/* ==========================================
   REVIEWDESK - COMPLETE STYLESHEET
   ========================================== */

/* GLOBAL */

:root {
    font-family: Inter, ui-sans-serif, system-ui,
        -apple-system, "Segoe UI", sans-serif;
    color: #17213a;
    background: #f6f8fc;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    max-width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid #9fc3ff;
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

/* ==========================================
   BRAND
   ========================================== */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: #17213a;
}

.brand-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    font-size: 20px;
}

/* ==========================================
   AUTHENTICATION
   ========================================== */

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 10% 10%,
            #e3e7ff,
            transparent 38%),
        #f7f8fc;
}

.auth-card {
    width: min(440px, 100%);
    padding: 36px;
    background: #fff;
    border: 1px solid #e7eaf2;
    border-radius: 20px;
    box-shadow: 0 24px 70px #26345a15;
}

.auth-card h1 {
    margin: 36px 0 8px;
    font-size: 30px;
    letter-spacing: -1px;
}

.muted,
.subhead {
    color: #7b8499;
    margin: 0 0 28px;
}

.auth-card label {
    display: block;
    margin: 18px 0;
    font-size: 13px;
    font-weight: 700;
}

.auth-card input {
    display: block;
    width: 100%;
    margin-top: 9px;
    padding: 13px;
    border: 1px solid #dfe4ed;
    border-radius: 10px;
    background: #fff;
}

.right {
    text-align: right;
    margin: -2px 0 22px;
}

.text-button {
    padding: 4px;
    border: 0;
    background: none;
    color: #5146da;
    font-weight: 650;
}

.primary,
.secondary,
.danger {
    padding: 11px 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
}

.primary {
    background: #5146df;
    color: #fff;
}

.primary:hover {
    background: #4338ca;
}

.secondary {
    background: #fff;
    border-color: #dfe3ec;
    color: #34405a;
}

.danger {
    background: #df354a;
    color: #fff;
}

.full {
    width: 100%;
}

.note {
    margin: 20px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: #9299a9;
}

/* ==========================================
   APPLICATION LAYOUT
   ========================================== */

.app,
#app.app {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

/* ==========================================
   SIDEBAR - DESKTOP
   ========================================== */

.sidebar,
#app .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    min-height: 0;
    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    padding: 24px 16px;
    background: #fff;
    border-right: 1px solid #e9edf3;

    overflow-y: auto;
    overflow-x: hidden;

    transition:
        width 0.25s ease,
        min-width 0.25s ease;
    z-index: 20;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0 0 22px;
    white-space: nowrap;
}

.side-label,
.eyebrow {
    font-size: 11px;
    letter-spacing: 1.4px;
    color: #99a1b2;
    font-weight: 800;
}

.side-label {
    margin: 22px 14px 16px;
}

/* Navigation */

.sidebar nav,
.sidebar .nav-links,
.sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
    margin: 0;
}

.sidebar .nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 12px 14px;

    border: 0;
    border-radius: 10px;
    background: transparent;

    color: #657089;
    text-align: left;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.sidebar .nav span {
    min-width: 0;
}

.sidebar .nav:hover {
    background: #f3f2ff;
    color: #5146e8;
}

.sidebar .nav.active {
    background: #eeedff;
    color: #4f46e5;
}

/* ==========================================
   SIDEBAR TOGGLE
   ========================================== */

.sidebar-toggle,
#sidebarToggle {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;

    margin: 0 0 18px;
    padding: 0;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    background: #f5f3ff;
    color: #5146e8;

    font-size: 21px;
    line-height: 1;
    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.sidebar-toggle:hover {
    background: #eae8ff;
    border-color: #c7c2ff;
}

/* ==========================================
   COLLAPSED DESKTOP SIDEBAR
   ========================================== */

@media (min-width: 769px) {

    #app .sidebar.collapsed {
        width: 76px;
        min-width: 76px;
        padding-left: 12px;
        padding-right: 12px;
    }

    #app .sidebar.collapsed .brand {
        justify-content: center;
        overflow: hidden;
    }

    #app .sidebar.collapsed .brand> :not(.brand-icon) {
        display: none;
    }

    #app .sidebar.collapsed .nav {
        justify-content: center;
        padding: 12px 8px;
        gap: 0;
    }

    #app .sidebar.collapsed .nav span {
        display: none;
    }

    #app .sidebar.collapsed .side-label,
    #app .sidebar.collapsed .sidebar-bottom {
        display: none;
    }

    #app .sidebar.collapsed #sidebarToggle {
        margin-left: auto;
        margin-right: auto;
    }
}

