/*
  Developed by Rameez Scripts
  WhatsApp: https://whatsapp.rameezscripts.com/ (For Custom Projects)
  YouTube: https://www.youtube.com/@rameezimdad (Subscribe for more!)
*/

/* ===== Color Scheme - Light Theme (Default) ===== */
:root {
    --navy-primary: #001f3f;
    --navy-dark: #001529;
    --navy-light: #003366;
    --navy-accent: #0074D9;
    --navy-hover: #002a52;

    /* rgb triplets — fallbacks; config.php overwrites these per user theme */
    --navy-primary-rgb: 0, 31, 63;
    --navy-light-rgb: 0, 51, 102;
    --navy-accent-rgb: 0, 116, 217;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;

    /* Light Theme Colors */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
    --table-hover: #f9f9f9;
    --skeleton-base: #f0f0f0;
    --skeleton-shine: #e0e0e0;
}

/* ===== Dark Theme ===== */
body.dark-mode {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1e1e3f;
    --text-primary: #e8eaf6;
    --text-secondary: #b0b3c5;
    --text-muted: #8a8d9f;
    --border-color: #2d2d5a;
    --border-light: #252550;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --input-bg: #252550;
    --input-border: #3d3d7a;
    --table-hover: #252550;
    --skeleton-base: #252550;
    --skeleton-shine: #2d2d5a;

    --navy-primary: #0a1628;
    --navy-dark: #060d16;
    --navy-light: #1a3a5c;
    --navy-primary-rgb: 10, 22, 40;
    --navy-light-rgb: 26, 58, 92;
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input, select, textarea {
    font-size: 16px !important;
    touch-action: manipulation;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: 100vh;
}

/* ===== Sidebar ===== */
/* light panel: brand / quick search / counts / menu / AI card / preferences / account.
   desktop folds to an icon rail, phones get it as a drawer */
:root {
    --sb-w: 260px;
    --sb-mini: 64px;
    --sb-r: 4px;
}

.sidebar {
    --sb-bg: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary));
    --sb-hover: rgba(var(--navy-accent-rgb), 0.07);
    width: var(--sb-w);
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 950; /* rail tooltips + account menu paint over the page */
    background: var(--sb-bg);
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 15px;
    transition: width 0.25s ease, background-color 0.3s ease;
}

.sb-brand,
.sb-search,
.sb-bottom,
.sb-user { flex-shrink: 0; }
.sb-brand,
.sb-search { border-bottom: 1px solid var(--border-color); }
.sb-bottom,
.sb-user { border-top: 1px solid var(--border-color); }
.sb-off { display: none !important; }

/* brand row */
.sb-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 60px;
    padding: 0 12px 0 18px;
}
.sb-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.sb-name {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-icon-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: var(--sb-r);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, opacity 0.15s;
}
.sb-icon-btn:hover {
    background: var(--sb-hover);
    color: var(--text-primary);
}

/* quick search */
.sb-search { padding: 8px; }
.sb-find {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--sb-r);
    cursor: text;
    transition: background-color 0.2s;
}
.sb-find:hover,
.sb-find:focus-within { background: var(--sb-hover); }
.sb-find i {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
}
.sidebar .sb-find input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 500;
}
.sb-find input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}
.sb-find input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* 16px stays on touch screens (stops iOS zoom); mouse users get the row size */
@media (hover: hover) and (pointer: fine) {
    .sb-find input { font-size: 15px !important; }
}

/* scrolling middle */
.sb-scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}
.sb-sec { padding: 8px; }
.sb-sec + .sb-sec { border-top: 1px solid var(--border-color); }
.sb-bottom { padding: 8px; }

.sb-head {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px 6px;
    background: none;
    border: 0;
    border-radius: var(--sb-r);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: left;
}
button.sb-head {
    margin-top: 6px;
    cursor: pointer;
    transition: color 0.2s;
}
button.sb-head:hover { color: var(--text-primary); }
.submenu-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.25s ease;
}
.submenu-toggle.open .submenu-arrow { transform: rotate(45deg); } /* + becomes x */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sidebar-submenu.open,
.sidebar.sb-filtering .sidebar-submenu { max-height: 640px; }

/* rows */
.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-menu li { position: relative; }
.sidebar-menu li + li { margin-top: 2px; }
.sidebar-menu a,
.sidebar-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--sb-r);
    color: inherit;
    font: inherit;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.sidebar-menu a > i:first-child,
.sidebar-menu button > i:first-child {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
    transition: color 0.2s;
}
.sidebar-menu a span,
.sidebar-menu button span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-menu li[data-pill] > a,
.sidebar-menu li[data-pill] > button { padding-right: 48px; }
.sidebar-menu a:hover,
.sidebar-menu button:hover {
    background: var(--sb-hover);
    color: var(--text-primary);
}
.sidebar-menu a:hover > i:first-child,
.sidebar-menu button:hover > i:first-child { color: var(--text-primary); }
.sidebar-menu a.active {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-color);
    color: var(--text-primary);
    font-weight: 600;
}
.sidebar-menu a.active > i:first-child { color: var(--navy-accent); }

.sidebar a:focus-visible,
.sidebar button:focus-visible,
.sb-find:focus-within {
    outline: 2px solid rgba(var(--navy-accent-rgb), 0.55);
    outline-offset: -2px;
}

/* waiting counts — plain number, collapsed rail turns it into a dot */
.nav-pill {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* dark mode row switch (state only — the row is the control) */
.sb-switch {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 18px;
    border-radius: 9px;
    background: var(--input-border);
    transition: background-color 0.2s;
}
.sb-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: 0 1px 2px var(--shadow-hover);
    transition: transform 0.2s;
}
[aria-checked="true"] > .sb-switch { background: var(--navy-accent); }
[aria-checked="true"] > .sb-switch::after { transform: translateX(12px); }

.sb-nohit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-muted);
}

/* account footer */
.sb-user {
    position: relative;
    padding: 8px;
}
.sb-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 0;
    border-radius: var(--sb-r);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}
.sb-user-btn:hover,
.sb-user-btn[aria-expanded="true"] { background: var(--sb-hover); }
.sb-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}
.sb-user-txt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.sb-user-txt strong,
.sb-user-txt small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-user-txt strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.sb-user-txt small {
    font-size: 12.5px;
    color: var(--text-muted);
}
.sb-caret {
    font-size: 12px;
    color: var(--text-muted);
}
.sb-user-menu {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% - 2px);
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--sb-r);
    box-shadow: 0 10px 28px var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0s 0.15s;
}
.sb-user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}
.sb-user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--sb-r);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.sb-user-menu a i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}
.sb-user-menu a:hover {
    background: var(--sb-hover);
    color: var(--text-primary);
}
.sb-user-menu a.danger,
.sb-user-menu a.danger i { color: var(--danger); }
.sb-user-menu a.danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }

/* rail tooltip (lives on <body>) */
.sb-tip {
    position: fixed;
    z-index: 1100;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: var(--sb-r);
    background: var(--text-primary);
    color: var(--bg-card);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
}
.sb-tip.on { opacity: 1; }

/* impersonation notice sits under the brand row */
.sidebar .impersonate-notice { flex-shrink: 0; margin: 8px; }

/* icon rail — desktop only, phones always get the full drawer */
@media (min-width: 769px) {
    /* attached panel: flush to the left edge, full height top to bottom */
    .sidebar {
        height: 100vh;
        height: 100dvh;
        margin: 0;
        border: 0;
        border-right: 1px solid var(--border-color);
        border-radius: 0;
        box-shadow: none;
    }
    .sb-x { display: none; }
    .sidebar.collapsed { width: var(--sb-mini); }
    .sidebar.collapsed .sb-name,
    .sidebar.collapsed .sb-find input,
    .sidebar.collapsed div.sb-head,
    .sidebar.collapsed .sidebar-menu span,
    .sidebar.collapsed .sb-switch,
    .sidebar.collapsed .sb-user-txt,
    .sidebar.collapsed .sb-caret,
    .sidebar.collapsed .impersonate-text { display: none; }

    /* logo swaps to the expand button on hover */
    .sidebar.collapsed .sb-brand {
        justify-content: center;
        padding: 0;
    }
    .sidebar.collapsed .sb-brand .sb-icon-btn {
        position: absolute;
        inset: 0;
        margin: auto;
        opacity: 0;
    }
    .sidebar.collapsed .sb-brand:hover .sb-icon-btn,
    .sidebar.collapsed .sb-brand .sb-icon-btn:focus-visible { opacity: 1; }
    .sidebar.collapsed .sb-brand:hover .sb-logo { opacity: 0; }

    .sidebar.collapsed .sb-find,
    .sidebar.collapsed .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu button {
        width: 40px;
        margin: 0 auto;
        padding: 0;
        gap: 0;
        justify-content: center;
    }
    .sidebar.collapsed .sb-find { cursor: pointer; }
    .sidebar.collapsed .sidebar-menu a > i:first-child,
    .sidebar.collapsed .sidebar-menu button > i:first-child { font-size: 16px; }
    .sidebar.collapsed .sb-sec,
    .sidebar.collapsed .sb-bottom { padding: 8px 0; }

    /* group header becomes a thin divider, its links stay reachable */
    .sidebar.collapsed button.sb-head {
        height: 1px;
        margin: 8px 14px;
        padding: 0;
        background: var(--border-color);
        font-size: 0;
        pointer-events: none;
    }
    .sidebar.collapsed button.sb-head i { display: none; }
    .sidebar.collapsed .sidebar-submenu { max-height: none; }

    .sidebar.collapsed .nav-pill {
        top: 7px;
        right: 13px;
        transform: none;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--danger);
        font-size: 0;
    }

    .sidebar.collapsed .sb-user-btn {
        justify-content: center;
        padding: 6px 0;
    }
    .sidebar.collapsed .sb-user-menu {
        left: calc(100% + 6px);
        right: auto;
        bottom: 8px;
        width: 200px;
    }
    .sidebar.collapsed .impersonate-notice {
        justify-content: center;
        padding: 8px 0;
    }
}

/* drawer overlay (phones) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* phones: off-canvas drawer, above the bottom bar so the account row stays reachable */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1002;
        width: min(300px, 86vw);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0s 0.28s;
    }
    .sidebar.mobile-open {
        transform: none;
        visibility: visible;
        transition-delay: 0s;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }
    .sidebar-menu a,
    .sidebar-menu button { height: 44px; }
    .sb-brand .sb-icon-btn .fa-table-columns { display: none; }
}

/* dark mode — the global span/div colour rule outranks plain classes */
body.dark-mode .sidebar div.sb-head { color: var(--text-muted) !important; }
body.dark-mode .sidebar-menu a.active span,
body.dark-mode .sidebar-menu a:hover span,
body.dark-mode .sidebar-menu button:hover span { color: var(--text-primary) !important; }
body.dark-mode .sb-switch::after { background: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar *,
    .sb-tip { transition: none !important; }
}

/* ===== Mobile Bottom Navigation Bar ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--navy-primary);
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    justify-content: space-around;
    align-items: center;
    padding: 0 5px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 60px;
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.mobile-nav-item span {
    white-space: nowrap;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: white;
    background: rgba(255,255,255,0.1);
}

.mobile-nav-item.active {
    color: white;
    background: var(--navy-accent);
    box-shadow: 0 2px 8px rgba(0,116,217,0.4);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-more {
    color: rgba(255,255,255,0.9);
}

/* Mobile layout */
@media (max-width: 768px) {
    /* Show bottom navigation */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Add padding to main content for bottom nav */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 80px;
    }

    .app-container {
        flex-direction: column;
    }

    /* Adjust header for mobile */
    .header {
        padding: 15px;
    }

    .header h1 {
        font-size: 18px;
    }

    /* Data section padding adjustment */
    .data-section {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .section-header > div {
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .section-header .btn {
        flex: 1;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .mobile-nav-item {
        padding: 8px 8px;
        min-width: 50px;
    }

    .mobile-nav-item i {
        font-size: 18px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }
}

/* Dark mode for mobile navigation */
body.dark-mode .mobile-bottom-nav {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

body.dark-mode .mobile-nav-item {
    color: var(--text-muted);
}

body.dark-mode .mobile-nav-item:hover,
body.dark-mode .mobile-nav-item:focus {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

body.dark-mode .mobile-nav-item.active {
    color: white;
    background: var(--navy-accent);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
    transition: background-color 0.3s ease, margin-left 0.3s ease;
}

.header {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 3px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header h1 {
    font-size: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-section {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 3px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Skeleton Loaders ===== */
.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 3px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-table {
    width: 100%;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.skeleton-table-row {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.skeleton-table-cell {
    height: 20px;
    border-radius: 3px;
}

.skeleton-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--navy-primary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
    border-radius: 3px;
}

.skeleton-text-large {
    height: 32px;
    margin-bottom: 8px;
    border-radius: 3px;
}

.skeleton-chart {
    width: 100%;
    height: 300px;
    border-radius: 3px;
}

/* ===== Dashboard Stats ===== */
.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--navy-primary);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--shadow-hover);
}

.stat-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy-accent);
    margin-bottom: 8px;
}

body.dark-mode .stat-card-value {
    color: #5dade2;
}

.stat-card-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

/* ===== Charts ===== */
.chart-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.chart-card h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--navy-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--navy-hover);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #2d8e47;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c8392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ===== DataTables ===== */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    background: var(--bg-card);
}

table.dataTable thead th {
    background: var(--navy-primary) !important;
    color: white !important;
    padding: 14px !important;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

table.dataTable tbody td {
    padding: 12px 14px !important;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

table.dataTable tbody tr:hover {
    background: rgba(var(--navy-accent-rgb), 0.05) !important;
}

body.dark-mode table.dataTable thead th {
    background: var(--navy-light) !important;
}

body.dark-mode .dataTables_wrapper .dataTables_length,
body.dark-mode .dataTables_wrapper .dataTables_filter,
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary) !important;
}

body.dark-mode .dataTables_wrapper .dataTables_filter input,
body.dark-mode .dataTables_wrapper .dataTables_length select {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--navy-accent) !important;
    color: white !important;
    border-color: var(--navy-accent) !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--navy-light) !important;
    color: white !important;
}

.dt-buttons {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dt-button {
    background: var(--navy-primary) !important;
    color: white !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    margin-right: 0 !important;
    cursor: pointer !important;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dt-button:hover {
    background: var(--navy-hover) !important;
}

/* DataTable wrapper for mobile scroll */
.dataTables_wrapper {
    position: relative;
}

.dataTables_scroll,
.dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* DataTable responsive hint for mobile */
.table-scroll-hint {
    display: none;
    text-align: center;
    padding: 10px;
    background: rgba(0, 116, 217, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--navy-accent);
}

.table-scroll-hint i {
    margin-right: 6px;
}

@media (max-width: 768px) {
    .table-scroll-hint {
        display: block;
    }
}

/* ===== Action Icons ===== */
.action-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    margin: 0 4px;
    border-radius: 2px;
    transition: all 0.3s;
}

.action-icon.edit-icon {
    color: var(--warning);
}

.action-icon.edit-icon:hover {
    background: rgba(251,188,4,0.1);
    transform: scale(1.15);
}

.action-icon.delete-icon {
    color: var(--danger);
}

.action-icon.delete-icon:hover {
    background: rgba(234,67,53,0.1);
    transform: scale(1.15);
}

.action-icon.view-icon {
    color: var(--navy-accent);
}

.action-icon.view-icon:hover {
    background: rgba(0,116,217,0.1);
    transform: scale(1.15);
}

/* ===== Status Badges ===== */
.status-badge {
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-admin {
    background: #d4edda;
    color: #155724;
}

.status-user {
    background: #cce5ff;
    color: #004085;
}

.status-current {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 11px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--navy-accent);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--input-border);
    border-radius: 2px;
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 2px rgba(0,116,217,0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.error {
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--danger);
    font-size: 14px;
    background: #fef2f2;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #fecaca;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

body.dark-mode .modal-overlay {
    background: rgba(0,0,0,0.8);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: 4px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px var(--shadow-hover);
    transition: background-color 0.3s ease;
}

.modal-header {
    padding: 24px 30px;
    background: var(--navy-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px 4px 0 0;
}

body.dark-mode .modal-header {
    background: var(--navy-light);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: var(--text-primary);
}

/* ===== Filters Section ===== */
.filters-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 25px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--navy-accent);
}

.filters-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--input-border);
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
}

.filter-input:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 3px rgba(0,116,217,0.15);
}

/* ===== Account Info Card ===== */
.account-info-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border-left: 4px solid var(--navy-accent);
    margin-bottom: 30px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.account-info-card h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-value {
    color: var(--text-primary);
    flex: 1;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-3,
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
    }

    .filters-section {
        padding: 15px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filters-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .filters-header .btn-sm {
        width: 100%;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    .info-label {
        width: 100%;
    }

    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ===== Login Page Specific ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 3px solid var(--navy-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.login-box h2 {
    margin-bottom: 35px;
    color: var(--navy-primary);
    font-size: 26px;
    font-weight: 600;
}

.login-footer {
    margin-top: 24px;
    font-size: 13px;
    color: #666;
}

@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
}

/* ===== Settings Page - 2x2 Grid Layout ===== */

/* Main Grid */
.settings-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

/* Mega Cards */
.settings-mega-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.settings-mega-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--navy-accent);
}

/* Card Header */
.settings-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 24px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-primary);
    margin: 0 0 4px 0;
}

.settings-card-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Card Body */
.settings-card-body {
    padding: 24px;
}

/* Stat Items (inline) */
.stat-item-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.stat-item-inline:last-child {
    margin-bottom: 0;
}

.stat-item-inline:hover {
    background: #fff;
    border-color: var(--navy-accent);
    box-shadow: 0 2px 8px rgba(0, 116, 217, 0.1);
}

.stat-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-item-content {
    flex: 1;
}

.stat-item-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item-value {
    font-size: 16px;
    color: var(--navy-primary);
    font-weight: 700;
}

/* Control Group */
.control-group {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.control-group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.control-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 31, 63, 0.2);
}

.control-info {
    flex: 1;
}

.control-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 4px;
}

.control-desc {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.control-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

/* Large Toggle Switch */
.toggle-switch-large {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.toggle-input-large {
    display: none;
}

.toggle-label-large {
    display: block;
    width: 80px;
    height: 40px;
    background: #ccc;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider-large {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-input-large:checked + .toggle-label-large {
    background: var(--success);
}

.toggle-input-large:checked + .toggle-label-large .toggle-slider-large {
    transform: translateX(40px);
}

.toggle-label-large:hover {
    opacity: 0.9;
}

/* Toggle Status */
.toggle-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-enabled {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.2);
}

.status-disabled {
    background: #ccc;
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(52, 168, 83, 0.1);
    }
}

.status-text {
    font-size: 14px;
    font-weight: 600;
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 116, 217, 0.05);
    border: 1px solid rgba(0, 116, 217, 0.2);
    border-left: 4px solid var(--navy-accent);
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.info-banner i {
    color: var(--navy-accent);
    font-size: 18px;
    flex-shrink: 0;
}

/* Security Features */
.security-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.security-feature:last-child {
    margin-bottom: 0;
}

.security-feature:hover {
    background: white;
    border-color: var(--success);
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.1);
}

.security-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--success) 0%, #2d9148 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.2);
}

.security-feature-content {
    flex: 1;
}

.security-feature-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 4px;
}

.security-feature-desc {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.security-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.security-feature-badge.active {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
    border: 2px solid rgba(52, 168, 83, 0.3);
}

/* Server Info Items */
.server-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f3f5;
}

.server-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.server-info-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.server-info-label i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy-accent);
    font-size: 16px;
}

.server-info-value {
    font-size: 14px;
    color: var(--navy-primary);
    font-weight: 700;
}

.version-badge,
.upload-badge {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 31, 63, 0.2);
}

.upload-badge {
    background: linear-gradient(135deg, var(--success) 0%, #2d9148 100%);
}

.time-value {
    font-family: 'Courier New', monospace;
    background: rgba(0, 116, 217, 0.05);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--navy-accent);
    font-size: 13px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 32px;
    background: #ccc;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background: var(--success);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(28px);
}

.toggle-label:hover {
    opacity: 0.9;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 24px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.3s;
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--navy-accent);
}

.info-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-value {
    font-size: 18px;
    color: var(--navy-primary);
    font-weight: 700;
}

/* Dashboard Grid 4 */
.dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Security Cards */
.security-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.security-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 16px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.security-card:hover {
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.15);
    transform: translateY(-2px);
}

.security-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.security-card-content {
    flex: 1;
}

.security-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-primary);
    margin-bottom: 6px;
}

.security-card-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.security-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(52, 168, 83, 0.2);
}

/* Info Table */
.info-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.info-table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.3s;
}

.info-table-row:last-child {
    border-bottom: none;
}

.info-table-row:hover {
    background: #f8f9fa;
}

.info-table-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-table-label i {
    color: var(--navy-accent);
    width: 20px;
    text-align: center;
}

.info-table-value {
    font-size: 14px;
    color: var(--navy-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: rgba(0, 31, 63, 0.05);
    padding: 6px 12px;
    border-radius: 4px;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .settings-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .settings-card-header {
        padding: 20px;
    }

    .settings-card-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .settings-card-title {
        font-size: 18px;
    }

    .settings-card-body {
        padding: 20px;
    }

    .control-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .control-toggle-wrapper {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .toggle-status {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .setting-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-switch {
        align-self: flex-start;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }

    .security-info-grid {
        grid-template-columns: 1fr;
    }

    .info-table-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .info-table-value {
        width: 100%;
        text-align: left;
    }

    .server-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .server-info-value {
        width: 100%;
    }
}

/* ===== Setup Page Styles ===== */
.setup-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
}

.setup-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.setup-container h2 {
    color: var(--navy-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setup-container .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.setup-container hr {
    border: none;
    border-top: 2px solid var(--navy-primary);
    margin-bottom: 30px;
}

.log-item {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-success {
    background: #d4edda;
    border-left-color: var(--success);
    color: #155724;
}

.log-error {
    background: #f8d7da;
    border-left-color: var(--danger);
    color: #721c24;
}

.log-info {
    background: #d1ecf1;
    border-left-color: var(--navy-accent);
    color: #0c5460;
}

.credentials-box {
    background: #fff3cd;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    border-left: 4px solid #ffc107;
}

.credentials-box strong {
    color: var(--navy-primary);
}

/* ===== Google Translate Widget ===== */
/* Hide Google Translate top bar */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}

/* Dark mode specific overrides */
body.dark-mode .login-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

body.dark-mode .login-box {
    background: var(--bg-card);
    box-shadow: 0 4px 20px var(--shadow-hover);
}

body.dark-mode .login-box h2 {
    color: var(--text-primary);
}

/* Login Page Theme Toggle */
.login-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

.login-theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

body.dark-mode .login-theme-toggle {
    background: var(--bg-card);
    border-color: var(--navy-accent);
    color: #ffd700;
}

body.dark-mode .setup-wrapper {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

body.dark-mode .setup-container {
    background: var(--bg-card);
    box-shadow: 0 4px 20px var(--shadow-hover);
}

body.dark-mode .setup-container h2 {
    color: var(--text-primary);
}

body.dark-mode .setup-container .subtitle {
    color: var(--text-muted);
}

body.dark-mode .setup-container hr {
    border-top-color: var(--border-color);
}

body.dark-mode .log-item {
    border-left-width: 4px;
}

body.dark-mode .log-success {
    background: rgba(52, 168, 83, 0.15);
    color: #6fcf97;
}

body.dark-mode .log-error {
    background: rgba(234, 67, 53, 0.15);
    color: #f5857a;
}

body.dark-mode .log-info {
    background: rgba(0, 116, 217, 0.15);
    color: #5dade2;
}

body.dark-mode .credentials-box {
    background: rgba(251, 188, 4, 0.1);
    border-color: rgba(251, 188, 4, 0.4);
    color: var(--text-secondary);
}

body.dark-mode .credentials-box strong {
    color: var(--text-primary);
}

/* Settings Page Dark Mode */
body.dark-mode .settings-mega-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .settings-card-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom-color: var(--border-color);
}

body.dark-mode .settings-card-title {
    color: var(--text-primary);
}

body.dark-mode .settings-card-subtitle {
    color: var(--text-muted);
}

body.dark-mode .stat-item-inline {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .stat-item-label {
    color: var(--text-muted);
}

body.dark-mode .stat-item-value {
    color: var(--text-primary);
}

body.dark-mode .control-group {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-color: var(--border-color);
}

body.dark-mode .control-title {
    color: var(--text-primary);
}

body.dark-mode .control-desc {
    color: var(--text-muted);
}

body.dark-mode .control-toggle-wrapper {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .info-banner {
    background: rgba(0, 116, 217, 0.1);
    border-color: rgba(0, 116, 217, 0.3);
    color: var(--text-secondary);
}

body.dark-mode .security-feature {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .security-feature-name {
    color: var(--text-primary);
}

body.dark-mode .security-feature-desc {
    color: var(--text-muted);
}

body.dark-mode .server-info-item {
    border-bottom-color: var(--border-light);
}

body.dark-mode .server-info-label {
    color: var(--text-muted);
}

body.dark-mode .server-info-value {
    color: var(--text-primary);
}

body.dark-mode .time-value {
    background: rgba(0, 116, 217, 0.1);
    color: var(--navy-accent);
}

/* Dashboard Page Dark Mode */
body.dark-mode .data-section p {
    color: var(--text-secondary);
}

body.dark-mode .data-section strong {
    color: var(--text-primary);
}

/* Logs Page Dark Mode - Empty Details */
body.dark-mode em.text-muted,
body.dark-mode .text-muted em {
    color: var(--text-muted) !important;
}

/* Version/Upload Badges in Dark Mode */
body.dark-mode .version-badge,
body.dark-mode .upload-badge {
    color: white !important;
}

/* Ensure form inputs text is visible in dark mode */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-muted);
}

/* Filter labels in dark mode */
body.dark-mode .filter-group label {
    color: var(--text-secondary);
}

/* Settings page stat items dark mode */
body.dark-mode .stat-item-inline:hover {
    background: var(--bg-card);
    border-color: var(--navy-accent);
}

body.dark-mode .security-feature:hover {
    background: var(--bg-card);
    border-color: var(--success);
}

/* ===== UI Customization / Theme Section ===== */
.theme-preview {
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

body.dark-mode .theme-preview {
    background: var(--bg-card);
    border-color: var(--border-color) !important;
}

.theme-preview h4 {
    color: var(--text-primary);
}

/* Color picker styling */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Preset buttons */
.preset-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.preset-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Theme mode options */
.theme-mode-option {
    transition: all 0.3s ease;
}

.theme-mode-option:hover {
    border-color: var(--navy-accent) !important;
    background: var(--bg-secondary);
}

.theme-mode-option:has(input:checked) {
    border-color: var(--navy-accent) !important;
    background: rgba(0, 116, 217, 0.1);
}

body.dark-mode .theme-mode-option {
    border-color: var(--border-color) !important;
}

body.dark-mode .theme-mode-option:hover {
    border-color: var(--navy-accent) !important;
    background: var(--bg-secondary);
}

body.dark-mode .theme-mode-option:has(input:checked) {
    border-color: var(--navy-accent) !important;
    background: rgba(0, 116, 217, 0.2);
}

/* Responsive theme form */
@media (max-width: 768px) {
    #themeForm .form-grid {
        grid-template-columns: 1fr !important;
    }

    .preset-btn {
        width: 35px !important;
        height: 35px !important;
    }

    .theme-mode-option {
        flex: 1;
        justify-content: center;
    }
}

/* SweetAlert2 Dark Mode */
body.dark-mode .swal2-popup {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .swal2-title {
    color: var(--text-primary) !important;
}

body.dark-mode .swal2-html-container {
    color: var(--text-secondary) !important;
}

body.dark-mode .swal2-input,
body.dark-mode .swal2-textarea {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* ===== Text Utility Classes ===== */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ===== COMPREHENSIVE MOBILE RESPONSIVE STYLES ===== */

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
body {
    overflow-x: hidden;
}

/* Mobile-optimized scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-accent);
    border-radius: 3px;
}

/* Safe area padding for iOS devices with notch */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 8px);
        height: calc(65px + env(safe-area-inset-bottom, 0px));
    }

    .main-content {
        padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
}

/* ===== Mobile Responsive (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Main content adjustments */
    .main-content {
        padding: 15px;
        padding-bottom: 90px;
    }

    /* Data section mobile */
    .data-section {
        padding: 15px;
        border-radius: 6px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .section-header .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    /* Stat cards mobile */
    .stat-card {
        padding: 20px;
    }

    .stat-card-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin-bottom: 12px;
    }

    .stat-card-value {
        font-size: 28px;
    }

    .stat-card-label {
        font-size: 12px;
    }

    /* Charts mobile */
    .chart-card {
        padding: 15px;
    }

    .chart-container {
        height: 250px;
    }

    /* Buttons mobile - larger touch targets */
    .btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }

    .btn-sm {
        padding: 12px 16px;
        min-height: 44px;
    }

    /* Form inputs mobile - larger touch targets */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 16px;
        font-size: 16px !important;
        min-height: 52px;
        border-radius: 6px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Filter inputs mobile */
    .filter-input {
        padding: 14px 12px;
        font-size: 16px !important;
        min-height: 50px;
    }

    /* Modal mobile full screen */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin: 0;
    }

    .modal-header {
        padding: 20px;
        border-radius: 16px 16px 0 0;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .modal-body {
        padding: 20px;
        max-height: calc(95vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Account info cards mobile */
    .account-info-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .account-info-card h3 {
        font-size: 18px;
    }

    .info-row {
        flex-direction: column;
        gap: 8px;
        padding: 12px 0;
    }

    .info-label {
        width: 100%;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .info-value {
        font-size: 15px;
        font-weight: 500;
    }

    /* DataTables mobile */
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.dataTable {
        min-width: 600px;
    }

    table.dataTable thead th {
        padding: 12px 10px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    table.dataTable tbody td {
        padding: 14px 10px !important;
        font-size: 13px !important;
    }

    /* Action icons mobile - larger touch targets */
    .action-icon {
        padding: 10px 12px;
        font-size: 18px;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* DataTables buttons mobile */
    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 15px;
    }

    .dt-button {
        flex: 1;
        min-width: calc(33.33% - 6px);
        padding: 12px 10px !important;
        font-size: 12px !important;
        text-align: center;
        margin-right: 0 !important;
    }

    /* DataTables search and length mobile */
    .dataTables_length,
    .dataTables_filter {
        width: 100%;
        margin-bottom: 15px;
        text-align: left !important;
    }

    .dataTables_length select,
    .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 8px;
        padding: 12px !important;
        font-size: 16px !important;
    }

    .dataTables_info {
        font-size: 12px;
        padding: 10px 0;
    }

    .dataTables_paginate {
        padding-top: 15px;
    }

    .dataTables_paginate .paginate_button {
        padding: 10px 14px !important;
        min-width: 44px;
        min-height: 44px;
    }

    /* Login page mobile */
    .login-container {
        padding: 15px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .login-box {
        padding: 30px 20px;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
    }

    .login-logo {
        width: 90px;
        height: 90px;
        margin-bottom: 20px;
    }

    .login-box h2 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .login-box .form-group input {
        padding: 16px;
    }

    .login-box .btn {
        padding: 16px;
        font-size: 16px;
    }

    /* Settings page mobile */
    .settings-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .settings-mega-card {
        border-radius: 8px;
    }

    .settings-card-header {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .settings-card-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .settings-card-title {
        font-size: 16px;
    }

    .settings-card-body {
        padding: 16px;
    }

    .control-group {
        padding: 15px;
        margin-bottom: 12px;
    }

    .control-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .control-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .control-title {
        font-size: 15px;
    }

    .control-toggle-wrapper {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    /* Security features mobile */
    .security-feature {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 14px;
    }

    .security-feature-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Server info mobile */
    .server-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }

    /* Stat items inline mobile */
    .stat-item-inline {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 14px;
    }

    .stat-item-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    /* Status badges mobile */
    .status-badge {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Filters mobile */
    .filters-section {
        padding: 12px;
        margin-bottom: 15px;
    }

    .filters-header {
        padding-bottom: 12px;
        margin-bottom: 15px;
    }

    .filters-header h3 {
        font-size: 16px;
    }

    .filters-grid {
        gap: 12px;
    }

    .filter-group label {
        font-size: 12px;
    }

    /* Profile image section mobile */
    .profile-image-container {
        max-width: 100%;
    }

    /* Theme customization mobile */
    #themeForm .form-grid {
        grid-template-columns: 1fr !important;
    }

    .preset-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .theme-mode-option {
        padding: 12px !important;
    }

    .theme-preview {
        padding: 15px !important;
    }
}

/* ===== Extra Small Devices (max-width: 480px) ===== */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
        padding-bottom: 85px;
    }

    .header {
        padding: 12px;
    }

    .header h1 {
        font-size: 16px;
    }

    .data-section {
        padding: 12px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card-value {
        font-size: 24px;
    }

    .stat-card-label {
        font-size: 11px;
    }

    .chart-container {
        height: 200px;
    }

    .modal-body {
        padding: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px;
    }

    table.dataTable thead th {
        padding: 10px 8px !important;
        font-size: 11px !important;
    }

    table.dataTable tbody td {
        padding: 12px 8px !important;
        font-size: 12px !important;
    }

    .dt-button {
        min-width: calc(50% - 4px);
        padding: 10px 8px !important;
        font-size: 11px !important;
    }

    .login-box {
        padding: 25px 15px;
    }

    .login-logo {
        width: 80px;
        height: 80px;
    }

    .login-box h2 {
        font-size: 20px;
    }

    .account-info-card {
        padding: 15px;
    }

    .info-label {
        font-size: 11px;
    }

    .info-value {
        font-size: 14px;
    }

    /* Mobile bottom nav extra small */
    .mobile-nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }

    .mobile-nav-item i {
        font-size: 18px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }
}

/* ===== Landscape Mobile Orientation ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        height: 55px;
    }

    .mobile-nav-item {
        padding: 5px 10px;
    }

    .mobile-nav-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }

    .main-content {
        padding-bottom: 70px;
    }

    .modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        max-height: calc(100vh - 70px);
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for touch devices */
    .btn {
        min-height: 48px;
    }

    .action-icon {
        min-width: 48px;
        min-height: 48px;
    }

    .mobile-nav-item {
        min-height: 56px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    .action-icon:hover {
        transform: none;
    }

    /* Add active states for touch feedback */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .action-icon:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    .mobile-nav-item:active {
        transform: scale(0.95);
        opacity: 0.9;
    }
}

/* ===== iOS Specific Fixes ===== */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS 100vh issue */
    .login-container {
        min-height: -webkit-fill-available;
    }

    .app-container {
        min-height: -webkit-fill-available;
    }

    /* Fix for iOS input zoom */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Fix for iOS momentum scrolling */
    .modal-body,
    .main-content,
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Pull to Refresh Prevention ===== */
body {
    overscroll-behavior-y: contain;
}

/* ===== Tablet Responsive (768px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .settings-grid-2x2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

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

    .modal {
        width: 85%;
        max-width: 700px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .sidebar,
    .mobile-bottom-nav,
    .sidebar-overlay,
    .btn,
    .action-icon,
    .dt-buttons {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 20px;
    }

    .app-container {
        display: block;
    }
}

/* ===== Dark Mode Global Text Colors ===== */
body.dark-mode {
    color: var(--text-primary);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--text-primary) !important;
}

body.dark-mode p,
body.dark-mode span:not(.status-badge):not(.role-badge):not(.version-badge):not(.upload-badge):not(.chip):not(.val),
body.dark-mode div:not(.sidebar):not(.modal-header):not(.stat-card-icon):not(.settings-card-icon),
body.dark-mode label {
    color: var(--text-secondary);
}

body.dark-mode .text-muted,
body.dark-mode .info-text,
body.dark-mode .help-text,
body.dark-mode em.text-muted {
    color: var(--text-muted) !important;
}

/* Account Page Dark Mode */
body.dark-mode .account-info-card {
    background: var(--bg-card);
    border-left-color: var(--navy-accent);
}

body.dark-mode .account-info-card h3 {
    color: var(--text-primary);
}

body.dark-mode .info-row {
    border-bottom-color: var(--border-light);
}

body.dark-mode .info-label {
    color: var(--text-secondary);
}

body.dark-mode .info-value {
    color: var(--text-primary);
}

/* Profile Image Section Dark Mode */
body.dark-mode .profile-image-container {
    background: var(--bg-secondary);
    border-color: var(--navy-accent);
}

body.dark-mode .profile-image-label {
    color: var(--text-muted) !important;
}

body.dark-mode #defaultProfileIcon {
    color: var(--navy-accent) !important;
}

/* Form Labels and Text Dark Mode */
body.dark-mode .form-group label {
    color: var(--text-secondary);
}

body.dark-mode .form-group label i {
    color: var(--navy-accent);
}

/* Section Headers Dark Mode */
body.dark-mode .section-header h2 {
    color: var(--text-primary);
}

body.dark-mode .data-section {
    background: var(--bg-card);
}

/* Info/Help Text Dark Mode */
body.dark-mode [style*="color: #666"],
body.dark-mode [style*="color:#666"] {
    color: var(--text-muted) !important;
}

/* Warning/Disabled Messages Dark Mode */
body.dark-mode #uploadDisabledMessage {
    background: rgba(251, 188, 4, 0.1) !important;
    border-color: rgba(251, 188, 4, 0.4) !important;
    color: #ffd54f !important;
}

/* File Input Dark Mode */
body.dark-mode input[type="file"] {
    background: var(--bg-secondary) !important;
    border-color: var(--navy-accent) !important;
    color: var(--text-primary) !important;
}

/* Header Welcome Text Dark Mode */
body.dark-mode .header {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ===== Profile Image Section ===== */
.profile-section-grid {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.profile-image-display {
    text-align: center;
    flex-shrink: 0;
}

.profile-image-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--navy-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 0 auto 15px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-image-container #defaultProfileIcon {
    font-size: 50px;
    color: var(--navy-accent);
}

.profile-image-label {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-upload-form {
    flex: 1;
    min-width: 280px;
}

.file-input-styled {
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--navy-accent);
    border-radius: 6px;
    background: var(--bg-secondary);
    font-size: 16px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-styled:hover {
    border-color: var(--navy-primary);
    background: var(--bg-primary);
}

.help-text {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.warning-message {
    padding: 15px;
    background: rgba(251, 188, 4, 0.15);
    border: 1px solid rgba(251, 188, 4, 0.5);
    border-radius: 6px;
    color: var(--warning);
    margin-top: 15px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .profile-section-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .profile-image-display {
        width: 100%;
    }

    .profile-image-container {
        width: 100px;
        height: 100px;
    }

    .profile-image-container #defaultProfileIcon {
        font-size: 40px;
    }

    .profile-upload-form {
        width: 100%;
        min-width: unset;
    }

    .file-input-styled {
        padding: 16px;
    }
}

/* ===== Theme Customization Section Mobile ===== */
@media (max-width: 768px) {
    .theme-preview-container {
        padding: 15px;
    }

    .theme-preview-swatches {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #previewPrimary,
    #previewSecondary,
    #previewAccent {
        width: 100% !important;
        height: 40px !important;
    }

    #previewButton {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 10px !important;
    }

    .theme-mode-option {
        flex: 1;
        justify-content: center;
        padding: 14px 16px !important;
    }
}

/* ===== Setup Guide Table (OAuth & SMTP) ===== */
.setup-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.setup-guide-table thead tr {
    background: var(--navy-primary);
    color: white;
}

.setup-guide-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
}

.setup-guide-table td {
    padding: 14px 16px;
}

.setup-guide-table tbody tr {
    border-bottom: 1px solid var(--input-border, #e9ecef);
}

.setup-guide-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.setup-guide-table .step-num {
    font-weight: bold;
    color: var(--navy-accent);
    width: 50px;
}

.setup-guide-table .step-name {
    font-weight: 600;
    min-width: 180px;
}

.setup-guide-table .step-final {
    background: rgba(52, 168, 83, 0.08);
}

.setup-guide-table .step-final .step-num {
    color: var(--success);
}

.setup-guide-table .step-final .step-name {
    color: var(--success);
}

.setup-guide-table .step-section-header td {
    background: var(--navy-primary);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
}

.setup-guide-table code {
    background: var(--input-border, #e9ecef);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    display: inline-block;
    margin-top: 6px;
    word-break: break-all;
}

body.dark-mode .setup-guide-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .setup-guide-table .step-final {
    background: rgba(52, 168, 83, 0.1);
}

body.dark-mode .setup-guide-table .step-section-header td {
    background: var(--navy-light);
}

/* ===== Credential Status Indicator ===== */
.credential-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.credential-input-wrapper {
    position: relative;
}

/* ===== Success Message ===== */
.success {
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--success);
    font-size: 14px;
    background: #f0fdf4;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #bbf7d0;
}

body.dark-mode .success {
    background: rgba(52, 168, 83, 0.1);
    border-color: rgba(52, 168, 83, 0.3);
}

/* ===== Login Page Utilities ===== */
.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-subtitle .highlight {
    color: var(--navy-accent);
    font-weight: 600;
}

.login-link {
    color: var(--navy-accent);
    text-decoration: none;
    font-weight: 500;
}

.login-link:hover {
    text-decoration: underline;
}

.login-footer-link {
    margin-bottom: 8px;
}

/* ===== OTP Input ===== */
.otp-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: bold;
}

/* ===== Full Width Button ===== */
.btn-block {
    width: 100%;
}

/* ===== Remember Me & Forgot Password Row ===== */
.login-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted);
}

.remember-me-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--navy-accent);
}

/* ===== OAuth Divider ===== */
.oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.oauth-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid var(--border-color);
}

.oauth-divider span {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* ===== Google OAuth Button ===== */
.google-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.google-oauth-btn:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}

/* ===== SMTP Setup Utilities ===== */
.smtp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.smtp-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.smtp-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.smtp-actions .btn {
    flex: 1;
}

.card-divider {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* ===== Resend OTP Section ===== */
.resend-section {
    margin-top: 20px;
    text-align: center;
}

.resend-countdown {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.resend-countdown .timer {
    font-weight: bold;
    color: var(--navy-accent);
}

/* ===== Card Icon Gradient Variants ===== */
.icon-gradient-navy {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
}
.icon-gradient-accent {
    background: linear-gradient(135deg, var(--navy-accent) 0%, #0056a8 100%);
}
.icon-gradient-navy-accent {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-accent) 100%);
}
.icon-gradient-light {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-hover) 100%);
}
.icon-gradient-success {
    background: linear-gradient(135deg, #34a853 0%, #2d9148 100%);
}
.icon-gradient-blue {
    background: linear-gradient(135deg, #0074D9 0%, #0056a8 100%);
}
.icon-gradient-warning {
    background: linear-gradient(135deg, #fbbc04 0%, #e0a800 100%);
}

/* ===== Stat Icon Color Variants ===== */
.stat-icon-success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
}
.stat-icon-accent {
    background: rgba(0, 116, 217, 0.1);
    color: var(--navy-accent);
}
.stat-icon-warning {
    background: rgba(251, 188, 4, 0.1);
    color: var(--warning);
}
.stat-icon-danger {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}

/* ===== Layout Utilities ===== */
.mb-24 { margin-bottom: 24px; }
.mb-30 { margin-bottom: 30px; }
.mt-24 { margin-top: 24px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mt-30 { margin-top: 30px; }

/* ===== Quick Actions Bar ===== */
.quick-actions-bar {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ===== Card Body Variants ===== */
.card-body-flush {
    padding: 0;
}
.card-body-flush-scroll {
    padding: 0;
    overflow-x: auto;
}

/* ===== Info Banner Variants ===== */
.info-banner-inset {
    margin: 16px;
    border-radius: 8px;
}
.info-banner-top {
    margin-top: 10px;
}

/* ===== Button Group Inline ===== */
.btn-group-inline {
    display: flex;
    gap: 10px;
}

/* ===== Table Responsive Wrapper ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-full-width {
    width: 100%;
}

/* ===== Data Table Flush ===== */
.data-table.data-table-flush {
    margin: 0;
}

/* ===== Skeleton Helpers ===== */
.skeleton-card-mb { margin-bottom: 20px; }
.skeleton-grid-mb { margin-bottom: 30px; }
.skeleton-w-50 { width: 50%; }
.skeleton-w-60 { width: 60%; }
.skeleton-w-70 { width: 70%; }
.skeleton-w-80 { width: 80%; }
.skeleton-mb-sm { margin-bottom: 12px; }
.skeleton-mb-md { margin-bottom: 16px; }
.skeleton-flex-1 { flex: 1; }
.skeleton-flex-2 { flex: 2; }

/* ===== Dashboard Activities ===== */
.activities-loading {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}
.activities-loading .fa-spinner {
    font-size: 24px;
}
.activities-loading p {
    margin-top: 10px;
}
.activities-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}
.activities-empty .fa-inbox {
    font-size: 32px;
    margin-bottom: 10px;
}

/* ===== Dashboard Activity Table Cells ===== */
.action-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.action-badge-default {
    background: rgba(0, 116, 217, 0.1);
    color: var(--navy-accent);
}
.action-badge-success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
}
.action-badge-danger {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}
.action-badge-warning {
    background: rgba(251, 188, 4, 0.1);
    color: var(--warning);
}
.activity-detail {
    color: var(--text-muted);
    font-size: 13px;
}
.activity-ip code {
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 3px;
}

.ip-mask-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ip-mask-wrap code {
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 3px;
}

.ip-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    padding: 2px 4px;
    transition: color 0.2s;
}

.ip-toggle-btn:hover {
    color: var(--navy-primary);
}
.activity-time {
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Status Text Helpers ===== */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: #0074D9; }
.text-muted { color: var(--text-muted); }

/* ===== Logo Upload Section (settings.php) ===== */
.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}
.logo-preview-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}
body.dark-mode .logo-preview-img {
    border-color: var(--border-color);
}
.logo-upload-controls {
    flex: 1;
}

/* ===== Form Grid Variants ===== */
.form-grid-2col {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

/* ===== Theme Customization (account.php) ===== */
.theme-preview-container {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}
.theme-preview-title {
    margin-bottom: 15px;
    color: var(--text-primary);
}
.theme-preview-swatches {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.color-preview-box {
    width: 80px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}
.preview-button-spacer {
    margin-left: 20px;
}
.color-picker-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.color-picker-input {
    width: 60px;
    height: 45px;
    padding: 2px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}
.hex-input {
    flex: 1;
    text-transform: uppercase;
}
.color-help-text {
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
}
.theme-mode-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.theme-mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
}
.theme-mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
}
.icon-sun { color: #fbbc04; }
.icon-moon { color: #5dade2; }
.preset-colors-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ===== Preset Button Base Styles ===== */
.preset-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.preset-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== Profile Image Cover ===== */
.profile-img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== UI Help Text ===== */
.ui-help-text {
    margin-bottom: 20px;
    color: var(--text-muted);
}

/* ===== Palette Gallery (UI Customization) ===== */
.palette-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
    margin-top: 10px;
}
.palette-card {
    position: relative;
    text-align: left;
    padding: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.palette-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px var(--shadow-hover);
    border-color: var(--navy-accent);
}
.palette-card.active {
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 2px var(--navy-accent) inset;
}
.palette-swatch {
    display: flex;
    height: 54px;
    width: 100%;
}
.palette-swatch span { flex: 1; }
.palette-meta { padding: 10px 12px; }
.palette-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.palette-id {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.palette-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--navy-accent);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.palette-card.active .palette-check { display: flex; }
.palette-default-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* ===== AdminLTE-style collapsible card (theme-aware) ===== */
.lte-card {
    background: var(--bg-card);
    border-radius: 6px;
    box-shadow: 0 2px 6px var(--shadow-color);
    margin-bottom: 22px;
    border-top: 3px solid var(--navy-accent);
    overflow: hidden;
}
.lte-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.lte-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lte-card-title i { color: var(--navy-accent); }
.lte-card-tools { display: flex; align-items: center; gap: 4px; }
.lte-card-tools button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 9px;
    font-size: 14px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.lte-card-tools button:hover { color: var(--navy-accent); background: var(--bg-primary); }
.lte-card-body { padding: 18px; }
.lte-card.collapsed .lte-card-body { display: none; }
.lte-card.collapsed { border-top-color: var(--border-color); }

/* current theme summary strip */
.current-theme-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.current-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 145px;
}
.current-swatch-chip {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}
.current-swatch-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.current-swatch-hex {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: monospace;
}
.current-theme-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.current-theme-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 7px 15px;
    border-radius: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}
.current-mode-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 7px 13px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.theme-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ===== AdminLTE small-box KPI (dashboard) ===== */
.lte-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 1200px) { .lte-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .lte-kpi-grid { grid-template-columns: 1fr; } }

.small-box {
    position: relative;
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #fff;
    overflow: hidden;
    transition: transform 0.25s;
}
.small-box:hover { transform: translateY(-3px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.small-box .inner { padding: 18px 20px 12px; position: relative; z-index: 2; }
.small-box .inner h3 { font-size: clamp(24px, 4.5vw, 32px); font-weight: 700; margin: 0 0 6px; white-space: nowrap; }
.small-box .inner p { font-size: 14px; margin: 0; opacity: 0.95; }
.small-box .icon { position: absolute; top: 12px; right: 16px; z-index: 1; font-size: 64px; color: rgba(0, 0, 0, 0.15); transition: font-size 0.3s; }
.small-box:hover .icon { font-size: 70px; }
.small-box-footer {
    position: relative;
    display: block;
    width: 100%;
    padding: 8px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-decoration: none;
    z-index: 3;
}
.small-box-footer:hover { background: rgba(0, 0, 0, 0.22); color: #fff; }

/* box colors — navy theme (react to user's custom accent/primary) */
.bg-navy    { background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); }
.bg-info    { background: linear-gradient(135deg, var(--navy-accent) 0%, #3393e0 100%); }
.bg-success { background: linear-gradient(135deg, #2e8b46 0%, var(--success) 100%); }
.bg-warning { background: linear-gradient(135deg, #e0a800 0%, var(--warning) 100%); color: #1f2d3d; }
.bg-warning .small-box-footer { color: rgba(0, 0, 0, 0.65); }
.bg-danger  { background: linear-gradient(135deg, #c5221f 0%, var(--danger) 100%); }

/* ===== Header tools: quick theme + language switcher ===== */
.header-tool-wrapper { position: relative; }
.header-tool-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    transition: all 0.25s;
}
.header-tool-btn:hover { background: #f0f0f0; color: var(--navy-primary); }
.header-tool-btn .lang-current { font-size: 12px; font-weight: 700; }
body.dark-mode .header-tool-btn { color: var(--text-secondary); }
body.dark-mode .header-tool-btn:hover { background: var(--bg-primary); color: var(--text-primary); }

.header-tool-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 34px var(--shadow-hover);
    z-index: 1200;
    display: none;
    overflow: hidden;
}
.header-tool-dropdown.open { display: block; }
.header-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}
.header-tool-header strong { color: var(--text-primary); font-size: 14px; display: flex; align-items: center; gap: 7px; }
.mode-toggle-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    transition: all 0.2s;
}
.mode-toggle-btn:hover { color: var(--navy-accent); border-color: var(--navy-accent); }

.theme-quick-menu { width: 296px; max-width: calc(100vw - 24px); }
.theme-quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px; }
.theme-quick-swatch {
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    height: 34px;
    cursor: pointer;
    overflow: hidden;
    background: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.theme-quick-swatch span { display: block; width: 100%; height: 100%; }
.theme-quick-swatch:hover { transform: translateY(-2px); border-color: var(--navy-accent); }
.theme-quick-swatch.active { border-color: var(--navy-accent); box-shadow: 0 0 0 2px var(--navy-accent) inset; }
.header-tool-footer {
    display: block;
    text-align: center;
    padding: 11px;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-accent);
    text-decoration: none;
    border-top: 1px solid var(--border-color);
}
.header-tool-footer:hover { background: var(--bg-primary); }

.lang-menu { min-width: 214px; max-height: 340px; overflow-y: auto; padding: 6px; }
.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 9px 11px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-primary);
    text-align: left;
}
.lang-item:hover { background: var(--bg-primary); }
.lang-item.active { background: rgba(0, 116, 217, 0.12); color: var(--navy-accent); font-weight: 700; }
.lang-item .lang-flag { font-size: 18px; line-height: 1; }
.lang-item .lang-check { margin-left: auto; color: var(--navy-accent); font-size: 12px; }
[dir="rtl"] .header-tool-dropdown { right: auto; left: 0; }
[dir="rtl"] .lang-item { text-align: right; }

/* ===== Header: search + account menu ===== */
.hdr-search-wrap { flex: 0 1 300px; min-width: 0; }
.hdr-search {
    display: flex; align-items: center; gap: 9px;
    height: 40px; padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hdr-search:focus-within { border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.14); }
.hdr-search i { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.hdr-search input {
    flex: 1; min-width: 0;
    border: 0; outline: 0; background: none;
    color: var(--text-primary); font-family: inherit; font-size: 14px;
}
.hdr-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-menu { width: 340px; max-width: calc(100vw - 24px); padding: 6px; }
.search-hit {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--text-primary); text-decoration: none; font-size: 13.5px;
}
.search-hit i { color: var(--navy-accent); width: 17px; text-align: center; flex-shrink: 0; }
.search-hit span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit em {
    display: none;
    font-style: normal; font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.search-hit.on, .search-hit:hover { background: var(--bg-primary); }
.search-hit.on em { display: inline; }

.moon-btn { position: relative; }
.hdr-user {
    display: inline-flex; align-items: center; gap: 9px;
    max-width: 190px; padding: 5px 12px 5px 5px;
    border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-primary); font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s;
}
.hdr-user:hover { border-color: var(--navy-accent); }
.hdr-user-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.hdr-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-user-caret { font-size: 11px; color: var(--text-muted); transition: transform 0.2s; }
.hdr-user-wrap:has(.header-tool-dropdown.open) .hdr-user-caret { transform: rotate(180deg); }

.user-menu { width: 268px; padding: 6px; }
.user-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}
.user-card img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-card-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-card-txt strong { font-size: 14.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-txt small { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: 9px;
    color: var(--text-primary); text-decoration: none; font-size: 14px; font-weight: 500;
}
.user-link i { width: 17px; text-align: center; color: var(--navy-accent); font-size: 15px; }
.user-link:hover { background: var(--bg-primary); }
.user-link.danger, .user-link.danger i { color: var(--danger); }

@media (max-width: 1100px) { .hdr-search-wrap { display: none; } }
@media (max-width: 640px) { .hdr-user-name, .hdr-user-caret { display: none; } .hdr-user { padding: 4px; border: 0; } }

/* dark mode — span/div blanket at 3692 is (0,5,2) */
body.dark-mode .hdr-search { background: var(--bg-secondary); }
body.dark-mode .hdr-user-name,
body.dark-mode .user-card-txt strong { color: var(--text-primary) !important; }
body.dark-mode .user-card-txt small,
body.dark-mode .search-hit em { color: var(--text-muted) !important; }
body.dark-mode .search-hit span,
body.dark-mode .user-link { color: var(--text-primary) !important; }
body.dark-mode .user-link.danger { color: var(--danger) !important; }
body.dark-mode .search-hit.on, body.dark-mode .search-hit:hover,
body.dark-mode .user-link:hover { background: var(--bg-secondary); }
/* ===== Header messages dropdown ===== */
.msg-btn { position: relative; }
.msg-dot {
    position: absolute; top: 5px; right: 7px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--bg-card);
}
.msg-menu { width: 340px; max-width: calc(100vw - 24px); }
.msg-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 15px 18px 11px;
}
.msg-head strong { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.msg-head a { font-size: 12.5px; font-weight: 600; color: var(--navy-accent); text-decoration: underline; }
.msg-body { max-height: 392px; overflow-y: auto; padding-bottom: 6px; }
.msg-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 18px;
    text-decoration: none;
    transition: background 0.15s;
}
.msg-item:hover { background: var(--bg-primary); }
.msg-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.msg-top strong { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.msg-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.msg-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.msg-prev {
    font-size: 12.5px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.msg-item.unread .msg-prev { color: var(--text-primary); font-weight: 600; }
.msg-pill {
    flex-shrink: 0;
    min-width: 20px; height: 20px;
    padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--danger);
    color: #fff; font-size: 11px; font-weight: 700; font-style: normal;
}
.msg-none {
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    padding: 34px 18px;
    color: var(--text-muted); font-size: 13px;
}
.msg-none i { font-size: 26px; opacity: 0.45; }

/* dark mode — the span blanket at 3692 is (0,5,2), so these need !important */
body.dark-mode .msg-prev,
body.dark-mode .msg-time,
body.dark-mode .msg-none span { color: var(--text-muted) !important; }
body.dark-mode .msg-item.unread .msg-prev { color: var(--text-primary) !important; }
body.dark-mode .msg-item:hover { background: var(--bg-secondary); }
body.dark-mode .msg-dot { border-color: var(--bg-card); }

/* keep the GT widget rendered (so the combo builds) but off-screen — NOT display:none */
.gt-offscreen {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* extra google-translate chrome hiding */
.goog-te-gadget { font-size: 0 !important; }
.goog-te-gadget span, .goog-logo-link { display: none !important; }
.goog-tooltip, .goog-tooltip:hover, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* ===== New Classes Mobile Responsive ===== */
@media (max-width: 768px) {
    .setup-guide-table th,
    .setup-guide-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .setup-guide-table .step-name {
        min-width: 120px;
    }

    .smtp-form-grid {
        grid-template-columns: 1fr;
    }

    .smtp-actions {
        flex-direction: column;
    }

    .login-options-row {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .form-grid-2col { grid-template-columns: 1fr; }
    .form-grid-3col { grid-template-columns: 1fr; }
    .palette-gallery { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
    .current-theme-meta { margin-left: 0; width: 100%; }
    .current-swatch { flex: 1; min-width: 120px; }
    .theme-action-row .btn { flex: 1; justify-content: center; }
    .theme-mode-options { flex-direction: column; gap: 10px; }
    .theme-preview-swatches { flex-direction: column; }
    .color-preview-box { width: 100%; }
    .logo-upload-row { flex-direction: column; align-items: flex-start; }
    .quick-actions-bar { justify-content: center; }

    .preset-btn {
        width: 45px !important;
        height: 45px !important;
    }
}

/* ===== Utility Classes ===== */
.initially-hidden {
    display: none;
}

/* ===== Select2 Theme Integration ===== */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    color: var(--text-primary);
    padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted);
}

.select2-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    z-index: 10060;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 6px 10px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.select2-container--default .select2-results__option {
    padding: 8px 12px;
    color: var(--text-primary);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--navy-accent);
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--bg-primary);
}

body.dark-mode .select2-container--default .select2-selection--single {
    background: var(--input-bg);
    border-color: var(--input-border);
}

body.dark-mode .select2-dropdown {
    background: var(--bg-secondary);
    border-color: var(--input-border);
}

body.dark-mode .select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

body.dark-mode .select2-container--default .select2-results__option {
    color: var(--text-primary);
}

body.dark-mode .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--bg-primary);
}

/* ===== Breadcrumbs ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 12px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--navy-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--navy-primary);
    text-decoration: underline;
}

.breadcrumb a i {
    font-size: 12px;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.5;
    font-weight: 300;
}

body.dark-mode .breadcrumb a:hover {
    color: #fff;
}

/* ===== Maintenance Page ===== */
.maintenance-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    padding: 20px;
}

.maintenance-admin-link {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.3;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 10;
}

.maintenance-admin-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

.maintenance-content {
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.maintenance-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 8px 32px rgba(0, 116, 217, 0.3);
}

.maintenance-icon i {
    font-size: 48px;
    color: #fff;
}

.maintenance-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 16px;
}

body.dark-mode .maintenance-title {
    color: var(--text-primary);
}

.maintenance-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.maintenance-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e3f2fd;
    padding: 14px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--navy-accent);
    font-size: 14px;
    color: var(--navy-primary);
    margin-bottom: 30px;
    text-align: left;
}

body.dark-mode .maintenance-info {
    background: rgba(0, 116, 217, 0.1);
    color: var(--text-secondary);
}

.maintenance-brand {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.maintenance-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid var(--border-color);
}

.maintenance-brand p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Maintenance Card Warning (Settings) ===== */
.maintenance-card-warning {
    border-color: #ffc107;
}

.maintenance-card-warning:hover {
    border-color: #ff9800;
}

.icon-gradient-danger {
    background: linear-gradient(135deg, #ea4335, #ff6b6b);
}

.info-banner-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

body.dark-mode .info-banner-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #ffc107;
}

.text-danger {
    color: #ea4335 !important;
}

/* ===== Notification Bell ===== */
/* view-transition-name (bottom of this file) turns .header-right into its own
   stacking context, so the panels inside it can't out-paint later content on
   z-index alone. Lift the whole context: above page content, still under the
   sidebar (999/1001) and modal overlays (1000). */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 900;
}

.notification-bell-wrapper {
    position: relative;
}

.notification-bell-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
}

.notification-bell-btn:hover {
    background: #f0f0f0;
    color: var(--navy-primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ea4335;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 420px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.notification-dropdown-header strong {
    font-size: 15px;
    color: var(--navy-primary);
}

.notification-dropdown-header button {
    background: transparent;
    border: none;
    color: var(--navy-accent);
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.notification-dropdown-header button:hover {
    text-decoration: underline;
}

.notification-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.notification-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e8f4fd;
    border-left: 3px solid var(--navy-accent);
}

.notification-item.unread:hover {
    background: #d6ecfb;
}

.notification-item-icon {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
}

.notification-item-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.notification-item-mark {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-item-mark:hover {
    color: #34a853;
}

/* Dark Mode — Notification Bell */
body.dark-mode .notification-bell-btn {
    color: var(--text-secondary);
}

body.dark-mode .notification-bell-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

body.dark-mode .notification-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .notification-dropdown-header {
    background: var(--bg-primary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .notification-dropdown-header strong {
    color: var(--text-primary);
}

body.dark-mode .notification-item {
    border-bottom-color: var(--border-color);
}

body.dark-mode .notification-item:hover {
    background: var(--bg-primary);
}

body.dark-mode .notification-item.unread {
    background: rgba(0, 116, 217, 0.1);
    border-left-color: var(--navy-accent);
}

body.dark-mode .notification-item.unread:hover {
    background: rgba(0, 116, 217, 0.15);
}

body.dark-mode .notification-item-title {
    color: var(--text-primary);
}

body.dark-mode .notification-item-message {
    color: var(--text-secondary);
}

body.dark-mode .notification-item-time {
    color: var(--text-muted);
}

/* ===== About Section Styles ===== */

.about-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
}

.about-roles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.about-roles-table th,
.about-roles-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.about-roles-table th {
    background: var(--navy-primary);
    color: white;
    font-weight: 600;
}

.about-roles-table th:first-child {
    text-align: left;
}

.about-roles-table td:first-child {
    text-align: left;
    font-weight: 500;
    background: #f8f9fa;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: #d4edda;
    color: #155724;
}

.role-sf {
    background: #cce5ff;
    color: #004085;
}

.text-success {
    color: var(--success) !important;
}

/* login footer contact block */
.auth-contact {
    text-align: center;
    padding: 14px 10px 0;
    font-size: 12px;
}

.auth-contact-title {
    display: block;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 7px;
}

.auth-contact-links {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.auth-contact-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s;
}

.auth-contact-links a:hover { color: var(--navy-accent); }

/* the span blanket at 3692 is (0,5,2) — a plain class rule loses to it */

body.dark-mode .auth-contact-title { color: var(--text-primary) !important; }

/* Dark Mode — About Section */

body.dark-mode .about-roles-table th {
    background: var(--navy-primary);
}

body.dark-mode .about-roles-table td {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .about-roles-table td:first-child {
    background: var(--bg-primary);
}

/* Mobile — Notification Dropdown */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 300px;
        right: -40px;
    }

    .header-right {
        gap: 10px;
        font-size: 13px;
    }

}

/* RBAC matrix — sticky grid (roles.php) */
.rbac-wrap {
    overflow: auto;
    border: 1px solid var(--border-color);
    max-height: 72vh;
    margin: 15px 0;
}

.rbac-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    width: 100%;
    table-layout: fixed; /* role cols split equally, fills 100% */
}

.rbac-table th,
.rbac-table td {
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-light);
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
    background: var(--bg-card);
}

.rbac-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f5f8fc;
}

.rbac-rolehead {
    color: #fff;
    padding: 5px 9px;
    font-weight: 700;
    font-size: 11px;
    display: inline-block;
    min-width: 74px;
    border-radius: 3px;
}

.rbac-perm-legend {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 1px;
}

.rbac-table th.rbac-pagecol,
.rbac-table td.rbac-pagecol {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    font-weight: 600;
    color: var(--navy-primary);
    background: var(--bg-card);
    width: 200px; /* fixed; rest splits equally among roles */
    box-shadow: 1px 0 0 var(--border-color);
}

.rbac-table thead th.rbac-pagecol {
    z-index: 4;
    background: #f5f8fc;
}

.rbac-grouprow td {
    background: #eef2f7 !important;
    color: #5a6b7b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    text-align: left;
}

.rbac-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap; /* wrap V·A·E·D when many roles shrink cols */
}

/* impersonation — "login as this user" */
.action-icon.loginas-icon { color: #0074D9; }
.action-icon.loginas-icon:hover { color: #005fa3; }
.impersonate-notice {
    margin: 10px;
    padding: 10px 12px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #664d03;
}
.impersonate-notice > i { font-size: 18px; color: #997404; flex-shrink: 0; }
.impersonate-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.impersonate-text span { font-weight: 600; }
.impersonate-text a { color: #0074D9; font-weight: 700; text-decoration: none; }
.impersonate-text a:hover { text-decoration: underline; }
body.dark-mode .impersonate-notice { background: #3a2f00; border-color: #5c4a00; color: #ffe69c; }
body.dark-mode .impersonate-text a { color: #4aa3ff; }

.rbac-dot {
    width: 24px;
    height: 24px;
    border: 1px solid #d4d4d4;
    background: #fff;
    color: #bbb;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    border-radius: 0;
}

.rbac-dot:hover {
    border-color: var(--navy-accent);
}

.rbac-dot.on {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.rbac-dot.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.rbac-dot.on.locked {
    background: #9bbf9e;
    border-color: #9bbf9e;
}

/* perm letters in About roles table */
.perm-on {
    display: inline-block;
    min-width: 16px;
    font-weight: 800;
    font-size: 12px;
    color: var(--success);
    letter-spacing: 1px;
}

.perm-off {
    display: inline-block;
    min-width: 16px;
    font-weight: 600;
    font-size: 12px;
    color: #c4c4c4;
    letter-spacing: 1px;
}

/* User role badge (Admin badge already defined above) */
.role-user {
    background: #cce5ff;
    color: #004085;
}

/* Per-user access (roles.php User Access tab) */
.rbac-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 16px;
    border-bottom: 2px solid var(--border-color);
}

.rbac-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
}

.rbac-tab:hover { color: var(--navy-accent); }

.rbac-tab.active {
    color: var(--navy-primary);
    border-bottom-color: var(--navy-accent);
}

.rbac-userpick { max-width: 420px; margin-bottom: 16px; }

.rbac-userbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--navy-accent);
}

.rbac-userbar-main {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--navy-primary);
}

.rbac-userbar-main > i { font-size: 18px; color: var(--navy-accent); }

.rbac-userbar-sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.rbac-ovr-chip {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    background: #fdecd6;
    color: #c4701a;
    border: 1px solid #f8dab4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rbac-ovr-chip.off {
    background: #e2f6ea;
    color: #1f8b4c;
    border-color: #c7eed6;
}

.rbac-selfnote {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* the exception marker — this cell no longer follows the role */
.rbac-dot.ovr {
    box-shadow: 0 0 0 2px #e8a200;
    border-color: #e8a200;
}

.rbac-ovr-key {
    display: inline-block;
    width: 11px;
    height: 11px;
    vertical-align: -1px;
    background: var(--success);
    box-shadow: 0 0 0 2px #e8a200;
}

.rbac-utable { table-layout: auto; }
.rbac-utable td, .rbac-utable th { text-align: center; }

.rbac-hardnote {
    font-size: 11px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rbac-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.rbac-empty > i { font-size: 34px; opacity: 0.4; display: block; margin-bottom: 10px; }
.rbac-empty p { font-size: 13px; margin: 0; }

/* users.php per-user access shortcut */
.act-perm { color: var(--navy-light); font-size: 15px; }
body.dark-mode .act-perm { color: color-mix(in srgb, var(--navy-light) 45%, #fff); }
.act-perm:hover { transform: scale(1.18); }

/* Dark Mode — RBAC matrix */
body.dark-mode .rbac-wrap {
    border-color: var(--border-color);
}

body.dark-mode .rbac-table th,
body.dark-mode .rbac-table td {
    border-bottom-color: var(--border-color);
    border-right-color: var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .rbac-table thead th,
body.dark-mode .rbac-table thead th.rbac-pagecol {
    background: var(--navy-dark);
}

body.dark-mode .rbac-table td.rbac-pagecol {
    color: var(--text-primary);
    background: var(--bg-card);
    box-shadow: 1px 0 0 var(--border-color);
}

body.dark-mode .rbac-grouprow td {
    background: var(--bg-primary) !important;
    color: var(--text-muted);
}

body.dark-mode .rbac-dot {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

body.dark-mode .rbac-dot.on {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

body.dark-mode .perm-off {
    color: #5a5a78;
}

/* ===== Slight curved feel — global rounding polish (subtle, dashboard-wide) ===== */
/* larger surfaces / cards */
.data-section,
.lte-card,
.account-info-card,
.settings-mega-card,
.theme-preview-container,
.notification-dropdown,
.header-tool-dropdown,
.about-table-wrapper,
.setup-guide-table,
.small-box,
.stat-card,
.info-box,
.modal-content,
.modal-box { border-radius: 14px !important; }

/* controls / chips / smaller elements */
.palette-card,
.notification-item,
.btn,
.mode-toggle-btn,
.lang-item,
.theme-quick-swatch,
.action-badge,
.hex-input,
.color-picker-input,
.data-section input:not([type="file"]),
.data-section select,
.data-section textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea { border-radius: 10px !important; }
/* file input stays squared per DaisyUI standard — do not round */

/* ===== Smooth SPA-like navigation (View Transitions) ===== */
/* opt every page into cross-document transitions — clicking the sidebar crossfades
   the content while the sidebar / bottom-nav / header tools stay put (no white flash).
   Unsupported browsers just navigate normally (graceful fallback). */
@view-transition { navigation: auto; }

.sidebar           { view-transition-name: app-sidebar; }
.mobile-bottom-nav { view-transition-name: app-mobilenav; }
.header-right      { view-transition-name: app-headertools; }

/* persistent chrome — snap instantly, don't crossfade */
::view-transition-group(app-sidebar),
::view-transition-group(app-mobilenav),
::view-transition-group(app-headertools) { animation-duration: 0s; }

/* content area — gentle crossfade + rise */
::view-transition-old(root) { animation: rsPageOut 0.16s ease both; }
::view-transition-new(root) { animation: rsPageIn 0.30s ease both; }
@keyframes rsPageOut { to { opacity: 0; } }
@keyframes rsPageIn { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ===== DaisyUI-style file input — squared button, follows the user's palette ===== */
.file-input {
    display: block;
    width: 100%;
    height: 48px;
    line-height: 46px;
    padding: 0;
    font-size: 16px;
    color: var(--text-secondary);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.file-input:hover  { border-color: var(--navy-accent); }
.file-input:focus  { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.18); }
.file-input:disabled { opacity: 0.55; cursor: not-allowed; }
.file-input::file-selector-button {
    height: 46px;
    margin: 0 14px 0 0;
    padding: 0 20px;
    border: 0;
    border-right: 1px solid var(--input-border);
    border-radius: 0;
    background: rgba(var(--navy-accent-rgb), 0.14);
    color: var(--navy-accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
}
.file-input::file-selector-button:hover { background: var(--navy-accent); color: #fff; }

/* ===== Upload drop zone (sidebar.php upgrades every .file-input) — dashed zone, picked file card, inline error ===== */
.rs-drop { position: relative; display: block; min-height: 76px; padding: 14px 16px; border: 1.5px dashed color-mix(in srgb, var(--navy-accent) 45%, var(--border-color));
    border-radius: var(--r-ctrl, 4px); background: rgba(var(--navy-accent-rgb), .04); transition: border-color .2s, background .2s, box-shadow .2s; }
.rs-drop .rs-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; font-size: 16px; border: 0; }
.rs-drop:hover, .rs-drop.is-over { border-color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .08); }
.rs-drop.is-over { box-shadow: 0 0 0 4px rgba(var(--navy-accent-rgb), .14); }
.rs-drop:focus-within { border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .18); }
.rs-drop:has(.rs-drop-input:disabled) { opacity: .55; }
.rs-drop:has(.rs-drop-input:disabled) .rs-drop-input { cursor: not-allowed; }
.rs-drop-empty, .rs-drop-file { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rs-drop-file, .rs-drop-err { display: none; }
.rs-drop[data-state="ready"] .rs-drop-empty { display: none; }
.rs-drop[data-state="ready"] .rs-drop-file { display: flex; }
.rs-drop[data-state="error"] { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.rs-drop[data-state="error"] .rs-drop-err { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.rs-drop-ico { flex: 0 0 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-ctrl, 4px);
    background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); font-size: 19px; }
.rs-drop-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rs-drop-txt strong { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-drop-txt strong u { color: var(--navy-accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.rs-drop-txt small { font-size: 12px; color: var(--text-muted); }
.rs-drop-thumb { flex: 0 0 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--r-ctrl, 4px);
    background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); font-size: 20px; border: 1px solid var(--border-color); }
.rs-drop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rs-drop-file .rs-drop-txt { flex: 1; }
.rs-drop-x { position: relative; z-index: 2; flex: 0 0 34px; height: 34px; border: 1px solid var(--border-color); border-radius: var(--r-chip, 3px);
    background: var(--bg-card); color: var(--text-muted); cursor: pointer; }
.rs-drop-x:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 600px) { .rs-drop { padding: 12px; } .rs-drop-ico, .rs-drop-thumb { flex-basis: 38px; height: 38px; } }

/* ===== My Account — themed cards (every colour here rides the theme vars) ===== */
.acct-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 22px 24px 24px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.acct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.acct-head-txt h2 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0; }
.acct-head-txt p  { font-size: 13px; color: var(--text-muted); margin: 3px 0 0; }
.acct-chip {
    flex: 0 0 38px; width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    background: rgba(var(--navy-accent-rgb), 0.13);
    font-size: 16px;
}
.acct-chip i { color: var(--navy-accent); }

/* profile photo + upload */
.acct-photo { display: flex; align-items: flex-start; gap: 26px; flex-wrap: wrap; }
.acct-avatar-col { flex: 0 0 auto; text-align: center; }
.acct-avatar {
    position: relative;
    width: 116px; height: 116px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(var(--navy-accent-rgb), 0.12);
    border: 1px solid rgba(var(--navy-accent-rgb), 0.28);
}
.acct-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-avatar #defaultProfileIcon { font-size: 52px; color: rgba(var(--navy-accent-rgb), 0.75); }
.acct-avatar-cam {
    position: absolute; right: 2px; bottom: 4px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--navy-primary);
    border: 2px solid var(--bg-card);
}
.acct-avatar-cam i { color: #fff; font-size: 12px; }
.acct-avatar-label { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }

.acct-upload { flex: 1 1 320px; min-width: 260px; }
.acct-upload-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.acct-upload-label i { color: var(--navy-accent); }
.acct-upload .form-actions { margin-top: 12px; }

/* account info tiles */
.acct-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.acct-info {
    display: flex; align-items: center; gap: 13px;
    padding: 4px 20px;
    border-left: 1px solid var(--border-light);
}
.acct-info:first-child { border-left: 0; padding-left: 0; }
.acct-info-icon {
    flex: 0 0 44px; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: rgba(var(--navy-accent-rgb), 0.13);
    font-size: 17px;
}
.acct-info-icon i { color: var(--navy-accent); }
.acct-info-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acct-info-label { font-size: 12.5px; color: var(--text-muted); }
.acct-info-value { font-size: 15px; font-weight: 700; color: var(--text-primary); word-break: break-word; }

/* forms inside account cards */
.acct-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; }
.acct-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; }
.acct-card .form-group { margin-bottom: 0; }
.acct-card .form-group label {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
}
.acct-card .form-group label i { color: var(--navy-accent); }
.acct-req::after { content: ' *'; color: var(--danger); font-weight: 700; }
.acct-card input[type="text"],
.acct-card input[type="email"],
.acct-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.acct-card input:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.18);
}
.acct-pw { position: relative; }
.acct-pw input { padding-right: 46px !important; }
.acct-eye {
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    background: none; border: 0; border-radius: 8px;
    color: var(--text-muted); font-size: 15px; line-height: 1;
    cursor: pointer; transition: all 0.2s;
}
.acct-eye:hover { color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.1); }

.acct-card .form-actions { display: flex; gap: 12px; margin-top: 22px; }
.acct-pw-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.acct-note {
    flex: 1; min-width: 240px;
    display: flex; align-items: center; gap: 9px;
    padding: 11px 15px;
    border-radius: 10px;
    background: rgba(var(--navy-accent-rgb), 0.08);
    border: 1px solid rgba(var(--navy-accent-rgb), 0.18);
    font-size: 13px; color: var(--text-secondary);
}
.acct-note i { color: var(--navy-accent); }
.acct-card .btn-primary {
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--navy-accent) 0%, rgba(var(--navy-accent-rgb), 0.82) 100%);
    color: #fff;
}
.acct-card .btn-primary:hover { background: var(--navy-accent); filter: brightness(1.08); transform: translateY(-2px); }

/* dark mode — beat the blanket div/span colour rule */
body.dark-mode .acct-info-label,
body.dark-mode .acct-avatar-label,
body.dark-mode .acct-head-txt p { color: var(--text-muted) !important; }
body.dark-mode .acct-drop { background: rgba(var(--navy-accent-rgb), 0.09); }

@media (max-width: 1100px) {
    .acct-info-grid { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
    .acct-info:nth-child(odd) { border-left: 0; padding-left: 0; }
    .acct-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .acct-card { padding: 18px 16px 20px; }
    .acct-photo { flex-direction: column; align-items: center; }
    .acct-upload { width: 100%; min-width: 0; }
    .acct-info-grid { grid-template-columns: 1fr; }
    .acct-info { border-left: 0; padding: 0; }
    .acct-grid-2, .acct-grid-3 { grid-template-columns: 1fr; }
    .acct-pw-actions { flex-direction: column; align-items: stretch; }
    .acct-note { min-width: 0; }
}

/* ===== Auth — SaaS split: form left, showcase right ===== */
.auth-body {
    position: relative;
    min-height: 100dvh;
    display: flex;
    background-color: var(--bg-primary);
    /* soft theme-tinted glows — light wash, recolours with the site palette */
    background-image:
        radial-gradient(760px 470px at 10% 6%,   rgba(var(--navy-accent-rgb), 0.20), transparent 62%),
        radial-gradient(700px 430px at 90% 4%,   rgba(var(--navy-light-rgb), 0.16), transparent 60%),
        radial-gradient(860px 540px at 82% 98%,  rgba(var(--navy-accent-rgb), 0.16), transparent 64%),
        radial-gradient(660px 420px at 6% 96%,   rgba(var(--navy-primary-rgb), 0.12), transparent 62%);
    background-attachment: fixed;
    background-repeat: no-repeat;
}
/* faint dot texture over the wash */
.auth-body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: radial-gradient(rgba(var(--navy-primary-rgb), 0.09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(1000px 700px at 30% 40%, #000 20%, transparent 78%);
            mask-image: radial-gradient(1000px 700px at 30% 40%, #000 20%, transparent 78%);
    pointer-events: none;
    z-index: 0;
}
/* full-bleed: the card IS the viewport. transparent so the body wash shows through */
.auth-wrap {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 100dvh;
}
.auth-card {
    flex: 1;
    width: 100%; min-height: 100dvh;
    display: grid; grid-template-columns: 1fr 1fr;
    background: transparent;
}

/* ---------- left: form column ---------- */
.auth-form-col {
    position: relative;
    display: flex; flex-direction: column;
    min-width: 0; max-height: 100dvh;
    padding: 24px 30px 20px;
    overflow-y: auto;                       /* long errors scroll the column, never the page */
}
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.auth-brandmark {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--navy-primary); font-size: 15.5px; font-weight: 800;
    text-decoration: none; letter-spacing: -0.2px;
}
.auth-brandmark img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.auth-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border-color); border-radius: 50%;
    background: var(--bg-card); color: var(--text-secondary);
    font-size: 15px; cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: color 0.2s, border-color 0.2s;
}
.auth-toggle:hover { color: var(--navy-accent); border-color: var(--navy-accent); }

.auth-form-inner { width: 100%; max-width: 392px; margin: auto; }
.auth-form-inner .error,
.auth-form-inner .success { margin: 0 0 16px; text-align: left; }

/* badge on a graph-paper wash, like the reference */
.auth-badge-wrap { position: relative; display: flex; justify-content: center; margin-bottom: 16px; }
.auth-badge-wrap::before {
    content: '';
    position: absolute; left: 50%; top: 50%;
    width: 300px; height: 150px;
    transform: translate(-50%, -50%);
    background-image:
        linear-gradient(rgba(var(--navy-primary-rgb), 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--navy-primary-rgb), 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(closest-side, #000 8%, transparent 76%);
            mask-image: radial-gradient(closest-side, #000 8%, transparent 76%);
    pointer-events: none;
}
.auth-badge {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    border-radius: 15px;
    background: linear-gradient(140deg, var(--navy-accent) 0%, rgba(var(--navy-accent-rgb), 0.72) 100%);
    color: #fff; font-size: 19px;
    box-shadow: 0 10px 24px rgba(var(--navy-accent-rgb), 0.34);
}
.auth-form-inner h1 { font-size: 25px; font-weight: 800; color: var(--navy-primary); text-align: center; margin: 0 0 7px; }
.auth-sub { font-size: 14px; color: var(--text-muted); text-align: center; margin: 0 0 26px; }

.auth-group { margin-bottom: 16px; }
.auth-group label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.auth-group label i { color: var(--navy-accent); }
.auth-field { position: relative; }
.auth-field-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }
.auth-field input {
    width: 100%; height: 52px;
    padding: 0 16px;
    border: 1px solid var(--input-border);
    border-radius: 11px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.auth-field-icon ~ input { padding-left: 46px; }
.auth-field input:focus {
    outline: none;
    border-color: var(--navy-accent);
    background: rgba(var(--navy-accent-rgb), 0.04);
    box-shadow: 0 0 0 4px rgba(var(--navy-accent-rgb), 0.14);
}
.auth-eye {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%);
    padding: 9px;
    background: none; border: 0; border-radius: 9px;
    color: var(--text-muted); font-size: 16px; line-height: 1;
    cursor: pointer; transition: all 0.2s;
}
.auth-eye:hover { color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.1); }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 20px; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-secondary); cursor: pointer; }
.auth-check input { width: 17px; height: 17px; accent-color: var(--navy-accent); cursor: pointer; }
.auth-link { color: var(--navy-accent); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-submit {
    width: 100%; height: 52px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: 11px;
    background: linear-gradient(120deg, var(--navy-accent) 0%, rgba(var(--navy-accent-rgb), 0.78) 100%);
    color: #fff; font-size: 16px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(var(--navy-accent-rgb), 0.32);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    touch-action: manipulation;
}
.auth-submit:hover  { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 28px rgba(var(--navy-accent-rgb), 0.40); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: 0.65; cursor: not-allowed; pointer-events: none; transform: none; }

/* divider — flex rules, no opaque chip needed over the wash */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.auth-or span { color: var(--text-muted); font-size: 12.5px; font-weight: 600; }

.auth-google {
    width: 100%; height: 52px;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    border: 1px solid var(--input-border);
    border-radius: 11px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 15px; font-weight: 600;
    font-family: inherit;                   /* verify_otp uses this on a <button> — buttons don't inherit */
    text-decoration: none; cursor: pointer;
    transition: all 0.25s;
}
.auth-google:hover { border-color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.05); }
.auth-signup { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--text-secondary); }
.auth-maint { margin-top: 16px; text-align: left; }

/* footer sits at the bottom of the column — flow, not absolute */
.auth-foot { width: 100%; padding-top: 18px; }
.auth-copy {
    position: static;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    padding: 10px 0 0; text-align: center;
    font-size: 12.5px; color: var(--text-muted);
}
.auth-copy i { color: var(--navy-accent); }

/* ---------- right: showcase panel ---------- */
.auth-showcase { display: flex; padding: 14px; min-width: 0; }
.auth-showcase-card {
    position: relative;
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center;
    padding: 46px 38px 32px;
    border: 1px solid rgba(var(--navy-accent-rgb), 0.16);
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(165deg,
        rgba(var(--navy-accent-rgb), 0.20) 0%,
        rgba(var(--navy-light-rgb), 0.10) 44%,
        var(--bg-card) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.auth-show-title {
    margin: 0; text-align: center;
    font-size: clamp(22px, 2.1vw, 30px); font-weight: 800; letter-spacing: -0.4px;
    color: var(--navy-primary);
}
.auth-show-title span { color: var(--navy-accent); }

/* orbit — one size var drives rings + radii so nothing is hand-tuned per breakpoint */
.auth-orbit {
    position: relative;
    --d: clamp(230px, 22vw, 380px);
    width: var(--d); height: var(--d);
    margin: auto;
}
.auth-orbit::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 62%; height: 62%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--navy-accent-rgb), 0.30), transparent 72%);
    animation: authGlow 3.8s ease-in-out infinite;
    pointer-events: none;
}
.auth-ring {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(var(--navy-accent-rgb), 0.20);
    border-radius: 50%;
}
.auth-ring.r1 { width: calc(var(--d) * 0.46); height: calc(var(--d) * 0.46); }
.auth-ring.r2 { width: calc(var(--d) * 0.72); height: calc(var(--d) * 0.72); }
.auth-ring.r3 { width: var(--d); height: var(--d); border-style: dashed; border-color: rgba(var(--navy-accent-rgb), 0.16); }

.auth-orbit-core {
    position: absolute; top: 50%; left: 50%;
    width: calc(var(--d) * 0.30); height: calc(var(--d) * 0.30);
    transform: translate(-50%, -50%);
    padding: 5px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--navy-accent) 0%, rgba(var(--navy-accent-rgb), 0.62) 100%);
    box-shadow: 0 18px 40px rgba(var(--navy-accent-rgb), 0.36), 0 0 0 7px rgba(255, 255, 255, 0.55);
    z-index: 2;
}
.auth-orbit-core img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* slot places the chip on the ring; the trailing rotate keeps it upright */
.auth-orbit-slot {
    position: absolute; top: 50%; left: 50%;
    --sz: 46px;
    width: var(--sz); height: var(--sz);
    margin: calc(var(--sz) / -2);
    /* fallbacks matter: one undefined var invalidates the whole declaration and drops the chip dead centre */
    transform: rotate(var(--a, 0deg)) translateX(var(--r, 0px)) rotate(calc(-1 * var(--a, 0deg)));
    z-index: 1;
}
.auth-orbit-slot.s1 { --a: -75deg;  --r: calc(var(--d) * 0.23); --sz: 40px; }
.auth-orbit-slot.s2 { --a: 205deg;  --r: calc(var(--d) * 0.36); }
.auth-orbit-slot.s3 { --a: -25deg;  --r: calc(var(--d) * 0.36); }
.auth-orbit-slot.s4 { --a: 160deg;  --r: calc(var(--d) * 0.50); --sz: 44px; }
.auth-orbit-slot.s5 { --a: 35deg;   --r: calc(var(--d) * 0.50); --sz: 44px; }
.auth-orbit-slot.s6 { --a: 95deg;   --r: calc(var(--d) * 0.50); --sz: 42px; }

.auth-orbit-chip {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    font-size: 18px;
    box-shadow: 0 8px 20px rgba(var(--navy-primary-rgb), 0.16), 0 0 0 1px rgba(var(--navy-primary-rgb), 0.05);
    animation: authFloat 5.4s ease-in-out infinite;
}
.auth-orbit-slot.s2 .auth-orbit-chip { animation-delay: -0.8s; }
.auth-orbit-slot.s3 .auth-orbit-chip { animation-delay: -1.7s; }
.auth-orbit-slot.s4 .auth-orbit-chip { animation-delay: -2.6s; }
.auth-orbit-slot.s5 .auth-orbit-chip { animation-delay: -3.4s; }
.auth-orbit-slot.s6 .auth-orbit-chip { animation-delay: -4.2s; }
.auth-orbit-chip.c-smtp   i { color: var(--navy-accent); }
.auth-orbit-chip.c-google i { color: #4285F4; }
.auth-orbit-chip.c-drive  i { color: #1FA463; }
.auth-orbit-chip.c-wa     i { color: #25D366; }
.auth-orbit-chip.c-ms     i { color: #00A4EF; }

@keyframes authFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes authGlow  { 0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.07); } }

/* rotating captions + dots */
.auth-slides { position: relative; width: 100%; max-width: 430px; min-height: 66px; }
.auth-slide {
    position: absolute; inset: 0;
    margin: 0; text-align: center;
    font-size: 14.5px; line-height: 1.55; color: var(--text-secondary);
    opacity: 0; transform: translateY(7px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}
.auth-slide.is-active { opacity: 1; transform: none; }
.auth-slide b { color: var(--navy-primary); font-weight: 700; }
.auth-dots { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; }
.auth-dot {
    width: 7px; height: 7px; padding: 0;
    border: 0; border-radius: 4px;
    background: rgba(var(--navy-primary-rgb), 0.22);
    cursor: pointer;
    transition: width 0.3s, background 0.3s;
}
.auth-dot.is-active { width: 22px; background: var(--navy-accent); }

/* ---------- dark mode — beat the blanket p/span/div/label colour rules ---------- */
body.dark-mode.auth-body {
    background-image:
        radial-gradient(760px 470px at 10% 6%,  rgba(var(--navy-accent-rgb), 0.22), transparent 64%),
        radial-gradient(700px 430px at 90% 4%,  rgba(var(--navy-light-rgb), 0.26), transparent 62%),
        radial-gradient(860px 540px at 82% 98%, rgba(var(--navy-accent-rgb), 0.15), transparent 66%);
}
body.dark-mode.auth-body::before { background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px); }
body.dark-mode .auth-brandmark,
body.dark-mode .auth-brandmark span { color: var(--text-primary) !important; }
body.dark-mode .auth-form-inner h1 { color: var(--text-primary) !important; }  /* h1-h6 blanket at 3683 is !important */
body.dark-mode .auth-sub,
body.dark-mode .auth-copy,
body.dark-mode .auth-or span,
body.dark-mode .auth-signup,
body.dark-mode .auth-check span { color: var(--text-muted) !important; }
body.dark-mode .error { background: rgba(234, 67, 53, 0.10); border-color: rgba(234, 67, 53, 0.30); }
body.dark-mode .auth-showcase-card {
    border-color: rgba(var(--navy-accent-rgb), 0.28);
    box-shadow: none;
    background: linear-gradient(165deg,
        rgba(var(--navy-accent-rgb), 0.22) 0%,
        rgba(var(--navy-light-rgb), 0.30) 46%,
        var(--bg-card) 100%);
}
body.dark-mode .auth-show-title { color: var(--text-primary) !important; }
body.dark-mode .auth-show-title span { color: var(--navy-accent) !important; }
body.dark-mode .auth-slide { color: var(--text-secondary) !important; }
body.dark-mode .auth-slide b { color: var(--text-primary) !important; }
body.dark-mode .auth-ring { border-color: rgba(var(--navy-accent-rgb), 0.32); }
body.dark-mode .auth-orbit-chip { background: var(--bg-secondary); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38); }
body.dark-mode .auth-orbit-core { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 7px rgba(255, 255, 255, 0.10); }
body.dark-mode .auth-dot { background: rgba(255, 255, 255, 0.22); }

/* ---------- responsive ---------- */
/* short windows — shrink the orbit before it crowds the caption out of the card */
@media (max-height: 780px) {
    .auth-orbit { --d: clamp(190px, 17vw, 290px); }
    .auth-showcase-card { padding: 32px 32px 26px; }
}
@media (max-width: 1024px) {
    .auth-card { grid-template-columns: 1fr; min-height: 0; }
    .auth-showcase { display: none; }
    .auth-form-col { max-height: none; overflow: visible; padding: 20px 24px 18px; }
}
@media (max-width: 560px) {
    .auth-form-col { padding: 16px 18px 16px; }
    .auth-form-inner h1 { font-size: 22px; }
    .auth-sub { margin-bottom: 22px; }
    .auth-brandmark { font-size: 14.5px; }
    .auth-brandmark img { width: 30px; height: 30px; }
}

/* ===== Auth transitions — login <-> signup slide, showcase stays put =====
   Cross-document view transitions (opted in globally above). The showcase panel is
   identical on every auth page, so it gets its own snapshot and never moves. */
.auth-showcase   { view-transition-name: auth-brand; }
.auth-form-inner { view-transition-name: auth-form; }

/* showcase box = same on every page -> hold it perfectly still, no crossfade */
::view-transition-group(auth-brand) { animation-duration: 0s; }
::view-transition-old(auth-brand),
::view-transition-new(auth-brand)   { animation: none; }

/* default pair — forgot/reset/verify carry no html.auth-* class, so without this
   they fall back to the unstyled group animation instead of a clean fade */
::view-transition-old(auth-form) { animation: authFadeOut 0.18s ease both; }
::view-transition-new(auth-form) { animation: authFadeIn 0.34s cubic-bezier(.16, 1, .3, 1) both; }

/* form slides in the direction you travelled — class sits on <html> per page */
.auth-signup::view-transition-old(auth-form) { animation: authOutLeft 0.20s ease both; }
.auth-signup::view-transition-new(auth-form) { animation: authInRight 0.40s cubic-bezier(.16, 1, .3, 1) both; }
.auth-login::view-transition-old(auth-form)  { animation: authOutRight 0.20s ease both; }
.auth-login::view-transition-new(auth-form)  { animation: authInLeft 0.40s cubic-bezier(.16, 1, .3, 1) both; }

@keyframes authFadeOut { to   { opacity: 0; transform: translateY(-8px); } }
@keyframes authFadeIn  { from { opacity: 0; transform: translateY(10px); } }
@keyframes authOutLeft  { to   { opacity: 0; transform: translateX(-38px); } }
@keyframes authInRight  { from { opacity: 0; transform: translateX(38px); } }
@keyframes authOutRight { to   { opacity: 0; transform: translateX(38px); } }
@keyframes authInLeft   { from { opacity: 0; transform: translateX(-38px); } }

/* no view transitions (older Safari/Firefox) -> plain entrance so it still feels alive */
@supports not (view-transition-name: none) {
    .auth-form-inner { animation: authFadeIn 0.45s cubic-bezier(.16, 1, .3, 1) 0.05s both; }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(auth-form), ::view-transition-new(auth-form) { animation: none; }
    .auth-form-inner { animation: none; }
    .auth-orbit-chip, .auth-orbit::before { animation: none; }
    .auth-slide { transition: none; }
}

/* ===== Google Drive backup card ===== */
.gdrive-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
@media (max-width: 576px) {
    .gdrive-actions { flex-direction: column; }
    .gdrive-actions .btn { width: 100%; }
}

/* bottom bar now carries up to 5 entries — tighten so nothing wraps on small phones */
.mobile-bottom-nav .mobile-nav-item { position: relative; padding: 8px 6px; min-width: 0; flex: 1; }
.mobile-nav-pill {
    position: absolute; top: 3px; right: 50%; margin-right: -20px;
    background: var(--danger); color: #fff; font-style: normal; font-weight: 700;
    font-size: 9px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 360px) {
    .mobile-bottom-nav .mobile-nav-item { font-size: 9px; padding: 8px 3px; }
}

/* chat scope segmented control — same visual language as the V/A/E/D dots */
.rbac-scope { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.rbac-scope-btn {
    padding: 4px 8px; border: 1px solid #d4d4d4; background: #fff; color: #999;
    font-size: 10px; font-weight: 700; cursor: pointer; border-radius: 0;
    transition: all .12s; white-space: nowrap;
}
.rbac-scope-btn:hover:not(:disabled) { border-color: var(--navy-accent); }
.rbac-scope-btn.on { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
.rbac-scope-btn.locked { opacity: .45; cursor: not-allowed; }
body.dark-mode .rbac-scope-btn { background: var(--input-bg); border-color: var(--input-border); color: var(--text-muted); }
body.dark-mode .rbac-scope-btn.on { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }

/* ===== Chat — same language as the sidebar =====
   tinted contact list with sidebar-style rows, white thread panel, squared bubbles in the palette colour.
   Page-scoped: everything sits under .page-chat / .chat-*; colours come from the theme tokens. */

body.page-chat {
    --wa-teal:  var(--navy-accent);
    --wa-green: var(--navy-accent);
    --wa-out:   color-mix(in srgb, var(--navy-accent) 13%, var(--bg-card));   /* my bubble */
    --wa-in:    var(--bg-card);                                               /* their bubble */
    --wa-bg:    color-mix(in srgb, var(--navy-accent) 3%, var(--bg-secondary)); /* thread ground */
    --wa-panel: var(--bg-card);
    --wa-head:  color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)); /* = sidebar panel */
    --wa-hover: rgba(var(--navy-accent-rgb), 0.07);
    --wa-line:  var(--border-color);
    --wa-txt:   var(--text-primary);
    --wa-mut:   var(--text-muted);
    --wa-tick:  var(--navy-accent);
    --wa-r:     var(--sb-r, 4px);
}

.chat-banner {
    display: flex; align-items: center; gap: 10px;
    background: #fff3cd; color: #664d03;
    border-bottom: 1px solid #ffe69c;
    padding: 10px 16px; font-size: 13px;
}
body.page-chat.dark-mode .chat-banner { background: #332701; color: #ffda6a; border-bottom-color: #4a3800; }

/* thin indeterminate bar — reads and writes both drive it, never a blocking popup */
.chat-bar { height: 3px; background: transparent; overflow: hidden; }
.chat-bar.on::after {
    content: ''; display: block; height: 100%; width: 40%;
    background: var(--wa-green);
    animation: chat-bar-slide 1s linear infinite;
}
@keyframes chat-bar-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.chat-wrap {
    display: grid; grid-template-columns: 380px 1fr;
    height: calc(100vh - 220px); min-height: 460px;
    background: var(--wa-panel);
    border: 1px solid var(--wa-line); border-radius: var(--wa-r);
    box-shadow: 0 1px 3px var(--shadow-color); overflow: hidden;
}

/* ---------- left panel ---------- */
.chat-side { display: flex; flex-direction: column; overflow: hidden; background: var(--wa-head); }
.chat-side-head {
    display: flex; gap: 8px; align-items: center;
    padding: 8px; background: transparent; border-bottom: 1px solid var(--wa-line);
}
.chat-search { position: relative; flex: 1; }
.chat-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--wa-mut); font-size: 13px; }
.chat-search input {
    width: 100%; padding: 9px 14px 9px 40px; font-size: 16px;
    background: var(--wa-panel); color: var(--wa-txt);
    border: 1px solid var(--wa-line); border-radius: var(--wa-r) !important;
}
.chat-search input::placeholder { color: var(--wa-mut); }
.chat-search input:focus { outline: none; border-color: var(--wa-teal); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15); }

.chat-contacts { flex: 1; overflow-y: auto; padding: 8px; background: transparent; }
/* rows = sidebar rows: hover tint, active = white card with a hairline */
.chat-contact {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 9px 10px; background: none; border: 1px solid transparent; border-radius: var(--wa-r);
    text-align: left; cursor: pointer; color: var(--wa-txt);
    transition: background-color .2s, border-color .2s;
}
.chat-contact + .chat-contact { margin-top: 2px; }
.chat-contact:hover  { background: var(--wa-hover); }
.chat-contact.active { background: var(--bg-card); border-color: var(--wa-line); box-shadow: 0 1px 3px var(--shadow-color); }
.chat-contact:focus-visible { outline: 2px solid var(--wa-teal); outline-offset: -3px; }
.chat-contact.has-unread .chat-contact-top strong { font-weight: 700; }
.chat-contact.has-unread .chat-contact-sub span { color: var(--wa-txt); }
.chat-contact { position: relative; }
.chat-contact img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--wa-head); }
.chat-contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-contact-top  { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-contact-top strong { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact-time { font-size: 12px; color: var(--wa-mut); flex-shrink: 0; }
.chat-contact.has-unread .chat-contact-time { color: var(--wa-green); }
.chat-contact-sub {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 13px; color: var(--wa-mut);
}
.chat-contact-sub span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.chat-pill {
    background: var(--wa-green); color: #fff; font-size: 12px; font-style: normal; font-weight: 600;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 3px;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- thread ---------- */
.chat-pane { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--wa-bg); }
.chat-thread, .chat-blank { position: relative; z-index: 1; }
.chat-head, .chat-composer { position: relative; z-index: 1; }
.chat-thread[hidden], .chat-blank[hidden] { display: none; }
.chat-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.chat-blank, .chat-none {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 40px 20px; text-align: center; color: var(--wa-mut);
    background: var(--wa-bg);
}
.chat-blank i {
    width: 84px; height: 84px; border-radius: var(--wa-r);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 34px; color: var(--wa-teal); background: rgba(var(--navy-accent-rgb), .12);
}
.chat-blank h3 { color: var(--wa-txt); font-size: 20px; font-weight: 600; }
.chat-none i { font-size: 26px; opacity: .5; }
.chat-none-lg { height: 100%; background: transparent; }

.chat-head {
    display: flex; align-items: center; gap: 13px; flex-shrink: 0;
    padding: 10px 16px; background: var(--wa-panel); border-bottom: 1px solid var(--wa-line);
}
.chat-head-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-head-info { display: flex; flex-direction: column; }
.chat-head-info strong { font-size: 15px; font-weight: 600; color: var(--wa-txt); }
.chat-head-info span  { font-size: 13px; color: var(--wa-mut); }
.chat-back { display: none; background: none; border: none; color: var(--wa-txt); font-size: 18px; cursor: pointer; padding: 4px 6px; }

/* ---------- messages + wallpaper ---------- */
.chat-msgs {
    flex: 1; overflow-y: auto; padding: 14px 6%;
    display: flex; flex-direction: column; gap: 2px;
    background: transparent;
}

.chat-day { text-align: center; margin: 12px 0; }
.chat-day span {
    display: inline-block; padding: 4px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
    text-transform: uppercase; color: var(--wa-mut);
    background: var(--wa-in); border: 1px solid var(--wa-line); border-radius: 3px;
}

.chat-msg { display: flex; max-width: 65%; }
.chat-msg.mine { align-self: flex-end; justify-content: flex-end; }
.chat-msg + .chat-msg { margin-top: 2px; }
.chat-msg.starts-run { margin-top: 12px; }

.chat-bub {
    position: relative; padding: 6px 9px 8px; font-size: 14.2px; line-height: 19px;
    background: var(--wa-in); color: var(--wa-txt);
    border: 1px solid var(--wa-line); border-radius: var(--wa-r);
    word-break: break-word; max-width: 100%;
}
.chat-msg.mine .chat-bub { background: var(--wa-out); border-color: rgba(var(--navy-accent-rgb), .28); }

.chat-bub.gone { font-style: italic; color: var(--wa-mut); }
.chat-bub .chat-text { white-space: pre-wrap; }

.chat-tag {
    display: block; margin-bottom: 3px;
    font-size: 12.5px; font-weight: 600; color: var(--wa-teal);
}
.chat-msg.bcast .chat-bub { border-color: rgba(var(--navy-accent-rgb), .45); }

/* time + ticks tuck into the last line of text, dropping to their own line when it's tight */
.chat-meta {
    float: right; position: relative; top: 4px;
    margin: 0 -3px -4px 11px;
    font-size: 11px; color: var(--wa-mut); line-height: 15px; white-space: nowrap;
}
.chat-meta i { font-size: 12px; margin-left: 2px; vertical-align: -1px; }
.chat-meta i.read { color: var(--wa-tick); }
.chat-meta i.failed { color: #ea4335; }
/* optimistic bubble — on screen before the server has confirmed it */
.chat-msg.pending .chat-bub { opacity: .72; }

.chat-img { display: block; margin: -2px -5px 5px; cursor: zoom-in; }
.chat-img img { display: block; max-width: 320px; width: 100%; border-radius: 3px; }
.chat-doc {
    display: flex; align-items: center; gap: 11px; margin-bottom: 3px; padding: 9px 12px;
    background: rgba(var(--navy-accent-rgb), .06); border: 1px solid var(--wa-line); border-radius: var(--wa-r); color: inherit; text-decoration: none;
    transition: background 0.2s;
}
.chat-doc:hover { background: rgba(var(--navy-accent-rgb), .12); }
.chat-doc i {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--wa-r);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; color: var(--wa-teal); background: rgba(var(--navy-accent-rgb), .14);
}
.chat-doc span { display: flex; flex-direction: column; min-width: 0; }
.chat-doc strong { font-size: 13.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.chat-doc em { font-size: 11.5px; font-style: normal; color: var(--wa-mut); text-transform: uppercase; }

/* hover tools stay out of the way until you point at a bubble */
.chat-tools {
    position: absolute; top: 50%; transform: translateY(-50%); display: none; gap: 1px;
    background: var(--wa-panel); border: 1px solid var(--wa-line); border-radius: var(--wa-r); padding: 3px;
    box-shadow: 0 2px 8px var(--shadow-color);
}
.chat-msg:not(.mine) .chat-tools { right: -70px; }
.chat-msg.mine .chat-tools      { left: -70px; }
.chat-msg:hover .chat-tools { display: flex; }
.chat-tools button {
    background: none; border: none; cursor: pointer; font-size: 12px; color: var(--wa-mut);
    width: 26px; height: 26px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center;
}
.chat-tools button:hover { color: #ea4335; background: rgba(234,67,53,.1); }

/* ---------- composer ---------- */
.chat-composer {
    display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0;
    padding: 10px 16px; background: var(--wa-panel); border-top: 1px solid var(--wa-line);
}
.chat-composer textarea {
    flex: 1; resize: none; max-height: 140px; padding: 10px 14px;
    font-size: 16px; font-family: inherit; line-height: 20px;
    background: var(--input-bg); color: var(--wa-txt);
    border: 1px solid var(--input-border); border-radius: var(--wa-r) !important;
}
.chat-composer textarea::placeholder { color: var(--wa-mut); }
.chat-composer textarea:focus { outline: none; border-color: var(--wa-teal); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15); }
.chat-file-hidden { display: none; }
.chat-attach, .chat-send {
    flex-shrink: 0; width: 42px; height: 42px; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--wa-r); touch-action: manipulation;
}
.chat-attach { background: none; color: var(--wa-mut); font-size: 18px; transition: background-color .2s, color .2s; }
.chat-attach:hover { color: var(--wa-txt); background: var(--wa-hover); }
.chat-send { background: var(--wa-teal); color: #fff; font-size: 17px; }
.chat-send { transition: filter 0.2s, transform 0.2s; }
.chat-send:hover:not(:disabled) { filter: brightness(1.08); }
.chat-send:active:not(:disabled) { transform: scale(0.96); }
.chat-send:disabled { opacity: .6; cursor: not-allowed; }
.chat-composer-off {
    justify-content: center; gap: 8px; color: var(--wa-mut); font-size: 13px; padding: 16px;
}

/* ---------- broadcast modal ---------- */
.chat-bcast-note { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.chat-bcast-input {
    width: 100%; resize: vertical; padding: 11px 12px; font-size: 16px; font-family: inherit;
    background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text-primary);
    border-radius: var(--wa-r) !important;
}
.chat-bcast-input:focus { outline: none; border-color: var(--navy-accent); }
.chat-bcast-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- skeletons ---------- */
.chat-skel {
    height: 58px; margin: 0 0 6px; border-radius: var(--wa-r);
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ---- full screen: the shell stops scrolling, the thread owns the viewport ---- */
/* the page stops scrolling; header card on top, the chat card fills the rest */
body.page-chat .main-content { overflow: hidden; display: flex; flex-direction: column; }
body.page-chat .header { flex-shrink: 0; margin-bottom: 16px; }
/* one lone button — keep it in tier 1 so the thread gets the height */
@media (min-width: 769px) {
    body.page-chat .header::after { display: none; }
    body.page-chat .header .head-btns { order: 2; align-self: center; margin-left: auto; }
    body.page-chat .header .header-right { order: 3; margin-left: 16px; }
    body.page-chat .main-content { padding-bottom: 20px !important; }
}
body.page-chat .chat-wrap { flex: 1; height: auto; min-height: 0; }
body.page-chat .chat-bar { flex-shrink: 0; margin: -13px 0 10px; }
body.page-chat .chat-side { border-right: 1px solid var(--wa-line); }

/* ---- mobile: one pane at a time ---- */
@media (max-width: 900px) {
    .chat-wrap { grid-template-columns: 1fr; }
    .chat-pane { display: none; }
    .chat-wrap.thread-open .chat-side { display: none; }
    .chat-wrap.thread-open .chat-pane { display: flex; }
    .chat-back { display: inline-block; }
    .chat-msg { max-width: 82%; }
    .chat-msgs { padding: 12px 4%; }
    .chat-img img { max-width: 240px; }
    .chat-msg:not(.mine) .chat-tools, .chat-msg.mine .chat-tools {
        top: -13px; right: 2px; left: auto; transform: none;
    }
    .chat-jump { right: 14px; bottom: 72px; }
}
@media (max-width: 768px) {
    body.page-chat .main-content { padding-bottom: max(65px, calc(65px + env(safe-area-inset-bottom))); }
    body.page-chat .main-content { padding-left: 10px; padding-right: 10px; }
    body.page-chat .header { margin-bottom: 10px; }
}

/* ---------- jump to latest ---------- */
.chat-jump {
    position: absolute; right: 22px; bottom: 76px; z-index: 3;
    width: 42px; height: 42px; border: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--wa-panel); color: var(--wa-mut); font-size: 15px;
    border: 1px solid var(--wa-line); box-shadow: 0 2px 8px var(--shadow-color);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    cursor: pointer;
}
.chat-jump.on { opacity: 1; visibility: visible; transform: none; }
.chat-jump:hover { color: var(--wa-teal); }

/* ---------- thin themed scrollbars in both panes ---------- */
.chat-contacts, .chat-msgs { scrollbar-width: thin; scrollbar-color: rgba(11,20,26,.22) transparent; }
.chat-contacts::-webkit-scrollbar, .chat-msgs::-webkit-scrollbar { width: 7px; }
.chat-contacts::-webkit-scrollbar-track, .chat-msgs::-webkit-scrollbar-track { background: transparent; }
.chat-contacts::-webkit-scrollbar-thumb, .chat-msgs::-webkit-scrollbar-thumb {
    background: rgba(11,20,26,.2); border-radius: 4px;
}
.chat-contacts::-webkit-scrollbar-thumb:hover, .chat-msgs::-webkit-scrollbar-thumb:hover { background: rgba(11,20,26,.34); }
body.page-chat.dark-mode .chat-contacts, body.page-chat.dark-mode .chat-msgs { scrollbar-color: rgba(255,255,255,.2) transparent; }
body.page-chat.dark-mode .chat-contacts::-webkit-scrollbar-thumb,
body.page-chat.dark-mode .chat-msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }

@media (prefers-reduced-motion: reduce) {
    .chat-jump, .chat-send, .chat-doc { transition: none; }
    .chat-send:hover:not(:disabled), .chat-send:active:not(:disabled) { transform: none; }
}

/* ===== Users — profile photo (same column the sidebar + chat avatars read) ===== */
.form-group-full { grid-column: 1 / -1; }

.dt-photo { width: 64px; text-align: center; }
.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    vertical-align: middle;
}

.user-photo-note { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.user-photo-row { display: flex; align-items: center; gap: 16px; }
.user-photo-preview {
    width: 74px; height: 74px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}
.user-photo-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.user-photo-remove {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--danger);
    cursor: pointer;
}
/* beat .form-group input { width:100% } — a checkbox must stay a checkbox */
.user-photo-fields .user-photo-remove input {
    width: 16px; min-width: 16px; height: 16px;
    accent-color: var(--danger);
    cursor: pointer;
}

body.dark-mode .user-avatar,
body.dark-mode .user-photo-preview { border-color: var(--input-border); }

@media (max-width: 560px) {
    .user-photo-row { flex-direction: column; align-items: flex-start; }
    .user-photo-fields { width: 100%; }
}

/* ===== Page head — one card, two tiers =====
   tier 1: title + breadcrumb | search · tools · account
   tier 2 (under a hairline, only when used): filters left | page buttons right */
.header { flex-wrap: wrap; justify-content: flex-start; column-gap: 16px; row-gap: 0; padding: 14px 18px; }
.header > .head-title { order: 1; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.header .head-title h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.header .head-actions { display: contents; }
.header .header-right { order: 2; margin-left: auto; }
.header::after { content: ''; order: 3; flex: 0 0 100%; height: 0; }
.header:has(.head-filters:not([hidden]), .head-btns .head-btn)::after { height: 1px; margin: 12px 0; background: var(--border-light); }
.header .head-filters { order: 4; flex: 1 1 0; min-width: 0; }
.header .head-btns { order: 5; align-self: flex-start; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.header .head-btns:empty { display: none; }
.header:has(.head-filters:not([hidden])) .head-btns { padding-left: 8px; }

.head-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; line-height: 1.2; color: var(--text-muted); }
.head-crumbs a, .head-crumbs .crumb-group { display: inline-flex; align-items: center; gap: 5px; }
.head-crumbs a { color: var(--navy-accent); font-weight: 600; text-decoration: none; }
.head-crumbs a:hover { text-decoration: underline; }
.head-crumbs .crumb-now { color: var(--text-secondary); font-weight: 600; }
.head-crumbs .crumb-sep { font-size: 8px; opacity: 0.6; }

/* page buttons: icon + tooltip, the primary one keeps its label */
.head-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    width: 38px; height: 38px; padding: 0;
    border: 1px solid rgba(var(--navy-accent-rgb), 0.28); border-radius: 3px;
    background: rgba(var(--navy-accent-rgb), 0.10);
    color: var(--navy-accent);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    white-space: nowrap; cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.head-btn i { font-size: 14px; }
.head-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.head-btn:hover { background: rgba(var(--navy-accent-rgb), 0.2); border-color: var(--navy-accent); }
.head-btn:active { transform: translateY(1px); }
.head-btn:focus-visible { outline: 2px solid var(--navy-accent); outline-offset: 2px; }
.head-btn.primary { width: auto; padding: 0 14px; background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
.head-btn.primary span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.head-btn.primary:hover { filter: brightness(1.08); }
.head-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* filter strip: one bordered 38px control per filter, icon inside; date pairs share one field */
.head-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.head-filters[hidden] { display: none; }
.hf-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.hf-strip[hidden] { display: none; }
.hf-field {
    display: flex; align-items: center; height: 38px; min-width: 0;
    background: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px);
    transition: border-color .2s, box-shadow .2s;
}
.hf-field:hover { border-color: rgba(var(--navy-accent-rgb), .45); }
.hf-field:focus-within, .hf-field:has(.sd-wrap.open) { border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .14); }
.hf-field > label {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 34px; height: 100%; margin: 0; padding-left: 2px; border: 0; background: none;
    color: var(--text-muted); font-size: 13px; cursor: pointer; transition: color .2s;
}
.hf-field:focus-within > label { color: var(--navy-accent); }
.hf-field > input, .hf-field > select {
    height: 100%; min-width: 0; margin: 0; padding: 0 10px 0 0; border: 0 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important; outline: none;
    color: var(--text-primary); font-family: inherit; font-size: 14px !important;
}
.hf-field > input[type="search"] { width: 180px; }
.hf-field > input[type="date"] { width: 128px; padding-right: 4px; }
.hf-range > input[type="date"] + .hf-sep + input { padding-left: 4px; }
.hf-sep { flex: none; padding: 0 6px; color: var(--text-muted); font-size: 11px; }
.hf-field > .sd-wrap { height: 100%; width: 170px; }
.hf-field .sd-trigger { min-height: 0; height: 100%; padding: 0 10px 0 0; border: 0 !important; background: transparent; box-shadow: none !important; font-size: 14px; }

/* quick ranges = one segmented switch */
.hf-seg { display: inline-flex; height: 38px; padding: 3px; gap: 2px; background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px); }
.hf-seg button {
    padding: 0 11px; border: 0; border-radius: 3px; background: transparent; cursor: pointer;
    color: var(--text-secondary); font: 600 12.5px/1 inherit; white-space: nowrap; transition: background-color .2s, color .2s;
}
.hf-seg button:hover { color: var(--text-primary); background: rgba(var(--navy-accent-rgb), .08); }
.hf-seg button.is-on { background: var(--bg-card); color: var(--navy-accent); box-shadow: 0 1px 3px var(--shadow-color); }

/* plain strip buttons + the clear icon: quiet ghosts */
.hf-strip .btn {
    display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; margin: 0;
    border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px) !important; box-shadow: none;
    background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 600; transform: none;
}
.hf-strip .btn:hover { background: rgba(var(--navy-accent-rgb), .08); border-color: rgba(var(--navy-accent-rgb), .45); color: var(--navy-accent); transform: none; }
.hf-strip .btn-icon { width: 38px; padding: 0; justify-content: center; }
.hf-strip .btn-icon:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* page buttons: primary filled, the rest quiet outline squares */
.head-btns .head-btn:not(.primary):not(.danger) { background: var(--bg-card); border-color: var(--border-color); color: var(--text-secondary); }
.head-btns .head-btn:not(.primary):not(.danger):hover { background: rgba(var(--navy-accent-rgb), .08); border-color: rgba(var(--navy-accent-rgb), .45); color: var(--navy-accent); }
.head-btns .head-btn.primary, .head-btns .head-btn.primary :is(i, span) { color: #fff !important; }
.head-btns .head-btn.primary { box-shadow: 0 1px 3px rgba(var(--navy-accent-rgb), .35); }
.header .hdr-search input { background: transparent !important; border: 0 !important; box-shadow: none !important; }

/* searchable dropdown (upgrades a <select>, the select stays the value) */
.sd-wrap { position: relative; display: block; }
.sd-wrap > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.sd-trigger {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 100%; min-height: 38px; padding: 0 10px;
    border: 1px solid var(--input-border); border-radius: 0 3px 3px 0; background: var(--input-bg); color: var(--text-primary);
    font-size: 15px; cursor: pointer; user-select: none;
}
.sd-wrap.open .sd-trigger, .sd-trigger:focus-visible { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.15); }
.sd-label { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-label.sd-ph { color: var(--text-muted); }
.sd-arrow { flex: none; font-size: 11px; color: var(--text-muted); transition: transform 0.2s; }
.sd-wrap.open .sd-arrow { transform: rotate(180deg); }
.sd-panel {
    position: fixed; z-index: 1900; display: flex; flex-direction: column; max-height: 300px;
    background: var(--bg-card); border: 1px solid var(--navy-accent); border-radius: 3px; box-shadow: 0 8px 24px var(--shadow-hover);
}
.sd-search { flex: none; width: 100%; height: 40px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--border-color); outline: none; background: transparent; color: var(--text-primary); font-size: 15px !important; }
.sd-list { overflow-y: auto; overscroll-behavior: contain; }
.sd-item { padding: 9px 12px; font-size: 14px; color: var(--text-primary); cursor: pointer; }
.sd-item:hover, .sd-item.hl { background: rgba(var(--navy-accent-rgb), 0.1); }
.sd-item.sel { background: var(--navy-accent); color: #fff; }
.sd-empty { padding: 12px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* tables: no controls on top — search lives in the header, length + info + paging sit underneath */
.dt-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding-top: 12px; }
.dt-foot .dataTables_length, .dt-foot .dataTables_info, .dt-foot .dataTables_paginate { float: none; padding-top: 0; margin: 0; }
.dt-foot .dataTables_info { margin-right: auto; }

@media (max-width: 768px) {
    .header { padding: 12px 14px; flex-direction: row; align-items: center; gap: 0; } /* an older phone rule stacks it as a column */
    .header .head-title h1 { font-size: 18px; }
    .header .header-right { order: 2; flex: 1 1 100%; margin: 10px 0 0; justify-content: flex-end; }
    .header .head-filters { flex: 1 1 100%; margin: 0 0 10px; }
    .header .head-btns { align-self: auto; }
    .hf-strip, .hf-field { flex: 1 1 100%; }
    .hf-field > input[type="date"], .hf-field > input[type="search"], .hf-field > .sd-wrap { flex: 1 1 auto; width: auto; font-size: 16px !important; }
    .hf-seg { flex: 1 1 100%; } .hf-seg button { flex: 1; }
    .hf-strip .btn { flex: 1 1 auto; justify-content: center; }
    .hf-strip .btn-icon { flex: none; }
    .hf-field:has(+ .btn-icon:last-child) { flex: 1 1 calc(100% - 46px); }
    .header .head-btns { flex: 1 1 100%; justify-content: flex-start; padding-left: 0 !important; }
}

/* ================= Chip-row dense table — only applies to .chip-table ================= */
/* min-width is 1200px in the reference doc for 6-9 grouped columns; ours run 3-4, where 1200
   clips the last column instead of filling space — 900 still guarantees the chips their room */
table.dataTable.chip-table{ width:100%!important; border-collapse:separate; border-spacing:0; min-width:900px; }
table.dataTable.chip-table thead th{ background:var(--navy-primary)!important; color:#fff!important; padding:9px 10px!important; text-align:center; font-weight:700; font-size:13px; white-space:nowrap; border:none; }
table.dataTable.chip-table tbody td{ padding:5px 9px!important; font-size:12.5px; color:var(--text-secondary); vertical-align:middle; border-bottom:1px solid var(--border-light); }
/* DataTables stripe / hover / sorted-column overlays tinted with the palette instead of grey */
table.dataTable{ --dt-row-stripe: var(--navy-accent-rgb); --dt-row-hover: var(--navy-accent-rgb); --dt-column-ordering: var(--navy-accent-rgb); --dt-row-selected: var(--navy-accent-rgb); }
table.dataTable tbody tr:hover td{ background:rgba(var(--navy-accent-rgb), .05); }

/* stacked chip rows in a cell */
.cell-stack{ display:flex; flex-direction:column; gap:3px; }
.chip-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; min-width:152px; white-space:nowrap; }

/* the chip (squared tag = icon + label) — uniform size so values align across rows */
.chip{ display:inline-flex; align-items:center; gap:5px; padding:0 8px; height:21px; min-width:82px; border-radius:3px; font-size:10.8px; font-weight:700; line-height:1; white-space:nowrap; border:1px solid transparent; flex:none; }
.chip i{ font-size:10px; width:11px; text-align:center; }
.chip.is-btn{ cursor:pointer; }
.chip.is-btn:hover{ filter:brightness(.95); }

/* palettes — named by COLOUR/ROLE, never by domain */
/* chip tones follow the active palette (user theme -> Settings default) — --c picks the source colour */
.chip-navy   { background:var(--navy-primary); color:#fff; }
.chip-green  { background:var(--navy-accent); color:#fff; }
:is(.chip-soft-navy, .chip-soft-purple) { --c: var(--navy-primary); }
:is(.chip-link, .chip-teal, .chip-soft-green) { --c: var(--navy-accent); }
:is(.chip-soft-amber, .chip-soft-tan) { --c: var(--navy-light); }
:is(.chip-soft-navy, .chip-soft-purple, .chip-link, .chip-teal, .chip-soft-green, .chip-soft-amber, .chip-soft-tan) {
    background: color-mix(in srgb, var(--c) 10%, var(--bg-card));
    color: color-mix(in srgb, var(--c) 85%, var(--text-primary));
    border-color: color-mix(in srgb, var(--c) 22%, var(--bg-card));
}
/* dark: deep primary/secondary would vanish on a dark card — lift them toward white */
body.dark-mode :is(.chip-soft-navy, .chip-soft-purple) { --c: color-mix(in srgb, var(--navy-primary) 35%, #fff); }
body.dark-mode :is(.chip-soft-amber, .chip-soft-tan) { --c: color-mix(in srgb, var(--navy-light) 45%, #fff); }

/* values beside chips — pinned right */
.chip-row .val{ font-weight:800; font-size:12.5px; margin-left:auto; text-align:right; }
.val-amount{ color:#d35400; }   /* money */
.val-pos{ color:#1f8b4c; }      /* good / positive */
.val-neg{ color:#c0392b; }      /* bad / negative */
.val-navy{ color:var(--navy-primary); }
.val-accent{ color:var(--navy-accent); }
.val-muted{ color:#9aa6b2; font-weight:700; }
.val-box{ background:color-mix(in srgb, var(--navy-accent) 8%, var(--bg-card)); color:var(--text-secondary); padding:2px 7px; border-radius:3px; font-size:11px; font-weight:700; font-family:'Courier New',monospace; letter-spacing:.2px; }
.cell-title{ font-size:13px; font-weight:800; color:var(--navy-primary); margin-bottom:1px; }

/* media / thumbnail cell */
.media-stack{ display:flex; flex-direction:column; align-items:center; gap:4px; min-width:44px; }
.media-box{ width:36px; height:36px; border:1px solid var(--border-color); border-radius:3px; background:var(--bg-card); display:flex; align-items:center; justify-content:center; font-size:15px; overflow:hidden; box-shadow:0 1px 2px rgba(0,0,0,.05); }
.media-box img{ width:100%; height:100%; object-fit:cover; }

/* squared action icons */
.actions-cell{ display:flex; align-items:center; justify-content:center; gap:6px; flex-wrap:nowrap; }
.act{ width:26px; height:26px; border:none; border-radius:3px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size:12px; transition:all .2s; background:transparent; }
.act-info{ background:var(--navy-primary); color:#fff; }
.act-info:hover{ filter:brightness(1.25); transform:scale(1.1); }
.act-edit{ color:var(--navy-accent); font-size:15px; }
.act-del { color:#e23b2e; font-size:15px; }
.act-edit:hover,.act-del:hover{ transform:scale(1.18); }
.act[disabled]{ opacity:.32; cursor:not-allowed; }
.act[disabled]:hover{ transform:none; }

/* column helpers */
table.dataTable td.ctr, table.dataTable th.ctr{ text-align:center; }
table.dataTable td.col-media, table.dataTable th.col-media{ width:64px; text-align:center; }
table.dataTable td.col-actions,table.dataTable th.col-actions{ white-space:nowrap; }

/* status-tinted rows — !important beats DataTables' own striping */
table.dataTable tbody tr.row-good td{ background:rgba(var(--navy-accent-rgb), .08) !important; }
table.dataTable tbody tr.row-bad  td{ background:#fdecea !important; }
table.dataTable tbody tr.row-wait td{ background:#fff7e0 !important; }

body.dark-mode .cell-title{ color:var(--text-primary); }
body.dark-mode .val-navy{ color:var(--text-primary); }
body.dark-mode table.dataTable tbody tr.row-good td{ background:rgba(var(--navy-accent-rgb), .14) !important; }
body.dark-mode table.dataTable tbody tr.row-bad  td{ background:#3a1a18 !important; }
body.dark-mode table.dataTable tbody tr.row-wait td{ background:#33290d !important; }

/* import result popup — long skip lists stay readable */
.import-errors {
    max-height: 190px; overflow-y: auto; text-align: left;
    font-size: 12.5px; line-height: 1.7; color: var(--text-secondary);
    background: var(--bg-secondary); border-radius: 3px; padding: 10px 12px;
}

/* 4–5 grouped columns stretch a cell far wider than the doc's 6–9 column tables and the value
   drifts a screen away from its chip — cap the stack so each pair stays visually joined */
table.dataTable.chip-table .cell-stack,
table.dataTable.chip-table .cell-title { max-width: 330px; }

/* ===== Tabulator — theme skin. tokens only, so the palette, dark mode and Soft/Classic all follow ===== */
.tb-table { margin-top: 2px; }
.tabulator { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; font-size: 13px; }
.tabulator .tabulator-header { background: var(--navy-primary); color: #fff; border-bottom: 0; font-weight: 600; }
.tabulator .tabulator-header .tabulator-col { background: transparent; border-right: 1px solid rgba(255,255,255,.10); }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 10px 10px 8px; }
.tabulator .tabulator-header .tabulator-col div.tabulator-col-title { font-size: 12.5px; letter-spacing: .3px; color: inherit; }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover { background: rgba(255,255,255,.08); }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow { border-bottom-color: currentColor; opacity: .55; }
.tabulator .tabulator-header .tabulator-col[aria-sort="descending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow { border-top-color: currentColor; opacity: 1; }
.tabulator .tabulator-header .tabulator-col[aria-sort="ascending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow { opacity: 1; }
.tabulator .tabulator-tableholder .tabulator-table { background: transparent; color: var(--text-primary); }
.tabulator-row { background: var(--bg-card); border-bottom: 1px solid var(--border-light); min-height: 50px; }
.tabulator-row.tabulator-row-even { background: color-mix(in srgb, var(--navy-accent) 2%, var(--bg-card)); }
.tabulator-row.tabulator-selectable:hover { background: rgba(var(--navy-accent-rgb), .05); }
.tabulator-row.tabulator-selected, .tabulator-row.tabulator-selected:hover { background: rgba(var(--navy-accent-rgb), .13); }
.tabulator-row.row-good { background: rgba(var(--navy-accent-rgb), .08); }
.tabulator-row .tabulator-cell { border-right: 0; padding: 8px 10px; color: var(--text-primary); }
.tabulator-row .tabulator-cell.tabulator-frozen { background: inherit; }
.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left, .tabulator .tabulator-header .tabulator-col.tabulator-frozen-left { border-right: 1px solid var(--border-color); }
.tabulator .tabulator-header .tabulator-col.tabulator-frozen-left { background: var(--navy-primary); }
.tabulator .tabulator-footer { background: var(--bg-card); border-top: 1px solid var(--border-color); color: var(--text-secondary); padding: 8px 10px; font-weight: 500; }
.tabulator .tabulator-footer .tabulator-page { border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); border-radius: 3px; padding: 5px 10px; margin: 0 2px; font-size: 12.5px; }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
.tabulator .tabulator-footer .tabulator-page:not(:disabled):not(.active):hover { border-color: var(--navy-accent); color: var(--navy-accent); background: var(--bg-card); }
.tabulator .tabulator-footer .tabulator-page:disabled { opacity: .45; }
.tabulator .tabulator-footer .tabulator-page-size { border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-primary); border-radius: 3px; padding: 4px 6px; }
.tabulator .tabulator-placeholder .tabulator-placeholder-contents { color: var(--text-muted); font-size: 13px; }
.tabulator-row .tabulator-responsive-collapse { border: 0; padding: 4px 14px 10px; }
.tabulator-row .tabulator-responsive-collapse table td { padding: 3px 10px 3px 0; color: var(--text-secondary); }
.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle { background: var(--navy-accent); border-radius: 3px; }
.tabulator .tabulator-col-resize-handle:hover { background: rgba(var(--navy-accent-rgb), .25); }

/* header filters — light controls on the header. !important on padding: Tabulator writes inline padding:4px */
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter { padding-top: 7px; }
.tabulator .tabulator-header-filter input:not([type="checkbox"]), .tabulator .tabulator-header-filter select {
    width: 100%; height: 30px; padding: 0 8px !important; border: 1px solid rgba(255,255,255,.22); background: var(--input-bg); color: var(--text-primary);
    font-family: inherit; font-size: 12.5px !important; font-weight: 500; border-radius: 3px; }
.tabulator .tabulator-header-filter input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb), .35); }
.tabulator .tabulator-header-filter input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy-accent); cursor: pointer; }
.tb-range { display: flex; gap: 4px; }
.tb-range input { flex: 1 1 0; min-width: 0; }
.tabulator .tb-range input[type="date"] { padding: 0 4px !important; }
.tabulator-edit-list { border: 1px solid var(--border-color) !important; background: var(--bg-card) !important; border-radius: 3px; box-shadow: 0 10px 24px var(--shadow-color, rgba(0,0,0,.15)); }
.tabulator-edit-list .tabulator-edit-list-item { color: var(--text-primary); padding: 7px 10px; }
.tabulator-edit-list .tabulator-edit-list-item.active, .tabulator-edit-list .tabulator-edit-list-item:hover { background: var(--navy-accent) !important; color: #fff !important; }

/* tick bar — frozen rowHeader checkboxes */
.tabulator .tabulator-row-header input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy-accent); cursor: pointer; vertical-align: middle; }

/* progress bar (formatter colour = var(--navy-accent)) on a tinted track; empty stars dim in dark */
.tabulator .tabulator-cell.tb-progress { padding: 9px 10px; }
.tabulator .tabulator-cell.tb-progress > div { border-radius: 3px; overflow: hidden; background: rgba(var(--navy-accent-rgb), .10); }
body.dark-mode .tabulator .tabulator-cell polygon[fill="#D2D2D2"] { fill: #3a3a5a; stroke: #55557a; }

/* inline editing — editable hint, editor fills the cell, per-cell save state */
.tabulator .tabulator-cell.tabulator-editable { cursor: cell; }
.tabulator .tabulator-cell.tabulator-editing { border: 1px solid var(--navy-accent); padding: 0; }
.tabulator .tabulator-cell.tabulator-editing :is(input, select) { width: 100%; height: 100%; padding: 0 8px !important; border: 0; font: inherit; background: var(--input-bg); color: var(--text-primary); }
.tb-saving { opacity: .55; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(var(--navy-accent-rgb), .18), transparent) 0 0 / 200% 100%; animation: tbSave 1s linear infinite; }
.tb-saved { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 65%, transparent); }
.tb-err { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--danger) 65%, transparent); }
@keyframes tbSave { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .tb-saving { animation: none; } }

/* bulk bar — always visible, disabled at 0 ticked */
.tb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px;
          background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-card)); border: 1px solid var(--border-color); border-radius: 4px; }
.tb-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-bulk-n { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-right: 4px; }
.tb-bulk-n i { color: var(--navy-accent); }
.tb-bulk-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border-color); background: var(--bg-card);
               color: var(--text-primary); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 3px; transition: border-color .18s, color .18s; }
.tb-bulk-btn:hover:not(:disabled) { border-color: var(--navy-accent); color: var(--navy-accent); }
.tb-bulk-btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--bg-card)); }
.tb-bulk-btn.danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.tb-bulk-btn:disabled { opacity: .45; cursor: not-allowed; }
.tb-count { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.tb-role { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tb-role .val { font-weight: 700; }
/* identity: photo or initials, "You" tag, name opens the edit form */
.tb-ava { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
          background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.tb-ava img { width: 100%; height: 100%; object-fit: cover; }
.tb-you { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 3px; font-size: 10.5px; font-weight: 700;
          background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); vertical-align: middle; }
.tb-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text-primary); cursor: pointer; text-align: left; }
.tb-link:hover, .tb-link:focus-visible { color: var(--navy-accent); text-decoration: underline; text-underline-offset: 3px; outline: none; }
/* quick role change — pencil shows on row hover, always on touch */
.tb-cell-edit { width: 24px; height: 24px; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.tabulator-row:hover .tb-cell-edit, .tb-cell-edit:focus-visible { opacity: 1; }
.tb-cell-edit:hover { background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); }
@media (hover: none) { .tb-cell-edit { opacity: .7; } }
.tb-empty { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.tb-empty .tb-link { color: var(--navy-accent); font-weight: 600; }

@media (max-width: 768px) {
    .tb-bar { gap: 8px; }
    .tabulator .tabulator-header-filter input, .tabulator .tabulator-cell.tabulator-editing :is(input, select) { font-size: 16px !important; } /* no iOS zoom */
    .tabulator .tabulator-footer .tabulator-paginator { font-size: 12px; }
}

/* ===== UI Customization studio (ui.php) — settings left, sticky live preview right ===== */
.ui-studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ui-side { position: sticky; top: 16px; }
.ui-main, .ui-side { min-width: 0; }   /* grid columns may shrink below their content — wide tables scroll inside their own box */
.ui-panel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; padding: 18px 20px 20px; margin-bottom: 20px; }
.ui-panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ui-panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.ui-panel-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.ui-panel-ico { flex: 0 0 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px;
                background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); }

/* look tiles — style + mode, each with a tiny drawing of the result */
.ui-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1280px) { .ui-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ui-choice { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px;
             background: var(--bg-card); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ui-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ui-choice:hover { border-color: rgba(var(--navy-accent-rgb), .55); }
.ui-choice:has(input:checked) { border-color: var(--navy-accent); box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb), .22); }
.ui-choice:has(input:focus-visible) { outline: 2px solid var(--navy-accent); outline-offset: 2px; }
.ui-choice-txt strong { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-primary); }
.ui-choice-txt strong i { color: var(--navy-accent); }
.ui-choice-txt small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.ui-tick { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; display: none; align-items: center; justify-content: center;
           background: var(--navy-accent); color: #fff; font-size: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ui-choice:has(input:checked) .ui-tick, .ui-pal.active .ui-tick { display: inline-flex; }
.ui-thumb { display: grid; grid-template: 12px 1fr / 26% 1fr; gap: 0; height: 64px; border-radius: 3px; overflow: hidden; border: 1px solid var(--border-color); }
.ui-thumb i { grid-row: 1 / 3; }
.ui-thumb em { margin: 7px; border-radius: 2px; }
.ui-thumb-soft { background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-card)); }
.ui-thumb-soft i { background: color-mix(in srgb, var(--navy-accent) 7%, var(--bg-card)); border-right: 1px solid var(--border-color); }
.ui-thumb-soft b { background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.ui-thumb-soft em { background: var(--bg-card); border: 1px solid var(--border-color); }
.ui-thumb-classic { background: var(--bg-primary); }
.ui-thumb-classic i, .ui-thumb-classic b { background: var(--navy-primary); }
.ui-thumb-classic em { background: var(--bg-card); border-top: 3px solid var(--navy-accent); }
/* light / dark drawings show those modes whatever mode is on now — fixed values on purpose */
.ui-thumb-light { background: #f5f5f5; }
.ui-thumb-light i { background: #ffffff; border-right: 1px solid #e0e0e0; }
.ui-thumb-light b { background: #ffffff; border-bottom: 1px solid #e0e0e0; }
.ui-thumb-light em { background: #ffffff; border: 1px solid #e0e0e0; }
.ui-thumb-dark { background: #1a1a2e; }
.ui-thumb-dark i { background: #16213e; }
.ui-thumb-dark b { background: #1e1e3f; border-bottom: 1px solid #2d2d5a; }
.ui-thumb-dark em { background: #252550; }

/* palettes */
.ui-pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ui-pal { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 0; border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden;
          background: var(--bg-card); text-align: left; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ui-pal:hover { border-color: rgba(var(--navy-accent-rgb), .55); transform: translateY(-1px); }
.ui-pal:focus-visible { outline: 2px solid var(--navy-accent); outline-offset: 2px; }
.ui-pal.active { border-color: var(--navy-accent); box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb), .22); }
.ui-pal-sw { display: flex; width: 100%; height: 44px; }
.ui-pal-sw span { flex: 1; }
.ui-pal-meta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.ui-pal-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ui-pal-id { font-size: 11.5px; color: var(--text-muted); }

/* custom colours */
.ui-colors { display: grid; gap: 10px; }
.ui-color { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 4px; }
.ui-color-sw { flex: 0 0 40px; height: 40px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border-color); cursor: pointer; }
.ui-color-sw input { width: 64px; height: 64px; margin: -12px; border: 0; padding: 0; cursor: pointer; background: none; }
.ui-color-txt { flex: 1; min-width: 0; }
.ui-color-txt strong { display: block; font-size: 13.5px; color: var(--text-primary); }
.ui-color-txt small { font-size: 12px; color: var(--text-muted); }
.ui-color .hex-input { flex: 0 0 110px; width: 110px; height: 36px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: 3px;
                       background: var(--input-bg); color: var(--text-primary); font: 600 13px 'Courier New', monospace; text-transform: uppercase; letter-spacing: .5px; }
.ui-color .hex-input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15); }

/* live preview — a tiny dashboard drawn only with theme tokens */
.uip { display: grid; grid-template-columns: 58px 1fr; height: 220px; border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden; background: var(--bg-primary); }
.uip-side { background: var(--navy-primary); padding-top: 12px; }
.uip-side i { display: block; height: 8px; margin: 0 9px 9px; border-radius: 2px; background: rgba(255,255,255,.22); }
.uip-side i.on { background: var(--navy-accent); }
.uip-main { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.uip-head { height: 24px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 3px; }
.uip-head span { width: 64px; height: 6px; border-radius: 2px; background: color-mix(in srgb, var(--text-muted) 35%, transparent); }
.uip-head b { width: 14px; height: 14px; border-radius: 50%; background: var(--navy-accent); }
.uip-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uip-kpis div { padding: 6px 8px; border-radius: 3px; background: var(--navy-primary); color: #fff; }
.uip-kpis div + div { background: var(--navy-accent); }
.uip-kpis b { display: block; font-size: 15px; line-height: 1.2; }
.uip-kpis span { font-size: 10px; opacity: .85; }
.uip-row { display: flex; align-items: center; gap: 6px; }
.uip-btn { padding: 4px 9px; border-radius: 3px; background: var(--navy-accent); color: #fff; font-size: 10.5px; font-weight: 600; }
.uip-chip { padding: 3px 7px; border-radius: 3px; background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); font-size: 10px; font-weight: 700; }
.uip-table { flex: 1; display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 3px; overflow: hidden; }
.uip-table::before { content: ''; height: 12px; background: var(--navy-primary); }
.uip-table i { flex: 1; border-bottom: 1px solid var(--border-light); }
.uip-table i.sel { background: rgba(var(--navy-accent-rgb), .13); }
.ui-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ui-sw { display: flex; flex-direction: column; gap: 3px; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; min-width: 0; }
.ui-sw span { height: 26px; border-radius: 3px; border: 1px solid var(--border-color); }
.ui-sw small { font-size: 11px; color: var(--text-muted); }
.ui-sw code { font-size: 12px; font-weight: 700; color: var(--text-primary); background: none; padding: 0; }
.ui-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ui-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 3px; background: rgba(var(--navy-accent-rgb), .10); color: var(--text-primary); font-size: 12px; font-weight: 600; }
.ui-badge i { color: var(--navy-accent); }
.ui-badge-dirty { background: color-mix(in srgb, var(--warning) 18%, transparent); }
.ui-badge-dirty i { color: var(--warning); font-size: 7px; }
.ui-badge[hidden] { display: none; }

@media (max-width: 1100px) {
    .ui-studio { grid-template-columns: 1fr; }
    .ui-side { position: static; }
}
@media (max-width: 600px) {
    .ui-panel { padding: 14px; }
    .ui-choice-grid { grid-template-columns: 1fr 1fr; }
    .ui-pal-grid { grid-template-columns: 1fr 1fr; }
    .ui-color { flex-wrap: wrap; }
    .ui-color .hex-input { flex: 1 1 100%; width: 100%; font-size: 16px; }
}

/* ===== Chevron pipeline tabs — status filter above a table (chevron-pipeline.md), stage colours from the theme ===== */
.pipeline-stages { display: flex; width: 100%; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pipeline-stages::-webkit-scrollbar { display: none; }
.pipeline-stage { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px 12px 28px; border: 0; cursor: pointer; font: inherit; color: #fff; background: var(--navy-primary);
    transition: filter .2s, opacity .2s;
    -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); }
.pipeline-stage + .pipeline-stage { margin-left: -12px; }
.pipeline-stage:first-child { -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); padding-left: 16px; }
.pipeline-stage:last-child { -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); }
.pipeline-stage.pipe-unread { background: var(--navy-accent); }
.pipeline-stage.pipe-read { background: var(--navy-light); }
.pipeline-stage:hover { filter: brightness(1.12); }
.pipeline-stage:not(.active) { opacity: .62; }
.pipeline-stage.active { opacity: 1; box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .55); }
.pipeline-stage:focus-visible { outline: 2px solid var(--navy-accent); outline-offset: 2px; }
.pipeline-stage-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.pipeline-stage-count { font-size: 14px; font-weight: 800; }
@media (max-width: 768px) { .pipeline-stage { flex: 1 0 110px; padding: 10px 14px 10px 24px; } }

/* notifications page */
.n-type { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.n-info    { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); }
.n-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.n-warning { background: color-mix(in srgb, var(--warning) 20%, transparent); color: #b7791f; }
.n-danger  { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.n-msg { display: flex; align-items: flex-start; gap: 8px; min-width: 0; white-space: normal; }
.n-msg > div { min-width: 0; }
.n-title { display: block; font-weight: 600; color: var(--text-primary); }
.n-msg.is-unread .n-title { font-weight: 800; }
.n-msg small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.n-dot { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--navy-accent); }
.tabulator-row.n-row-unread { background: rgba(var(--navy-accent-rgb), .045); }
.n-state { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }
.n-state.is-new { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); }
.notification-dropdown-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-top: 1px solid var(--border-color);
    font-size: 13px; font-weight: 600; color: var(--navy-accent); text-decoration: none; }
.notification-dropdown-foot:hover { background: rgba(var(--navy-accent-rgb), .06); }

/* ===== DaisyUI-style toggle — theme accent. the width guard is load-bearing: `.form-group input` would stretch it ===== */
.toggle { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 24px; background: color-mix(in srgb, var(--text-muted) 40%, transparent);
    position: relative; cursor: pointer; transition: background .25s; border: none; outline: none; vertical-align: middle; flex: 0 0 44px; margin: 0; }
.toggle:checked { background: var(--navy-accent); }
.toggle::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle:checked::before { transform: translateX(20px); }
.toggle:focus-visible { box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .3); }
.form-group .toggle, .toggle-row .toggle, .cfg-switch .toggle { width: 44px; min-width: 44px; max-width: 44px; height: 24px; flex: 0 0 44px; padding: 0; border-radius: 24px !important; }

/* ===== Setup pages (SMTP / OAuth) — switch list, presets, form grid, guides, readiness checklist ===== */
.cfg-switches { display: flex; flex-direction: column; border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); overflow: hidden; }
.cfg-switch { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; margin: 0; }
.cfg-switch + .cfg-switch { border-top: 1px solid var(--border-color); }
.cfg-switch:hover { background: rgba(var(--navy-accent-rgb), .04); }
.cfg-switch-ico { flex: 0 0 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-ctrl, 4px);
    background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); }
.cfg-switch-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cfg-switch-txt strong { font-size: 14px; color: var(--text-primary); }
.cfg-switch-txt small { font-size: 12.5px; color: var(--text-muted); }
.cfg-state { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 26px; text-align: right; }
.cfg-state.is-on { color: var(--navy-accent); }
.cfg-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cfg-preset { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px);
    background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cfg-preset:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.cfg-preset.on { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
.cfg-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.cfg-form .form-group { margin-bottom: 14px; min-width: 0; }
.cfg-span-2 { grid-column: 1 / -1; }
.cfg-secret { position: relative; }
.cfg-secret input { padding-right: 44px !important; }
.cfg-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--text-muted); cursor: pointer; border-radius: var(--r-chip, 3px); }
.cfg-eye:hover { color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .08); }
.cfg-copy { display: flex; gap: 8px; }
.cfg-muted { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.ui-panel-ico.ico-warn { background: color-mix(in srgb, var(--warning) 18%, transparent); color: #b7791f; }
.cfg-warn { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-ctrl, 4px);
    background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--text-primary); font-size: 13px; line-height: 1.45; }
.cfg-warn i { color: #b7791f; margin-top: 2px; }
.cfg-note { margin: 10px 0 0; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.cfg-check.cfg-benefits { margin-bottom: 16px; }
.ui-panel a.btn { text-decoration: none; }
.cfg-account { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); }
.cfg-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cfg-actions .btn { justify-content: center; }
.cfg-danger-text { color: var(--danger) !important; }
.cfg-stats { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); }
.cfg-stats li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 13.5px; }
.cfg-stats li + li { border-top: 1px solid var(--border-color); }
.cfg-stats li i { width: 16px; text-align: center; color: var(--navy-accent); }
.cfg-stats li span { color: var(--text-muted); }
.cfg-stats li strong { margin-left: auto; color: var(--text-primary); overflow-wrap: anywhere; text-align: right; }
.cfg-table-wrap { border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); overflow: auto; }
.cfg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cfg-table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted);
    background: color-mix(in srgb, var(--navy-accent) 5%, var(--bg-card)); border-bottom: 1px solid var(--border-color); }
.cfg-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-light); color: var(--text-primary); white-space: nowrap; }
.cfg-table td i { color: var(--navy-accent); margin-right: 6px; }
.cfg-table .r { text-align: right; } .cfg-table .n { color: var(--text-muted); width: 44px; }
.cfg-table tr.total td { border-bottom: 0; font-weight: 700; background: color-mix(in srgb, var(--navy-accent) 5%, var(--bg-card)); }
.cfg-copy input { flex: 1; min-width: 0; font-family: 'Courier New', monospace; font-size: 13px !important; }
.cfg-copy .btn { flex: none; }
.cfg-guide { border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); }
.cfg-guide + .cfg-guide { margin-top: 10px; }
.cfg-guide summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-primary); list-style: none; }
.cfg-guide summary::-webkit-details-marker { display: none; }
.cfg-guide summary i { color: var(--navy-accent); width: 16px; text-align: center; }
.cfg-guide summary small { font-weight: 500; color: var(--text-muted); font-size: 12.5px; }
.cfg-guide summary::after { content: "\f078"; font: var(--fa-font-solid); margin-left: auto; color: var(--text-muted); font-size: 12px; transition: transform .2s; }
.cfg-guide[open] summary::after { transform: rotate(180deg); }
.cfg-steps { margin: 0; padding: 0 16px 14px 40px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.cfg-steps li + li { margin-top: 6px; }
.cfg-steps code { padding: 1px 6px; border-radius: 3px; background: rgba(var(--navy-accent-rgb), .1); color: var(--text-primary); font-size: 12.5px; word-break: break-all; }
.cfg-meter { height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--text-muted) 18%, transparent); overflow: hidden; margin-bottom: 14px; }
.cfg-meter i { display: block; height: 100%; width: 0; background: var(--navy-accent); transition: width .3s; border-radius: inherit; }
.cfg-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cfg-check li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.cfg-check li > i { flex: 0 0 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
    font-style: normal; background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-muted); }
.cfg-check li > i::before { content: "\f00d"; font: var(--fa-font-solid); }
.cfg-check li.ok > i { background: rgba(var(--navy-accent-rgb), .16); color: var(--navy-accent); }
.cfg-check li.ok > i::before { content: "\f00c"; }
.cfg-check span { min-width: 0; display: flex; flex-direction: column; }
.cfg-check strong { font-size: 13.5px; color: var(--text-primary); }
.cfg-check small { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.ui-side .ui-panel .form-group { margin-bottom: 12px; }
@media (max-width: 600px) {
    .cfg-form { grid-template-columns: 1fr; }
    .cfg-switch { padding: 12px; gap: 12px; }
    .cfg-switch-ico { display: none; }
    .cfg-copy { flex-direction: column; }
}

/* ===== About (admin only) — full width: identity strip, tabs, one pane at a time ===== */
.ab-hero { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--r-panel, 4px); }
.ab-logo { width: 52px; height: 52px; border-radius: var(--r-ctrl, 4px); object-fit: cover; flex: none; border: 1px solid var(--border-color); }
.ab-id { min-width: 0; flex: 1; }
.ab-id h1 { margin: 0; font-size: 19px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ab-id p { margin: 3px 0 0; font-size: 13px; color: var(--text-muted); }
.ab-id p strong { color: var(--text-secondary); }
.ab-ver { padding: 2px 8px; border-radius: var(--r-chip, 3px); background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); font-size: 12px; font-weight: 700; }
.ab-stats { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ab-stats li { min-width: 78px; padding: 8px 12px; text-align: center; border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); }
.ab-stats strong { display: block; font-size: 18px; color: var(--navy-accent); line-height: 1.1; }
.ab-stats span { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.ab-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); overflow-x: auto; scrollbar-width: none; }
.ab-tabs::-webkit-scrollbar { display: none; }
.ab-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
    background: none; color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ab-tab:hover { color: var(--text-primary); }
.ab-tab.on { color: var(--navy-accent); border-bottom-color: var(--navy-accent); }
.ab-tab em { font-style: normal; font-size: 11.5px; padding: 1px 7px; border-radius: var(--r-chip, 3px); background: color-mix(in srgb, var(--text-muted) 14%, transparent); }
.ab-tab.on em { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); }
.ab-pane > .about-table-wrapper + .about-table-wrapper { margin-top: 16px; }
.ab-pane .about-table-wrapper { width: 100%; }
.ab-pane .about-roles-table { width: 100%; }
.ab-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); }
.ab-legend small { margin-left: auto; color: var(--text-muted); font-size: 12.5px; }
.ab-legend .perm-on { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--r-chip, 3px);
    background: rgba(var(--navy-accent-rgb), .14); font-size: 11px; margin-left: 4px; }
.ab-legend .perm-on:first-child { margin-left: 0; }
.ab-pane .about-roles-table td:not(:first-child) { white-space: nowrap; }
.ab-legend a { color: var(--navy-accent); }
.ab-empty { color: var(--text-muted); }
.ab-dev { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-panel, 4px); }
.ab-dev-img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid rgba(var(--navy-accent-rgb), .35); }
.ab-dev-txt h3 { margin: 0; font-size: 18px; color: var(--text-primary); }
.ab-dev-txt p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-muted); }
.ab-work { font-weight: 700; color: var(--text-primary) !important; margin-top: 14px !important; }
.ab-work i { color: var(--navy-accent); }
.ab-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ab-links .btn { text-decoration: none; }
.ab-wa { background: #25D366; color: #fff; }
.ab-wa:hover { filter: brightness(1.05); color: #fff; }
html[data-shape="glass"] :is(.ab-hero, .ab-dev) { background: var(--glass-bg) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-line) !important; }
@media (max-width: 768px) {
    .ab-hero { flex-wrap: wrap; padding: 14px; }
    .ab-stats { width: 100%; }
    .ab-stats li { flex: 1; min-width: 0; }
    .ab-legend small { margin-left: 0; width: 100%; }
    .ab-dev { flex-direction: column; text-align: center; }
    .ab-links { justify-content: center; }
}

/* ===== AI settings card ===== */
.ai-model-row { display: flex; gap: 8px; align-items: center; }
.ai-model-row select { flex: 1; min-width: 0; }
.ai-model-row .btn { flex-shrink: 0; }
.ai-model-custom { margin-top: 8px; }
.ai-keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 4px 0 18px; }
.ai-key-input { display: flex; gap: 8px; align-items: center; }
.ai-key-input input { flex: 1; min-width: 0; }
.ai-key-input .btn { flex-shrink: 0; }
.ai-key-link { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--navy-accent); text-decoration: none; }
.ai-key-link:hover { text-decoration: underline; }
.ai-key-row label { display: flex; align-items: center; gap: 8px; }
.ai-test-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; }
.ai-test-result { font-size: 13.5px; font-weight: 600; }
.ai-test-result.ok  { color: var(--success, #1f8b4c); }
.ai-test-result.bad { color: var(--danger); }
.field-hint { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 768px) { .ai-keys { grid-template-columns: 1fr; } }

/* ===== AI Assistant page ===== */
/* the borrowed .chat-skel / .chat-none / .chat-banner helpers read these — point them at the navy palette */
body.page-ai {
    --wa-mut: var(--text-muted);
    --wa-txt: var(--text-primary);
    --wa-head: var(--bg-secondary);
    --wa-panel: var(--bg-card);
    --wa-line: var(--border-color);
}

.ai-wrap {
    display: grid; grid-template-columns: 300px 1fr;
    height: calc(100vh - 250px); min-height: 430px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 3px;
    box-shadow: 0 2px 4px var(--shadow-color); overflow: hidden;
}

.ai-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border-color); background: var(--bg-secondary); }
.ai-side-head { padding: 12px; border-bottom: 1px solid var(--border-color); }
.ai-convs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.ai-side-foot {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px; border-top: 1px solid var(--border-color);
    font-size: 12px; color: var(--text-muted);
}
.ai-quota { margin-left: auto; font-weight: 700; color: var(--navy-accent); }

.ai-conv {
    position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; margin-bottom: 4px; border: none; border-radius: 3px;
    background: transparent; color: var(--text-primary); font-family: inherit; text-align: left; cursor: pointer;
    transition: background 0.15s;
}
.ai-conv:hover { background: rgba(var(--navy-accent-rgb), 0.08); }
.ai-conv.active { background: rgba(var(--navy-accent-rgb), 0.14); box-shadow: inset 3px 0 0 var(--navy-accent); }
.ai-conv > i { color: var(--navy-accent); font-size: 13px; flex-shrink: 0; }
.ai-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-conv-main strong { font-size: 13.2px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-conv-main em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.ai-conv-del { flex-shrink: 0; padding: 4px 6px; border-radius: 3px; color: var(--text-muted); font-size: 12px; opacity: 0; transition: opacity 0.15s, color 0.15s; }
.ai-conv:hover .ai-conv-del { opacity: 1; }
.ai-conv-del:hover { color: var(--danger); background: rgba(234, 67, 53, 0.12); }

.ai-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-card); }
.ai-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; }

.ai-blank { margin: auto; text-align: center; max-width: 460px; padding: 20px; }
.ai-blank i {
    width: 88px; height: 88px; border-radius: 50%; margin-bottom: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 34px; color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.12);
}
.ai-blank h3 { font-size: 21px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.ai-blank p { font-size: 14px; color: var(--text-muted); margin: 0; }
.ai-tips { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.ai-tip {
    padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 3px;
    background: var(--bg-secondary); color: var(--text-secondary);
    font-family: inherit; font-size: 13.2px; text-align: left; cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.ai-tip:hover { border-color: var(--navy-accent); color: var(--navy-accent); }

.ai-msg { display: flex; align-items: flex-start; gap: 11px; max-width: 84%; }
.ai-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.ai-avatar {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
    background: rgba(var(--navy-accent-rgb), 0.14); color: var(--navy-accent);
}
.ai-msg.mine .ai-avatar { background: var(--navy-primary); color: #fff; }
.ai-avatar-bad { background: rgba(234, 67, 53, 0.14); color: var(--danger); }
.ai-bub {
    padding: 11px 14px; border-radius: 3px; font-size: 14px; line-height: 1.65;
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border-color); word-break: break-word; min-width: 0;
}
.ai-msg.mine .ai-bub { background: rgba(var(--navy-accent-rgb), 0.1); border-color: rgba(var(--navy-accent-rgb), 0.25); }
.ai-bub-bad { background: rgba(234, 67, 53, 0.08); border-color: rgba(234, 67, 53, 0.3); color: var(--danger); }
.ai-bub code { padding: 1px 5px; border-radius: 3px; background: rgba(var(--navy-primary-rgb), 0.09); font-family: 'Courier New', monospace; font-size: 12.5px; }
.ai-code {
    margin: 8px 0; padding: 11px 13px; border-radius: 3px; overflow-x: auto;
    background: var(--navy-primary); color: #e6edf6;
    font-family: 'Courier New', monospace; font-size: 12.5px; line-height: 1.55; white-space: pre;
}
.ai-meta { display: block; margin-top: 6px; font-size: 11px; color: var(--text-muted); }

/* thinking indicator — three dots while the model is composing */
.ai-dots { display: inline-flex; gap: 5px; padding: 3px 0; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--navy-accent); opacity: 0.4; animation: aiDot 1.2s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay: 0.18s; }
.ai-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes aiDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.ai-composer {
    display: flex; align-items: flex-end; gap: 10px; flex-shrink: 0;
    padding: 12px 16px; border-top: 1px solid var(--border-color); background: var(--bg-secondary);
}
.ai-composer textarea {
    flex: 1; resize: none; max-height: 160px; padding: 11px 14px;
    font-family: inherit; font-size: 16px; line-height: 21px;
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--input-border); border-radius: 3px;
}
.ai-composer textarea:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.15); }
.ai-send {
    flex-shrink: 0; width: 44px; height: 44px; border: none; border-radius: 3px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--navy-accent); color: #fff; font-size: 16px;
    transition: filter 0.2s, transform 0.2s;
}
.ai-send:hover:not(:disabled) { filter: brightness(1.08); transform: scale(1.05); }
.ai-send:disabled { opacity: 0.6; cursor: not-allowed; }
.ai-composer-off { justify-content: center; gap: 8px; color: var(--text-muted); font-size: 13px; padding: 18px; }

@media (max-width: 900px) {
    .ai-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100vh - 230px); }
    .ai-side { border-right: none; border-bottom: 1px solid var(--border-color); max-height: 168px; }
    .ai-msg { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) {
    .ai-dots i { animation: none; }
    .ai-send:hover:not(:disabled) { transform: none; }
}

/* Dark Mode — per-user access */
body.dark-mode .rbac-tabs { border-bottom-color: var(--border-color); }
body.dark-mode .rbac-tab { color: var(--text-muted); }
body.dark-mode .rbac-tab.active { color: #fff; border-bottom-color: var(--navy-accent); }
body.dark-mode .rbac-userbar { background: var(--bg-card); border-color: var(--border-color); }
body.dark-mode .rbac-userbar-main { color: var(--text-primary); }
body.dark-mode .rbac-ovr-chip { background: #3a2f00; color: #ffe69c; border-color: #5c4a00; }
body.dark-mode .rbac-ovr-chip.off { background: #10331f; color: #8fe0ac; border-color: #1d5836; }
body.dark-mode .rbac-empty { color: var(--text-muted); }

/* =====================================================================
   SHOP KIT — Mobile Shop Management System (Rameez Scripts)
   theme tokens only; dark mode via body.dark-mode. used by shop pages + print.php
   ===================================================================== */

/* on-accent text (white in both modes — the sidebar, chevrons and headers stay dark) */
:root { --on-accent: rgba(255, 255, 255, .96); }
/* [hidden] always wins — component display rules (flex buttons, pills) must never un-hide */
body.shop-page [hidden], .sd-panel[hidden] { display: none !important; }

/* page shell — fade + rise on load, reserved scrollbar (tabulator resize loop guard) */
body.shop-page .main-content { scrollbar-gutter: stable; animation: shopRise .22s ease both; }
@keyframes shopRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.shop-fade { animation: shopFade .15s ease both; }
@keyframes shopFade { from { opacity: 0; } to { opacity: 1; } }
.sr-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

.head-btn.is-busy { cursor: progress; }

/* ---- top loading bar — reads only ---- */
.top-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10001; overflow: hidden; pointer-events: none; }
.top-loadbar > span { display: block; height: 100%; width: 38%; border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, rgba(var(--navy-accent-rgb), 0), var(--navy-accent), var(--navy-primary));
    box-shadow: 0 0 8px rgba(var(--navy-accent-rgb), .5); animation: topLoadSlide 1.05s ease-in-out infinite; }
@keyframes topLoadSlide { 0% { transform: translateX(-105%); } 100% { transform: translateX(320%); } }
body.dark-mode .top-loadbar > span { background: linear-gradient(90deg, rgba(var(--navy-accent-rgb), 0), var(--navy-accent), var(--text-primary)); }

/* ---- processing overlay — writes only, above modals ---- */
.proc-ov { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: rgba(var(--navy-primary-rgb), .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: shopFade .15s ease both; }
.proc-logo { width: 84px; height: 84px; border-radius: 4px; object-fit: cover; background: var(--bg-secondary);
    box-shadow: 0 12px 34px var(--shadow-hover); animation: procPulse 1.5s ease-in-out infinite; }
@keyframes procPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .86; } }
.proc-bar { width: 210px; height: 4px; background: rgba(255, 255, 255, .25); border-radius: 3px; overflow: hidden; }
.proc-bar i { display: block; width: 40%; height: 100%; background: var(--navy-accent); border-radius: 3px; animation: procSlide 1.1s ease-in-out infinite; }
@keyframes procSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
.proc-ov .proc-label { color: var(--on-accent); font-size: 14px; font-weight: 600; letter-spacing: .3px; }
.proc-ov .proc-count { color: rgba(255, 255, 255, .75); font-size: 12px; font-weight: 600; }
body.dark-mode .proc-ov div.proc-label { color: var(--on-accent) !important; }
body.dark-mode .proc-ov div.proc-count { color: rgba(255, 255, 255, .75) !important; }

/* ---- AdminLTE info-box (theme-aware) ---- */
.info-box { display: flex; align-items: center; background: var(--bg-card); border-radius: 4px; box-shadow: 0 2px 6px var(--shadow-color);
    padding: 12px; min-height: 80px; transition: transform .15s ease; }
.info-box:hover { transform: translateY(-2px); }
.info-box-icon { width: 56px; height: 56px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--on-accent); flex-shrink: 0; }
.info-box-content { padding-left: 12px; flex: 1; min-width: 0; }
.info-box-text { display: block; text-transform: uppercase; font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-box-number { display: block; font-size: 20px; font-weight: 700; color: var(--navy-primary); }
body.dark-mode .info-box .info-box-number { color: var(--text-primary) !important; }
body.dark-mode .info-box .info-box-text { color: var(--text-muted) !important; }
.lte-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
@media (max-width: 1200px) { .lte-info-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .lte-info-grid { grid-template-columns: 1fr; } }

/* ---- DaisyUI toggle + width guard ---- */
.toggle { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 24px; background: var(--input-border); position: relative;
    cursor: pointer; transition: background .3s; border: none; outline: none; vertical-align: middle; flex: 0 0 44px; }
.toggle:checked { background: var(--navy-accent); }
.toggle::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-secondary);
    transition: transform .3s; box-shadow: 0 1px 3px var(--shadow-hover); }
.toggle:checked::before { transform: translateX(20px); }
.toggle:focus-visible { box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .25); }
.toggle:disabled { opacity: .5; cursor: not-allowed; }
.form-group .toggle, .toggle-row .toggle, .ss-toggle-row .toggle { width: 44px; min-width: 44px; max-width: 44px; height: 24px; flex: 0 0 44px; padding: 0; }
body.dark-mode .toggle::before { background: var(--text-primary); }

/* ---- searchable dropdown (vanilla) — squared 3px, panel fixed so no ancestor clips it ---- */
.sd { position: relative; width: 100%; }
.sd-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px;
    border: 2px solid var(--input-border); border-radius: 3px; background: var(--input-bg); color: var(--text-primary); font-size: 16px;
    cursor: pointer; transition: all .3s; }
.sd.open .sd-trigger, .sd-trigger:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15); }
.sd.is-disabled .sd-trigger { opacity: .6; cursor: not-allowed; background: var(--bg-primary); }
.sd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; flex-wrap: wrap; gap: 4px; }
.sd-label.sd-placeholder { color: var(--text-muted); }
.sd-arrow { font-size: 11px; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.sd.open .sd-arrow { transform: rotate(180deg); }
.sd-multi .sd-label { white-space: normal; }
.sd-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 3px; font-size: 13px; font-weight: 600;
    background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); }
.sd-tag i { cursor: pointer; font-size: 11px; opacity: .7; }
.sd-tag i:hover { opacity: 1; }
.sd-panel { position: fixed; z-index: 2000; background: var(--bg-card); border: 2px solid var(--navy-accent); border-radius: 3px;
    box-shadow: 0 6px 20px var(--shadow-hover); overflow: hidden; }
.sd-search-wrap { position: relative; border-bottom: 1px solid var(--border-color); }
.sd-search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); }
.sd-panel .sd-search { width: 100%; padding: 10px 12px 10px 34px; border: none; outline: none; font-size: 16px; background: var(--bg-card); color: var(--text-primary); border-radius: 0 !important; }
.sd-list { max-height: 260px; overflow-y: auto; }
.sd-item { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 12px; font-size: 14px; cursor: pointer; color: var(--text-primary); }
.sd-item i { width: 16px; text-align: center; color: var(--navy-accent); }
.sd-item small { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.sd-item:hover, .sd-item.active { background: rgba(var(--navy-accent-rgb), .08); }
.sd-item.selected { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); font-weight: 600; }
.sd-empty { padding: 12px; color: var(--text-muted); font-size: 13px; text-align: center; }
.sd.sd-sm .sd-trigger { min-height: 38px; padding: 6px 10px; border-width: 1px; font-size: 13px; min-width: 150px; }
body.dark-mode .sd-panel div.sd-item, body.dark-mode .sd span.sd-label { color: var(--text-primary) !important; }
body.dark-mode .sd span.sd-label.sd-placeholder, body.dark-mode .sd-panel div.sd-empty, body.dark-mode .sd-panel .sd-item small { color: var(--text-muted) !important; }
body.dark-mode .sd-panel div.sd-item.selected, body.dark-mode .sd span.sd-tag { color: var(--navy-accent) !important; }

/* ---- Tabulator — navy skin, scoped to the kit wrapper ---- */
.tb-wrap { position: relative; }
.tb-wrap .tabulator { background: transparent; border: 1px solid var(--border-color); border-radius: 4px; font-size: 13px; overflow: hidden; }
.tb-wrap .tabulator .tabulator-header { background: var(--navy-primary); border-bottom: 0; color: var(--on-accent); font-weight: 600; }
.tb-wrap .tabulator .tabulator-header .tabulator-col { background: transparent; border-right: 1px solid rgba(255, 255, 255, .10); color: var(--on-accent); }
.tb-wrap .tabulator .tabulator-header .tabulator-col .tabulator-col-title { font-size: 12.5px; letter-spacing: .3px; padding: 4px 2px; text-align: center; }
.tb-wrap .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: rgba(255, 255, 255, .08); }
.tb-wrap .tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow { border-bottom-color: rgba(255, 255, 255, .6); }
.tb-wrap .tabulator .tabulator-tableholder { background: var(--bg-card); }
.tb-wrap .tabulator .tabulator-row { border-bottom: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-primary); }
.tb-wrap .tabulator .tabulator-row.tabulator-row-even { background: var(--bg-secondary); }
.tb-wrap .tabulator .tabulator-row:hover { background: var(--table-hover); }
.tb-wrap .tabulator .tabulator-row.tabulator-selected { background: rgba(var(--navy-accent-rgb), .10); }
.tb-wrap .tabulator .tabulator-cell { border-right: 0; padding: 9px 10px; color: var(--text-primary); vertical-align: middle; }
.tb-wrap .tabulator .tabulator-footer { background: var(--bg-secondary); border-top: 1px solid var(--border-color); padding: 8px 10px; color: var(--text-secondary); }
.tb-wrap .tabulator .tabulator-footer .tabulator-page { border: 1px solid var(--border-color); background: var(--bg-card); color: var(--navy-accent); font-size: 12.5px; padding: 5px 10px; border-radius: 3px; min-height: 32px; }
.tb-wrap .tabulator .tabulator-footer .tabulator-page.active { background: var(--navy-accent); color: var(--on-accent); border-color: var(--navy-accent); }
.tb-wrap .tabulator .tabulator-footer .tabulator-page:disabled { opacity: .45; }
.tb-wrap .tabulator .tabulator-footer .tabulator-page-size { border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); border-radius: 3px !important; padding: 4px 6px; }
.tb-wrap .tabulator .tabulator-responsive-collapse { border-bottom: 1px dashed var(--border-color); padding: 6px 10px; }
.tb-wrap .tabulator .tabulator-responsive-collapse table td { padding: 3px 8px 3px 0; color: var(--text-secondary); }
.tb-wrap .tabulator .tabulator-responsive-collapse-toggle { background: var(--navy-accent); border-radius: 3px; }
/* tall html placeholder loops resize<->reposition -> pin it (tabulator 6.3) */
.tb-wrap .tabulator-placeholder { position: absolute; inset: 0; min-height: 140px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tb-wrap .tabulator-placeholder .tabulator-placeholder-contents { pointer-events: auto; color: var(--text-muted); font-size: 13px; }
.tb-wrap .tabulator .tabulator-tableholder { min-height: 140px; }
.tb-host { margin-top: 4px; }
.tb-skel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; padding: 6px 16px; }
.tb-skel .skeleton-table-row .skeleton-table-cell { flex: 1; }

/* toolbar + popovers + bulk bar */
.tb-pipe { margin-bottom: 4px; }
.tb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px; margin-bottom: 10px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; }
.tb-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-search, .tb-sel { position: relative; display: flex; align-items: center; }
.tb-search > i { position: absolute; left: 12px; font-size: 13px; color: var(--text-muted); pointer-events: none; }
.tb-search input { height: 38px; width: 262px; padding: 0 12px 0 34px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-primary);
    font-family: inherit; font-size: 16px; font-weight: 500; border-radius: 3px !important; transition: border-color .2s, box-shadow .2s; }
.tb-search input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .14); }
.tb-tbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid var(--input-border); background: var(--input-bg);
    color: var(--text-primary); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 3px; transition: all .18s; }
.tb-tbtn:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.tb-tbtn.ghost { border-style: dashed; color: var(--text-muted); width: 100%; justify-content: center; margin-top: 4px; }
.tb-reset.is-on { border-color: var(--navy-accent); color: var(--navy-accent); }
.tb-dot { min-width: 17px; height: 17px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-style: normal;
    background: var(--navy-accent); color: var(--on-accent); font-size: 10px; font-weight: 700; border-radius: 3px; }
.tb-pop { position: relative; }
.tb-pop-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--bg-card); border: 1px solid var(--border-color);
    box-shadow: 0 10px 28px var(--shadow-hover); border-radius: 4px; padding: 10px; z-index: 400; display: none; }
.tb-left .tb-pop-menu { left: 0; right: auto; }
.tb-pop.open .tb-pop-menu { display: block; }
.tb-pop-h { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.tb-pop-menu label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 2px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.tb-pop-menu label.tb-chk { justify-content: flex-start; gap: 9px; padding: 7px 8px; font-size: 13px; cursor: pointer; border-radius: 3px; }
.tb-pop-menu label.tb-chk:hover { background: var(--table-hover); }
.tb-pop-menu input[type="date"] { height: 36px; padding: 0 8px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-primary);
    font-family: inherit; font-size: 16px; border-radius: 3px !important; }
.tb-pop-menu input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy-accent); cursor: pointer; }
.tb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 9px 12px; margin-bottom: 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 4px; }
.tb-count { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-left: auto; }
.tb-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-all { width: 16px; height: 16px; accent-color: var(--navy-accent); cursor: pointer; }
.tb-bulk-n { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--navy-accent); margin-right: 4px; }
.tb-bulk-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--input-border); background: var(--input-bg);
    color: var(--text-primary); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 3px; transition: all .18s; }
.tb-bulk-btn:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.tb-bulk-btn.ok { background: rgba(52, 168, 83, .1); border-color: rgba(52, 168, 83, .3); color: var(--success); }
.tb-bulk-btn.warn { background: rgba(251, 188, 4, .14); border-color: rgba(251, 188, 4, .4); color: var(--text-primary); }
.tb-bulk-btn.danger { background: rgba(234, 67, 53, .1); border-color: rgba(234, 67, 53, .3); color: var(--danger); }
.tb-bulk-btn.info { background: rgba(var(--navy-accent-rgb), .1); border-color: rgba(var(--navy-accent-rgb), .3); color: var(--navy-accent); }
.tb-bulk-btn:disabled { opacity: .45; cursor: not-allowed; }
.tb-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 3px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tb-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tb-pill.ok { background: rgba(52, 168, 83, .14); color: var(--success); }
.tb-pill.off { background: rgba(234, 67, 53, .13); color: var(--danger); }
.tb-pill.warn { background: rgba(251, 188, 4, .2); color: var(--text-primary); }
.tb-pill.info { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); }
.tb-pill.muted { background: var(--bg-primary); color: var(--text-muted); }
.tb-na { color: var(--text-muted); }
body.dark-mode .tb-wrap span.tb-count, body.dark-mode .tb-wrap div.tb-pop-h { color: var(--text-muted) !important; }
body.dark-mode .tb-wrap span.tb-bulk-n { color: var(--navy-accent) !important; }
body.dark-mode span.tb-pill.ok { color: var(--success) !important; }
body.dark-mode span.tb-pill.off { color: var(--danger) !important; }
body.dark-mode span.tb-pill.warn { color: var(--warning) !important; }
body.dark-mode span.tb-pill.info { color: var(--navy-accent) !important; }
body.dark-mode .tb-wrap .tabulator .tabulator-header .tabulator-col, body.dark-mode .tb-wrap .tabulator-col-title { color: var(--on-accent) !important; }
body.dark-mode .tb-wrap .tabulator .tabulator-cell, body.dark-mode .tb-wrap .tabulator-footer span { color: var(--text-primary); }
@media (max-width: 768px) {
    .tb-search, .tb-search input { width: 100%; }
    .tb-left { width: 100%; }
    .tb-wrap .tabulator { font-size: 12.5px; }
}

/* chip-table on tabulator — same .chip / .cell-stack / .val-* classes as the datatables variant */
.chip-table .tabulator .tabulator-cell { padding: 6px 9px; font-size: 12.5px; }
.chip-table .tabulator .cell-stack, .chip-table .tabulator .cell-title { max-width: 330px; }
.chip-table .tabulator-row.row-good .tabulator-cell { background: rgba(52, 168, 83, .10) !important; }
.chip-table .tabulator-row.row-bad .tabulator-cell { background: rgba(234, 67, 53, .10) !important; }
.chip-table .tabulator-row.row-wait .tabulator-cell { background: rgba(251, 188, 4, .14) !important; }
.chip-soft-red { background: rgba(234, 67, 53, .12); color: var(--danger); border-color: rgba(234, 67, 53, .3); }
.chip-table .tabulator-cell.ctr { text-align: center; }
.chip-table .tabulator-cell.col-actions { white-space: nowrap; overflow: visible; }
.act-print { color: var(--navy-accent); font-size: 14px; }
.act-print:hover, .act-more:hover { transform: scale(1.15); }
.act-more { color: var(--text-secondary); font-size: 15px; }
.act[disabled] { cursor: progress; }
/* dark: chips + values keep their tone (the global span/div text rule would grey them) */
body.dark-mode.shop-page span.chip { border-color: transparent; }
body.dark-mode.shop-page span.chip-navy, body.dark-mode.shop-page span.chip-green { color: var(--text-primary) !important; }
body.dark-mode.shop-page span.chip-soft-navy, body.dark-mode.shop-page span.chip-link, body.dark-mode.shop-page span.chip-soft-purple { background: rgba(var(--navy-accent-rgb), .18); color: var(--navy-accent) !important; }
body.dark-mode.shop-page span.chip-soft-green, body.dark-mode.shop-page span.chip-teal { background: rgba(52, 168, 83, .18); color: var(--success) !important; }
body.dark-mode.shop-page span.chip-soft-amber, body.dark-mode.shop-page span.chip-soft-tan { background: rgba(251, 188, 4, .18); color: var(--warning) !important; }
body.dark-mode.shop-page span.chip-soft-red { background: rgba(234, 67, 53, .18); color: var(--danger) !important; }
body.dark-mode.shop-page span.val { color: var(--text-primary) !important; }
body.dark-mode.shop-page span.val.val-amount { color: var(--warning) !important; }
body.dark-mode.shop-page span.val.val-pos { color: var(--success) !important; }
body.dark-mode.shop-page span.val.val-neg { color: var(--danger) !important; }
body.dark-mode.shop-page span.val.val-muted { color: var(--text-muted) !important; }
body.dark-mode.shop-page .chip-table .tabulator-row.row-good .tabulator-cell { background: rgba(52, 168, 83, .16) !important; }
body.dark-mode.shop-page .chip-table .tabulator-row.row-bad .tabulator-cell { background: rgba(234, 67, 53, .16) !important; }
body.dark-mode.shop-page .chip-table .tabulator-row.row-wait .tabulator-cell { background: rgba(251, 188, 4, .14) !important; }

/* ---- chevron pipeline (status filter above the table) ---- */
.pipeline-stages { display: flex; width: 100%; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pipeline-stages::-webkit-scrollbar { display: none; }
.pipeline-stage { flex: 1 1 0; min-width: 0; min-height: 44px; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 20px 12px 28px; cursor: pointer; border: 0; font-family: inherit; color: var(--on-accent); transition: filter .2s, opacity .2s;
    -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); }
.pipeline-stage:first-child { -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); padding-left: 16px; border-radius: 3px 0 0 3px; }
.pipeline-stage:last-child { -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); border-radius: 0 3px 3px 0; }
.pipeline-stage:hover { filter: brightness(1.15); }
.pipeline-stage.active { filter: brightness(1.25); box-shadow: inset 0 0 0 100px rgba(255, 255, 255, .15); }
.pipeline-stage-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .3px; color: inherit; }
.pipeline-stage-count { font-size: 14px; font-weight: 800; color: inherit; white-space: nowrap; }
.pipeline-stage.pipeline-empty { opacity: .6; }
.pipeline-stage.pipeline-empty:hover { opacity: .85; }
.pl-navy { background: var(--navy-primary); }
.pl-info { background: var(--navy-accent); }
.pl-success { background: var(--success); }
.pl-warning { background: var(--warning); color: var(--navy-primary); }
.pl-danger { background: var(--danger); }
.pl-muted { background: var(--text-muted); }
.pl-purple { background: var(--navy-light); }
body.dark-mode .pipeline-stage span { color: var(--on-accent) !important; }
body.dark-mode .pipeline-stage.pl-warning span { color: var(--navy-primary) !important; }
@media (max-width: 992px) { .pipeline-stage { padding: 10px 16px 10px 24px; } .pipeline-stage-name { font-size: 10px; } .pipeline-stage-count { font-size: 12px; } }
@media (max-width: 768px) { .pipeline-stage { min-width: 100px; flex-shrink: 0; flex-grow: 0; padding: 10px 14px 10px 22px; } .pipeline-stage-name { font-size: 9px; } }

/* ---- ⋮ row menu + header overflow menu ---- */
.row-menu { position: fixed; z-index: 2100; min-width: 190px; max-width: calc(100vw - 32px); padding: 6px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: 4px; box-shadow: 0 10px 28px var(--shadow-hover); animation: shopFade .12s ease both; }
.row-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 3px;
    background: transparent; color: var(--text-primary); font-family: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.row-menu button i { width: 16px; text-align: center; color: var(--navy-accent); }
.row-menu button:hover, .row-menu button:focus-visible { background: rgba(var(--navy-accent-rgb), .08); outline: none; }
.row-menu button.danger, .row-menu button.danger i { color: var(--danger); }
.row-menu button:disabled { opacity: .5; cursor: not-allowed; }
body.dark-mode .row-menu button span { color: var(--text-primary) !important; }
body.dark-mode .row-menu button.danger span { color: var(--danger) !important; }

/* ---- modal helpers: demo quick-add, inline errors, entrance ---- */
.modal-head-tools { display: flex; align-items: center; gap: 2px; }
.demo-seed-btn { font-size: 19px; opacity: .7; }
.demo-seed-btn:hover { opacity: 1; color: var(--warning); }
body.shop-page .modal-overlay.active { animation: shopFade .16s ease-out; }
body.shop-page .modal-overlay.active > .modal { animation: modalRise .2s cubic-bezier(.4, 0, .2, 1); }
@keyframes modalRise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.field-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.form-group.has-error input, .form-group.has-error textarea, .form-group.has-error .sd-trigger { border-color: var(--danger); }
body.dark-mode small.field-error { color: var(--danger) !important; }
.form-section-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; padding-bottom: 6px; font-size: 13px; font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase; color: var(--navy-accent); border-bottom: 1px solid var(--border-color); }
.form-section-title:first-child { margin-top: 0; }

/* ---- chip list editor ---- */
.chip-list { display: flex; flex-direction: column; gap: 10px; }
.chip-list-items { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.chip-list-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 3px; font-size: 13px; font-weight: 600;
    background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); border: 1px solid rgba(var(--navy-accent-rgb), .25); }
.chip-list-chip button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 3px;
    background: transparent; color: inherit; cursor: pointer; }
.chip-list-chip button:hover { background: rgba(234, 67, 53, .15); color: var(--danger); }
.chip-list-empty { font-size: 13px; color: var(--text-muted); }
.chip-list-add { display: flex; gap: 8px; }
.chip-list-add input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; font-size: 16px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-primary); border-radius: 3px !important; }
.chip-list-add .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.chip-list.is-disabled .chip-list-chip button { display: none; }
body.dark-mode span.chip-list-chip { color: var(--navy-accent) !important; }
body.dark-mode span.chip-list-empty { color: var(--text-muted) !important; }

/* ---- shop settings shell — left nav + one card per section ---- */
.ss-shell { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.ss-nav { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--bg-card); padding: 10px; border-radius: 4px; box-shadow: 0 2px 4px var(--shadow-color); }
.ss-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: none; border-left: 3px solid transparent;
    background: transparent; color: var(--text-primary); font-family: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
    border-radius: 3px; transition: background .15s, border-color .15s; }
.ss-nav-item i { width: 18px; text-align: center; color: var(--navy-accent); }
.ss-nav-item:hover { background: rgba(var(--navy-accent-rgb), .08); }
.ss-nav-item.active { background: rgba(var(--navy-accent-rgb), .12); border-left-color: var(--navy-accent); color: var(--navy-accent); }
.ss-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.ss-panel { min-width: 0; }
.ss-card { background: var(--bg-card); border-radius: 4px; box-shadow: 0 2px 4px var(--shadow-color); }
.ss-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-color); }
.ss-ic { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: var(--navy-primary); color: var(--on-accent); font-size: 17px; }
.ss-card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.ss-card-sub { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.ss-card-body { padding: 18px; }
.ss-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border-color); background: var(--bg-secondary); border-radius: 0 0 4px 4px; }
.ss-hint { margin-right: auto; font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.ss-dirty { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 3px; font-size: 12px; font-weight: 700; background: rgba(251, 188, 4, .2); color: var(--text-primary); }
.ss-toggle-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--border-color); }
.ss-toggle-row:last-child { border-bottom: none; }
.ss-toggle-row .ss-grow { flex: 1; min-width: 0; }
.ss-lbl { font-weight: 600; font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.ss-lbl i { color: var(--navy-accent); }
.ss-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.ss-logo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.ss-logo-preview { width: 88px; height: 88px; object-fit: cover; border: 3px solid var(--navy-primary); border-radius: 4px; background: var(--bg-secondary); }
.ss-logo-fields { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.ss-logo-fields .btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; }
.ss-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.ss-copy-row { display: flex; gap: 8px; }
.ss-copy-row input { flex: 1; min-width: 0; font-family: 'Courier New', monospace; font-size: 13px !important; }
.ss-copy-row .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.ss-print-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ss-print-row .btn { display: inline-flex; align-items: center; gap: 6px; }
.ss-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
body.shop-page .form-group textarea { min-height: 84px; resize: vertical; }
body.dark-mode .ss-card div.ss-card-sub, body.dark-mode .ss-card span.ss-hint, body.dark-mode .ss-card div.ss-desc, body.dark-mode .ss-card div.ss-note { color: var(--text-muted) !important; }
body.dark-mode .ss-card div.ss-lbl, body.dark-mode .ss-card .ss-card-title { color: var(--text-primary) !important; }
body.dark-mode .ss-nav .ss-nav-item.active span { color: var(--navy-accent) !important; }
body.dark-mode .ss-nav .ss-nav-item span { color: var(--text-primary) !important; }
body.dark-mode .ss-card-foot { background: var(--bg-secondary); }
body.dark-mode .ss-card span.ss-dirty { color: var(--warning) !important; }
@media (max-width: 992px) {
    .ss-shell { grid-template-columns: 1fr; }
    .ss-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; }
    .ss-nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; width: auto; }
    .ss-nav-item.active { border-bottom-color: var(--navy-accent); }
    .ss-dot { margin-left: 6px; }
    .ss-lists { grid-template-columns: 1fr; }
}

/* ---- sidebar: shop groups, pills on submenu parents, EN/ES chip ---- */
.sidebar-menu + .sidebar-menu-title { margin-top: 18px; }
.sidebar-menu li.nav-pill-parent > .nav-pill { top: 24px; right: 40px; }
.sidebar .sidebar-lang { padding: 0 20px 16px; background: rgba(0, 0, 0, .15); }
.sidebar .lang-toggle { width: 100%; min-height: 44px; padding: 10px 16px; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: rgba(var(--navy-accent-rgb), .18); border: 1px solid rgba(var(--navy-accent-rgb), .45); color: var(--on-accent);
    border-radius: 3px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .3s; }
.sidebar .lang-toggle:hover { background: rgba(var(--navy-accent-rgb), .35); transform: translateY(-2px); }
.sidebar .lang-toggle .lang-now { padding: 1px 7px; border-radius: 3px; background: var(--navy-accent); font-size: 12px; font-weight: 800; letter-spacing: .5px; }
body.dark-mode .sidebar .lang-toggle span { color: var(--on-accent) !important; }
.sidebar.collapsed .sidebar-lang { padding: 0 8px 12px; }
.sidebar.collapsed .lang-toggle { padding: 12px 0; gap: 0; }
.sidebar.collapsed .lang-toggle i, .sidebar.collapsed .lang-toggle .lang-next { display: none; }

/* role badges for the shop roles (About matrix) */
.role-manager { background: rgba(var(--navy-accent-rgb), .15); color: var(--navy-accent); }
.role-employee { background: rgba(52, 168, 83, .15); color: var(--success); }

/* squared inputs on shop pages — beats the global rounded-input polish */
body.shop-page .main-content input[type="text"], body.shop-page .main-content input[type="email"], body.shop-page .main-content input[type="number"],
body.shop-page .main-content input[type="search"], body.shop-page .main-content input[type="tel"], body.shop-page .main-content input[type="url"],
body.shop-page .main-content input[type="date"], body.shop-page .main-content textarea, body.shop-page .main-content .btn,
body.shop-page .data-section, body.shop-page .lte-card, body.shop-page .small-box, body.shop-page .info-box { border-radius: 3px !important; }
body.shop-page .form-group input, body.shop-page .form-group textarea { font-size: 16px; }

/* ---- hidden print iframe ---- */
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

/* ---- print documents (print.php) — A4 + 80mm / 58mm thermal ---- */
@page a4doc { size: A4 portrait; margin: 12mm; }
@page th80 { margin: 0; }
@page th58 { margin: 0; }
body.print-doc { background: var(--bg-secondary); color: var(--text-primary); margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4-doc { page: a4doc; width: 186mm; margin: 0 auto; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: var(--text-primary); position: relative; }
.a4-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--navy-primary); }
.a4-lh { display: flex; gap: 12px; align-items: flex-start; text-align: left; }
.a4-logo { width: 64px; height: 64px; object-fit: contain; }
.a4-shop { font-size: 18px; font-weight: 800; color: var(--navy-primary); margin: 0 0 2px; }
.a4-lh-line { font-size: 11px; color: var(--text-secondary); line-height: 1.45; }
.a4-title { text-align: right; }
.a4-title h1 { font-size: 22px; letter-spacing: 1px; color: var(--navy-primary); margin: 0 0 6px; }
.a4-meta { font-size: 11.5px; line-height: 1.6; }
.a4-box { border: 1px solid var(--border-color); border-radius: 3px; padding: 8px 10px; margin-bottom: 12px; }
.a4-box-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 4px; }
.a4-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.a4-table thead { display: table-header-group; }
.a4-table tr { page-break-inside: avoid; break-inside: avoid; }
.a4-table th { background: var(--navy-primary); color: var(--on-accent); font-size: 11px; font-weight: 700; padding: 6px 7px; border: 1px solid var(--navy-primary); text-align: left; }
.a4-table td { font-size: 11.5px; padding: 6px 7px; border: 1px solid var(--border-color); vertical-align: top; }
.a4-table td.num, .a4-table th.num { text-align: right; white-space: nowrap; }
.a4-table tfoot td { font-weight: 700; background: var(--bg-primary); }
.a4-total td { font-size: 13px; }
.a4-terms { border: 1px dashed var(--border-color); padding: 8px 10px; font-size: 10.5px; color: var(--text-secondary); margin-bottom: 18px; white-space: pre-line; }
.a4-sign { display: flex; justify-content: space-between; gap: 40px; margin-top: 36px; }
.a4-sign div { flex: 1; border-top: 1px solid var(--text-primary); padding-top: 4px; font-size: 11px; text-align: center; }
.a4-void { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: 110px; font-weight: 900; letter-spacing: 12px;
    color: rgba(234, 67, 53, .16); transform: rotate(-24deg); pointer-events: none; }
.th-doc { width: 80mm; margin: 0 auto; padding: 3mm 4mm; font-family: 'Courier New', Courier, monospace; font-size: 12px; line-height: 1.35; color: var(--text-primary); word-wrap: break-word; }
.th-doc.th-58 { page: th58; width: 58mm; padding: 2mm 3mm; font-size: 11px; }
.th-doc.th-80 { page: th80; }
.th-center { text-align: center; }
.th-logo { width: 46px; height: 46px; object-fit: contain; display: block; margin: 0 auto 4px; }
.th-shop { font-size: 14px; font-weight: 700; text-align: center; }
.th-lh-line { text-align: center; font-size: 11px; }
.th-rule { border: 0; border-top: 1px dashed var(--text-primary); margin: 6px 0; }
.th-row { display: flex; justify-content: space-between; gap: 8px; }
.th-row > span:last-child { text-align: right; white-space: nowrap; }
.th-strong { font-weight: 700; font-size: 13px; }
.th-foot { text-align: center; font-size: 11px; margin-top: 6px; }
.print-error { max-width: 420px; margin: 60px auto; padding: 20px; text-align: center; font-family: Arial, Helvetica, sans-serif; color: var(--danger);
    border: 1px solid rgba(234, 67, 53, .35); border-radius: 4px; }
/* thermal = black on white, whatever the theme */
.th-doc, .th-doc * { color: black; }
@media print {
    body.print-doc { background: none; }
    body.print-doc .no-print { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    body.shop-page .main-content, .shop-fade, .proc-ov, .row-menu, body.shop-page .modal-overlay.active, body.shop-page .modal-overlay.active > .modal { animation: none; }
    .proc-logo { animation: none; }
    .proc-bar i { animation-duration: 2.6s; }
    .top-loadbar > span { animation-duration: 2.4s; }
}

/* =====================================================================
   SHOP — Phase 2: record hub, product cells, image manager, summary bar (Rameez Scripts)
   ===================================================================== */
/* modal sizes */
body.shop-page .modal.modal-lg { max-width: 980px; }
body.shop-page .modal.modal-sm { max-width: 480px; }
body.shop-page .modal .form-section-title + .form-grid { margin-bottom: 4px; }

/* record hub — tabbed view modal */
.hub-ov .modal.hub { max-width: 780px; }
.hub-ov .modal.hub-wide { max-width: 900px; }
.hub-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 18px; border-bottom: 2px solid var(--border-color); background: var(--bg-card); scrollbar-width: none; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 14px; margin-bottom: -2px; border: 0; border-bottom: 3px solid transparent;
    background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.hub-tab i { color: var(--navy-accent); }
.hub-tab:hover, .hub-tab.active { color: var(--navy-accent); }
.hub-tab.active { border-bottom-color: var(--navy-accent); }
.hub-badge { min-width: 18px; padding: 0 6px; border-radius: 3px; background: var(--navy-accent); color: var(--on-accent); font-size: 10.5px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; }
.hub-body { padding: 20px 22px; }
.hub-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hub-kpi { min-width: 0; padding: 10px 12px; border: 1px solid rgba(var(--navy-accent-rgb), .2); border-radius: 3px; background: rgba(var(--navy-accent-rgb), .06); }
.hub-k { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); }
.hub-v { margin-top: 3px; font-size: 18px; font-weight: 800; color: var(--navy-primary); overflow-wrap: anywhere; }
.hub-kpi.is-bad { border-color: rgba(234, 67, 53, .35); background: rgba(234, 67, 53, .07); }
.hub-kpi.is-bad .hub-v { color: var(--danger); }
.hub-fields { display: flex; flex-direction: column; }
.hub-field { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 13.5px; }
.hub-field:last-child { border-bottom: 0; }
.hub-l { flex-shrink: 0; color: var(--text-muted); }
.hub-fv { min-width: 0; color: var(--text-primary); text-align: right; overflow-wrap: anywhere; white-space: pre-line; }
.hub-empty { padding: 22px 10px; text-align: center; font-size: 13px; color: var(--text-muted); }
.hub-table { margin: 0; }
.hub-table .about-roles-table { font-size: 13px; }
.hub-table .about-roles-table th, .hub-table .about-roles-table td { padding: 8px 10px; }
.hub-skel { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.hub-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.hub-gallery a { display: block; }
.hub-gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-secondary); }
body.dark-mode .modal-header span.hub-title, body.dark-mode .modal-header span.modal-title-txt { color: var(--on-accent) !important; }
body.dark-mode .hub-kpi div.hub-v { color: var(--text-primary) !important; }
body.dark-mode .hub-kpi.is-bad div.hub-v { color: var(--danger) !important; }
body.dark-mode div.hub-k, body.dark-mode span.hub-l, body.dark-mode p.hub-empty { color: var(--text-muted) !important; }
body.dark-mode span.hub-fv { color: var(--text-primary) !important; }
body.dark-mode .hub-tab span { color: var(--text-secondary) !important; }
body.dark-mode .hub-tab.active span, body.dark-mode .hub-tab:hover span { color: var(--navy-accent) !important; }
@media (max-width: 576px) {
    .hub-body { padding: 16px 14px; }
    .hub-tabs { padding: 0 8px; }
    .hub-field { flex-direction: column; gap: 2px; }
    .hub-fv { text-align: left; }
}

/* table states — empty (with add) + load error (with retry) */
.tb-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; color: var(--text-muted); text-align: center; }
.tb-empty > i { font-size: 30px; color: var(--navy-accent); opacity: .55; }
.tb-empty p { margin: 0; font-size: 13.5px; font-weight: 600; }
.tb-empty .btn { display: inline-flex; align-items: center; gap: 6px; }
.tb-fail { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 140px; padding: 20px;
    border: 1px dashed rgba(234, 67, 53, .4); border-radius: 4px; background: rgba(234, 67, 53, .05); color: var(--danger); font-weight: 600; font-size: 13.5px; }
.tb-fail .btn { display: inline-flex; align-items: center; gap: 6px; }
body.dark-mode .tb-empty p, body.dark-mode .tb-empty { color: var(--text-muted) !important; }
body.dark-mode div.tb-fail, body.dark-mode .tb-fail span { color: var(--danger) !important; }

/* summary bar under a list */
.tb-summary { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; padding: 10px 14px; border: 1px solid rgba(var(--navy-accent-rgb), .2);
    border-radius: 3px; background: rgba(var(--navy-accent-rgb), .06); font-size: 13px; color: var(--text-secondary); }
.tb-summary span { display: inline-flex; align-items: center; gap: 7px; }
.tb-summary i { color: var(--navy-accent); }
.tb-summary b { color: var(--navy-primary); font-weight: 800; }
.tb-summary .is-bad i, .tb-summary .is-bad b { color: var(--danger); }
body.dark-mode .tb-summary span { color: var(--text-secondary) !important; }
body.dark-mode .tb-summary b { color: var(--text-primary) !important; }
body.dark-mode .tb-summary .is-bad b { color: var(--danger) !important; }

/* product cell — thumbnail + chips */
.pcell { display: flex; align-items: flex-start; gap: 10px; }
.pcell-main { min-width: 0; flex: 1; }
.pcell-cat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.pthumb { position: relative; flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; overflow: visible;
    border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-secondary); color: var(--text-muted); font-size: 16px; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.pthumb em { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 3px; background: var(--navy-accent);
    color: var(--on-accent); font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; }
.unit-count { font-family: 'Courier New', monospace; font-weight: 800; }
.move-cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.move-cell .val { font-weight: 800; }
.cell-date { white-space: nowrap; }

/* image manager (product form) — first tile = primary */
.img-url-row { display: flex; gap: 8px; margin-bottom: 10px; }
.img-url-row input { flex: 1; min-width: 0; }
.img-url-row .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.img-count { font-weight: 400; color: var(--text-muted); }
.img-manager { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.img-tile { position: relative; width: 92px; height: 92px; border: 2px solid var(--border-color); border-radius: 3px; overflow: hidden; background: var(--bg-secondary); }
.img-tile.primary { border-color: var(--navy-accent); }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-x, .img-star { position: absolute; top: 4px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 3px;
    background: rgba(0, 0, 0, .6); color: var(--on-accent); font-size: 12px; cursor: pointer; }
.img-x { right: 4px; }
.img-star { left: 4px; }
.img-x:hover { background: var(--danger); }
.img-star:hover { background: var(--warning); color: var(--navy-primary); }
.img-badge { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; background: var(--navy-accent); color: var(--on-accent); font-size: 10px; font-weight: 800; letter-spacing: .6px; text-align: center; }
.img-none { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
body.dark-mode .img-tile span.img-badge { color: var(--on-accent) !important; }
body.dark-mode span.img-none, body.dark-mode span.img-count { color: var(--text-muted) !important; }

/* adjust popup — current stock line */
.adj-info { margin: -4px 0 14px; padding: 8px 12px; border-left: 3px solid var(--navy-accent); background: rgba(var(--navy-accent-rgb), .07); font-size: 13.5px; color: var(--text-secondary); }
body.dark-mode p.adj-info { color: var(--text-secondary) !important; }
@media (max-width: 576px) {
    .img-url-row { flex-direction: column; }
    .pthumb { width: 36px; height: 36px; }
}

/* =====================================================================
   SHOP — Phase 3: imei units modal (Rameez Scripts)
   ===================================================================== */
/* sub-tabs inside a modal body (reuses the hub tab look) */
.hub-tabs.in-body { padding: 0; margin: 2px 0 14px; background: transparent; }
.hub-tab-tools { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.hub-tab-tools .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
/* stock vs units mismatch banner + re-entry info line */
.unit-warn { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 12px; padding: 9px 12px; border-left: 3px solid var(--warning); border-radius: 3px;
    background: rgba(251, 188, 4, .13); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.unit-warn i { margin-top: 2px; color: var(--warning); }
.unit-info { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); }
.unit-info i { margin-top: 2px; color: var(--navy-accent); }
.unit-panes { margin-bottom: 16px; }
.unit-list { margin-top: 4px; }
.form-group textarea.unit-bulk { font-family: 'Courier New', monospace; line-height: 1.5; }
/* paste preview + skipped lines */
.unit-preview { margin: 0 0 12px; }
.unit-prev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.unit-prev-head i { color: var(--navy-accent); }
.unit-more { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.unit-errs { margin-top: 10px; padding: 9px 12px; border-left: 3px solid var(--warning); border-radius: 3px; background: rgba(251, 188, 4, .1);
    font-size: 12.5px; color: var(--text-primary); text-align: left; }
.unit-errs b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.unit-errs b i { color: var(--warning); }
.unit-errs ul { margin: 0; padding-left: 18px; }
.unit-errs li { margin: 2px 0; overflow-wrap: anywhere; }
.unit-errs small { display: block; margin-top: 4px; color: var(--text-muted); }
.unit-count.is-off { color: var(--danger); cursor: help; }
body.dark-mode p.unit-warn { color: var(--text-primary); }
body.dark-mode p.unit-warn span { color: var(--text-primary) !important; }
body.dark-mode p.unit-info { color: var(--text-muted); }
body.dark-mode div.unit-prev-head { color: var(--text-secondary) !important; }
body.dark-mode div.unit-errs, body.dark-mode .unit-errs li, body.dark-mode .unit-errs b { color: var(--text-primary) !important; }
body.dark-mode span.unit-count.is-off { color: var(--danger) !important; }
@media (max-width: 576px) {
    .hub-tabs.in-body .hub-tab { flex: 1; justify-content: center; }
    .hub-tab-tools .btn { width: 100%; justify-content: center; }
}

/* =====================================================================
   SHOP — Phase 4: customer 360 hub + statement bar (Rameez Scripts)
   ===================================================================== */
.hub-ov .modal.hub-xl { width: 90vw; max-width: 90vw; }
.c360-id { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 14px; padding: 12px 14px;
    border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-secondary); }
.c360-avatar { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--navy-accent); }
.c360-avatar i { color: var(--on-accent); font-size: 20px; }
.c360-main { flex: 1 1 200px; min-width: 0; }
.c360-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; color: var(--navy-primary); overflow-wrap: anywhere; }
.c360-sub { margin-top: 3px; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.c360-sub i { margin-right: 4px; color: var(--navy-accent); }
.c360-acts { display: flex; gap: 8px; }
.c360-acts .btn { min-width: 44px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.hub-table .actions-cell { justify-content: flex-end; }
.hub-table .tb-pill { white-space: nowrap; }
/* statement bar — from / to / show / prints */
.c360-stmt { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; align-items: end; margin-bottom: 4px; }
.c360-stmt-acts { display: flex; gap: 8px; margin-bottom: 20px; }
.c360-stmt-acts .btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
body.dark-mode div.c360-name { color: var(--text-primary) !important; }
body.dark-mode div.c360-sub { color: var(--text-muted) !important; }
@media (max-width: 576px) {
    .c360-acts { width: 100%; }
    .c360-acts .btn { flex: 1; }
    .c360-stmt-acts .btn { flex: 1; }
}

/* =====================================================================
   SHOP — Phase 5: POS register (product grid + ticket), unit picker, sale prints (Rameez Scripts)
   ===================================================================== */
.pos-wrap { padding-top: 14px; }
.pos-tabs { margin-top: 0; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pos-panel { min-width: 0; }
.pos-ticket { padding: 14px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-primary); }
.pos-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; color: var(--navy-primary); }
.pos-h i { color: var(--navy-accent); }
.pos-lock { padding: 34px 16px; text-align: center; color: var(--navy-primary); }
.pos-lock i { font-size: 28px; margin-bottom: 10px; color: var(--navy-accent); }
.pos-lock p { margin: 0; font-weight: 600; }
.pos-soon { min-height: 180px; justify-content: center; }
/* search + in-stock toggle + category chips */
.pos-filter { display: flex; gap: 8px; margin-bottom: 10px; }
.pos-search { position: relative; flex: 1; min-width: 0; }
.pos-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
body.shop-page .pos-search input { width: 100%; min-height: 44px; padding: 10px 12px 10px 36px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); font-size: 16px; }
.pos-search input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15); }
.pos-search-modal { margin-bottom: 12px; }
.pos-stock-toggle { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-color); border-radius: 3px;
    background: var(--bg-card); color: var(--text-secondary); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pos-stock-toggle.on { border-color: var(--success); background: rgba(52, 168, 83, .1); color: var(--success); }
.pos-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pos-cat { min-height: 40px; padding: 0 14px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card); color: var(--text-secondary);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pos-cat:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.pos-cat.active { border-color: var(--navy-accent); background: var(--navy-accent); color: var(--on-accent); }
.pos-count { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-muted); }
.pos-count i { color: var(--navy-accent); }
/* product cards */
.pos-prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-skel { height: 196px; border-radius: 3px; }
.pos-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card);
    color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pos-card:hover:not(:disabled) { border-color: var(--navy-accent); box-shadow: 0 4px 14px rgba(var(--navy-accent-rgb), .16); transform: translateY(-1px); }
.pos-card:focus-visible { outline: 2px solid var(--navy-accent); outline-offset: 2px; }
.pos-card.is-out { opacity: .55; cursor: not-allowed; }
.pos-img { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; background: var(--bg-secondary); color: var(--text-muted); font-size: 26px; }
.pos-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pos-img-cat { position: absolute; left: 6px; top: 6px; }
.pos-img-cat .chip { font-size: 10.5px; }
.pos-img-n { position: absolute; right: 6px; top: 6px; padding: 1px 6px; border-radius: 3px; background: rgba(0, 0, 0, .6); color: var(--on-accent); font-size: 10.5px; font-weight: 700; }
.pos-body { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 8px 10px 10px; }
.pos-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; font-size: 13px; font-weight: 700; line-height: 1.3; }
.pos-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pos-price { font-size: 14px; font-weight: 800; color: var(--navy-primary); }
.pos-stock { padding: 1px 7px; border-radius: 3px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pos-stock.in { background: rgba(52, 168, 83, .14); color: var(--success); }
.pos-stock.low { background: rgba(251, 188, 4, .18); color: var(--text-primary); }
.pos-stock.out { background: rgba(234, 67, 53, .14); color: var(--danger); }
.pos-empty { grid-column: 1 / -1; padding: 30px 10px; text-align: center; color: var(--text-muted); }
/* cart lines */
.cart-empty { margin: 0 0 12px; padding: 12px 0; color: var(--text-muted); }
.cart-item { padding: 8px 0; border-bottom: 1px dashed var(--border-color); }
.cart-line { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 6px; align-items: center; }
.cart-name { grid-column: 1 / -1; min-width: 0; font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.cart-list { margin-left: 4px; font-weight: 600; font-size: 11.5px; color: var(--warning); }
body.shop-page .cart-line input { width: 100%; min-height: 40px; padding: 6px 8px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); font-size: 16px; text-align: right; }
body.shop-page .cart-line input:disabled { background: var(--bg-secondary); color: var(--text-muted); }
body.shop-page .cart-line input.cart-sub { font-weight: 700; }
.cart-x { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); border-radius: 3px;
    background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.cart-x:hover { border-color: var(--danger); color: var(--danger); }
.cart-imeis { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.cart-imeis .btn { min-height: 32px; display: inline-flex; align-items: center; gap: 5px; }
.imei-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; border: 1px solid rgba(var(--navy-accent-rgb), .3); border-radius: 3px;
    background: rgba(var(--navy-accent-rgb), .08); font-family: 'Courier New', monospace; font-size: 12.5px; font-weight: 700; color: var(--navy-primary); }
.imei-chip i { color: var(--navy-accent); }
.imei-chip button { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 3px; background: transparent; color: var(--text-muted); cursor: pointer; }
.imei-chip button:hover { background: rgba(234, 67, 53, .12); color: var(--danger); }
/* bill-to 2x2 + loyalty / credit */
.pos-bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.shop-page .pos-bill-grid input { width: 100%; font-size: 16px; }
.pos-hint { display: flex; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.pos-hint i { margin-top: 2px; color: var(--navy-accent); }
.pos-loyalty { margin: -4px 0 14px; padding: 10px 12px; border: 1px solid rgba(var(--navy-accent-rgb), .22); border-radius: 3px; background: rgba(var(--navy-accent-rgb), .05); }
.pos-lp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 3px; background: var(--bg-card); border: 1px solid var(--border-color);
    font-size: 12.5px; font-style: normal; font-weight: 700; color: var(--navy-primary); }
.lp-chip i { color: var(--warning); }
.lp-chip small { font-weight: 400; color: var(--text-muted); }
.pos-lp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 10px; }
.pos-lp-grid .form-group { margin-bottom: 0; }
.pos-lp-grid .form-group[hidden] { display: none; }
/* trade-in card */
.pos-tradein { margin-bottom: 14px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card); }
.pos-tradein-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: transparent;
    color: var(--navy-primary); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.pos-tradein-head > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pos-tradein-head i { color: var(--navy-accent); }
.pos-tradein-arrow { transition: transform .2s; }
.pos-tradein.open .pos-tradein-arrow { transform: rotate(180deg); }
.pos-tradein-head .lp-chip i, .pos-tradein-head .lp-chip { color: var(--success); }
.pos-tradein-body { padding: 0 12px 12px; }
.pos-tradein-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 6px; padding: 10px 0; border-top: 1px dashed var(--border-color);
    grid-template-areas: "im im2 x" "br mo mo" "st co co" "cd va va" "no no no"; }
body.shop-page .pos-tradein-row input[type="text"], body.shop-page .pos-tradein-row input[type="number"] { width: 100%; min-height: 40px; padding: 6px 8px; font-size: 16px; }
.pos-tradein-row [data-k="imei"] { grid-area: im; } .pos-tradein-row [data-k="imei2"] { grid-area: im2; } .pos-tradein-row .cart-x { grid-area: x; }
.pos-tradein-row [data-k="brand"] { grid-area: br; } .pos-tradein-row [data-k="model"] { grid-area: mo; }
.pos-tradein-row [data-k="storage"] { grid-area: st; } .pos-tradein-row [data-k="color"] { grid-area: co; }
.pos-tradein-row .sd { grid-area: cd; min-width: 0; } .pos-tradein-row [data-k="value"] { grid-area: va; } .pos-tradein-row .tr-notes { grid-area: no; }
.pos-tradein-body > .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 8px; }
/* payment, totals, cash, checkout */
.pos-pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pos-totals { padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card); }
.pos-total-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; color: var(--text-secondary); }
.pos-total-row[hidden] { display: none; }
.pos-total-row > span:last-child { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.pos-total-row.grand { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border-color); font-size: 16px; font-weight: 800; color: var(--navy-primary); }
.pos-total-row.grand > span:last-child { font-size: 18px; color: var(--navy-primary); }
body.shop-page .pos-total-row input.grand-input { width: 140px; min-height: 42px; padding: 6px 10px; border: 2px solid var(--navy-accent); background: var(--bg-card); color: var(--navy-primary);
    font-size: 18px; font-weight: 800; text-align: right; }
.pos-total-row.is-warn { font-size: 12.5px; color: var(--warning); }
.pos-total-row.is-warn > span:last-child { white-space: normal; font-weight: 600; color: var(--text-primary); }
.pos-total-row.is-earn { font-size: 12.5px; color: var(--success); }
.pos-total-row.is-earn > span:last-child { color: var(--success); }
.pos-cash { margin: 12px 0 2px; }
.pos-checkout { width: 100%; min-height: 48px; margin-top: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; }
.pos-done { text-align: left; line-height: 1.8; }
/* unit picker rows */
.up-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.unit-row.unit-pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 3px;
    background: var(--bg-card); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.unit-row.unit-pick:hover { border-color: var(--navy-accent); }
.unit-row.unit-pick.on { border-color: rgba(var(--navy-accent-rgb), .45); background: rgba(var(--navy-accent-rgb), .07); }
.unit-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.imei-main { font-family: 'Courier New', monospace; font-weight: 800; }
.imei-sub { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text-muted); }
.imei-var { display: block; font-family: inherit; }
.unit-st { flex: none; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; }
.unit-st.avail { background: rgba(52, 168, 83, .14); color: var(--success); }
.unit-st.on { background: rgba(var(--navy-accent-rgb), .15); color: var(--navy-accent); }
/* dark — the template greys every span / div */
body.dark-mode h3.pos-h, body.dark-mode .pos-lock p { color: var(--text-primary) !important; }
body.dark-mode span.pos-price, body.dark-mode span.lp-chip, body.dark-mode span.imei-chip, body.dark-mode .pos-total-row.grand span { color: var(--text-primary) !important; }
body.dark-mode span.pos-stock.in, body.dark-mode span.unit-st.avail, body.dark-mode .pos-total-row.is-earn span { color: var(--success) !important; }
body.dark-mode span.pos-stock.out { color: var(--danger) !important; }
body.dark-mode span.pos-stock.low { color: var(--text-primary) !important; }
body.dark-mode .pos-total-row.is-warn span { color: var(--warning) !important; }
body.dark-mode small.cart-list { color: var(--warning) !important; }
body.dark-mode span.unit-st.on { color: var(--navy-accent) !important; }
body.dark-mode span.imei-sub, body.dark-mode div.pos-count, body.dark-mode p.cart-empty, body.dark-mode small.pos-hint { color: var(--text-muted) !important; }
body.dark-mode span.pos-img-n { color: var(--on-accent) !important; }
body.dark-mode .pos-cat.active { color: var(--on-accent); }
@media (max-width: 992px) {
    .pos-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .pos-prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .pos-filter { flex-wrap: wrap; }
    .pos-stock-toggle { flex: 1; justify-content: center; }
    .pos-cat { flex: 1 1 auto; }
    .pos-ticket { padding: 12px 10px; }
    .pos-bill-grid, .pos-lp-grid, .pos-pay-grid { grid-template-columns: 1fr; }
    body.shop-page .pos-total-row input.grand-input { width: 120px; }
}
/* sale prints — thermal item lines + A4 imei / trade-in / amount in words */
.th-meta { font-size: 11.5px; line-height: 1.45; }
.th-line { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; }
.th-line > div { min-width: 0; flex: 1; }
.th-line > span { white-space: nowrap; }
.th-sub { font-size: 10.5px; line-height: 1.35; }
.th-method { margin-top: 4px; }
.a4-imei { font-size: 10.5px; color: var(--text-secondary); }
.a4-table td.a4-tin { font-weight: 400; font-size: 10.5px; color: var(--text-secondary); }
.a4-words { margin: -4px 0 12px; font-size: 11.5px; }
/* ---- P6 · sales history · returns · void · statement ---- */
/* header exports belong to the history / returns tables — none on the register */
body.page-pos.pos-on-register .head-btn.pos-tab-act { display: none !important; }
.act-ret { color: var(--warning); font-size: 15px; }
.act-pay { color: var(--success); font-size: 15px; }
.act-ret:hover, .act-pay:hover { transform: scale(1.18); }
.tin-tip { cursor: help; }
/* identity cell extras — date line + status / return pills under the doc no */
.chip-table .cell-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; white-space: normal; }
.chip-table .cell-sub i { color: var(--navy-accent); margin-right: 3px; }
.chip-table .cell-pills { display: flex; flex-wrap: wrap; gap: 4px; }
body.page-pos .header h1 { white-space: nowrap; }
body.dark-mode .chip-table div.cell-sub { color: var(--text-muted) !important; }
.ret-flag { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 3px; font-size: 14px; }
.ret-flag.is-yes { color: var(--success); background: rgba(52, 168, 83, .12); }
.ret-flag.is-no { color: var(--text-muted); background: var(--bg-primary); }
/* return modal */
.ret-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 12px; margin-bottom: 4px; border: 1px solid rgba(var(--navy-accent-rgb), .2); border-radius: 3px;
    background: rgba(var(--navy-accent-rgb), .05); font-size: 13.5px; color: var(--text-secondary); }
.ret-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ret-meta i { color: var(--navy-accent); }
.ret-meta b { color: var(--text-primary); }
body.shop-page input.ret-qty { width: 96px; min-height: 40px; padding: 6px 10px; font-size: 16px; text-align: right; }
.ret-done { font-size: 12.5px; font-style: italic; color: var(--text-muted); }
.ret-prev { margin-top: 14px; }
#retLines .hub-table { margin-bottom: 4px; }
/* sale view popup */
.sale-view { text-align: left; font-size: 13.5px; }
.sale-view hr { border: 0; border-top: 1px solid var(--border-color); margin: 10px 0; }
.sv-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--border-color); }
.sv-line > span { font-weight: 700; white-space: nowrap; color: var(--text-primary); }
.sv-name small { color: var(--text-muted); font-weight: 600; }
.sv-sub { font-size: 11.5px; color: var(--text-muted); font-family: 'Courier New', monospace; }
.sv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; color: var(--text-secondary); }
.sv-row > span:last-child { color: var(--text-primary); text-align: right; }
.sv-row.is-bad > span:last-child { color: var(--danger); font-weight: 700; }
.c360-m { color: var(--text-muted); }
body.dark-mode span.ret-flag.is-yes { color: var(--success) !important; }
body.dark-mode .ret-meta span, body.dark-mode .sv-row > span:first-child { color: var(--text-secondary) !important; }
body.dark-mode .ret-meta b, body.dark-mode .sv-row > span:last-child, body.dark-mode .sv-line > span, body.dark-mode .sv-name { color: var(--text-primary) !important; }
body.dark-mode .sv-row.is-bad > span:last-child { color: var(--danger) !important; }
body.dark-mode span.ret-done, body.dark-mode .sv-sub, body.dark-mode .sv-name small, body.dark-mode small.c360-m { color: var(--text-muted) !important; }
@media (max-width: 576px) {
    body.shop-page input.ret-qty { width: 76px; }
    .ret-meta { font-size: 12.5px; }
}

/* ===== buy used phone (P7) ===== */
.chip.grade-chip { min-width: 22px; padding: 0 6px; justify-content: center; margin-left: 3px; }
.chip-row .val small { font-weight: 600; color: var(--text-muted); margin-left: 3px; }
.up-sug { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.up-sug i { color: var(--navy-accent); }
.up-sug b { color: var(--text-primary); }
.up-id { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.up-id img { height: 64px; max-width: 120px; object-fit: cover; border: 1px solid var(--border-color); border-radius: 3px; display: block; }
.up-pv { text-align: left; font-size: 14px; line-height: 1.85; }
.up-pv-row b { color: var(--text-primary); }
.up-pv-row span { color: var(--text-secondary); }
.up-pv-img { display: block; max-width: 100%; max-height: 140px; margin-top: 4px; border: 1px solid var(--border-color); border-radius: 3px; }
.up-pv-done { margin-top: 6px; font-size: 13px; }
.up-pv-done i { color: var(--success); }
/* contract print — seller id photo + key/value device table */
.a4-idimg { display: block; max-height: 110px; max-width: 60%; margin-top: 6px; border: 1px solid var(--border-color); }
.a4-kv th { width: 160px; background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-color); font-size: 11.5px; }
body.dark-mode .up-sug, body.dark-mode .up-pv-row span, body.dark-mode .chip-row .val small { color: var(--text-muted) !important; }
body.dark-mode .up-sug b, body.dark-mode .up-pv-row b { color: var(--text-primary) !important; }
body.dark-mode .up-pv-done i { color: var(--success) !important; }
.up-imeis { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* ===== repairs + public tracker (P8) ===== */
.act-wa { color: var(--success); font-size: 15px; }
.act-wa:hover { transform: scale(1.18); }
.chip-row i.rp-wa-on { color: var(--success); }
.chip-row i.rp-wa-off, .tabulator-cell i.rp-wa-off { color: var(--text-muted); }
.tabulator-cell i.rp-wa-on { color: var(--success); }
body.shop-page input.rp-remaining { background: var(--bg-primary); color: var(--text-primary); font-weight: 700; cursor: default; }
.rp-parts-add { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 12px; align-items: end; }
.rp-parts-add .form-group { margin-bottom: 0; }
.rp-part-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rp-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.rp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 3px; font-size: 13px; font-weight: 600;
    background: rgba(var(--navy-accent-rgb), .1); border: 1px solid rgba(var(--navy-accent-rgb), .3); color: var(--text-primary); }
.rp-pill > i { color: var(--navy-accent); }
.rp-pill-x { border: 0; background: none; color: var(--text-muted); cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 3px; }
.rp-pill-x:hover { color: var(--danger); background: rgba(234, 67, 53, .08); }
.rp-pills-empty { font-size: 12.5px; color: var(--text-muted); }
body.dark-mode span.rp-pill { color: var(--text-primary) !important; }
body.dark-mode .rp-pill > i { color: var(--navy-accent) !important; }
body.dark-mode span.rp-pills-empty { color: var(--text-muted) !important; }
body.dark-mode .chip-row i.rp-wa-on, body.dark-mode .tabulator-cell i.rp-wa-on { color: var(--success) !important; }
@media (max-width: 576px) {
    .rp-parts-add { grid-template-columns: minmax(0, 1fr) 90px; }
    .rp-part-btn { grid-column: 1 / -1; justify-content: center; }
}
/* job ticket / sheet prints — tear-off stub, tracking url, money box */
.th-stub { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--text-primary); font-size: 11px; font-weight: 700; }
.a4-money { width: 50%; margin-left: auto; }
.a4-track { font-size: 11px; word-break: break-all; }
.a4-stub { margin-top: 26px; padding-top: 8px; border-top: 2px dashed var(--text-muted); font-size: 11px; font-weight: 700; color: var(--text-secondary); }
/* public tracker (track.php) — standalone, login-box shell */
.track-page { margin: 0; }
.track-box { max-width: 480px; }
.track-box h2 { margin-bottom: 8px; }
.track-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; }
.track-sub i { color: var(--navy-accent); }
.track-lang { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; margin-bottom: 20px; border: 1px solid var(--border-color); border-radius: 3px;
    background: var(--bg-secondary); color: var(--text-primary); font-size: 14px; font-weight: 600; cursor: pointer; }
.track-lang:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.track-bad { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1px solid rgba(234, 67, 53, .35); border-radius: 3px;
    background: rgba(234, 67, 53, .06); color: var(--danger); font-weight: 700; }
.track-info { text-align: left; margin-bottom: 20px; font-size: 14px; line-height: 1.9; color: var(--text-secondary); }
.track-info i { width: 20px; color: var(--navy-accent); }
.track-info b { color: var(--text-primary); }
.track-raw { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.track-steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 4px; position: relative; }
.track-steps li { flex: 1; text-align: center; position: relative; }
.track-steps li + li::before { content: ''; position: absolute; top: 17px; right: 50%; width: 100%; height: 3px; background: var(--border-color); z-index: 0; }
.track-steps li.is-done + li.is-done::before { background: var(--navy-accent); }
.track-dot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50%;
    background: var(--border-color); color: var(--text-muted); font-size: 14px; }
.track-steps li.is-done .track-dot { background: var(--navy-accent); color: var(--on-accent); }
.track-steps li.is-current .track-dot { box-shadow: 0 0 0 4px rgba(var(--navy-accent-rgb), .25); }
.track-lbl { display: block; font-size: 12px; color: var(--text-muted); }
.track-steps li.is-done .track-lbl { color: var(--navy-accent); }
.track-steps li.is-current .track-lbl { font-weight: 800; }
body.dark-mode .track-sub, body.dark-mode span.track-lbl, body.dark-mode div.track-raw { color: var(--text-muted) !important; }
body.dark-mode .track-steps li.is-done span.track-lbl { color: var(--navy-accent) !important; }
body.dark-mode .track-steps li.is-done span.track-dot { color: var(--on-accent) !important; }
body.dark-mode div.track-info { color: var(--text-secondary) !important; }
body.dark-mode .track-info b { color: var(--text-primary) !important; }
body.dark-mode div.track-bad { color: var(--danger) !important; }
body.dark-mode .track-lang { background: var(--bg-secondary); color: var(--text-primary); }
/* ---- installments · expenses · cash drawer (P9) ---- */
.head-btn.is-off { display: none !important; }
.lte-info-grid.ex-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
.ex-note { display: block; white-space: normal; font-size: 13px; line-height: 1.4; color: var(--text-secondary); }
body.dark-mode span.ex-note { color: var(--text-secondary) !important; }
/* due today / overdue card + schedule terms */
.lte-card.ins-due { border-top-color: var(--danger); margin-bottom: 20px; }
.ins-due .lte-card-title i { color: var(--danger); }
.ins-due-table .actions-cell { justify-content: flex-end; }
.about-roles-table tr.is-late td { background: rgba(234, 67, 53, .07); }
.about-roles-table tr.is-late td.ins-date { color: var(--danger); font-weight: 700; }
body.dark-mode .about-roles-table tr.is-late td { background: rgba(234, 67, 53, .16); }
body.dark-mode .about-roles-table tr.is-late td.ins-date { color: var(--danger) !important; }
.ins-head { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; margin-bottom: 12px; }
.ins-head > div { display: flex; align-items: center; gap: 8px; }
.ins-k { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.ins-v { font-size: 15px; font-weight: 800; color: var(--text-primary); }
body.dark-mode span.ins-k { color: var(--text-muted) !important; }
body.dark-mode span.ins-v { color: var(--text-primary) !important; }
.ins-terms .actions-cell { justify-content: flex-start; flex-wrap: wrap; }
.ins-paid { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-weight: 600; white-space: nowrap; }
body.dark-mode span.ins-paid { color: var(--success) !important; }
.ip-preview { max-height: 260px; overflow: auto; margin: 4px 0 12px; }
.ip-preview:empty { display: none; }
.ip-pv-head { font-size: 13px; margin-bottom: 8px; color: var(--text-secondary); }
.ip-pv-head i { color: var(--navy-accent); }
body.dark-mode div.ip-pv-head { color: var(--text-secondary) !important; }
body.dark-mode .ip-pv-head i { color: var(--navy-accent) !important; }
.ip-preview .about-roles-table { font-size: 13px; }
.ip-preview .about-roles-table th, .ip-preview .about-roles-table td { padding: 6px 10px; }
/* till */
.cd-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 17px; color: var(--navy-primary); }
.cd-h i { color: var(--navy-accent); }
body.shop-page input.cd-ro { background: var(--bg-primary); color: var(--text-primary); font-weight: 700; cursor: default; }
body.shop-page input.cd-var.is-neg { color: var(--danger); }
body.shop-page input.cd-var.is-pos { color: var(--success); }
.cd-v { font-weight: 700; }
.ex-kpis .info-box, .cd-kpis .info-box { min-width: 0; } /* long labels ellipsis instead of widening the grid */
@media (max-width: 576px) {
    .lte-info-grid.ex-kpis { grid-template-columns: 1fr; }
    .ins-head { gap: 8px 18px; }
    .ins-due .lte-card-body { padding: 10px; }
    .ins-due-table th, .ins-due-table td { padding: 8px 6px; font-size: 13px; }
}
/* ---- dashboard · reports · imei lookup · welcome tour (P10) ---- */
.dash-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding: 18px 22px; margin-bottom: 20px; border-radius: 3px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); color: var(--on-accent); box-shadow: 0 2px 8px var(--shadow-color); }
.dash-hero-info { min-width: 0; }
.dash-hero-info h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 21px; color: var(--on-accent); }
.dash-hero-info p { margin: 0; font-size: 14px; opacity: .9; color: var(--on-accent); }
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-hero-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 3px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12); color: var(--on-accent); font-size: 13.5px; font-weight: 600; text-decoration: none; touch-action: manipulation; }
.dash-hero-btn:hover { background: rgba(255, 255, 255, .22); color: var(--on-accent); }
.dash-hero-btn[disabled] { opacity: .7; cursor: progress; }
body.dark-mode .dash-hero h2, body.dark-mode .dash-hero p, body.dark-mode .dash-hero span, body.dark-mode .dash-hero div, body.dark-mode .dash-hero i { color: var(--on-accent) !important; }
.db-skel { display: inline-block; width: 4.5em; max-width: 100%; height: .8em; border-radius: 3px; vertical-align: middle;
    background: linear-gradient(90deg, rgba(255, 255, 255, .18) 25%, rgba(255, 255, 255, .32) 50%, rgba(255, 255, 255, .18) 75%); background-size: 200% 100%; animation: skeleton-loading 1.4s infinite; }
.info-box .db-skel, .im-count .db-skel { background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; }
.small-box-footer.is-off { min-height: 33px; pointer-events: none; }
body.shop-page .lte-info-grid > .info-box { min-width: 0; } /* long labels ellipsis, never push the grid wider */
body.shop-page .small-box .inner p, body.shop-page .small-box .inner h3 { color: inherit; }
body.dark-mode.shop-page .small-box div.inner, body.dark-mode.shop-page .small-box .inner h3, body.dark-mode.shop-page .small-box .inner p, body.dark-mode.shop-page a.small-box-footer { color: var(--on-accent) !important; }
body.dark-mode.shop-page .small-box.bg-warning div.inner, body.dark-mode.shop-page .small-box.bg-warning .inner h3, body.dark-mode.shop-page .small-box.bg-warning .inner p { color: var(--navy-primary) !important; }
body.dark-mode.shop-page .small-box.bg-warning a.small-box-footer { color: var(--navy-primary) !important; }
body.dark-mode.shop-page .small-box div.icon, body.dark-mode.shop-page .small-box div.icon i { color: rgba(0, 0, 0, .18) !important; } /* faded watermark icon, as in light */
.db-rows { padding: 2px 0; }
.db-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 90px; margin: 0; padding: 14px; text-align: center; color: var(--text-muted); font-size: 14px; }
.db-empty i { color: var(--navy-accent); font-size: 17px; }
body.dark-mode div.db-empty, body.dark-mode p.db-empty { color: var(--text-muted) !important; }
.db-chart.is-empty { height: auto; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.db-chart .skeleton-chart { height: 100%; }
/* needs attention — one click from the fix */
.lte-card.db-attn { border-top-color: var(--warning); }
.db-attn .lte-card-title i { color: var(--warning); }
.db-attn-list { display: flex; flex-direction: column; gap: 8px; }
.db-attn-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border-radius: 3px; text-decoration: none; color: var(--text-primary);
    border: 1px solid var(--border-color); border-left: 4px solid var(--navy-accent); background: var(--bg-card); transition: background .15s ease, transform .15s ease; }
.db-attn-row:hover { background: rgba(var(--navy-accent-rgb), .06); transform: translateX(2px); }
.db-attn-row > i:first-child { width: 18px; text-align: center; color: var(--navy-accent); }
.db-attn-row.is-bad { border-left-color: var(--danger); } .db-attn-row.is-bad > i:first-child { color: var(--danger); }
.db-attn-row.is-ok { border-left-color: var(--success); } .db-attn-row.is-ok > i:first-child { color: var(--success); }
.db-attn-row.is-warn { border-left-color: var(--warning); } .db-attn-row.is-warn > i:first-child { color: var(--warning); }
.db-attn-txt { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.db-attn-n { min-width: 26px; padding: 2px 8px; border-radius: 3px; text-align: center; font-style: normal; font-size: 12px; font-weight: 800;
    background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent); }
.db-attn-row.is-bad .db-attn-n { background: rgba(234, 67, 53, .12); color: var(--danger); }
.db-attn-row.is-ok .db-attn-n { background: rgba(52, 168, 83, .14); color: var(--success); }
.db-attn-go { color: var(--text-muted); font-size: 12px; }
body.dark-mode span.db-attn-txt { color: var(--text-primary) !important; }
body.dark-mode .db-attn-row.is-bad > i:first-child, body.dark-mode .db-attn-row.is-bad em.db-attn-n { color: var(--danger) !important; }
body.dark-mode .db-attn-row.is-ok > i:first-child, body.dark-mode .db-attn-row.is-ok em.db-attn-n { color: var(--success) !important; }
body.dark-mode .db-attn-row.is-warn > i:first-child { color: var(--warning) !important; }
/* mini tables */
.db-table .about-roles-table { font-size: 13px; }
.db-table .about-roles-table th, .db-table .about-roles-table td { padding: 8px 10px; }
.db-table td.db-neg { color: var(--danger); font-weight: 800; }
.db-table td.db-when { white-space: nowrap; color: var(--text-muted); }
.db-table td.db-detail { white-space: normal; min-width: 180px; }
body.dark-mode .db-table td.db-neg { color: var(--danger) !important; }
.lte-card.db-due { border-top-color: var(--danger); }
/* reports */
.rp-period { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.rp-period i { color: var(--navy-accent); }
body.dark-mode p.rp-period { color: var(--text-muted) !important; }
.rp-table th.num, .rp-table td.num { text-align: right; white-space: nowrap; }
.rp-table tr.rp-sub td { color: var(--text-muted); font-size: 13px; }
.rp-table tr.rp-sub td:first-child { padding-left: 34px; }
.rp-table tr.rp-total td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--border-color); }
.rp-table tr.rp-total.is-pos td.num { color: var(--success); }
.rp-table tr.rp-total.is-neg td.num { color: var(--danger); }
body.dark-mode .rp-table tr.rp-sub td { color: var(--text-muted) !important; }
body.dark-mode .rp-table tr.rp-total.is-pos td.num { color: var(--success) !important; }
body.dark-mode .rp-table tr.rp-total.is-neg td.num { color: var(--danger) !important; }
.rp-ico { width: 18px; text-align: center; color: var(--navy-accent); }
.lte-info-grid.rp-status { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.rp-none { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.rp-none i { font-size: 38px; color: var(--navy-accent); margin-bottom: 12px; }
.rp-none h3 { margin: 0 0 6px; color: var(--navy-primary); }
.rp-skel-box { min-height: 110px; }
.a4-table tr.a4-sub td { color: var(--text-secondary); font-size: 11px; }
.a4-table tr.a4-sub td:first-child { padding-left: 22px; }
/* imei lookup — search + type-ahead + vertical timeline */
.im-head { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.im-count { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); }
.im-count i { color: var(--navy-accent); }
.im-search { display: flex; gap: 10px; align-items: stretch; }
.im-sug-wrap { position: relative; flex: 1; min-width: 0; }
.im-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
body.shop-page .im-sug-wrap input { width: 100%; min-height: 48px; padding: 10px 14px 10px 40px; font-size: 16px; font-family: 'Courier New', monospace; letter-spacing: .5px;
    border: 1px solid var(--input-border); border-radius: 3px; background: var(--input-bg); color: var(--text-primary); }
body.shop-page .im-sug-wrap input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .18); }
.im-search .btn { min-height: 48px; white-space: nowrap; }
.im-sug { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50; max-height: min(480px, 70vh); overflow: auto; border: 1px solid var(--border-color); border-radius: 3px;
    background: var(--bg-card); box-shadow: 0 10px 26px var(--shadow-hover); }
.im-sug-item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light); }
.im-sug-item:last-child { border-bottom: 0; }
.im-sug-item.on { background: rgba(var(--navy-accent-rgb), .1); }
.im-sug-item.none { cursor: default; color: var(--text-muted); font-size: 13px; }
.im-sug-item > i { width: 18px; text-align: center; }
.im-grow { display: flex; flex-direction: column; min-width: 0; }
.im-sg-imei { font-family: 'Courier New', monospace; font-size: 14px; color: var(--text-primary); }
.im-sg-imei b { color: var(--navy-accent); }
.im-sg-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-sug-foot { padding: 8px 14px; font-size: 12px; color: var(--text-muted); background: var(--bg-primary); }
body.dark-mode span.im-sg-imei { color: var(--text-primary) !important; }
body.dark-mode .im-sg-imei b { color: var(--navy-accent) !important; }
body.dark-mode span.im-sg-sub, body.dark-mode div.im-sug-foot, body.dark-mode div.im-sug-item.none, body.dark-mode span.im-count { color: var(--text-muted) !important; }
.im-t-unit { color: var(--navy-accent); } .im-t-sale { color: var(--success); } .im-t-return { color: var(--danger); }
.im-t-repair { color: color-mix(in srgb, var(--warning) 72%, var(--text-primary)); } .im-t-used_phone_purchase { color: var(--navy-light); } .im-t-trade_in { color: var(--navy-primary); }
body.dark-mode .im-t-used_phone_purchase, body.dark-mode .im-t-trade_in { color: var(--navy-accent); }
.im-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--text-muted); }
.im-empty i { font-size: 34px; color: var(--navy-accent); }
.im-empty p { max-width: 620px; margin: 0; line-height: 1.6; }
body.dark-mode .im-empty p { color: var(--text-muted) !important; }
.im-timeline { position: relative; list-style: none; margin: 0; padding: 4px 0 4px 0; }
.im-timeline::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: 19px; width: 2px; background: var(--border-color); }
.im-item { position: relative; display: flex; gap: 16px; padding: 0 0 16px; }
.im-item:last-child { padding-bottom: 0; }
.im-dot { position: relative; z-index: 1; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--on-accent); font-size: 15px; box-shadow: 0 0 0 4px var(--bg-card); }
.im-bg-unit { background: var(--navy-accent); } .im-bg-sale { background: var(--success); } .im-bg-return { background: var(--danger); }
.im-bg-repair { background: var(--warning); color: var(--navy-primary); } .im-bg-used_phone_purchase { background: var(--navy-light); } .im-bg-trade_in { background: var(--navy-primary); }
.im-card { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card); }
.im-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.im-top strong { font-size: 14.5px; color: var(--text-primary); overflow-wrap: anywhere; }
.im-sub { margin-top: 4px; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.im-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.im-date { font-size: 12.5px; color: var(--text-muted); }
.im-date i { color: var(--navy-accent); margin-right: 4px; }
.im-bottom .btn-sm { min-height: 36px; }
body.dark-mode div.im-sub { color: var(--text-secondary) !important; }
body.dark-mode span.im-date { color: var(--text-muted) !important; }
body.dark-mode span.im-dot, body.dark-mode .im-dot i { color: var(--on-accent) !important; }
body.dark-mode span.im-dot.im-bg-repair, body.dark-mode .im-bg-repair i { color: var(--navy-primary) !important; }
/* welcome tour (H2) */
body.shop-page .modal.tour { max-width: 430px; }
.tour-body { text-align: center; padding: 30px 26px 18px; }
.tour-ico { width: 74px; height: 74px; margin: 0 auto; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 30px;
    background: linear-gradient(135deg, var(--navy-accent), var(--navy-light)); color: var(--on-accent); box-shadow: 0 10px 26px rgba(var(--navy-accent-rgb), .35); }
.tour-title { margin: 14px 0 8px; color: var(--navy-primary); font-size: 19px; }
.tour-text { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.tour-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.tour-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--border-color); cursor: pointer; transition: all .2s; }
.tour-dot.on { width: 22px; border-radius: 3px; background: var(--navy-accent); }
.tour-actions { display: flex; justify-content: space-between; gap: 10px; padding: 0 26px 24px; }
.tour-actions .btn { min-height: 42px; }
body.dark-mode .tour-ico i, body.dark-mode div.tour-ico { color: var(--on-accent) !important; }
body.dark-mode p.tour-text { color: var(--text-secondary) !important; }
@media (prefers-reduced-motion: reduce) { .db-attn-row, .tour-dot { transition: none; } .db-skel { animation: none; } }
@media (max-width: 768px) {
    .dash-hero { padding: 16px; }
    .dash-hero-actions { width: 100%; }
    .dash-hero-btn { flex: 1 1 calc(50% - 8px); }
    .lte-info-grid.rp-status { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .dash-hero-info h2 { font-size: 18px; }
    .im-search { flex-direction: column; }
    .im-search .btn { width: 100%; }
    .im-timeline::before { left: 15px; }
    .im-dot { flex-basis: 32px; width: 32px; height: 32px; font-size: 13px; }
    .im-item { gap: 10px; }
    .db-attn-row { padding: 10px; }
}

/* header danger button (e.g. Clear Credentials) */
.head-btn.danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.head-btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: var(--danger); }

/* quick theme menu: soft / classic switch */
.theme-quick-style { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 10px 12px 0; }
.theme-quick-style .mode-toggle-btn { min-width: 0; justify-content: center; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-quick-style .mode-toggle-btn i { flex: none; }
.theme-quick-style .mode-toggle-btn.active { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
.theme-mode-option small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* =====================================================================
   SOFT UI — the sidebar look on every page (html[data-ui="soft"]).
   Sidebar recipe: tinted ground · white panels with a hairline border, 4px corners,
   1px shadow · light tinted heads instead of dark fills · accent only on icons + actions.
   Classic = everything above this block, untouched.
   ===================================================================== */
html[data-ui="soft"] body {
    --bg-primary: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary));
    --soft-head: color-mix(in srgb, var(--navy-accent) 6%, var(--bg-card));
    --soft-tint: rgba(var(--navy-accent-rgb), 0.10);
    --soft-r: var(--sb-r);
    --soft-shadow: 0 1px 3px var(--shadow-color);
}

/* panels */
html[data-ui="soft"] :is(.header, .data-section, .lte-card, .settings-mega-card, .stat-card, .acct-card,
    .about-table-wrapper, .skeleton-card, .info-box, .setup-guide-table, .control-group, .security-feature, .stat-item-inline, .palette-card) {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--soft-r) !important; /* beats the global rounding polish */
    box-shadow: var(--soft-shadow);
}
html[data-ui="soft"] :is(.small-box, .modal-content, .modal-box, .notification-dropdown, .header-tool-dropdown, .account-info-card) { border-radius: var(--soft-r) !important; }
html[data-ui="soft"] :is(.control-group, .security-feature, .stat-item-inline) { box-shadow: none; }
html[data-ui="soft"] .palette-card.active { border-color: var(--navy-accent); box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb), 0.35); }
html[data-ui="soft"] :is(.settings-card-header, .lte-card-header) { background: transparent; border-bottom: 1px solid var(--border-color); }
html[data-ui="soft"] body.dark-mode .settings-card-header { background: transparent; }
html[data-ui="soft"] .lte-card, html[data-ui="soft"] .stat-card { border-top-width: 1px; border-left-width: 1px; border-top-color: var(--border-color); border-left-color: var(--border-color); }

/* icon tiles: tinted square, coloured glyph */
html[data-ui="soft"] :is(.settings-card-icon, .stat-card-icon, .control-icon, .security-feature-icon) {
    background: var(--soft-tint); color: var(--navy-accent); border-radius: var(--soft-r); box-shadow: none;
}
html[data-ui="soft"] :is(.settings-card-icon, .stat-card-icon, .control-icon, .security-feature-icon) i { color: inherit; }
html[data-ui="soft"] :is(.icon-gradient-danger, .stat-icon-danger) { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
html[data-ui="soft"] .icon-gradient-warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: #b7791f; }
html[data-ui="soft"] .icon-gradient-success { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }

/* KPI tiles: white panel, colour lives in the glyph + footer */
html[data-ui="soft"] .small-box { --sbx: var(--navy-accent); background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--soft-r); box-shadow: var(--soft-shadow); }
html[data-ui="soft"] .small-box.bg-navy    { --sbx: var(--navy-primary); }
html[data-ui="soft"] .small-box.bg-success { --sbx: var(--success); }
html[data-ui="soft"] .small-box.bg-warning { --sbx: #d69e00; }
html[data-ui="soft"] .small-box.bg-danger  { --sbx: var(--danger); }
html[data-ui="soft"] body.dark-mode .small-box.bg-navy { --sbx: var(--navy-accent); }
html[data-ui="soft"] .small-box:hover { box-shadow: 0 4px 12px var(--shadow-color); }
html[data-ui="soft"] .small-box .inner h3 { color: var(--text-primary); }
html[data-ui="soft"] .small-box .inner p { color: var(--text-muted); opacity: 1; }
html[data-ui="soft"] .small-box .icon { color: var(--sbx); opacity: 0.22; }
html[data-ui="soft"] .small-box-footer { background: color-mix(in srgb, var(--sbx) 7%, var(--bg-card)); color: var(--sbx); border-top: 1px solid var(--border-light); }
html[data-ui="soft"] .small-box-footer:hover { background: color-mix(in srgb, var(--sbx) 14%, var(--bg-card)); color: var(--sbx); }

/* table heads: light tint, not a dark bar */
html[data-ui="soft"] .main-content table thead :is(tr, th) {
    background: var(--soft-head) !important; color: var(--text-secondary) !important; border-color: var(--border-color) !important;
}
html[data-ui="soft"] .main-content table thead th { border-bottom: 1px solid var(--border-color) !important; }
html[data-ui="soft"] .main-content table thead th i { color: var(--navy-accent); }
html[data-ui="soft"] .chip-navy { background: var(--soft-tint); color: var(--text-primary); }
html[data-ui="soft"] .tabulator { border-radius: var(--soft-r); box-shadow: var(--soft-shadow); }
html[data-ui="soft"] .ui-panel { border-radius: var(--soft-r); box-shadow: var(--soft-shadow); }
html[data-ui="soft"] .uip-side { background: color-mix(in srgb, var(--navy-accent) 5%, var(--bg-card)); border-right: 1px solid var(--border-color); }
html[data-ui="soft"] .uip-side i { background: color-mix(in srgb, var(--text-muted) 25%, transparent); }
html[data-ui="soft"] .uip-side i.on { background: var(--navy-accent); }
html[data-ui="soft"] .uip-kpis div { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
html[data-ui="soft"] .uip-kpis div b { color: var(--navy-accent); }
html[data-ui="soft"] .uip-table::before { background: var(--soft-head); border-bottom: 1px solid var(--border-color); }
html[data-ui="soft"] .tabulator .tabulator-header, html[data-ui="soft"] .tabulator .tabulator-header .tabulator-col.tabulator-frozen-left { background: var(--soft-head); color: var(--text-secondary); border-bottom: 1px solid var(--border-color); }
html[data-ui="soft"] .tabulator .tabulator-header .tabulator-col { border-right-color: var(--border-color); }
html[data-ui="soft"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover { background: rgba(var(--navy-accent-rgb), .06); }
html[data-ui="soft"] .tabulator .tabulator-header-filter input:not([type="checkbox"]), html[data-ui="soft"] .tabulator .tabulator-header-filter select { border-color: var(--border-color); }
html[data-ui="soft"] :is(.tabulator, .tb-bar, .tb-bulk-btn, .tabulator-page, .tabulator-page-size, .tabulator-header-filter input) { border-radius: var(--soft-r) !important; }
html[data-ui="soft"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-ui="soft"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--navy-accent) !important; border-color: var(--navy-accent) !important; color: #fff !important; border-radius: var(--soft-r);
}

/* banners: hairline all round + tint, no accent stripe */
html[data-ui="soft"] .info-banner { border: 1px solid rgba(var(--navy-accent-rgb), 0.25); border-radius: var(--soft-r); background: rgba(var(--navy-accent-rgb), 0.06); color: var(--text-secondary); }
html[data-ui="soft"] .info-banner-warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 9%, transparent); }

/* controls: same corners as the sidebar rows */
html[data-ui="soft"] :is(.btn, .mode-toggle-btn, .palette-card, .hex-input, .notification-item, .lang-item, .action-badge, input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea, .hdr-search, .header-tool-btn, .filters-section) { border-radius: var(--soft-r) !important; }
html[data-ui="soft"] .btn-primary { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
html[data-ui="soft"] .btn-primary:hover { filter: brightness(1.06); }
html[data-ui="soft"] .header-tool-btn:hover { background: var(--sb-hover, rgba(var(--navy-accent-rgb), 0.07)); color: var(--text-primary); }
html[data-ui="soft"] .hdr-search { background: var(--bg-primary); }
html[data-ui="soft"] .filters-section { background: var(--bg-card); border: 1px solid var(--border-color); }

/* ===== Header tier 1 — sidebar language =====
   tinted icon tile + title/breadcrumb · tinted search with "/" hint · square tool buttons with the
   sidebar hover tint · hairline divider · account chip with name + role */
.header > .head-title { flex-direction: row; align-items: center; gap: 12px; }
.head-ico {
    flex: none; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--sb-r, 4px); background: rgba(var(--navy-accent-rgb), 0.12); color: var(--navy-accent); font-size: 18px;
}
.head-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.header .head-txt h1 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header .header-right { gap: 4px; }
.header .hdr-search-wrap { flex: 0 1 290px; margin-right: 8px; }
.header .hdr-search {
    height: 38px; padding: 0 8px 0 12px; gap: 9px;
    background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary));
    border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px) !important;
}
.header .hdr-search:hover { border-color: rgba(var(--navy-accent-rgb), 0.45); }
.hdr-kbd {
    flex: none; min-width: 22px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
    font: 600 11px/1 inherit; color: var(--text-muted);
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 3px;
}
.hdr-search:focus-within .hdr-kbd { opacity: 0; }

/* every tool = one 38px square, sidebar hover tint */
.header .header-right :is(.header-tool-btn, .notification-bell-btn) {
    position: relative; width: 38px; height: 38px; padding: 0; justify-content: center; display: inline-flex; align-items: center;
    font-size: 16px; color: var(--text-secondary); background: transparent; border: 0; border-radius: var(--sb-r, 4px) !important;
    transition: background-color .2s, color .2s;
}
.header .header-right :is(.header-tool-btn, .notification-bell-btn):hover,
.header .header-right .header-tool-wrapper:has(.header-tool-dropdown.open) > .header-tool-btn,
.header .header-right .notification-bell-wrapper:has(.notification-dropdown.show, .notification-dropdown.open) > .notification-bell-btn {
    background: rgba(var(--navy-accent-rgb), 0.09); color: var(--navy-accent);
}
.header .header-right .lang-switcher .header-tool-btn { width: auto; padding: 0 10px; gap: 6px; }
.header .header-right .lang-current { font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.header .notification-badge { top: 3px; right: 2px; min-width: 17px; height: 17px; font-size: 10px; border-radius: 3px; border: 2px solid var(--bg-card); box-sizing: content-box; padding: 0 3px; }
.header .msg-dot { top: 8px; right: 8px; }

/* account chip behind a hairline */
.header .hdr-user-wrap { margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--border-color); }
.header .hdr-user {
    max-width: 210px; gap: 10px; padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: var(--sb-r, 4px);
    background: transparent; transition: background-color .2s, border-color .2s;
}
.header .hdr-user:hover, .header .hdr-user-wrap:has(.header-tool-dropdown.open) .hdr-user { background: rgba(var(--navy-accent-rgb), 0.07); border-color: var(--border-color); }
.header .hdr-user-av { width: 34px; height: 34px; }
.hdr-user-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.2; }
.hdr-user-txt .hdr-user-name { font-size: 14px; font-weight: 600; color: var(--text-primary); max-width: 130px; }
.hdr-user-role { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }

@media (max-width: 768px) {
    .head-ico { width: 36px; height: 36px; font-size: 15px; }
    .header .head-txt h1 { font-size: 18px; }
    .header .header-right { gap: 2px; justify-content: space-between; }
    .header .hdr-user-wrap { margin-left: 2px; padding-left: 6px; }
}
@media (max-width: 640px) { .hdr-user-txt { display: none; } }

/* processing overlay — writes only */
.rs-overlay { position: fixed; inset: 0; z-index: 20000; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .15s, visibility 0s .15s; }
.rs-overlay.on { opacity: 1; visibility: visible; transition-delay: 0s; }
.rs-overlay-card { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 220px; padding: 22px 26px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.rs-overlay-card img { border-radius: 50%; object-fit: cover; }
.rs-overlay-card span { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.rs-overlay-bar { position: relative; width: 160px; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(var(--navy-accent-rgb), .15); }
.rs-overlay-bar i { position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--navy-accent); animation: rsOvBar 1s linear infinite; }
@keyframes rsOvBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .rs-overlay-bar i { animation-duration: 2.5s; } }
.rs-swal-list { margin: 0; padding-left: 18px; text-align: left; font-size: 13px; }

/* ===== Settings app — section list left (sidebar language), one section right ===== */
.set-app { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-nav {
    position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px;
    background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary));
    border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px);
}
.set-nav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px;
    border: 1px solid transparent; border-radius: var(--sb-r, 4px);
    color: var(--text-secondary); text-decoration: none; transition: background-color .2s, border-color .2s, color .2s;
}
.set-nav a:hover { background: rgba(var(--navy-accent-rgb), .07); color: var(--text-primary); }
.set-nav a.active { background: var(--bg-card); border-color: var(--border-color); box-shadow: 0 1px 3px var(--shadow-color); color: var(--text-primary); }
.set-nav a:focus-visible { outline: 2px solid rgba(var(--navy-accent-rgb), .55); outline-offset: -2px; }
.set-nav-ico {
    flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--sb-r, 4px); background: rgba(var(--navy-accent-rgb), .10); color: var(--text-muted); font-size: 14px; transition: color .2s, background-color .2s;
}
.set-nav a.active .set-nav-ico, .set-nav a:hover .set-nav-ico { color: var(--navy-accent); }
.set-nav a.active .set-nav-ico { background: rgba(var(--navy-accent-rgb), .16); }
.set-nav-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.set-nav-txt strong { font-size: 14.5px; font-weight: 600; color: inherit; }
.set-nav-txt small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-nav-go { flex: none; font-size: 10px; color: var(--text-muted); opacity: 0; transition: opacity .2s; }
.set-nav a.active .set-nav-go, .set-nav a:hover .set-nav-go { opacity: 1; }

/* one section at a time; the old 2x2 grid just flows its cards */
.set-main { min-width: 0; }
.set-main [data-set]:not(.on) { display: none !important; }
.set-main .settings-grid-2x2 { display: contents; }
.set-main [data-set].on { margin: 0 0 16px !important; animation: setIn .18s ease-out; }
@keyframes setIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .set-main [data-set].on { animation: none; } }

/* phones: list becomes a scrolling chip row */
@media (max-width: 900px) {
    .set-app { grid-template-columns: 1fr; gap: 12px; }
    .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px; }
    .set-nav::-webkit-scrollbar { display: none; }
    .set-nav a { flex: none; padding: 7px 10px; gap: 8px; }
    .set-nav-ico { width: 28px; height: 28px; font-size: 12px; }
    .set-nav-txt small, .set-nav-go { display: none; }
}

/* =====================================================================
   PHONE SHELL — app bar · ⋮ sheet · float dock · bottom bar (pattern from the NFC build)
   desktop: the sheet is display:contents (buttons stay in tier 2), tools stay in the header
   ===================================================================== */
.hdr-sheet, .hdr-sheet-page { display: contents; }
.hdr-sheet-app, .hdr-more-btn, .hdr-tool-lbl { display: none; }
.hf-bar:not(:has(.head-filters:not([hidden]))) { display: none; }

/* alerts / install — one dock: sidebar foot on desktop, ⋮ sheet on phones */
.rs-float-dock { display: flex; flex-direction: column; gap: 8px; }
.rs-float-dock:empty { display: none; }
.rs-float-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px;
    border: 1px solid transparent; border-radius: var(--sb-r, 4px); cursor: pointer;
    font: inherit; font-size: 13.5px; font-weight: 600; color: #fff; transition: filter .2s;
}
.rs-float-btn:hover { filter: brightness(1.08); }
.rs-float-btn:disabled { opacity: .7; cursor: default; }
.rs-float-btn.is-push { order: 1; background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }
.rs-float-btn.is-push i { color: var(--navy-accent); }
.rs-float-btn.is-install { order: 2; background: var(--navy-accent); }
body.dark-mode .rs-float-btn :is(span, i) { color: inherit !important; }
body.dark-mode .rs-float-btn.is-push i { color: var(--navy-accent) !important; }
.sidebar-dock { flex-shrink: 0; padding: 8px 8px 0; }
.sidebar-dock:not(:has(.rs-float-btn)) { display: none; }
.sidebar-dock .rs-float-btn { width: 100%; }
@media (min-width: 769px) {
    .sidebar.collapsed .sidebar-dock .rs-float-btn { padding: 8px 0; }
    .sidebar.collapsed .sidebar-dock .rs-float-btn span { display: none; }
}

/* bottom bar — sidebar language: tinted panel, hairline, active = accent tint */
.mobile-bottom-nav {
    background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)) !important;
    border-top: 1px solid var(--border-color); box-shadow: 0 -2px 10px var(--shadow-color) !important; padding: 0 4px;
}
.mobile-bottom-nav .mobile-nav-item {
    position: relative; flex: 1; min-width: 0; padding: 7px 4px; gap: 3px; border-radius: var(--sb-r, 4px);
    color: var(--text-muted) !important; font-size: 10.5px; font-weight: 600; background: none !important; box-shadow: none !important;
}
.mobile-bottom-nav .mobile-nav-item i { font-size: 19px; margin: 0; transform: none !important; color: inherit !important; }
.mobile-bottom-nav .mobile-nav-item span { color: inherit !important; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mobile-bottom-nav .mobile-nav-item.active { color: var(--navy-accent) !important; background: rgba(var(--navy-accent-rgb), .10) !important; }
.mobile-bottom-nav .mobile-nav-item:active { background: rgba(var(--navy-accent-rgb), .08) !important; }
.mobile-nav-pill { top: 3px; right: 50%; margin-right: -22px; border-radius: 3px; border: 2px solid color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)); box-sizing: content-box; }
.mobile-nav-pill.is-dot { min-width: 8px; width: 8px; height: 8px; padding: 0; margin-right: -14px; top: 6px; border-radius: 50%; }

@media (max-width: 768px) {
    /* shell: page scrolls inside .main-content; bar sticks to its top */
    .app-container { height: 100dvh; }
    .main-content { padding: 0 12px calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
    body:not(.page-chat):not(.page-ai) .main-content:has(.hdr-sheet .head-btn.primary) { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important; }

    /* app bar: title | bell · avatar · ⋮ */
    .main-content > .header {
        position: sticky; top: 0; z-index: 950; flex-wrap: nowrap; align-items: center; gap: 2px; min-height: 56px;
        margin: 0 -12px 12px; padding: 6px 4px 6px 14px; border: 0; border-bottom: 1px solid var(--border-color);
        border-radius: 0 !important; box-shadow: 0 2px 8px var(--shadow-color);
    }
    .main-content > .header::after { display: none !important; }
    .main-content > .header > .head-title { flex: 1 1 auto; min-width: 0; gap: 10px; }
    .main-content > .header .head-ico { width: 32px; height: 32px; font-size: 14px; }
    .main-content > .header .head-txt h1 { font-size: 17px; }
    .main-content > .header .head-crumbs { display: none; }
    .main-content > .header .header-right { order: 2; flex: none; margin: 0; padding: 0; gap: 0; position: static; justify-content: flex-end; }
    .main-content > .header .header-right :is(.notification-bell-btn, .hdr-user) { width: 42px; height: 42px; padding: 0; justify-content: center; border: 0; }
    .main-content > .header .hdr-user-wrap { margin: 0; padding: 0; border: 0; }
    .main-content > .header .hdr-user-caret, .main-content > .header .hdr-user-txt { display: none; }
    .hdr-more-btn {
        order: 3; position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
        width: 42px; height: 42px; padding: 0; font-size: 18px; color: var(--text-secondary); background: transparent; border: 0;
        border-radius: var(--sb-r, 4px); cursor: pointer; touch-action: manipulation;
    }
    .hdr-more-btn:hover, .header.is-more .hdr-more-btn { color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .09); }
    .header:has(#rsFloatDock > .rs-float-btn) .hdr-more-btn::after { content: ''; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }

    /* bell + account menus: full-width panels under the bar */
    .main-content > .header .header-right :is(.notification-bell-wrapper, .hdr-user-wrap) { position: static; }
    .main-content > .header .header-right :is(.notification-dropdown, .user-menu) { position: absolute; top: 100%; left: 8px; right: 8px; width: auto; max-width: none; margin-top: 4px; }

    /* the ⋮ sheet — visibility only (no opacity / transform) so the fixed primary button inside stays put */
    .hdr-sheet {
        position: absolute; top: 100%; left: 0; right: 0; z-index: 2; display: flex; flex-direction: column; gap: 12px;
        max-height: calc(100dvh - 150px); overflow-y: auto; padding: 12px;
        background: var(--bg-card); border-bottom: 1px solid var(--border-color); box-shadow: 0 12px 24px var(--shadow-hover); visibility: hidden;
    }
    .header.is-more .hdr-sheet { visibility: visible; }
    .hdr-sheet-page { display: block; }
    .hdr-sheet .head-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0 !important; }
    .hdr-sheet .head-btn { width: auto; height: 44px; justify-content: flex-start; gap: 10px; padding: 0 12px; }
    .hdr-sheet .head-btn span { position: static; width: auto; height: auto; overflow: hidden; clip: auto; text-overflow: ellipsis; white-space: nowrap; }
    .hdr-sheet-page:has(.head-btn:not(.primary)) + .hdr-sheet-app { padding-top: 12px; border-top: 1px solid var(--border-color); }
    .hdr-sheet-app { display: flex; flex-wrap: wrap; gap: 8px; }
    .hdr-sheet-app > * { flex: 1 1 calc(33.33% - 6px); min-width: 84px; }
    .hdr-sheet-app .header-tool-btn {
        position: relative; width: 100% !important; height: auto !important; min-height: 62px; flex-direction: column; justify-content: center; gap: 6px;
        padding: 8px 4px !important; font-size: 18px !important; background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)) !important;
        border: 1px solid var(--border-color) !important;
    }
    .hdr-sheet-app .hdr-tool-lbl { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.2; color: var(--text-secondary); white-space: nowrap; }
    .hdr-sheet-app .lang-current { position: absolute; top: 6px; right: 7px; font-size: 10px; }
    .hdr-sheet-app .msg-dot { top: 8px; right: 12px; }
    /* an open tool menu takes its own full-width row, inline (never off-screen) */
    .hdr-sheet-app .header-tool-wrapper:has(> .header-tool-dropdown.open) { flex-basis: 100%; order: 9; }
    .hdr-sheet-app .header-tool-dropdown { position: static; width: auto !important; min-width: 0; max-width: none; margin-top: 8px; box-shadow: none; }
    .hdr-sheet .rs-float-dock { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .hdr-sheet .rs-float-btn { flex: 1 1 140px; min-height: 44px; }

    /* primary page button = floating action button above the bottom bar */
    .hdr-sheet .head-btn.primary {
        position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 960; visibility: visible;
        width: 56px; height: 56px; padding: 0; justify-content: center; font-size: 20px; border-radius: 6px;
        box-shadow: 0 6px 18px rgba(var(--navy-accent-rgb), .45);
    }
    .hdr-sheet .head-btn.primary i { font-size: 20px; }
    .hdr-sheet .head-btn.primary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .hdr-sheet .head-btns:not(:has(.head-btn:not(.primary))) { display: contents; }
    body:has(.sidebar.mobile-open) .hdr-sheet .head-btn.primary, body:has(.modal-overlay.active, .modal-overlay.show) .hdr-sheet .head-btn.primary { visibility: hidden; }
    /* chat + ai: the composer owns the bottom, so their button stays in the sheet */
    /* refresh-type primaries don't deserve a FAB — they stay in the sheet like chat's */
    .hdr-sheet .head-btn.primary:has(.fa-sync, .fa-rotate, .fa-arrows-rotate) {
        position: static; visibility: inherit; width: auto; height: 44px; justify-content: flex-start; padding: 0 12px; font-size: 13.5px; box-shadow: none;
    }
    .hdr-sheet .head-btn.primary:has(.fa-sync, .fa-rotate, .fa-arrows-rotate) span { position: static; width: auto; height: auto; clip: auto; }
    body .main-content:has(.hdr-sheet .head-btn.primary:has(.fa-sync, .fa-rotate)) { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
    :is(.page-chat, .page-ai) .hdr-sheet .head-btn.primary {
        position: static; visibility: inherit; width: auto; height: 44px; justify-content: flex-start; padding: 0 12px; font-size: 13.5px; box-shadow: none;
    }
    :is(.page-chat, .page-ai) .hdr-sheet .head-btn.primary span { position: static; width: auto; height: auto; clip: auto; }
    :is(.page-chat, .page-ai) .hdr-sheet .head-btns:not(:has(.head-btn:not(.primary))) { display: grid; }

    /* filter strips: their own card under the bar, scroll away with the page */
    .hf-bar { margin: 0 0 12px; padding: 10px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px); box-shadow: 0 1px 3px var(--shadow-color); }
    .hf-bar .head-filters { margin: 0; width: 100%; }
    .hf-bar .hf-strip { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
    .hf-bar .hf-strip > * { flex: 1 1 100%; min-width: 0; }
    .hf-bar .hf-strip > .hf-field:has(.sd-wrap) { flex: 1 1 calc(50% - 30px); }
    .hf-bar .hf-strip > .btn-icon { flex: 0 0 44px; width: 44px !important; height: 38px; }
    .hf-bar .hf-field > :is(input, .sd-wrap) { flex: 1 1 auto; width: auto !important; min-width: 0; font-size: 16px !important; }
    .hf-bar .hf-range > input[type="date"] { width: 0 !important; flex: 1 1 0; font-size: 15px !important; }
    .hf-bar .hf-seg button { flex: 1; }

    /* pop-ups sit above the bottom bar and the drawer */
    .modal-overlay { z-index: 1003 !important; }

    /* tables: tighter chip rows, info + pager stack */
    table.dataTable.chip-table { min-width: 640px; }
    .dt-foot { justify-content: center; }
    .dt-foot .dataTables_info { width: 100%; margin: 0; text-align: center; order: -1; }
    .dt-foot .dataTables_length label { display: inline-flex; align-items: center; gap: 8px; }
    .dt-foot .dataTables_length select { width: auto !important; min-width: 76px; min-height: 38px; padding: 4px 8px; }
    .card-body-flush-scroll { overflow-x: auto; }
    .card-body-flush-scroll table { min-width: 680px; }
    .card-body-flush-scroll table td { white-space: nowrap; }

    /* roles matrix: scroll both ways, narrower sticky page column */
    .rbac-table { table-layout: auto !important; width: max-content !important; min-width: 100%; }
    .rbac-table :is(th, td):first-child { width: 128px !important; min-width: 128px; max-width: 128px; white-space: normal !important; }
    .rbac-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .rbac-tabs::-webkit-scrollbar { display: none; }

    /* chat bar sits flush like every page now */
    body.page-chat .main-content > .header { margin-bottom: 10px; }
    body.page-chat .chat-bar { margin: -8px 0 8px; }
}
@media (max-width: 576px) {
    .lte-kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .lte-kpi-grid .small-box .inner { padding: 12px 12px 8px; }
    .lte-kpi-grid .small-box .inner h3 { font-size: 24px; }
    .lte-kpi-grid .small-box .inner p { font-size: 12.5px; }
    .lte-kpi-grid .small-box .icon { font-size: 34px !important; top: 10px; right: 10px; }
    .lte-kpi-grid .small-box-footer { font-size: 12px; padding: 5px 0; }
}

@media (max-width: 380px) {
    .hdr-sheet .head-btns { grid-template-columns: 1fr; }
    .palette-gallery { grid-template-columns: 1fr 1fr !important; }
}

/* AI assistant — same full-height shell as chat: header card on top, the panel fills the rest */
body.page-ai .main-content { overflow: hidden; display: flex; flex-direction: column; }
body.page-ai .main-content > .header { flex-shrink: 0; }
body.page-ai .ai-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
@media (min-width: 769px) {
    body.page-ai .main-content { padding-bottom: 20px !important; }
    body.page-ai .header::after { display: none; }
    body.page-ai .header .head-btns { display: none; } /* the panel's own New Chat is right there */
}
@media (max-width: 900px) { body.page-ai .ai-wrap { height: auto; } }

/* language menu — search + 240-odd languages */
.lang-menu { width: 300px; max-height: 420px; padding: 0; display: none; flex-direction: column; overflow: hidden; }
.lang-menu.open { display: flex; }
.lang-search-wrap { position: relative; flex: none; padding: 8px; border-bottom: 1px solid var(--border-color); }
.lang-search-wrap i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); }
.lang-search { width: 100%; height: 38px; padding: 0 10px 0 34px; border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px) !important; background: var(--input-bg); color: var(--text-primary); font-size: 14px !important; }
.lang-search:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .14); }
.lang-list { flex: 1; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.lang-item { gap: 10px; }
.lang-code { flex: none; min-width: 34px; padding: 3px 0; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: var(--text-secondary); background: rgba(var(--navy-accent-rgb), .08); border-radius: 3px; }
.lang-item.active .lang-code { background: var(--navy-accent); color: #fff; }
.lang-names { display: flex; flex-direction: column; min-width: 0; text-align: start; line-height: 1.25; }
.lang-names b { font-weight: 600; font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-names small { font-size: 11.5px; color: var(--text-muted); }
.lang-item[dir="rtl"] .lang-names { text-align: right; }
.lang-none { padding: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
@media (max-width: 768px) {
    .hdr-sheet-app .lang-menu { width: auto; max-height: 360px; }
    .lang-search { font-size: 16px !important; }
}

/* ===== Split add / edit form — 90% wide: form left, live preview right, actions in a footer bar ===== */
.modal.modal-split {
    width: 90vw; max-width: 1400px; height: min(86vh, 860px); max-height: none; overflow: hidden;
    display: flex; flex-direction: column; border-radius: var(--sb-r, 4px) !important;
}
.modal-split .modal-header { flex: none; padding: 16px 22px; }
.modal-split .split-tabs { display: none; }
.split-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); }
.split-form { min-height: 0; overflow-y: auto; padding: 22px 24px; }
.split-form .form-grid { gap: 18px; }
.split-preview {
    min-height: 0; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
    background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)); border-left: 1px solid var(--border-color);
}
.modal-foot {
    flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px;
    background: var(--bg-card); border-top: 1px solid var(--border-color);
}
.modal-foot .btn { min-width: 120px; justify-content: center; }

/* preview pieces */
.pv-label { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); }
.pv-label:first-child { margin-top: 0; }
.pv-card {
    display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px); box-shadow: 0 1px 3px var(--shadow-color);
}
.pv-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border-color); }
.pv-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-who strong { font-size: 16px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-who small { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-badge { flex: none; padding: 4px 9px; font-size: 12px; font-weight: 700; color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .12); border-radius: 3px; }
.pv-sbrow {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px);
}
.pv-sbrow img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.pv-sbrow span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pv-sbrow b { font-size: 14px; color: var(--text-primary); }
.pv-sbrow small { font-size: 12px; color: var(--text-muted); }
.pv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pv-list li {
    display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; font-size: 13.5px; line-height: 1.4; color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px);
}
.pv-list li i { flex: none; width: 16px; margin-top: 2px; text-align: center; color: var(--text-muted); }
.pv-list li.ok i { color: var(--navy-accent); }
.pv-list li.warn { border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 8%, var(--bg-card)); }
.pv-list li.warn i { color: #b7791f; }
.pv-list li.muted { color: var(--text-muted); }
.pv-list li s { color: var(--text-muted); }
.pv-list li b { color: var(--text-primary); }
.pv-count { display: block; margin-top: 6px; text-align: right; font-size: 12px; color: var(--text-muted); }
.pv-chat { padding: 16px; background: var(--wa-bg, var(--bg-primary)); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px); }
.pv-chat .chat-msg { max-width: 100%; }
.pv-ph { color: var(--text-muted); font-style: italic; }
body.dark-mode .split-preview :is(span, b, strong, small, li) { color: inherit; }

/* phones: full-screen sheet, one pane at a time */
@media (max-width: 900px) {
    .modal.modal-split { width: 100vw; height: 100dvh; max-width: none; border-radius: 0 !important; }
    .modal-split .split-tabs {
        display: flex; flex: none; gap: 4px; margin: 10px 14px 0; padding: 3px;
        background: color-mix(in srgb, var(--navy-accent) 4%, var(--bg-secondary)); border: 1px solid var(--border-color); border-radius: var(--sb-r, 4px);
    }
    .split-tabs button { flex: 1; height: 38px; border: 0; border-radius: 3px; background: none; color: var(--text-secondary); font: 600 14px/1 inherit; cursor: pointer; }
    .split-tabs button.on { background: var(--bg-card); color: var(--navy-accent); box-shadow: 0 1px 3px var(--shadow-color); }
    .split-body { grid-template-columns: 1fr; }
    .modal-split:not(.show-preview) .split-preview, .modal-split.show-preview .split-form { display: none; }
    .split-preview { border-left: 0; }
    .split-form, .split-preview { padding: 16px 14px; }
    .modal-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .modal-foot .btn { flex: 1; min-width: 0; }
    .modal-overlay:has(.modal-split) { padding: 0 !important; align-items: stretch !important; }
}

/* soft look: pop-up head = light bar like the sidebar, accent icon, quiet close */
html[data-ui="soft"] .modal-header { background: var(--bg-card) !important; color: var(--text-primary); border-bottom: 1px solid var(--border-color); border-radius: 0 !important; }
html[data-ui="soft"] .modal-header h3 { color: var(--text-primary) !important; display: flex; align-items: center; gap: 10px; font-size: 18px; }
html[data-ui="soft"] .modal-header h3 i { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--sb-r, 4px); background: rgba(var(--navy-accent-rgb), .12); color: var(--navy-accent) !important; font-size: 15px; }
html[data-ui="soft"] .modal-header .close-btn { color: var(--text-muted) !important; font-size: 20px; border-radius: var(--sb-r, 4px); }
html[data-ui="soft"] .modal-header .close-btn:hover { color: var(--text-primary) !important; background: rgba(var(--navy-accent-rgb), .08); }
/* searchable dropdown inside a normal form field */
.form-group .sd-wrap { width: 100%; }
.form-group .sd-trigger { min-height: 46px; padding: 0 12px; border-radius: var(--sb-r, 4px); font-size: 16px; }

/* ===== SHAPE — squared · rounded · glass. corners + surfaces for the whole app (<html data-shape>).
   LAST block on purpose: beats the Soft / Classic corner rules and the old rounding polish ===== */
:root, html[data-shape="squared"] { --r-panel: 4px;  --r-ctrl: 3px;  --r-chip: 3px; --sb-r: 4px; }
html[data-shape="rounded"]        { --r-panel: 14px; --r-ctrl: 10px; --r-chip: 7px; --sb-r: 10px; }
html[data-shape="glass"]          { --r-panel: 20px; --r-ctrl: 12px; --r-chip: 9px; --sb-r: 12px; }

/* panels */
html[data-shape] :is(.data-section, .lte-card, .settings-mega-card, .account-info-card, .acct-card, .about-table-wrapper,
    .setup-guide-table, .small-box, .stat-card, .info-box, .modal-content, .modal-box, .modal, .notification-dropdown, .header-tool-dropdown, .header,
    .ui-panel, .uip, .tabulator, .tb-bar, .skeleton-card, .filters-section, .control-group, .security-feature, .rs-overlay-card, .split-preview, .swal2-popup) {
    border-radius: var(--r-panel) !important;
}
/* controls */
html[data-shape] :is(.btn, .head-btn, .header-tool-btn, .mode-toggle-btn, .hdr-search, .hf-field, .hf-seg, .tb-bulk-btn, .tabulator-page, .tabulator-page-size,
    .lang-item, .notification-item, .action-badge, .sd-trigger, .ui-choice, .ui-pal, .ui-color, .ui-sw, .ui-color-sw, .theme-quick-swatch, .palette-card, .hex-input,
    .swal2-confirm, .swal2-cancel, .swal2-input, input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea) {
    border-radius: var(--r-ctrl) !important;
}
/* chips + small tags (avatars and dots stay round) */
html[data-shape] :is(.chip, .tb-pill, .role-badge, .status-badge, .val-box, .tb-you, .ui-badge, .act, .tb-cell-edit, .uip-chip, .uip-btn, .uip-kpis div, .hf-seg button, .head-ico) {
    border-radius: var(--r-chip) !important;
}

/* glass — frosted surfaces over a soft palette-tinted backdrop (iOS-style). vars live on body so dark-mode tokens apply */
html[data-shape="glass"] body {
    --glass-bg: color-mix(in srgb, var(--bg-card) 56%, transparent);
    --glass-strong: color-mix(in srgb, var(--bg-card) 93%, transparent);   /* dropdowns + modals: text must win over what is behind */
    --glass-line: rgba(255, 255, 255, 0.6);
    --glass-blur: blur(22px) saturate(180%);
    --glass-shadow: 0 10px 30px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    background:
        radial-gradient(55vw 55vw at 0% 0%, rgba(var(--navy-accent-rgb), 0.24), transparent 62%),
        radial-gradient(45vw 45vw at 100% 8%, rgba(var(--navy-light-rgb), 0.22), transparent 62%),
        radial-gradient(60vw 45vw at 55% 100%, rgba(var(--navy-primary-rgb), 0.16), transparent 62%),
        var(--bg-primary) !important;
    background-attachment: fixed !important;
}
html[data-shape="glass"] body.dark-mode {
    --glass-line: rgba(255, 255, 255, 0.10);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
html[data-shape="glass"] :is(.app-container, .main-content) { background: transparent !important; }
/* backdrop-filter makes every frosted box its own layer: lift the header (theme / bell / account dropdowns)
   above the page, and lift whichever panel holds the open control (searchable dropdown, date picker) */
html[data-shape="glass"] .header { position: relative; z-index: 60; }
html[data-shape="glass"] :is(.ui-panel, .data-section, .lte-card, .settings-mega-card, .acct-card, .tb-bar, .small-box, .info-box, .stat-card):focus-within { position: relative; z-index: 40; }
html[data-shape="glass"] :is(.data-section, .lte-card, .settings-mega-card, .acct-card, .about-table-wrapper, .ui-panel, .tb-bar, .header,
    .filters-section, .skeleton-card, .control-group, .security-feature, .info-box, .stat-card) {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line) !important;
    box-shadow: var(--glass-shadow), var(--glass-hi) !important;
}
html[data-shape="glass"][data-ui="soft"] .small-box {
    background: var(--glass-bg) !important;
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line) !important; box-shadow: var(--glass-shadow), var(--glass-hi) !important;
}
/* floating layers read on top of anything -> stronger glass */
html[data-shape="glass"] :is(.notification-dropdown, .header-tool-dropdown, .modal-content, .modal-box, .modal, .swal2-popup, .tabulator-edit-list, .sd-menu) {
    background: var(--glass-strong) !important;
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line) !important; box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22), var(--glass-hi) !important;
}
html[data-shape="glass"] .sidebar { --sb-bg: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-right: 1px solid var(--glass-line) !important; }
html[data-shape="glass"] .mobile-bottom-nav { background: var(--glass-strong) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-top: 1px solid var(--glass-line) !important; }
/* nested surfaces sit on the frosted panel instead of repainting it */
html[data-shape="glass"] .tabulator { background: transparent !important; border-color: var(--glass-line) !important; }
html[data-shape="glass"] .tabulator-row { background: transparent; }
html[data-shape="glass"] .tabulator-row.tabulator-row-even { background: color-mix(in srgb, var(--bg-card) 25%, transparent); }
html[data-shape="glass"][data-ui="soft"] .tabulator .tabulator-header,
html[data-shape="glass"][data-ui="soft"] .tabulator .tabulator-header .tabulator-col.tabulator-frozen-left { background: color-mix(in srgb, var(--soft-head) 60%, transparent); }
html[data-shape="glass"] .tabulator .tabulator-footer { background: transparent; }
html[data-shape="glass"] .main-content table:not(.rp-table) :is(tbody tr, tbody td) { background: transparent !important; }
html[data-shape="glass"] .main-content table:not(.rp-table) tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-card) 25%, transparent) !important; }
html[data-shape="glass"][data-ui="soft"] .main-content table:not(.rp-table) thead :is(tr, th) { background: color-mix(in srgb, var(--soft-head, var(--bg-card)) 60%, transparent) !important; }
html[data-shape="glass"][data-ui="classic"] .main-content table:not(.rp-table) thead :is(tr, th) { background: rgba(var(--navy-primary-rgb), .88) !important; }   /* classic heads keep white text */
html[data-shape="glass"] :is(.ui-choice, .ui-pal, .ui-color, .ui-sw) { background: color-mix(in srgb, var(--bg-card) 50%, transparent); border-color: var(--glass-line); }
html[data-shape="glass"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea, .hdr-search, .hf-field, .sd-trigger) {
    background: color-mix(in srgb, var(--input-bg) 62%, transparent) !important;
}
/* buttons: glossy highlight on the solid ones, frosted on the quiet ones */
html[data-shape="glass"] :is(.btn-primary, .head-btn.primary) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px rgba(var(--navy-accent-rgb), 0.32) !important; }
html[data-shape="glass"] :is(.head-btn:not(.primary), .header-tool-btn, .tb-bulk-btn:not(.danger), .tabulator-page:not(.active)) { background: color-mix(in srgb, var(--bg-card) 45%, transparent) !important; }
/* no frosting where it can't render or isn't wanted */
@media (prefers-reduced-transparency: reduce) {
    html[data-shape="glass"] body { --glass-bg: var(--bg-card); --glass-strong: var(--bg-card); --glass-blur: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html[data-shape="glass"] body { --glass-bg: color-mix(in srgb, var(--bg-card) 94%, transparent); --glass-strong: var(--bg-card); }
}
@media (max-width: 768px) { html[data-shape="glass"] body { --glass-blur: blur(16px) saturate(170%); } }
/* print never frosts */
@media print { html[data-shape="glass"] body { background: #fff !important; } }

/* ui.php shape tiles — each drawing shows its own corners + surface */
.ui-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.ui-thumb-shape { background: color-mix(in srgb, var(--navy-accent) 5%, var(--bg-card)); border-radius: 3px !important; }
.ui-thumb-shape i { background: color-mix(in srgb, var(--navy-accent) 9%, var(--bg-card)); border-right: 1px solid var(--border-color); }
.ui-thumb-shape b { margin: 4px 6px 0; background: var(--bg-card); border: 1px solid var(--border-color); }
.ui-thumb-shape em { background: var(--bg-card); border: 1px solid var(--border-color); }
.ui-thumb-squared b, .ui-thumb-squared em { border-radius: 2px; }
.ui-thumb-rounded b { border-radius: 5px; } .ui-thumb-rounded em { border-radius: 9px; }
.ui-thumb-glass { background: radial-gradient(circle at 15% 20%, rgba(var(--navy-accent-rgb), .55), transparent 55%), radial-gradient(circle at 90% 90%, rgba(var(--navy-light-rgb), .5), transparent 55%), var(--bg-card); }
.ui-thumb-glass i { background: rgba(255, 255, 255, .35); border-right-color: rgba(255, 255, 255, .5); }
.ui-thumb-glass b, .ui-thumb-glass em { background: rgba(255, 255, 255, .45); border-color: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
.ui-thumb-glass b { border-radius: 6px; } .ui-thumb-glass em { border-radius: 11px; }
@media (max-width: 600px) { .ui-shape-grid { grid-template-columns: 1fr 1fr !important; } }

/* SweetAlert success tick: its animation masks are white blocks sized for a white popup — on tinted / dark / glass popups they show as blobs */
.swal2-icon.swal2-success [class^="swal2-success-circular-line"],
.swal2-icon.swal2-success .swal2-success-fix { background: transparent !important; }

/* ===== Mobile bottom nav — floating bar, active item lifted into a bubble inside a notch.
   ring = page colour, so it reads as a bite out of the bar; two shoulders round the bar's edges into the bite ===== */
.mobile-bottom-nav {
    --mbn-h: 64px; --mbn-bub: 52px; --mbn-ring: 6px; --mbn-gap: 10px;
    left: var(--mbn-gap) !important; right: var(--mbn-gap) !important; bottom: calc(var(--mbn-gap) + env(safe-area-inset-bottom, 0px)) !important;
    height: var(--mbn-h) !important; padding: 0 6px !important; align-items: stretch !important;
    background: var(--bg-card) !important; border: 0 !important; border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08) !important; overflow: visible !important;
}
.mobile-bottom-nav .mobile-nav-item {
    height: 100%; padding: 0 2px !important; justify-content: center; gap: 4px; border-radius: 0 !important;
    color: var(--text-muted) !important; font-size: 11px; font-weight: 600; background: none !important;
    -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav .mobile-nav-item:active { background: none !important; }
.mobile-bottom-nav .mobile-nav-item i { font-size: 20px; }
.mobile-bottom-nav .mobile-nav-item.active { color: var(--text-primary) !important; background: none !important; justify-content: flex-end; padding-bottom: 11px !important; }
.mobile-bottom-nav .mobile-nav-item.active span { font-weight: 800; }
.mobile-bottom-nav .mobile-nav-item.active i {
    position: absolute; z-index: 2; top: calc(var(--mbn-bub) / -2); left: 50%;
    width: var(--mbn-bub); height: var(--mbn-bub); margin-left: calc(var(--mbn-bub) / -2 - var(--mbn-ring));
    display: flex; align-items: center; justify-content: center; box-sizing: content-box;
    border-radius: 50%; border: var(--mbn-ring) solid var(--bg-primary);
    background: color-mix(in srgb, var(--navy-accent) 16%, var(--bg-card)); color: var(--navy-accent) !important; font-size: 22px;   /* opaque: content scrolls behind */
    box-shadow: inset 0 0 0 2px var(--bg-card);
    animation: mbnPop .38s cubic-bezier(.3, 1.6, .5, 1) both;
}
/* shoulders: page-colour corners with a rounded cut, either side of the bite */
.mobile-bottom-nav .mobile-nav-item.active::before,
.mobile-bottom-nav .mobile-nav-item.active::after {
    content: ""; position: absolute; z-index: 1; top: 0; width: 12px; height: 12px; pointer-events: none;
}
.mobile-bottom-nav .mobile-nav-item.active::before {
    left: calc(50% - (var(--mbn-bub) / 2 + var(--mbn-ring)) - 11px);
    background: radial-gradient(circle at 0 100%, transparent 11.5px, var(--bg-primary) 12px);
}
.mobile-bottom-nav .mobile-nav-item.active::after {
    left: calc(50% + (var(--mbn-bub) / 2 + var(--mbn-ring)) - 1px);
    background: radial-gradient(circle at 100% 100%, transparent 11.5px, var(--bg-primary) 12px);
}
.mobile-bottom-nav .mobile-nav-item.active .mobile-nav-pill { top: calc(var(--mbn-bub) / -2 - 2px); z-index: 3; }
@keyframes mbnPop { from { transform: translateY(14px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mobile-bottom-nav .mobile-nav-item.active i { animation: none; } }
html[data-shape="glass"] .mobile-bottom-nav { background: color-mix(in srgb, var(--bg-card) 97%, transparent) !important; }   /* content scrolls under it — keep labels clean */
@media (max-width: 768px) {
    .main-content { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important; }
    .hdr-sheet .head-btn.primary { bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }   /* clears the floating bar + bubble */
}

/* ===== Sidebar bottom: Profile · Dark mode · Theme · About as one row of icon buttons, name on hover ===== */
.sidebar:not(.collapsed) .sb-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.sidebar:not(.collapsed) .sb-grid > li { position: relative; margin: 0; }
.sidebar:not(.collapsed) .sb-grid :is(a, button) {
    justify-content: center; gap: 0; height: 40px; padding: 0; border: 1px solid var(--border-color);
}
.sidebar:not(.collapsed) .sb-grid :is(a, button) > i:first-child { width: auto; font-size: 16px; }
/* label stays for screen readers, hidden on screen */
.sidebar:not(.collapsed) .sb-grid :is(a, button) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sidebar:not(.collapsed) .sb-grid .sb-switch { display: none; }
.sidebar:not(.collapsed) .sb-grid :is(a, button):hover { border-color: rgba(var(--navy-accent-rgb), .4); }
.sidebar:not(.collapsed) .sb-grid a.active,
.sidebar:not(.collapsed) .sb-grid [aria-checked="true"] { border-color: rgba(var(--navy-accent-rgb), .5); background: rgba(var(--navy-accent-rgb), .1); }
.sidebar:not(.collapsed) .sb-grid :is(a.active, [aria-checked="true"]) > i:first-child { color: var(--navy-accent); }
/* name bubble above the icon on hover / keyboard focus */
.sidebar:not(.collapsed) .sb-grid > li[data-tooltip]::after {
    content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px);
    padding: 4px 8px; border-radius: var(--r-chip, 3px); background: var(--text-primary); color: var(--bg-card);
    font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; z-index: 5;
}
.sidebar:not(.collapsed) .sb-grid > li[data-tooltip]:is(:hover, :focus-within)::after { opacity: 1; transform: translate(-50%, 0); }

/* ===== Phone filters: search + "Filters" toggle on one row, the rest folds into a panel ===== */
.hf-toggle { display: none; }
@media (max-width: 768px) {
    .hf-bar .hf-strip > .hf-toggle {
        display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; height: 42px; padding: 0 14px;
        border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 4px); background: var(--bg-card); color: var(--text-primary);
        font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    }
    .hf-bar .hf-strip > .hf-toggle i { color: var(--navy-accent); }
    .hf-bar .hf-strip > .hf-toggle em { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--navy-accent); color: #fff;
        font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
    .hf-bar .hf-strip > .hf-toggle em[hidden] { display: none; }
    .hf-bar .hf-strip > .hf-toggle.has-on, .hf-bar .hf-strip.hf-open > .hf-toggle { border-color: var(--navy-accent); }
    .hf-bar .hf-strip:has(> .hf-toggle) > :first-child { flex: 1 1 0; min-width: 0; }
    .hf-bar .hf-strip:has(> .hf-toggle) > :first-child > input { height: 40px; }
    .hf-bar .hf-strip:has(> .hf-toggle):not(.hf-open) > :nth-child(n+3) { display: none !important; }
    .hf-bar .hf-strip:has(> .hf-toggle) > :nth-child(n+3) { flex: 1 1 100% !important; }   /* panel rows full width; search + toggle keep row 1 */
    .hf-bar .hf-strip.hf-open > :nth-child(n+3) { animation: hfIn .18s ease-out both; }
    .hf-bar .hf-strip.hf-open > .btn-icon:last-child { flex: 1 1 100% !important; width: auto !important; }
    .hf-bar .hf-strip.hf-open > .btn-icon:last-child::after { content: attr(aria-label); margin-left: 8px; font-size: 14px; font-weight: 600; }
    .hf-bar { padding: 8px; }
}
@keyframes hfIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hf-bar .hf-strip.hf-open > * { animation: none !important; } }

/* ===== Tabulator on phones — row cards, folded columns as a label/value grid, footer that fits ===== */
@media (max-width: 768px) {
    .tabulator { border-radius: var(--r-panel, 4px); }
    .tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 9px 8px; }
    .tabulator-row { border-bottom: 6px solid var(--bg-primary) !important; }
    .tabulator-row:last-child { border-bottom: 0 !important; }
    .tabulator-row .tabulator-cell { padding: 10px 8px; }
    /* folded columns: 2-column grid of small label over value */
    .tabulator-row .tabulator-responsive-collapse { padding: 2px 12px 12px 54px; border: 0; }
    .tabulator-row .tabulator-responsive-collapse table,
    .tabulator-row .tabulator-responsive-collapse tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; width: 100%; }
    .tabulator-row .tabulator-responsive-collapse tr { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .tabulator-row .tabulator-responsive-collapse td { padding: 0 !important; display: block; min-width: 0; overflow-wrap: anywhere; }
    .tabulator-row .tabulator-responsive-collapse td:first-child { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); }
    .tabulator-row .tabulator-responsive-collapse td:first-child strong { font-weight: 700; }
    .tabulator-row .tabulator-responsive-collapse td:last-child { font-size: 13.5px; color: var(--text-primary); }
    /* footer: count on top, then size + pages; first/last dropped */
    .tabulator .tabulator-footer .tabulator-footer-contents { flex-direction: column; align-items: stretch; gap: 8px; }
    .tabulator .tabulator-footer .tabulator-page-counter { text-align: center; }
    .tabulator .tabulator-footer .tabulator-paginator { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
    .tabulator .tabulator-footer .tabulator-paginator > label { display: none; }   /* the size select explains itself */
    .tabulator .tabulator-footer .tabulator-page-size { width: 68px; min-height: 36px; margin: 0 6px 0 0; }
    .tabulator .tabulator-footer .tabulator-page[data-page="first"], .tabulator .tabulator-footer .tabulator-page[data-page="last"] { display: none; }
    .tabulator .tabulator-footer .tabulator-page { min-width: 36px; min-height: 36px; margin: 0; }
    .tabulator .tabulator-footer .tabulator-pages { display: inline-flex; gap: 4px; margin: 0 4px; }
}

/* settings: small text link under a field (e.g. Back to English) */
.set-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--navy-accent);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.set-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) { .logo-upload-row { flex-direction: column; align-items: stretch; gap: 12px; } .logo-upload-row .logo-preview-img { align-self: flex-start; } }

/* ===== Chat list — All / Unread chips, Recent + People groups, initials avatars, phone rows ===== */
.chat-filters { display: flex; gap: 6px; padding: 8px 8px 0; }
.chat-filters button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--wa-line); border-radius: var(--r-pill, 999px);
    background: var(--bg-card); color: var(--wa-txt); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-filters button.on { background: var(--navy-accent); border-color: var(--navy-accent); color: #fff; }
.chat-filters em { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--navy-accent); color: #fff;
    font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.chat-filters button.on em { background: #fff; color: var(--navy-accent); }
.chat-filters em[hidden] { display: none; }
.chat-group { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase; color: var(--wa-mut); }
.chat-group em { font-style: normal; font-weight: 600; }
.chat-ava { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.chat-ava img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 768px) {
    body.page-chat .chat-wrap { border-radius: var(--r-panel, 4px); }
    .chat-contacts { padding: 4px 0; }
    .chat-contact { border-radius: 0; padding: 11px 14px; border: 0; }
    .chat-contact + .chat-contact { margin-top: 0; }
    .chat-contact + .chat-contact::before { content: ""; position: absolute; top: 0; left: 70px; right: 0; border-top: 1px solid var(--wa-line); }
    .chat-contact .chat-ava { width: 48px; height: 48px; flex-basis: 48px; font-size: 15px; }
    .chat-contact-top strong { font-size: 16px; }
    .chat-group { padding: 12px 14px 4px; }
    .chat-filters { padding: 8px 10px 2px; }
}

/* System group header carries the summed count while its submenu is folded */
/* counts read as badges: accent pill, white number */
.sidebar:not(.collapsed) .nav-pill { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--navy-accent); color: #fff;
    font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(var(--navy-accent-rgb), .35); }
.sb-head .nav-pill-group { position: static; margin-left: auto; transform: none; }
.sb-head:has(.nav-pill-group) .submenu-arrow { margin-left: 10px; }
.sb-head.open .nav-pill-group { display: none; }   /* open: the item itself shows it */

/* ===== Shop pages on the two-tier shell — header filters, soft table heads, phone tables, EN/ES tile, shop About tab ===== */
/* soft heads are light, the shop skin painted white text on navy */
html[data-ui="soft"] .tb-wrap .tabulator .tabulator-header { background: var(--soft-head); color: var(--text-secondary); border-bottom: 1px solid var(--border-color); }
html[data-ui="soft"] .tb-wrap .tabulator .tabulator-header .tabulator-col { color: var(--text-secondary); border-right-color: var(--border-color); }
html[data-ui="soft"] .tb-wrap .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: rgba(var(--navy-accent-rgb), .06); }
html[data-ui="soft"] .tb-wrap .tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow { border-bottom-color: var(--text-muted); }
html[data-ui="soft"] body.dark-mode .tb-wrap .tabulator .tabulator-header .tabulator-col,
html[data-ui="soft"] body.dark-mode .tb-wrap .tabulator-col-title { color: var(--text-secondary) !important; }

/* shop dropdown + search inside a header filter field */
.hf-field:has(.sd.open) { border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .14); }
.hf-field > .sd { height: 100%; width: 170px; min-width: 0; }
.hf-field .sd .sd-trigger, .hf-field .sd.sd-sm .sd-trigger { min-height: 0; min-width: 0; height: 100%; padding: 0 10px 0 0; border: 0 !important; background: transparent; box-shadow: none !important; font-size: 14px; }
.hf-field.tb-search > input { width: 200px; height: 100%; padding: 0 10px 0 0; border: 0; background: transparent; }
.hf-strip .tb-pop { display: inline-flex; }
.hf-strip .tb-pop-menu { z-index: 70; }
.hf-strip .btn-icon.tb-colbtn:hover { color: var(--navy-accent); border-color: rgba(var(--navy-accent-rgb), .45); background: rgba(var(--navy-accent-rgb), .08); }
.hf-strip .btn-icon.tb-reset.is-on { color: var(--navy-accent); border-color: rgba(var(--navy-accent-rgb), .45); }
.hf-strip.rp-bar .btn { min-height: 38px; }
/* register tab: no filters, its buttons are hidden -> no empty second tier */
body.page-pos.pos-on-register .header .head-btns { display: none; }
body.page-pos.pos-on-register .header:not(:has(.head-filters:not([hidden])))::after { display: none; }
@media (max-width: 768px) {
    .hf-bar .hf-strip > .hf-field:has(.sd) { flex: 1 1 calc(50% - 30px); }
    .hf-bar .hf-field > .sd, .hf-bar .hf-field.tb-search > input { flex: 1 1 auto; width: auto !important; min-width: 0; font-size: 16px !important; }
    .hf-bar .hf-strip > .tb-pop { flex: 0 0 44px; }
    .hf-bar .hf-strip > .tb-pop .btn-icon { width: 44px !important; height: 38px; }
    .hf-bar .hf-strip .tb-pop-menu { right: 0; left: auto; }
    /* chip stacks need the full card width: folded columns in one column */
    .tb-host.chip-table .tabulator-row .tabulator-responsive-collapse { padding: 4px 12px 12px; }
    .tb-host.chip-table .tabulator-row .tabulator-responsive-collapse :is(table, tbody) { grid-template-columns: minmax(0, 1fr); }
}

/* EN/ES tile: the open sidebar shows the language code, the rail shows the icon */
#shopLangBtn .sb-lang-now { font-size: 12.5px; font-weight: 800; letter-spacing: .5px; color: var(--text-secondary); }
.sidebar:not(.collapsed) .sb-grid #shopLangBtn > i:not(.fa-spin) { display: none; }
.sidebar.collapsed #shopLangBtn .sb-lang-now { display: none; }

/* About — shop logic tab */
.ab-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.ab-h:first-child { margin-top: 0; }
.ab-h i { color: var(--navy-accent); }
.ab-p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.ab-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ab-list li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }
.ab-list li i { color: var(--navy-accent); width: 16px; text-align: center; flex: none; }
/* flat shop columns that may wrap (date + who) */
.chip-table .tabulator-cell.cell-wrap, .chip-table .tabulator-cell.cell-wrap .cell-date { white-space: normal; }
/* phones: the kept name column is narrow — titles wrap, a chip row drops its value under the chip */
@media (max-width: 576px) {
    .chip-table .tabulator-row .tabulator-cell .cell-title { white-space: normal; overflow-wrap: anywhere; }
    .chip-table .tabulator-row .tabulator-cell .chip-row { flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 2px 8px; }
    .chip-table .tabulator-row .tabulator-cell .chip-row .val { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
    .chip-table .tabulator-row .tabulator-cell .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
.ab-pane .about-roles-table.ab-logic { table-layout: fixed; }
.ab-pane .about-roles-table.ab-logic :is(th, td) { white-space: normal; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ab-pane .about-roles-table.ab-logic th:first-child { width: 190px; }
.ab-pane .about-roles-table.ab-logic th:last-child { width: 26%; }
.ab-pane .about-roles-table.ab-logic code { white-space: normal; }
.ab-pane .about-roles-table.ab-logic td:first-child { font-weight: 600; }
@media (max-width: 768px) { .ab-pane .about-roles-table.ab-logic { table-layout: auto; min-width: 640px; } .ab-pane .about-roles-table.ab-logic th:first-child { width: 120px; } }

/* =====================================================================
   PUBLIC PAGES — warm cream look (home page, sign-in pages, repair tracker, maintenance)
   Cream #f7f4ed · charcoal #1c1c1c · off-white #fcfbf8 · muted #5f5f5d · lines #eceae4. Greys = charcoal at an opacity.
   Figtree 400 + 600 only. Borders hold things together; the one shadow is the inset on dark buttons.
   Radii: 6 buttons + fields · 12 cards · 16 containers · full pill for icon buttons, tabs + chips.
   Own tokens, so the admin's palette / style / shape options never change these pages. Dark mode = neutral black.
   ===================================================================== */
html body:is(.lv-site, .lv-auth, .lv-track, .lv-maint) {
    --lv-cream: #f7f4ed; --lv-char: #1c1c1c; --lv-white: #fcfbf8; --lv-muted: #5f5f5d; --lv-line: #eceae4; --lv-card: #f7f4ed;
    --lv-c83: rgba(28, 28, 28, .83); --lv-c40: rgba(28, 28, 28, .4); --lv-c04: rgba(28, 28, 28, .04); --lv-c03: rgba(28, 28, 28, .03);
    --lv-ring: rgba(59, 130, 246, .5);
    --lv-focus: rgba(0, 0, 0, .1) 0 4px 12px;
    --lv-inset: rgba(255, 255, 255, .2) 0 .5px 0 0 inset, rgba(0, 0, 0, .2) 0 0 0 .5px inset, rgba(0, 0, 0, .05) 0 1px 2px 0;
    --lv-wash-a: rgba(251, 196, 171, .34); --lv-wash-b: rgba(246, 189, 206, .26); --lv-wash-c: rgba(180, 212, 245, .3);
    --lv-scrim: rgba(28, 28, 28, .42);
    --lv-ease: cubic-bezier(.2, .7, .2, 1);
    /* HPhones logo artwork */
    --hp-cyan: #12d6e6; --hp-cyan-pulse: #0aa9b7; --hp-coral: #f4896b; --hp-coral-hi: #ffb59d; --hp-ink: #06323a; --hp-spark: #06323a; --hp-orb: #06323a;
    --lv-font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    /* shared widgets on these pages follow the cream tokens */
    --navy-primary: var(--lv-char); --navy-dark: var(--lv-char); --navy-light: var(--lv-muted); --navy-accent: var(--lv-char); --navy-hover: var(--lv-char);
    --navy-primary-rgb: 28, 28, 28; --navy-light-rgb: 95, 95, 93; --navy-accent-rgb: 28, 28, 28; --on-accent: var(--lv-white);
    --bg-primary: var(--lv-cream); --bg-secondary: var(--lv-cream); --bg-card: var(--lv-card);
    --text-primary: var(--lv-char); --text-secondary: var(--lv-c83); --text-muted: var(--lv-muted);
    --border-color: var(--lv-line); --border-light: var(--lv-line); --input-bg: var(--lv-card); --input-border: var(--lv-line);
    --glass-bg: var(--lv-card); --glass-strong: var(--lv-card); --glass-line: var(--lv-line); --glass-blur: none; --glass-shadow: none; --glass-hi: none;
    background: var(--lv-cream) !important; color: var(--lv-char); font-family: var(--lv-font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
html body.dark-mode:is(.lv-site, .lv-auth, .lv-track, .lv-maint) {
    --lv-cream: #121212; --lv-char: #f2f0ea; --lv-white: #121212; --lv-muted: #a3a29d; --lv-line: rgba(255, 255, 255, .1); --lv-card: #1e1e1e;
    --lv-c83: rgba(242, 240, 234, .83); --lv-c40: rgba(242, 240, 234, .4); --lv-c04: rgba(255, 255, 255, .05); --lv-c03: rgba(255, 255, 255, .03);
    --lv-focus: rgba(0, 0, 0, .5) 0 4px 12px;
    --lv-inset: rgba(255, 255, 255, .25) 0 .5px 0 0 inset, rgba(0, 0, 0, .3) 0 0 0 .5px inset;
    --lv-wash-a: rgba(251, 196, 171, .06); --lv-wash-b: rgba(246, 189, 206, .05); --lv-wash-c: rgba(180, 212, 245, .06);
    --lv-scrim: rgba(0, 0, 0, .6);
    --hp-cyan-pulse: #b4f7fc; --hp-spark: #fff; --hp-orb: #fff;
    --navy-primary-rgb: 242, 240, 234; --navy-light-rgb: 163, 162, 157; --navy-accent-rgb: 242, 240, 234;
}
:is(.lv-site, .lv-auth, .lv-track, .lv-maint) :is(input, select, textarea, button) { font-family: inherit; }
:is(.lv-site, .lv-auth, .lv-track, .lv-maint) :is(a, button, input, textarea):focus-visible { outline: none; box-shadow: 0 0 0 2px var(--lv-ring) !important; }
:is(.lv-site, .lv-auth, .lv-track, .lv-maint) :is(h1, h2, h3) { font-weight: 600; color: var(--lv-char); }
body.lv-site [hidden] { display: none !important; }
/* dark mode: the app's blanket p / span / div / label colour would win — hand the text back */
body.dark-mode.lv-site :is(.lv-btn, .lv-pill, .lv-chip, .lv-tabs, .lv-colors) :is(span, div) { color: inherit !important; }
body.dark-mode:is(.lv-site, .lv-auth, .lv-track, .lv-maint) :is(.lv-muted, .lv-lead, .lv-eyebrow, .lv-card-brand, .lv-card-sub, .lv-count, .lv-fig span, .lv-shelf-name,
    .lv-stock, .lv-foot-bottom small, .lv-badges li, .lv-clist small, .lv-social small, .lv-err,
    .lv-cat p, .lv-steps p, .lv-map p, .lv-offer:not(.is-dark) p, .lv-empty p, .lv-intro p) { color: var(--lv-muted) !important; }
body.dark-mode.lv-site :is(.lv-price, .lv-brand span, .lv-stock.is-low) { color: var(--lv-char) !important; }

html.lv-lock { overflow: hidden; }
html:has(> body.lv-home) { scroll-behavior: smooth; scroll-padding-top: 80px; }
.lv-wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.lv-skip { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 6px; background: var(--lv-char); color: var(--lv-white); }
.lv-skip:focus { top: 12px; }
.lv-muted { color: var(--lv-muted); }

/* buttons — 6px rectangles, pills only for icon buttons */
.lv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid transparent; border-radius: 6px;
    font-size: 16px; font-weight: 400; line-height: 1.5; text-decoration: none; white-space: nowrap; cursor: pointer; touch-action: manipulation; transition: opacity .15s, background-color .15s, border-color .15s; }
.lv-btn:active { opacity: .8; }
.lv-btn-dark { background: var(--lv-char); border-color: var(--lv-char); color: var(--lv-white); box-shadow: var(--lv-inset); }
.lv-btn-ghost { background: transparent; border-color: var(--lv-c40); color: var(--lv-char); }
.lv-btn-light { background: #fcfbf8; border-color: #fcfbf8; color: #1c1c1c; box-shadow: var(--lv-inset); }
.lv-btn-lg { min-height: 48px; padding: 10px 20px; }
.lv-btn-block { width: 100%; }
.lv-pill { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 1px solid var(--lv-line); border-radius: 9999px;
    background: var(--lv-card); color: var(--lv-char); font-size: 15px; cursor: pointer; transition: border-color .15s, opacity .15s; }
.lv-pill:active { opacity: .8; }
.lv-lang { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.lv-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; color: var(--lv-muted); font-size: 14px; text-decoration: none; cursor: pointer; }
:where(.lv-site) a { color: inherit; text-decoration: none; }
.lv-site :is(b, strong) { color: var(--lv-char); }
@media (hover: hover) {
    .lv-btn-dark:hover, .lv-btn-light:hover { opacity: .9; }
    .lv-btn-ghost:hover { background: var(--lv-c04); }
    .lv-pill:hover { border-color: var(--lv-c40); }
    .lv-link:hover { color: var(--lv-char); }
}

/* header — cream bar, hairline once the page scrolls */
.lv-head { position: sticky; top: 0; z-index: 80; background: var(--lv-cream); border-bottom: 1px solid transparent; transition: border-color .2s; }
.lv-head.is-scrolled, body.lv-site:has(.lv-menu:not([hidden])) .lv-head { border-bottom-color: var(--lv-line); }
.lv-head-in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.lv-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--lv-char); }
.lv-brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.lv-brand span { font-size: 18px; font-weight: 600; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-nav { display: flex; gap: 4px; margin-inline: auto; }
.lv-nav a { padding: 8px 12px; border-radius: 6px; font-size: 15px; color: var(--lv-c83); }
.lv-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lv-nav + .lv-tools { margin-left: 0; }
.lv-burger { display: none; }
.lv-menu { border-top: 1px solid var(--lv-line); background: var(--lv-cream); }
.lv-menu .lv-wrap { display: flex; flex-direction: column; padding: 8px 0 16px; }
.lv-menu a:not(.lv-btn) { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--lv-line); font-size: 16px; color: var(--lv-char); }
.lv-menu a:not(.lv-btn) i { width: 20px; color: var(--lv-muted); }
.lv-menu-row { display: flex; gap: 8px; padding-top: 14px; }
.lv-menu-row .lv-btn { flex: 1; }
@media (hover: hover) { .lv-nav a:hover { background: var(--lv-c04); color: var(--lv-char); } }

/* hero — centred, faint warm wash, photo shelf */
.lv-hero { position: relative; padding: 88px 0 72px; overflow: hidden; text-align: center; isolation: isolate; }
.lv-hero::before { content: ''; position: absolute; inset: -10%; z-index: -1; pointer-events: none; animation: lvDrift 16s ease-in-out infinite alternate;
    background: radial-gradient(620px 340px at 18% 12%, var(--lv-wash-a), transparent 70%), radial-gradient(560px 320px at 84% 6%, var(--lv-wash-c), transparent 70%),
        radial-gradient(700px 360px at 50% 100%, var(--lv-wash-b), transparent 72%); }
.lv-hero-in { display: flex; flex-direction: column; align-items: center; }
.lv-eyebrow { display: inline-block; margin-bottom: 16px; font-size: 14px; color: var(--lv-muted); }
.lv-hero .lv-eyebrow { padding: 4px 14px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-card); }
.lv-hero h1 { max-width: 15ch; font-size: clamp(38px, 6.2vw, 60px); line-height: 1.04; letter-spacing: -.025em; }
.lv-lead { max-width: 640px; margin-top: 16px; font-size: 18px; line-height: 1.45; color: var(--lv-muted); }
.lv-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.lv-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 28px; list-style: none; font-size: 14px; color: var(--lv-muted); }
.lv-badges i { margin-right: 6px; color: var(--lv-char); }
.lv-show { position: relative; margin-top: 56px; }
.lv-show::before { content: ""; position: absolute; inset: 10% -4% -6%; z-index: 0; pointer-events: none; border-radius: 40px; filter: blur(60px); opacity: .55;
    background: radial-gradient(40% 55% at 20% 30%, rgba(66, 133, 244, .22), transparent 70%), radial-gradient(35% 50% at 55% 80%, rgba(52, 168, 83, .16), transparent 70%), radial-gradient(35% 50% at 85% 25%, rgba(251, 188, 4, .18), transparent 70%); animation: lvAura 14s ease-in-out infinite alternate; }
.lv-show-label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 20px; font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--lv-muted); }
.lv-show-label::before, .lv-show-label::after { content: ""; flex: 0 1 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--lv-c40)); }
.lv-show-label::after { transform: scaleX(-1); }
.lv-show-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--lv-char); box-shadow: 0 0 0 0 var(--lv-c40); animation: lvPing 2.4s ease-out infinite; }
.lv-show-view { position: relative; z-index: 1; overflow: hidden; padding: 16px 0 26px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.lv-show-track { display: flex; width: max-content; animation: lvShowDrift var(--dur, 60s) linear infinite; will-change: transform; }
.lv-show-view:is(:hover, :focus-within, .is-hold) .lv-show-track { animation-play-state: paused; }
.lv-show-set { display: flex; flex: 0 0 auto; gap: 14px; padding-right: 14px; }
@keyframes lvShowDrift { to { transform: translateX(-50%); } }
.lv-shelf-item { position: relative; overflow: hidden; flex: 0 0 200px; width: 200px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 18px; border: 1px solid var(--lv-line); border-radius: 22px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--lv-card) 92%, transparent), color-mix(in srgb, var(--lv-card) 55%, transparent)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    color: inherit; cursor: pointer; scroll-snap-align: start; transition: translate .45s var(--lv-ease), border-color .3s, box-shadow .45s var(--lv-ease); }
.lv-shelf-item::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 30%), var(--lv-c04), transparent 70%); }
.lv-shelf-item::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, var(--lv-c04), transparent); }
.lv-shelf-img { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 220px; }
.lv-shelf-img::after { content: ""; position: absolute; bottom: -6px; left: 18%; right: 18%; height: 14px; border-radius: 50%; background: var(--lv-char); opacity: .12; filter: blur(9px); animation: lvShadow 6s ease-in-out infinite; }
.lv-shelf-img img { position: relative; z-index: 1; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .16)); transition: translate .5s var(--lv-ease), scale .5s var(--lv-ease); }
.lv-shelf-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--lv-char); }
.lv-shelf-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--lv-muted); opacity: 0; translate: 0 6px; transition: opacity .35s, translate .35s var(--lv-ease); }
.lv-shelf-more i { font-size: 11px; transition: translate .3s; }
@media (hover: hover) {
    .lv-shelf-item:hover { translate: 0 -8px; border-color: var(--lv-c40); box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .28); }
    .lv-shelf-item:hover::before { opacity: 1; }
    .lv-shelf-item:hover::after { animation: lvSweep .9s var(--lv-ease); }
    .lv-shelf-item:hover img { translate: 0 -6px; scale: 1.05; }
    .lv-shelf-item:hover .lv-shelf-more { opacity: 1; translate: 0 0; }
    .lv-shelf-item:hover .lv-shelf-more i { translate: 3px 0; }
}
.lv-shelf-item:focus-visible { outline: 2px solid var(--lv-char); outline-offset: 3px; }
@media (hover: none) { .lv-shelf-more { opacity: .85; translate: 0 0; } }
@keyframes lvAura { to { transform: translate3d(2%, -3%, 0) scale(1.06); } }
@keyframes lvPing { 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes lvSweep { to { left: 130%; } }
@keyframes lvShadow { 50% { transform: scale(.82); opacity: .07; } }
body.dark-mode .lv-shelf-img img { filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .55)); }
body.dark-mode .lv-show::before { opacity: .4; }

/* figures */
.lv-figures { border-block: 1px solid var(--lv-line); }
.lv-fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.lv-fig { display: flex; flex-direction: column; gap: 4px; padding: 32px 24px; border-left: 1px solid var(--lv-line); }
.lv-fig:first-child { border-left: 0; padding-left: 0; }
.lv-fig b { font-size: clamp(36px, 4.6vw, 48px); font-weight: 600; line-height: 1; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.lv-fig span { font-size: 15px; color: var(--lv-muted); }

/* sections */
.lv-sec { padding: 104px 0; }
.lv-sec + .lv-sec { padding-top: 32px; }
.lv-sec-head { max-width: 720px; margin-bottom: 40px; }
.lv-sec-head h2 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.04; letter-spacing: -.025em; }
.lv-sec-head .lv-lead { margin-top: 14px; }

/* brand marquee — two identical sets slide left forever; hover, focus or a finger holds it */
.lv-marquee { overflow: hidden; padding: 6px 0; -webkit-mask-image: linear-gradient(90deg, transparent, black 7%, black 93%, transparent); mask-image: linear-gradient(90deg, transparent, black 7%, black 93%, transparent); }
.lv-mq-track { display: flex; width: max-content; animation: lvRun 38s linear infinite; }
.lv-mq-set { display: flex; gap: 12px; padding-right: 12px; }
.lv-marquee:is(:hover, :focus-within, .is-hold) .lv-mq-track { animation-play-state: paused; }
.lv-brand-tile { display: flex; align-items: center; justify-content: center; flex: 0 0 180px; height: 96px; padding: 16px 20px; border: 1px solid var(--lv-line); border-radius: 12px; background: var(--lv-card);
    color: var(--lv-char); font-size: 18px; font-weight: 600; cursor: pointer; transition: border-color .2s, translate .25s var(--lv-ease); }
.lv-brand-tile img { max-width: 78%; max-height: 42px; object-fit: contain; filter: grayscale(1); mix-blend-mode: multiply; opacity: .78; transition: filter .25s, opacity .25s; }
body.dark-mode .lv-brand-tile img { filter: grayscale(1) invert(1); mix-blend-mode: screen; }
@media (hover: hover) {
    .lv-brand-tile:hover { border-color: var(--lv-c40); translate: 0 -3px; }
    .lv-brand-tile:hover img { filter: none; opacity: 1; }
    body.dark-mode .lv-brand-tile:hover img { filter: grayscale(1) invert(1); }
}

/* catalogue toolbar */
.lv-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.lv-search { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; max-width: 420px; min-height: 44px; padding: 0 14px; border: 1px solid var(--lv-line); border-radius: 6px; background: var(--lv-card); }
.lv-search:focus-within { border-color: var(--lv-c40); box-shadow: 0 0 0 2px var(--lv-ring); }
.lv-search i { color: var(--lv-muted); }
.lv-site .lv-search input { flex: 1; min-width: 0; height: 42px; border: 0 !important; border-radius: 0 !important; background: transparent; color: var(--lv-char); outline: none; box-shadow: none !important; }
.lv-search input::placeholder { color: var(--lv-muted); }
.lv-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-c03); }
.lv-tabs button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 9999px; background: transparent; color: var(--lv-c83); font-size: 15px; cursor: pointer; transition: background-color .2s, color .2s; }
.lv-tabs button.is-on { background: var(--lv-char); color: var(--lv-white); box-shadow: var(--lv-inset); }
.lv-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid var(--lv-c40); border-radius: 9999px; background: var(--lv-c04);
    color: var(--lv-char); font-size: 14px; cursor: pointer; }
.lv-count { margin-left: auto; font-size: 14px; color: var(--lv-muted); }

/* product cards */
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.lv-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--lv-line); border-radius: 12px; background: var(--lv-card); overflow: hidden; transition: border-color .2s, translate .25s var(--lv-ease); }
.lv-card-img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; padding: 24px; border: 0; border-bottom: 1px solid var(--lv-line);
    background: var(--lv-c03); cursor: pointer; }
.lv-card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--lv-ease); }
.lv-noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--lv-c40); font-size: 44px; }
.lv-ctag { position: absolute; top: 12px; left: 12px; padding: 2px 10px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-card); font-size: 12px; color: var(--lv-char); }
.lv-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 18px 18px; }
.lv-card-brand { font-size: 13px; color: var(--lv-muted); }
.lv-card .lv-card-body h3 { font-size: 18px; line-height: 1.25; letter-spacing: -.2px; }
.lv-card-sub { font-size: 14px; color: var(--lv-muted); }
.lv-colors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lv-colors button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--lv-line); border-radius: 9999px; background: transparent;
    color: var(--lv-c83); font-size: 13px; cursor: pointer; }
.lv-colors button.is-on { border-color: var(--lv-char); color: var(--lv-char); }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: inset 0 0 0 1px var(--lv-c40); }
.lv-card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: auto 0 6px; padding-top: 8px; }
.lv-price { font-size: 20px; font-weight: 600; letter-spacing: -.4px; color: var(--lv-char); }
.lv-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--lv-c83); }
.lv-stock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lv-stock.is-low { color: var(--lv-char); font-weight: 600; }
.lv-stock.is-out { color: var(--lv-muted); }
.lv-stock.is-out::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.lv-card .lv-link { align-self: center; }
@media (hover: hover) {
    .lv-card:hover { border-color: var(--lv-c40); translate: 0 -4px; }
    .lv-card:hover .lv-card-img img { transform: scale(1.06) rotate(-2deg); }
    .lv-btn-wa:hover i, .lv-head-wa:hover i { animation: lvWiggle .6s ease-in-out; }
    .lv-colors button:hover { border-color: var(--lv-c40); }
}
.lv-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 24px; border: 1px dashed var(--lv-c40); border-radius: 12px; text-align: center; color: var(--lv-muted); }
.lv-empty i.fa-magnifying-glass { font-size: 28px; }
.lv-empty p { max-width: 460px; }

/* retail / wholesale */
.lv-offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.lv-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 40px; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-card); transition: translate .25s var(--lv-ease); }
@media (hover: hover) { .lv-offer:hover { translate: 0 -4px; } }
.lv-offer h3 { font-size: 30px; line-height: 1.1; letter-spacing: -.6px; }
.lv-offer p { font-size: 17px; color: var(--lv-muted); }
.lv-offer ul { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; list-style: none; }
.lv-offer li { display: flex; gap: 10px; font-size: 15px; }
.lv-offer li i { margin-top: 4px; font-size: 13px; }
.lv-tag { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--lv-line); border-radius: 9999px; font-size: 13px; }
.lv-offer.is-dark { background: #1c1c1c; border-color: #1c1c1c; color: #fcfbf8; }
.lv-offer.is-dark :is(h3, li, .lv-tag) { color: #fcfbf8 !important; }
.lv-offer.is-dark p { color: rgba(252, 251, 248, .7) !important; }
.lv-offer.is-dark .lv-tag { border-color: rgba(252, 251, 248, .2); }
body.dark-mode .lv-offer.is-dark { background: #262626; border-color: var(--lv-line); }

/* categories */
.lv-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lv-cat { display: flex; flex-direction: column; gap: 8px; padding: 28px 24px 24px; border: 1px solid var(--lv-line); border-radius: 12px; background: var(--lv-card); transition: border-color .2s, translate .25s var(--lv-ease); }
.lv-cat > i { align-self: flex-start; margin-bottom: 8px; font-size: 22px; color: var(--lv-char); animation: lvFloat 4s ease-in-out infinite; }
.lv-cat:nth-child(2) > i { animation-delay: -1s; } .lv-cat:nth-child(3) > i { animation-delay: -2s; } .lv-cat:nth-child(4) > i { animation-delay: -3s; }
.lv-site .lv-cat h3 { font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.lv-cat p { flex: 1; font-size: 15px; color: var(--lv-muted); }
.lv-cat-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--lv-char); }
@media (hover: hover) { .lv-cat:hover { border-color: var(--lv-c40); translate: 0 -4px; } .lv-cat:hover .lv-cat-go i { animation: lvNudge .8s ease-in-out infinite; } }

/* how it works — step numbers fill one by one once the row shows */
.lv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-card); }
.lv-steps li { display: flex; flex-direction: column; gap: 8px; padding: 32px; border-left: 1px solid var(--lv-line); }
.lv-steps li:first-child { border-left: 0; }
.lv-steps b { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: 8px; border: 1px solid var(--lv-c40); border-radius: 9999px; font-size: 14px;
    transition: background-color .4s, border-color .4s, color .4s; }
.lv-steps.is-in li b { background: var(--lv-char); border-color: var(--lv-char); color: var(--lv-white); transition-delay: calc(var(--i, 0) * .3s + .4s); }
.lv-site .lv-steps h3 { font-size: 20px; letter-spacing: -.2px; }
.lv-steps p { font-size: 15px; color: var(--lv-muted); }

/* contact */
.lv-contact { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.lv-box { padding: 32px; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-card); }
.lv-site .lv-box h3 { font-size: 22px; letter-spacing: -.3px; }
.lv-clist { display: flex; flex-direction: column; list-style: none; }
.lv-clist li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--lv-line); }
.lv-clist li:first-child { border-top: 0; padding-top: 0; }
.lv-ic { display: inline-flex; justify-content: center; flex: 0 0 22px; padding-top: 3px; font-size: 16px; color: var(--lv-char); }
.lv-clist div { display: flex; flex-direction: column; min-width: 0; }
.lv-clist small { font-size: 13px; color: var(--lv-muted); }
.lv-clist :is(a, strong) { font-size: 16px; font-weight: 400; color: var(--lv-char); overflow-wrap: anywhere; }
.lv-map { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--lv-line); }
.lv-site .lv-map h3 { font-size: 17px; }
.lv-map p { font-size: 14px; color: var(--lv-muted); }
.lv-box > .lv-muted { margin: 4px 0 18px; }
.lv-social { display: flex; flex-direction: column; gap: 10px; }
.lv-social a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 16px; border: 1px solid var(--lv-line); border-radius: 12px; transition: border-color .2s; }
.lv-social a > span:not(.lv-ic) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lv-social b { font-weight: 600; }
.lv-social small { font-size: 13px; color: var(--lv-muted); }
.lv-social a > i { color: var(--lv-muted); }
@media (hover: hover) { .lv-social a:hover, .lv-clist a:hover { border-color: var(--lv-c40); opacity: .85; } .lv-social a:hover > i { animation: lvNudge .8s ease-in-out infinite; } }

/* footer — one bordered box with a faint wash */
.lv-foot { padding: 24px 0 32px; }
.lv-foot-box { padding: 40px; border: 1px solid var(--lv-line); border-radius: 16px;
    background: radial-gradient(520px 260px at 10% 110%, var(--lv-wash-a), transparent 70%), radial-gradient(520px 260px at 95% 120%, var(--lv-wash-c), transparent 70%), var(--lv-card); }
.lv-foot-top { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.lv-foot-brand .lv-muted { max-width: 360px; margin-top: 12px; font-size: 15px; }
.lv-foot-col { display: flex; flex-direction: column; gap: 10px; }
.lv-foot-col b { font-size: 14px; font-weight: 600; }
.lv-foot-col a { font-size: 14px; color: var(--lv-muted); }
.lv-foot-bottom { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--lv-line); }
.lv-foot-bottom small { font-size: 13px; color: var(--lv-muted); }
@media (hover: hover) { .lv-foot-col a:hover { color: var(--lv-char); } }

/* floating whatsapp — a soft ring pulses out of it */
.lv-wa-float { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70; display: inline-flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border-radius: 9999px; background: var(--lv-char); color: var(--lv-white) !important; font-size: 26px; box-shadow: var(--lv-inset), var(--lv-focus); transition: opacity .15s, bottom .2s; }
.lv-wa-float:active { opacity: .8; }
.lv-wa-float::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: lvPulse 2.8s ease-out infinite; }

/* product popup */
.lv-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--lv-scrim); }
.lv-modal-box { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; width: min(980px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto;
    padding: 28px; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-cream); box-shadow: var(--lv-focus); overscroll-behavior: contain; }
.lv-x { position: absolute; top: 16px; right: 16px; z-index: 2; }
.lv-gal { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lv-gal-main { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; padding: 28px; border: 1px solid var(--lv-line); border-radius: 12px; background: var(--lv-c03); }
.lv-gal-main img { width: 100%; height: 100%; object-fit: contain; }
.lv-gal-th { display: flex; gap: 8px; overflow-x: auto; }
.lv-gal-th button { flex: 0 0 64px; height: 64px; padding: 6px; border: 1px solid var(--lv-line); border-radius: 8px; background: var(--lv-c03); cursor: pointer; }
.lv-gal-th button.is-on { border-color: var(--lv-char); }
.lv-gal-th img { width: 100%; height: 100%; object-fit: contain; }
.lv-minfo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding-top: 8px; }
.lv-minfo .lv-ctag { position: static; }
.lv-site .lv-minfo h2 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.08; letter-spacing: -.8px; padding-right: 48px; }
.lv-minfo .lv-card-row { width: 100%; justify-content: flex-start; gap: 16px; margin: 8px 0 4px; }
.lv-price-lg { font-size: 28px; letter-spacing: -.6px; }
.lv-minfo > .lv-btn-block { margin-top: 2px; }
.lv-warranty { font-size: 14px; }
.lv-warranty i { margin-right: 6px; }
.lv-mtext { font-size: 15px; color: var(--lv-c83); }
.lv-site .lv-minfo h3 { margin-top: 12px; font-size: 16px; }
.lv-specs { width: 100%; border-top: 1px solid var(--lv-line); }
.lv-specs div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lv-line); }
.lv-specs dt { font-size: 13px; color: var(--lv-muted); }
.lv-specs dd { font-size: 14px; color: var(--lv-char); overflow-wrap: anywhere; }

/* animated HPhones logo — artwork + motion from the owner's original site */
.hp-logo { display: block; width: auto; height: 44px; overflow: visible; }
.hp-logo-lg { height: 56px; }
.hp-logo-xl { height: clamp(96px, 24vw, 132px); }
.hp-logo .hb { fill: var(--hp-cyan); animation: hpBar 3.6s ease-in-out infinite; }
.hp-logo rect.hb:nth-of-type(1) { animation-delay: .3s; } .hp-logo rect.hb:nth-of-type(2) { animation-delay: .6s; }
.hp-logo .sph { fill: var(--hp-coral); transform-box: fill-box; transform-origin: center; animation: hpBreath 4s ease-in-out infinite; }
.hp-logo .net { transform-origin: 140px 52px; animation: hpSpin 40s linear infinite; }
.hp-logo .net line { stroke: var(--hp-cyan); stroke-width: 1.3; stroke-dasharray: 3 3; animation: hpDash 1.4s linear infinite; }
.hp-logo .net circle { fill: var(--hp-cyan); transform-box: fill-box; transform-origin: center; animation: hpNode 2.4s ease-in-out infinite; }
.hp-logo .net circle:nth-of-type(2) { animation-delay: -.35s; } .hp-logo .net circle:nth-of-type(3) { animation-delay: -.7s; } .hp-logo .net circle:nth-of-type(4) { animation-delay: -1.05s; }
.hp-logo .net circle:nth-of-type(5) { animation-delay: -1.4s; } .hp-logo .net circle:nth-of-type(6) { animation-delay: -1.75s; } .hp-logo .net circle:nth-of-type(7) { animation-delay: -2.1s; }
.hp-logo .net circle:nth-of-type(8) { animation-delay: -2.45s; } .hp-logo .net circle:nth-of-type(9) { animation-delay: -2.8s; } .hp-logo .net circle:nth-of-type(10) { animation-delay: -3.15s; }
.hp-logo .net circle:nth-of-type(11) { animation-delay: -3.5s; }
.hp-logo .orb { transform-origin: 140px 52px; animation: hpSpin 6s linear infinite; }
.hp-logo .orb circle { fill: var(--hp-orb); filter: drop-shadow(0 0 4px var(--hp-cyan)); }
.hp-logo .ltr { font: 900 34px Montserrat, var(--lv-font); fill: var(--hp-coral); stroke: var(--hp-ink); stroke-width: .8; paint-order: stroke; animation: hpWave 2.8s ease-in-out infinite; }
.hp-logo .ltr:nth-of-type(2) { animation-delay: .12s; } .hp-logo .ltr:nth-of-type(3) { animation-delay: .24s; } .hp-logo .ltr:nth-of-type(4) { animation-delay: .36s; }
.hp-logo .ltr:nth-of-type(5) { animation-delay: .48s; } .hp-logo .ltr:nth-of-type(6) { animation-delay: .6s; }
@keyframes hpBar { 0%, 60%, 100% { fill: var(--hp-cyan); } 30% { fill: var(--hp-cyan-pulse); } }
@keyframes hpBreath { 50% { transform: scale(1.08); } }
@keyframes hpSpin { to { transform: rotate(360deg); } }
@keyframes hpDash { to { stroke-dashoffset: -6; } }
@keyframes hpNode { 50% { transform: scale(1.7); fill: var(--hp-spark); } }
@keyframes hpWave { 0%, 40%, 100% { transform: translateY(0); } 20% { transform: translateY(-4px); fill: var(--hp-coral-hi); } }

/* opening animation — once per browser session (set before paint), css only, the panel lifts away at 1.5s */
.lv-intro { display: none; }
html.lv-intro-on { --lv-d0: 1.6s; }
html.lv-intro-on .lv-intro { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--lv-cream);
    animation: lvIntroOut .65s var(--lv-ease) 1.5s forwards; }
.lv-intro-in { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; animation: lvIntroFade .45s ease-in 1.4s forwards; }
.lv-intro-logo { display: inline-flex; align-items: center; gap: 12px; animation: lvPop .9s var(--lv-ease) backwards; }
.lv-intro-logo.lv-brand img { width: 72px; height: 72px; border-radius: 16px; }
.lv-intro-logo.lv-brand span { font-size: 30px; }
.lv-intro p { max-width: 320px; font-size: 15px; color: var(--lv-muted); animation: lvUp .7s var(--lv-ease) .35s backwards; }
.lv-intro-bar { position: relative; width: 160px; height: 2px; border-radius: 2px; background: var(--lv-line); overflow: hidden; }
.lv-intro-bar i { position: absolute; inset: 0; background: var(--lv-char); transform: scaleX(0); transform-origin: left; animation: lvFill 1.2s var(--lv-ease) .15s forwards; }

/* scroll progress line */
.lv-prog { position: fixed; top: 0; left: 0; right: 0; z-index: 90; height: 2px; background: var(--lv-char); transform: scaleX(0); transform-origin: left; pointer-events: none; }

/* hero entrance (waits for the intro), phones float on the shelf, the wash drifts */
.lv-hero-in > *, .lv-shelf-item { animation: lvUp .8s var(--lv-ease) backwards; animation-delay: var(--lv-d0, 0s); }
.lv-hero-in > :nth-child(2) { animation-delay: calc(var(--lv-d0, 0s) + .08s); } .lv-hero-in > :nth-child(3) { animation-delay: calc(var(--lv-d0, 0s) + .16s); }
.lv-hero-in > :nth-child(4) { animation-delay: calc(var(--lv-d0, 0s) + .24s); } .lv-hero-in > :nth-child(5) { animation-delay: calc(var(--lv-d0, 0s) + .32s); }
.lv-shelf-item:nth-child(1) { animation-delay: calc(var(--lv-d0, 0s) + .3s); } .lv-shelf-item:nth-child(2) { animation-delay: calc(var(--lv-d0, 0s) + .38s); }
.lv-shelf-item:nth-child(3) { animation-delay: calc(var(--lv-d0, 0s) + .46s); } .lv-shelf-item:nth-child(4) { animation-delay: calc(var(--lv-d0, 0s) + .54s); }
.lv-shelf-item:nth-child(5) { animation-delay: calc(var(--lv-d0, 0s) + .62s); } .lv-shelf-item:nth-child(6) { animation-delay: calc(var(--lv-d0, 0s) + .7s); }
.lv-shelf-img img { animation: lvBob 6s ease-in-out infinite; }
.lv-shelf-item:nth-child(2) img { animation-delay: -1.2s; } .lv-shelf-item:nth-child(3) img { animation-delay: -2.4s; }
.lv-shelf-item:nth-child(4) img { animation-delay: -3.6s; } .lv-shelf-item:nth-child(5) img { animation-delay: -4.8s; }
.lv-cta .fa-arrow-down { animation: lvNudgeY 1.8s ease-in-out infinite; }

/* scroll reveal — only while home.js runs (lv-rv-on); groups stagger their children by --i */
html.lv-rv-on [data-rv]:not([data-rv="kids"]):not(.is-in), html.lv-rv-on [data-rv="kids"]:not(.is-in) > * { opacity: 0; }
html.lv-rv-on [data-rv].is-in:not([data-rv="kids"]), html.lv-rv-on [data-rv="kids"].is-in > * { animation: lvUp .7s var(--lv-ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
html.lv-rv-on .lv-grid:is(.is-typing) > *, html.lv-rv-on .lv-grid > .is-still { animation: none; }

@keyframes lvUp { from { opacity: 0; transform: translateY(24px); } }
@keyframes lvPop { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: none; } }
@keyframes lvFill { to { transform: none; } }
@keyframes lvIntroFade { to { opacity: 0; transform: translateY(-14px); } }
@keyframes lvIntroOut { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }
@keyframes lvDrift { to { transform: translate3d(4%, 3%, 0) scale(1.08); } }
@keyframes lvBob { 50% { transform: translateY(-8px); } }
@keyframes lvFloat { 50% { transform: translateY(-5px); } }
@keyframes lvNudge { 50% { transform: translateX(4px); } }
@keyframes lvNudgeY { 50% { transform: translateY(3px); } }
@keyframes lvWiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes lvPulse { from { box-shadow: 0 0 0 0 var(--lv-c40); } to { box-shadow: 0 0 0 18px transparent; } }
@keyframes lvRun { to { transform: translateX(-50%); } }

/* tablet + phone */
@media (max-width: 1080px) {
    .lv-nav { display: none; }
    .lv-burger { display: inline-flex; }
    .lv-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1081px) { .lv-menu { display: none !important; } }
@media (max-width: 768px) {
    .lv-hide-sm { display: none !important; }
    .lv-head-in { gap: 12px; min-height: 60px; }
    .lv-head-wa { width: 44px; padding: 0; }
    .lv-brand .hp-logo { height: 40px; }
    .lv-hero { padding: 56px 0 48px; }
    .lv-lead { font-size: 17px; }
    .lv-cta { flex-direction: column; align-self: stretch; }
    .lv-cta .lv-btn { width: 100%; }
    .lv-show { margin-top: 40px; }
    .lv-shelf-item { flex-basis: 168px; width: 168px; }
    .lv-show-set { gap: 12px; padding-right: 12px; }
    .lv-shelf-img { height: 170px; }
    .lv-fig-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv-fig { padding: 24px 16px; }
    .lv-fig:nth-child(odd) { border-left: 0; padding-left: 0; }
    .lv-fig:nth-child(n+3) { border-top: 1px solid var(--lv-line); }
    .lv-sec { padding: 64px 0; }
    .lv-sec + .lv-sec { padding-top: 16px; }
    .lv-sec-head { margin-bottom: 28px; }
    .lv-offers, .lv-contact, .lv-steps { grid-template-columns: 1fr; }
    .lv-offer { padding: 28px 24px; }
    .lv-steps li { border-left: 0; border-top: 1px solid var(--lv-line); padding: 24px; }
    .lv-steps li:first-child { border-top: 0; }
    .lv-box { padding: 24px 20px; }
    .lv-foot-box { padding: 28px 20px; }
    .lv-foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv-foot-brand { grid-column: 1 / -1; }
    .lv-tools-row .lv-search { max-width: none; flex-basis: 100%; }
    .lv-count { margin-left: 0; }
    /* popup = full-screen sheet */
    .lv-modal { padding: 0; align-items: stretch; }
    .lv-modal-box { grid-template-columns: 1fr; gap: 16px; max-height: none; height: 100dvh; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
    .lv-gal-main { aspect-ratio: auto; height: min(46dvh, 340px); }
    .lv-x { position: fixed; top: 12px; right: 12px; }
}
@media (max-width: 560px) {
    .lv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .lv-card-img { padding: 14px; }
    .lv-card-body { padding: 12px 12px 14px; gap: 4px; }
    .lv-card .lv-card-body h3 { font-size: 16px; }
    .lv-card-sub, .lv-colors button { font-size: 12px; }
    .lv-colors button { min-height: 28px; padding: 0 8px; }
    .lv-price { font-size: 17px; }
    .lv-card .lv-btn { min-height: 44px; padding: 8px 10px; font-size: 14px; }
    .lv-cats { grid-template-columns: 1fr; }
    .lv-brand-tile { flex-basis: 140px; height: 80px; }
    .lv-brand span { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    .lv-site *, .lv-site *::before, .lv-site *::after { transition: none !important; animation: none !important; }
    html:has(> body.lv-home) { scroll-behavior: auto; }
    /* marquee -> a still, centred wall of the real brands */
    .lv-marquee { -webkit-mask-image: none; mask-image: none; }
    .lv-mq-track { width: auto; }
    .lv-mq-set { flex-wrap: wrap; justify-content: center; width: min(1200px, 100% - 32px); margin-inline: auto; padding: 0; }
    .lv-mq-set[aria-hidden], .lv-brand-tile[aria-hidden] { display: none; }
}

/* ---- sign-in pages on the cream look: centred card, no showcase panel ---- */
html body.auth-body.lv-auth {
    --auth-paper: var(--lv-card);
    background-image: radial-gradient(620px 340px at 12% 8%, var(--lv-wash-a), transparent 70%), radial-gradient(560px 340px at 92% 4%, var(--lv-wash-c), transparent 70%),
        radial-gradient(700px 380px at 60% 104%, var(--lv-wash-b), transparent 72%) !important;
}
.lv-auth.auth-body::before { display: none; }
.lv-auth .auth-card { grid-template-columns: 1fr; }
.lv-auth .auth-form-col { max-height: none; overflow: visible; padding: 20px 24px; }
.lv-auth .auth-topbar { width: min(1120px, 100%); margin: 0 auto; }
.lv-auth .auth-brandmark { gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -.3px; color: var(--lv-char) !important; }
.lv-auth .auth-brandmark img { border-radius: 8px; }
.lv-auth .auth-brandmark span { color: var(--lv-char) !important; }
.lv-auth .auth-toggle { width: 44px; height: 44px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-card); color: var(--lv-char); box-shadow: none; }
.lv-auth .auth-form-inner { max-width: 440px; margin: 40px auto; padding: 40px 36px 34px; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--auth-paper); box-shadow: var(--lv-focus); }
.lv-auth .auth-badge-wrap { display: none; }
.lv-auth .auth-form-inner h1 { margin-bottom: 8px; font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.9px; color: var(--lv-char) !important; text-align: left; }
.lv-auth .auth-sub { margin-bottom: 28px; font-size: 16px; color: var(--lv-muted) !important; text-align: left; }
.lv-auth .auth-group label { font-size: 14px; font-weight: 400; color: var(--lv-c83) !important; }
.lv-auth .auth-group label i { color: var(--lv-muted); }
.lv-auth .auth-field input { height: 48px; border: 1px solid var(--lv-line); border-radius: 6px !important; background: var(--input-bg); color: var(--lv-char); font-weight: 400; box-shadow: none; }
.lv-auth .auth-field input::placeholder { color: var(--lv-muted); opacity: 1; }
.lv-auth .auth-field input:focus { border-color: var(--lv-c40); background: var(--input-bg); box-shadow: 0 0 0 2px var(--lv-ring); }
.lv-auth .auth-field input:-webkit-autofill { box-shadow: 0 0 0 100px var(--input-bg) inset; -webkit-text-fill-color: var(--lv-char); }
.lv-auth .auth-field:focus-within .auth-field-icon { color: var(--lv-char); }
.lv-auth .auth-eye { border-radius: 9999px; }
.lv-auth .auth-check { color: var(--lv-c83) !important; }
.lv-auth .auth-check input { accent-color: var(--lv-char); }
.lv-auth :is(.auth-link, .auth-signup a, .auth-consent a, .auth-contact-links a) { color: var(--lv-char) !important; font-weight: 600; text-decoration: none !important; }
.lv-auth .auth-submit { height: 48px; border: 1px solid var(--lv-char); border-radius: 6px; background: var(--lv-char); color: var(--lv-white); font-size: 16px; font-weight: 400; box-shadow: var(--lv-inset); filter: none; }
.lv-auth .auth-submit:hover { transform: none; filter: none; opacity: .9; box-shadow: var(--lv-inset); }
.lv-auth .auth-submit:active { opacity: .8; }
.lv-auth .auth-google { height: 48px; border: 1px solid var(--lv-c40); border-radius: 6px; background: transparent; font-weight: 400; }
.lv-auth .auth-google:hover { border-color: var(--lv-c40); background: var(--lv-c04); }
.lv-auth .auth-or::before, .lv-auth .auth-or::after { background: var(--lv-line); }
.lv-auth .auth-form-inner :is(.error, .success) { border-radius: 6px; }
.lv-auth .auth-foot { width: min(440px, 100%); margin: 0 auto; }
.lv-auth .auth-contact-title { font-weight: 600; color: var(--lv-char) !important; }
.lv-auth .auth-copy i { color: var(--lv-muted); }
.lv-auth .auth-home { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--lv-c40); border-radius: 6px; color: var(--lv-char); font-size: 15px; text-decoration: none; }
.lv-auth .auth-home span { color: inherit !important; }
.lv-auth .auth-top-tools { display: flex; align-items: center; gap: 8px; }
@media (hover: hover) { .lv-auth .auth-home:hover { background: var(--lv-c04); } .lv-auth :is(.auth-link, .auth-contact-links a):hover { opacity: .7; } }
@media (max-width: 560px) {
    .lv-auth .auth-form-col { padding: 14px 16px; }
    .lv-auth .auth-form-inner { margin: 24px auto; padding: 28px 20px 24px; }
    .lv-auth .auth-form-inner h1 { font-size: 28px; letter-spacing: -.6px; }
    .lv-auth .auth-home span { display: none; }
}

/* ---- repair tracker + maintenance on the cream look ---- */
.lv-track .login-container, .lv-maint .maintenance-container { background: radial-gradient(620px 340px at 15% 10%, var(--lv-wash-a), transparent 70%),
    radial-gradient(560px 340px at 90% 6%, var(--lv-wash-c), transparent 70%), var(--lv-cream) !important; }
.lv-track .login-box { padding: 40px 32px; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-card); box-shadow: var(--lv-focus); }
.lv-track .login-logo { width: 72px; height: 72px; margin-bottom: 16px; border: 1px solid var(--lv-line); border-radius: 16px; box-shadow: none; }
.lv-track .login-box h2 { margin-bottom: 6px; font-size: 26px; letter-spacing: -.5px; color: var(--lv-char) !important; }
.lv-track .track-sub { color: var(--lv-muted) !important; }
.lv-track :is(.track-sub, .track-info) i { color: var(--lv-char); }
.lv-track .track-lang { min-height: 44px; border: 1px solid var(--lv-c40); border-radius: 6px; background: transparent; color: var(--lv-char); }
.lv-track .track-info b { color: var(--lv-char) !important; }
.lv-track .track-steps li.is-done .track-dot { background: var(--lv-char); color: var(--lv-white); }
.lv-track .track-steps li.is-done + li.is-done::before { background: var(--lv-char); }
.lv-track .track-steps li.is-current .track-dot { box-shadow: 0 0 0 4px var(--lv-c04), 0 0 0 5px var(--lv-c40); }
.lv-track .track-bad { border-radius: 6px; }
.lv-maint .maintenance-icon { background: var(--lv-card) !important; border: 1px solid var(--lv-line); box-shadow: none !important; }
.lv-maint .maintenance-icon i { color: var(--lv-char) !important; }
.lv-maint .maintenance-title { font-weight: 600; letter-spacing: -.9px; color: var(--lv-char) !important; }
.lv-maint :is(.maintenance-desc, .maintenance-brand p) { color: var(--lv-muted) !important; }
.lv-maint .maintenance-info { border: 1px solid var(--lv-line) !important; border-radius: 12px; background: var(--lv-card) !important; color: var(--lv-c83) !important; }
.lv-maint :is(.maintenance-admin-link, .login-theme-toggle) { border: 1px solid var(--lv-line) !important; background: var(--lv-card) !important; color: var(--lv-char) !important; box-shadow: none !important; }

/* ---- v15.2: from the world to your door (route banner) + more moving objects ---- */
.lv-route { padding: 72px 0; border-block: 1px solid var(--lv-line); overflow: hidden; }
.lv-route-head { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.lv-route-head .lv-eyebrow { padding: 4px 14px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-card); }
.lv-route-map { position: relative; display: grid; grid-template-columns: auto minmax(90px, 1fr) auto minmax(90px, 1fr) auto; align-items: start; gap: 0 16px; padding: 40px 40px 32px;
    border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-card); overflow: hidden; isolation: isolate; }
.lv-route-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lv-route-bg i { position: absolute; font-size: 20px; color: var(--lv-char); opacity: .09; animation: lvBob 7s ease-in-out infinite; }
.lv-route-bg i:nth-child(1) { left: 4%; top: 12%; } .lv-route-bg i:nth-child(2) { left: 22%; bottom: 10%; animation-duration: 9s; animation-delay: -2s; }
.lv-route-bg i:nth-child(3) { left: 40%; top: 8%; animation-duration: 8s; animation-delay: -4s; } .lv-route-bg i:nth-child(4) { left: 58%; bottom: 8%; animation-delay: -1s; }
.lv-route-bg i:nth-child(5) { left: 76%; top: 10%; animation: lvTurn 30s linear infinite; } .lv-route-bg i:nth-child(6) { left: 92%; bottom: 14%; animation-duration: 10s; animation-delay: -5s; }
.lv-route-bg i:nth-child(7) { left: 14%; top: 46%; animation-duration: 11s; animation-delay: -3s; } .lv-route-bg i:nth-child(8) { left: 84%; top: 46%; animation-duration: 8s; animation-delay: -6s; }
.lv-stop { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 160px; text-align: center; }
.lv-stop b { margin-top: 14px; font-size: 17px; font-weight: 600; }
.lv-stop small { font-size: 13px; color: var(--lv-muted); }
.lv-stop-orb { position: relative; display: grid; place-items: center; width: 88px; height: 88px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-white); color: var(--lv-char); font-size: 34px; }
.lv-stop-orb::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; animation: lvPulse 2.6s ease-out infinite; }
.is-store .lv-stop-orb::after { animation-delay: .7s; } .is-home .lv-stop-orb::after { animation-delay: 1.4s; }
.is-world .lv-stop-orb > i { animation: lvBreathe 4s ease-in-out infinite; }
.lv-sat { position: absolute; inset: -10px; border: 1.5px dashed var(--lv-c40); border-radius: 9999px; animation: lvTurn 14s linear infinite; }
.lv-sat::before { content: ''; position: absolute; top: -5px; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 9999px; background: var(--hp-coral); }
.is-store .lv-stop-orb { background: var(--lv-char); border-color: var(--lv-char); color: var(--lv-white); }
.is-store .lv-stop-orb > i { animation: lvFloat 3s ease-in-out infinite; }
.lv-orb-badge { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--lv-card); border-radius: 9999px; background: var(--hp-coral); color: #06323a; font-size: 13px; font-style: normal; animation: lvBob 3.6s ease-in-out infinite; }
.is-home .lv-stop-orb > i { animation: lvNudgeY 2.4s ease-in-out infinite; }
.lv-ok { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--lv-card); border-radius: 9999px; background: var(--hp-cyan); color: #06323a; font-size: 12px; font-style: normal; animation: lvOk 6s ease-in-out infinite; }
.lv-lane { position: relative; height: 88px; }
.lv-lane::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; translate: 0 -50%; background: repeating-linear-gradient(90deg, var(--lv-c40) 0 8px, transparent 8px 16px); background-size: 16px 2px; animation: lvDashes .7s linear infinite; }
.lv-ride { position: absolute; top: 50%; left: 0; display: grid; place-items: center; width: 42px; height: 42px; margin-top: -21px; border: 1px solid var(--lv-line); border-radius: 9999px; background: var(--lv-white);
    color: var(--lv-char); font-size: 16px; box-shadow: 0 0 0 5px var(--lv-card); animation: lvRide 6s linear infinite; }
.lv-ride.is-b { width: 36px; height: 36px; margin-top: -18px; font-size: 14px; animation-duration: 8s; animation-delay: -3.4s; }
@keyframes lvRide { 0% { left: 0; opacity: 0; scale: .6; } 10% { opacity: 1; scale: 1; } 88% { opacity: 1; scale: 1; } 100% { left: calc(100% - 42px); opacity: 0; scale: .6; } }
@keyframes lvRideY { 0% { top: 0; opacity: 0; scale: .6; } 10% { opacity: 1; scale: 1; } 88% { opacity: 1; scale: 1; } 100% { top: calc(100% - 42px); opacity: 0; scale: .6; } }
@keyframes lvDashes { to { background-position-x: 16px; } }
@keyframes lvDashesY { to { background-position-y: 16px; } }
@keyframes lvTurn { to { rotate: 360deg; } }
@keyframes lvBreathe { 50% { scale: 1.1; } }
@keyframes lvOk { 0%, 52% { scale: 0; } 62% { scale: 1.25; } 70%, 90% { scale: 1; } 100% { scale: 0; } }
@keyframes lvRing { 0%, 84%, 100% { rotate: 0deg; } 88% { rotate: -16deg; } 92% { rotate: 16deg; } 96% { rotate: -8deg; } }
@keyframes lvTick { 0%, 68%, 100% { scale: 1; } 80% { scale: 1.4; } }
@keyframes lvBobT { 50% { translate: 0 -7px; } }

/* hero: floating accessory chips on both sides (wide screens only) */
.lv-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lv-fx-chip { position: absolute; display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--lv-line); border-radius: 16px; background: var(--lv-card); color: var(--lv-char); font-size: 21px; animation: lvBob 6s ease-in-out infinite; }
.lv-fx-chip:nth-child(1) { left: 6%; top: 9%; rotate: -8deg; } .lv-fx-chip:nth-child(2) { left: 12%; top: 25%; rotate: 6deg; animation-duration: 7.5s; animation-delay: -2s; }
.lv-fx-chip:nth-child(3) { left: 4%; top: 40%; rotate: -4deg; animation-duration: 5.5s; animation-delay: -3.5s; }
.lv-fx-chip:nth-child(4) { right: 6%; top: 11%; rotate: 8deg; animation-delay: -1s; } .lv-fx-chip:nth-child(5) { right: 12%; top: 27%; rotate: -6deg; animation-duration: 8s; animation-delay: -4s; }
.lv-fx-chip:nth-child(6) { right: 4%; top: 41%; rotate: 5deg; animation-duration: 6.5s; animation-delay: -2.5s; }
.lv-badges li i { display: inline-block; animation: lvFloat 3.4s ease-in-out infinite; }
.lv-badges li:nth-child(2) i { animation-delay: -.8s; } .lv-badges li:nth-child(3) i { animation-delay: -1.6s; } .lv-badges li:nth-child(4) i { animation: lvNudge 1.6s ease-in-out infinite; }
.lv-card-img img { animation: lvBobT 7s ease-in-out infinite; }
.lv-grid > :nth-child(2n) .lv-card-img img { animation-delay: -2.3s; } .lv-grid > :nth-child(3n) .lv-card-img img { animation-delay: -4.6s; }
.lv-tag i { display: inline-block; animation: lvRing 5s ease-in-out infinite; }
.lv-offer li i { animation: lvTick 4.5s ease-in-out infinite; } .lv-offer li:nth-child(2) i { animation-delay: .3s; } .lv-offer li:nth-child(3) i { animation-delay: .6s; }
.lv-steps b { animation: lvBobT 3.6s ease-in-out infinite; } .lv-steps li:nth-child(2) b { animation-delay: -1.2s; } .lv-steps li:nth-child(3) b { animation-delay: -2.4s; }
body.dark-mode.lv-site :is(.lv-stop-orb, .lv-ride, .lv-fx-chip) { color: var(--lv-char) !important; }
body.dark-mode.lv-site .is-store .lv-stop-orb { color: var(--lv-white) !important; }
@media (max-width: 1000px) { .lv-fx { display: none; } }
@media (max-width: 768px) {
    .lv-route { padding: 48px 0; }
    .lv-route-head { margin-bottom: 28px; }
    .lv-route-map { grid-template-columns: 1fr; justify-items: center; gap: 0; padding: 28px 16px; }
    .lv-stop { width: 100%; max-width: 260px; }
    .lv-lane { width: 100%; height: 100px; margin: 6px 0; }
    .lv-lane::before { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto; translate: -50% 0; background: repeating-linear-gradient(180deg, var(--lv-c40) 0 8px, transparent 8px 16px); background-size: 2px 16px; animation-name: lvDashesY; }
    .lv-ride { top: 0; left: 50%; margin: 0 0 0 -21px; animation-name: lvRideY; }
    .lv-ride.is-b { margin-left: -18px; }
    .lv-ride > i { rotate: 90deg; }
    .lv-ride i.fa-box { rotate: 0deg; }
}
@media (prefers-reduced-motion: reduce) {
    .lv-ride { left: calc(50% - 21px); } .lv-ride.is-b { display: none; }
    @media (max-width: 768px) { .lv-ride { top: calc(50% - 21px); left: 50%; } }
    .lv-ok { scale: 1; }
}

/* ===== polish layer: modern touches (glass header, gradient accents, glow + lift on hover, softer reveals). Delete from here to the end to undo. ===== */
::selection { background: var(--lv-char); color: var(--lv-cream); }
.lv-prog { background: linear-gradient(90deg, var(--hp-cyan), var(--hp-coral)); height: 3px; }

/* header: frosted glass, animated nav underline */
.lv-head { background: color-mix(in srgb, var(--lv-cream) 76%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); transition: border-color .2s, box-shadow .35s; }
.lv-head.is-scrolled { box-shadow: 0 10px 30px -22px rgba(0, 0, 0, .35); }
.lv-nav a { position: relative; }
.lv-nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .4s var(--lv-ease);
    background: linear-gradient(90deg, var(--hp-cyan), var(--hp-coral)); }
@media (hover: hover) { .lv-nav a:hover::after { transform: scaleX(1); } }

/* hero: a slow light sweep across the headline, a live dot on the eyebrow, a spotlight that follows the cursor */
.lv-hero h1 { background: linear-gradient(100deg, var(--lv-char) 0%, var(--lv-char) 38%, var(--lv-muted) 50%, var(--lv-char) 62%, var(--lv-char) 100%); background-size: 260% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    animation-name: lvUp, lvShine; animation-duration: .8s, 9s; animation-timing-function: var(--lv-ease), ease-in-out; animation-iteration-count: 1, infinite; animation-fill-mode: backwards, none; animation-delay: calc(var(--lv-d0, 0s) + .08s), 2s; }
.lv-hero .lv-eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; background: var(--hp-cyan); animation: lvPing 2.4s ease-out infinite; }
.lv-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .5s;
    background: radial-gradient(480px circle at var(--hx, 50%) var(--hy, 30%), rgba(255, 255, 255, .75), transparent 70%); }
body.dark-mode .lv-hero::after { background: radial-gradient(480px circle at var(--hx, 50%) var(--hy, 30%), rgba(255, 255, 255, .06), transparent 70%); }
.lv-hero.is-lit::after { opacity: 1; }
.lv-btn-dark { position: relative; overflow: hidden; transition: opacity .15s, translate .3s var(--lv-ease), box-shadow .3s; }
.lv-btn-dark::after { content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%; transform: skewX(-20deg); pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); }
@media (hover: hover) {
    .lv-btn-dark:hover { translate: 0 -2px; box-shadow: var(--lv-inset), 0 14px 26px -14px rgba(0, 0, 0, .55); }
    .lv-btn-dark:hover::after { animation: lvSweep .9s var(--lv-ease); }
    .lv-btn-ghost { transition: background-color .15s, border-color .15s, translate .3s var(--lv-ease); }
    .lv-btn-ghost:hover { translate: 0 -2px; border-color: var(--lv-char); }
}

/* section titles: brand-colour accent bar + small leading rule on eyebrows */
.lv-sec-head h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 18px; border-radius: 3px; background: linear-gradient(90deg, var(--hp-cyan), var(--hp-coral)); transform-origin: left; }
html.lv-rv-on .lv-sec-head[data-rv]:not(.is-in) h2::after { transform: scaleX(0); }
html.lv-rv-on .lv-sec-head[data-rv].is-in h2::after { animation: lvGrow .9s .25s var(--lv-ease) backwards; }
.lv-sec-head .lv-eyebrow::before { content: ""; display: inline-block; width: 22px; height: 1px; margin-right: 10px; vertical-align: middle; background: currentColor; opacity: .6; }

.lv-route-head h2::after { margin-inline: auto; }

/* cards, offers, categories, brand tiles, contact boxes: lift, soft shadow and a glow that follows the cursor */
.lv-card, .lv-offer, .lv-cat, .lv-box, .lv-brand-tile, .lv-steps li { position: relative; }
.lv-card::after, .lv-offer::after, .lv-cat::after, .lv-box::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--lv-c04), transparent 70%); }
.lv-card, .lv-offer, .lv-cat { transition: border-color .2s, translate .35s var(--lv-ease), box-shadow .4s var(--lv-ease); }
@media (hover: hover) {
    .lv-card:hover, .lv-offer:hover, .lv-cat:hover { box-shadow: 0 26px 48px -28px rgba(0, 0, 0, .35); }
    .lv-offer:hover, .lv-cat:hover { translate: 0 -4px; border-color: var(--lv-c40); }
    .lv-card:hover::after, .lv-offer:hover::after, .lv-cat:hover::after, .lv-box:hover::after { opacity: 1; }
}
body.dark-mode .lv-card:hover, body.dark-mode .lv-offer:hover, body.dark-mode .lv-cat:hover { box-shadow: 0 26px 48px -28px rgba(0, 0, 0, .9); }

/* softer scroll reveal: rise + gentle de-blur */
html.lv-rv-on [data-rv].is-in:not([data-rv="kids"]), html.lv-rv-on [data-rv="kids"].is-in > * { animation-name: lvRise; animation-duration: .9s; }
@keyframes lvRise { from { opacity: 0; transform: translateY(28px) scale(.985); filter: blur(6px); } }
@keyframes lvShine { 0%, 55% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes lvGrow { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
    .lv-show-track { animation: none; }
    .lv-show-view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; scrollbar-width: none; }
    .lv-show-set[aria-hidden] { display: none; }
    .lv-hero h1 { animation: none; background: none; -webkit-text-fill-color: currentColor; color: var(--lv-char); }
    .lv-head, .lv-card, .lv-offer, .lv-cat { transition: none; }
}
