/*
  Developed by Mohammad Rameez Imdad (Rameez Scripts)
  WhatsApp: https://wa.me/923435347417 (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 ===== */
/* icon rail (logo · shortcuts · preferences · account) + panel (name · search · folding sections).
   desktop folds the panel to icons, phones get both as a drawer */
:root {
    --sb-rail-w: 52px;
    --sb-w: 292px;      /* rail + panel */
    --sb-mini: 108px;   /* rail + icon column */
    --sb-r: 4px;
}

.sidebar {
    --sb-bg: var(--bg-secondary);
    --sb-rail: color-mix(in srgb, var(--text-primary) 3.5%, transparent);
    --sb-hover: color-mix(in srgb, var(--text-primary) 5%, transparent);
    --sb-active: color-mix(in srgb, var(--text-primary) 8%, transparent);
    --sb-ring: var(--bg-secondary);
    width: var(--sb-w);
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    display: flex;
    position: relative;
    z-index: 950; /* tooltips + account menu paint over the page */
    background: var(--sb-bg);
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    transition: width 0.25s ease, background-color 0.3s ease;
}
.sb-off { display: none !important; }

/* rail */
.sb-rail {
    width: var(--sb-rail-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 12px;
    background: var(--sb-rail);
    border-right: 1px solid var(--border-color);   /* no overflow clip — the account + theme menus open beside it */
}
.sb-rail-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
}
.sb-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.sb-rail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sb-rail-foot {
    margin-top: auto;
    padding-top: 12px;
}
.sb-rail-list li { position: relative; }
.sb-rail-list > li > a,
.sb-rail-list > li > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--sb-r);
    color: var(--text-muted);
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.sb-rail-list > li > a:hover,
.sb-rail-list > li > button:hover,
.sb-user-btn[aria-expanded="true"] {
    background: var(--sb-hover);
    color: var(--text-primary);
}
.sb-rail-list > li > a.active {
    background: var(--sb-active);
    color: var(--text-primary);
}
/* header theme menu while borrowed by the rail — opens to the right, bottom-aligned */
.sb-theme > .theme-quick-menu {
    top: auto;
    right: auto;
    bottom: 0;
    left: calc(100% + 8px);
}
#sbMode .fa-sun,
#sbMode[aria-checked="true"] .fa-moon { display: none; }
#sbMode[aria-checked="true"] .fa-sun { display: inline-block; }

/* panel */
.sb-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.sb-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--border-color);
}
.sb-name {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    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;
}
.sb-icon-btn:hover {
    background: var(--sb-hover);
    color: var(--text-primary);
}

/* search box — "/" jumps here */
.sb-search {
    flex-shrink: 0;
    padding: 12px 12px 4px;
}
.sb-find {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 8px 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--sb-r);
    cursor: text;
    transition: border-color 0.2s, background-color 0.2s;
}
.sb-find:hover { border-color: var(--input-border); }
.sb-find i {
    width: 16px;
    flex-shrink: 0;
    text-align: center;
    font-size: 13px;
    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;
}
.sb-find input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}
.sb-find input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sb-find kbd {
    flex-shrink: 0;
    font: 500 12px/1 inherit;
    color: var(--text-muted);
}
.sb-find:focus-within kbd { display: 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: 14px !important; }
}
@media (hover: none) {
    .sb-find kbd { display: none; }
}

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

/* section title — chevron · NAME · summed count while folded */
.sb-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 32px;
    padding: 0 10px;
    background: none;
    border: 0;
    border-radius: var(--sb-r);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
    transition: color 0.2s;
}
.sb-head:hover { color: var(--text-primary); }
.submenu-arrow {
    width: 12px;
    font-size: 10px;
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}
.submenu-toggle.open .submenu-arrow { transform: none; }
.sb-head .nav-pill-group {
    position: static;
    margin-left: auto;
    transform: none;
}
.sb-head.open .nav-pill-group { display: none; }   /* open: each row shows its own */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sidebar-submenu.open,
.sidebar.sb-filtering .sidebar-submenu { max-height: 1600px; }   /* room for a long project menu */

/* rows */
.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-menu li { position: relative; }
.sidebar-menu li + li { margin-top: 1px; }
.sidebar-menu a,
.sidebar-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    background: transparent;
    border: 0;
    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, 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: 44px; }
.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(--sb-active);
    color: var(--text-primary);
    font-weight: 600;
}
.sidebar-menu a.active > i:first-child { color: var(--text-primary); }

.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 in the panel, a dot on the rail / folded panel */
.nav-pill {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.sb-rail .nav-pill {
    top: 5px;
    right: 5px;
    transform: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--sb-ring);
    font-size: 0;
}

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

/* account — avatar on the rail, menu opens beside it */
.sb-user-btn img.sb-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}
.sb-user-menu {
    position: absolute;
    left: calc(100% + 8px);
    bottom: 0;
    z-index: 5;
    width: 220px;
    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: translateX(-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-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    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: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.sb-user-txt small {
    font-size: 12px;
    color: var(--text-muted);
}
.sb-user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 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); }

/* icon 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 12px 0; }

/* folded panel — desktop only, phones always get the full drawer */
@media (min-width: 769px) {
    .sb-x { display: none; }
    .sidebar.collapsed { width: var(--sb-mini); }
    .sidebar.collapsed .sb-name,
    .sidebar.collapsed .sb-find input,
    .sidebar.collapsed .sb-find kbd,
    .sidebar.collapsed .sb-head,
    .sidebar.collapsed .sidebar-menu span,
    .sidebar.collapsed .impersonate-text { display: none; }
    .sidebar.collapsed .sb-brand {
        justify-content: center;
        padding: 0;
    }
    .sidebar.collapsed .sb-search { padding: 12px 0 4px; }
    .sidebar.collapsed .sb-sec { padding: 8px 0; }
    .sidebar.collapsed .sb-find,
    .sidebar.collapsed .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu button {
        width: 36px;
        margin: 0 auto;
        padding: 0;
        gap: 0;
        justify-content: center;
        cursor: pointer;
    }
    .sidebar.collapsed .sidebar-submenu { max-height: none; }
    .sidebar.collapsed .sb-panel .nav-pill {
        top: 5px;
        right: calc(50% - 16px);
        transform: none;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--danger);
        box-shadow: 0 0 0 2px var(--sb-ring);
        font-size: 0;
    }
    .sidebar.collapsed .impersonate-notice {
        justify-content: center;
        margin: 8px 6px 0;
        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 (rail + panel), above the bottom bar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1002;
        width: min(330px, 90vw);
        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);
    }
    .sb-rail { width: 58px; }
    .sb-rail-list > li > a,
    .sb-rail-list > li > button,
    .sidebar-menu a,
    .sidebar-menu button { height: 44px; }
    .sb-rail-list > li > a,
    .sb-rail-list > li > button { width: 44px; }
    .sb-find { height: 44px; }
    .sb-sec { padding: 8px 10px; }
    .sb-brand .sb-icon-btn .fa-table-columns { display: none; }
    .sb-brand .sb-icon-btn { width: 44px; height: 44px; }
    .sb-user-menu { width: min(220px, calc(90vw - 72px)); }
}

/* dark mode — the global span/div colour rule outranks plain classes */
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; }

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

/* ===== Sidebar colour — <html data-sb>: light (default, base look above) · navy · theme (palette primary) =====
   dark panels redefine the text/line tokens INSIDE .sidebar so every child follows */
:root { --sb-navy-top: #071d3c; --sb-navy-bottom: #04152a; --sb-navy-active: #14376a; --sb-navy-card: #0b2447; }
html[data-sb="theme"] {
    --sb-navy-top: var(--navy-primary);
    --sb-navy-bottom: color-mix(in srgb, var(--navy-primary) 72%, #000);
    --sb-navy-active: color-mix(in srgb, var(--navy-accent) 30%, var(--navy-primary));
    --sb-navy-card: color-mix(in srgb, var(--navy-primary) 88%, #fff);
}
html:not([data-sb="light"]) .sidebar {
    --sb-bg: linear-gradient(180deg, var(--sb-navy-top), var(--sb-navy-bottom));
    --sb-hover: rgba(255, 255, 255, 0.07);
    --sb-active: var(--sb-navy-active);
    --sb-rail: rgba(0, 0, 0, 0.2);
    --sb-ring: var(--sb-navy-top);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.86);
    --text-muted: rgba(255, 255, 255, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.25);
    --bg-card: var(--sb-navy-card);
    --shadow-hover: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
    color: var(--text-secondary);
    background-color: var(--sb-navy-bottom);
}
@media (min-width: 769px) { html:not([data-sb="light"]) .sidebar { border-right-color: var(--sb-navy-bottom); } }
html[data-shape="glass"]:not([data-sb="light"]) .sidebar { --sb-bg: color-mix(in srgb, var(--sb-navy-top) 86%, transparent); border-right-color: rgba(255, 255, 255, 0.08) !important; }
/* quick search sits flat in the panel — the glass / rounded input rules must not frost or round it */
.sidebar #sbQ { background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }














































/* Sidebar User Info */




/* Collapsed Sidebar */


























/* Hide submenu arrow in collapsed state */


/* Submenu in collapsed state */










/* Theme toggle in collapsed state */








/* Logout button in collapsed state */








/* Tooltip for collapsed sidebar items */






/* Mobile Overlay */




/* Mobile Menu Button - DEPRECATED (Now using bottom navigation bar) */
/* Old top hamburger button - kept for backwards compatibility but hidden */
.mobile-menu-btn-old {
    display: none !important;
}

/* Bottom nav menu button is now in mobile-menu.php inline styles */

/* ===== 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);
}

/* Sidebar Overlay for mobile */




/* Mobile Sidebar */
@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;
    }

    

    

    /* Disable collapsed state on mobile */


    

    

    

    

    

    

    

    

    /* Hide sidebar toggle button on mobile */


    .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: var(--table-hover) !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%;
    }
}

/* ===== Sidebar Submenu Styles ===== */

























/* ===== 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);
}

/* ===== Theme Toggle ===== */










/* ===== 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);
}

/* Ensure all header welcome text is visible */
body.dark-mode .header > div {
    color: var(--text-secondary) !important;
}

/* ===== 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;
    }

    /* Header mobile optimization */
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

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

    .header > div {
        font-size: 13px;
        width: 100%;
        text-align: right;
    }

    /* 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;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .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),
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);
}

body.dark-mode .header div {
    color: var(--text-secondary);
}

/* ===== 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;
}
.logo-upload-controls-inner {
    display: flex;
    gap: 10px;
    align-items: center;
}
.logo-upload-btn {
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 16px;
}
.logo-file-name {
    color: var(--text-muted);
    font-size: 13px;
}
.logo-help-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

/* ===== 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: 264px; }
.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; }

/* 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-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    border-radius: 4px;
    color: white;
}

.about-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.about-title h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 700;
}

.about-dev {
    font-size: 14px;
    opacity: 0.9;
}

.about-card {
    background: white;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--navy-primary);
}

.about-card h2 {
    color: var(--navy-primary);
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-card p {
    color: #555;
    line-height: 1.7;
    font-size: 15px;
}

.about-features {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.about-features li {
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    align-items: flex-start;
    gap: 12px;
}

.about-features li i {
    color: var(--navy-primary);
    margin-right: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

.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;
}

.about-developer {
    border-left-color: var(--navy-accent);
}

.developer-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.developer-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--navy-primary);
    flex-shrink: 0;
}

.developer-details h3 {
    color: var(--navy-primary);
    font-size: 20px;
    margin-bottom: 5px;
}

.developer-brand {
    color: var(--navy-accent);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.developer-details p {
    margin-bottom: 15px;
}

.developer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dev-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.dev-link.whatsapp {
    background: #25D366;
    color: white;
}

.dev-link.whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.dev-link.youtube {
    background: #FF0000;
    color: white;
}

.dev-link.youtube:hover {
    background: #CC0000;
    transform: translateY(-2px);
}

.about-footer {
    text-align: center;
    padding: 25px;
    color: #666;
    font-size: 14px;
}

.about-version {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Dark Mode — About Section */
body.dark-mode .about-card {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body.dark-mode .about-card p {
    color: var(--text-secondary);
}

body.dark-mode .about-features li {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

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);
}