/* ==========================================
   SIDEBAR ACCOUNT FOOTER
   ========================================== */

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: auto;
    padding: 20px 5px 0;

    border-top: 1px solid #edf0f5;
}

.admin-avatar {
    display: grid;
    place-items: center;

    width: 35px;
    height: 35px;
    flex-shrink: 0;

    border-radius: 50%;
    background: #e8e5ff;
    color: #5449dd;
    font-weight: 800;
}

.sidebar-bottom strong {
    font-size: 12px;
}

.sidebar-bottom small {
    display: block;
    margin-top: 4px;
    color: #939cac;
    font-size: 11px;
}

.sidebar-bottom button {
    margin-left: auto;
    border: 0;
    background: none;
    color: #68758c;
    font-size: 23px;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main,
#app .main {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 36px 44px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 11px;
}

.topbar h1 {
    margin: 8px 0;
    font-size: 30px;
    letter-spacing: -1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    padding: 9px 15px;
    border: 1px solid #e0e4ef;
    border-radius: 9px;

    background: #fff;
    color: #4a526b;
    font-size: 13px;
    font-weight: 750;
}

.top-logout:hover {
    background: #f0efff;
    color: #4f46e5;
}

.demo-pill {
    padding: 8px 12px;
    border: 1px solid #e3dcaa;
    border-radius: 20px;
    background: #fffbea;
    color: #8c7322;
    font-size: 12px;
}

.subhead {
    margin-bottom: 30px;
    font-size: 14px;
}

.user-greeting {
    overflow-wrap: anywhere;
    line-height: 1.3;
}

/* ==========================================
   DASHBOARD STATISTICS
   ========================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 29px;
}

.stat,
.panel {
    min-width: 0;
    background: #fff;
    border: 1px solid #e7eaf1;
    border-radius: 13px;
    box-shadow: 0 3px 13px #22315506;
}

.stat {
    padding: 23px;
}

.stat span {
    display: block;
    font-size: 13px;
    color: #7a8498;
    font-weight: 600;
}

.stat strong {
    display: block;
    margin: 16px 0 8px;
    font-size: 35px;
    letter-spacing: -1px;
}

.stat em {
    font-size: 20px;
    color: #f6b43c;
    font-style: normal;
}

.stat small {
    font-size: 12px;
    color: #9ba3b2;
}

/* ==========================================
   PANELS
   ========================================== */

.panel {
    overflow: hidden;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 22px 25px;
}

.panel-heading h2 {
    margin: 0 0 5px;
    font-size: 17px;
}

.panel-heading p {
    margin: 0;
    font-size: 12px;
    color: #96a0b0;
}

.panel-heading input {
    min-width: 230px;
    padding: 11px 13px;
    border: 1px solid #dfe4ec;
    border-radius: 9px;
}

/* ==========================================
   REVIEW TABLES
   ========================================== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

th {
    padding: 15px 24px;
    background: #fafbfe;
    color: #9aa3b2;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

td {
    padding: 18px 24px;
    border-top: 1px solid #f0f1f6;
    color: #58637a;
    font-size: 13px;
}

td strong {
    color: #26314a;
}

td small {
    display: block;
    margin-top: 5px;
    color: #9da5b4;
}

.stars {
    color: #f3b332;
    letter-spacing: 2px;
    font-size: 16px;
}

.delete-btn {
    padding: 8px 12px;
    border: 1px solid #f9d9df;
    border-radius: 8px;
    background: #fff4f5;
    color: #cf354e;
    font-size: 12px;
    font-weight: 700;
}

.delete-btn:hover {
    background: #ffe8eb;
}

.empty {
    padding: 48px;
    text-align: center;
    color: #9aa3b2;
}

.count {
    padding: 3px 9px;
    border-radius: 20px;
    background: #f0edff;
    color: #574cda;
    font-size: 12px;
}

/* ==========================================
   REVIEW PHOTOS
   ========================================== */

.review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.photo-thumb {
    display: grid;
    place-items: center;

    width: 51px;
    height: 51px;
    flex-shrink: 0;

    padding: 0;
    overflow: hidden;

    border: 1px solid #dfe4ef;
    border-radius: 9px;
    background: #f4f5fa;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb:hover {
    outline: 2px solid #7067e8;
}

.no-photo {
    color: #a4adbd;
    font-size: 12px;
}

.photo-dialog {
    max-width: min(650px, calc(100% - 30px));
}

.photo-modal {
    position: relative;
    padding: 18px;
    text-align: center;
}

.photo-modal img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    background: #f6f8fc;
}

.photo-modal p {
    color: #6e7890;
    font-size: 13px;
}

.photo-close {
    position: absolute;
    top: 25px;
    right: 25px;

    width: 32px;
    height: 32px;

    border: 0;
    border-radius: 50%;
    background: #fff;

    box-shadow: 0 2px 10px #0002;
    font-weight: bold;
}

/* ==========================================
   DIALOGS
   ========================================== */

dialog {
    width: calc(100% - 30px);
    max-width: 420px;
    padding: 0;

    border: 0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 30px 100px #14213b45;
}

dialog::backdrop {
    background: #121c3590;
}

.dialog-content {
    padding: 30px;
}

.dialog-content h2 {
    font-size: 21px;
}

.dialog-content p {
    color: #7b8499;
    line-height: 1.6;
    font-size: 14px;
}

.warning {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;
    border-radius: 50%;

    background: #fff0f2;
    color: #df354a;
    font-size: 24px;
    font-weight: 800;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}

/* ==========================================
   ERROR POPUP
   ========================================== */

.message-dialog {
    position: fixed;
    inset: 0;
    margin: auto;

    width: min(90%, 400px);
    max-height: 90vh;
    padding: 0;

    border: none;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.message-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.message-modal {
    padding: 35px 30px;
    text-align: center;
}

.message-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 65px;
    height: 65px;
    margin: 0 auto 20px;

    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;

    font-size: 30px;
    font-weight: bold;
}

.message-modal h2 {
    margin: 0 0 12px;
    color: #17233d;
    font-size: 24px;
}

.message-modal p {
    margin-bottom: 25px;
    color: #64748b;
    line-height: 1.6;
}

.message-modal button {
    cursor: pointer;
}

/* ==========================================
   SUCCESS NOTIFICATION
   ========================================== */

.toast {
    position: fixed;
    top: 25px;
    right: 25px;
    bottom: auto;
    left: auto;

    display: block;
    z-index: 9999;

    padding: 14px 22px;
    border: 1px solid #86efac;
    border-radius: 12px;

    background: #dcfce7;
    color: #166534;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    font-weight: 600;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;

    pointer-events: none;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================
   API SETTINGS
   ========================================== */

.api-settings-view {
    width: 100%;
    min-width: 0;
}

.api-settings-panel {
    width: 100%;
    max-width: 760px;
    padding: 28px;

    background: #fff;
    border: 1px solid #e5eaf3;
    border-radius: 16px;
}

.api-settings-heading h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #17233d;
}

.api-settings-heading p {
    margin: 0 0 26px;
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
}

.api-settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-settings-form label,
.api-key-result label {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.api-settings-form input,
.api-key-field input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;

    border: 1px solid #dce3ee;
    border-radius: 9px;

    background: #fff;
    font: inherit;
    font-size: 14px;
}

.api-settings-form input:focus,
.api-key-field input:focus {
    border-color: #635bff;
}

.api-primary-btn {
    align-self: flex-start;
    margin-top: 8px;
    padding: 12px 20px;

    border: 0;
    border-radius: 9px;

    background: #635bff;
    color: #fff;

    font-size: 14px;
    font-weight: 600;
}

.api-primary-btn:hover {
    background: #5146e8;
}

.api-primary-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.api-key-result {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e5eaf3;
}

.api-key-result h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.api-key-result label {
    margin: 18px 0 8px;
}