body.dark-mode .developer-details h3 {
    color: var(--text-primary);
}

body.dark-mode .developer-avatar {
    border-color: var(--navy-accent);
}

body.dark-mode .about-footer {
    color: var(--text-secondary);
}

body.dark-mode .about-version {
    color: var(--text-muted);
}

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

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

    .about-header {
        flex-direction: column;
        text-align: center;
    }

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

    .developer-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .developer-links {
        justify-content: center;
    }
}

/* 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;
}

/* 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; }

/* ===== 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-drop {
    padding: 16px 18px 18px;
    border: 1.5px dashed rgba(var(--navy-accent-rgb), 0.45);
    background: rgba(var(--navy-accent-rgb), 0.05);
    border-radius: 12px;
}
.acct-drop-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.acct-drop-head > i { font-size: 26px; color: var(--navy-accent); }
.acct-drop-head strong { display: block; font-size: 14.5px; color: var(--text-primary); }
.acct-drop-head small  { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.acct-hint { display: block; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
.acct-hint i { color: var(--navy-accent); margin-right: 5px; }

/* 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 (login) — split brand / form card ===== */
.auth-body {
    position: relative;
    min-height: 100vh;
    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 50% 40%, #000 20%, transparent 78%);
            mask-image: radial-gradient(1000px 700px at 50% 40%, #000 20%, transparent 78%);
    pointer-events: none;
    z-index: 0;
}
.auth-wrap {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 22px;
    padding: 32px 20px;
}
.auth-card {
    width: 100%; max-width: 1180px;
    display: grid; grid-template-columns: 0.86fr 1fr;
    background: var(--bg-card);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.13);
    overflow: hidden;
}

/* brand rail */
.auth-brand {
    position: relative;
    display: flex; align-items: center;
    padding: 52px 46px;
    background: linear-gradient(160deg, var(--navy-light) 0%, var(--navy-primary) 55%, var(--navy-dark) 100%);
    overflow: hidden;
}
.auth-brand::after {
    content: '';
    position: absolute; left: -30%; bottom: -48%;
    width: 160%; height: 92%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--navy-accent-rgb), 0.42), transparent 72%);
    pointer-events: none;
}
.auth-dots {
    position: absolute;
    width: 84px; height: 62px;
    opacity: 0.5;
    background-image: radial-gradient(rgba(255, 255, 255, 0.45) 1.6px, transparent 1.6px);
    background-size: 17px 17px;
    pointer-events: none;
}
.auth-dots-tr { top: 42px; right: 40px; }
.auth-dots-bl { left: 34px; bottom: 66px; }
.auth-brand-inner { position: relative; z-index: 1; width: 100%; text-align: center; }
.auth-logo {
    width: 118px; height: 118px;
    margin: 0 auto 26px;
    padding: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.auth-logo img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.auth-brand h1 { font-size: 30px; font-weight: 800; color: #fff; margin: 0 0 12px; line-height: 1.25; }
.auth-brand h1 span { color: var(--navy-accent); }
.auth-brand p { max-width: 330px; margin: 0 auto; font-size: 14.5px; line-height: 1.65; color: rgba(255, 255, 255, 0.72); }
.auth-sep { height: 1px; background: rgba(255, 255, 255, 0.18); margin: 30px 0 26px; }
.auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.auth-features li { display: flex; align-items: center; gap: 16px; }
.auth-feat-icon {
    flex: 0 0 52px; width: 52px; height: 52px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 19px;
}
.auth-feat-icon i { color: var(--navy-accent); }
.auth-features strong { display: block; margin-bottom: 3px; font-size: 15.5px; font-weight: 700; color: #fff; }
.auth-features small  { display: block; font-size: 13.2px; line-height: 1.5; color: rgba(255, 255, 255, 0.62); }

/* form panel */
.auth-panel {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 48px 56px;
    background: var(--bg-card);
}
.auth-toggle {
    position: absolute; top: 26px; right: 28px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.25s;
}
.auth-toggle:hover { color: var(--navy-accent); border-color: var(--navy-accent); }
.auth-panel-inner { width: 100%; max-width: 420px; }
.auth-panel-inner .error,
.auth-panel-inner .success { margin-bottom: 18px; text-align: left; }
.auth-lock {
    width: 74px; height: 74px;
    margin: 0 auto 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(var(--navy-accent-rgb), 0.12);
    font-size: 28px;
}
.auth-lock i { color: var(--navy-accent); }
.auth-panel h2 { font-size: 29px; font-weight: 800; color: var(--navy-primary); text-align: center; margin: 0 0 8px; }
.auth-sub { font-size: 14.5px; color: var(--text-muted); text-align: center; margin: 0 0 28px; }

.auth-group { margin-bottom: 18px; }
.auth-group label { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 14.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: 54px;
    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 22px; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--navy-accent); cursor: pointer; }
.auth-link { color: var(--navy-accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-submit {
    width: 100%; height: 54px;
    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: 16.5px; 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-or { position: relative; text-align: center; margin: 24px 0 18px; }
.auth-or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border-color); }
.auth-or span {
    position: relative; display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px;
}
.auth-google {
    width: 100%; height: 54px;
    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: 15.5px; font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
}
.auth-google:hover { border-color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.05); }
.auth-signup { margin: 22px 0 0; text-align: center; font-size: 14.5px; color: var(--text-secondary); }
.auth-maint { margin-top: 18px; text-align: left; }
.auth-copy { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-muted); }
.auth-copy i { color: var(--navy-accent); }

/* dark mode — beat the blanket p/span/div 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-card { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
body.dark-mode .auth-brand p { color: rgba(255, 255, 255, 0.72) !important; }
body.dark-mode .auth-brand h1 span { color: var(--navy-accent) !important; }
body.dark-mode .auth-features small { color: rgba(255, 255, 255, 0.62) !important; }
body.dark-mode .auth-sub,
body.dark-mode .auth-copy { color: var(--text-muted) !important; }

@media (max-width: 992px) {
    .auth-card { grid-template-columns: 1fr; max-width: 560px; }
    .auth-brand { padding: 36px 30px 32px; }
    .auth-logo { width: 92px; height: 92px; margin-bottom: 18px; }
    .auth-brand h1 { font-size: 25px; }
    .auth-sep, .auth-features { display: none; }
    .auth-panel { padding: 40px 30px 36px; }
}
@media (max-width: 560px) {
    .auth-wrap { padding: 18px 14px; }
    .auth-brand { padding: 30px 22px 26px; }
    .auth-panel { padding: 34px 20px 30px; }
    .auth-panel h2 { font-size: 24px; }
    .auth-toggle { top: 14px; right: 14px; padding: 8px 12px; }
}

/* ===== 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%; }
}

/* sidebar unread pill sits on the Chat nav item */


/* collapsed rail has no room for a number — shrink to a dot */


/* 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 — WhatsApp-style surface =====
   Page-scoped on purpose: everything here sits under .page-chat / .chat-*,
   so the navy dashboard theme is untouched everywhere else. */

body.page-chat {
    --wa-teal:      #008069;
    --wa-green:     #25d366;
    --wa-out:       #d9fdd3;   /* my bubble  */
    --wa-in:        #ffffff;   /* their bubble */
    --wa-bg:        #efeae2;   /* wallpaper base */
    --wa-panel:     #ffffff;
    --wa-head:      #f0f2f5;
    --wa-line:      #e9edef;
    --wa-txt:       #111b21;
    --wa-mut:       #667781;
    --wa-tick:      #53bdeb;
    --wa-wall-op:   .06;
}
body.page-chat.dark-mode {
    --wa-teal:      #00a884;
    --wa-out:       #005c4b;
    --wa-in:        #202c33;
    --wa-bg:        #0b141a;
    --wa-panel:     #111b21;
    --wa-head:      #202c33;
    --wa-line:      #222d34;
    --wa-txt:       #e9edef;
    --wa-mut:       #8696a0;
    --wa-wall-op:   .05;
}

.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);
}