.api-key-warning {
    color: #a16207;
    font-size: 13px;
    line-height: 1.6;
}

.api-key-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-key-field input {
    flex: 1;
}

.api-key-field button {
    padding: 11px 14px;
    border: 1px solid #dce3ee;
    border-radius: 9px;

    background: #f8fafc;
    color: #334155;

    font-size: 13px;
    font-weight: 600;
}

.api-key-field button:hover {
    background: #eeedff;
    color: #5146e8;
}

/* ==========================================
   FOOTER
   ========================================== */

footer {
    margin-top: 30px;
    color: #a5adbb;
    font-size: 12px;
}

/* ==========================================
   TABLET - 1000px
   ========================================== */

@media (max-width: 1000px) {

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #app .main {
        padding: 28px;
    }

    .user-greeting {
        font-size: 24px;
    }
}

/* ==========================================
   MOBILE NAVIGATION - 768px
   ========================================== */

@media (max-width: 768px) {

    #app.app {
        display: block;
        width: 100%;
    }

    /* Sidebar becomes compact mobile header */

    #app .sidebar,
    #app .sidebar.collapsed {
        position: relative;
        top: auto;
        left: auto;

        display: grid;
        grid-template-columns: minmax(0, 1fr) 40px;
        align-items: center;
        column-gap: 12px;
        row-gap: 0;

        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;

        margin: 0;
        padding: 14px 16px;

        border-right: 0;
        border-bottom: 1px solid #e8ebf3;

        overflow: visible;
        background: #fff;
    }

    /* Logo remains visible */

    #app .sidebar .brand,
    #app .sidebar.collapsed .brand {
        grid-column: 1;
        grid-row: 1;

        display: flex;
        align-items: center;
        justify-content: flex-start;

        width: auto;
        min-width: 0;

        margin: 0;
        padding: 0;

        overflow: visible;
    }

    #app .sidebar .brand>*,
    #app .sidebar.collapsed .brand>* {
        display: initial;
    }

    #app .sidebar .brand .brand-icon,
    #app .sidebar.collapsed .brand .brand-icon {
        display: grid;
        flex-shrink: 0;
    }

    /* Hamburger button on right */

    #sidebarToggle {
        grid-column: 2;
        grid-row: 1;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 40px;
        height: 40px;

        margin: 0;
        padding: 0;
    }

    /* Expanded dropdown */

    #app .sidebar nav,
    #app .sidebar .nav-links,
    #app .sidebar .sidebar-nav {
        grid-column: 1 / -1;
        grid-row: 2;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;
        gap: 6px;

        margin: 14px 0 0;
        padding: 12px 0 0;

        border-top: 1px solid #eef0f6;
    }

    /* Closed dropdown */

    #app .sidebar.collapsed nav,
    #app .sidebar.collapsed .nav-links,
    #app .sidebar.collapsed .sidebar-nav {
        display: none;
    }

    /* Navigation buttons */

    #app .sidebar .nav,
    #app .sidebar.collapsed .nav {
        display: flex;
        align-items: center;
        justify-content: flex-start;

        width: 100%;
        min-height: 44px;

        padding: 12px 14px;
        margin: 0;

        text-align: left;
    }

    #app .sidebar .nav span,
    #app .sidebar.collapsed .nav span {
        display: inline;
    }

    #app .sidebar .side-label,
    #app .sidebar .sidebar-bottom {
        display: none;
    }

    /* Dashboard immediately below header */

    #app .main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        padding: 22px 16px;
    }

    .topbar h1 {
        font-size: 26px;
    }

    .panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-heading input {
        width: 100%;
        min-width: 0;
    }

    .table-wrap {
        max-width: 100%;
    }

    .table-wrap table {
        width: max-content;
        min-width: 700px;
    }

    dialog {
        max-width: calc(100vw - 32px);
    }
}

/* ==========================================
   MOBILE REVIEW CARDS - 600px
   ========================================== */