/* ---------- left panel ---------- */
.chat-side { display: flex; flex-direction: column; overflow: hidden; background: var(--wa-panel); }
.chat-side-head {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 12px; background: var(--wa-head); 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 transparent; border-radius: 8px;
}
.chat-search input::placeholder { color: var(--wa-mut); }
.chat-search input:focus { outline: none; border-color: var(--wa-teal); }
.chat-bcast-btn {
    white-space: nowrap; background: var(--wa-teal); border: none; color: #fff;
    padding: 9px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.chat-bcast-btn:hover { filter: brightness(1.08); }

.chat-contacts { flex: 1; overflow-y: auto; background: var(--wa-panel); }
.chat-contact {
    display: flex; align-items: center; gap: 13px; width: 100%;
    padding: 10px 14px; background: none; border: none;
    text-align: left; cursor: pointer; color: var(--wa-txt);
}
.chat-contact:hover  { background: var(--wa-head); }
.chat-contact.active { background: var(--wa-head); }
body.page-chat.dark-mode .chat-contact.active { background: #2a3942; }
/* divider is indented past the avatar, the way a messenger list reads */
.chat-contact + .chat-contact::before {
    content: ''; position: absolute; left: 74px; right: 0; top: 0; height: 1px; background: var(--wa-line);
}
.chat-contact { position: relative; }
.chat-contact img { width: 49px; height: 49px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.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: 16px; font-weight: 400; 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: 14px; 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: #0b141a; font-size: 12px; font-style: normal; font-weight: 600;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    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); }
/* doodle wallpaper — inlined so nothing is fetched from outside. it lives on the pane, not the
   scrolling message list, otherwise it would only cover the first screenful of a long thread */
.chat-pane::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMjAiIGhlaWdodD0iMjIwIiB2aWV3Qm94PSIwIDAgMjIwIDIyMCI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjEuNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMzgiPjxjaXJjbGUgY3g9IjI4IiBjeT0iMjYiIHI9IjgiLz48cGF0aCBkPSJNNjAgMjBoMTh2MTRINjB6Ii8+PHBhdGggZD0iTTEwNCAzMmM0LTEwIDE0LTEwIDE0LTIgMCA2LTcgMTAtMTQgMTYtNy02LTE0LTEwLTE0LTE2IDAtOCAxMC04IDE0IDJ6Ii8+PHBhdGggZD0iTTE1MCAxOGw0IDkgMTAgMS03IDcgMiAxMC05LTUtOSA1IDItMTAtNy03IDEwLTF6Ii8+PHBhdGggZD0iTTE5MCAyMGM2IDAgMTAgNCAxMCA5cy00IDktMTAgOWgtNGwtNiA1di01Yy00LTEtNi01LTYtOSAwLTUgNC05IDEwLTl6Ii8+PHBhdGggZD0iTTIwIDcwYzgtNiAxNiA2IDI0IDAiLz48cGF0aCBkPSJNNjIgNjRoMTZ2MTZINjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSgyMCA3MCA3MikiLz48Y2lyY2xlIGN4PSIxMTIiIGN5PSI3MiIgcj0iOSIvPjxwYXRoIGQ9Ik0xMDggNzJsMyAzIDYtNyIvPjxwYXRoIGQ9Ik0xNTAgNjR2MTZNMTQyIDcyaDE2Ii8+PHBhdGggZD0iTTE4NiA2MmwxMCAxMC0xMCAxMC0xMC0xMHoiLz48cGF0aCBkPSJNMTggMTE4YzAtNiA1LTEwIDExLTEwczExIDQgMTEgMTAtNSAxMC0xMSAxMGgtM2wtNSA0di01Yy0yLTItMy01LTMtOXoiLz48cGF0aCBkPSJNNjAgMTEwbDggMTZoLTE2eiIvPjxwYXRoIGQ9Ik0xMDAgMTA4aDIwdjhoLTIwek0xMDQgMTE2djEwTTExNiAxMTZ2MTAiLz48cGF0aCBkPSJNMTQ4IDExMmE4IDggMCAxIDEgMCAxMk0xNDggMTA2djIyIi8+PGNpcmNsZSBjeD0iMTkyIiBjeT0iMTE4IiByPSI5Ii8+PHBhdGggZD0iTTE5MiAxMTJ2Nmw0IDMiLz48cGF0aCBkPSJNMTYgMTYwaDIwbC00IDEySDIweiIvPjxwYXRoIGQ9Ik01OCAxNTZjNi00IDEyIDQgMTggMCIvPjxwYXRoIGQ9Ik01OCAxNjhjNi00IDEyIDQgMTggMCIvPjxwYXRoIGQ9Ik0xMDQgMTUybDYgMTItNiAxMi02LTEyeiIvPjxwYXRoIGQ9Ik0xNDQgMTU2aDE4djE0aC02bC00IDUtMi01aC02eiIvPjxwYXRoIGQ9Ik0xODggMTU0djE4TTE4MCAxNjNoMTYiLz48cGF0aCBkPSJNMjAgMTk4YzggMCA4IDggMTYgOCIvPjxwYXRoIGQ9Ik02NCAxOTZhNyA3IDAgMSAwIDE0IDAgNyA3IDAgMCAwLTE0IDB6TTcxIDIwM3Y2Ii8+PHBhdGggZD0iTTEwMiAxOTRoMTZ2MTJoLTE2eiIvPjxwYXRoIGQ9Ik0xMDYgMjA2bC0zIDZNMTE0IDIwNmwzIDYiLz48cGF0aCBkPSJNMTQ4IDE5Mmw4IDgtOCA4LTgtOHoiLz48cGF0aCBkPSJNMTg2IDE5NGM2IDIgOCA4IDQgMTIiLz48L2c+PC9zdmc+Cg==");
    background-repeat: repeat; background-size: 220px 220px;
    opacity: var(--wa-wall-op);
}
.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 { font-size: 52px; color: var(--wa-teal); opacity: .3; }
.chat-blank h3 { color: var(--wa-txt); font-size: 22px; font-weight: 300; }
.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: 9px 16px; background: var(--wa-head); 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: 16px; font-weight: 500; 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;
}
/* doodle wallpaper, inlined so nothing is fetched from outside */

.chat-day { text-align: center; margin: 12px 0; }
.chat-day span {
    display: inline-block; padding: 5px 12px; font-size: 12.5px;
    text-transform: uppercase; color: var(--wa-mut);
    background: var(--wa-in); border-radius: 7.5px; box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
}
body.page-chat.dark-mode .chat-day span { color: var(--wa-mut); background: var(--wa-head); }

.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-radius: 7.5px; box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    word-break: break-word; max-width: 100%;
}
.chat-msg.mine .chat-bub { background: var(--wa-out); }

/* the little tail — only on the first bubble of a run, like the real thing */
.chat-msg.starts-run .chat-bub::before {
    content: ''; position: absolute; top: 0; width: 8px; height: 13px;
}
.chat-msg.starts-run:not(.mine) .chat-bub { border-top-left-radius: 0; }
.chat-msg.starts-run:not(.mine) .chat-bub::before {
    left: -8px;
    background: var(--wa-in);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.chat-msg.starts-run.mine .chat-bub { border-top-right-radius: 0; }
.chat-msg.starts-run.mine .chat-bub::before {
    right: -8px;
    background: var(--wa-out);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.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);
}

/* time + ticks tuck into the last line of text, dropping to their own line when it's tight */
.chat-meta {
    float: right; margin: 8px -4px -4px 8px;
    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 img { display: block; max-width: 320px; width: 100%; border-radius: 6px; margin-bottom: 2px; }
.chat-doc {
    display: flex; align-items: center; gap: 11px; margin-bottom: 3px; padding: 11px 13px;
    background: rgba(11,20,26,.05); border-radius: 6px; color: inherit; text-decoration: none;
}
body.page-chat.dark-mode .chat-doc { background: rgba(255,255,255,.06); }
.chat-doc i { font-size: 24px; color: var(--wa-mut); }
.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: -12px; right: 4px; display: none; gap: 2px;
    background: var(--wa-panel); border-radius: 6px; padding: 2px;
    box-shadow: 0 2px 6px rgba(11,20,26,.2);
}
.chat-bub:hover .chat-tools { display: flex; }
.chat-tools button { background: none; border: none; cursor: pointer; padding: 4px 7px; font-size: 12px; color: var(--wa-mut); }
.chat-tools button:hover { color: #ea4335; }

/* ---------- composer ---------- */
.chat-composer {
    display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0;
    padding: 8px 16px; background: var(--wa-head);
}
.chat-composer textarea {
    flex: 1; resize: none; max-height: 140px; padding: 10px 14px;
    font-size: 16px; font-family: inherit; line-height: 20px;
    background: var(--wa-panel); color: var(--wa-txt);
    border: none; border-radius: 8px;
}
.chat-composer textarea::placeholder { color: var(--wa-mut); }
.chat-composer textarea:focus { outline: none; }
.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: 50%; touch-action: manipulation;
}
.chat-attach { background: none; color: var(--wa-mut); font-size: 21px; }
.chat-attach:hover { color: var(--wa-txt); }
.chat-send { background: var(--wa-teal); color: #fff; font-size: 17px; }
.chat-send:hover:not(:disabled) { filter: brightness(1.08); }
.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: 8px;
}
.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: 62px; margin: 8px 14px; border-radius: 8px;
    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 ---- */
body.page-chat .main-content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body.page-chat .breadcrumb { display: none; }
body.page-chat .header {
    flex-shrink: 0; margin: 0; padding: 10px 16px; border-radius: 0; box-shadow: none;
    background: var(--wa-head); border-bottom: 1px solid var(--wa-line);
}
body.page-chat .header h1 { font-size: 18px; color: var(--wa-txt); }
body.page-chat .chat-wrap { flex: 1; height: auto; min-height: 0; }
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; }
}
@media (max-width: 768px) {
    body.page-chat .main-content { padding-bottom: max(65px, calc(65px + env(safe-area-inset-bottom))); }
    body.page-chat .header { padding: 9px 14px; }
    body.page-chat .header h1 { font-size: 17px; }
}


/* ================================================================
   HELPDESK FRONTEND SPINE — appended block
   Navbar · overlay · top bar · toggle · sd-* · pipeline · chip-table
   bulk select · txn modal · sidebar groups · helpdesk widgets · tour
   ================================================================ */

/* ===== Top Loading Bar — READS only, 3px, non-blocking ===== */
.top-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10001; overflow: hidden; pointer-events: none; display: none; }
.top-loadbar.on { display: block; }
.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), 0.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(74, 163, 255, 0), #4aa3ff, #9fd0ff); }

/* ===== Branded Processing Overlay — WRITES only, above modals ===== */
.action-loader { position: fixed; inset: 0; z-index: 3000; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(var(--navy-primary-rgb), 0.72); backdrop-filter: blur(3px); }
.action-loader.on { display: flex; }
.action-loader img { width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); object-fit: cover; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); animation: al-pulse 1.6s ease-in-out infinite; }
.action-loader-bar { width: min(260px, 60vw); height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.action-loader-bar::after { content: ""; display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--navy-accent); animation: al-slide 1.1s ease-in-out infinite; }
.action-loader-text { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0.3px; }
@keyframes al-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes al-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ===== Action button busy state (pairs with the overlay) ===== */
.btn[disabled] { opacity: 0.65; cursor: not-allowed; pointer-events: none; }
.btn .fa-spinner { margin-right: 6px; }
.row-busy { opacity: 0.55; pointer-events: none; }
[data-act][disabled] { cursor: progress; opacity: 0.5; }

/* ===== DaisyUI-style toggle (+ the mandatory 44px width guard) ===== */
.toggle { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 24px; background: #ccc; position: relative; cursor: pointer; transition: background 0.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: #fff; transition: transform 0.3s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.toggle:checked::before { transform: translateX(20px); }
.toggle:disabled { opacity: 0.5; cursor: not-allowed; }
/* guard: `.form-group input {width:100%}` (0,1,1) beats a bare `.toggle` (0,1,0) — these score (0,2,0) */
.form-group .toggle, .toggle-row .toggle { width: 44px; min-width: 44px; max-width: 44px; height: 24px; flex: 0 0 44px; padding: 0; }
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row label { margin: 0; font-size: 14px; color: var(--text-secondary); }
body.dark-mode .toggle { background: #3d3d7a; }

/* ===== Searchable dropdown / multiselect (vanilla, squared 3px) ===== */
.searchable-dropdown { position: relative; width: 100%; }
.sd-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 9px 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 0.3s; }
.searchable-dropdown.open .sd-trigger, .sd-trigger:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.15); }
.searchable-dropdown.sd-disabled .sd-trigger { opacity: 0.6; cursor: not-allowed; }
.sd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-label.sd-placeholder { color: var(--text-muted); }
.sd-arrow { font-size: 11px; color: var(--text-muted); transition: transform 0.2s; flex: none; }
.sd-arrow.open { transform: rotate(180deg); }
/* fixed panel — a DataTable / .lte-card with overflow can never clip it */
.sd-panel { position: fixed; z-index: 4000; background: var(--bg-card); border: 2px solid var(--navy-accent); border-radius: 3px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); overflow: hidden; }
.sd-panel[hidden] { display: none; }
.sd-search { width: 100%; padding: 10px 12px; border: none; border-bottom: 1px solid var(--border-light); background: var(--input-bg); color: var(--text-primary); font-size: 16px; outline: none; }
.sd-list { max-height: 220px; overflow-y: auto; }
.sd-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 14px; color: var(--text-primary); cursor: pointer; }
.sd-item:hover { background: rgba(var(--navy-accent-rgb), 0.1); }
.sd-item.selected { background: rgba(var(--navy-accent-rgb), 0.12); color: var(--navy-accent); font-weight: 600; }
.sd-item .sd-tick { width: 14px; font-size: 11px; color: var(--navy-accent); opacity: 0; flex: none; }
.sd-item.selected .sd-tick { opacity: 1; }
.sd-empty { padding: 12px; color: var(--text-muted); font-size: 13px; text-align: center; }
.sd-create { padding: 9px 12px; font-size: 13.5px; color: var(--navy-accent); font-weight: 600; cursor: pointer; border-top: 1px solid var(--border-light); }
.sd-create:hover { background: rgba(var(--navy-accent-rgb), 0.1); }
/* multiselect chips inside the trigger */
.sd-tags { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-width: 0; }
.sd-tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 7px; border-radius: 3px; background: rgba(var(--navy-accent-rgb), 0.12); color: var(--navy-accent); font-size: 12px; font-weight: 600; }
.sd-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-tag i { font-size: 10px; cursor: pointer; opacity: 0.75; }
.sd-tag i:hover { opacity: 1; }

/* ===== Pipeline Chevron Tabs (status filter) ===== */
.pipeline-stages { display: flex; width: 100%; margin-bottom: 20px; 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: 6px; padding: 14px 20px 14px 28px; cursor: pointer; transition: filter 0.2s, opacity 0.2s; color: #fff; text-decoration: none; border: none; -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, 0.15); }
.pipeline-stage i { font-size: 12px; }
.pipeline-stage-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.3px; color: inherit; }
.pipeline-stage-count { font-size: 14px; font-weight: 800; color: inherit; white-space: nowrap; }
.pipeline-stage.pipeline-empty { opacity: 0.6; }
.pipeline-stage.pipeline-empty:hover { opacity: 0.85; }
@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: 110px; flex-shrink: 0; flex-grow: 0; padding: 10px 14px 10px 22px; } .pipeline-stage-name { font-size: 9px; } }

/* ===== Chip-row dense table — scoped to .chip-table only ===== */
table.dataTable.chip-table { width: 100% !important; border-collapse: separate; border-spacing: 0; min-width: 1200px; }
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-primary); vertical-align: middle; border-bottom: 1px solid var(--border-light); }

.cell-stack { display: flex; flex-direction: column; gap: 3px; }
.chip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 164px; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; height: 24px; min-width: 92px; border-radius: 3px; font-size: 11px; 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(0.95); }
.chip.chip-outline { background: transparent; border-style: dashed; border-color: #b9c3ce; color: #7d8896; }

/* chip palettes — named by colour, never by domain */
.chip-navy { background: #0b2545; color: #fff; }
.chip-green { background: #1f9d57; color: #fff; }
.chip-red { background: #c0392b; color: #fff; }
.chip-amber { background: #c4701a; color: #fff; }
.chip-teal { background: #d4efef; color: #0d7878; border-color: #bbe6e6; }
.chip-link { background: #e9f1fc; color: #0a66c2; border-color: #cfe0f7; }
.chip-soft-navy { background: #e6edf6; color: #0b2545; border-color: #d3deec; }
.chip-soft-green { background: #e2f6ea; color: #1f8b4c; border-color: #c7eed6; }
.chip-soft-amber { background: #fdecd6; color: #c4701a; border-color: #f8dab4; }
.chip-soft-red { background: #fdecea; color: #c0392b; border-color: #f7cdc7; }
.chip-soft-purple { background: #ece2f9; color: #6a1b9a; border-color: #dccbf2; }
.chip-soft-tan { background: #fbe7c6; color: #92520a; border-color: #f3d29b; }
.chip-soft-grey { background: #eef1f4; color: #5a6672; border-color: #dfe4ea; }

/* values beside chips — pinned right */
.chip-row .val { font-weight: 800; font-size: 12.5px; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.val-amount { color: #d35400; }
.val-pos { color: #1f8b4c; }
.val-neg { color: #c0392b; }
.val-navy { color: var(--navy-primary); }
.val-muted { color: #9aa6b2; font-weight: 700; }
.val-box { background: #eef1f4; color: #33414f; padding: 2px 7px; border-radius: 3px; font-size: 11px; font-weight: 700; font-family: 'Courier New', monospace; letter-spacing: 0.2px; }
.cell-title { font-size: 13px; font-weight: 800; color: var(--navy-primary); margin-bottom: 1px; }
.cell-sub { font-size: 11.5px; color: var(--text-muted); }

/* inline select inside a chip row (never a plain <select> — sdInit renders into this box) */
.mini-select { height: 30px; min-width: 118px; padding: 0 8px; border: 1px solid var(--input-border); border-radius: 3px; background: var(--input-bg); color: var(--text-primary); font-size: 12px !important; cursor: pointer; }
.mini-select .sd-trigger { min-height: 30px; padding: 3px 8px; border: none; font-size: 12px; background: transparent; }

/* 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, 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 0.2s; background: transparent; }
.act-info { background: #1c2733; color: #fff; }
.act-info:hover { background: #000; transform: scale(1.1); }
.act-edit { color: #e8a200; font-size: 15px; }
.act-del { color: #e23b2e; font-size: 15px; }
.act-ok { color: #1f8b4c; font-size: 15px; }
.act-edit:hover, .act-del:hover, .act-ok:hover { transform: scale(1.18); }
.act[disabled] { opacity: 0.32; cursor: not-allowed; }
.act[disabled]:hover { transform: none; }

/* column helpers */
table.dataTable.chip-table td.ctr, table.dataTable.chip-table th.ctr { text-align: center; }
table.dataTable.chip-table td.col-media, table.dataTable.chip-table th.col-media { width: 64px; text-align: center; }
table.dataTable.chip-table td.col-actions, table.dataTable.chip-table th.col-actions { white-space: nowrap; }

/* status-tinted rows — !important beats DataTables striping */
table.dataTable.chip-table tbody tr.row-good td { background: #e9f7ef !important; }
table.dataTable.chip-table tbody tr.row-bad td { background: #fdecea !important; }
table.dataTable.chip-table tbody tr.row-wait td { background: #fff7e0 !important; }

body.dark-mode table.dataTable.chip-table tbody td { color: #cbd5e1; border-bottom-color: #2f3846; }
body.dark-mode .cell-title { color: #e8edf3; }
body.dark-mode .val-box { background: #2a3240; color: #cbd5e1; }
body.dark-mode .val-navy { color: #9fd0ff; }
body.dark-mode .media-box { background: #1e2430; border-color: #3a4454; }
body.dark-mode .chip-soft-navy { background: #22304a; color: #cfe0f7; border-color: #32405c; }
body.dark-mode .chip-soft-grey { background: #2a3240; color: #cbd5e1; border-color: #3a4454; }
body.dark-mode .chip.chip-outline { border-color: #48546a; color: #9aa6b2; }
body.dark-mode table.dataTable.chip-table tbody tr.row-good td { background: #12301f !important; }
body.dark-mode table.dataTable.chip-table tbody tr.row-bad td { background: #3a1a18 !important; }
body.dark-mode table.dataTable.chip-table tbody tr.row-wait td { background: #33290d !important; }

/* ===== Bulk select & bulk mode ===== */
.bulk-check { width: 34px; text-align: center; }
.bulk-check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--navy-primary); cursor: pointer; }
table.dataTable tbody tr.row-selected td { background: rgba(var(--navy-accent-rgb), 0.08) !important; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--navy-primary); color: #fff; border-radius: 3px; font-size: 13.5px; font-weight: 600; }
.bulk-bar .bulk-count { background: rgba(255, 255, 255, 0.2); border-radius: 3px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.bulk-bar .btn { padding: 6px 12px; font-size: 13px; }
.bulk-all-hint { background: #fff3cd; color: #856404; border-radius: 3px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
body.dark-mode .bulk-all-hint { background: #3a3418; color: #ffd980; }

/* ===== Transaction / formula modal — 80% split preview ===== */
.modal-txn { width: 80%; max-width: 1400px; }
.txn-split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.txn-form, .txn-preview { max-height: 68vh; overflow-y: auto; }
.txn-preview { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 3px; padding-block: 18px; padding-inline: 18px; }
.txn-preview h4 { font-size: 13px; font-weight: 700; color: var(--navy-primary); text-transform: uppercase; letter-spacing: 0.3px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.txn-calc { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.txn-calc td { padding: 7px 0; color: var(--text-secondary); }
.txn-calc td:last-child { text-align: right; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.txn-formula { display: block; font-size: 11.5px; color: var(--text-muted); }
.txn-calc .txn-total td { border-top: 2px solid var(--navy-primary); padding-top: 10px; font-size: 16px; font-weight: 700; color: var(--navy-primary); }
.txn-impact { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-color); font-size: 13px; color: var(--text-secondary); line-height: 1.9; }
.txn-impact b { color: var(--navy-primary); font-variant-numeric: tabular-nums; }
.txn-invalid { background: #f8d7da; color: #721c24; border-radius: 3px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.txn-empty { text-align: center; color: var(--text-muted); padding: 40px 20px; font-size: 14px; }
.txn-preview-foot { position: sticky; bottom: 0; background: var(--bg-card); border-top: 2px solid var(--navy-primary); padding: 14px 18px; margin: 14px -18px -18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
body.dark-mode .txn-preview h4, body.dark-mode .txn-impact b, body.dark-mode .txn-calc .txn-total td { color: #9fd0ff; }
body.dark-mode .txn-invalid { background: #3a1a18; color: #f5b7b1; }
@media (max-width: 992px) { .modal-txn { width: 95%; } .txn-split { grid-template-columns: 1fr; } .txn-form, .txn-preview { max-height: none; } }

/* ===== DaisyUI-style Top Navbar — the ONLY top bar on a page ===== */
.navbar { display: flex; align-items: center; gap: 8px; background: var(--bg-card); box-shadow: 0 2px 6px var(--shadow-color); border-radius: 3px; padding: 8px 14px; margin-bottom: 15px; position: relative; z-index: 200; }
.navbar-start { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.navbar-end { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav-page { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-left: 4px; }
.nav-page-title { font-size: 18px; font-weight: 700; color: var(--navy-primary); display: flex; align-items: center; gap: 9px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-page-title i { color: var(--navy-accent); font-size: 16px; }
.nav-crumb { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.nav-crumb i { font-size: 10px; color: var(--navy-accent); }
.nav-crumb a { color: inherit; text-decoration: none; }
.nav-crumb a:hover { color: var(--navy-accent); }
.nav-crumb-sep { color: var(--border-color); }
.nav-welcome { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: 6px; }
.nav-welcome-hi { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); font-weight: 600; }
.nav-welcome strong { font-size: 14px; color: var(--navy-primary); font-weight: 600; }
.nav-btn { width: 40px; height: 40px; border: none; background: transparent; border-radius: 3px; color: var(--text-secondary); font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; transition: background 0.2s; }
.nav-btn:hover { background: var(--bg-primary); color: var(--navy-primary); }
.nav-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 3px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nav-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--navy-accent); object-fit: cover; cursor: pointer; }
.nav-sep { width: 1px; height: 26px; background: var(--border-color); margin: 0 2px; }

/* navbar dropdowns */
.nav-dd { position: relative; }
.nav-dd-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 3px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); padding: 8px; display: none; z-index: 300; }
.nav-dd.open .nav-dd-menu { display: block; }
.nav-dd-menu a, .nav-dd-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: none; border-radius: 3px; font-size: 14px; color: var(--text-primary); cursor: pointer; text-align: left; text-decoration: none; }
.nav-dd-menu a:hover, .nav-dd-menu button:hover { background: var(--bg-primary); color: var(--navy-primary); }
.nav-dd-menu .dd-badge { background: var(--navy-accent); color: #fff; border-radius: 3px; padding: 2px 7px; font-size: 11px; font-weight: 700; }
.nav-dd-head { padding: 10px 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 6px; }
.nav-dd-head .dd-title { font-size: 15px; font-weight: 700; color: var(--navy-primary); }
.nav-dd-head .dd-sub { font-size: 12.5px; color: var(--navy-accent); margin-top: 2px; }
.nav-dd-foot { padding: 8px 4px 2px; }
.nav-dd-foot .btn-block { width: 100%; background: var(--navy-primary); color: #fff; border: none; padding: 10px; border-radius: 3px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.nav-dd-foot .btn-block:hover { background: var(--navy-hover); }
.nav-notif { display: flex; gap: 10px; padding: 9px 10px; border-radius: 3px; font-size: 13px; color: var(--text-primary); }
.nav-notif:hover { background: var(--bg-primary); }
.nav-notif i { color: var(--navy-accent); margin-top: 2px; }

/* page-action button cluster (RS.pageActions renders into #pageActions) */
.page-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.page-actions:empty { display: none; }
.pa-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.pa-btn:hover { border-color: var(--navy-accent); color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.06); }
.pa-btn i { font-size: 13px; }
.pa-btn.pa-primary { background: var(--navy-primary); border-color: var(--navy-primary); color: #fff; }
.pa-btn.pa-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: #fff; }
.pa-btn.pa-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.pa-btn.pa-danger:hover { filter: brightness(1.08); color: #fff; }
.pa-btn[disabled] { opacity: 0.6; pointer-events: none; }
.pa-count { background: rgba(255, 255, 255, 0.22); border-radius: 3px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
/* the bell/theme/lang cluster shipped by notifications_bell.php sits in the navbar-end row
   (.header-right already carries position:relative + z-index:900 above — don't redefine it) */
.navbar .header-right { gap: 4px; }
.navbar .header-right > div:last-child { display: none; } /* welcome already shown in .nav-welcome */

@media (max-width: 992px) { .navbar { flex-wrap: wrap; } .navbar-end { width: 100%; justify-content: flex-start; } }
@media (max-width: 768px) { .nav-crumb { display: none; } .nav-welcome { display: none; } .nav-page-title { font-size: 16px; } .pa-btn span { display: none; } .pa-btn { padding: 0 11px; } }

/* ===== Sidebar dropdown groups (rides the template's .has-submenu markup) ===== */






/* ===== SLA countdown widget ===== */
.sla-clock { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 3px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: #e2f6ea; color: #1f8b4c; border: 1px solid #c7eed6; white-space: nowrap; }
.sla-clock i { font-size: 11px; }
.sla-clock.is-warn { background: #fdecd6; color: #c4701a; border-color: #f8dab4; }
.sla-clock.is-breached { background: #fdecea; color: #c0392b; border-color: #f7cdc7; }
.sla-clock.is-paused { background: #eef1f4; color: #5a6672; border-color: #dfe4ea; }
.sla-clock.is-done { background: #e6edf6; color: #0b2545; border-color: #d3deec; }
.sla-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; background: rgba(0, 0, 0, 0.08); }
.sla-widget { display: flex; flex-direction: column; gap: 8px; }
.sla-widget-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-secondary); }
.sla-widget-row b { color: var(--text-primary); }
.sla-meter { height: 6px; border-radius: 3px; background: var(--border-light); overflow: hidden; }
.sla-meter > span { display: block; height: 100%; background: var(--success); transition: width 0.4s; }
.sla-meter.is-warn > span { background: var(--warning); }
.sla-meter.is-breached > span { background: var(--danger); }
body.dark-mode .sla-clock { background: #12301f; color: #7ee2a8; border-color: #1d4a30; }
body.dark-mode .sla-clock.is-warn { background: #33290d; color: #f5c877; border-color: #4a3c12; }
body.dark-mode .sla-clock.is-breached { background: #3a1a18; color: #f5b7b1; border-color: #55231f; }
body.dark-mode .sla-clock.is-paused, body.dark-mode .sla-clock.is-done { background: #2a3240; color: #cbd5e1; border-color: #3a4454; }

/* ===== Ticket conversation thread ===== */
.tkt-thread { display: flex; flex-direction: column; gap: 16px; }
.tkt-msg { display: flex; gap: 12px; padding: 14px 16px; border-radius: 3px; border: 1px solid var(--border-color); border-left: 4px solid var(--border-color); background: var(--bg-card); }
.tkt-msg.is-customer { border-left-color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), 0.04); }
.tkt-msg.is-agent { border-left-color: var(--success); background: rgba(52, 168, 83, 0.05); }
.tkt-msg.is-note { border-left-color: var(--warning); background: rgba(251, 188, 4, 0.09); border-style: dashed; }
.tkt-msg.is-system { border-left-color: #9aa6b2; background: var(--bg-primary); font-style: italic; }
.tkt-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--border-color); background: var(--bg-primary); display: flex; align-items: center; justify-content: center; color: var(--navy-primary); font-weight: 700; font-size: 14px; }
.tkt-msg-main { flex: 1; min-width: 0; }
.tkt-msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.tkt-msg-who { font-size: 13.5px; font-weight: 700; color: var(--navy-primary); }
.tkt-msg-time { font-size: 11.5px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.tkt-msg-body { font-size: 14px; line-height: 1.65; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.tkt-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tkt-att { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-primary); font-size: 12px; color: var(--text-secondary); text-decoration: none; max-width: 240px; }
.tkt-att:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.tkt-att i { color: var(--navy-accent); }
.tkt-att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkt-att-img { width: 72px; height: 72px; border-radius: 3px; object-fit: cover; border: 1px solid var(--border-color); cursor: pointer; }
.tkt-reply-box { border: 1px solid var(--border-color); border-radius: 3px; padding: 14px; background: var(--bg-card); }
.tkt-reply-box.is-note { border-color: var(--warning); background: rgba(251, 188, 4, 0.06); }
.tkt-reply-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.tkt-empty { text-align: center; color: var(--text-muted); padding: 34px 20px; font-size: 14px; }
.tkt-empty i { font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.5; }
body.dark-mode .tkt-msg-who { color: #9fd0ff; }

/* ===== Timeline list ===== */
.tkt-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tkt-timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border-light); }
.tkt-tl-item { position: relative; display: flex; gap: 12px; padding: 0 0 16px 0; }
.tkt-tl-item:last-child { padding-bottom: 0; }
.tkt-tl-ico { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--navy-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; z-index: 1; }
.tkt-tl-ico.is-good { background: var(--success); }
.tkt-tl-ico.is-warn { background: var(--warning); color: #1f2d3d; }
.tkt-tl-ico.is-bad { background: var(--danger); }
.tkt-tl-body { flex: 1; min-width: 0; font-size: 13px; color: var(--text-primary); line-height: 1.5; padding-top: 4px; }
.tkt-tl-body b { color: var(--navy-primary); }
.tkt-tl-time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.tkt-tl-old { text-decoration: line-through; color: var(--text-muted); }
body.dark-mode .tkt-tl-body b { color: #9fd0ff; }

/* ===== Star rating control ===== */
.star-rate { display: inline-flex; align-items: center; gap: 6px; }
.star-rate button { background: none; border: none; padding: 0; font-size: 30px; line-height: 1; color: #d8dee6; cursor: pointer; transition: transform 0.15s, color 0.15s; }
.star-rate button:hover { transform: scale(1.15); }
.star-rate button.on { color: #f5b301; }
.star-rate button:focus-visible { outline: 2px solid var(--navy-accent); outline-offset: 2px; border-radius: 3px; }
.star-rate.is-readonly button { cursor: default; pointer-events: none; }
.star-rate.is-sm button { font-size: 15px; }
.star-rate-value { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-left: 4px; }
body.dark-mode .star-rate button { color: #3d3d7a; }

/* ===== Knowledge Base tiles + FAQ accordion ===== */
.kb-hero { background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); border-radius: 3px; padding: 34px 24px; text-align: center; color: #fff; margin-bottom: 22px; }
.kb-hero h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.kb-hero p { font-size: 14px; opacity: 0.85; margin-bottom: 18px; }
.kb-hero-search { position: relative; max-width: 560px; margin: 0 auto; }
.kb-hero-search input { width: 100%; height: 48px; padding: 0 16px 0 44px; border: none; border-radius: 3px; font-size: 16px; color: var(--text-primary); background: #fff; }
.kb-hero-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--navy-accent); }
.kb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.kb-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-card); text-decoration: none; text-align: center; transition: all 0.2s; }
.kb-tile:hover { border-color: var(--navy-accent); box-shadow: 0 4px 14px var(--shadow-color); transform: translateY(-2px); }
.kb-tile-ico { width: 48px; height: 48px; border-radius: 3px; background: rgba(var(--navy-accent-rgb), 0.12); color: var(--navy-accent); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.kb-tile-name { font-size: 14.5px; font-weight: 700; color: var(--navy-primary); }
.kb-tile-count { font-size: 12px; color: var(--text-muted); }
.kb-result { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border-light); text-decoration: none; }
.kb-result:hover { background: var(--bg-primary); }
.kb-result-title { font-size: 15px; font-weight: 700; color: var(--navy-primary); margin-bottom: 4px; }
.kb-result-meta { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.kb-result-snippet { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.kb-article-body { font-size: 15px; line-height: 1.8; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.kb-faq { border: 1px solid var(--border-color); border-radius: 3px; overflow: hidden; }
.kb-faq-item + .kb-faq-item { border-top: 1px solid var(--border-light); }
.kb-faq-q { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: none; background: var(--bg-card); color: var(--text-primary); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.kb-faq-q:hover { background: var(--bg-primary); }
.kb-faq-q i { color: var(--navy-accent); font-size: 12px; margin-left: auto; transition: transform 0.25s; }
.kb-faq-item.open .kb-faq-q i { transform: rotate(45deg); }
.kb-faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; font-size: 13.5px; line-height: 1.7; color: var(--text-secondary); padding: 0 16px; }
.kb-faq-item.open .kb-faq-a { max-height: 900px; padding: 0 16px 16px; }
.kb-vote { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); }
body.dark-mode .kb-tile-name, body.dark-mode .kb-result-title { color: #9fd0ff; }

/* ===== Welcome Tour ===== */
.tour-ico { width: 74px; height: 74px; margin: 0 auto; border-radius: 3px; background: linear-gradient(135deg, var(--navy-accent), var(--navy-light)); color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(var(--navy-accent-rgb), 0.35); }
.tour-modal { max-width: 430px; }
.tour-body { text-align: center; padding: 30px 26px 20px; }
.tour-body h3 { color: var(--navy-primary); margin: 14px 0 8px; font-size: 19px; }
.tour-body p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.tour-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-color); cursor: pointer; transition: all 0.2s; }
.tour-dots span.on { background: var(--navy-accent); width: 20px; border-radius: 3px; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 26px 24px; }
body.dark-mode .tour-body h3 { color: #9fd0ff; }

/* ===== Demo Quick-Add (injector in sidebar.php) ===== */
.modal-head-tools { display: flex; align-items: center; gap: 2px; }
.demo-seed-btn { font-size: 19px; opacity: 0.7; }
.demo-seed-btn:hover { opacity: 1; color: var(--warning); transform: none; }

/* ===== Reduced motion — kill the decorative loops, keep the states ===== */
@media (prefers-reduced-motion: reduce) {
    .top-loadbar > span { animation-duration: 2.6s; }
    .action-loader img { animation: none; }
    .action-loader-bar::after { animation-duration: 2.4s; }
    .kb-tile:hover, .star-rate button:hover, .act:hover, .chip.is-btn:hover { transform: none; }
    .sd-panel, .kb-faq-a, .sla-meter > span { transition: none; }
}

/* member avatar stack (departments) */
.avatar-stack { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.avatar-stack .media-box { margin: 0; }
.avatar-stack .lead-star { color: #f0ad4e; font-size: 11px; margin-left: -4px; }
.avatar-stack-more { font-size: 11px; color: var(--text-muted, #6c757d); font-weight: 600; }
body.dark-mode .avatar-stack-more { color: #9aa4b2; }

/* AdminLTE info-box — secondary KPI strip on inner pages */
.info-box { display: flex; align-items: center; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); padding: 12px; min-height: 80px; }
.info-box-icon { width: 56px; height: 56px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; background: var(--navy-primary); }
.info-box-icon.bg-navy, .info-box-icon.bg-info, .info-box-icon.bg-success,
.info-box-icon.bg-warning, .info-box-icon.bg-danger { color: #fff; }
.info-box-icon.bg-warning { color: #1f2d3d; }
.info-box-content { padding-left: 12px; flex: 1; min-width: 0; }
.info-box-text { text-transform: uppercase; font-size: 12px; color: #666; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-box-number { font-size: 20px; font-weight: 700; color: var(--navy-primary); line-height: 1.25; }
.info-box-sub { font-size: 11px; color: #8a939f; margin-top: 2px; }
.info-box.is-danger .info-box-number { color: var(--danger, #c5221f); }
.info-box.is-warn   .info-box-number { color: #b7791f; }
body.dark-mode .info-box { background: var(--card-bg, #1e2530); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
body.dark-mode .info-box-text { color: #9aa4b2; }
body.dark-mode .info-box-number { color: #e8edf4; }
body.dark-mode .info-box-sub { color: #7d8798; }

/* two-column page split (ticket detail / new ticket) — same rhythm as .txn-split */
.tkt-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 992px) { .tkt-split { grid-template-columns: 1fr; } }

/* narrow numeric cell input (SLA matrix h/m, warn %) */
.mini-num { width: 72px; min-width: 72px; max-width: 72px; height: 30px; padding: 4px 6px; text-align: center;
  border: 1px solid var(--border-color, #d9dee5); border-radius: 3px; font-size: 13px; background: #fff; color: #22262e; }
.mini-num:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb), .18); }
.mini-num:disabled { background: #f2f4f7; color: #8a939f; cursor: not-allowed; }
body.dark-mode .mini-num { background: #232b36; border-color: #39424f; color: #e8edf4; }
body.dark-mode .mini-num:disabled { background: #1b212a; color: #6f7887; }

/* row tints outside the chip table (panel/compact tables) */
tr.row-good td { background: rgba(46,139,70,.10) !important; }
tr.row-bad  td { background: rgba(197,34,31,.10) !important; }
tr.row-wait td { background: rgba(224,168,0,.13) !important; }
body.dark-mode tr.row-good td { background: rgba(46,139,70,.20) !important; }
body.dark-mode tr.row-bad  td { background: rgba(197,34,31,.22) !important; }
body.dark-mode tr.row-wait td { background: rgba(224,168,0,.20) !important; }

/* placeholder chip row under a canned-response body */
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ph-chips .chip.is-btn { cursor: pointer; border: none; }
.ph-chips .chip.is-btn:hover { filter: brightness(1.08); }

/* contact button variants — Let's Work Together block */
.dev-link.telegram { background: #229ED9; color: #fff; }
.dev-link.telegram:hover { background: #1B87BA; transform: translateY(-2px); }
.dev-link.email { background: var(--navy-primary); color: #fff; }
.dev-link.email:hover { background: var(--navy-light, #003366); transform: translateY(-2px); }

/* login footer contact row */
.login-contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 14px 0 4px; }
.login-contact-title { width: 100%; text-align: center; font-size: 13px; font-weight: 600; opacity: .85; margin-bottom: 2px; }
.login-contact .dev-link { padding: 8px 14px; font-size: 13px; }
@media (max-width: 480px) { .login-contact .dev-link { flex: 1 1 auto; justify-content: center; } }

/* completes the documented soft chip palette */
.chip-soft-teal { background: #d9f2f2; color: #17696b; border-color: #bde5e5; }
body.dark-mode .chip-soft-teal { background: #14343a; color: #7fd6d6; border-color: #1e4a51; }

/* print — reports and any card page print as content, not as an app */
@media print {
    .sidebar, .navbar, .mobile-bottom-nav, .mobile-menu-btn-old, .sidebar-overlay,
    .filters-section, .page-actions, #pageActions, .dt-buttons, .dataTables_filter,
    .dataTables_length, .dataTables_paginate, .dataTables_info, .top-loadbar,
    .action-loader, .actions-cell, .col-actions, .bulk-check, .swal2-container { display: none !important; }
    .app-container { display: block !important; }
    .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .lte-card, .info-box, .small-box { break-inside: avoid; page-break-inside: avoid; box-shadow: none !important; border: 1px solid #ccc !important; }
    .lte-card.collapsed .lte-card-body { display: block !important; }
    .lte-card-tools { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    a[href]:after { content: ""; }
}

/* helpdesk role badges — keys: Admin(super) HelpdeskAdmin Manager Agent User */
.role-helpdeskadmin { background: #d1e7f7; color: #0b4a72; }
.role-manager       { background: #e2d9f3; color: #4a2b82; }
.role-agent         { background: #fde7c9; color: #8a4b08; }
body.dark-mode .role-admin         { background: #1d3a26; color: #8fe0a8; }
body.dark-mode .role-helpdeskadmin { background: #16334a; color: #8ec9f0; }
body.dark-mode .role-manager       { background: #2c2247; color: #c3aef0; }
body.dark-mode .role-agent         { background: #43300f; color: #f0c48e; }
body.dark-mode .role-user          { background: #14304d; color: #96c6f5; }

/* ===== 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(--accent-ink); 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(--accent-ink); 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(--accent-ink); 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; } }


/* ===== 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.row-bad { background: color-mix(in srgb, var(--danger) 9%, var(--bg-card)); }
.tabulator-row.row-wait { background: color-mix(in srgb, var(--warning) 11%, var(--bg-card)); }
.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: 4px 10px; margin: 0 2px; font-size: 12.5px; }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--navy-accent); border-color: var(--navy-accent); color: var(--on-accent); }
.tabulator .tabulator-footer .tabulator-page:not(:disabled):not(.active):hover { border-color: var(--navy-accent); color: var(--accent-ink); 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: 6px; }
.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: 6px 10px; }
.tabulator-edit-list .tabulator-edit-list-item.active, .tabulator-edit-list .tabulator-edit-list-item:hover { background: var(--navy-accent) !important; color: var(--on-accent) !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: 8px 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: #3a3a3a; stroke: #555555; }

/* 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: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-right: 4px; }
.tb-bulk-n i { color: var(--accent-ink); }
.tb-bulk-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 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(--accent-ink); }
.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(--accent-ink); 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 6px; border-radius: 3px; font-size: 10.5px; font-weight: 700;
          background: rgba(var(--navy-accent-rgb), .14); color: var(--accent-ink); 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(--accent-ink); text-decoration: none; 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(--accent-ink); }
@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(--accent-ink); 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; }
}


/* ===== 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: 14px 24px; }
.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: 20px 24px; }
.split-form .form-grid { gap: 18px; }
.split-preview {
    min-height: 0; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px;
    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: 14px 24px;
    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: 8px; 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 10px; font-size: 12px; font-weight: 700; color: var(--accent-ink); 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: 8px 12px; 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(--accent-ink); }
.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: 12px 16px 0; padding: 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);
    }
    .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(--accent-ink); 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(--accent-ink) !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; }
/* one row, one height: every form control 40px on desktop, 44px tap height on phones (app pages + modals) */
:is(.main-content, .modal) .form-group :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]), select, .sd-trigger) { height: 40px; min-height: 40px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
@media (max-width: 768px) { :is(.main-content, .modal) .form-group :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]), select, .sd-trigger) { height: 44px; min-height: 44px; } }


/* ===== 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: 8px 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; white-space: normal; overflow-wrap: anywhere; }   /* tabulator's table is nowrap — folded values must wrap */
    .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(--accent-ink);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.set-link:hover { text-decoration: none; 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; } }


/* ===== Popups — rsPop dialog + corner toasts (every alert, confirm and prompt in the app) ===== */
.rs-pop-wrap { position: fixed; inset: 0; z-index: 12000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .45); animation: rsPopFade .16s ease-out; }
.dark-mode .rs-pop-wrap { background: rgba(0, 0, 0, .65); }
.rs-pop-wrap.out { opacity: 0; transition: opacity .15s; }
body.rs-pop-open { overflow: hidden; }
body.rs-pop-open .sd-panel, body.rs-pop-open .searchable-dropdown-list { z-index: 12100; }   /* searchable picker inside a popup */
.rs-pop { --pop-c: var(--navy-accent); position: relative; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
    padding: 24px; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--r-panel, 4px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .22); animation: rsPopRise .2s cubic-bezier(.4, 0, .2, 1); }
.rs-pop-success { --pop-c: var(--success); }
.rs-pop-error { --pop-c: var(--danger); }
.rs-pop-warning { --pop-c: color-mix(in srgb, var(--warning) 78%, var(--text-primary)); }
.rs-pop-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0;
    background: transparent; color: var(--text-muted); font-size: 16px; border-radius: var(--r-ctrl, 3px); cursor: pointer; }
.rs-pop-x:hover, .rs-pop-x:focus-visible { background: rgba(var(--navy-accent-rgb), .08); color: var(--text-primary); }
.rs-pop-head { display: flex; align-items: flex-start; gap: 14px; padding-right: 28px; }
.rs-pop-ico { flex: 0 0 40px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 17px;
    color: var(--pop-c); background: color-mix(in srgb, var(--pop-c) 14%, transparent); }
.rs-pop-ico + .rs-pop-hd { padding-top: 8px; }
.rs-pop-hd { min-width: 0; flex: 1; }
.rs-pop-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--text-primary); overflow-wrap: anywhere; }
.rs-pop-title:empty { display: none; }
.rs-pop-text { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.rs-pop-body { margin-top: 14px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.rs-pop-body:empty { display: none; }
.rs-pop-body > :last-child { margin-bottom: 0; }
.rs-pop-body a:not(.btn) { color: var(--navy-accent); font-weight: 600; text-decoration: none; }
.rs-pop-field { margin-top: 4px; }
.rs-pop-body > .rs-pop-field:first-child { margin-top: 0; }
.rs-pop-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rs-pop-input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text-primary);
    background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--r-ctrl, 3px); }
textarea.rs-pop-input { min-height: 96px; line-height: 1.5; resize: vertical; }
.rs-pop-input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15); }
.rs-pop-input[aria-invalid="true"] { border-color: var(--danger); }
.rs-pop .sd-wrap { width: 100%; }
.rs-pop .sd-trigger { min-height: 44px; font-size: 16px; }
.rs-pop-msg { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; font-size: 13.5px; color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent); border-radius: var(--r-ctrl, 3px); }
.rs-pop-msg[hidden] { display: none; }
/* how to fix it — numbered steps under the message */
.rs-pop-help { margin-top: 2px; padding: 12px 14px; background: rgba(var(--navy-accent-rgb), .06); border: 1px solid rgba(var(--navy-accent-rgb), .16); border-radius: var(--r-panel, 4px); }
.rs-pop-field + .rs-pop-help, .rs-pop-p + .rs-pop-help { margin-top: 12px; }
.rs-pop-help-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--navy-accent); }
.rs-pop-help ol { counter-reset: st; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.rs-pop-help li { counter-increment: st; position: relative; padding-left: 28px; font-size: 14px; line-height: 1.5; color: var(--text-primary); }
.rs-pop-help li::before { content: counter(st); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 700; color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .14); border-radius: var(--r-chip, 3px); }
.rs-pop-help b { color: var(--text-primary); }
.rs-pop-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.rs-pop-foot:empty { display: none; }
.rs-pop-foot .btn { min-height: 40px; text-decoration: none; }
.rs-pop-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color) !important; }
.rs-pop-ghost:hover { background: rgba(var(--navy-accent-rgb), .06); }
.rs-pop-alt { background: transparent; color: var(--navy-accent); border: 1px solid rgba(var(--navy-accent-rgb), .45) !important; }
.rs-pop-alt:hover { background: rgba(var(--navy-accent-rgb), .08); }
/* busy bar — only when the page has no write overlay to hand over to */
.rs-pop-wait { display: none; position: relative; width: 160px; height: 3px; margin: 18px auto 2px; overflow: hidden; border-radius: 3px; background: rgba(var(--navy-accent-rgb), .15); }
.rs-pop-wait i { position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--navy-accent); animation: rsPopBar 1s linear infinite; }
.rs-pop-busy .rs-pop-wait { display: block; }
.rs-pop-busy .rs-pop-foot, .rs-pop-busy .rs-pop-x { display: none; }
/* content helpers for html popups */
.rs-pop-list { margin: 0; padding-left: 18px; text-align: left; font-size: 13px; }
.rs-pop-p { margin: 0 0 10px; text-align: left; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.rs-pop-pre { margin: 0 0 10px; padding: 10px 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; text-align: left; font: inherit; font-size: 13.5px; line-height: 1.5;
    color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--r-ctrl, 3px); }
/* toasts — top right, phones full width under the status bar */
.rs-toasts { position: fixed; top: 16px; right: 16px; z-index: 12500; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.rs-toast { --pop-c: var(--navy-accent); display: flex; align-items: center; gap: 12px; padding: 12px 14px; pointer-events: auto; cursor: pointer; color: var(--text-primary);
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-panel, 4px); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); animation: rsToastIn .2s ease-out; }
.rs-toast .rs-pop-ico { flex-basis: 30px; width: 30px; height: 30px; font-size: 13px; }
.rs-toast b { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.rs-toast p { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); }
.rs-toast.out { opacity: 0; transform: translateX(12px); transition: opacity .18s, transform .18s; }
@keyframes rsPopFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rsPopRise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes rsPopUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rsToastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes rsPopBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (max-width: 600px) {   /* bottom sheet */
    .rs-pop-wrap { align-items: flex-end; padding: 0; }
    .rs-pop { max-width: none !important; max-height: 88dvh; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); animation-name: rsPopUp; }
    html[data-shape] .rs-pop-wrap .rs-pop { border-radius: var(--r-panel, 4px) var(--r-panel, 4px) 0 0 !important; }   /* sheet: flat bottom edge */
    .rs-pop-foot { flex-direction: column; }
    .rs-pop-foot .btn { width: 100%; min-height: 46px; }
    .rs-pop-foot .btn-primary, .rs-pop-foot .btn-danger { order: -1; }
    .rs-pop-foot .rs-pop-close { order: 1; }
    .rs-toasts { top: calc(10px + env(safe-area-inset-top)); left: 16px; right: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .rs-pop-wrap, .rs-pop, .rs-toast { animation: none; } .rs-pop-wait i { animation-duration: 2.5s; } }


/* ===== modal stack + 360° View ===== */
body.rs-locked { overflow: hidden; }
.rs-layer { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }   /* one dimmer PER layer — the parent stays visibly dimmed */
.dark-mode .rs-layer { background: rgba(0, 0, 0, .7); }
.v360 { width: 90vw; max-width: 90vw; height: 90vh; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; padding: 0; background: var(--bg-card); border-radius: var(--r-panel); }
/* header band — palette primary like the modal headers; Soft style turns it light. Band colours derive from its own ink (currentColor) */
.v360-head { --hd-bg: var(--navy-primary); --hd-ink: var(--on-accent); --hd-pill: var(--bg-card); --hd-btn: var(--bg-card); --hd-btn-ink: var(--navy-primary);
    display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-shrink: 0; background: var(--hd-bg); color: var(--hd-ink); }
body.dark-mode .v360-head { --hd-bg: var(--navy-light); --hd-btn: var(--navy-accent); --hd-btn-ink: var(--on-accent); }
html[data-ui="soft"] .v360-head { --hd-bg: var(--bg-card); --hd-ink: var(--text-primary); --hd-pill: transparent; --hd-btn: var(--navy-accent); --hd-btn-ink: var(--on-accent); border-bottom: 1px solid var(--border-color); }
.v360-nav { display: flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.v360-nav span { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; opacity: .8; }
.v360-nav button { width: 32px; height: 32px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: var(--r-ctrl); background: none; color: inherit; cursor: pointer; }
.v360-nav button:not(:disabled):hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.v360-nav button:disabled { opacity: .35; cursor: default; }
.v360-avatar { width: 50px; height: 50px; flex-shrink: 0; border-radius: var(--r-ctrl); display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: 21px; color: inherit; background: color-mix(in srgb, currentColor 14%, transparent); }
html[data-ui="soft"] .v360-avatar { color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .1); }
.v360-avatar img { width: 100%; height: 100%; object-fit: cover; }
.v360-id { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, max-content) 1fr; align-items: center; gap: 4px 12px; }
.v360-id h3 { grid-area: 1 / 1; margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v360-id [data-state] { grid-area: 1 / 2; justify-self: start; }
.v360-id small { grid-area: 2 / 1 / 3 / 3; font-size: 13px; color: inherit; opacity: .78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v360-head .st { box-shadow: inset 0 0 0 40px var(--hd-pill); }   /* solid pill on the band, its ink keeps the meaning; Soft = the normal tint */
.v360-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.v360-tools .btn { min-height: 38px; padding: 0 14px; }
.v360-tools :is([data-print], [data-menu]) { width: 38px; padding: 0; }
/* buttons: one height, no hover jump, a clear focus ring; on the band the primary is the band's light button (never band-on-band), the rest outlined in its ink */
.v360 .btn { height: 38px; min-height: 38px; box-sizing: border-box; border: 1px solid transparent; transform: none; }
.v360 .btn:hover { transform: none; }
.v360 :is(.btn, .close-btn, .v360-nav button):focus-visible { outline: 2px solid var(--navy-accent); outline-offset: 2px; }
.v360-head :is(.btn, .close-btn, .v360-nav button):focus-visible { outline-color: var(--hd-ink); }
.v360-head .btn-primary { background: var(--hd-btn); color: var(--hd-btn-ink); box-shadow: none; }
.v360-head .btn-primary:hover { background: var(--hd-btn); filter: brightness(.94); }
.v360-head .btn-secondary { background: none; color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); box-shadow: none; }
.v360-head .btn-secondary:hover, .v360-head .btn-secondary:focus-visible { background: color-mix(in srgb, currentColor 14%, transparent); transform: none; }
.v360-head .close-btn { width: 38px; height: 38px; margin-left: 4px; font-size: 18px; color: inherit; border-radius: var(--r-ctrl); background: color-mix(in srgb, currentColor 14%, transparent); }
.v360-head .close-btn:hover, .v360-head .close-btn:focus-visible { background: color-mix(in srgb, currentColor 24%, transparent); transform: none; }
/* body — the record LEFT (about 40 %), its datasets RIGHT on the page canvas */
.v360-body { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(360px, 40%, 760px) minmax(0, 1fr); }
.v360-side { overflow-y: auto; padding: 20px; border-right: 1px solid var(--border-color); background: var(--bg-card); display: flex; flex-direction: column; gap: 16px; container-type: inline-size; scrollbar-gutter: stable; }
.v360-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* each tile carries its colour (--k): a solid icon square, the tile a light wash of the same colour */
.v360-kpi { --k: var(--navy-accent); display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--k) 24%, var(--border-color)); border-radius: var(--r-panel);
    background: color-mix(in srgb, var(--k) 7%, var(--bg-card)); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.v360-kpi.c1, .v360-kpi.t-good { --k: var(--success); }
.v360-kpi.c2, .v360-kpi.t-warn { --k: var(--warning); }
.v360-kpi.c3 { --k: var(--navy-primary); }
.v360-kpi.t-danger { --k: var(--danger); }
.v360-kpi[disabled] { cursor: default; }
.v360-kpi:not([disabled]):hover { border-color: color-mix(in srgb, var(--k) 55%, var(--border-color)); background: color-mix(in srgb, var(--k) 12%, var(--bg-card)); }
.v360-kpi-ico { flex: 0 0 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-ctrl); font-size: 19px; color: var(--on-accent); background: var(--k); }
.v360-kpi-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.v360-kpi small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--k) 40%, var(--text-secondary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v360-kpi b { font-size: 20px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v360-kpi .is-danger { color: var(--danger-ink, var(--danger)); } .v360-kpi .is-warn { color: var(--warning-ink, var(--warning)); } .v360-kpi .is-good { color: var(--success-ink, var(--success)); }
.v360-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.v360-quick :is(a, button) { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border-color);
    border-radius: var(--r-ctrl); background: rgba(var(--navy-accent-rgb), .06); color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.v360-quick :is(a, button) { border-color: rgba(var(--navy-accent-rgb), .22); }
.v360-quick i { color: var(--navy-accent); }
.v360-quick :is(a, button):hover { border-color: var(--navy-accent); color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .12); }
/* details — titled cards, label left · value right; two cards a row once the pane is wide enough */
.v360-dhead { display: flex; align-items: center; gap: 8px; margin: 4px 0 -4px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.v360-dhead i { color: var(--navy-accent); }
.v360-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 540px) { .v360-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* each card a colour of its own (--g, cycling the four theme colours): light tinted title strip, faint matching border */
.v360-group { --g: var(--navy-accent); min-width: 0; padding: 0 16px 4px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--g) 20%, var(--border-color)); border-radius: var(--r-panel); background: var(--bg-card); }
.v360-group:nth-child(4n+2) { --g: var(--success); }
.v360-group:nth-child(4n+3) { --g: var(--warning); }
.v360-group:nth-child(4n+4) { --g: var(--navy-primary); }
.v360-group h5 { display: flex; align-items: center; gap: 8px; margin: 0 -16px; padding: 12px 16px; border-bottom: 1px solid color-mix(in srgb, var(--g) 20%, var(--border-color));
    background: color-mix(in srgb, var(--g) 8%, var(--bg-card)); font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.v360-group h5 i { font-size: 13px; color: color-mix(in srgb, var(--g) 85%, var(--text-primary)); }
.v360-details { margin: 0; font-size: 13.5px; }
.v360-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.v360-details > div:last-child { border-bottom: 0; }
.v360-details dt { flex-shrink: 0; color: var(--text-muted); font-weight: 500; }
.v360-details dd { margin: 0; min-width: 0; text-align: right; color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
.v360-details dd .st { font-size: 12px; }
.v360-details > .empty { display: none; }
.v360-side.show-empty .v360-details > .empty { display: flex; }
.v360-side:not(.show-empty) .v360-group:not(:has(.v360-details > div:not(.empty))) { display: none; }   /* a card with nothing filled in waits for Show empty fields */
.v360-meta { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--border-color); font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.v360-body .btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-color); box-shadow: none; }
.v360-body .btn-secondary:hover, .v360-body .btn-secondary:focus-visible { background: rgba(var(--navy-accent-rgb), .06); color: var(--navy-accent); border-color: rgba(var(--navy-accent-rgb), .45); transform: none; }
.v360-side [data-show-empty] { align-self: flex-start; min-height: 34px; padding: 0 12px; font-size: 12.5px; }
/* tabs — state by colour, no underline bar */
.v360-main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-primary); }
.v360-tabs { display: flex; gap: 2px; padding: 8px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.v360-tabs button { display: flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 40px; border: 1px solid transparent; border-radius: var(--r-ctrl); background: none; color: var(--text-secondary);
    font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.v360-tabs button:hover { background: rgba(var(--navy-accent-rgb), .06); }
.v360-tabs button.active { color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .1); }
.v360-tabs em { font-style: normal; font-size: 11.5px; min-width: 20px; padding: 1px 6px; text-align: center; border-radius: var(--r-chip); color: var(--text-muted); background: rgba(var(--navy-accent-rgb), .08); }
.v360-tabs em:empty { display: none; }
.v360-tabs button.active em { color: var(--navy-accent); }
.v360-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; scrollbar-gutter: stable; }
/* tab bar: figures + chevrons LEFT | the tab's actions + exports RIGHT */
.v360-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.v360-bar:has(> .v360-left > .v360-figs:empty):has(> .v360-left > .v360-pipe:empty):has(> .v360-acts:empty) { display: none; }   /* nothing to show (the phone Details tab): no gap
.v360-left { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.v360-figs:not(:empty) { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-secondary); }
.v360-figs b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.v360-pipe .pipeline-stages { display: inline-flex; width: auto; max-width: 100%; margin: 0; vertical-align: top; }
.v360-pipe .pipeline-stage { flex: 0 0 auto; min-height: 36px; padding: 8px 24px 8px 32px; }
.v360-pipe .pipeline-stage:first-child { padding-left: 16px; }
.v360-pipe .pipeline-stage-count { font-size: 13px; }
.v360-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.v360-acts .btn { min-height: 38px; padding: 0 12px; }
.v360-acts .btn.icon { width: 38px; padding: 0; }
.v360-acts .sep { width: 1px; height: 24px; margin: 0 4px; background: var(--border-color); }
.v360-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-color); border-radius: var(--r-panel); background: var(--bg-card); }
.v360-empty[hidden] { display: none; }   /* display:flex above beats the hidden attribute */
.v360-empty i { font-size: 30px; color: rgba(var(--navy-accent-rgb), .5); }
.v360-empty p { margin: 0; font-size: 14.5px; color: var(--text-secondary); }
.v360-pane .v360-groups { max-width: 760px; }
@media (max-width: 991px) {   /* full-screen sheet; the tab strip scrolls, the page never does */
    .rs-layer.v360-layer { padding: 0; align-items: stretch; }
    .v360 { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
    .v360-head { flex-wrap: wrap; gap: 10px 12px; padding: calc(10px + env(safe-area-inset-top)) 12px 12px; }
    .v360-nav { order: -1; width: 100%; justify-content: center; }
    .v360-nav button { width: 44px; height: 44px; }
    .v360-tools { width: 100%; }
    .v360-tools .btn-primary { flex: 1; }
    .v360 .btn, .v360-head .close-btn { min-height: 44px; }
    .v360-tools :is([data-print], [data-menu]), .v360-head .close-btn { width: 44px; height: 44px; }
    .v360-body { display: flex; flex-direction: column; overflow-y: auto; }
    .v360-side { overflow: visible; padding: 14px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--border-color); }
    .v360-side :is(.v360-dhead, .v360-groups, [data-show-empty], .v360-meta) { display: none; }   /* details move into their own first tab on phones */
    .v360-kpi { gap: 10px; padding: 10px; }
    .v360-kpi-ico { flex-basis: 40px; height: 40px; font-size: 16px; }
    .v360-kpi b { font-size: 17px; }
    .v360-kpi small { white-space: normal; line-height: 1.25; }   /* the whole label, on two lines if it must */
    .v360-main, .v360-pane { overflow: visible; }
    .v360-pane { padding: 14px; }
    .v360-bar { flex-wrap: wrap; }
    .v360-acts { width: 100%; }
    .v360-acts .btn-primary { flex: 1; }
    .v360-acts .btn:not(.btn-primary):not(.more) { display: none; }   /* the rest live in the tab's ⋮ sheet */
}
@media (prefers-reduced-motion: reduce) { .rs-layer { animation: none; } }
/* the page's own add / edit modal opened from a 360 (its opener adds .above-layer while rsStack.depth() > 0) — above the layer, as wide as the 360 */
.modal-overlay.above-layer { z-index: 1200 !important; }
@media (min-width: 769px) { .modal-overlay.above-layer > .modal { width: 90vw; max-width: 90vw; } }


/* ===== page kit: tabs, menu, form pieces ===== */
.rs-tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 14px; border-bottom: 1px solid var(--border-color); }
.rs-tabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 4px 4px 0 0; }
.rs-tabs button:hover { color: var(--text-primary); background: rgba(var(--navy-accent-rgb), .06); }
.rs-tabs button.active { color: var(--on-accent, #fff); background: var(--navy-accent); }
.rs-menu { position: fixed; z-index: 2500; min-width: 180px; padding: 4px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.rs-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.rs-menu button:hover { background: rgba(var(--navy-accent-rgb), .08); }
.rs-menu button.danger, .rs-menu button.danger i { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .form-group { margin: 0; min-width: 0; }
.form-grid .span-2, .form-grid .form-section { grid-column: 1 / -1; }
.form-section { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding-top: 16px; border-top: 1px solid var(--border-color); font-size: 13.5px; color: var(--text-primary); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-help { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.req { color: var(--danger); }
.modal-head-tools { display: flex; align-items: center; gap: 6px; }
.modal:not(.modal-split) .modal-foot { padding: 12px 20px; }
.pv-card { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; }
.pv-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.pv-row:last-child { border-bottom: 0; }
.pv-row span { color: var(--text-muted); }
.pv-row b { min-width: 0; color: var(--text-primary); text-align: right; word-break: break-word; }
.pv-missing { padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-card); font-size: 13px; }
.pv-missing ul { margin: 6px 0 0 18px; color: var(--text-muted); }
@media (max-width: 768px) {
    .modal-split .split-tabs { display: flex; flex: none; }
    .modal-split .split-tabs button { flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--text-secondary); font: inherit; }
    .modal-split .split-tabs button.on { color: var(--text-primary); background: rgba(var(--navy-accent-rgb), .08); }
    .split-body { grid-template-columns: minmax(0, 1fr); }
    .modal-split .split-preview { display: none; }
    .modal-split.show-preview .split-preview { display: flex; border-left: 0; }
    .modal-split.show-preview .split-form { display: none; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ===== public pages: support form, tracking ===== */
.pub-body { min-height: 100vh; background: var(--bg-primary); color: var(--text-primary); overflow-y: auto; }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-primary); font-weight: 700; }
.pub-brand img { border-radius: 50%; object-fit: cover; }
.pub-nav { display: flex; gap: 16px; }
.pub-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text-secondary); font-size: 14px; }
.pub-main { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; }
.pub-hero { text-align: center; padding: 16px 0 4px; }
.pub-hero h1 { margin: 0 0 8px; font-size: 28px; }
.pub-hero p { margin: 0; color: var(--text-secondary); }
.pub-card { padding: 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 4px; }
.pub-card h2 { margin: 0 0 12px; font-size: 18px; }
.pub-center { text-align: center; }
.pub-center > i { font-size: 34px; color: var(--navy-accent); margin-bottom: 10px; }
.pub-center .btn { margin-top: 12px; }
.pub-trap { position: absolute; left: -9999px; }
.pub-hints { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px 12px; background: rgba(var(--navy-accent-rgb), .06); border-radius: 4px; font-size: 13px; }
.pub-ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pub-ticket-head h1 { margin: 2px 0 0; font-size: 20px; word-break: break-word; }
.pub-stars { display: flex; gap: 6px; margin-bottom: 12px; }
.pub-stars button { width: 44px; height: 44px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); border-radius: 4px; cursor: pointer; }
.pub-stars button.on { color: var(--navy-accent); border-color: var(--navy-accent); }
.pub-body input, .pub-body textarea { font-size: 16px; }
.tkt-msg-body.is-html { white-space: normal; }
.tkt-msg-body.is-html p { margin: 0 0 8px; }
.tkt-msg-body.is-html img { max-width: 100%; height: auto; }
.tkt-msg-body.is-html blockquote { margin: 6px 0; padding-left: 10px; color: var(--text-secondary); }
@media (max-width: 768px) { .pub-nav a span { display: none; } .pub-hero h1 { font-size: 23px; } }

.ch-code { margin: 0 0 6px; padding: 10px 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 4px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* ===== rich text editor ===== */
.rs-editor { border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-card); }
.rs-editor:focus-within { border-color: var(--navy-accent); }
.rs-ed-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border-color); }
.rs-ed-tools button { width: 36px; height: 36px; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.rs-ed-tools button:hover { background: rgba(var(--navy-accent-rgb), .1); color: var(--text-primary); }
.rs-ed-extra { display: inline-flex; gap: 4px; margin-left: auto; }
.rs-ed-extra button { width: auto; padding: 0 10px; font-size: 13px; }
.rs-ed-area { min-height: 130px; max-height: 340px; overflow-y: auto; padding: 10px 12px; font-size: 16px; line-height: 1.6; color: var(--text-primary); outline: none; word-break: break-word; }
.rs-ed-area.is-empty:before { content: attr(data-ph); color: var(--text-muted); pointer-events: none; }
.rs-ed-area img { max-width: 100%; height: auto; }
.rs-ed-area blockquote { margin: 6px 0; padding-left: 10px; color: var(--text-secondary); }
.rs-ed-area pre { padding: 8px; background: var(--bg-secondary); overflow-x: auto; }
.tkt-reply-box.is-note .rs-editor { background: rgba(var(--navy-accent-rgb), .05); }

/* ===== ticket extras ===== */
.tx-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 14px; background: rgba(var(--navy-accent-rgb), .08); border: 1px solid var(--border-color); border-radius: 4px; font-size: 13.5px; color: var(--text-primary); }
.tx-banner.is-warn { background: color-mix(in srgb, var(--warning, #f39c12) 12%, var(--bg-card)); }
.tx-list { display: flex; flex-direction: column; gap: 6px; }
.tx-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; font-size: 13.5px; }
.tx-row > span, .tx-row > a { min-width: 0; word-break: break-word; }
.tx-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }
.tx-x:hover { color: var(--danger); }
.tx-add { display: flex; gap: 8px; margin-top: 8px; }
.tx-add input { flex: 1; min-width: 0; }
.tx-timer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tx-clock { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.tx-muted { font-size: 12.5px; color: var(--text-muted); }
.tx-summary { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--text-primary); }
.tx-split-btn { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }
.tx-split-btn:hover { color: var(--navy-accent); }

.tb-search { display: flex; align-items: center; gap: 8px; max-width: 360px; margin-bottom: 12px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-card); }
.tb-search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text-primary); font-size: 16px; outline: none; }
.tb-search i { color: var(--text-muted); }

/* ===== custom dashboards ===== */
.db-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.db-top > div:first-child { flex: 0 1 300px; min-width: 0; }
.db-hint { font-size: 13px; color: var(--text-muted); }
.db-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.db-grid > .pub-card { grid-column: 1 / -1; }
.db-w { min-width: 0; margin: 0; }
.db-1 { grid-column: span 1; } .db-2 { grid-column: span 2; } .db-4 { grid-column: span 4; }
.db-w[draggable="true"] { cursor: move; }
.db-kpi { font-size: 30px; font-weight: 700; color: var(--text-primary); }
.db-chart { position: relative; height: 260px; }
@media (max-width: 1024px) { .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .db-4 { grid-column: span 2; } }
@media (max-width: 600px) { .db-grid { grid-template-columns: minmax(0, 1fr); } .db-1, .db-2, .db-4 { grid-column: span 1; } }

.kb-langs { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.kb-langs a { min-width: 40px; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-secondary); font-size: 12.5px; text-align: center; }
.kb-langs a.active { color: var(--on-accent, #fff); background: var(--navy-accent); border-color: var(--navy-accent); }