@media (max-width: 600px) {

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat {
        padding: 16px;
    }

    .stat strong {
        font-size: 28px;
    }

    .table-wrap {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        overflow-x: visible;
    }

    .table-wrap table,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .table-wrap table {
        border-collapse: separate;
    }

    .table-wrap thead {
        display: none;
    }

    /* Review card */

    .table-wrap tbody tr {
        padding: 14px;
        margin-bottom: 12px;

        background: #fff;
        border: 1px solid #e5eaf3;
        border-radius: 12px;

        box-shadow: 0 2px 8px rgba(20, 35, 70, 0.03);
    }

    .table-wrap tbody tr:last-child {
        margin-bottom: 0;
    }

    /* Review detail rows */

    .table-wrap tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;

        padding: 10px 0;
        border: 0;

        text-align: right;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Column labels */

    .table-wrap tbody td::before {
        flex: 0 0 75px;
        font-size: 10px;
        font-weight: 700;
        color: #8792a8;
        letter-spacing: 0.5px;
        text-align: left;
    }

    .table-wrap tbody td:nth-child(1)::before {
        content: "CUSTOMER";
    }

    .table-wrap tbody td:nth-child(2)::before {
        content: "PRODUCT";
    }

    .table-wrap tbody td:nth-child(3)::before {
        content: "RATING";
    }

    .table-wrap tbody td:nth-child(4)::before {
        content: "REVIEW";
    }

    .table-wrap tbody td:nth-child(5)::before {
        content: "PHOTOS";
    }

    .table-wrap tbody td:nth-child(6)::before {
        content: "DATE";
    }

    .table-wrap tbody td:nth-child(7)::before {
        content: "ACTION";
    }

    .table-wrap tbody td strong {
        font-size: 12px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .table-wrap tbody td small {
        font-size: 10px;
        color: #8a96ab;
        overflow-wrap: anywhere;
    }

    .table-wrap tbody td.stars {
        color: #e6a23c;
        font-size: 16px;
    }

    .table-wrap tbody td:nth-child(4) {
        font-size: 12px;
        line-height: 1.6;
    }

    .review-photos {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
    }

    .photo-thumb {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .table-wrap tbody td:last-child {
        align-items: center;
        margin-top: 8px;
        padding-top: 14px;
        border-top: 1px solid #edf0f5;
    }

    .delete-btn {
        max-width: 100%;
        white-space: nowrap;
    }

    .table-wrap tbody td>* {
        min-width: 0;
        max-width: 100%;
    }

    /* API Settings */

    .api-settings-panel {
        padding: 18px;
    }

    .api-key-field {
        flex-wrap: wrap;
    }

    .api-key-field input {
        flex-basis: 100%;
    }

    .api-primary-btn {
        width: 100%;
    }
}

/* ==========================================
   SMALL MOBILE - 480px
   ========================================== */

@media (max-width: 480px) {

    #app .main {
        padding: 20px 15px;
    }

    .user-greeting {
        font-size: 21px;
        line-height: 1.35;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat {
        padding: 14px;
    }

    .stat strong {
        font-size: 27px;
    }

    .table-wrap {
        padding: 8px;
    }

    .table-wrap tbody tr {
        padding: 12px;
        border-radius: 10px;
    }

    .table-wrap tbody td {
        gap: 8px;
        padding: 9px 0;
    }

    .table-wrap tbody td::before {
        flex-basis: 65px;
        font-size: 9px;
    }

    .demo-pill {
        font-size: 10px;
    }

    .header-actions {
        gap: 8px;
    }

    .top-logout {
        padding: 9px 12px;
    }

    button {
        max-width: 100%;
    }
}

/* ==========================================
   EXTRA SMALL MOBILE - 360px
   ========================================== */

@media (max-width: 360px) {

    .user-greeting {
        font-size: 19px;
    }

    .stat {
        padding: 12px;
    }

    .stat strong {
        font-size: 25px;
    }

    .table-wrap {
        padding: 6px;
    }

    .table-wrap tbody tr {
        padding: 10px;
    }

    .table-wrap tbody td::before {
        flex-basis: 58px;
    }

    .table-wrap tbody td strong {
        font-size: 11px;
    }

    .table-wrap tbody td small {
        font-size: 9px;
    }
}

/* ==========================================
   ACCESSIBILITY / MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .sidebar,
    .sidebar-toggle,
    .nav,
    .toast {
        transition: none;
    }
}

/* Always respect HTML hidden attributes */

[hidden] {
    display: none !important;
}