/* NegoceFlow: the one stylesheet of the staff pages, sign-in and onboarding (DESIGN.md).
   Four parts, in cascade order: base layout and components, the shared tokens and component recipes, the
   Settings shell, and the design itself (fonts, colours, looks, outline icons). Later rules win over earlier ones. */

/* ================================================================================================
   PART: BASE (was styles.css)
   ================================================================================================ */

/*
  NegoceFlow: le négoce, en ordre. (c) GREENSHIELD SARL, Abidjan. Proprietary: see LICENSE.
  If you read CSS for fun, we would like to meet you: contact@negoceflow.com
  (We promise the cocoa-brown here is a colour choice, not a coffee stain.)
*/
/* ===== Color Scheme - Light Theme (Default) ===== */
:root {
    --navy-primary: #001f3f;
    --navy-dark: #001529;
    --navy-light: #003366;
    --navy-accent: #0074D9;
    --navy-hover: #002a52;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    /* unselected star: light grey so the gold reads clearly (Google-style) */
    --star-empty: #d4d4d8;

    /* 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;
    --star-empty: #5a5d73;
    --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;
}

/* ===== 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 ===== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--navy-primary) 0%, var(--navy-dark) 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: width 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.sidebar-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-title-text {
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-toggle-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-toggle-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.sidebar-logo-section {
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-logo,
.sidebar-avatar-placeholder {
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
    max-width: 55px;
    max-height: 55px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    display: block;
    overflow: hidden;
}

.sidebar-logo:hover,
.sidebar-avatar-placeholder:hover {
    transform: scale(1.1);
    border-color: var(--navy-accent);
    box-shadow: 0 5px 15px rgba(0,116,217,0.6);
}

.sidebar-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    font-size: 22px;
}

.sidebar-menu-section {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.sidebar-menu-title {
    margin: 14px 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    padding: 4px 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    transition: background .15s, color .15s;
}
.sidebar-menu-title:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
}
/* Administration is one Settings entry, set apart from the last section by a hairline. */
.sidebar-menu--settings {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.10);
}
.sidebar-menu-title .section-chevron {
    font-size: 10px;
    transition: transform .2s;
    opacity: .7;
}
.sidebar-menu-title.section-hidden .section-chevron {
    transform: rotate(-90deg);
}
.sidebar-menu.section-hidden {
    display: none;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a,
.sidebar-menu button {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    border-radius: 3px;
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-menu a:hover,
.sidebar-menu button:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-menu a.active,
.sidebar-menu button.active {
    background: var(--navy-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(0,116,217,0.3);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-logout {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.sidebar-logout button {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(234,67,53,0.2) 0%, rgba(234,67,53,0.3) 100%);
    border: 1px solid rgba(234,67,53,0.4);
    color: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}

.sidebar-logout button:hover {
    background: linear-gradient(135deg, rgba(234,67,53,0.4) 0%, rgba(234,67,53,0.5) 100%);
    transform: translateY(-2px);
}

.sidebar-logout button i {
    font-size: 16px;
}

.sidebar-logout button span {
    font-size: 15px;
}

/* Sidebar User Info */
.sidebar-user-name {
    font-size: 15px;
    font-weight: 600;
    color: white;
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar-user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    background: rgba(0,116,217,0.3);
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-title {
    justify-content: center;
}

.sidebar.collapsed .sidebar-title-text {
    display: none;
}

.sidebar.collapsed .sidebar-toggle-btn {
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--navy-primary);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar.collapsed .sidebar-logo-section {
    padding: 10px;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-avatar-placeholder {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    max-width: 45px;
    max-height: 45px;
    font-size: 18px;
}

.sidebar.collapsed .sidebar-menu-section {
    padding: 15px 8px;
}

.sidebar.collapsed .sidebar-menu-title {
    display: none;
}

.sidebar.collapsed .sidebar-menu a,
.sidebar.collapsed .sidebar-menu button {
    justify-content: center;
    padding: 14px 10px;
    gap: 0;
}

.sidebar.collapsed .sidebar-menu a span,
.sidebar.collapsed .sidebar-menu button span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a i,
.sidebar.collapsed .sidebar-menu button i {
    font-size: 20px;
    width: auto;
}

.sidebar.collapsed .sidebar-menu a:hover,
.sidebar.collapsed .sidebar-menu button:hover {
    transform: scale(1.1);
}

/* Hide submenu arrow in collapsed state */
.sidebar.collapsed .submenu-arrow {
    display: none;
}

/* Submenu in collapsed state */
.sidebar.collapsed .sidebar-submenu {
    position: absolute;
    left: 70px;
    top: 0;
    width: 200px;
    background: var(--navy-dark);
    border-radius: 4px;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
    max-height: none;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
}

.sidebar.collapsed .has-submenu:hover .sidebar-submenu {
    opacity: 1;
    visibility: visible;
}

.sidebar.collapsed .sidebar-submenu a {
    padding: 12px 16px;
    justify-content: flex-start;
    gap: 10px;
}

.sidebar.collapsed .sidebar-submenu a span {
    display: inline;
}

.sidebar.collapsed .sidebar-submenu a i {
    font-size: 14px;
    width: 20px;
}

/* Theme toggle in collapsed state */
.sidebar.collapsed .sidebar-theme {
    padding: 12px 8px;
}

.sidebar.collapsed .sidebar-theme button {
    padding: 14px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-theme button span {
    display: none;
}

.sidebar.collapsed .sidebar-theme button i {
    font-size: 20px;
}

/* Logout button in collapsed state */
.sidebar.collapsed .sidebar-logout {
    padding: 12px 8px;
}

.sidebar.collapsed .sidebar-logout button {
    padding: 14px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-logout button span {
    display: none;
}

.sidebar.collapsed .sidebar-logout button i {
    font-size: 20px;
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .sidebar-menu li {
    position: relative;
}

.sidebar.collapsed .sidebar-menu li::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--navy-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

.sidebar.collapsed .sidebar-menu li:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

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

/* Quick Add FAB */
.mobile-nav-fab {
    position: relative;
}
.mobile-nav-fab i {
    font-size: 22px !important;
    background: var(--navy-accent);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px !important;
    margin-top: -14px;
    box-shadow: 0 4px 12px rgba(0,116,217,0.4);
    transition: transform 0.3s, background 0.3s;
}
.mobile-nav-fab span { margin-top: -2px; }

/* Quick Add Overlay */
.quick-add-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1002;
}
.quick-add-overlay.open { display: block; }

/* Quick Add Menu */
.quick-add-menu {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    z-index: 1003;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    flex-direction: row;
    gap: 16px;
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}
.quick-add-menu.open {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.quick-add-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #333;
    font-size: 11px;
    font-weight: 600;
    min-width: 56px;
    transition: transform 0.2s;
}
.quick-add-item:active { transform: scale(0.9); }

.quick-add-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* dark mode quick add */
body.dark-mode .quick-add-menu {
    background: #1a1a2e;
}
body.dark-mode .quick-add-item {
    color: rgba(255,255,255,0.9);
}

/* Sidebar Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

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

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px !important;
        z-index: 1000;
        transition: left 0.3s ease;
        height: calc(100vh - 65px);
        overflow: hidden;
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    /* Disable collapsed state on mobile */
    .sidebar.collapsed {
        width: 280px !important;
        left: -280px;
    }

    .sidebar.collapsed.mobile-open {
        left: 0;
    }

    .sidebar.collapsed .sidebar-title-text,
    .sidebar.collapsed .sidebar-menu-title,
    .sidebar.collapsed .sidebar-menu a span,
    .sidebar.collapsed .sidebar-menu button span,
    .sidebar.collapsed .sidebar-theme button span,
    .sidebar.collapsed .sidebar-logout button span {
        display: inline !important;
    }

    .sidebar.collapsed .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu button,
    .sidebar.collapsed .sidebar-theme button,
    .sidebar.collapsed .sidebar-logout button {
        justify-content: flex-start !important;
        padding: 14px 16px !important;
        gap: 14px !important;
    }

    .sidebar.collapsed .sidebar-menu a i,
    .sidebar.collapsed .sidebar-menu button i {
        font-size: 18px !important;
    }

    .sidebar.collapsed .sidebar-logo,
    .sidebar.collapsed .sidebar-avatar-placeholder {
        width: 55px !important;
        height: 55px !important;
        min-width: 55px !important;
        min-height: 55px !important;
        max-width: 55px !important;
        max-height: 55px !important;
        font-size: 22px !important;
    }

    .sidebar.collapsed .submenu-arrow {
        display: inline !important;
    }

    .sidebar.collapsed .sidebar-submenu {
        position: static !important;
        width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
        opacity: 0;
        visibility: hidden;
    }

    .sidebar.collapsed .sidebar-submenu.open {
        opacity: 1;
        visibility: visible;
    }

    /* Hide sidebar toggle button on mobile */
    .sidebar-toggle-btn {
        display: none !important;
    }

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb a:hover {
    color: var(--navy-accent);
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.6;
}

.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;
    position: relative;
}

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

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

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

.action-icon.paperwork-icon.has-expired {
    color: var(--danger);
}

.action-icon.paperwork-icon.has-expired:hover {
    background: rgba(234,67,53,0.1);
}

.action-icon.paperwork-icon.has-expiring {
    color: var(--warning);
}

.action-icon.paperwork-icon.has-expiring:hover {
    background: rgba(251,188,4,0.1);
}

.action-icon.salary-icon {
    color: var(--success);
}

.action-icon.salary-icon:hover {
    background: rgba(52,168,83,0.1);
    transform: scale(1.15);
}

.action-icon .expired-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 3px;
    line-height: 1;
}

.action-icon .expiring-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: var(--warning);
    color: #333;
    font-size: 9px;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 3px;
    line-height: 1;
}

/* ===== 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, .role-admin {
    background: #d4edda;
    color: #155724;
}

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

.role-manager {
    background: #fff3cd;
    color: #856404;
}

.role-procurement {
    background: #e2d9f3;
    color: #5a2d82;
}

.role-sales {
    background: #d1ecf1;
    color: #0c5460;
}

.role-finance {
    background: #fde2e4;
    color: #721c24;
}

.role-fleet {
    background: #d6f5e0;
    color: #1e7e34;
}

/* ===== Payment Status Badges ===== */
.status-pending {
    background: #e9ecef;
    color: #495057;
}

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

.status-partial {
    background: #fff3cd;
    color: #856404;
}

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

/* ===== Searchable Dropdown ===== */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.searchable-dropdown-input {
    width: 100%;
    padding: 14px 36px 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);
    cursor: pointer;
    touch-action: manipulation;
}

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

.searchable-dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.3s;
}

.searchable-dropdown-arrow.open {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--navy-accent);
    border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.searchable-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.searchable-dropdown-item:hover {
    background: rgba(0,116,217,0.1);
}

.searchable-dropdown-item.selected {
    background: var(--navy-primary);
    color: white;
}

.searchable-dropdown-item.no-results {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

/* ===== Delivery Status Badges ===== */
.status-in-transit {
    background: #cce5ff;
    color: #004085;
}

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

.status-accepted {
    background: #c3e6cb;
    color: #0d5524;
}

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

.status-reassigned {
    background: #e2d9f3;
    color: #5a2d82;
}

/* ===== Sale Status Badges ===== */
.status-draft {
    background: #cce5ff;
    color: #004085;
}

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

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

/* ===== Financing Status Badges ===== */
.status-settled {
    background: #e2e3e5;
    color: #383d41;
}

.status-overdue {
    background: #fff3cd;
    color: #856404;
}

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

/* ===== Direction Badges ===== */
.status-incoming {
    background: #d4edda;
    color: #155724;
}

.status-outgoing {
    background: #fff3cd;
    color: #856404;
}

/* ===== Radio Button Group ===== */
.radio-group {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--navy-accent);
}

/* ===== Computed Field Display ===== */
.computed-field {
    background: var(--bg-primary);
    border: 1px dashed var(--input-border);
    padding: 14px 16px;
    border-radius: 2px;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== Pricing Agreement Status Badges ===== */
.status-expired {
    background: #e2e3e5;
    color: #383d41;
}

.status-superseded {
    background: #fff3cd;
    color: #856404;
}

/* ===== Tab Navigation ===== */
.pricing-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.pricing-tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.pricing-tab-btn:hover {
    color: var(--navy-accent);
    background: rgba(0,116,217,0.05);
}

.pricing-tab-content {
    display: none;
}

.pricing-tab-content.active {
    display: block;
}

.searchable-dropdown-item.no-results:hover {
    background: transparent;
}

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

/* A form can always be closed: the header with its close button stays pinned while the dialog scrolls, and the dialog
   never grows past its overlay, which is the visible screen. vh units ignore phone browser bars and the keyboard, and
   a dialog taller than the overlay sticks out above its top, out of reach. One scroll box: the dialog itself. */
.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

.modal-overlay.active > .modal {
    max-height: 100%;
}

.modal-overlay.active > .modal .modal-body {
    max-height: none;
}

/* ===== 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) {
    .sidebar {
        width: 220px;
    }

    .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;
    width: 60px;
    height: 32px;
    background: #ccc;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch:has(input:checked) {
    background: var(--success);
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.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-switch input:checked ~ .toggle-slider {
    transform: translateX(28px);
}

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

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

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

/* Star Rating (Visual Quality) - DOM order is 5..1 so the row-reverse +
   general-sibling selectors below light up "this star and every lower one" */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 4px;
    font-size: 22px;
}

.star-rating .star-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.star-rating .star-label {
    color: var(--star-empty);
    cursor: pointer;
    transition: color 0.15s ease;
}

/* the icons must inherit the label colour, otherwise the global `i` colour wins
   and every star looks identical no matter how many are selected.
   The dark-mode form is needed too: `body.dark-mode .form-group label i` is more
   specific than the light rule below and was still overriding it. */
.star-rating .star-label i {
    color: inherit;
}

body.dark-mode .star-rating .star-label i {
    color: inherit;
}

.star-rating .star-label:hover,
.star-rating .star-label:hover ~ .star-label,
.star-rating .star-radio:checked + .star-label,
.star-rating .star-radio:checked ~ .star-label {
    color: var(--warning);
}

.star-rating .star-radio:focus-visible + .star-label {
    outline: 2px solid var(--navy-accent, #1a73e8);
    outline-offset: 2px;
    border-radius: 3px;
}

.star-rating-text {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 8px;
}

.star-rating-clear {
    display: none;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    margin-left: 8px;
}

.star-rating-clear:hover {
    color: var(--danger);
    text-decoration: underline;
}

/* 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 ===== */
.sidebar-menu .has-submenu {
    position: relative;
}

.submenu-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 12px;
    margin-left: auto;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.submenu-toggle.open .submenu-arrow {
    transform: rotate(180deg);
    color: white;
}

.sidebar-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    margin-top: 4px;
}

.sidebar-submenu.open {
    max-height: 500px;
    opacity: 1;
    margin-bottom: 8px;
}

.sidebar-submenu li {
    margin-bottom: 0;
}

.sidebar-submenu a {
    width: 100%;
    text-align: left;
    padding: 12px 16px 12px 48px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 400;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--navy-accent);
    padding-left: 52px;
}

.sidebar-submenu a.active {
    background: rgba(0, 116, 217, 0.25);
    color: white;
    border-left-color: var(--navy-accent);
    font-weight: 500;
}

.sidebar-submenu a i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.submenu-toggle.active {
    background: var(--navy-accent);
    color: white;
}

@media (max-width: 768px) {
    .sidebar-submenu a {
        padding: 12px 16px 12px 40px;
        font-size: 13px;
    }

    .sidebar-submenu a:hover {
        padding-left: 44px;
    }
}

/* ===== 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 ===== */
.sidebar .sidebar-theme {
    padding: 16px 20px;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.sidebar .sidebar-theme button {
    width: 100% !important;
    padding: 14px 16px !important;
    background: linear-gradient(135deg, rgba(251,188,4,0.2) 0%, rgba(251,188,4,0.3) 100%) !important;
    border: 1px solid rgba(251,188,4,0.4) !important;
    color: white !important;
    cursor: pointer !important;
    border-radius: 3px !important;
    font-size: 15px !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-weight: 600 !important;
    font-family: inherit;
    text-align: center;
    box-sizing: border-box;
}

.sidebar .sidebar-theme button:hover {
    background: linear-gradient(135deg, rgba(251,188,4,0.4) 0%, rgba(251,188,4,0.5) 100%) !important;
    transform: translateY(-2px);
}

.sidebar .sidebar-theme button i {
    font-size: 16px;
    width: auto;
}

.sidebar .sidebar-theme button span {
    font-size: 15px;
}

/* In sidebar-light, the single theme button keeps the same amber gradient
   but inverts text so it remains legible on a white sidebar */
.sidebar.sidebar-light .sidebar-theme button {
    color: #0f172a !important;
    background: linear-gradient(135deg, rgba(251,188,4,0.18) 0%, rgba(251,188,4,0.28) 100%) !important;
}
.sidebar.sidebar-light .sidebar-theme button:hover {
    background: linear-gradient(135deg, rgba(251,188,4,0.28) 0%, rgba(251,188,4,0.38) 100%) !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: 44px;
        height: 44px;
        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) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dashboard-kpi-grid .kpi-card {
        padding: 12px;
    }

    .dashboard-kpi-grid .kpi-card-value {
        font-size: 18px;
    }

    .dashboard-kpi-grid .kpi-card-label {
        font-size: 11px;
    }

    .dashboard-kpi-grid .kpi-card-sub {
        font-size: 10px;
    }

    .dashboard-kpi-grid .kpi-card-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .main-content {
        padding: 10px;
        padding-bottom: 85px;
    }

    .header {
        padding: 12px;
    }

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

    .data-section {
        padding: 12px;
    }

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

    .stat-card {
        padding: 15px;
    }

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

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

    .chart-container {
        height: 200px;
    }

    .modal-body {
        padding: 15px;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    .sidebar-menu a,
    .sidebar-menu button {
        min-height: 50px;
    }

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

    .sidebar-menu a:active,
    .sidebar-menu button:active {
        transform: scale(0.98);
    }
}

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

    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Fix for iOS momentum scrolling */
    .modal-body,
    .main-content,
    .sidebar-menu-section {
        -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) {
    .sidebar {
        width: 220px;
    }

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

/* ===== Supplier Balance Colors ===== */
.balance-positive {
    color: #27ae60;
    font-weight: 600;
}

.balance-negative {
    color: #e74c3c;
    font-weight: 600;
}

/* ===== Stock Ledger Badges ===== */
.stock-badge-in {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(52, 168, 83, 0.15);
    color: #27ae60;
}

.stock-badge-out {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(234, 67, 53, 0.15);
    color: #ea4335;
}

/* ===== Floating Action Button ===== */
.fab-add-btn {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 100;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--navy-accent);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.fab-add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* ===== 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 {
        padding: 15px !important;
    }

    .theme-preview > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

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

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

/* ===== Fleet Vehicle Status Badges ===== */
.status-available {
    background: #d4edda;
    color: #155724;
}

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

.status-maintenance {
    background: #fff3cd;
    color: #856404;
}

/* ===== Profit Analysis Target Badges ===== */
.status-above-target {
    background: #d4edda;
    color: #155724;
}

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

.status-at-target {
    background: #fff3cd;
    color: #856404;
}

/* ===== License Expiry Warning ===== */
.license-expired {
    color: #dc3545;
    font-weight: 700;
}

.license-warning {
    color: #fd7e14;
    font-weight: 600;
}

/* ===== Dropdown with Quick-Add Button ===== */
.dropdown-with-add {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.dropdown-with-add select {
    flex: 1;
}

.btn-quick-add {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 1px solid var(--input-border);
    border-radius: 2px;
    background: var(--navy-accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.3s;
    touch-action: manipulation;
}

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

/* ===== Dashboard Overview - KPI Cards ===== */
.dashboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.time-filter-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.time-filter-tabs button {
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
}

.time-filter-tabs button:hover {
    background: rgba(0, 116, 217, 0.08);
    color: var(--navy-accent);
}

.time-filter-tabs button.active {
    background: var(--navy-accent);
    color: white;
    font-weight: 600;
}

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

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

/* KPI grid — auto-fills based on visible cards per role */
.dashboard-primary-kpi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.dashboard-primary-kpi .kpi-card { padding: 24px; }
.dashboard-primary-kpi .kpi-card-value { font-size: 26px; }
.dashboard-primary-kpi .kpi-card-label { font-size: 14px; }
.dashboard-primary-kpi .kpi-card-icon { width: 52px; height: 52px; font-size: 22px; }

.dashboard-charts-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
    margin-bottom: 16px;
}
.dashboard-charts-row .prices-chart-card { margin: 0; }

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

/* KPI Cards */
.kpi-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 12px var(--shadow-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px var(--shadow-hover);
}

.kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kpi-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.kpi-card-menu {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.kpi-card-menu:hover {
    opacity: 1;
}

.kpi-card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.kpi-card-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-card-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-card-sub .evolution-up {
    color: var(--success);
    font-weight: 600;
}

.kpi-card-sub .evolution-down {
    color: var(--danger);
    font-weight: 600;
}

.kpi-card-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-accent-navy { background: var(--navy-primary); }
.kpi-accent-blue { background: var(--navy-accent); }
.kpi-accent-green { background: var(--success); }
.kpi-accent-orange { background: var(--warning); }
.kpi-accent-red { background: var(--danger); }

/* ===== Category Cards ===== */
.overview-row-2 {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.category-cards-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.category-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px var(--shadow-hover);
    border-color: var(--navy-accent);
}

.category-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 10px;
    position: relative;
}

.category-card-icon.icon-blue { background: rgba(0, 116, 217, 0.12); color: var(--navy-accent); }
.category-card-icon.icon-green { background: rgba(52, 168, 83, 0.12); color: var(--success); }
.category-card-icon.icon-orange { background: rgba(251, 188, 4, 0.12); color: #e0a800; }
.category-card-icon.icon-purple { background: rgba(111, 66, 193, 0.12); color: #6f42c1; }
.category-card-icon.icon-teal { background: rgba(32, 201, 151, 0.12); color: #20c997; }

.badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    color: white;
}

.badge-count-green { background: var(--success); }
.badge-count-orange { background: var(--warning); color: #333; }
.badge-count-blue { background: var(--navy-accent); }
.badge-count-red { background: var(--danger); }

.category-card-count {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.category-card-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Notifications Panel ===== */
.notifications-panel {
    width: 280px;
    min-width: 280px;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    max-height: 260px;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.notifications-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notifications-header a {
    font-size: 12px;
    color: var(--navy-accent);
    text-decoration: none;
    font-weight: 500;
}

.notifications-header a:hover {
    text-decoration: underline;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--table-hover);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.notif-icon-yellow { background: rgba(251, 188, 4, 0.15); color: #e0a800; }
.notif-icon-green { background: rgba(52, 168, 83, 0.15); color: var(--success); }
.notif-icon-blue { background: rgba(0, 116, 217, 0.15); color: var(--navy-accent); }
.notif-icon-red { background: rgba(234, 67, 53, 0.15); color: var(--danger); }

.notification-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Revenue Highlight Card ===== */
.revenue-highlight {
    background: linear-gradient(135deg, #0074D9 0%, #004c99 40%, #003366 100%);
    border-radius: 10px;
    padding: 24px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

.revenue-highlight::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.revenue-highlight-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 8px;
}

.revenue-highlight-value {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.1;
}

.revenue-highlight-sub {
    font-size: 13px;
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.revenue-highlight-sub .trend-up {
    color: #90EE90;
    font-weight: 600;
}

.revenue-sparkline-container {
    flex: 1;
    min-height: 80px;
    position: relative;
}

/* ===== Charts Row ===== */
.overview-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr 320px;
    gap: 20px;
    margin-bottom: 20px;
}

.overview-chart-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-light);
}

.overview-chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overview-chart-card h3 i {
    color: var(--navy-accent);
}

.prices-chart-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.prices-chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prices-chart-card h3 i {
    color: var(--navy-accent);
}

.prices-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.price-trend-tabs {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.price-trend-tabs .ptt-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s, color .2s;
    touch-action: manipulation;
}

.price-trend-tabs .ptt-btn:hover {
    color: var(--text-primary);
}

.price-trend-tabs .ptt-btn.active {
    background: var(--navy-accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ───── Delivery form: visual sections ───── */
.delivery-section {
    border: 1px solid var(--border-light);
    border-left: 5px solid var(--navy-accent);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 18px;
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0, 31, 63, 0.06);
    transition: box-shadow .2s;
}
.delivery-section:hover { box-shadow: 0 2px 10px rgba(0, 31, 63, 0.1); }
.delivery-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--navy-primary);
    border-bottom: 2px solid var(--navy-accent);
    padding-bottom: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.delivery-section-title i {
    color: var(--navy-accent);
    font-size: 15px;
}
/* per-section accents so each block reads differently at a glance */
.delivery-section.section-customer {
    border-left-color: #1a9c6b;
    background: linear-gradient(180deg, rgba(26,156,107,0.05), var(--bg-card) 40px);
}
.delivery-section.section-customer .delivery-section-title { color: #0f6b47; border-bottom-color: #1a9c6b; }
.delivery-section.section-customer .delivery-section-title i { color: #1a9c6b; }

.delivery-section.section-vehicle {
    border-left-color: #0074D9;
    background: linear-gradient(180deg, rgba(0,116,217,0.05), var(--bg-card) 40px);
}
.delivery-section.section-vehicle .delivery-section-title { color: #001f3f; border-bottom-color: #0074D9; }
.delivery-section.section-vehicle .delivery-section-title i { color: #0074D9; }

.delivery-section.section-expenses {
    border-left-color: #e67e22;
    background: linear-gradient(180deg, rgba(230,126,34,0.05), var(--bg-card) 40px);
}
.delivery-section.section-expenses .delivery-section-title { color: #a04b00; border-bottom-color: #e67e22; }
.delivery-section.section-expenses .delivery-section-title i { color: #e67e22; }

/* ===== Dashboard Overview Responsive ===== */
@media (max-width: 1200px) {
    .dashboard-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .dashboard-primary-kpi {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-cards-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }

    .overview-bottom-row {
        grid-template-columns: 1fr;
    }

    .notifications-panel {
        width: 100%;
        min-width: unset;
        max-height: 200px;
    }

    .overview-row-2 {
        flex-direction: column;
    }
}

@media (max-width: 968px) {
    .dashboard-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

    .kpi-card-value {
        font-size: 20px;
    }

    .time-filter-tabs button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid-5 {
        grid-template-columns: 1fr;
    }

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

    .dashboard-primary-kpi {
        grid-template-columns: 1fr;
    }
    .dashboard-primary-kpi .kpi-card { padding: 16px; }
    .dashboard-primary-kpi .kpi-card-value { font-size: 20px; }
    .dashboard-primary-kpi .kpi-card-icon { width: 44px; height: 44px; font-size: 18px; }

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

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

    .category-cards-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-card-value {
        font-size: 18px;
    }

    .revenue-highlight-value {
        font-size: 26px;
    }

    .overview-bottom-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .time-filter-tabs {
        width: 100%;
        overflow-x: auto;
    }
}

/* money-input: text-align right for currency feel */
.money-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Desktop Quick-Add (Add New dropdown in header) — mirrors mobile FAB
   Injected into .header by sidebar.php. Hidden on mobile (FAB handles it).
   ===================================================================== */
.desktop-quick-add-wrap {
    position: relative;
    margin-right: 12px;
    display: none;              /* flipped on by JS after header inject */
}
.desktop-quick-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--navy-accent) 0%, #0057a3 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 116, 217, 0.35);
    transition: transform .15s, box-shadow .15s, background .2s;
    white-space: nowrap;
}
.desktop-quick-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 116, 217, 0.45);
}
.desktop-quick-add-btn .dqa-chevron {
    font-size: 11px;
    transition: transform .2s;
}
.desktop-quick-add-btn.open .dqa-chevron {
    transform: rotate(180deg);
}

.desktop-quick-add-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 9998;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.desktop-quick-add-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.desktop-quick-add-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 12px 6px;
}
.desktop-quick-add-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
}
.desktop-quick-add-item:hover {
    background: var(--table-hover);
}
.desktop-quick-add-item .dqa-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

/* Overlay behind dropdown — catches outside clicks */
.desktop-quick-add-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9997;
}
.desktop-quick-add-overlay.open {
    display: block;
}

/* Hide the desktop button on mobile — mobile FAB handles it */
@media (max-width: 768px) {
    .desktop-quick-add-wrap {
        display: none !important;
    }
}

/* =====================================================================
   Sidebar Light Variant — white sidebar with dark text. Independent of
   body.dark-mode: user may prefer a white sidebar while the main content
   stays in either light or dark mode. Persisted in localStorage as
   "sidebarStyle" = "light" | "dark" (default).
   ===================================================================== */
.sidebar.sidebar-light {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    color: #1f2937;
    border-right: 1px solid #e5e7eb;
    box-shadow: 1px 0 6px rgba(15, 23, 42, 0.05);
}
.sidebar.sidebar-light .sidebar-header {
    border-bottom: 1px solid #e5e7eb;
}
.sidebar.sidebar-light .sidebar-title {
    color: #0f172a;
}
.sidebar.sidebar-light .sidebar-toggle-btn {
    background: #eef2f7;
    color: #334155;
}
.sidebar.sidebar-light .sidebar-toggle-btn:hover {
    background: #e2e8f0;
}
.sidebar.sidebar-light .sidebar-logo-section {
    background: #f1f5f9;
    border-bottom: 1px solid #e5e7eb;
}
.sidebar.sidebar-light .sidebar-logo,
.sidebar.sidebar-light .sidebar-avatar-placeholder {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.sidebar.sidebar-light .sidebar-avatar-placeholder {
    background: #e2e8f0;
    color: #64748b;
}
.sidebar.sidebar-light .sidebar-user-name {
    color: #0f172a;
}
.sidebar.sidebar-light .sidebar-user-role {
    color: #334155;
    background: rgba(0, 116, 217, 0.12);
}
.sidebar.sidebar-light .sidebar-menu-title {
    color: #64748b;
}
.sidebar.sidebar-light .sidebar-menu-title:hover {
    background: #eef2f7;
    color: #0f172a;
}
.sidebar.sidebar-light .sidebar-menu--settings {
    border-top-color: #e2e8f0;
}
.sidebar.sidebar-light .sidebar-menu a,
.sidebar.sidebar-light .sidebar-menu button {
    color: #334155;
}
.sidebar.sidebar-light .sidebar-menu a:hover,
.sidebar.sidebar-light .sidebar-menu button:hover {
    background: #eef2f7;
    color: #0f172a;
}
.sidebar.sidebar-light .sidebar-menu a.active,
.sidebar.sidebar-light .sidebar-menu button.active {
    background: var(--navy-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 116, 217, 0.28);
}
.sidebar.sidebar-light .submenu-arrow {
    color: #64748b;
}
.sidebar.sidebar-light .sidebar-submenu {
    background: #f8fafc;
}
.sidebar.sidebar-light .sidebar-submenu a {
    color: #475569;
}
.sidebar.sidebar-light .sidebar-submenu a:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.sidebar.sidebar-light .sidebar-submenu a.active {
    background: rgba(0, 116, 217, 0.12);
    color: var(--navy-accent);
}
.sidebar.sidebar-light .sidebar-theme {
    background: #f1f5f9;
    border-top: 1px solid #e5e7eb;
}
.sidebar.sidebar-light .sidebar-theme button {
    background: linear-gradient(135deg, rgba(251,188,4,0.14) 0%, rgba(251,188,4,0.22) 100%) !important;
    color: #0f172a !important;
    border: 1px solid rgba(251,188,4,0.35) !important;
}
.sidebar.sidebar-light .sidebar-theme button:hover {
    background: linear-gradient(135deg, rgba(251,188,4,0.24) 0%, rgba(251,188,4,0.34) 100%) !important;
}
.sidebar.sidebar-light .sidebar-logout {
    background: #f1f5f9;
    border-top: 1px solid #e5e7eb;
}
.sidebar.sidebar-light .sidebar-logout button {
    background: linear-gradient(135deg, rgba(234,67,53,0.12) 0%, rgba(234,67,53,0.2) 100%);
    color: #b91c1c;
    border-color: rgba(234,67,53,0.35);
}
.sidebar.sidebar-light .sidebar-logout button:hover {
    background: linear-gradient(135deg, rgba(234,67,53,0.22) 0%, rgba(234,67,53,0.3) 100%);
}

/* Language switcher row in sidebar-light (if lang.php is included) */
.sidebar.sidebar-light .sidebar-lang-switch a {
    color: #475569;
}


/* NegoceFlow Phase 5: renewal reminder (billing-lib.php billingBannerHtml) */
.billing-banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.4;
    background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.billing-banner--grace { background: #fef3f2; color: #912018; border-color: #fecdca; }
.billing-banner a { color: inherit; font-weight: 600; text-decoration: underline; margin-left: 6px; }

/* NegoceFlow: the "Get started" list on a new company's dashboard (getting-started-lib.php) */
.gs-card { background: var(--bg-card, #fff); color: var(--text-primary, #333); border: 1px solid var(--border-color, #e4e7ec); border-radius: 12px; padding: 16px; margin: 0 0 20px; }
.gs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.gs-head h2 { margin: 0 0 4px; font-size: 18px; }
.gs-intro { margin: 0; color: var(--text-muted, #667085); font-size: 14px; }
.gs-progress { font-size: 13px; font-weight: 600; color: var(--text-muted, #667085); white-space: nowrap; }
.gs-bar { height: 6px; background: var(--border-color, #e4e7ec); border-radius: 3px; margin: 12px 0; overflow: hidden; }
.gs-bar span { display: block; height: 100%; background: #12b76a; border-radius: 3px; }
.gs-steps { list-style: none; margin: 0; padding: 0; }
.gs-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-color, #e4e7ec); }
.gs-step:first-child { border-top: 0; }
.gs-mark { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 11px; background: var(--border-color, #e4e7ec); color: var(--text-muted, #667085); }
.gs-step.is-done .gs-mark { background: rgba(18, 183, 106, .18); color: #067647; font-size: 13px; }
.gs-step.is-next .gs-mark { background: rgba(247, 144, 9, .18); color: #b54708; }
.gs-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.gs-help { color: var(--text-muted, #667085); font-size: 13px; }
.gs-step.is-done .gs-text strong { text-decoration: line-through; color: var(--text-muted, #667085); }
.gs-done { font-size: 13px; color: #067647; font-weight: 600; }
.gs-go { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; }
.gs-hide { margin-top: 8px; text-align: right; }
.gs-hide-btn { background: none; border: 0; color: var(--text-muted, #667085); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 8px 0; min-height: 44px; }
@media (max-width: 480px) { .gs-step { flex-wrap: wrap; } .gs-go { margin-left: 40px; } }
body.dark-mode .gs-step.is-done .gs-mark, body.dark-mode .gs-done { color: #47cd89; }
body.dark-mode .gs-step.is-next .gs-mark { color: #fdb022; }
body.dark-mode .billing-banner { background: rgba(247, 144, 9, .14); color: #fec84b; border-color: rgba(247, 144, 9, .4); }
body.dark-mode .billing-banner--grace { background: rgba(240, 68, 56, .14); color: #fda29b; border-color: rgba(240, 68, 56, .4); }

/* A company whose subscription ended is read-only (billing-lib.php billingGate()): its data shows, downloads and
   add/edit/delete do not. The server refuses them too; this only keeps buttons that would fail out of the way. */
.billing-banner--readonly { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.billing-banner--readonly > span { flex: 1 1 260px; }
.billing-banner .billing-banner-action { display: inline-flex; align-items: center; min-height: 44px; margin-left: 0; }
.billing-banner.is-flash { animation: billing-flash .9s ease-out 1; }
@keyframes billing-flash { 0% { outline: 3px solid currentColor; } 100% { outline: 3px solid transparent; } }
@media (prefers-reduced-motion: reduce) { .billing-banner.is-flash { animation: none; } }
#billingReadOnlyLive { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.billing-readonly .dt-buttons .buttons-csv,
body.billing-readonly .dt-buttons .buttons-excel,
body.billing-readonly .dt-buttons .buttons-pdf,
body.billing-readonly .dt-buttons .buttons-print,
body.billing-readonly .dt-buttons .buttons-copy,
body.billing-readonly a[download],
body.billing-readonly a[href*="action=export"],
body.billing-readonly a[href*="traceability-export.php"],
body.billing-readonly a[href*="format=pdf"],
body.billing-readonly [data-readonly-hide],
body.billing-readonly .gs-card { display: none !important; }

/* ===== Connection and session states (net-states.js, DESIGN.md §6.26) ===== */
.nf-net-bar { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 3000; max-width: calc(100vw - 32px);
    padding: 10px 16px; border-radius: 10px; font-size: 14px; line-height: 1.4; box-shadow: 0 4px 16px var(--shadow-hover);
    background: #fff6e0; color: #6b4a00; border: 1px solid #f1d58a; }
.nf-net-bar[hidden], .nf-session[hidden] { display: none !important; }
.nf-net-bar.is-online { background: #e6f4ea; color: #1e5631; border-color: #a8d5b5; }
.nf-net-bar.is-error { background: #fdecea; color: #8a1f17; border-color: #f2b8b2; }
.nf-net-bar.is-slow { background: #e8f0fe; color: #1a3d7c; border-color: #b5c9f2; }
body.dark-mode .nf-net-bar { background: #3a3220; color: #f6dfa4; border-color: #5c4d28; }
body.dark-mode .nf-net-bar.is-online { background: #1f3a2a; color: #b7e4c7; border-color: #2f5a40; }
body.dark-mode .nf-net-bar.is-error { background: #3d2224; color: #f5c2c0; border-color: #6a3337; }
body.dark-mode .nf-net-bar.is-slow { background: #1f2b45; color: #c3d4f7; border-color: #34466e; }
@media (min-width: 769px) { .nf-net-bar { bottom: 24px; } }
.nf-session { position: fixed; inset: 0; z-index: 3100; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(0, 0, 0, 0.45); }
.nf-session-box { width: 100%; max-width: 440px; background: var(--bg-card); color: var(--text-primary); border-radius: 12px;
    padding: 22px; box-shadow: 0 10px 30px var(--shadow-hover); }
.nf-session-box h2 { font-size: 19px; margin: 0 0 8px; }
.nf-session-box p, .nf-session-box li { font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
.nf-session-box ol { margin: 10px 0 0 20px; }
.nf-session-status:empty { display: none; }
.nf-session-status { margin-top: 10px; color: #1e5631 !important; font-weight: 600; }
body.dark-mode .nf-session-status { color: #b7e4c7 !important; }
.nf-session-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.nf-session-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.nf-session-actions [hidden] { display: none !important; }

/* Phone forms: an open form always sits above the bottom bar (z-index 1001), and the bar hides while it is open, so
   no Save button can end up underneath it (iPhone Safari included). SweetAlert (1060) still comes on top. */
.modal-overlay { z-index: 1004; }
body:has(.modal-overlay.active) .mobile-bottom-nav { display: none !important; }

/* iPhone Safari counts the space behind its own toolbars in 100vh, so anything sized with 100vh ran past the visible
   screen and its last items (the end of the menu, the last Settings sections) sat under the bottom bar. Size to the
   visible screen (dvh) where the browser knows it, and keep the phone menu clear of the bottom bar and the home bar. */
.app-container { height: 100vh; height: 100dvh; }
.sidebar { height: 100vh; height: 100dvh; }
@media (max-width: 768px) {
    .sidebar {
        height: calc(100vh - 65px);
        height: calc(100dvh - 65px - env(safe-area-inset-bottom, 0px));
    }
    .sidebar-menu-section {
        padding-bottom: 24px;
        overscroll-behavior: contain;
    }
}

/* "Required" / "Optional" after a field's label (users and profile forms) */
.field-note { font-style: normal; font-weight: 400; opacity: .75; }

/* ===================== Add from a form field (purchase form: "Add a supplier") =====================
   The add action sits on the label's line, before the field, in the action colour. The line keeps the label's height,
   so the field lines up with the fields beside it; the 44px touch area reaches up into the gap above the label
   (::before) and stops at the field's top edge. */
.nf-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.nf-field-head > label { margin-bottom: 0 !important; }
.nf-inline-add {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0;
    margin: -3px 0;
    border: 0;
    background: transparent;
    color: var(--cw-primary, #2F5D8C);
    font: inherit;
    font-size: 14px;
    line-height: 16px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.nf-inline-add::before { content: ""; position: absolute; left: -8px; right: -8px; top: -20px; bottom: -8px; }
.nf-inline-add:hover { text-decoration: underline; }
.nf-inline-add:focus-visible { outline: 2px solid var(--cw-primary, #2F5D8C); outline-offset: 2px; }
.nf-inline-add i { color: inherit !important; margin: 0 !important; }
.searchable-dropdown-item.nf-dropdown-add {
    color: var(--cw-primary, #2F5D8C);
    font-weight: 600;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.nf-quick-note { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: var(--text-muted); }
/* A purchase's description line under its supplier on the purchases list (M31): wraps, never widens the table. */
.pur-description { display: inline-block; max-width: 28ch; color: var(--cw-text-secondary); white-space: normal; overflow-wrap: anywhere; }
.nf-field-error { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--danger, #A3392A); }
.nf-field-error[hidden] { display: none; }
#quickSupplierForm [aria-invalid="true"] { border-color: var(--danger, #A3392A) !important; }

/* ================================================================================================
   PART: TOKENS AND RECIPES (was cashew-ui.css)
   ================================================================================================ */

/* CashewPro UI revamp — Phase 1: design tokens + shared shell + dashboard.
   Comes after the base part on every page (see UI-BRIEF.md). Dashboard-only
   rules are scoped under body.page-dashboard so other pages are untouched. */

/* ===================== DESIGN TOKENS ===================== */
:root {
    --cw-bg: #F8FAFC;
    --cw-surface: #FFFFFF;
    --cw-surface-soft: #F5F8FC;
    --cw-tint-blue: #EFF4FE;
    --cw-tint-orange: #FBF3EC;
    --cw-border: #E3EAF3;
    --cw-border-soft: #EDF1F7;
    --cw-text-primary: #16223D;
    --cw-text-secondary: #60708F;
    --cw-text-muted: #8A98B3;
    --cw-primary: #3B82F6;
    --cw-primary-soft: #E8F0FE;
    --cw-primary-dark: #2C6BE0;
    --cw-orange: #E3A379;
    --cw-orange-soft: #FAF0E8;
    --cw-green: #4FA98C;
    --cw-green-soft: #EAF4F1;
    --cw-purple: #9A8AD4;
    --cw-purple-soft: #F1EEFA;
    --cw-red: #D9808F;
    --cw-red-soft: #FBEDEF;
    --cw-ink-navy: #101C35;
    --cw-sidebar-active-bg: #EAF1FE;
    --cw-contour: #EAB393;

    /* nav rail — theme-independent dark navy (the app's own default before
       the Phase-1 restyle); pastel-tinted active state */
    --cw-nav-bg: #0E1A2E;
    --cw-nav-bg-soft: rgba(255, 255, 255, 0.06);
    --cw-nav-border: rgba(255, 255, 255, 0.08);
    --cw-nav-text: #A9B8D4;
    --cw-nav-text-strong: #FFFFFF;
    --cw-nav-muted: #6E7E9E;
    --cw-nav-active-bg: rgba(59, 130, 246, 0.18);
    --cw-nav-accent: #3B82F6;

    /* alias the app's existing variable system onto the new palette, so
       every untouched page inherits the new colours automatically */
    --navy-primary: var(--cw-ink-navy);
    --navy-dark: #0B1426;
    --navy-light: #1F3A63;
    --navy-accent: var(--cw-primary);
    --navy-hover: var(--cw-primary-dark);
    --success: var(--cw-green);
    --warning: var(--cw-orange);
    --danger: var(--cw-red);

    --bg-primary: var(--cw-bg);
    --bg-secondary: var(--cw-surface-soft);
    --bg-card: var(--cw-surface);
    --text-primary: var(--cw-text-primary);
    --text-secondary: var(--cw-text-secondary);
    --text-muted: var(--cw-text-muted);
    --border-color: var(--cw-border);
    --border-light: var(--cw-border-soft);
    --shadow-color: rgba(17, 38, 76, 0.05);
    --shadow-hover: rgba(17, 38, 76, 0.1);
    --input-bg: #FFFFFF;
    --input-border: #DDE6F0;
    --table-hover: var(--cw-surface-soft);
    --skeleton-base: #EEF2F7;
    --skeleton-shine: #E3E9F1;
}

body.dark-mode {
    --cw-bg: #0B1426;
    --cw-surface: #101C35;
    --cw-surface-soft: #15233D;
    --cw-tint-blue: rgba(59, 130, 246, 0.14);
    --cw-tint-orange: rgba(227, 163, 121, 0.14);
    --cw-border: #223150;
    --cw-border-soft: #1B2740;
    --cw-text-primary: #EAF0FB;
    --cw-text-secondary: #9FB0CC;
    --cw-text-muted: #7487A8;
    --cw-primary-soft: rgba(59, 130, 246, 0.18);
    --cw-orange-soft: rgba(227, 163, 121, 0.16);
    --cw-green-soft: rgba(79, 169, 140, 0.16);
    --cw-purple-soft: rgba(154, 138, 212, 0.18);
    --cw-red-soft: rgba(217, 128, 143, 0.16);
    --cw-sidebar-active-bg: rgba(59, 130, 246, 0.18);
    --cw-nav-bg: #070E1B;
    --cw-nav-active-bg: rgba(59, 130, 246, 0.22);

    --navy-primary: #0B1426;
    --navy-dark: #060B14;
    --navy-light: #1F3A63;

    --bg-primary: var(--cw-bg);
    --bg-secondary: var(--cw-surface-soft);
    --bg-card: var(--cw-surface);
    --text-primary: var(--cw-text-primary);
    --text-secondary: var(--cw-text-secondary);
    --text-muted: var(--cw-text-muted);
    --border-color: var(--cw-border);
    --border-light: var(--cw-border-soft);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --input-bg: var(--cw-surface-soft);
    --input-border: var(--cw-border);
    --table-hover: var(--cw-surface-soft);
    --skeleton-base: var(--cw-surface-soft);
    --skeleton-shine: var(--cw-border-soft);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* keyboard-only focus ring, app-wide — doesn't affect mouse/touch interaction or layout */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}

/* ===================== SHELL: SIDEBAR ===================== */
/* Dark navy rail in both themes (the app's own 'navy' default), denser than the
   Phase-1 white version: smaller type + tighter rows so more destinations fit
   without scrolling. The 'white' theme mode still switches to a light sidebar
   via the .sidebar-light class. */
.sidebar:not(.sidebar-light) {
    background: var(--cw-nav-bg);
    color: var(--cw-nav-text);
    border-right: 1px solid var(--cw-nav-border);
    box-shadow: none;
}

.sidebar:not(.sidebar-light) .sidebar-header,
.sidebar:not(.sidebar-light) .sidebar-logo-section {
    border-bottom: 1px solid var(--cw-nav-border);
}

.sidebar:not(.sidebar-light) .sidebar-header {
    padding: 12px 12px;
}

.sidebar:not(.sidebar-light) .sidebar-logo-section {
    background: transparent;
    padding: 10px;
}

.sidebar-header {
    padding: 12px 12px;
}

.sidebar-logo-section {
    background: transparent;
    padding: 10px;
}

.sidebar-title {
    color: var(--cw-text-primary);
    font-size: 14.5px;
    font-weight: 650;
    gap: 8px;
}

.sidebar:not(.sidebar-light) .sidebar-title {
    color: var(--cw-nav-text-strong);
}

/* The NegoceFlow mark (assets/brand, identity pack v2): cocoa route and blue cap on a light sidebar, cotton and tan
   on the dark sidebar and in dark mode. */
.sidebar-title .sidebar-mark { width: 24px; height: 24px; flex: none; display: block; }
.sidebar-mark .nf-route { fill: #F4EDE0; }
.sidebar-mark .nf-cap { fill: #C8A97E; }
.sidebar.sidebar-light .sidebar-mark .nf-route { fill: #4A2E1F; }
.sidebar.sidebar-light .sidebar-mark .nf-cap { fill: #2F5D8C; }
body.dark-mode .sidebar.sidebar-light .sidebar-mark .nf-route { fill: #F4EDE0; }
body.dark-mode .sidebar.sidebar-light .sidebar-mark .nf-cap { fill: #C8A97E; }

.sidebar-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--cw-orange);
    color: #24160A;
    font-size: 11px;
}

.sidebar-toggle-btn {
    background: var(--cw-surface-soft);
    color: var(--cw-text-secondary);
    border-radius: 6px;
}

.sidebar-toggle-btn:hover {
    background: var(--cw-border-soft);
}

.sidebar:not(.sidebar-light) .sidebar-toggle-btn {
    background: var(--cw-nav-bg-soft);
    color: var(--cw-nav-text);
}

.sidebar:not(.sidebar-light) .sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-logo,
.sidebar-avatar-placeholder {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    border-color: var(--cw-border);
    box-shadow: none;
}

.sidebar-menu {
    padding: 0 8px;
}

.sidebar-menu-title {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    margin: 8px 0 3px;
    padding: 3px 8px;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    color: var(--cw-text-muted);
    font-weight: 700;
}

.sidebar:not(.sidebar-light) .sidebar-menu-title {
    color: var(--cw-nav-muted);
}

.sidebar-menu-title:hover {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
}

.sidebar:not(.sidebar-light) .sidebar-menu-title:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cw-nav-text-strong);
}

/* Commodity · Campaign view selector (sidebar.php, above Operations) */
.campaign-context {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 8px 2px;
    padding: 8px;
    border: 1px solid var(--cw-nav-border);
    border-radius: 7px;
}

.campaign-context label,
.campaign-context-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--cw-nav-muted);
}

.campaign-context select {
    width: 100%;
    min-height: 31px;
    padding: 4px 6px;
    font-size: 12.5px;
    border: 1px solid var(--cw-nav-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cw-nav-text-strong);
}

/* The viewed commodity's icon left of the selector: a 32px tile holding the same 22px glyph as the top-bar switcher
   (.cv-thumb-icon). Drawn in the selector's text colour so it reads on every sidebar (dark, light, cocoa). */
.campaign-context-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.campaign-context-row select {
    flex: 1 1 auto;
    min-width: 0;
}

/* One campaign only (sidebar.php $soleCampaign): its name as plain text, no arrow and no list, wrapping in full. */
.campaign-context-single {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 2px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    color: var(--cw-nav-text-strong);
}

@media (min-width: 1000px) {
    .campaign-context-single { font-size: 13px; }
}

.campaign-context-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cw-nav-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cw-nav-text-strong);
    font-size: 14px;
}

.campaign-context-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.sidebar.sidebar-light .campaign-context-icon {
    border-color: var(--cw-border);
    background: var(--cw-surface);
    color: var(--cw-text-primary);
}

.campaign-context select option {
    background: var(--cw-nav-bg);
    color: var(--cw-nav-text-strong);
}

.campaign-context-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--cw-green);
}

.campaign-context-status.is-history {
    color: var(--cw-orange);
}

/* Campaign scope note (sidebar.php showCampaignNote): rows left out, later settlements */
.campaign-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--cw-border);
    border-left: 4px solid var(--cw-orange);
    border-radius: 7px;
    background: var(--cw-orange-soft);
    color: var(--cw-text-primary);
    font-size: 13px;
    line-height: 1.45;
}

.campaign-note[hidden] {
    display: none;
}

.campaign-note i {
    margin-top: 2px;
    color: var(--cw-orange);
}

/* Purchases saved with no price that an agreed price now covers (purchases.php, purchase-price-fill-lib.php). */
.unpriced-note .unpriced-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.unpriced-note .unpriced-list { margin: 0; padding-left: 18px; font-size: 14px; overflow-wrap: anywhere; }
.unpriced-note .unpriced-list li + li { margin-top: 4px; }
.unpriced-note .unpriced-truck { margin: 0; font-size: 14px; color: var(--cw-text-secondary); overflow-wrap: anywhere; }
.unpriced-note .unpriced-apply { align-self: flex-start; min-height: 48px; }
.unpriced-note [hidden] { display: none; }
@media (max-width: 600px) { .unpriced-note .unpriced-apply { align-self: stretch; } }

.sidebar.sidebar-light .campaign-context {
    border-color: var(--cw-border);
}

.sidebar.sidebar-light .campaign-context-single {
    color: var(--cw-text-primary);
}

.sidebar.sidebar-light .campaign-context label,
.sidebar.sidebar-light .campaign-context-label {
    color: var(--cw-text-muted);
}

.sidebar.sidebar-light .campaign-context select,
.sidebar.sidebar-light .campaign-context select option {
    border-color: var(--cw-border);
    background: var(--cw-surface);
    color: var(--cw-text-primary);
}

.sidebar.collapsed .campaign-context {
    display: none;
}

/* Phones keep the global 16px so iOS does not zoom on focus. */
@media (min-width: 1000px) {
    .campaign-context select {
        font-size: 12.5px !important;
    }
}

.sidebar-menu li {
    margin-bottom: 1px;
}

.sidebar-menu a,
.sidebar-menu button {
    color: var(--cw-text-secondary);
    border-radius: 7px;
    min-height: 31px;
    padding: 6px 10px;
    font-size: 12.5px;
    font-weight: 500;
    gap: 9px;
}

.sidebar:not(.sidebar-light) .sidebar-menu a,
.sidebar:not(.sidebar-light) .sidebar-menu button {
    color: var(--cw-nav-text);
}

.sidebar-menu a:hover,
.sidebar-menu button:hover {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    transform: none;
}

.sidebar:not(.sidebar-light) .sidebar-menu a:hover,
.sidebar:not(.sidebar-light) .sidebar-menu button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--cw-nav-text-strong);
}

.sidebar-menu a.active,
.sidebar-menu button.active {
    background: var(--cw-sidebar-active-bg);
    color: var(--cw-primary);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--cw-primary);
}

.sidebar:not(.sidebar-light) .sidebar-menu a.active,
.sidebar:not(.sidebar-light) .sidebar-menu button.active {
    background: var(--cw-nav-active-bg);
    color: var(--cw-nav-text-strong);
    box-shadow: inset 2px 0 0 var(--cw-nav-accent);
}

.sidebar-menu i {
    width: 15px;
    font-size: 12.5px;
    text-align: center;
}

.submenu-arrow {
    color: var(--cw-text-muted);
}

.sidebar:not(.sidebar-light) .submenu-arrow {
    color: var(--cw-nav-muted);
}

.submenu-toggle.open .submenu-arrow {
    color: var(--cw-primary);
}

.submenu-toggle.active {
    background: var(--cw-sidebar-active-bg);
    color: var(--cw-primary);
}

.sidebar:not(.sidebar-light) .submenu-toggle.active {
    background: var(--cw-nav-active-bg);
    color: var(--cw-nav-text-strong);
}

.sidebar-submenu {
    background: var(--cw-surface-soft);
}

.sidebar:not(.sidebar-light) .sidebar-submenu {
    background: rgba(0, 0, 0, 0.20);
}

.sidebar-submenu a {
    color: var(--cw-text-secondary);
    min-height: 26px;
    padding: 4px 10px;
    font-size: 11.5px;
}

.sidebar:not(.sidebar-light) .sidebar-submenu a {
    color: var(--cw-nav-text);
}

.sidebar-submenu a:hover {
    background: var(--cw-border-soft);
    color: var(--cw-text-primary);
    border-left-color: var(--cw-primary);
}

.sidebar:not(.sidebar-light) .sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--cw-nav-text-strong);
    border-left-color: var(--cw-nav-accent);
}

.sidebar-submenu a.active {
    background: var(--cw-sidebar-active-bg);
    color: var(--cw-primary);
    border-left-color: var(--cw-primary);
    font-weight: 600;
}

.sidebar:not(.sidebar-light) .sidebar-submenu a.active {
    background: var(--cw-nav-active-bg);
    color: var(--cw-nav-text-strong);
    border-left-color: var(--cw-nav-accent);
}

/* Profit Analysis sub-menu (Profit & Loss, Profit Analysis, Cash Flow, Simulation): no slide or fade under the
   pointer (owner 2026-11-05). The item keeps its place; only the colours of the hover state change, at once. */
.sidebar-submenu,
.sidebar-submenu a,
.sidebar-submenu a:hover { transition: none !important; }
.sidebar-submenu a:hover { padding-left: 10px; }
.sidebar.collapsed .sidebar-submenu a:hover { padding-left: 16px; }

/* the collapsed flyout submenu keeps a dark chip in every theme */
.sidebar.collapsed .sidebar-submenu a {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar.collapsed .sidebar-submenu a:hover,
.sidebar.collapsed .sidebar-submenu a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-theme,
.sidebar-logout {
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid var(--cw-nav-border);
    padding: 8px;
}

.sidebar:not(.sidebar-light) .sidebar-theme button {
    width: 100% !important;
    padding: 7px 10px !important;
    background: var(--cw-nav-bg-soft) !important;
    border: 1px solid var(--cw-nav-border) !important;
    color: var(--cw-nav-text) !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    gap: 8px !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.sidebar:not(.sidebar-light) .sidebar-theme button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--cw-nav-text-strong) !important;
    transform: none !important;
}

.sidebar:not(.sidebar-light) .sidebar-theme button i,
.sidebar:not(.sidebar-light) .sidebar-theme button span {
    font-size: 12px;
}

.sidebar-logout button {
    background: var(--cw-red-soft);
    border: 1px solid rgba(217, 128, 143, 0.3);
    color: var(--cw-red);
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 12px;
}

.sidebar:not(.sidebar-light) .sidebar-logout button {
    background: rgba(217, 128, 143, 0.12) !important;
    border: 1px solid rgba(217, 128, 143, 0.26) !important;
    color: #E8A9B3 !important;
}

.sidebar-logout button:hover {
    background: rgba(217, 128, 143, 0.2);
    transform: none;
}

/* 'white' theme mode — light sidebar stays available */
.sidebar.sidebar-light {
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    border-right: 1px solid var(--cw-border);
}

.sidebar.sidebar-light .sidebar-header,
.sidebar.sidebar-light .sidebar-logo-section {
    background: var(--cw-surface);
    border-bottom: 1px solid var(--cw-border);
}

.sidebar.sidebar-light .sidebar-title {
    color: var(--cw-text-primary);
}

.sidebar.sidebar-light .sidebar-menu-title {
    color: var(--cw-text-muted);
}

.sidebar.sidebar-light .sidebar-menu a,
.sidebar.sidebar-light .sidebar-menu button,
.sidebar.sidebar-light .sidebar-submenu a {
    color: var(--cw-text-secondary);
}

.sidebar.sidebar-light .sidebar-submenu {
    background: var(--cw-surface-soft);
}

.sidebar.sidebar-light .sidebar-theme,
.sidebar.sidebar-light .sidebar-logout {
    background: var(--cw-surface-soft);
    border-top: 1px solid var(--cw-border);
}

/* ===================== SHELL: QUICK-ADD (unscoped — injected on every page) ===================== */
.desktop-quick-add-btn {
    background: var(--cw-tint-blue);
    color: var(--cw-primary);
    box-shadow: none;
}

.desktop-quick-add-btn:hover {
    background: var(--cw-primary-soft);
    box-shadow: none;
    transform: none;
}

/* ===================== SHELL: DASHBOARD TOP BAR (scoped) ===================== */
body.page-dashboard .header {
    display: none;
}

body.page-dashboard .dash-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

body.page-dashboard .dash-topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
    max-width: 380px;
    height: 34px;
    padding: 0 11px;
    background: var(--bg-card);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--cw-text-muted);
}

body.page-dashboard .dash-topbar-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

body.page-dashboard .dash-topbar-search input::placeholder {
    color: var(--cw-text-muted);
}

body.page-dashboard .dash-search-kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--cw-text-muted);
    background: var(--cw-surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 2px 6px;
}

body.page-dashboard .time-filter-tabs {
    display: inline-flex;
    background: var(--cw-surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: none;
    padding: 3px;
    gap: 2px;
}

body.page-dashboard .time-filter-tabs button {
    border-radius: 7px;
    padding: 5px 11px;
    color: var(--text-secondary);
}

body.page-dashboard .time-filter-tabs button:hover {
    background: var(--bg-card);
    color: var(--cw-primary);
}

body.page-dashboard .time-filter-tabs button.active {
    background: var(--bg-card);
    color: var(--cw-primary);
    box-shadow: 0 1px 4px var(--shadow-color);
}

body.page-dashboard .dash-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

body.page-dashboard .dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* shared notification bell + quick-add, injected here by sidebar.php */
body.page-dashboard .dash-topbar-actions #notifBellWrap {
    margin-right: 0;
}

body.page-dashboard .dash-topbar-actions #notifBell i {
    font-size: 17px !important;
    color: var(--cw-text-secondary) !important;
}

body.page-dashboard .dash-topbar-actions #notifBell:hover i {
    color: var(--cw-primary) !important;
}

body.page-dashboard .dash-topbar-actions #notifPanel {
    right: 0;
}

body.page-dashboard .dash-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-dashboard .dash-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--cw-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

body.page-dashboard .dash-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.page-dashboard .dash-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

body.page-dashboard .dash-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

body.page-dashboard .dash-user-role {
    font-size: 11px;
    color: var(--cw-text-muted);
}

body.page-dashboard .dash-lang-switch {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--cw-text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background .15s, color .15s;
}

body.page-dashboard .dash-lang-switch:hover {
    background: var(--cw-tint-blue);
    color: var(--cw-primary);
}

/* ===================== DASHBOARD: HERO ===================== */
body.page-dashboard .dash-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 84px;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    overflow: hidden;
}

body.page-dashboard .dash-hero-art {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='200' viewBox='0 0 600 200'%3E%3Cg fill='none' stroke='%23EAB393' stroke-width='1.2' opacity='0.16'%3E%3Cpath d='M0 40 Q 100 0 200 40 T 400 40 T 600 40'/%3E%3Cpath d='M0 80 Q 100 40 200 80 T 400 80 T 600 80'/%3E%3Cpath d='M0 120 Q 100 80 200 120 T 400 120 T 600 120'/%3E%3Cpath d='M0 160 Q 100 120 200 160 T 400 160 T 600 160'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 60% auto;
    pointer-events: none;
}

body.page-dashboard .dash-hero-left {
    position: relative;
    z-index: 1;
}

body.page-dashboard .dash-hero-overline {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--cw-text-muted);
    margin-bottom: 3px;
}

body.page-dashboard .dash-hero-greeting {
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.15;
    margin: 0 0 3px;
}

body.page-dashboard .dash-hero-name {
    color: var(--cw-primary);
}

body.page-dashboard .dash-hero-sub {
    font-size: 12.5px;
    color: var(--cw-text-secondary);
}

body.page-dashboard .dash-season-pill {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    flex-shrink: 0;
}

body.page-dashboard .dash-season-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cw-green);
    flex-shrink: 0;
}

body.page-dashboard .dash-season-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

body.page-dashboard .dash-season-status {
    font-size: 10px;
    color: var(--cw-green);
}

/* ===================== DASHBOARD: KPI CARDS ===================== */
body.page-dashboard .kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 8px 24px var(--shadow-color);
}

body.page-dashboard .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px var(--shadow-hover);
}

body.page-dashboard .kpi-card-icon {
    border-radius: 7px;
    width: 26px;
    height: 26px;
    font-size: 11px;
}

body.page-dashboard .kpi-card-value {
    color: var(--text-primary);
    font-weight: 650;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

body.page-dashboard .kpi-card-top {
    margin-bottom: 6px;
}

/* Dashboard figures that ignore the selected campaign. */
body.page-dashboard .kpi-scope {
    font-size: 10px;
    font-weight: 600;
    color: var(--cw-text-muted);
    border: 1px solid var(--cw-border);
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

body.page-dashboard .category-cards-scope {
    grid-column: 1 / -1;
}

body.page-dashboard .kpi-card-sub {
    font-size: 10.5px;
}

body.page-dashboard .kpi-card-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cw-text-muted);
    margin-bottom: 3px;
}

body.page-dashboard .dashboard-primary-kpi .kpi-card {
    padding: 12px 16px;
    position: relative;
}

body.page-dashboard .dashboard-primary-kpi .kpi-card-icon {
    width: 26px;
    height: 26px;
    font-size: 11px;
}

body.page-dashboard .dashboard-primary-kpi .kpi-card-value {
    font-size: 21px;
}

body.page-dashboard .dashboard-primary-kpi .kpi-card-label {
    font-size: 10px;
}

/* subtle decorative wave accent behind the primary metric — stands in for a
   per-card sparkline without a second Chart.js instance per card */
body.page-dashboard .dashboard-primary-kpi .kpi-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 32px;
    opacity: 0.45;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
}

body.page-dashboard .dashboard-primary-kpi .kpi-card:nth-child(1)::after {
    background-image: linear-gradient(180deg, rgba(59,130,246,0) 0%, rgba(59,130,246,0.07) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 36 L30 30 L60 34 L90 18 L120 24 L150 10 L180 14 L200 4' fill='none' stroke='%233B82F6' stroke-width='2'/%3E%3C/svg%3E");
}

body.page-dashboard .dashboard-primary-kpi .kpi-card:nth-child(2)::after {
    background-image: linear-gradient(180deg, rgba(227,163,121,0) 0%, rgba(227,163,121,0.07) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 30 L30 34 L60 20 L90 26 L120 12 L150 18 L180 6 L200 10' fill='none' stroke='%23E3A379' stroke-width='2'/%3E%3C/svg%3E");
}

body.page-dashboard .dashboard-primary-kpi .kpi-card:nth-child(3)::after {
    background-image: linear-gradient(180deg, rgba(79,169,140,0) 0%, rgba(79,169,140,0.07) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 38 L30 32 L60 34 L90 22 L120 24 L150 14 L180 16 L200 6' fill='none' stroke='%234FA98C' stroke-width='2'/%3E%3C/svg%3E");
}

body.page-dashboard .dashboard-kpi-grid .kpi-card {
    padding: 10px 12px;
}

body.page-dashboard .dashboard-kpi-grid .kpi-card-icon {
    width: 24px;
    height: 24px;
    font-size: 10.5px;
    border-radius: 7px;
}

/* ===================== DASHBOARD: CATEGORY CARDS ===================== */
body.page-dashboard .category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 6px 18px var(--shadow-color);
}

body.page-dashboard .category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px var(--shadow-hover);
    border-color: var(--cw-primary);
}

/* ===================== DASHBOARD: CHARTS ===================== */
body.page-dashboard .prices-chart-card,
body.page-dashboard .overview-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 6px 18px var(--shadow-color);
}

body.page-dashboard .prices-chart-card h3,
body.page-dashboard .overview-chart-card h3 {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

body.page-dashboard .prices-chart-card h3 i,
body.page-dashboard .overview-chart-card h3 i {
    color: var(--cw-primary);
}

body.page-dashboard .price-trend-tabs {
    background: var(--cw-surface-soft);
    border-color: var(--border-color);
}

body.page-dashboard .price-trend-tabs .ptt-btn.active {
    background: var(--cw-primary);
}

/* ===================== DASHBOARD: REVENUE EDITORIAL CARD ===================== */
body.page-dashboard .revenue-highlight {
    background: linear-gradient(135deg, #D9B08F 0%, #C29970 55%, #A67F5E 100%);
    border-radius: 12px;
    padding: 16px;
    min-height: 190px;
    position: relative;
}

body.page-dashboard .revenue-highlight::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='280' viewBox='0 0 320 280'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.12'%3E%3Cpath d='M-20 60 Q 60 20 140 60 T 300 60'/%3E%3Cpath d='M-20 110 Q 60 70 140 110 T 300 110'/%3E%3Cpath d='M-20 160 Q 60 120 140 160 T 300 160'/%3E%3Cpath d='M-20 210 Q 60 170 140 210 T 300 210'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 14px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 968px) {
    body.page-dashboard .dash-hero {
        flex-wrap: wrap;
    }
    body.page-dashboard .dash-hero-art {
        background-size: 90% auto;
    }
}

@media (max-width: 768px) {
    body.page-dashboard .dash-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    body.page-dashboard .dash-topbar-search {
        max-width: none;
    }
    body.page-dashboard .dash-topbar-right {
        margin-left: 0;
        justify-content: space-between;
    }
    body.page-dashboard .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    body.page-dashboard .dash-hero-greeting {
        font-size: 24px;
    }
    body.page-dashboard .dash-hero-art {
        display: none;
    }
}


/* ===================== PHASE 2: DENSITY + PASTEL PASS ===================== */
/* Dark navy nav rail, pastel accents, and a tighter dashboard rhythm so the
   whole page fits a desktop viewport without scrolling. */

.sidebar {
    width: 230px;
}

body.page-dashboard .main-content {
    padding: 12px 16px;
}

body.page-dashboard .dashboard-primary-kpi,
body.page-dashboard .dashboard-kpi-grid {
    gap: 12px;
}

/* 7 secondary KPIs — flow them across one row on a wide screen instead of
   leaving one orphaned on a second row */
body.page-dashboard .dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

/* Mid-size desktops (e.g. 1366x768) fit only six of the seven cards, leaving the
   last one orphaned on its own row. Settle on a tidy 4-up grid for that band;
   the 2-up phone rule in the base part still applies below 480px. */
@media (min-width: 1000px) and (max-width: 1279px) {
    body.page-dashboard .dashboard-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* category strip + the AI-insights card share one row (was two full-width rows) */
body.page-dashboard .overview-row-2 {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

body.page-dashboard .overview-row-2 .category-cards-wrapper {
    flex: 2 1 540px;
}

body.page-dashboard .overview-row-2 .dash-ai-card {
    flex: 1 1 300px;
    min-width: 250px;
    margin: 0;
}

body.page-dashboard .dashboard-primary-kpi {
    margin-bottom: 12px;
}

body.page-dashboard .dashboard-kpi-grid {
    margin-bottom: 10px;
}

body.page-dashboard .dashboard-charts-row {
    gap: 12px;
    margin-bottom: 10px;
}

body.page-dashboard .chart-container {
    height: 190px;
}

body.page-dashboard .overview-bottom-row {
    grid-template-columns: 1fr 1fr 300px;
    gap: 12px;
    margin-bottom: 12px;
}

body.page-dashboard .revenue-highlight-label {
    font-size: 12px;
    margin-bottom: 4px;
}

body.page-dashboard .revenue-highlight-value {
    font-size: 26px;
    font-variant-numeric: tabular-nums;
}

body.page-dashboard .revenue-highlight-sub {
    font-size: 11px;
    margin-bottom: 10px;
}

body.page-dashboard .revenue-sparkline-container {
    min-height: 60px;
}

body.page-dashboard .category-cards-wrapper {
    gap: 8px;
}

body.page-dashboard .category-card-count {
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

body.page-dashboard .category-card-label {
    font-size: 10.5px;
}

body.page-dashboard .category-card-icon {
    width: 26px;
    height: 26px;
    font-size: 11px;
    border-radius: 8px;
    margin: 0 auto 5px;
}

body.page-dashboard .category-card-icon.icon-blue   { background: rgba(59, 130, 246, 0.10);  color: #3B82F6; }
body.page-dashboard .category-card-icon.icon-green  { background: rgba(79, 169, 140, 0.12);  color: #4FA98C; }
body.page-dashboard .category-card-icon.icon-orange { background: rgba(227, 163, 121, 0.16); color: #C08A5E; }
body.page-dashboard .category-card-icon.icon-purple { background: rgba(154, 138, 212, 0.14); color: #8B79C8; }
body.page-dashboard .category-card-icon.icon-teal   { background: rgba(79, 169, 140, 0.10);  color: #479A8E; }

/* the secondary-KPI accent rules read as soft pastel, not saturated strips */
body.page-dashboard .kpi-card-accent {
    opacity: 0.55;
    height: 3px;
}

/* ===================== RESPONSIVE CORRECTIONS =====================
   Everything above is scoped with `body.page-dashboard`, which outranks the
   plain selectors in the responsive blocks of the base part. On a phone those
   desktop rules therefore applied too: `.overview-bottom-row` stayed a fixed
   `1fr 1fr 300px` grid inside a 358px column, giving the row a 992px scroll
   width and making .main-content (overflow-x:auto) scroll sideways — the
   whole dashboard became a 1008px strip on a 390px screen.
   These rules come last and win, restoring the stacking the base part intends.
   Re-check with: node work/tools/cdp_shot.js --width 390 --height 844
   (assert .main-content scrollWidth === clientWidth). */

@media (max-width: 999px) {
    body.page-dashboard .overview-bottom-row {
        grid-template-columns: 1fr;
    }

    body.page-dashboard .dashboard-charts-row {
        grid-template-columns: 1fr;
    }

    body.page-dashboard .overview-row-2 {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    body.page-dashboard .overview-row-2 .category-cards-wrapper,
    body.page-dashboard .overview-row-2 .dash-ai-card {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

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

    /* Icons: the desktop shrink (24-26px) reads as far too small on a phone and
       leaves the cards looking empty. Mid-size here — bigger than desktop,
       smaller than the 52px original. */
    body.page-dashboard .category-card-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-radius: 11px;
    }

    body.page-dashboard .kpi-card-icon,
    body.page-dashboard .dashboard-primary-kpi .kpi-card-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    body.page-dashboard .dashboard-kpi-grid .kpi-card-icon {
        width: 34px;
        height: 34px;
        font-size: 13.5px;
    }
}

@media (max-width: 480px) {
    body.page-dashboard .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    body.page-dashboard .category-cards-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== PAGE: SUPPLIER MASTER ===== */
/* Scoped to body.page-suppliers only — no other page is affected.
   See DESIGN.md §7.3: a body-scoped rule outranks a plain selector inside a
   the base part @media block at every width, so layout-affecting properties
   already governed by the base part (.filters-grid, .modal width, .dt-buttons
   flex) are deliberately left untouched here — only colour/radius/type. */

body.page-suppliers .header h1 {
    font-size: 19px;
    font-weight: 600;
}

body.page-suppliers .header > div {
    font-size: 13px;
    color: var(--cw-text-secondary);
}

body.page-suppliers .data-section {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}

body.page-suppliers .section-header h2 {
    font-size: 14px;
    font-weight: 600;
}

/* --- Buttons: pastel house style (DESIGN.md §6.9) --- */
body.page-suppliers .btn {
    border-radius: 8px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

body.page-suppliers .btn-primary {
    background: var(--cw-primary-soft);
    color: var(--cw-primary-dark);
    border: 1px solid var(--cw-primary-soft);
}

body.page-suppliers .btn-primary:hover {
    background: var(--cw-primary-soft);
    border-color: var(--cw-primary);
    transform: none;
}

body.page-suppliers .btn-success {
    background: var(--cw-green-soft);
    color: var(--cw-green);
    border: 1px solid var(--cw-green-soft);
}

body.page-suppliers .btn-success:hover {
    border-color: var(--cw-green);
    transform: none;
}

body.page-suppliers .btn-secondary {
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    border: 1px solid var(--cw-border);
}

body.page-suppliers .btn-secondary:hover {
    background: var(--cw-surface-soft);
    transform: none;
}

body.page-suppliers .btn-danger {
    background: var(--cw-red-soft);
    color: var(--cw-red);
    border: 1px solid var(--cw-red-soft);
}

body.page-suppliers .btn-danger:hover {
    border-color: var(--cw-red);
    transform: none;
}

/* --- Filters panel (DESIGN.md §6.7) --- */
body.page-suppliers .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}

body.page-suppliers .filters-header {
    border-bottom: 1px solid var(--cw-border);
}

body.page-suppliers .filters-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-text-primary);
}

body.page-suppliers .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-text-muted);
    letter-spacing: .02em;
}

body.page-suppliers .filter-input {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--cw-text-primary);
    padding: 8px 10px;
    font-size: 13px;
}

/* --- Form controls in the add/edit modal (DESIGN.md §6.8) --- */
body.page-suppliers .form-group label {
    font-size: 12px;
    color: var(--cw-text-muted);
    font-weight: 600;
}

body.page-suppliers .form-group input,
body.page-suppliers .form-group select,
body.page-suppliers .form-group textarea {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    padding: 8px 10px;
    font-size: 13px;
}

body.page-suppliers .form-group input:focus,
body.page-suppliers .form-group select:focus,
body.page-suppliers .form-group textarea:focus {
    box-shadow: none;
}

/* --- Modal (DESIGN.md §6.11) — surface header, not a saturated navy band --- */
body.page-suppliers .modal {
    border-radius: 16px;
    border: 1px solid var(--cw-border);
}

body.page-suppliers .modal-header {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
}

body.page-suppliers .modal-header h3 {
    font-size: 15px;
}

body.page-suppliers .modal-body {
    padding: 20px;
}

body.page-suppliers .close-btn {
    color: var(--cw-text-muted);
}

body.page-suppliers .close-btn:hover {
    background: var(--cw-border-soft);
    transform: none;
}

/* --- Status pills (DESIGN.md §6.10) --- */
body.page-suppliers .status-badge {
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

body.page-suppliers .status-active {
    background: var(--cw-green-soft);
    color: var(--cw-green);
}

body.page-suppliers .status-inactive {
    background: var(--cw-red-soft);
    color: var(--cw-red);
}

/* --- Action icon buttons (DESIGN.md §6.9) --- */
body.page-suppliers .action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
}

body.page-suppliers .action-icon:hover {
    background: var(--cw-border-soft);
    transform: none;
}

body.page-suppliers .action-icon.view-icon {
    color: var(--cw-primary);
}

body.page-suppliers .action-icon.view-icon:hover {
    background: var(--cw-primary-soft);
}

body.page-suppliers .action-icon.edit-icon {
    color: var(--cw-orange);
}

body.page-suppliers .action-icon.edit-icon:hover {
    background: var(--cw-orange-soft);
}

body.page-suppliers .action-icon.delete-icon {
    color: var(--cw-red);
}

body.page-suppliers .action-icon.delete-icon:hover {
    background: var(--cw-red-soft);
}

body.page-suppliers .action-icon.toggle-on {
    color: var(--cw-green);
}

body.page-suppliers .action-icon.toggle-off {
    color: var(--cw-red);
}

/* --- DataTables grid (DESIGN.md §6.6) --- */
body.page-suppliers table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-muted) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    border-bottom: 1px solid var(--cw-border);
}

body.page-suppliers table.dataTable tbody td {
    font-size: 13px;
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border-soft);
}

body.page-suppliers table.dataTable tbody td.col-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body.page-suppliers .dataTables_filter input,
body.page-suppliers .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    padding: 6px 8px;
}

body.page-suppliers .dt-button {
    background: var(--cw-surface) !important;
    color: var(--cw-text-secondary) !important;
    border: 1px solid var(--cw-border) !important;
    border-radius: 8px !important;
}

body.page-suppliers .dt-button:hover {
    background: var(--cw-surface-soft) !important;
}

body.page-suppliers .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary);
}

body.page-suppliers .dataTables_paginate .paginate_button.current {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-primary-dark) !important;
    border-color: var(--cw-primary-soft) !important;
}

body.page-suppliers .dataTables_paginate .paginate_button:hover {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-primary) !important;
    border-color: var(--cw-border) !important;
}

/* ===== PAGE: SUPPLIER RANKING ===== */
/* Same cards, controls and table treatment as Supplier Master. */
body.page-supplier-ranking .main-content { min-width: 0; }
body.page-supplier-ranking .breadcrumb { flex-wrap: wrap; color: var(--cw-text-secondary); }
body.page-supplier-ranking .breadcrumb a { color: var(--cw-text-secondary); }
body.page-supplier-ranking .header,
body.page-supplier-ranking .data-section,
body.page-supplier-ranking .movement-strip,
body.page-supplier-ranking .tier-summary-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}
body.page-supplier-ranking .header { flex-wrap: wrap; gap: 12px; }
body.page-supplier-ranking .header h1 { font-size: 19px; font-weight: 600; }
body.page-supplier-ranking .header h1 i { font-size: 16px; line-height: 1; }
body.page-supplier-ranking .header > div { font-size: 13px; color: var(--cw-text-secondary); }
body.page-supplier-ranking .section-header { gap: 12px; }
body.page-supplier-ranking .section-header h2 { font-size: 14px; font-weight: 600; }

/* --- Buttons and controls (DESIGN.md §6.8–9) --- */
body.page-supplier-ranking .btn,
body.page-supplier-ranking .swal2-confirm {
    border-radius: 8px;
    min-height: 30px;
    font-size: 13px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
body.page-supplier-ranking .btn-primary,
body.page-supplier-ranking .swal2-confirm {
    background: var(--cw-primary-soft);
    color: var(--cw-primary-dark);
    border: 1px solid var(--cw-primary-soft);
    box-shadow: none;
}
body.page-supplier-ranking .btn-primary:hover,
body.page-supplier-ranking .swal2-confirm:hover { background: var(--cw-primary-soft); border-color: var(--cw-primary); transform: none; }
body.page-supplier-ranking .main-content :focus-visible,
body.page-supplier-ranking .swal2-confirm:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
body.page-supplier-ranking .dataTables_filter input,
body.page-supplier-ranking .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--cw-text-primary);
    padding: 8px 10px;
    font-size: 13px !important;
    min-height: 30px;
    max-width: 100%;
}
body.page-supplier-ranking .dt-button {
    background: var(--cw-surface) !important;
    color: var(--cw-text-secondary) !important;
    border: 1px solid var(--cw-border) !important;
    border-radius: 8px !important;
    min-height: 30px;
    font-size: 13px;
}
body.page-supplier-ranking .dt-button:hover { background: var(--cw-surface-soft) !important; box-shadow: none !important; }
body.page-supplier-ranking .swal2-popup,
body.page-supplier-ranking div.dt-button-info {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    max-width: calc(100% - 24px);
}
body.page-supplier-ranking .swal2-title { color: var(--cw-text-primary); font-size: 19px; }
body.page-supplier-ranking .swal2-html-container { color: var(--cw-text-secondary); font-size: 13px; }
body.page-supplier-ranking div.dt-button-info h2 { background: var(--cw-surface-soft); font-size: 14px; }

/* --- Top-3 podium highlight --- */
/* DOM stays rank order 1,2,3 (role="list" order, tests/supplier-ranking.js:80); the classic
   podium look — #1 centred and tallest, #2 left, #3 right, shortest — comes purely from
   CSS order + per-rank sizing, baseline-aligned with flex-end. */
body.page-supplier-ranking .rank-podium { display: flex; gap: 12px; align-items: flex-end; }
body.page-supplier-ranking .podium-card {
    flex: 1 1 0;
    min-width: 0;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-top: 3px solid transparent;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}
body.page-supplier-ranking .podium-rank-1 { order: 2; padding: 22px 14px; border-top-color: var(--cw-orange); }
body.page-supplier-ranking .podium-rank-2 { order: 1; border-top-color: var(--cw-primary); }
body.page-supplier-ranking .podium-rank-3 { order: 3; padding: 10px 14px; border-top-color: var(--cw-green); }
body.page-supplier-ranking .podium-badge { font-size: 11px; font-weight: 700; color: var(--cw-text-secondary); }
body.page-supplier-ranking .podium-rank-1 .podium-badge i { color: var(--cw-orange); }
body.page-supplier-ranking .podium-rank-2 .podium-badge i { color: var(--cw-primary); }
body.page-supplier-ranking .podium-rank-3 .podium-badge i { color: var(--cw-green); }
body.page-supplier-ranking .podium-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--cw-primary-soft); color: var(--cw-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; margin: 8px auto;
}
body.page-supplier-ranking .podium-name { font-weight: 600; font-size: 13px; color: var(--cw-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.page-supplier-ranking .podium-score { font-size: 20px; font-weight: 700; color: var(--cw-text-primary); margin-top: 8px; font-variant-numeric: tabular-nums; }
body.page-supplier-ranking .podium-rank-1 .podium-score { font-size: 26px; }
body.page-supplier-ranking .podium-rank-3 .podium-score { font-size: 18px; }
body.page-supplier-ranking .podium-move { margin-top: 6px; }
body.page-supplier-ranking .rank-podium-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; color: var(--cw-text-secondary); font-size: 13px; }
body.page-supplier-ranking .rank-podium-empty i { font-size: 22px; color: var(--cw-text-muted); }

/* --- Scoring explanation and tier cards --- */
body.page-supplier-ranking .ranking-explainer {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-left: 3px solid var(--cw-primary);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--cw-text-secondary);
}
/* <details>/<summary> — native, keyboard-operable disclosure; closed by default so the
   formula explanation never reads as a wall of always-open text. */
body.page-supplier-ranking .ranking-explainer summary { color: var(--cw-text-primary); font-weight: 600; cursor: pointer; }
body.page-supplier-ranking .ranking-explainer summary:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; border-radius: 6px; }
body.page-supplier-ranking .ranking-explainer[open] summary { margin-bottom: 8px; }
body.page-supplier-ranking .ranking-formula { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
body.page-supplier-ranking .ranking-formula-note { margin-top: 8px; font-size: 12px; }
body.page-supplier-ranking .tier-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
body.page-supplier-ranking .tier-summary-card {
    padding: 12px;
    border-left-width: 3px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    transition: transform .15s, box-shadow .15s;
}
body.page-supplier-ranking .tier-summary-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--shadow-hover); }
body.page-supplier-ranking .tier-a-border { border-left-color: var(--cw-green); }
body.page-supplier-ranking .tier-b-border { border-left-color: var(--cw-primary); }
body.page-supplier-ranking .tier-c-border { border-left-color: var(--cw-orange); }
body.page-supplier-ranking .tier-d-border { border-left-color: var(--cw-red); }
body.page-supplier-ranking .tier-summary-icon { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; line-height: 1; }
body.page-supplier-ranking .tier-summary-icon i { line-height: 1; }
body.page-supplier-ranking .tier-a-border .tier-summary-icon,
body.page-supplier-ranking .tier-A,
body.page-supplier-ranking .mv-up,
body.page-supplier-ranking .mc-up { background: var(--cw-green-soft); color: var(--cw-green); }
body.page-supplier-ranking .tier-b-border .tier-summary-icon,
body.page-supplier-ranking .tier-B { background: var(--cw-primary-soft); color: var(--cw-primary); }
body.page-supplier-ranking .tier-c-border .tier-summary-icon,
body.page-supplier-ranking .tier-C { background: var(--cw-orange-soft); color: var(--cw-orange); }
body.page-supplier-ranking .tier-d-border .tier-summary-icon,
body.page-supplier-ranking .tier-D,
body.page-supplier-ranking .mv-down,
body.page-supplier-ranking .mc-down { background: var(--cw-red-soft); color: var(--cw-red); }
body.page-supplier-ranking .mv-same,
body.page-supplier-ranking .mc-same,
body.page-supplier-ranking .mv-pending { background: var(--cw-surface-soft); color: var(--cw-text-secondary); }
body.page-supplier-ranking .mv-new,
body.page-supplier-ranking .mc-new { background: var(--cw-purple-soft); color: var(--cw-purple); }
body.page-supplier-ranking .tier-summary-value { font-size: 24px; font-weight: 700; color: var(--cw-text-primary); line-height: 1; font-variant-numeric: tabular-nums; }
body.page-supplier-ranking .tier-summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--cw-text-secondary); margin-top: 4px; font-weight: 600; }

/* --- Movement and score indicators --- */
body.page-supplier-ranking .movement-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding: 12px 16px; align-items: center; }
body.page-supplier-ranking .movement-strip-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--cw-text-secondary); font-weight: 600; }
body.page-supplier-ranking .movement-chip,
body.page-supplier-ranking .movement-pill,
body.page-supplier-ranking .tier-badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; line-height: 1.4; }
body.page-supplier-ranking .movement-chip i { font-size: 11px; line-height: 1; }
body.page-supplier-ranking .baseline-note { font-size: 11px; color: var(--cw-text-secondary); margin-left: auto; }
body.page-supplier-ranking .rank-stack { display: flex; flex-direction: column; align-items: center; gap: 4px; }
body.page-supplier-ranking .rank-num { font-size: 13px; font-weight: 700; color: var(--cw-text-primary); min-width: 32px; text-align: center; }
body.page-supplier-ranking .rank-1 i,
body.page-supplier-ranking .rank-3 i { color: var(--cw-orange); }
body.page-supplier-ranking .rank-2 i { color: var(--cw-text-secondary); }
/* hidden by default — desktop already has the movement column; shown ≤600px (media query below)
   where that column is hidden, so the rank cell is the only place left to see movement. */
body.page-supplier-ranking .rank-mv { display: none; font-size: 10px; font-weight: 700; margin-left: 3px; }
body.page-supplier-ranking .rank-mv i { font-size: 9px; margin-right: 1px; }
body.page-supplier-ranking .rank-mv-up { color: var(--cw-green); }
body.page-supplier-ranking .rank-mv-down { color: var(--cw-red); }
body.page-supplier-ranking .rank-mv-same,
body.page-supplier-ranking .rank-mv-new { color: var(--cw-text-secondary); }
/* 10-segment discrete score bar — token-based, no saturated gradient; segments approximate
   the score, the numeric value stays the source of truth. */
body.page-supplier-ranking .score-segments { display: flex; gap: 2px; width: 100%; }
body.page-supplier-ranking .score-seg { flex: 1 1 0; height: 8px; border-radius: 2px; background: var(--cw-border-soft); }
body.page-supplier-ranking .score-text { font-weight: 700; font-size: 13px; margin-top: 4px; display: block; }

/* --- DataTables grid (DESIGN.md §6.6) --- */
/* NOTE: no overflow-x here — this table uses DataTables `responsive: true` (pre-existing),
   which already collapses columns on narrow screens. Putting an `overflow-x: auto` wrapper
   around a responsive table makes the plugin and the scroll container fight over the width
   and the browser relayouts in a loop (it froze the page in testing). */
body.page-supplier-ranking #tableContainer { max-width: 100%; }
body.page-supplier-ranking table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-secondary) !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    border-bottom: 1px solid var(--cw-border);
}
body.page-supplier-ranking table.dataTable tbody td { font-size: 13px; color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border-soft); }
body.page-supplier-ranking table.dataTable tbody tr { background: var(--cw-surface); }
body.page-supplier-ranking table.dataTable tbody tr:hover { background: var(--table-hover); }
body.page-supplier-ranking #rankingTable th:nth-child(n+5),
body.page-supplier-ranking #rankingTable td:nth-child(n+5) { text-align: right; font-variant-numeric: tabular-nums; }
body.page-supplier-ranking .dataTables_info,
body.page-supplier-ranking .dataTables_filter,
body.page-supplier-ranking .dataTables_paginate { color: var(--cw-text-secondary); font-size: 12px; }
body.page-supplier-ranking .dataTables_paginate .paginate_button { border-radius: 8px; color: var(--cw-text-secondary) !important; min-height: 30px; }
body.page-supplier-ranking .dataTables_paginate .paginate_button.current { background: var(--cw-primary-soft) !important; color: var(--cw-primary-dark) !important; border-color: var(--cw-primary-soft) !important; }
body.page-supplier-ranking .dataTables_paginate .paginate_button:hover { background: var(--cw-surface-soft) !important; color: var(--cw-text-primary) !important; border-color: var(--cw-border) !important; box-shadow: none; }

/* --- Expanded supplier metrics --- */
body.page-supplier-ranking .rank-detail { padding: 16px; background: var(--cw-surface-soft); white-space: normal; }
body.page-supplier-ranking .rank-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.page-supplier-ranking .rank-metric { background: var(--cw-surface); border: 1px solid var(--cw-border); border-radius: 16px; padding: 12px; min-width: 0; }
body.page-supplier-ranking .rank-metric-wide { grid-column: 1 / -1; }
body.page-supplier-ranking .rank-metric-label { font-size: 11px; text-transform: uppercase; color: var(--cw-text-secondary); font-weight: 600; letter-spacing: .06em; }
body.page-supplier-ranking .rank-metric-value { font-size: 20px; font-weight: 700; color: var(--cw-text-primary); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Rows are tap-to-expand; the real disclosure control is the button in the name cell
   (row semantics stay on <tr> for assistive tech — see DESIGN.md §6.14). */
body.page-supplier-ranking table.dataTable tbody tr { cursor: pointer; }
body.page-supplier-ranking .row-disclosure-btn {
    display: block; width: 100%; text-align: left; background: none; border: none;
    padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
}
body.page-supplier-ranking .row-disclosure-btn:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; border-radius: 6px; }

/* Explicit narrow-screen corrections for the scoped layout rules (§7.3). */
@media (max-width: 999px) {
    body.page-supplier-ranking .tier-summary-grid,
    body.page-supplier-ranking .rank-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.page-supplier-ranking .tier-summary-icon { width: 40px; height: 40px; border-radius: 8px; font-size: 16px; }
    body.page-supplier-ranking .podium-card { padding: 10px; }
    body.page-supplier-ranking .podium-rank-1 { padding: 16px 10px; }
    body.page-supplier-ranking .podium-rank-3 { padding: 8px 10px; }
    body.page-supplier-ranking .podium-avatar { width: 32px; height: 32px; font-size: 12px; margin: 6px auto; }
    body.page-supplier-ranking .podium-score { font-size: 17px; margin-top: 4px; }
    body.page-supplier-ranking .podium-rank-1 .podium-score { font-size: 21px; }
    body.page-supplier-ranking .podium-rank-3 .podium-score { font-size: 15px; }
}
@media (max-width: 600px) {
    body.page-supplier-ranking .header h1 { font-size: 17px; }
    body.page-supplier-ranking .tier-summary-card { flex-direction: column; align-items: flex-start; }
    body.page-supplier-ranking .ranking-formula { flex-direction: column; }
    body.page-supplier-ranking .rank-podium { gap: 6px; }
    body.page-supplier-ranking .podium-name { font-size: 10px; }
    body.page-supplier-ranking .podium-badge { font-size: 10px; }
    body.page-supplier-ranking .podium-rank-1 { padding: 16px 8px; }
    body.page-supplier-ranking .podium-rank-2,
    body.page-supplier-ranking .podium-rank-3 { padding: 10px 8px; }
    body.page-supplier-ranking .podium-score { font-size: 16px; }
    body.page-supplier-ranking .podium-rank-1 .podium-score { font-size: 20px; }
    body.page-supplier-ranking .podium-rank-3 .podium-score { font-size: 15px; }
    body.page-supplier-ranking .rank-mv { display: inline-flex; align-items: center; }
    /* Pin the phone view to rank + name only. DataTables Responsive collapses by fit-width,
       which on real handsets dropped the NAME and kept Movement — force the two identity
       columns on and hide everything else, regardless of what happens to fit. */
    body.page-supplier-ranking #rankingTable th:nth-child(1),
    body.page-supplier-ranking #rankingTable td:nth-child(1),
    body.page-supplier-ranking #rankingTable th:nth-child(3),
    body.page-supplier-ranking #rankingTable td:nth-child(3) { display: table-cell !important; }
    body.page-supplier-ranking #rankingTable th:nth-child(2),
    body.page-supplier-ranking #rankingTable td:nth-child(2),
    body.page-supplier-ranking #rankingTable th:nth-child(n+4),
    body.page-supplier-ranking #rankingTable td:nth-child(n+4) { display: none !important; }
    /* phone rank cell shows just "#N"; the "was #N" subtext moves into the expanded panel */
    body.page-supplier-ranking .rank-stack span + span { display: none; }
    body.page-supplier-ranking .dt-supplier .row-disclosure-btn { white-space: normal; }
    body.page-supplier-ranking .baseline-note { width: 100%; margin-left: 0; }
    body.page-supplier-ranking .rank-detail-grid { grid-template-columns: 1fr; }
    body.page-supplier-ranking .btn,
    body.page-supplier-ranking .dt-button,
    body.page-supplier-ranking .swal2-confirm,
    body.page-supplier-ranking .dataTables_filter input,
    body.page-supplier-ranking .dataTables_paginate .paginate_button { min-height: 44px; }
}

/* ===== PAGE: BANK MASTER ===== */
/* Scoped to body.page-banks only — no other page is affected.
   Same recipe as Supplier Master (body.page-suppliers): pastel buttons,
   tokenised filters/modal/table, 30px/8px action icons. The report tabs
   and report-summary-card/report-table are styled by banks.php's own
   inline <style> block (left as-is, matches the Supplier Master precedent)
   so only the page chrome around them is covered here. */

body.page-banks .header h1 {
    font-size: 19px;
    font-weight: 600;
}

body.page-banks .header > div {
    font-size: 13px;
    color: var(--cw-text-secondary);
}

body.page-banks .data-section {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}

body.page-banks .section-header h2 {
    font-size: 14px;
    font-weight: 600;
}

/* --- Buttons: pastel house style (DESIGN.md §6.9) --- */
body.page-banks .btn {
    border-radius: 8px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

body.page-banks .btn-primary {
    background: var(--cw-primary-soft);
    color: var(--cw-primary-dark);
    border: 1px solid var(--cw-primary-soft);
}

body.page-banks .btn-primary:hover {
    background: var(--cw-primary-soft);
    border-color: var(--cw-primary);
    transform: none;
}

body.page-banks .btn-success {
    background: var(--cw-green-soft);
    color: var(--cw-green);
    border: 1px solid var(--cw-green-soft);
}

body.page-banks .btn-success:hover {
    border-color: var(--cw-green);
    transform: none;
}

body.page-banks .btn-secondary {
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    border: 1px solid var(--cw-border);
}

body.page-banks .btn-secondary:hover {
    background: var(--cw-surface-soft);
    transform: none;
}

/* --- KPI strip (reuses .report-summary-card from the inline style block) --- */
body.page-banks #bankKpiStrip .report-summary-card {
    border: 1px solid var(--cw-border);
}

/* --- Filters panel (DESIGN.md §6.7) --- */
body.page-banks .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}

body.page-banks .filters-header {
    border-bottom: 1px solid var(--cw-border);
}

body.page-banks .filters-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-text-primary);
}

body.page-banks .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-text-muted);
    letter-spacing: .02em;
}

body.page-banks .filter-input {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--cw-text-primary);
    padding: 8px 10px;
    font-size: 13px;
}

/* --- Form controls in the add/edit modal (DESIGN.md §6.8) --- */
body.page-banks .form-group label {
    font-size: 12px;
    color: var(--cw-text-muted);
    font-weight: 600;
}

body.page-banks .form-group input,
body.page-banks .form-group select,
body.page-banks .form-group textarea {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    padding: 8px 10px;
    font-size: 13px;
}

body.page-banks .form-group input:focus,
body.page-banks .form-group select:focus,
body.page-banks .form-group textarea:focus {
    box-shadow: none;
}

/* --- Modal (DESIGN.md §6.11) --- */
body.page-banks .modal {
    border-radius: 16px;
    border: 1px solid var(--cw-border);
}

body.page-banks .modal-header {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
}

body.page-banks .modal-header h3 {
    font-size: 15px;
}

body.page-banks .modal-body {
    padding: 20px;
}

body.page-banks .close-btn {
    color: var(--cw-text-muted);
}

body.page-banks .close-btn:hover {
    background: var(--cw-border-soft);
    transform: none;
}

/* --- Status pills (DESIGN.md §6.10) --- */
body.page-banks .status-badge {
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

body.page-banks .status-active {
    background: var(--cw-green-soft);
    color: var(--cw-green);
}

body.page-banks .status-inactive {
    background: var(--cw-red-soft);
    color: var(--cw-red);
}

/* --- Action icon buttons (DESIGN.md §6.9) --- */
body.page-banks .action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
}

body.page-banks .action-icon:hover {
    background: var(--cw-border-soft);
    transform: none;
}

body.page-banks .action-icon.view-icon {
    color: var(--cw-primary);
}

body.page-banks .action-icon.view-icon:hover {
    background: var(--cw-primary-soft);
}

body.page-banks .action-icon.edit-icon {
    color: var(--cw-orange);
}

body.page-banks .action-icon.edit-icon:hover {
    background: var(--cw-orange-soft);
}

body.page-banks .action-icon.delete-icon {
    color: var(--cw-red);
}

body.page-banks .action-icon.delete-icon:hover {
    background: var(--cw-red-soft);
}

body.page-banks .action-icon.toggle-on {
    color: var(--cw-green);
}

body.page-banks .action-icon.toggle-off {
    color: var(--cw-red);
}

/* --- DataTables grid (DESIGN.md §6.6) --- */
body.page-banks table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-muted) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    border-bottom: 1px solid var(--cw-border);
}

body.page-banks table.dataTable tbody td {
    font-size: 13px;
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border-soft);
}

body.page-banks table.dataTable tbody td.col-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body.page-banks .dataTables_filter input,
body.page-banks .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    padding: 6px 8px;
}

body.page-banks .dt-button {
    background: var(--cw-surface) !important;
    color: var(--cw-text-secondary) !important;
    border: 1px solid var(--cw-border) !important;
    border-radius: 8px !important;
}

body.page-banks .dt-button:hover {
    background: var(--cw-surface-soft) !important;
}

body.page-banks .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary);
}

body.page-banks .dataTables_paginate .paginate_button.current {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-primary-dark) !important;
    border-color: var(--cw-primary-soft) !important;
}

body.page-banks .dataTables_paginate .paginate_button:hover {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-primary) !important;
    border-color: var(--cw-border) !important;
}

/* ===== PAGE: CUSTOMER MASTER ===== */
/* Scoped to body.page-customers only — no other page is affected.
   Same recipe as Supplier Master / Bank Master: pastel buttons,
   tokenised filters/modal/table, 30px/8px action icons. The report tabs
   and report-summary-card/report-table are styled by customers.php's own
   inline <style> block (left as-is, matches the Supplier Master precedent)
   so only the page chrome around them is covered here. */

body.page-customers .header h1 {
    font-size: 19px;
    font-weight: 600;
}

body.page-customers .header > div {
    font-size: 13px;
    color: var(--cw-text-secondary);
}

body.page-customers .data-section {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}

body.page-customers .section-header h2 {
    font-size: 14px;
    font-weight: 600;
}

/* --- Buttons: pastel house style (DESIGN.md §6.9) --- */
body.page-customers .btn {
    border-radius: 8px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

body.page-customers .btn-primary {
    background: var(--cw-primary-soft);
    color: var(--cw-primary-dark);
    border: 1px solid var(--cw-primary-soft);
}

body.page-customers .btn-primary:hover {
    background: var(--cw-primary-soft);
    border-color: var(--cw-primary);
    transform: none;
}

body.page-customers .btn-success {
    background: var(--cw-green-soft);
    color: var(--cw-green);
    border: 1px solid var(--cw-green-soft);
}

body.page-customers .btn-success:hover {
    border-color: var(--cw-green);
    transform: none;
}

body.page-customers .btn-secondary {
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    border: 1px solid var(--cw-border);
}

body.page-customers .btn-secondary:hover {
    background: var(--cw-surface-soft);
    transform: none;
}

/* --- Filters panel (DESIGN.md §6.7) --- */
body.page-customers .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}

body.page-customers .filters-header {
    border-bottom: 1px solid var(--cw-border);
}

body.page-customers .filters-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-text-primary);
}

body.page-customers .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-text-muted);
    letter-spacing: .02em;
}

body.page-customers .filter-input {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--cw-text-primary);
    padding: 8px 10px;
    font-size: 13px;
}

/* --- Form controls in the add/edit modal (DESIGN.md §6.8) --- */
body.page-customers .form-group label {
    font-size: 12px;
    color: var(--cw-text-muted);
    font-weight: 600;
}

body.page-customers .form-group input,
body.page-customers .form-group select,
body.page-customers .form-group textarea {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    padding: 8px 10px;
    font-size: 13px;
}

body.page-customers .form-group input:focus,
body.page-customers .form-group select:focus,
body.page-customers .form-group textarea:focus {
    box-shadow: none;
}

/* --- Modal (DESIGN.md §6.11) --- */
body.page-customers .modal {
    border-radius: 16px;
    border: 1px solid var(--cw-border);
}

body.page-customers .modal-header {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
}

body.page-customers .modal-header h3 {
    font-size: 15px;
}

body.page-customers .modal-body {
    padding: 20px;
}

body.page-customers .close-btn {
    color: var(--cw-text-muted);
}

body.page-customers .close-btn:hover {
    background: var(--cw-border-soft);
    transform: none;
}

/* --- Status pills (DESIGN.md §6.10) --- */
body.page-customers .status-badge {
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

body.page-customers .status-active {
    background: var(--cw-green-soft);
    color: var(--cw-green);
}

body.page-customers .status-inactive {
    background: var(--cw-red-soft);
    color: var(--cw-red);
}

/* --- Action icon buttons (DESIGN.md §6.9) --- */
body.page-customers .action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
}

body.page-customers .action-icon:hover {
    background: var(--cw-border-soft);
    transform: none;
}

body.page-customers .action-icon.view-icon {
    color: var(--cw-primary);
}

body.page-customers .action-icon.view-icon:hover {
    background: var(--cw-primary-soft);
}

body.page-customers .action-icon.edit-icon {
    color: var(--cw-orange);
}

body.page-customers .action-icon.edit-icon:hover {
    background: var(--cw-orange-soft);
}

body.page-customers .action-icon.delete-icon {
    color: var(--cw-red);
}

body.page-customers .action-icon.delete-icon:hover {
    background: var(--cw-red-soft);
}

body.page-customers .action-icon.toggle-on {
    color: var(--cw-green);
}

body.page-customers .action-icon.toggle-off {
    color: var(--cw-red);
}

/* --- DataTables grid (DESIGN.md §6.6) --- */
body.page-customers table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-muted) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    border-bottom: 1px solid var(--cw-border);
}

body.page-customers table.dataTable tbody td {
    font-size: 13px;
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border-soft);
}

body.page-customers table.dataTable tbody td.col-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body.page-customers .dataTables_filter input,
body.page-customers .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    padding: 6px 8px;
}

body.page-customers .dt-button {
    background: var(--cw-surface) !important;
    color: var(--cw-text-secondary) !important;
    border: 1px solid var(--cw-border) !important;
    border-radius: 8px !important;
}

body.page-customers .dt-button:hover {
    background: var(--cw-surface-soft) !important;
}

body.page-customers .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary);
}

body.page-customers .dataTables_paginate .paginate_button.current {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-primary-dark) !important;
    border-color: var(--cw-primary-soft) !important;
}

body.page-customers .dataTables_paginate .paginate_button:hover {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-primary) !important;
    border-color: var(--cw-border) !important;
}

/* ===== PAGE: PRICING MASTER ===== */
/* Scoped to body.page-pricing only — no other page is affected.
   Same recipe as Supplier/Bank/Customer Master: pastel buttons, tokenised
   filters/modal/table, 30px/8px action icons. Pricing Master also has its
   own tab switcher (.pricing-tabs, shared in the base part) restyled here as a
   quiet underline tab, matching the card/section title scale instead of its
   oversized 15px default. */

body.page-pricing .header h1 {
    font-size: 19px;
    font-weight: 600;
}

body.page-pricing .header > div {
    font-size: 13px;
    color: var(--cw-text-secondary);
}

body.page-pricing .data-section {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}

body.page-pricing .section-header h2 {
    font-size: 14px;
    font-weight: 600;
}

/* --- Tab switcher (Customer Pricing / Supplier Pricing) --- */
body.page-pricing .pricing-tabs {
    border-bottom: 1px solid var(--cw-border);
    margin-bottom: 16px;
}

body.page-pricing .pricing-tab-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-text-secondary);
}

body.page-pricing .pricing-tab-btn.active {
    color: var(--cw-primary-dark);
    border-bottom-color: var(--cw-primary);
}

body.page-pricing .pricing-tab-btn:hover {
    color: var(--cw-primary-dark);
    background: var(--cw-primary-soft);
}

/* --- Buttons: pastel house style (DESIGN.md §6.9) --- */
body.page-pricing .btn {
    border-radius: 8px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

body.page-pricing .btn-primary {
    background: var(--cw-primary-soft);
    color: var(--cw-primary-dark);
    border: 1px solid var(--cw-primary-soft);
}

body.page-pricing .btn-primary:hover {
    background: var(--cw-primary-soft);
    border-color: var(--cw-primary);
    transform: none;
}

body.page-pricing .btn-success {
    background: var(--cw-green-soft);
    color: var(--cw-green);
    border: 1px solid var(--cw-green-soft);
}

body.page-pricing .btn-success:hover {
    border-color: var(--cw-green);
    transform: none;
}

body.page-pricing .btn-secondary {
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    border: 1px solid var(--cw-border);
}

body.page-pricing .btn-secondary:hover {
    background: var(--cw-surface-soft);
    transform: none;
}

/* --- Filters panel (DESIGN.md §6.7) --- */
body.page-pricing .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}

body.page-pricing .filters-header {
    border-bottom: 1px solid var(--cw-border);
}

body.page-pricing .filters-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-text-primary);
}

body.page-pricing .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-text-muted);
    letter-spacing: .02em;
}

body.page-pricing .filter-input {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--cw-text-primary);
    padding: 8px 10px;
    font-size: 13px;
}

/* --- Form controls in the add/edit modal (DESIGN.md §6.8) --- */
body.page-pricing .form-group label {
    font-size: 12px;
    color: var(--cw-text-muted);
    font-weight: 600;
}

body.page-pricing .form-group input,
body.page-pricing .form-group select,
body.page-pricing .form-group textarea {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    padding: 8px 10px;
    font-size: 13px;
}

body.page-pricing .form-group input:focus,
body.page-pricing .form-group select:focus,
body.page-pricing .form-group textarea:focus {
    box-shadow: none;
}

/* --- Modal (DESIGN.md §6.11) --- */
body.page-pricing .modal {
    border-radius: 16px;
    border: 1px solid var(--cw-border);
}

body.page-pricing .modal-header {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
}

body.page-pricing .modal-header h3 {
    font-size: 15px;
}

body.page-pricing .modal-body {
    padding: 20px;
}

body.page-pricing .close-btn {
    color: var(--cw-text-muted);
}

body.page-pricing .close-btn:hover {
    background: var(--cw-border-soft);
    transform: none;
}

/* --- Status pills (DESIGN.md §6.10) --- */
body.page-pricing .status-badge {
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

body.page-pricing .status-active {
    background: var(--cw-green-soft);
    color: var(--cw-green);
}

body.page-pricing .status-expired {
    background: var(--cw-border-soft);
    color: var(--cw-text-secondary);
}

body.page-pricing .status-superseded {
    background: var(--cw-orange-soft);
    color: var(--cw-orange);
}

/* --- Action icon buttons (DESIGN.md §6.9) --- */
body.page-pricing .action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
}

body.page-pricing .action-icon:hover {
    background: var(--cw-border-soft);
    transform: none;
}

body.page-pricing .action-icon.edit-icon {
    color: var(--cw-orange);
}

body.page-pricing .action-icon.edit-icon:hover {
    background: var(--cw-orange-soft);
}

body.page-pricing .action-icon.delete-icon {
    color: var(--cw-red);
}

body.page-pricing .action-icon.delete-icon:hover {
    background: var(--cw-red-soft);
}

/* --- DataTables grid (DESIGN.md §6.6) --- */
body.page-pricing table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-muted) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    border-bottom: 1px solid var(--cw-border);
}

body.page-pricing table.dataTable tbody td {
    font-size: 13px;
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border-soft);
}

body.page-pricing table.dataTable tbody td.col-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body.page-pricing .dataTables_filter input,
body.page-pricing .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    padding: 6px 8px;
}

body.page-pricing .dt-button {
    background: var(--cw-surface) !important;
    color: var(--cw-text-secondary) !important;
    border: 1px solid var(--cw-border) !important;
    border-radius: 8px !important;
}

body.page-pricing .dt-button:hover {
    background: var(--cw-surface-soft) !important;
}

body.page-pricing .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary);
}

body.page-pricing .dataTables_paginate .paginate_button.current {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-primary-dark) !important;
    border-color: var(--cw-primary-soft) !important;
}

body.page-pricing .dataTables_paginate .paginate_button:hover {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-primary) !important;
    border-color: var(--cw-border) !important;
}

/* =========================================================================
   GLOBAL: ICON & TYPE SCALE
   Cross-page corrections for elements measured oversized against the DESIGN.md
   scale. Measured on the live DOM at 1280px:
     .header h1         24px with a 24px inline glyph (body text is 13px)
     .section-header i  20px beside a 13-14px title
     .stat-card-icon    60x60 tile, 28px glyph, saturated navy gradient
     .stat-card-value   32px in the old saturated blue #0074D9
     .settings-card-title 20px in the old navy #001F3F
     .settings-card-icon  56x56 tile, 28px glyph
   suppliers.php and supplier-ranking.php each already carry a per-page fix
   (19px title / 16px glyph); this generalises that same scale product-wide so
   the shell reads consistently. Per-page sections in this file are more
   specific (body.page-x .header h1) and still win where a page differs.
   ========================================================================= */

.main-content .header h1 { font-size: 19px; font-weight: 600; }
.main-content .header h1 i.fas,
.main-content .header h1 i.far,
.main-content .header h1 i.fab { font-size: 16px; line-height: 1; }

/* section titles: the inline glyph was 20px next to a 13-14px heading */
.section-header i.fas,
.section-header i.far,
.section-header i.fab { font-size: 14px; line-height: 1; }

/* stat cards (inventory, profit-analysis, ...) */
.stat-card-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--cw-primary-soft);
    color: var(--cw-primary);
}
.stat-card-value { font-size: 24px; color: var(--cw-primary); }

/* settings cards */
.settings-card-title { font-size: 15px; color: var(--cw-text-primary); }
.settings-card-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 8px;
    background: var(--cw-primary-soft); color: var(--cw-primary); }

/* phones: keep the icons from collapsing to nothing (DESIGN.md §7.2) */
@media (max-width: 999px) {
    .main-content .header h1 { font-size: 18px; }
    .stat-card-icon,
    .settings-card-icon { width: 40px; height: 40px; font-size: 18px; }
    .stat-card-value { font-size: 22px; }
}

/* =========================================================================
   GLOBAL: SATURATED COMPONENTS -> PASTEL
   The legacy sheet fills DataTables buttons, the grid header and the
   primary/success buttons with SOLID brand colour (--navy-primary / --success)
   and uses a 2px control radius. That is the most visible inconsistency left on
   pages that have not had a per-page pass. DESIGN.md §6.6 / §6.9 call for a soft
   tint, accent text, a soft border and an 8px radius.
   !important is needed to beat the legacy rules; per-page sections
   (body.page-<name> …) are more specific and still win.
   ========================================================================= */

.btn {
    border-radius: 8px;
    font-size: 13px;
}

.dt-button {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-primary) !important;
    border: 1px solid var(--cw-border) !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    padding: 7px 12px !important;
    box-shadow: none !important;
}
.dt-button:hover {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-primary) !important;
}

table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-secondary) !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    padding: 10px 12px !important;
}
body.dark-mode table.dataTable thead th {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-secondary) !important;
}

.btn-primary {
    background: var(--cw-primary-soft);
    color: var(--cw-primary);
    border: 1px solid var(--cw-border);
}
.btn-primary:hover {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    transform: translateY(-1px);
}
.btn-success {
    background: var(--cw-green-soft);
    color: var(--cw-green);
    border: 1px solid var(--cw-border);
}
.btn-success:hover {
    background: var(--cw-surface-soft);
    color: var(--cw-green);
    transform: translateY(-1px);
}

/* the collapsible filter headers were set at heading size */
.filters-header h3 { font-size: 14px; font-weight: 600; }
.filters-header i.fas,
.filters-header i.far,
.filters-header i.fab { font-size: 13px; }

/* control tiles (settings, …): 50x50 saturated navy gradient with a 24px glyph */
.control-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--cw-primary-soft);
    color: var(--cw-primary);
}
.control-icon i.fas,
.control-icon i.far,
.control-icon i.fab { font-size: 20px; line-height: 1; }

/* ===== PAGE: FINANCING ===== */
/* Master Data recipes; shared title, glyph, button and grid-header rules above apply. */
body.page-financing .main-content,
body.page-financing .pricing-tab-content,
body.page-financing .form-group { min-width: 0; }
body.page-financing .header > div { font-size: 13px; color: var(--cw-text-secondary); }
body.page-financing .data-section { border: 1px solid var(--cw-border); border-radius: 16px; box-shadow: none; }
body.page-financing .section-header { gap: 12px; flex-wrap: wrap; }
body.page-financing .section-header h2 { font-size: 14px; font-weight: 600; }
body.page-financing .section-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.page-financing .btn-secondary { background: var(--cw-surface); color: var(--cw-text-secondary); border: 1px solid var(--cw-border); }
body.page-financing .btn-secondary:hover { background: var(--cw-surface-soft); }

body.page-financing .pricing-tabs { border-bottom: 1px solid var(--cw-border); margin-bottom: 16px; }
body.page-financing .pricing-tab-btn { min-width: 0; padding: 12px 16px; font-size: 13px; color: var(--cw-text-secondary); }
body.page-financing .pricing-tab-btn.active { color: var(--cw-text-primary); border-bottom-color: var(--cw-primary); }
body.page-financing .pricing-tab-btn:hover { background: var(--cw-primary-soft); color: var(--cw-text-primary); }

body.page-financing .filters-section { padding: 16px; margin-bottom: 16px; background: var(--cw-surface-soft); border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-financing .filters-header { border-bottom: 1px solid var(--cw-border); padding-bottom: 12px; margin-bottom: 12px; gap: 8px; }
body.page-financing .filters-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
body.page-financing .filter-group label,
body.page-financing .form-group label { font-size: 12px; color: var(--cw-text-secondary); }
body.page-financing .filter-input,
body.page-financing .form-group input:not([type="radio"]),
body.page-financing .form-group select,
body.page-financing .form-group textarea,
body.page-financing .dataTables_filter input,
body.page-financing .dataTables_length select {
    min-width: 0; max-width: 100%; padding: 8px 10px; border-radius: 8px;
    border: 1px solid var(--input-border); background: var(--input-bg); color: var(--cw-text-primary);
    font-size: 13px !important; /* Legacy mobile controls force 16px. */
}
body.page-financing .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.page-financing .radio-group { flex-wrap: wrap; }
body.page-financing.dark-mode input[type="date"] { color-scheme: dark; }
body.page-financing .radio-group input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: var(--cw-primary); }
body.page-financing .radio-group .radio-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 0; }
body.page-financing .form-group { margin-bottom: 12px; }
body.page-financing .form-group label i { color: var(--cw-primary); }
body.page-financing .form-group input:focus-visible,
body.page-financing .form-group select:focus-visible,
body.page-financing .form-group textarea:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; box-shadow: none; }
body.page-financing .computed-field,
body.page-financing .form-id-info { background: var(--cw-surface-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
body.page-financing .searchable-dropdown-list { background: var(--cw-surface); border-color: var(--cw-border); border-radius: 8px; }
body.page-financing .searchable-dropdown-item { font-size: 13px; color: var(--cw-text-primary); }
body.page-financing .searchable-dropdown-item:hover,
body.page-financing .searchable-dropdown-item.selected { background: var(--cw-primary-soft); color: var(--cw-text-primary); }
body.page-financing .form-actions { justify-content: flex-end; margin-top: 20px; }

body.page-financing .modal-overlay { z-index: 1004; } /* Above the mobile navigation, below SweetAlert. */
body.page-financing .modal { border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-financing .modal-header { background: var(--cw-surface); color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border); border-radius: 16px 16px 0 0; padding: 16px 20px; gap: 12px; }
body.page-financing .modal-header h3 { font-size: 14px; overflow-wrap: anywhere; }
body.page-financing .modal-body { padding: 20px; }
body.page-financing .close-btn { flex-shrink: 0; font-size: 16px; color: var(--cw-text-secondary); border-radius: 8px; }
body.page-financing .close-btn:hover { background: var(--cw-surface-soft); transform: none; }
body.page-financing .financing-empty-icon { font-size: 26px; margin-bottom: 12px; color: var(--cw-text-secondary); }
body.page-financing #paymentsLoading i { font-size: 24px; color: var(--cw-primary); }
body.page-financing #paymentsEmpty p { font-size: 13px; color: var(--cw-text-secondary); }
body.page-financing #runningBalanceSummary > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: 8px; background: var(--cw-surface-soft); border: 1px solid var(--cw-border); }
body.page-financing #runningBalanceSummary span { font-size: 14px !important; }
body.page-financing #runningBalanceTable th { font-size: 11px !important; text-transform: uppercase; color: var(--cw-text-secondary); }
body.page-financing #runningBalanceTable td { font-variant-numeric: tabular-nums; }

body.page-financing .status-badge { padding: 4px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; color: var(--cw-text-primary); }
body.page-financing .status-active,
body.page-financing .status-delivered,
body.page-financing .status-accepted { background: var(--cw-green-soft); }
body.page-financing .status-in-transit,
body.page-financing .status-pending { background: var(--cw-orange-soft); }
body.page-financing .status-rejected { background: var(--cw-red-soft); }
body.page-financing .action-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 0; border-radius: 8px; background: var(--cw-surface-soft); border: 1px solid var(--cw-border); font-size: 13px; }
body.page-financing .action-icon:hover { background: var(--cw-border-soft); transform: none; }
body.page-financing .action-icon.edit-icon { color: var(--cw-orange); }
body.page-financing .action-icon.delete-icon { color: var(--cw-red); }
body.page-financing .financing-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--cw-surface-soft); color: var(--cw-text-primary); font-size: 13px; font-weight: 700; }

/* Responsive DataTables collapse columns; only the plain history table scrolls. */
/* Keep hidden loading containers measurable so Responsive can calculate columns
   before the existing .show() call. They still occupy no height and stay hidden. */
body.page-financing #supTableContainer[style*="display: none"],
body.page-financing #custTableContainer[style*="display: none"],
body.page-financing #bankTableContainer[style*="display: none"] {
    display: block !important; height: 0; overflow: hidden; visibility: hidden;
}
body.page-financing .table-scroll-hint { background: var(--cw-primary-soft); color: var(--cw-text-secondary); border-radius: 8px; }

body.page-financing .dataTables_wrapper { max-width: 100%; overflow: visible; }
body.page-financing table.dataTable { min-width: 0; }
body.page-financing table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { color: var(--cw-text-secondary); }
body.page-financing table.dataTable tbody tr { background: var(--cw-surface); }
body.page-financing table.dataTable tbody tr:hover { background: var(--table-hover); }
body.page-financing table.dataTable tbody td:last-child:has(.action-icon) { white-space: nowrap; }
body.page-financing table.dataTable tbody td { font-size: 13px; color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border-soft); font-variant-numeric: tabular-nums; }
body.page-financing table.dataTable tbody td.child { white-space: normal; overflow-wrap: anywhere; }
body.page-financing table.dataTable > tbody > tr.child ul.dtr-details { display: block; }
body.page-financing table.dataTable > tbody > tr.child span.dtr-data { white-space: normal; }
body.page-financing .dataTables_info,
body.page-financing .dataTables_paginate,
body.page-financing .dataTables_filter,
body.page-financing .dataTables_length { font-size: 12px; color: var(--cw-text-secondary); }
body.page-financing .dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 8px; color: var(--cw-text-secondary) !important; }
body.page-financing .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--cw-primary-soft) !important; color: var(--cw-text-primary) !important; border: 1px solid var(--cw-border) !important; }
body.page-financing .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--cw-surface-soft) !important; color: var(--cw-text-primary) !important; border-color: var(--cw-border) !important; }
body.page-financing .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: var(--cw-text-secondary) !important; }
body.page-financing .swal2-popup { background: var(--cw-surface); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-financing .swal2-title { font-size: 18px; }
body.page-financing .swal2-html-container { font-size: 13px; }
body.page-financing .swal2-styled.swal2-confirm { background: var(--cw-primary-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-financing .swal2-styled.swal2-cancel { background: var(--cw-surface-soft); color: var(--cw-text-secondary); border: 1px solid var(--cw-border); border-radius: 8px; }

@media (max-width: 999px) {
    body.page-financing .pricing-tabs { flex-wrap: wrap; }
    body.page-financing .pricing-tab-btn { flex: 1 1 100%; min-height: 44px; padding: 12px; }
    body.page-financing .pricing-tab-btn i { font-size: 16px; }
    body.page-financing .filters-grid,
    body.page-financing .form-grid { grid-template-columns: minmax(0, 1fr); }
    body.page-financing .data-section,
    body.page-financing .filters-section { padding: 12px; }
    body.page-financing .section-header { align-items: stretch; flex-direction: column; }
    body.page-financing .section-header-actions .btn { flex: 1 1 auto; width: auto; padding: 8px 12px; min-height: 44px; }
    body.page-financing .filter-input,
    body.page-financing .form-group input:not([type="radio"]),
    body.page-financing .form-group select { min-height: 44px; }
    body.page-financing .radio-label { min-height: 44px; }
    body.page-financing .modal { width: 100%; max-height: 95vh; }
    body.page-financing .modal-body,
    body.page-financing .modal-header { padding: 16px; }
    body.page-financing .close-btn,
    body.page-financing .action-icon { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 16px; }
    body.page-financing .financing-avatar { width: 40px; height: 40px; font-size: 16px; }
    body.page-financing .dataTables_filter input { width: 100%; margin-left: 0; }
    body.page-financing .dataTables_filter label { display: block; }
}

/* =========================================================================
   PAGE: EXPENSES
   Expense ledger: status pills, action icons, filter/form polish.
   Built on the shared recipes (DESIGN.md §6.9/§6.10); globals already cover
   titles, buttons, the grid header and the DataTables chrome.
   ========================================================================= */

body.page-expenses .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

body.page-expenses .status-active   { background: var(--cw-green-soft);  color: var(--cw-green); }
body.page-expenses .status-inactive { background: var(--cw-red-soft);    color: var(--cw-red); }
body.page-expenses .status-pending  { background: var(--cw-orange-soft); color: var(--cw-orange); }

body.page-expenses .action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
body.page-expenses .action-icon:hover {
    background: var(--cw-border-soft);
    transform: translateY(-1px);
}
body.page-expenses .action-icon.edit-icon   { color: var(--cw-primary); }
body.page-expenses .action-icon.delete-icon { color: var(--cw-red); }

body.page-expenses .form-id-info {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--cw-text-secondary);
}

body.page-expenses .table-scroll-hint {
    font-size: 11px;
    color: var(--cw-text-muted);
}

/* ---- GLOBAL continuation: secondary button house style ----
   the base part fills .btn-secondary with solid #6c757d grey. DESIGN.md §6.9 wants a
   soft surface with token text, like .btn-primary. Specificity: per-page
   `body.page-x …` rules are more specific and still win. */
.btn-secondary {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
}
.btn-secondary:hover {
    background: var(--cw-border-soft);
    color: var(--cw-text-primary);
    transform: translateY(-1px);
}

/* =========================================================================
   PAGE: PROFIT ANALYSIS   (4 tabs: profit / pnl / cashflow / simulation)
   Rules migrated out of the page's inline <style> block, tokenised.
   ========================================================================= */

body.page-profit-analysis .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
body.page-profit-analysis .status-badge.status-above-target { background: var(--cw-green-soft);  color: var(--cw-green); }
body.page-profit-analysis .status-badge.status-below-target { background: var(--cw-red-soft);    color: var(--cw-red); }
body.page-profit-analysis .status-badge.status-at-target    { background: var(--cw-orange-soft); color: var(--cw-orange); }

body.page-profit-analysis .report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
body.page-profit-analysis .report-summary-card {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}
body.page-profit-analysis .report-summary-card .val { font-size: 20px; font-weight: 700; color: var(--cw-primary); }
body.page-profit-analysis .report-summary-card .lbl { font-size: 11px; color: var(--cw-text-muted); text-transform: uppercase; margin-top: 4px; }

/* charts sit in cards: keep the canvas responsive and bounded on phones */
body.page-profit-analysis canvas { max-width: 100%; }

@media (max-width: 999px) {
    body.page-profit-analysis .report-summary { grid-template-columns: 1fr; }
}

/* Tab bar: 4 tabs did not fit a phone width (the 4th sat ~116px past the edge).
   Let them wrap and tighten the padding on phones. */
body.page-profit-analysis .pricing-tabs {
    border-bottom: 1px solid var(--cw-border);
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
body.page-profit-analysis .pricing-tab-btn {
    min-width: 0;
    padding: 11px 14px;
    font-size: 13px;
    color: var(--cw-text-secondary);
    white-space: nowrap;
}
body.page-profit-analysis .pricing-tab-btn.active {
    color: var(--cw-text-primary);
    border-bottom-color: var(--cw-primary);
}
/* No hover or switch animation on these tabs (owner 2026-11-05): a tab looks the same under the pointer,
   only the active one is marked. Both designs. */
body.page-profit-analysis .pricing-tab-btn,
body.page-profit-analysis .pricing-tab-btn * { transition: none !important; animation: none !important; }
body.page-profit-analysis .pricing-tab-btn:hover { background: none; }
body.page-profit-analysis .pricing-tab-btn:not(.active):hover { color: var(--cw-text-secondary); }
body.page-profit-analysis .report-summary-card .val .cf-opening-edit {
    margin-left: 6px; padding: 2px 8px; font-size: 12px; vertical-align: middle;
    background: transparent; border: 1px solid var(--cw-border); color: var(--cw-text-secondary); min-height: 0;
}

/* NOTE: these grids use DataTables `responsive: true`, which collapses columns
   itself. Do NOT wrap them in an overflow-x scroller — the plugin and the scroll
   container fight over the width. */

@media (max-width: 999px) {
    body.page-profit-analysis .pricing-tab-btn { padding: 9px 10px; font-size: 12px; }
    body.page-profit-analysis .stat-card-value { font-size: 22px; }
}

/* =========================================================================
   PAGE: PURCHASES
   Operations grid (DataTable + add/edit modal with a searchable supplier
   dropdown and a star rating). Same recipe as Expenses/Financing; globals
   already cover titles, buttons, the grid header and the DataTables chrome.
   ========================================================================= */

body.page-purchases .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
body.page-purchases .status-pending     { background: var(--cw-surface-soft); color: var(--cw-text-secondary); }
body.page-purchases .status-prefinanced { background: var(--cw-primary-soft); color: var(--cw-primary); }
body.page-purchases .status-partial     { background: var(--cw-orange-soft);  color: var(--cw-orange); }
body.page-purchases .status-paid        { background: var(--cw-green-soft);   color: var(--cw-green); }

body.page-purchases .action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
body.page-purchases .action-icon:hover {
    background: var(--cw-border-soft);
    transform: translateY(-1px);
}
body.page-purchases .action-icon.edit-icon   { color: var(--cw-primary); }
body.page-purchases .action-icon.delete-icon { color: var(--cw-red); }

body.page-purchases .form-id-info {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--cw-text-secondary);
}

body.page-purchases .table-scroll-hint {
    font-size: 11px;
    color: var(--cw-text-muted);
}

/* the searchable supplier dropdown: legacy border/selected state were a
   saturated 2px blue outline and a solid navy fill (DESIGN.md §2.4). */
body.page-purchases .searchable-dropdown-list {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
}
body.page-purchases .searchable-dropdown-item { font-size: 13px; color: var(--cw-text-primary); }
body.page-purchases .searchable-dropdown-item:hover,
body.page-purchases .searchable-dropdown-item.selected {
    background: var(--cw-primary-soft);
    color: var(--cw-text-primary);
}

/* modal: legacy header was a solid navy bar with a 20px white title */
body.page-purchases .modal { border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-purchases .modal-header {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border);
    border-radius: 16px 16px 0 0;
}
body.page-purchases .modal-header h3 { font-size: 14px; }
body.page-purchases .close-btn {
    color: var(--cw-text-secondary);
    font-size: 16px;
    border-radius: 8px;
}
body.page-purchases .close-btn:hover { background: var(--cw-surface-soft); transform: none; }

body.page-purchases table.dataTable tbody td { font-variant-numeric: tabular-nums; }
/* Primary, not secondary: the sorted column and the open row shade the cell, and secondary drops under 4.5:1 there. */
body.page-purchases table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { color: var(--cw-text-primary); }
/* The fixed bottom nav (the base part, <=768px) covers the end of the .main-content scroller: scroll into view above it,
   with 12px to spare so taller text or rounding cannot slide row actions back under it. */
@media (max-width: 768px) {
    body.page-purchases .main-content { scroll-padding-bottom: calc(65px + 12px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 999px) {
    body.page-purchases .modal { width: 100%; max-height: 95vh; }
    body.page-purchases .modal-body,
    body.page-purchases .modal-header { padding: 16px; }
    body.page-purchases .close-btn,
    body.page-purchases .action-icon { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 16px; }
}

/* Row selection (list-selection.js): count, totals and the selection's Print / CSV above the table. */
.list-selection-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--cw-border);
    border-left: 4px solid var(--cw-primary);
    border-radius: 7px;
    background: var(--cw-surface);
}
.list-selection-bar[hidden] { display: none; }
.list-selection-bar [data-list-summary] { flex: 1 1 240px; min-width: 0; font-weight: 600; color: var(--cw-text-primary); font-variant-numeric: tabular-nums; }
.list-selection-bar [data-list-actions] { display: contents; }
.list-selection-bar .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; float: none; margin: 0; }
/* the base part gives phone .dt-buttons a 50% min-width, which stacks these two. */
.list-selection-bar .dt-button { margin: 0; min-width: 0; }
table.dataTable th.list-select-col,
table.dataTable td.list-select-col { width: 24px; text-align: center; }
/* [type] outranks page rules such as body.page-deliveries input[type="checkbox"] (16px). */
table.dataTable input[type="checkbox"].list-select,
table.dataTable input[type="checkbox"].list-select-page { width: 24px; height: 24px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--cw-primary); }
@media (max-width: 768px) {
    .list-selection-bar .dt-buttons { flex: 1 1 auto; }
    .list-selection-bar .dt-button,
    .list-selection-bar .btn { min-height: 44px; }
}

/* ===== PAGE: SALES ===== */
body.page-sales .main-content,
body.page-sales .data-section,
body.page-sales .form-group,
body.page-sales .filter-group { min-width: 0; }
body.page-sales .header,
body.page-sales .data-section {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}
body.page-sales .section-header { flex-wrap: wrap; gap: 12px; }
body.page-sales .section-header h2 { font-size: 14px; }
body.page-sales .section-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.page-sales .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
body.page-sales .filters-header { border-bottom: 1px solid var(--cw-border); padding-bottom: 12px; margin-bottom: 12px; }
body.page-sales .filters-header h3 { font-size: 14px; }
body.page-sales .filters-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.page-sales .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.page-sales .form-group { margin-bottom: 0; }
body.page-sales .filter-group label,
body.page-sales .form-group label { font-size: 12px; color: var(--cw-text-secondary); text-transform: none; letter-spacing: normal; }
body.page-sales .form-group label i { color: var(--cw-text-secondary); font-size: 13px; }
body.page-sales .filter-input,
body.page-sales .form-group input,
body.page-sales .form-group select,
body.page-sales .dataTables_filter input,
body.page-sales .dataTables_length select {
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    font-size: 13px;
}
body.page-sales :is(button, input, select, a, .paginate_button):focus-visible {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}
body.page-sales.dark-mode input,
body.page-sales.dark-mode select { color-scheme: dark; }
body.page-sales .computed-field,
body.page-sales .form-group .readonly-input,
body.page-sales .form-id-info {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
body.page-sales .status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
body.page-sales .status-draft { background: var(--cw-orange-soft); color: var(--cw-text-primary); }
body.page-sales .status-confirmed { background: var(--cw-green-soft); color: var(--cw-text-primary); }
body.page-sales .status-cancelled { background: var(--cw-red-soft); color: var(--cw-text-primary); }
body.page-sales .action-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface-soft);
    color: var(--cw-text-secondary);
    font-size: 13px;
    cursor: pointer;
}
body.page-sales .action-icon.edit-icon { color: var(--cw-primary); }
body.page-sales .action-icon.delete-icon { color: var(--cw-red); }
body.page-sales .action-icon:hover,
body.page-sales .close-btn:hover { background: var(--cw-border-soft); transform: none; }
body.page-sales table.dataTable tbody td { font-size: 13px; border-color: var(--cw-border-soft); font-variant-numeric: tabular-nums; }
body.page-sales table.dataTable tbody td:nth-child(n+5):nth-child(-n+9) { text-align: right; }
body.page-sales table.dataTable { min-width: 0; max-width: 100%; }
body.page-sales table.dataTable tbody td:nth-child(-n+2) { white-space: nowrap; }
body.page-sales table.dataTable tbody td:last-child { white-space: nowrap; }
body.page-sales table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { color: var(--cw-text-secondary); }
body.page-sales table.dataTable .dtr-data { overflow-wrap: anywhere; }
body.page-sales .dataTables_wrapper { overflow: visible; color: var(--cw-text-secondary); font-size: 12px; }
body.page-sales .dataTables_wrapper .dataTables_filter { max-width: 100%; }
body.page-sales .dataTables_wrapper .dataTables_filter input { width: 160px; }
body.page-sales .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary) !important;
}
body.page-sales .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.page-sales .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-text-primary) !important;
    border: 1px solid var(--cw-border) !important;
    box-shadow: none;
}
body.page-sales .table-scroll-hint { font-size: 11px; color: var(--cw-text-secondary); }
/* Responsive measures columns while the existing loader hides this container. */
body.page-sales #tableContainer[style*="display: none"] {
    display: block !important;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}
body.page-sales .modal-overlay { z-index: 1004; }
body.page-sales .modal { max-width: 800px; border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-sales .modal-header { background: var(--cw-surface); color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border); border-radius: 16px 16px 0 0; padding: 16px 20px; }
body.page-sales .modal-header h3 { font-size: 14px; }
body.page-sales .modal-body { padding: 20px; overflow-wrap: anywhere; }
body.page-sales .close-btn { width: 30px; height: 30px; flex-shrink: 0; color: var(--cw-text-secondary); font-size: 16px; border-radius: 8px; }
body.page-sales .form-actions { justify-content: flex-end; gap: 8px; margin-top: 20px; }
body.page-sales .receipt-reader { padding: 12px; margin-bottom: 16px; background: var(--cw-surface-soft); border: 1px dashed var(--cw-border); border-radius: 8px; }
body.page-sales input[type="file"] { max-width: 100%; color: var(--cw-text-secondary); }
body.page-sales .sale-route { background: var(--cw-surface-soft); border-radius: 8px; padding: 16px; margin-bottom: 16px; text-align: center; }
body.page-sales .sale-route-value { font-size: 13px; font-weight: 600; }
body.page-sales .sale-detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
body.page-sales .sale-detail-kpi { background: var(--cw-surface-soft); border-radius: 8px; padding: 12px; text-align: center; font-variant-numeric: tabular-nums; }
body.page-sales .sale-detail-rows { background: var(--cw-surface); border: 1px solid var(--cw-border); border-radius: 16px; margin-bottom: 16px; overflow: hidden; }
body.page-sales .sale-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--cw-border-soft); gap: 16px; }
body.page-sales .sale-detail-label { font-size: 12px; color: var(--cw-text-secondary); }
body.page-sales .sale-detail-value { font-size: 13px; color: var(--cw-text-primary); font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }
body.page-sales .field-hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--cw-text-secondary); }
body.page-sales .sale-documents-field { margin-bottom: 16px; }
body.page-sales .sale-documents-chosen,
body.page-sales .sale-documents { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
body.page-sales .sale-documents-chosen li { padding: 2px 0; color: var(--cw-text-secondary); overflow-wrap: anywhere; }
body.page-sales .sale-documents li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--cw-border-soft); }
body.page-sales .sale-documents li a { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--cw-primary); }
body.page-sales .sale-document-meta { font-size: 11.5px; color: var(--cw-text-muted); white-space: nowrap; }
body.page-sales .sale-documents-section { border-top: 1px solid var(--cw-border); padding-top: 14px; margin-top: 14px; }
/* Phones and touch screens: the details upload field and each document link are 44 px finger targets. */
@media (max-width: 768px), (pointer: coarse) {
    body.page-sales .sale-documents-section input[type="file"] { min-height: 44px; }
    body.page-sales .sale-documents li a { display: flex; align-items: center; min-height: 44px; }
}
body.page-sales .sale-remove-receipt { background: var(--cw-red-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-sales .swal2-popup { background: var(--cw-surface); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-sales .swal2-title { font-size: 20px; }
body.page-sales .swal2-html-container { font-size: 13px; }
body.page-sales .swal2-styled.swal2-confirm { background: var(--cw-primary-soft) !important; color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-sales .swal2-styled.swal2-cancel { background: var(--cw-surface-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
@media (max-width: 999px) {
    body.page-sales .filters-grid,
    body.page-sales .form-grid { grid-template-columns: minmax(0, 1fr); }
    body.page-sales .data-section { padding: 12px; }
    body.page-sales .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
    body.page-sales .dt-buttons .dt-button { width: auto; flex: 1; margin: 0; min-height: 44px; }
    body.page-sales .dataTables_length label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    body.page-sales .dataTables_length select { width: auto !important; }
    body.page-sales .dataTables_filter label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    body.page-sales .dataTables_wrapper .dataTables_filter input { width: 100%; margin: 0; }
    body.page-sales .modal-overlay { padding: 12px; }
    body.page-sales .modal { width: 100%; max-height: 95vh; }
    body.page-sales .modal-header,
    body.page-sales .modal-body { padding: 16px; }
    body.page-sales .action-icon,
    body.page-sales .close-btn { width: 44px; height: 44px; min-width: 44px; font-size: 16px; }
    body.page-sales .btn { min-height: 44px; font-size: 13px; }
    body.page-sales .btn i,
    body.page-sales .filters-header i,
    body.page-sales .form-group label i { font-size: 14px; }
    body.page-sales .filter-input,
    body.page-sales .form-group input,
    body.page-sales .receipt-reader input[type="file"],
    body.page-sales .form-group select { min-height: 44px; font-size: 16px; }
    /* The AI receipt field sits outside .form-group: same field look, a full row (beats its inline flex: 1), the picked name under the button. */
    body.page-sales .receipt-reader input[type="file"] { flex: 1 1 100% !important; padding: 8px 10px; border: 1px solid var(--cw-border); border-radius: 8px; background: var(--cw-surface); color: var(--cw-text-primary); }
    body.page-sales .receipt-reader input[type="file"]::file-selector-button { display: block; margin: 0 0 6px; }
    body.page-sales .sale-detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.page-sales .sale-route-value,
    body.page-sales .sale-route-value i { font-size: 14px; }
    body.page-sales .sale-detail-row { flex-wrap: wrap; gap: 8px; padding: 12px; }
    body.page-sales .form-actions { flex-wrap: wrap; }
}

/* ===== PAGE: DELIVERIES ===== */
body.page-deliveries .main-content,
body.page-deliveries .data-section,
body.page-deliveries .form-group,
body.page-deliveries .filter-group { min-width: 0; }
body.page-deliveries .header,
body.page-deliveries .data-section {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}
body.page-deliveries .section-header { flex-wrap: wrap; gap: 12px; }
body.page-deliveries .section-header h2 { font-size: 14px; }
body.page-deliveries .section-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.page-deliveries .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
body.page-deliveries .filters-header { border-bottom: 1px solid var(--cw-border); padding-bottom: 12px; margin-bottom: 12px; }
body.page-deliveries .filters-header h3 { font-size: 14px; }
body.page-deliveries .filters-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.page-deliveries .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.page-deliveries .form-group { margin-bottom: 0; }
body.page-deliveries .filter-group label,
body.page-deliveries .form-group label { font-size: 12px; color: var(--cw-text-secondary); text-transform: none; letter-spacing: normal; }
body.page-deliveries .form-group label i { color: var(--cw-text-secondary); font-size: 13px; }
body.page-deliveries .filter-input,
body.page-deliveries .form-group input:not([type="radio"]):not([type="checkbox"]),
body.page-deliveries .form-group textarea,
body.page-deliveries .form-group select,
body.page-deliveries .dataTables_filter input,
body.page-deliveries .dataTables_length select {
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    font-size: 13px;
}
body.page-deliveries :is(button, input, select, textarea, a, .paginate_button):focus-visible {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}
body.page-deliveries.dark-mode input,
body.page-deliveries.dark-mode select { color-scheme: dark; }
body.page-deliveries .computed-field,
body.page-deliveries .form-id-info {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
body.page-deliveries .status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
body.page-deliveries .status-pending,
body.page-deliveries .status-in-transit { background: var(--cw-orange-soft); color: var(--cw-text-primary); }
body.page-deliveries .status-delivered,
body.page-deliveries .status-accepted { background: var(--cw-green-soft); color: var(--cw-text-primary); }
body.page-deliveries .status-rejected { background: var(--cw-red-soft); color: var(--cw-text-primary); }
body.page-deliveries .action-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface-soft);
    color: var(--cw-text-secondary);
    font-size: 13px;
    cursor: pointer;
}
body.page-deliveries .action-icon.edit-icon { color: var(--cw-primary); }
body.page-deliveries .action-icon.delete-icon { color: var(--cw-red); }
body.page-deliveries .action-icon:hover,
body.page-deliveries .close-btn:hover { background: var(--cw-border-soft); transform: none; }
body.page-deliveries table.dataTable tbody td { font-size: 13px; border-color: var(--cw-border-soft); font-variant-numeric: tabular-nums; }
/* Weight, bags, average price and total cost: marked by class, so a column added before them (Expéditeur) never shifts the rule. */
body.page-deliveries table.dataTable tbody td.del-num { text-align: right; }
body.page-deliveries table.dataTable { min-width: 0; max-width: 100%; }
body.page-deliveries table.dataTable tbody td:nth-child(-n+2) { white-space: nowrap; }
body.page-deliveries table.dataTable tbody td:last-child { white-space: nowrap; }
body.page-deliveries table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { color: var(--cw-text-secondary); }
body.page-deliveries table.dataTable .dtr-data { overflow-wrap: anywhere; }
body.page-deliveries .dataTables_wrapper { overflow: visible; color: var(--cw-text-secondary); font-size: 12px; }
body.page-deliveries .dataTables_wrapper .dataTables_filter { max-width: 100%; }
body.page-deliveries .dataTables_wrapper .dataTables_filter input { width: 160px; }
body.page-deliveries .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary) !important;
}
body.page-deliveries .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.page-deliveries .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-text-primary) !important;
    border: 1px solid var(--cw-border) !important;
    box-shadow: none;
}
body.page-deliveries .table-scroll-hint { font-size: 11px; color: var(--cw-text-secondary); }
/* Responsive measures columns while the existing loader hides this container. */
body.page-deliveries #tableContainer[style*="display: none"] {
    display: block !important;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}
body.page-deliveries .modal-overlay { z-index: 1004; }
body.page-deliveries .modal { max-width: 800px; border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-deliveries .modal-header { background: var(--cw-surface); color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border); border-radius: 16px 16px 0 0; padding: 16px 20px; }
body.page-deliveries .modal-header h3 { font-size: 14px; }
body.page-deliveries .modal-body { padding: 20px; overflow-wrap: anywhere; }
body.page-deliveries .close-btn { width: 30px; height: 30px; flex-shrink: 0; color: var(--cw-text-secondary); font-size: 16px; border-radius: 8px; }
body.page-deliveries .form-actions { justify-content: flex-end; gap: 8px; margin-top: 20px; }
body.page-deliveries .swal2-popup { background: var(--cw-surface); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-deliveries .swal2-title { font-size: 20px; }
body.page-deliveries .swal2-html-container { font-size: 13px; }
body.page-deliveries .swal2-styled.swal2-confirm { background: var(--cw-primary-soft) !important; color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-deliveries .swal2-styled.swal2-cancel { background: var(--cw-surface-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
@media (max-width: 999px) {
    body.page-deliveries .filters-grid,
    body.page-deliveries .form-grid { grid-template-columns: minmax(0, 1fr); }
    body.page-deliveries .data-section { padding: 12px; }
    body.page-deliveries .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
    body.page-deliveries .dt-buttons .dt-button { width: auto; flex: 1; margin: 0; min-height: 44px; }
    body.page-deliveries .dataTables_length label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    body.page-deliveries .dataTables_length select { width: auto !important; }
    body.page-deliveries .dataTables_filter label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    body.page-deliveries .dataTables_wrapper .dataTables_filter input { width: 100%; margin: 0; }
    body.page-deliveries .modal-overlay { padding: 12px; }
    body.page-deliveries .modal { width: 100%; max-height: 95vh; }
    body.page-deliveries .modal-header,
    body.page-deliveries .modal-body { padding: 16px; }
    body.page-deliveries .action-icon,
    body.page-deliveries .close-btn { width: 44px; height: 44px; min-width: 44px; font-size: 16px; }
    body.page-deliveries .btn { min-height: 44px; font-size: 13px; }
    body.page-deliveries .btn i,
    body.page-deliveries .filters-header i,
    body.page-deliveries .form-group label i { font-size: 14px; }
    body.page-deliveries .filter-input,
    body.page-deliveries .form-group input:not([type="radio"]):not([type="checkbox"]),
    body.page-deliveries .form-group textarea,
    body.page-deliveries .form-group select { min-height: 44px; font-size: 16px; }
    body.page-deliveries .form-actions { flex-wrap: wrap; }
}

body.page-deliveries .text-muted { color: var(--cw-text-secondary); }
body.page-deliveries .status-reassigned { background: var(--cw-purple-soft); color: var(--cw-text-primary); }
body.page-deliveries .status-badge { gap: 4px; }
/* "Reassigned / Delivered" may break before "/ Delivered": the Status column is no wider than plain Reassigned needed */
body.page-deliveries .status-badge.status-reassigned-leg { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
body.page-deliveries .status-badge.status-reassigned-leg > span { white-space: nowrap; }
body.page-deliveries .searchable-dropdown-list {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    color: var(--cw-text-primary);
}
body.page-deliveries .searchable-dropdown-item { font-size: 13px; overflow-wrap: anywhere; }
body.page-deliveries .searchable-dropdown-item:hover,
body.page-deliveries .searchable-dropdown-item.selected { background: var(--cw-primary-soft); color: var(--cw-text-primary); }
body.page-deliveries .delivery-section {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: none;
}
body.page-deliveries .delivery-section:hover { box-shadow: none; }
body.page-deliveries .delivery-section .delivery-section-title {
    color: var(--cw-text-primary);
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    border-bottom: 1px solid var(--cw-border-soft);
    margin-bottom: 12px;
}
body.page-deliveries .delivery-section .delivery-section-title i { color: var(--cw-primary); font-size: 14px; }
body.page-deliveries .section-customer .delivery-section-title i { color: var(--cw-green); }
body.page-deliveries .section-expenses .delivery-section-title i { color: var(--cw-orange); }
/* bill of lading (connaissement) of a cocoa or coffee delivery (M19): optional number and paper. */
body.page-deliveries .lading-help { margin: 0 0 12px; font-size: 13px; color: var(--cw-text-secondary); }
body.page-deliveries .lading-error { margin-top: 6px; padding: 6px 8px; font-size: 13px; background: var(--cw-red-soft); color: var(--cw-text-primary); border-left: 3px solid var(--cw-red); }
body.page-deliveries .lading-current { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
body.page-deliveries .lading-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--cw-primary); font-weight: 600; text-decoration: none; }
body.page-deliveries .lading-remove { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-size: 13px; font-weight: 400; }
body.page-deliveries .lading-file { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
body.page-deliveries .lading-pick { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; width: 100%; margin: 0; cursor: pointer; }
body.page-deliveries .lading-file:focus-visible + .lading-pick { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
body.page-deliveries .lading-file-name { margin-top: 6px; font-size: 13px; color: var(--cw-text-secondary); overflow-wrap: anywhere; }
body.page-deliveries .lading-file-name:empty { display: none; }
body.page-deliveries #ladingNumber { text-transform: uppercase; }
body.page-deliveries table.dataTable .lading-number { font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) { body.page-deliveries table.dataTable .lading-link { min-height: 0; font-size: 12px; font-weight: 500; } }
body.page-deliveries .radio-group { flex-wrap: wrap; gap: 16px; }
body.page-deliveries .radio-group .radio-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; margin: 0; }
body.page-deliveries input[type="radio"],
body.page-deliveries input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--cw-primary); }
body.page-deliveries .rental-grid { border: 1px dashed var(--cw-border); padding: 12px; border-radius: 8px; background: var(--cw-surface-soft); }
body.page-deliveries #lotPickerSection { min-width: 0; margin-top: 12px; border: 1px solid var(--cw-border); border-radius: 8px; padding: 12px; background: var(--cw-surface-soft); }
body.page-deliveries .lot-picker-header,
body.page-deliveries .delivery-lot-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }
body.page-deliveries .lot-picker-header { margin-bottom: 12px; }
body.page-deliveries .lot-picker-header h4 { margin: 0; font-size: 13px; color: var(--cw-text-primary); }
body.page-deliveries .delivery-lot { min-width: 0; margin-bottom: 12px; border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-deliveries .delivery-lot-header { background: var(--cw-primary-soft); color: var(--cw-text-primary); padding: 8px 12px; border-radius: 8px 8px 0 0; }
body.page-deliveries .lot-table-scroll { overflow-x: auto; max-width: 100%; }
body.page-deliveries .lot-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
body.page-deliveries .lot-table th { background: var(--cw-surface-soft); color: var(--cw-text-secondary); font-size: 11px; font-weight: 600; }
body.page-deliveries .lot-table td { background: var(--cw-surface); border-top: 1px solid var(--cw-border-soft); }
body.page-deliveries .lot-qty-input { width: 90px; padding: 8px; font-size: 13px; text-align: right; border: 1px solid var(--cw-border); border-radius: 8px; background: var(--cw-surface); color: var(--cw-text-primary); }
/* Filling a truck by itself (Thino, 2026-11-20): oldest first, by price, or by hand. Square, flat, big touch targets. */
body.page-deliveries .split-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
body.page-deliveries .split-modes legend { width: 100%; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
body.page-deliveries .split-mode { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--cw-border); border-radius: 0; background: var(--cw-surface); color: var(--cw-text-primary); font-size: 14px; cursor: pointer; flex: 1 1 160px; }
body.page-deliveries .split-mode:has(input:checked) { border-color: var(--cw-primary); background: var(--cw-primary-soft); color: var(--cw-primary); font-weight: 600; }
body.page-deliveries .split-mode i { color: var(--cw-primary); }
body.page-deliveries .split-hint { margin: 0 0 8px; font-size: 13px; color: var(--cw-text-secondary); }
body.page-deliveries .split-result { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--cw-border); background: var(--cw-surface); font-size: 13px; color: var(--cw-text-secondary); border-radius: 0; }
body.page-deliveries .split-result:empty { display: none; }
body.page-deliveries .split-result.is-ok { border-left-color: var(--cw-green); color: var(--cw-text-primary); }
body.page-deliveries .split-result.is-ok > i { color: var(--cw-green); }
body.page-deliveries .split-result.is-short { border-left-color: var(--cw-red); background: var(--cw-red-soft); color: var(--cw-text-primary); }
body.page-deliveries .split-result.is-short > i { color: var(--cw-red); }
body.page-deliveries .split-lines { margin: 6px 0 0; padding-left: 18px; font-variant-numeric: tabular-nums; color: var(--cw-text-secondary); }
body.page-deliveries .split-search { width: 100%; min-height: 44px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--cw-border); border-radius: 0; background: var(--cw-surface); color: var(--cw-text-primary); font-size: 14px; box-sizing: border-box; }
body.page-deliveries .split-table td { vertical-align: top; }
body.page-deliveries .split-sub { font-size: 11px; color: var(--cw-text-muted); }
body.page-deliveries .split-note { margin: 8px 0 0; font-size: 12px; color: var(--cw-text-secondary); }
body.page-deliveries .split-tag { margin-top: 2px; font-size: 11px; color: var(--cw-text-secondary); white-space: nowrap; }
/* The Expéditeur (Thino, 2026-11-22): full width under the customer and warehouse; name and phone side by side on a
   computer, stacked on a phone. The list groups people under Équipe, Contacts and Déjà saisis. */
body.page-deliveries .dispatcher-group { grid-column: 1 / -1; }
body.page-deliveries .dispatcher-hint { margin: 0 0 6px; font-size: 12px; color: var(--cw-text-secondary); }
body.page-deliveries .dispatcher-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
body.page-deliveries .dispatcher-fields input { min-height: 44px; }
body.page-deliveries .dispatcher-group-label {
    padding: 8px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--cw-text-secondary); background: var(--cw-surface-soft, var(--cw-surface));
}
body.page-deliveries .dispatcher-item { display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
body.page-deliveries .dispatcher-item small { font-size: 12px; color: var(--cw-text-secondary); }
body.page-deliveries .dispatcher-item-name { font-weight: 600; }
@media (max-width: 640px) {
    body.page-deliveries .dispatcher-fields { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
body.page-deliveries .split-help { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; padding: 12px; border: 1px solid var(--cw-border); border-left: 3px solid var(--cw-primary); background: var(--cw-surface); border-radius: 0; }
body.page-deliveries .split-help > i { color: var(--cw-primary); margin-top: 3px; }
body.page-deliveries .split-help > div { flex: 1; min-width: 0; }
body.page-deliveries .split-help p { margin: 4px 0 0; font-size: 13px; color: var(--cw-text-secondary); }
body.page-deliveries .split-help .btn { min-height: 44px; }
body.page-deliveries .split-help[hidden], body.page-deliveries #splitAutoBox[hidden], body.page-deliveries #splitHandBox[hidden] { display: none; }
@media (max-width: 600px) { body.page-deliveries .split-help { flex-wrap: wrap; } body.page-deliveries .split-mode { flex-basis: 100%; } }
/* The truck size, asked once before a campaign's first purchase */
body.page-purchases .truck-size-box { margin: 0 0 16px; padding: 12px; border: 1px solid var(--cw-border); border-left: 3px solid var(--cw-primary); background: var(--cw-surface-soft); border-radius: 0; }
body.page-purchases .truck-size-box[hidden] { display: none; }
body.page-purchases .truck-size-box p { margin: 4px 0 8px; font-size: 13px; color: var(--cw-text-secondary); }
body.page-purchases .truck-size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.page-purchases .truck-size-row input { width: 140px; min-height: 48px; }
body.page-purchases .truck-size-row .btn { min-height: 48px; }
body.page-purchases .truck-size-box .field-error { margin: 8px 0 0; color: var(--cw-red); font-size: 13px; }
body.page-deliveries .swal2-container { z-index: 10020; }
body.page-deliveries .swal2-popup { min-width: 0; max-width: 100%; }
body.page-deliveries .swal2-select,
body.page-deliveries .swal2-textarea { width: 100%; margin: 8px 0; max-width: 100%; box-sizing: border-box; font-size: 13px; background: var(--cw-surface); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-deliveries .swal2-validation-message { background: var(--cw-red-soft); color: var(--cw-text-primary); font-size: 13px; }
@media (max-width: 999px) {
    body.page-deliveries .delivery-section { padding: 12px; }
    body.page-deliveries .delivery-section-title,
    body.page-deliveries .delivery-section-title i,
    body.page-deliveries .modal-header h3 i,
    body.page-deliveries .lot-picker-header i { font-size: 14px; }
    body.page-deliveries .radio-group .radio-label { min-height: 44px; font-size: 14px; }
    body.page-deliveries .lot-qty-input,
    body.page-deliveries .swal2-select,
    body.page-deliveries .swal2-textarea { min-height: 44px; font-size: 16px; }
    body.page-deliveries .swal2-styled { min-height: 44px; font-size: 13px; }
}
body.page-deliveries table.dataTable tbody tr.child td { white-space: normal; text-align: left; }
body.page-deliveries table.dataTable .dtr-details { width: 100%; }
body.page-deliveries table.dataTable .dtr-data { white-space: normal; }
@media (max-width: 999px) {
    body.page-deliveries table.dataTable .dtr-details li { display: flex; flex-direction: column; gap: 4px; }
}

/* =========================================================================
   GLOBAL: MOBILE DATATABLE COLLAPSE (responsive:true grids)
   the base part's mobile block forces `table.dataTable { min-width:600px }`,
   nowrap headers and its own overflow-x scroller. That was correct for the
   old horizontal-scroll design but it DEFEATS DataTables `responsive: true`
   (which every grid in this app uses): the grid stayed desktop-wide on a
   phone and no column collapsed — the reported "list display issue".
   Let the responsive table shrink to its container so the plugin collapses
   to the key columns, and keep the data container measurable while it is
   still hidden (the loader hides it, then `$('#tableContainer').show()`
   reveals it) so Responsive reads the real phone width at init instead of
   0/unbounded, which is what suppressed the collapse.
   NOTE: this makes the legacy overflow-x wrappers in the markup inert —
   do not remove them, they simply never overflow now.
   ========================================================================= */
@media (max-width: 999px) {
    table.dataTable { min-width: 0 !important; width: 100% !important; }
    table.dataTable thead th { white-space: normal !important; }
}
[id$="TableContainer"][style*="display: none"],
[id$="TableContainer"][style*="display:none"],
#tableContainer[style*="display: none"],
#tableContainer[style*="display:none"] {
    display: block !important;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

/* ===== PAGE: PAYMENTS ===== */
body.page-payments .main-content,
body.page-payments .data-section,
body.page-payments .form-group,
body.page-payments .filter-group { min-width: 0; }
body.page-payments .header,
body.page-payments .data-section {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}
body.page-payments .section-header { flex-wrap: wrap; gap: 12px; }
body.page-payments .section-header h2 { font-size: 14px; }
body.page-payments .section-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.page-payments .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
body.page-payments .filters-header { border-bottom: 1px solid var(--cw-border); padding-bottom: 12px; margin-bottom: 12px; }
body.page-payments .filters-header h3 { font-size: 14px; }
body.page-payments .filters-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.page-payments .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.page-payments .form-group { margin-bottom: 0; }
body.page-payments .filter-group label,
body.page-payments .form-group label { font-size: 12px; color: var(--cw-text-secondary); text-transform: none; letter-spacing: normal; }
body.page-payments .form-group label i { color: var(--cw-text-secondary); font-size: 13px; }
body.page-payments .filter-input,
body.page-payments .form-group input,
body.page-payments .form-group select,
body.page-payments .form-group textarea,
body.page-payments .dataTables_filter input,
body.page-payments .dataTables_length select {
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    font-size: 13px;
}
body.page-payments :is(button, input, select, a, .paginate_button):focus-visible {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}
body.page-payments.dark-mode input,
body.page-payments.dark-mode select { color-scheme: dark; }
body.page-payments .form-id-info {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
body.page-payments .radio-group { flex-wrap: wrap; gap: 16px; }
body.page-payments .radio-group .radio-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; margin: 0; }
body.page-payments input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--cw-primary); }
body.page-payments .searchable-dropdown-list {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    color: var(--cw-text-primary);
}
body.page-payments .searchable-dropdown-item { font-size: 13px; overflow-wrap: anywhere; }
body.page-payments .searchable-dropdown-item:hover,
body.page-payments .searchable-dropdown-item.selected { background: var(--cw-primary-soft); color: var(--cw-text-primary); }
body.page-payments .status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
body.page-payments .status-outgoing { background: var(--cw-orange-soft); color: var(--cw-text-primary); }
body.page-payments .status-incoming { background: var(--cw-green-soft); color: var(--cw-text-primary); }
body.page-payments .action-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface-soft);
    color: var(--cw-text-secondary);
    font-size: 13px;
    cursor: pointer;
}
body.page-payments .action-icon.edit-icon { color: var(--cw-primary); }
body.page-payments .action-icon.delete-icon { color: var(--cw-red); }
body.page-payments .action-icon:hover,
body.page-payments .close-btn:hover { background: var(--cw-border-soft); transform: none; }
body.page-payments table.dataTable tbody td { font-size: 13px; border-color: var(--cw-border-soft); font-variant-numeric: tabular-nums; }
body.page-payments table.dataTable tbody td:nth-child(6) { text-align: right; }
body.page-payments table.dataTable { min-width: 0; max-width: 100%; }
body.page-payments table.dataTable tbody td:nth-child(-n+2) { white-space: nowrap; }
body.page-payments table.dataTable tbody td:last-child { white-space: nowrap; }
body.page-payments table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { color: var(--cw-text-secondary); }
body.page-payments table.dataTable .dtr-data { overflow-wrap: anywhere; }
body.page-payments table.dataTable tbody tr.child td { white-space: normal; text-align: left; }
body.page-payments table.dataTable .dtr-details { width: 100%; }
body.page-payments .dataTables_wrapper { overflow: visible; color: var(--cw-text-secondary); font-size: 12px; }
body.page-payments .dataTables_wrapper .dataTables_filter { max-width: 100%; }
body.page-payments .dataTables_wrapper .dataTables_filter input { width: 160px; }
body.page-payments .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px;
    color: var(--cw-text-secondary) !important;
}
body.page-payments .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.page-payments .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-text-primary) !important;
    border: 1px solid var(--cw-border) !important;
    box-shadow: none;
}
body.page-payments .table-scroll-hint { font-size: 11px; color: var(--cw-text-secondary); }
/* Responsive measures columns while the existing loader hides this container. */
body.page-payments #tableContainer[style*="display: none"] {
    display: block !important;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}
body.page-payments .modal-overlay { z-index: 1004; }
body.page-payments .modal { max-width: 800px; border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-payments .modal-header { background: var(--cw-surface); color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border); border-radius: 16px 16px 0 0; padding: 16px 20px; }
body.page-payments .modal-header h3 { font-size: 14px; }
body.page-payments .modal-body { padding: 20px; overflow-wrap: anywhere; }
body.page-payments .close-btn { width: 30px; height: 30px; flex-shrink: 0; color: var(--cw-text-secondary); font-size: 16px; border-radius: 8px; }
body.page-payments .form-actions { justify-content: flex-end; gap: 8px; margin-top: 20px; }
body.page-payments .swal2-popup { background: var(--cw-surface); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-payments .swal2-title { font-size: 20px; }
body.page-payments .swal2-html-container { font-size: 13px; }
body.page-payments .swal2-styled.swal2-confirm { background: var(--cw-primary-soft) !important; color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-payments .swal2-styled.swal2-cancel { background: var(--cw-surface-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
@media (max-width: 999px) {
    body.page-payments .filters-grid,
    body.page-payments .form-grid { grid-template-columns: minmax(0, 1fr); }
    body.page-payments .data-section { padding: 12px; }
    body.page-payments .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
    body.page-payments .dt-buttons .dt-button { width: auto; flex: 1; margin: 0; min-height: 44px; }
    body.page-payments .dataTables_length label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    body.page-payments .dataTables_length select { width: auto !important; }
    body.page-payments .dataTables_filter label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    body.page-payments .dataTables_wrapper .dataTables_filter input { width: 100%; margin: 0; }
    body.page-payments .modal-overlay { padding: 12px; }
    body.page-payments .modal { width: 100%; max-height: 95vh; }
    body.page-payments .modal-header,
    body.page-payments .modal-body { padding: 16px; }
    body.page-payments .action-icon,
    body.page-payments .close-btn { width: 44px; height: 44px; min-width: 44px; font-size: 16px; }
    body.page-payments .btn { min-height: 44px; font-size: 13px; }
    body.page-payments .btn i,
    body.page-payments .filters-header i,
    body.page-payments .form-group label i { font-size: 14px; }
    body.page-payments .filter-input,
    body.page-payments .form-group input:not([type="radio"]):not([type="checkbox"]),
    body.page-payments .form-group textarea,
    body.page-payments .form-group select { min-height: 44px; font-size: 16px; }
    body.page-payments .radio-group .radio-label { min-height: 44px; font-size: 14px; }
    body.page-payments .form-actions { flex-wrap: wrap; }
    body.page-payments table.dataTable .dtr-details li { display: flex; flex-direction: column; gap: 4px; }
    /* Shrink the two widest key columns (ID, counterparty) so Référence/Date/Contrepartie/
       Montant all fit within Responsive's measured width at phone sizes, instead of Montant
       being dropped. Must be a real font-size reduction, not overflow/ellipsis: Responsive
       measures each column's natural (untruncated) content width to decide what collapses. */
    body.page-payments table.dataTable tbody td:nth-child(1),
    body.page-payments table.dataTable tbody td:nth-child(4) { font-size: 11px !important; }
}

/* Shared filter headings retain their desktop appearance. */
.filters-toggle {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: inherit;
}
.filters-toggle:disabled { opacity: 1; }
.filters-chevron { display: none; }

/* Compact phone/tablet chrome; desktop DataTables layout stays native. */
@media (max-width: 1024px) {
    body .filters-section { padding: 12px !important; margin-bottom: 12px !important; }
    body .filters-section .filters-header { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; }
    body .filters-section .filters-header h3 { margin: 0; }
    .filters-toggle { min-height: 44px; cursor: pointer; }
    .filters-toggle:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 4px; }
    .filters-chevron { display: inline-block; margin-left: 8px; font-size: 12px; }
    .filters-toggle[aria-expanded="true"] .filters-chevron { transform: rotate(180deg); }
    body .filters-section .filters-header .btn { width: auto !important; min-height: 44px; padding: 8px !important; }
    body .filters-section .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
    body .filters-section .filter-group { min-width: 0; margin: 0; }
    body .filters-section .filter-group label { white-space: normal; font-size: 12px; margin-bottom: 4px; }
    body .filters-section .filter-input { width: 100%; min-width: 0; min-height: 44px; padding: 8px !important; font-size: 16px !important; }
    body .filters-section.filters-collapsed .filters-grid { display: none !important; }
    body .filters-section.filters-collapsed .filters-header { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
    body .filters-grid .dataTables_filter { grid-column: 1 / -1; float: none; text-align: left; margin: 0; }
    body .filters-grid .dataTables_filter label { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
    body .filters-grid .dataTables_filter input { width: 100% !important; min-width: 0; margin: 0 !important; min-height: 44px; font-size: 16px; }
    /* Export buttons keep their word (CSV, Excel, PDF, Imprimer) beside the icon: the file icons look alike,
       so an icon alone does not say which file you get. Two per row on a phone, one row on a tablet. */
    body .dataTables_wrapper .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; float: none; margin: 0 0 8px; }
    body .dataTables_wrapper .dt-button.mobile-export { flex: 0 0 auto; width: auto !important; min-width: 0; min-height: 44px; height: auto; padding: 0 14px !important; margin: 0 !important; font-size: 14px !important; line-height: 1.2; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
    body .dataTables_wrapper .dt-button.mobile-export i { font-size: 16px !important; margin: 0 !important; }
    body .dataTables_wrapper .dt-button.mobile-export > span { display: inline-flex; align-items: center; gap: 8px; }
    body .dataTables_wrapper .dataTables_length { width: auto; clear: none; margin: 0 0 8px; font-size: 12px; }
    body .dataTables_wrapper .dataTables_length select { width: auto !important; margin: 0 4px !important; padding: 8px !important; min-height: 44px; font-size: 16px; }
    body .dataTables_wrapper .dataTables_info { font-size: 12px; }
    body table.dataTable tbody td.child { white-space: normal; text-align: left; }
    body table.dataTable tr.child .dtr-details { width: 100%; }
    body table.dataTable tr.child .dtr-details > li { display: flex; flex-direction: column; gap: 4px; white-space: normal; }
    body table.dataTable tr.child .dtr-data { white-space: normal; overflow-wrap: anywhere; }
    body table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control { min-height: 44px; padding-left: 32px; cursor: pointer; }
    body.page-suppliers .data-section, body.page-customers .data-section { padding: 12px; }
    body.page-suppliers .section-header, body.page-customers .section-header { margin-bottom: 12px; gap: 8px; }
    body.page-suppliers .section-header > div, body.page-customers .section-header > div { display: flex; flex-wrap: wrap; gap: 8px; }
    body.page-suppliers .section-header .btn, body.page-customers .section-header .btn { width: auto; min-height: 44px; padding: 8px 12px; }
    body.page-suppliers .table-scroll-hint, body.page-customers .table-scroll-hint { display: none; }
}
@media (max-width: 600px) {
    body .dataTables_wrapper .dt-button.mobile-export { flex: 1 1 calc(50% - 4px); }
}

/* =========================================================================
   GLOBAL: ROW DETAIL GRID (detail-grid.js)
   The Responsive child row a tap on a collapsed row opens (Purchases, Deliveries
   Out, Sales, Payments, Financing): label above value, in sections, 2 columns
   on phones and 3 from 600px instead of one long list. .is-wide (long text,
   actions) spans the row; .is-num (figures, dates) never wraps or breaks;
   words wrap, nothing is truncated. Tokens only, so light and dark both follow.
   ========================================================================= */
body table.dataTable tbody td.child:has(> .cw-detail-grid) { white-space: normal; text-align: left; }
.cw-detail-grid { display: grid; gap: 12px; width: 100%; min-width: 0; padding: 4px 0; white-space: normal; text-align: left; }
.cw-detail-section { min-width: 0; }
.cw-detail-section + .cw-detail-section { padding-top: 12px; border-top: 1px solid var(--cw-border-soft); }
.cw-detail-heading { margin: 0 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cw-text-secondary); }
.cw-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 0; padding: 0; }
@media (min-width: 600px) { .cw-detail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cw-detail-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cw-detail-item.is-wide { grid-column: 1 / -1; }
.cw-detail-label { margin: 0; font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--cw-text-secondary); overflow-wrap: break-word; }
.cw-detail-value { margin: 0; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--cw-text-primary); overflow-wrap: break-word; word-break: normal; }
.cw-detail-value.is-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cw-detail-item.is-wide .cw-detail-value:has(.action-icon, .row-actions) { display: flex; flex-wrap: wrap; gap: 8px; }
/* A reference a phone shortens to its last two parts ("…0056-3", detail-grid.js shortRef): one line, the full one in the
   opened row. */
.cw-ref-short, .cw-nowrap { white-space: nowrap; }
/* A person's name in a list that opens their account page (Suppliers, Customers, Purchases -> supplier.php /
   customer.php): Warehouse Blue because it acts, underlined so it reads as a link without colour, and a taller tap area
   (padding taken back by the margin, so the row keeps its height). */
.cw-name-link { display: inline-block; padding: 10px 0; margin: -10px 0; color: var(--cw-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: break-word; }
.cw-name-link:hover { color: var(--cw-primary-dark, var(--cw-primary)); }
.cw-name-link:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
.cw-detail-ref .cw-detail-value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Counterparty chooser: reserve separate touch targets for Clear and the arrow. */
.searchable-dropdown:has(.searchable-dropdown-clear) .searchable-dropdown-input { padding-right: 132px; }
.searchable-dropdown-clear {
    position: absolute;
    right: 44px;
    top: 0;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    font: inherit;
    cursor: pointer;
}
.searchable-dropdown-clear:hover { background: var(--cw-surface-soft); }
.searchable-dropdown-clear:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }

/* ===== PAGE: FLEET & DRIVERS ===== */
/* Layout after the inspiration boards: KPI strip, vehicle cards + renewals
   rail, detail drawer. Pastel tokens only; base recipes match Deliveries. */
body.page-fleet .main-content,
body.page-fleet .data-section,
body.page-fleet .form-group,
body.page-fleet .filter-group { min-width: 0; }
body.page-fleet .header,
body.page-fleet .data-section {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}
body.page-fleet .header { margin-bottom: 12px; }
body.page-fleet .data-section { padding: 16px; margin: 0; }
body.page-fleet .section-header { flex-wrap: wrap; gap: 12px; margin-bottom: 12px; padding-bottom: 0; border-bottom: 0; }
body.page-fleet .section-header h2 { font-size: 14px; }
body.page-fleet .section-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.page-fleet :is(button, input, select, textarea, a, .paginate_button, .fleet-card):focus-visible {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}
body.page-fleet.dark-mode input,
body.page-fleet.dark-mode select { color-scheme: dark; }

/* tones: tint background + accent signal (DESIGN §2.4) */
body.page-fleet .tone-blue   { --fl-accent: var(--cw-primary); --fl-soft: var(--cw-primary-soft); }
body.page-fleet .tone-green  { --fl-accent: var(--cw-green);   --fl-soft: var(--cw-green-soft); }
body.page-fleet .tone-orange { --fl-accent: var(--cw-orange);  --fl-soft: var(--cw-orange-soft); }
body.page-fleet .tone-purple { --fl-accent: var(--cw-purple);  --fl-soft: var(--cw-purple-soft); }
body.page-fleet .tone-red    { --fl-accent: var(--cw-red);     --fl-soft: var(--cw-red-soft); }
body.page-fleet .tone-grey   { --fl-accent: var(--cw-text-muted); --fl-soft: var(--cw-surface-soft); }
body.page-fleet .tone-text-red { color: var(--cw-red); }
body.page-fleet .tone-text-orange { color: var(--cw-orange); }
body.page-fleet .tone-text-green { color: var(--cw-green); }
body.page-fleet .tone-text-grey { color: var(--cw-text-muted); }

body.page-fleet .fleet-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 9999px;
    background: var(--fl-soft, var(--cw-surface-soft));
    color: var(--cw-text-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
body.page-fleet .fleet-pill i { color: var(--fl-accent); font-size: 10px; }
body.page-fleet .fleet-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fl-accent);
    flex-shrink: 0;
}
body.page-fleet .fleet-muted { color: var(--cw-text-secondary); font-size: 12px; }
body.page-fleet .fleet-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }

/* --- KPI strip: one quiet surface, four cells --- */
body.page-fleet .fleet-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
}
body.page-fleet .fleet-kpi { padding: 14px 16px; min-width: 0; }
body.page-fleet .fleet-kpi + .fleet-kpi { border-left: 1px solid var(--cw-border-soft); }
body.page-fleet .fleet-kpi-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--cw-text-muted);
    font-weight: 600;
}
body.page-fleet .fleet-kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
body.page-fleet .fleet-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--cw-text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
body.page-fleet .fleet-kpi-sub {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--cw-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.page-fleet .fleet-kpi-tile {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--fl-soft);
    color: var(--fl-accent);
    font-size: 12px;
    flex-shrink: 0;
}
body.page-fleet .fleet-ring { position: relative; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
body.page-fleet .fleet-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
body.page-fleet .fleet-ring circle { fill: none; stroke-width: 4; }
body.page-fleet .fleet-ring-track { stroke: var(--cw-border-soft); }
body.page-fleet .fleet-ring-fill { stroke: var(--cw-orange); stroke-linecap: round; transition: stroke-dasharray .22s ease-out; }
body.page-fleet .fleet-ring-pct { font-size: 9.5px; font-weight: 700; color: var(--cw-text-secondary); font-variant-numeric: tabular-nums; }
body.page-fleet .fleet-dots { display: inline-flex; gap: 3px; align-items: flex-end; }
body.page-fleet .fleet-dots i { width: 5px; height: 14px; border-radius: 2px; background: var(--cw-border); }
body.page-fleet .fleet-dots i.on { background: var(--cw-green); }

/* --- layout: vehicles + rail --- */
body.page-fleet .fleet-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 12px;
    align-items: start;
}

/* toolbar */
body.page-fleet .fleet-search { position: relative; }
body.page-fleet .fleet-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cw-text-muted);
    font-size: 12px;
    pointer-events: none;
}
body.page-fleet .fleet-search input {
    width: 260px;
    max-width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    font-size: 13px;
}
body.page-fleet .fleet-view-toggle {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface-soft);
}
body.page-fleet .fleet-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cw-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
body.page-fleet .fleet-view-btn.active { background: var(--cw-surface); color: var(--cw-text-primary); box-shadow: 0 1px 2px var(--shadow-color); }
body.page-fleet .fleet-icon-btn { width: 34px; padding: 0; justify-content: center; }

body.page-fleet .fleet-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
body.page-fleet .fleet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 11px;
    border: 1px solid var(--cw-border);
    border-radius: 9999px;
    background: var(--cw-surface);
    color: var(--cw-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
body.page-fleet .fleet-chip:hover { background: var(--cw-surface-soft); }
body.page-fleet .fleet-chip.active { background: var(--cw-orange-soft); border-color: var(--cw-contour); color: var(--cw-text-primary); }
body.page-fleet .fleet-chip > i { font-size: 11px; color: var(--cw-orange); }
body.page-fleet .fleet-chip-count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    background: var(--cw-surface-soft);
    color: var(--cw-text-secondary);
    font-size: 10.5px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
body.page-fleet .fleet-chip.active .fleet-chip-count { background: var(--cw-surface); }
body.page-fleet #fleetMoreFilters[aria-expanded="true"] { background: var(--cw-orange-soft); border-color: var(--cw-contour); }

/* the legacy filters panel lives behind the "Filters" chip */
body.page-fleet .filters-section:not(.is-open) { display: none !important; }
body.page-fleet .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
body.page-fleet .filters-header { border-bottom: 1px solid var(--cw-border); padding-bottom: 10px; margin-bottom: 10px; }
body.page-fleet .filters-header h3 { font-size: 13px; }
body.page-fleet .filters-grid { grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; }
body.page-fleet .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.page-fleet .form-group { margin-bottom: 0; }
body.page-fleet .filter-group label,
body.page-fleet .form-group label { font-size: 12px; color: var(--cw-text-secondary); text-transform: none; letter-spacing: normal; }
body.page-fleet .form-group label i { color: var(--cw-text-secondary); font-size: 13px; }
body.page-fleet .filter-input,
body.page-fleet .form-group input:not([type="radio"]):not([type="checkbox"]),
body.page-fleet .form-group textarea,
body.page-fleet .form-group select,
body.page-fleet .dataTables_length select {
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    font-size: 13px;
}
body.page-fleet .fleet-help { display: block; margin-top: 4px; font-size: 11px; color: var(--cw-text-muted); }
body.page-fleet .fleet-form-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--cw-text-muted);
}
body.page-fleet .fleet-form-section::after { content: ""; flex: 1; height: 1px; background: var(--cw-border-soft); }
body.page-fleet .form-grid + .fleet-form-section { margin-top: 18px; }
body.page-fleet .fleet-span-2 { grid-column: span 2; }

/* --- vehicle cards --- */
body.page-fleet .fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}
body.page-fleet .fleet-card-skeleton { height: 188px; border-radius: 14px; }
body.page-fleet .fleet-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.page-fleet .fleet-card:hover { border-color: var(--cw-contour); box-shadow: 0 4px 14px var(--shadow-color); }
body.page-fleet .fleet-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.page-fleet .fleet-card-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: var(--cw-text-secondary);
}
body.page-fleet .fleet-card-body { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.page-fleet .fleet-card-info { flex: 1; min-width: 0; }
body.page-fleet .fleet-card-reg {
    font-size: 17px;
    font-weight: 700;
    color: var(--cw-text-primary);
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.page-fleet .fleet-card-model { font-size: 12px; color: var(--cw-text-secondary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.page-fleet .fleet-card-driver { display: flex; align-items: center; gap: 7px; margin-top: 8px; min-width: 0; flex-wrap: wrap; }
body.page-fleet .fleet-card-driver-name { font-size: 12.5px; color: var(--cw-text-primary); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.page-fleet .fleet-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cw-orange-soft);
    color: var(--cw-text-primary);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
body.page-fleet .fleet-avatar-lg { width: 44px; height: 44px; font-size: 15px; }
body.page-fleet .fleet-card-art { width: 112px; flex-shrink: 0; }

/* truck illustration: neutral body, status-coloured stripe and cab */
body.page-fleet .fleet-truck { width: 100%; height: auto; display: block; }
body.page-fleet .fleet-truck .t-box { fill: var(--cw-surface-soft); stroke: var(--cw-border); stroke-width: 1.2; }
body.page-fleet .fleet-truck .t-stripe { fill: var(--fl-accent); opacity: .55; }
body.page-fleet .fleet-truck .t-cab { fill: var(--fl-soft); stroke: var(--fl-accent); stroke-width: 1.2; }
body.page-fleet .fleet-truck .t-glass { fill: var(--cw-surface); stroke: var(--cw-border); stroke-width: 1; }
body.page-fleet .fleet-truck .t-chassis { fill: var(--cw-text-secondary); opacity: .55; }
body.page-fleet .fleet-truck .t-wheel { fill: var(--cw-text-primary); opacity: .85; }
body.page-fleet .fleet-truck .t-hub { fill: var(--cw-surface-soft); }

body.page-fleet .fleet-meter { height: 5px; border-radius: 9999px; background: var(--cw-border-soft); overflow: hidden; }
body.page-fleet .fleet-meter span { display: block; height: 100%; border-radius: inherit; background: var(--fl-accent); }
body.page-fleet .fleet-card-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--cw-text-secondary); font-variant-numeric: tabular-nums; }
body.page-fleet .fleet-card-stats i { font-size: 11px; margin-right: 3px; opacity: .8; }
body.page-fleet .fleet-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--cw-border-soft);
}
body.page-fleet .fleet-card-open { margin-left: auto; color: var(--cw-text-muted); font-size: 11px; }

/* action icons (shared 30px / 8px set) */
body.page-fleet .action-icon {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface-soft);
    color: var(--cw-text-secondary);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
body.page-fleet .action-icon:hover,
body.page-fleet .close-btn:hover { background: var(--cw-border-soft); transform: none; }
body.page-fleet .action-icon.edit-icon,
body.page-fleet .action-icon.paperwork-icon { color: var(--cw-primary); }
body.page-fleet .action-icon.salary-icon,
body.page-fleet .action-icon.wa-icon { color: var(--cw-green); }
body.page-fleet .action-icon.delete-icon,
body.page-fleet .action-icon.paperwork-icon.has-expired { color: var(--cw-red); }
body.page-fleet .action-icon.paperwork-icon.has-expiring { color: var(--cw-orange); }
body.page-fleet .action-icon .expired-badge,
body.page-fleet .action-icon .expiring-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 9999px;
    border: 1px solid var(--cw-surface);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 14px;
    color: var(--cw-text-primary);
}
body.page-fleet .action-icon .expired-badge { background: var(--cw-red-soft); color: var(--cw-red); }
body.page-fleet .action-icon .expiring-badge { background: var(--cw-orange-soft); color: var(--cw-text-primary); }

body.page-fleet .fleet-empty { text-align: center; padding: 36px 12px; color: var(--cw-text-secondary); font-size: 13px; }
body.page-fleet .fleet-empty i { font-size: 22px; color: var(--cw-text-muted); margin-bottom: 8px; display: block; }
body.page-fleet .fleet-empty-sm { padding: 20px 8px; }
body.page-fleet .fleet-empty-sm i { color: var(--cw-green); }

/* --- renewals rail (cf. "Schedule") --- */
body.page-fleet .fleet-rail { position: sticky; top: 12px; }
body.page-fleet .fleet-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.page-fleet .fleet-rail-head h2 { font-size: 14px; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--cw-text-primary); }
body.page-fleet .fleet-rail-hint { font-size: 11.5px; color: var(--cw-text-secondary); margin: 6px 0 12px; line-height: 1.45; }
body.page-fleet .fleet-rail-list { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 220px); overflow-y: auto; }
body.page-fleet .fleet-sched {
    border: 1px solid var(--cw-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--cw-surface);
}
body.page-fleet .fleet-sched-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--fl-soft);
    font-size: 11.5px;
    color: var(--cw-text-primary);
}
body.page-fleet .fleet-sched-head .fleet-pill { background: var(--cw-surface); }
body.page-fleet .fleet-sched-route { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; font-size: 13px; color: var(--cw-text-primary); min-width: 0; }
body.page-fleet .fleet-sched-route strong { white-space: nowrap; }
body.page-fleet .fleet-sched-route span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.page-fleet .fleet-sched-line { flex: 1; min-width: 16px; border-top: 1px dashed var(--cw-border); }
body.page-fleet .fleet-sched-actions { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px; flex-wrap: wrap; }

body.page-fleet .fleet-btn-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid var(--cw-border);
    border-radius: 9999px;
    background: var(--fl-soft);
    color: var(--cw-text-primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s ease;
}
body.page-fleet .fleet-btn-soft i { color: var(--fl-accent); }
body.page-fleet .fleet-btn-soft:hover { border-color: var(--fl-accent); }
body.page-fleet .fleet-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 4px 6px;
    border: 0;
    background: none;
    color: var(--cw-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
body.page-fleet .fleet-link:hover { color: var(--cw-text-primary); }

/* --- detail drawer (cf. vehicle detail board) --- */
body.page-fleet .fleet-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1002;
    background: rgba(11, 20, 38, .35);
    opacity: 0;
    transition: opacity .2s ease-out;
}
body.page-fleet .fleet-drawer-overlay.is-open { opacity: 1; }
body.page-fleet .fleet-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1003;
    width: min(460px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--cw-bg);
    border-left: 1px solid var(--cw-border);
    box-shadow: -12px 0 32px var(--shadow-hover);
    transform: translateX(16px);
    opacity: 0;
    transition: transform .22s ease-out, opacity .2s ease-out;
}
body.page-fleet .fleet-drawer.is-open { transform: none; opacity: 1; }
body.page-fleet .fleet-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--cw-surface);
    border-bottom: 1px solid var(--cw-border);
}
body.page-fleet .fleet-drawer-crumb { font-size: 11.5px; color: var(--cw-text-secondary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.page-fleet .fleet-drawer-head h3 { margin: 2px 0 0; font-size: 19px; font-weight: 700; color: var(--cw-text-primary); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
body.page-fleet .fleet-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
body.page-fleet .fleet-hero {
    display: flex;
    justify-content: center;
    padding: 14px 24px 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--fl-soft), var(--cw-surface));
    border: 1px solid var(--cw-border);
}
body.page-fleet .fleet-hero .fleet-truck { max-width: 230px; }
body.page-fleet .fleet-d-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    padding: 14px;
}
body.page-fleet .fleet-d-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--cw-text-primary); margin-bottom: 10px; }
body.page-fleet .fleet-d-title i { color: var(--cw-text-secondary); font-size: 12px; }
body.page-fleet .fleet-d-driver { display: flex; align-items: center; gap: 12px; }
body.page-fleet .fleet-d-name { font-size: 15px; font-weight: 600; color: var(--cw-text-primary); }
body.page-fleet .fleet-d-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body.page-fleet .fleet-d-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.page-fleet .fleet-stat { background: var(--cw-surface); border: 1px solid var(--cw-border); border-radius: 14px; padding: 12px; min-width: 0; height: 100%; }
body.page-fleet .fleet-stat-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cw-text-secondary); }
body.page-fleet .fleet-stat-value { margin-top: 10px; font-size: 22px; font-weight: 700; color: var(--cw-text-primary); font-variant-numeric: tabular-nums; }
body.page-fleet .fleet-stat-value small { font-size: 12px; font-weight: 500; color: var(--cw-text-secondary); }
body.page-fleet .fleet-d-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 12.5px; color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border-soft); flex-wrap: wrap; }
body.page-fleet .fleet-d-row i { color: var(--cw-text-secondary); width: 14px; }
body.page-fleet .fleet-d-row + .fleet-meter { margin: 10px 0 2px; }
body.page-fleet .fleet-d-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
body.page-fleet .fleet-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; padding: 4px 2px 0; border-bottom: 1px solid var(--cw-border-soft); }
body.page-fleet .fleet-bars span { flex: 1; max-width: 28px; border-radius: 5px 5px 2px 2px; background: var(--fl-accent); opacity: .7; }
body.page-fleet .fleet-bars-caption { font-size: 11px; margin: 6px 0 4px; }
body.page-fleet .fleet-trips { list-style: none; margin: 0; padding: 0; }
body.page-fleet .fleet-trips li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--cw-border-soft); }
body.page-fleet .fleet-trip-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.page-fleet .fleet-trip-route { font-size: 12.5px; color: var(--cw-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.page-fleet .fleet-trip-route i { font-size: 9px; color: var(--cw-text-muted); margin: 0 3px; }
body.page-fleet .fleet-trip-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
body.page-fleet .fleet-trip-kg { font-size: 12.5px; font-weight: 600; color: var(--cw-text-primary); font-variant-numeric: tabular-nums; }
body.page-fleet .fleet-loader { text-align: center; padding: 16px; color: var(--cw-text-secondary); font-size: 12px; }

/* --- table view (DataTables) --- */
body.page-fleet .status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--cw-text-primary);
}
body.page-fleet .status-available { background: var(--cw-green-soft); }
body.page-fleet .status-on-trip { background: var(--cw-primary-soft); }
body.page-fleet .status-maintenance { background: var(--cw-orange-soft); }
body.page-fleet .status-inactive { background: var(--cw-surface-soft); color: var(--cw-text-secondary); }
body.page-fleet .license-expired { color: var(--cw-red); font-weight: 700; }
body.page-fleet .license-warning { color: var(--cw-orange); font-weight: 600; }
body.page-fleet table.dataTable { min-width: 0; max-width: 100%; }
body.page-fleet table.dataTable tbody td { font-size: 13px; border-color: var(--cw-border-soft); font-variant-numeric: tabular-nums; }
body.page-fleet table.dataTable tbody td:nth-child(n+8):nth-child(-n+10) { text-align: right; }
body.page-fleet table.dataTable tbody td:last-child { white-space: nowrap; }
body.page-fleet table.dataTable .dtr-data { overflow-wrap: anywhere; }
body.page-fleet .dataTables_wrapper { overflow: visible; color: var(--cw-text-secondary); font-size: 12px; }
body.page-fleet .dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 8px; color: var(--cw-text-secondary) !important; }
body.page-fleet .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.page-fleet .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-text-primary) !important;
    border: 1px solid var(--cw-border) !important;
    box-shadow: none;
}
/* Responsive measures columns while the loader hides this container. */
body.page-fleet #tableContainer[style*="display: none"] {
    display: block !important;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

/* --- modals --- */
body.page-fleet .modal-overlay { z-index: 1004; }
body.page-fleet .modal { max-width: 720px; border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-fleet .modal.fleet-modal-wide { max-width: 860px; }
body.page-fleet .modal-header { background: var(--cw-surface); color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border); border-radius: 16px 16px 0 0; padding: 16px 20px; }
body.page-fleet .modal-header h3 { font-size: 14px; }
body.page-fleet .modal-body { padding: 20px; overflow-wrap: anywhere; }
body.page-fleet .close-btn { width: 30px; height: 30px; flex-shrink: 0; color: var(--cw-text-secondary); font-size: 16px; border-radius: 8px; background: transparent; border: 0; cursor: pointer; }
body.page-fleet .form-actions { justify-content: flex-end; gap: 8px; margin-top: 16px; }
body.page-fleet .form-id-info {
    background: var(--cw-surface-soft);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}
body.page-fleet .fleet-subpanel { background: var(--cw-surface-soft); border: 1px solid var(--cw-border); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
body.page-fleet .fleet-subpanel h4,
body.page-fleet .fleet-subtitle { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
body.page-fleet .fleet-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
body.page-fleet .fleet-mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--cw-text-primary); }
body.page-fleet .fleet-mini-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--cw-text-muted);
    background: var(--cw-surface-soft);
    border-bottom: 1px solid var(--cw-border);
    white-space: nowrap;
}
body.page-fleet .fleet-mini-table td { padding: 8px 10px; border-bottom: 1px solid var(--cw-border-soft); font-variant-numeric: tabular-nums; }
body.page-fleet .fleet-mini-table tfoot td { font-weight: 700; background: var(--cw-surface-soft); border-bottom: 0; }
body.page-fleet .fleet-mini-table .num { text-align: right; }
body.page-fleet .fleet-mini-table .center { text-align: center; }
body.page-fleet .fleet-mini-table .nowrap { white-space: nowrap; }
body.page-fleet .fleet-mini-table .strong { font-weight: 600; }
body.page-fleet .fleet-empty-line { text-align: center; color: var(--cw-text-secondary); padding: 20px; font-size: 13px; }
body.page-fleet .fleet-empty-line.is-error { color: var(--cw-red); }
body.page-fleet .swal2-popup { background: var(--cw-surface); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 16px; }
body.page-fleet .swal2-title { font-size: 20px; }
body.page-fleet .swal2-html-container { font-size: 13px; }
body.page-fleet .swal2-styled.swal2-confirm { background: var(--cw-primary-soft) !important; color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }
body.page-fleet .swal2-styled.swal2-cancel { background: var(--cw-surface-soft); color: var(--cw-text-primary); border: 1px solid var(--cw-border); border-radius: 8px; }

/* The toolbar's "Add vehicle" covers every width, and phones already have the
   bottom-nav "+": a third floating "+" would only compete with them. */
body.page-fleet .fleet-fab { display: none; }

@media (prefers-reduced-motion: reduce) {
    body.page-fleet .fleet-drawer,
    body.page-fleet .fleet-drawer-overlay,
    body.page-fleet .fleet-ring-fill { transition: none; }
}

@media (max-width: 1279px) {
    body.page-fleet .fleet-layout { grid-template-columns: minmax(0, 1fr); }
    body.page-fleet .fleet-rail { position: static; }
    body.page-fleet .fleet-rail-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        max-height: none;
    }
}

@media (max-width: 999px) {
    body.page-fleet .fleet-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.page-fleet .fleet-kpi:nth-child(3) { border-left: 0; }
    body.page-fleet .fleet-kpi:nth-child(n+3) { border-top: 1px solid var(--cw-border-soft); }
    body.page-fleet .fleet-kpi-tile { width: 40px; height: 40px; border-radius: 11px; font-size: 16px; }
    body.page-fleet .fleet-ring { width: 44px; height: 44px; }
    body.page-fleet .data-section { padding: 12px; }
    body.page-fleet .section-header-actions { width: 100%; }
    body.page-fleet .fleet-search { flex: 1 1 100%; }
    body.page-fleet .fleet-search input { width: 100%; min-height: 44px; font-size: 16px; }
    body.page-fleet .fleet-view-toggle { flex: 1; }
    body.page-fleet .fleet-view-btn { flex: 1; justify-content: center; min-height: 38px; font-size: 13px; }
    body.page-fleet .fleet-icon-btn { flex: 0 0 44px; width: 44px; }
    body.page-fleet .section-header-actions > .btn-primary { flex: 1 1 100%; justify-content: center; }
    body.page-fleet .fleet-kpi-sub { white-space: normal; }
    body.page-fleet .fleet-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    body.page-fleet .fleet-chip { min-height: 40px; white-space: nowrap; flex-shrink: 0; }
    body.page-fleet .fleet-card-art { width: 96px; }
    body.page-fleet .action-icon,
    body.page-fleet .close-btn { width: 44px; height: 44px; min-width: 44px; font-size: 16px; }
    body.page-fleet .fleet-card-actions { gap: 8px; flex-wrap: wrap; }
    body.page-fleet .fleet-btn-soft,
    body.page-fleet .fleet-link { min-height: 44px; font-size: 13px; }
    body.page-fleet .filters-grid,
    body.page-fleet .form-grid { grid-template-columns: minmax(0, 1fr); }
    body.page-fleet .fleet-span-2 { grid-column: auto; }
    body.page-fleet .btn { min-height: 44px; font-size: 13px; }
    body.page-fleet .filter-input,
    body.page-fleet .form-group input:not([type="radio"]):not([type="checkbox"]),
    body.page-fleet .form-group textarea,
    body.page-fleet .form-group select { min-height: 44px; font-size: 16px; }
    body.page-fleet .modal-overlay { padding: 12px; }
    body.page-fleet .modal { width: 100%; max-height: 95vh; }
    body.page-fleet .modal-header,
    body.page-fleet .modal-body { padding: 16px; }
    body.page-fleet .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
    body.page-fleet .dt-buttons .dt-button { width: auto; flex: 1; margin: 0; min-height: 44px; }
    body.page-fleet .fleet-drawer { width: 100vw; border-left: 0; }
    body.page-fleet .fleet-d-actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 640px) {
    body.page-fleet .fleet-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
    body.page-fleet .fleet-kpi { padding: 12px; }
    body.page-fleet .fleet-kpi-value { font-size: 22px; }
    body.page-fleet .fleet-card-art { width: 84px; }
}
body.page-fleet .fleet-drawer[hidden],
body.page-fleet .fleet-drawer-overlay[hidden] { display: none; }
body.page-fleet a.btn { text-decoration: none; }

/* =========================================================================
   GLOBAL: SHELL — header actions and account menu (every page)
   sidebar.php injects quick-add, the bell, the greeting and the account menu
   into .header (or the dashboard top bar). The menu reaches the dashboard,
   profile, settings and sign-out from any page, on desktop and phones.
   ========================================================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a.sidebar-title { display: flex; align-items: center; text-decoration: none; }
a.sidebar-title:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; border-radius: 8px; }

.main-content > .header {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
    padding: 14px 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.main-content .data-section {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
/* the bell wrapper carries an inline right margin from older markup */
.header-actions #notifBellWrap { margin-right: 0 !important; }
.header-actions .header-greeting { font-size: 13px; color: var(--cw-text-secondary); white-space: nowrap; }

.user-menu-host { position: relative; }
.user-menu[hidden],
.user-menu-panel[hidden] { display: none !important; }

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 3px 9px 3px 3px;
    border: 1px solid var(--cw-border);
    border-radius: 9999px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] { background: var(--cw-surface-soft); border-color: var(--cw-contour); }
.user-menu-trigger:focus-visible,
.dash-user-chip[aria-haspopup]:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }

.user-menu-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--cw-orange-soft);
    color: var(--cw-text-primary);
    font-size: 13px;
    font-weight: 700;
}
.user-menu-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-menu-avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.user-menu-chevron { font-size: 10px; color: var(--cw-text-muted); transition: transform .15s ease; }
[aria-expanded="true"] > .user-menu-chevron { transform: rotate(180deg); }

/* the dashboard's own chip becomes the trigger there */
.dash-user-chip[aria-haspopup] {
    cursor: pointer;
    border-radius: 9999px;
    padding: 4px 10px 4px 4px;
    transition: background-color .15s ease;
}
.dash-user-chip[aria-haspopup]:hover,
.dash-user-chip[aria-expanded="true"] { background: var(--cw-surface-soft); }

.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10000;
    width: 260px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 14px;
    box-shadow: 0 16px 40px var(--shadow-hover);
    text-align: left;
}
.user-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--cw-border-soft);
}
.user-menu-who { display: flex; flex-direction: column; min-width: 0; }
.user-menu-name { font-size: 13px; font-weight: 600; color: var(--cw-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-role { font-size: 11.5px; color: var(--cw-text-secondary); }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--cw-text-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .12s ease;
}
.user-menu-item i { width: 16px; text-align: center; font-size: 13px; color: var(--cw-text-secondary); }
.user-menu-item:hover { background: var(--cw-surface-soft); }
.user-menu-item:focus-visible { background: var(--cw-surface-soft); outline: 2px solid var(--cw-primary); outline-offset: -2px; }
.user-menu-sep { height: 1px; margin: 4px 6px; background: var(--cw-border-soft); }
.user-menu-logout,
.user-menu-logout i { color: var(--cw-red); }
.user-menu-logout:hover { background: var(--cw-red-soft); }

@media (max-width: 999px) {
    .main-content > .header { padding: 12px 14px; }
    .header-actions { width: 100%; margin-left: 0; }
    .header-actions .header-greeting { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .user-menu-trigger { min-height: 44px; padding: 4px 10px 4px 4px; }
    .user-menu-avatar { width: 34px; height: 34px; }
    .user-menu-item { min-height: 44px; font-size: 14px; }
    .user-menu-panel { width: min(300px, calc(100vw - 32px)); }
}

/* Commodity view switcher (DESIGN.md §6.21): desktop top bar, beside the breadcrumbs, just above the avatar.
   Phones and tablets keep the sidebar selector only. */
.cv-switch[hidden],
.cv-panel[hidden] { display: none !important; }
.cv-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cv-row > .breadcrumb { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.cv-switch { position: relative; margin-left: auto; min-width: 0; }
.cv-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    min-height: 44px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.cv-trigger:hover,
.cv-trigger[aria-expanded="true"] { background: var(--cw-surface-soft); border-color: var(--cw-contour); }
/* One campaign only: the same tile as a label, nothing to open. */
.cv-trigger.cv-static { cursor: default; }
.cv-trigger.cv-static:hover { background: var(--cw-surface); border-color: var(--cw-border); }
.cv-trigger:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
.cv-thumb {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    color: var(--cw-text-secondary);
    font-size: 13px;
    font-weight: 700;
}
.cv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cv-kicker { font-size: 11px; color: var(--cw-text-secondary); }
.cv-name { font-size: 13px; font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-state,
.cv-item-state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cv-state {
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--cw-green-soft);
    color: var(--cw-text-primary);
}
.cv-state.is-readonly { background: var(--cw-orange-soft); }
.cv-state i,
.cv-item-state i { font-size: 10px; }
.cv-state.is-active > i,
.cv-item-state.is-active > i { color: var(--cw-green); }
.cv-state.is-readonly > i,
.cv-item-state.is-readonly > i { color: var(--cw-orange); }
.cv-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10000;
    width: 340px;
    max-width: calc(100vw - 24px);
    max-height: min(480px, 70vh);
    overflow-y: auto;
    padding: 6px;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 14px;
    box-shadow: 0 16px 40px var(--shadow-hover);
}
.cv-panel .cv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 7px 10px 7px 7px;
    border-radius: 8px;
    color: var(--cw-text-primary);
    text-decoration: none;
    transition: background-color .12s ease;
}
.cv-panel .cv-item:hover { background: var(--cw-surface-soft); }
.cv-panel .cv-item:focus-visible { background: var(--cw-surface-soft); outline: 2px solid var(--cw-primary); outline-offset: -2px; }
.cv-item[aria-current="true"] { background: var(--cw-primary-soft); }
.cv-item-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.cv-item-name { font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
.cv-item-meta { display: flex; flex-wrap: wrap; column-gap: 8px; font-size: 11.5px; color: var(--cw-text-secondary); }
/* secondary text is under 4.5:1 on the primary tint */
.cv-item[aria-current="true"] .cv-item-meta { color: var(--cw-text-primary); }
.cv-check { visibility: hidden; font-size: 12px; color: var(--cw-primary); }
.cv-item[aria-current="true"] .cv-check { visibility: visible; }
.cv-note {
    display: flex;
    gap: 8px;
    margin: 4px 0 0;
    padding: 9px 10px 5px;
    border-top: 1px solid var(--cw-border-soft);
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--cw-text-secondary);
}
.cv-note i { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) {
    .cv-trigger, .cv-item { transition: none; }
}
@media (max-width: 999px) {
    .cv-row-solo,
    .cv-switch { display: none !important; }
}

/* =========================================================================
   GLOBAL: SHARED RECIPES — forms, modals, filters, DataTables controls, dialogs
   DESIGN.md §6.6–§6.11 applied to every page. Measured before this block:
   control radius 0/2/4/6/8px, desktop control height 38–52px, labels 12px/600
   or 14px/500, and a saturated navy modal header on Expenses and Bags Log.
   `body` raises these over the legacy sheet; per-page blocks (body.page-x …)
   are more specific and still win where a page needs its own variant.
   ========================================================================= */
body .modal {
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: 0 24px 64px var(--shadow-hover);
}
body .modal-header {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border-bottom: 1px solid var(--cw-border);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
}
body .modal-header h2,
body .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--cw-text-primary);
}
body .modal-header h2 i,
body .modal-header h3 i { font-size: 14px; color: var(--cw-text-secondary); }
body .modal-header .close-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cw-text-secondary);
    font-size: 16px;
}
body .modal-header .close-btn:hover { background: var(--cw-surface-soft); color: var(--cw-text-primary); transform: none; }
/* The close X is drawn here, not by Font Awesome: when its CDN fails, <i class="fas fa-times"> is blank. Literal × buttons hold no <i>. */
.close-btn > i.fa-times { position: relative; display: inline-block; width: 1em; height: 1em; vertical-align: middle; }
.close-btn > i.fa-times::before,
.close-btn > i.fa-times::after { content: ""; position: absolute; top: 50%; left: 50%; width: 1.1em; height: 2px; margin: -1px 0 0 -0.55em; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.close-btn > i.fa-times::after { transform: rotate(-45deg); }
body .modal-body { padding: 20px; }

body .form-grid { gap: 14px 16px; }
body .form-group label {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-text-secondary);
    text-transform: none;
    letter-spacing: normal;
}
body .form-group label i { margin-right: 6px; font-size: 12px; color: var(--cw-text-muted); }
body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
body .form-group select,
body .form-group textarea,
body .filter-group input:not([type="checkbox"]):not([type="radio"]),
body .filter-group select,
body .filter-input {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--cw-text-primary);
    font-family: inherit;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body .form-group textarea { min-height: 76px; line-height: 1.45; }
body .form-group input:focus,
body .form-group select:focus,
body .form-group textarea:focus,
body .filter-group input:focus,
body .filter-group select:focus,
body .filter-input:focus {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px var(--cw-primary-soft);
}
body .form-group :is(input, select, textarea):focus-visible,
body .filter-group :is(input, select):focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 1px; }
body .form-group input::placeholder,
body .form-group textarea::placeholder { color: var(--cw-text-muted); }
body .form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

body .filters-section {
    background: var(--cw-surface-soft);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: none;
}
body .filters-header {
    border-bottom: 1px solid var(--cw-border);
    padding-bottom: 10px;
    margin-bottom: 12px;
}
body .filters-header h3 { font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
body .filters-header h3 i { font-size: 12px; color: var(--cw-text-secondary); }
body .filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-text-secondary);
    text-transform: none;
    letter-spacing: normal;
}
body .filter-group label i { font-size: 12px; color: var(--cw-text-muted); }

body .dataTables_wrapper .dataTables_length,
body .dataTables_wrapper .dataTables_filter,
body .dataTables_wrapper .dataTables_info { font-size: 12.5px; color: var(--cw-text-secondary); }
body .dataTables_wrapper .dataTables_filter input,
body .dataTables_wrapper .dataTables_length select {
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--cw-text-primary);
}
body .dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 8px; color: var(--cw-text-secondary) !important; }
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-text-primary) !important;
    border: 1px solid var(--cw-border) !important;
    box-shadow: none;
}

/* SweetAlert2: the library's purple default buttons showed on every page
   without a per-page block. Red confirm colours passed as confirmButtonColor
   (#d33 / #ea4335 / #e74c3c / var(--cw-red-soft)) keep their danger meaning as a rose tint. */
body .swal2-popup {
    background: var(--cw-surface);
    color: var(--cw-text-primary);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
}
body .swal2-title { font-size: 18px; font-weight: 600; color: var(--cw-text-primary); }
body .swal2-html-container { font-size: 13.5px; color: var(--cw-text-secondary); }
body .swal2-actions .swal2-styled {
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
}
body .swal2-actions .swal2-styled.swal2-confirm {
    background: var(--cw-primary-soft) !important;
    color: var(--cw-primary) !important;
    border: 1px solid var(--cw-border);
}
/* SweetAlert2 11 passes confirmButtonColor as --swal2-confirm-button-background-color (older builds as an
   rgb background-color): match both spellings of the red values used in this app. */
body .swal2-actions .swal2-styled.swal2-confirm:is([style*="#d33"], [style*="#ea4335"], [style*="#e74c3c"], [style*="#dc3545"], [style*="--cw-red"],
    [style*="221, 51, 51"], [style*="234, 67, 53"], [style*="231, 76, 60"], [style*="220, 53, 69"]) {
    background: var(--cw-red-soft) !important;
    color: var(--cw-red) !important;
}
body .swal2-actions .swal2-styled.swal2-cancel,
body .swal2-actions .swal2-styled.swal2-deny {
    background: var(--cw-surface-soft) !important;
    color: var(--cw-text-primary) !important;
    border: 1px solid var(--cw-border);
}
body .swal2-actions .swal2-styled:focus-visible { box-shadow: 0 0 0 3px var(--cw-primary-soft); outline: 2px solid var(--cw-primary); }

/* Desktop controls at the 13px body scale (DESIGN.md §6.8). The legacy sheet
   forces 16px on every input so iOS does not zoom on focus: keep that for any
   touch device, at any width. */
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
    body :is(.form-group, .filter-group, .filters-section, .modal, .dataTables_wrapper) :is(input, select, textarea) { font-size: 13px !important; }
}

@media (max-width: 999px) {
    body .modal-header { padding: 14px 16px; }
    body .modal-body { padding: 16px; }
    body .modal-header .close-btn { width: 44px; height: 44px; }
    body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
    body .form-group select,
    body .filter-group input:not([type="checkbox"]):not([type="radio"]),
    body .filter-group select,
    body .filter-input { min-height: 44px; }
    body .dataTables_wrapper .dataTables_filter input,
    body .dataTables_wrapper .dataTables_length select { min-height: 44px; }
}

/* =========================================================================
   DASHBOARD: KPI REFRESH
   Feedback: figures read cramped. Values are bolder and larger (800 weight),
   labels use the UI font instead of monospace (DESIGN.md §3 keeps monospace
   for identifiers), and the secondary cards fill two balanced rows on wide
   screens: dashboard.php sets --kpi-cols to half the card count (max 6), so
   11 cards read 6 + 5 instead of 8 + 3 orphans. A value only shrinks below
   its design size when it would not fit its card (dashboard.php fit()).
   ========================================================================= */
body.page-dashboard .kpi-card { min-width: 0; }
body.page-dashboard .kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    min-width: 0;
}
body.page-dashboard .kpi-card-value {
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    color: var(--cw-text-primary);
}
body.page-dashboard .kpi-card-label {
    margin: 6px 0 0;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.35;
    text-transform: uppercase;
    color: var(--cw-text-muted);
}
body.page-dashboard .kpi-card-sub {
    margin-top: 3px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--cw-text-secondary);
    overflow-wrap: anywhere;
}

/* primary row: the three headline figures */
body.page-dashboard .dashboard-primary-kpi .kpi-card { padding: 16px 18px 18px; }
body.page-dashboard .dashboard-primary-kpi .kpi-card-value { font-size: 30px; }
body.page-dashboard .dashboard-primary-kpi .kpi-card-label { font-size: 11px; }
body.page-dashboard .dashboard-primary-kpi .kpi-card-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }

/* secondary grid */
body.page-dashboard .dashboard-kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}
body.page-dashboard .dashboard-kpi-grid .kpi-card {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 16px;
}
body.page-dashboard .dashboard-kpi-grid .kpi-card-value { font-size: 24px; }
body.page-dashboard .dashboard-kpi-grid .kpi-card-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }

/* scope badge: full text on the wide primary cards, a globe on compact cards
   (text kept for screen readers; the tooltip carries it for pointer users) */
body.page-dashboard .kpi-scope { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.page-dashboard .kpi-scope i { font-size: 10px; flex-shrink: 0; }
body.page-dashboard .dashboard-kpi-grid .kpi-scope {
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
}
body.page-dashboard .dashboard-kpi-grid .kpi-scope-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (min-width: 1280px) {
    body.page-dashboard .dashboard-kpi-grid { grid-template-columns: repeat(var(--kpi-cols, 6), minmax(0, 1fr)); }
}
@media (min-width: 1000px) and (max-width: 1279px) {
    body.page-dashboard .dashboard-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body.page-dashboard .dashboard-primary-kpi .kpi-card-value { font-size: 26px; }
}
@media (max-width: 999px) {
    body.page-dashboard .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.page-dashboard .dashboard-primary-kpi .kpi-card { padding: 14px 16px 16px; }
    body.page-dashboard .dashboard-primary-kpi .kpi-card-value { font-size: 28px; }
    body.page-dashboard .dashboard-kpi-grid .kpi-card { padding: 12px 12px 14px; }
    body.page-dashboard .dashboard-kpi-grid .kpi-card-value { font-size: 22px; }
    body.page-dashboard .dashboard-kpi-grid .kpi-card-label { font-size: 10.5px; letter-spacing: 0.04em; }
    body.page-dashboard .dashboard-kpi-grid .kpi-card-sub { font-size: 11px; }
    body.page-dashboard .dashboard-kpi-grid .kpi-card-icon { width: 34px; height: 34px; font-size: 14px; }
    /* primary cards are full width on phones: room for the full scope text, truncated if it must */
    body.page-dashboard .dashboard-primary-kpi .kpi-scope { max-width: 70%; }
}
/* AI insights card: its header row (title + scope + Generate) is inline-styled; let it wrap instead of
   pushing the button past the card edge */
body.page-dashboard .dash-ai-card { min-width: 0; overflow: hidden; }
body.page-dashboard .dash-ai-card > div:first-child { flex-wrap: wrap; gap: 8px; }
body.page-dashboard .dash-ai-card > div:first-child h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
body.page-dashboard .dash-ai-card .kpi-scope { max-width: 100%; }
/* chart-card titles: a scope badge that does not fit moves under the title and wraps its text instead of being cut */
body.page-dashboard :is(.prices-chart-card, .overview-chart-card) h3 { flex-wrap: wrap; min-width: 0; }
body.page-dashboard :is(.prices-chart-card, .overview-chart-card) .kpi-scope { white-space: normal; max-width: 100%; }
@media (max-width: 480px) {
    /* five summary tiles: the last one spans the row instead of sitting alone */
    body.page-dashboard .category-cards-wrapper > .category-card:last-child:nth-child(even) { grid-column: 1 / -1; }
}

/* Legacy stat cards (Inventory, Profit Analysis, …) → the dashboard KPI card recipe: neutral figure,
   3px accent instead of the 4px navy bar, labels at the KPI scale. Inline accent colours still apply. */
body .stat-card {
    padding: 16px 18px;
    border: 1px solid var(--cw-border);
    border-left: 3px solid var(--cw-border);
    border-radius: 16px;
    box-shadow: none;
    min-width: 0;
}
body .stat-card:hover { transform: none; box-shadow: 0 8px 24px var(--shadow-color); }
body .stat-card-icon { width: 34px; height: 34px; font-size: 14px; border-radius: 8px; margin-bottom: 12px; }
body .stat-card-value,
body.dark-mode .stat-card-value {
    margin-bottom: 4px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--cw-text-primary);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
body .stat-card-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--cw-text-muted);
}
@media (max-width: 999px) {
    body .stat-card-value, body.dark-mode .stat-card-value { font-size: 22px; }
    body .stat-card-icon { width: 40px; height: 40px; font-size: 16px; }
}
/* section titles at the card-title scale (DESIGN.md §3); per-page blocks still win */
.main-content .section-header h2 { font-size: 14px; font-weight: 600; color: var(--cw-text-primary); }

/* ===== JUTE BAGS (item 24): Bags Log cards, the bags a person owes us, kind pills, dialogs (bag-person.js) ===== */
.bag-cards { margin-bottom: 16px; }
.bag-cards .stat-card { padding: 16px 18px; }
.bag-cards .stat-card-value { font-size: 26px; font-weight: 800; color: var(--cw-text-primary); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }
.bag-cards .stat-card-label { font-size: 11px; letter-spacing: .05em; }
/* Bags we owe / bags owed to us (2026-11-15): the bag count big, its value at the jute bag price and how many people below */
.bag-cards .stat-card-sub { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--ink-2, var(--text-muted)); }
.bag-cards .stat-card-sub strong { font-weight: 600; color: var(--ink, var(--cw-text-primary)); font-variant-numeric: tabular-nums; }
.bag-cards .stat-card-sub a { color: var(--g-blue, var(--cw-primary)); text-decoration: underline; }
.bag-owed-people { display: block; }
/* the dashboard's two bag cards: the value on one line, the people below (a KPI sub line is a flex row elsewhere) */
.kpi-card-sub.bag-owed-sub, html[data-look] .kpi-card-sub.bag-owed-sub { display: block; }
.kpi-card-sub.bag-owed-sub strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-card-sub.bag-owed-sub.is-error { color: var(--danger, #B3261E); }
.kpi-card-sub.bag-owed-sub a { color: var(--g-blue, var(--cw-primary)); text-decoration: underline; }
.bag-cards .stat-card-sub.is-error { color: var(--danger, #B3261E); }
.bag-cards .bag-skel { display: inline-block; height: 28px; width: 90px; }
/* phones: the four bag cards two by two, so the totals and the list below stay on the first screen */
@media (max-width: 640px) {
    .dashboard-grid-2.bag-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dashboard-grid-2.bag-cards .stat-card { padding: 12px 12px; }
    .bag-cards .stat-card-value { font-size: 24px; }
    .bag-cards .stat-card-sub { font-size: 13px; }
}
.bag-owed { font-weight: 600; white-space: nowrap; }
.bag-owed.is-owes-us { color: var(--cw-orange); }
.bag-owed.is-we-owe { color: var(--cw-primary); }
.bag-owed.is-settled { color: var(--cw-green); }
.bag-kind-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--cw-surface-soft); color: var(--cw-text-secondary); white-space: nowrap; }
.bag-kind-pill.is-charge { background: var(--cw-orange-soft); color: var(--cw-orange); }
.bag-kind-pill.is-payment { background: var(--cw-primary-soft); color: var(--cw-primary); }
.bag-kind-pill.is-bought { background: var(--cw-green-soft); color: var(--cw-green); }
.bag-person-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.bag-dialog-grid { display: grid; gap: 10px; text-align: left; }
.bag-dialog-grid label { font-size: 12px; font-weight: 600; color: var(--cw-text-secondary); display: block; margin-bottom: 4px; }
.bag-dialog-grid .swal2-input, .bag-dialog-grid .swal2-select, .bag-dialog-grid .swal2-file { width: 100%; max-width: none; box-sizing: border-box; margin: 0; }
.bag-dialog-grid [hidden] { display: none; }
.bag-dialog-grid #bagDlgDriverName:not([hidden]) { margin-top: 6px; }
.bag-dialog-note { font-size: 13px; color: var(--cw-text-secondary); margin: 0; }

/* Group headings of the new design (dashboard.php, the design part below). */
.kpi-group-head { display: none; }

/* Profit Analysis on white (owner 2026-11-08): each tab sits on a white panel like the other pages' cards, both designs
   (dark mode keeps its own surface). Print / PDF prints only the open tab, on white, without the app chrome. */
body.page-profit-analysis .pricing-tab-content.active {
    background: var(--cw-surface, #fff);
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    padding: 16px;
}
body.page-profit-analysis .pricing-tab-content .card,
body.page-profit-analysis .pricing-tab-content .data-section { background: var(--cw-surface, #fff); box-shadow: none; }
body.page-profit-analysis .card-header,
body.page-profit-analysis .pricing-tab-content .section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
body.page-profit-analysis .pa-export { display: flex; gap: 8px; flex-wrap: wrap; }
body.page-profit-analysis .pa-export .btn { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
body.page-profit-analysis .pa-print-head { display: none; }
@media (max-width: 999px) {
    body.page-profit-analysis .pricing-tab-content.active { padding: 10px; }
}
@media print {
    @page { margin: 12mm; }
    html, body.page-profit-analysis { background: #fff !important; color: #000 !important; }
    body.page-profit-analysis .sidebar, body.page-profit-analysis .mobile-menu, body.page-profit-analysis .mobile-nav,
    body.page-profit-analysis .mobile-bottom-nav, body.page-profit-analysis .breadcrumb, body.page-profit-analysis .header,
    body.page-profit-analysis .pricing-tabs, body.page-profit-analysis .no-print, body.page-profit-analysis .dt-buttons,
    body.page-profit-analysis .dataTables_length, body.page-profit-analysis .dataTables_filter,
    body.page-profit-analysis .dataTables_paginate, body.page-profit-analysis .table-scroll-hint,
    body.page-profit-analysis .cf-opening-edit, body.page-profit-analysis .campaign-note,
    body.page-profit-analysis .pricing-tab-content:not(.active), body.page-profit-analysis .commodity-view,
    body.page-profit-analysis .cv-switch, body.page-profit-analysis #commodityViewSwitcher, body.page-profit-analysis .cv-panel,
    body.page-profit-analysis .topbar, body.page-profit-analysis [class*="bottom-bar"] { display: none !important; }
    html[data-look] body.page-profit-analysis, html[data-look] body.page-profit-analysis .main-content,
    html[data-look] body.page-profit-analysis .app-container { background: #fff !important; }
    body.page-profit-analysis .app-container, body.page-profit-analysis .main-content { display: block !important; margin: 0 !important; padding: 0 !important; width: auto !important; height: auto !important; overflow: visible !important; }
    body.page-profit-analysis .pa-print-head { display: flex !important; flex-direction: column; gap: 2px; margin-bottom: 10px; font-size: 12px; }
    body.page-profit-analysis .pa-print-head strong { font-size: 16px; }
    body.page-profit-analysis .pricing-tab-content.active { border: 0; padding: 0; background: #fff !important; }
    body.page-profit-analysis .pnl-statement { max-width: none !important; }
    html, body.page-profit-analysis, body.page-profit-analysis * { box-shadow: none !important; transition: none !important; animation: none !important; }
    body.page-profit-analysis tr { break-inside: avoid; }
}

/* ================================================================================================
   PART: SETTINGS SHELL: Settings, Account, Users, Logs, reference data (was admin.css)
   ================================================================================================ */

/* ============================================================================
   Administration shell — DESIGN.md §6.15
   One surface: grouped nav on the left, the current section on the right.
   Scoped to body.adm-page so no other page changes. Tokens only (§2).
   ========================================================================= */

body.adm-page .main-content { min-width: 0; }
body.adm-page .breadcrumb { flex-wrap: wrap; color: var(--cw-text-secondary); }
body.adm-page .breadcrumb a { color: var(--cw-text-secondary); }

/* ---- Frame ------------------------------------------------------------- */
body.adm-page .adm-frame {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    align-items: start;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    min-height: calc(100vh - 170px);
}

/* ---- Desktop nav --------------------------------------------------------- */
body.adm-page .adm-nav {
    align-self: stretch;
    border-right: 1px solid var(--cw-border-soft);
}
body.adm-page .adm-nav-inner { position: sticky; top: 0; padding: 20px 12px 24px; }
body.adm-page .adm-nav-group + .adm-nav-group { margin-top: 20px; }
body.adm-page .adm-nav-title {
    margin: 0 0 6px 10px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cw-text-secondary);
}
body.adm-page .adm-nav ul,
body.adm-page .adm-picker-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
body.adm-page .adm-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--cw-text-secondary);
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
body.adm-page .adm-nav-link i { width: 16px; flex-shrink: 0; text-align: center; font-size: 13.5px; color: var(--cw-text-secondary); }
body.adm-page .adm-nav-link:hover { background: var(--cw-surface-soft); color: var(--cw-text-primary); }
body.adm-page .adm-nav-link[aria-current="page"] {
    background: var(--cw-primary-soft);
    color: var(--cw-text-primary);
    font-weight: 600;
}
body.adm-page .adm-nav-link[aria-current="page"] i { color: var(--cw-primary); }
body.adm-page .adm-nav-link:focus-visible,
body.adm-page .adm-picker-summary:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }

/* ---- Phone section picker (hidden on desktop) ---------------------------- */
/* The legal pages under the sections: small grey links, one per line (legal-lib.php). */
body.adm-page .adm-nav-legal { display: grid; gap: 0; margin: 24px 0 0; padding: 8px 12px 0; border-top: 1px solid var(--cw-border); font-size: 13px; }
body.adm-page .adm-nav-legal a { display: flex; align-items: center; min-height: 36px; padding: 0; color: var(--cw-text-secondary); text-decoration: none; }
body.adm-page .adm-nav-legal a:hover { color: var(--cw-text-primary); text-decoration: underline; }
@media (pointer: coarse), (max-width: 999px) { body.adm-page .adm-nav-legal a { min-height: 44px; } }
/* Icon credits (admin-shell.php): one small grey line of plain text under the legal links. */
body.adm-page .adm-nav-credits { margin: 8px 0 0; padding: 0 12px; font-size: 13px; line-height: 1.5; color: var(--cw-text-secondary); }
body.adm-page .adm-picker { display: none; }

/* ---- Content ------------------------------------------------------------- */
body.adm-page .adm-main { min-width: 0; padding: 24px 28px 32px; }
body.adm-page .adm-panel[hidden] { display: none !important; }
body.adm-page .adm-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--cw-border-soft);
}
body.adm-page .adm-kicker {
    display: flex; align-items: center; gap: 6px;
    margin: 0 0 4px;
    font-size: 12px;
    color: var(--cw-text-secondary);
}
body.adm-page .adm-kicker i { font-size: 9px; }
body.adm-page .adm-panel-title { margin: 0; font-size: 19px; font-weight: 600; color: var(--cw-text-primary); line-height: 1.3; }
/* The heading only receives programmatic focus (so screen readers announce the new
   section); it is not a control, so it draws no focus ring. */
body.adm-page .adm-panel-title:focus,
body.adm-page .adm-panel-title:focus-visible,
body.adm-page .adm-section:focus,
body.adm-page .adm-section:focus-visible { outline: none !important; box-shadow: none !important; }
body.adm-page .adm-panel-desc { margin: 6px 0 0; max-width: 62ch; font-size: 13px; line-height: 1.5; color: var(--cw-text-secondary); }
body.adm-page .adm-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

body.adm-page .adm-section { margin-top: 26px; }
body.adm-page .adm-section-head { padding-bottom: 10px; border-bottom: 1px solid var(--cw-border-soft); }
body.adm-page .adm-section-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--cw-text-primary); }
body.adm-page .adm-section-desc { margin: 4px 0 0; font-size: 12.5px; color: var(--cw-text-secondary); line-height: 1.5; }

/* Setting row: what it is on the left, the control on the right. */
body.adm-page .adm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 24px;
    padding: 14px 0;
    border-bottom: 1px solid var(--cw-border-soft);
}
body.adm-page .adm-row:last-child { border-bottom: 0; }
body.adm-page .adm-row-title { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--cw-text-primary); overflow-wrap: anywhere; }
body.adm-page .adm-row-desc { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--cw-text-secondary); overflow-wrap: anywhere; }
body.adm-page .adm-row-control { justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
body.adm-page .adm-row-control :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select) { width: 240px; max-width: 100%; }
body.adm-page .adm-value { font-size: 13px; font-weight: 600; color: var(--cw-text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
body.adm-page .adm-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 500; font-size: 12.5px; }
body.adm-page .adm-row-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; margin-right: 12px; flex-shrink: 0;
    border-radius: 8px; font-size: 13px;
    background: var(--cw-primary-soft); color: var(--cw-primary);
}
body.adm-page .adm-row-lead { display: flex; align-items: flex-start; min-width: 0; }
body.adm-page .adm-row-icon.green { background: var(--cw-green-soft); color: var(--cw-green); }
body.adm-page .adm-row-icon.orange { background: var(--cw-orange-soft); color: var(--cw-orange); }
body.adm-page .adm-row-icon.purple { background: var(--cw-purple-soft); color: var(--cw-purple); }
body.adm-page .adm-row-icon.red { background: var(--cw-red-soft); color: var(--cw-red); }

/* Field grid for forms that need labels above inputs (company, WhatsApp...). */
body.adm-page .adm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding-top: 16px; }
body.adm-page .adm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
body.adm-page .adm-field.wide { grid-column: 1 / -1; }
body.adm-page .adm-field > label { font-size: 12px; font-weight: 500; color: var(--cw-text-secondary); margin: 0; }
body.adm-page .adm-help { font-size: 12px; line-height: 1.45; color: var(--cw-text-secondary); }
body.adm-page .adm-panel :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea) {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--cw-text-primary);
    font-size: 13px;
    font-family: inherit;
}
body.adm-page .adm-panel :is(input, select, textarea):focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 1px; border-color: var(--cw-primary); }
body.adm-page .adm-panel .adm-field input[readonly] { background: var(--cw-surface-soft); color: var(--cw-text-secondary); }
body.adm-page .adm-inline { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.adm-page .adm-inline > :first-child { flex: 1; min-width: 0; }

/* Actions row at the end of a panel or section. */
body.adm-page .adm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 18px; }
body.adm-page .adm-actions.start { justify-content: flex-start; }
/* Read-only until Edit (account.php): the fieldset only locks its fields, it draws nothing of its own. */
body.adm-page fieldset.adm-lock { border: 0; margin: 0; padding: 0; min-width: 0; }
body.adm-page fieldset.adm-lock:disabled input, body.adm-page fieldset.adm-lock:disabled select { cursor: default; opacity: 1; color: var(--cw-text-primary); -webkit-text-fill-color: var(--cw-text-primary); }
body.adm-page .adm-main .btn { min-height: 38px; border-radius: 8px; white-space: normal; }

/* Switch: the real checkbox stays focusable on top of the track. */
body.adm-page .adm-switch { position: relative; display: inline-flex; flex-shrink: 0; width: 40px; height: 22px; }
body.adm-page .adm-switch input { position: absolute; inset: -11px -2px; width: calc(100% + 4px); height: calc(100% + 22px); margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
body.adm-page .adm-switch-track {
    position: absolute; inset: 0;
    border-radius: 9999px;
    background: var(--cw-text-secondary);
    transition: background-color .18s ease;
}
body.adm-page .adm-switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(17, 38, 76, .2);
    transition: transform .18s ease;
}
body.adm-page .adm-switch input:checked + .adm-switch-track { background: var(--cw-primary); }
body.adm-page .adm-switch input:checked + .adm-switch-track::after { transform: translateX(18px); }
body.adm-page .adm-switch input:focus-visible + .adm-switch-track { outline: 2px solid var(--cw-primary); outline-offset: 3px; }

/* Status pill + small state text next to a switch. */
body.adm-page .adm-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 9999px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
    background: var(--cw-green-soft); color: var(--cw-green);
}
body.adm-page .adm-pill.muted { background: var(--cw-surface-soft); color: var(--cw-text-secondary); }
body.adm-page .toggle-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; min-width: 64px; }
body.adm-page .toggle-status .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cw-text-muted); }
body.adm-page .toggle-status .status-dot.status-enabled { background: var(--cw-green); }

/* Note / callout. */
body.adm-page .adm-note {
    display: flex; gap: 10px; align-items: flex-start;
    margin-top: 14px; padding: 12px 14px;
    border-radius: 8px; border: 1px solid var(--cw-border-soft);
    background: var(--cw-surface-soft);
    font-size: 12.5px; line-height: 1.5; color: var(--cw-text-secondary);
}
body.adm-page .adm-note i { color: var(--cw-primary); margin-top: 2px; }

/* Shortcut tiles on the General panel. */
body.adm-page .adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding-top: 16px; }
body.adm-page .adm-tile {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px; border: 1px solid var(--cw-border); border-radius: 12px;
    background: var(--cw-surface); color: inherit; text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}
body.adm-page .adm-tile:hover { border-color: var(--cw-primary); background: var(--cw-surface-soft); }
body.adm-page .adm-tile:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
body.adm-page .adm-tile .adm-row-icon { margin: 0; }
body.adm-page .adm-tile-title { display: block; font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
body.adm-page .adm-tile-desc { display: block; margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--cw-text-secondary); }

/* Logo previews and theme swatches. */
body.adm-page .adm-logo-preview { width: 38px; height: 38px; flex-shrink: 0; border-radius: 8px; object-fit: contain; border: 1px solid var(--cw-border); background: var(--cw-surface-soft); }

/* AI on/off card state, set by updateAIToggleUI(). */
body.adm-page #aiToggleCard { cursor: default; }
body.adm-page #aiToggleIcon.is-on { background: var(--cw-green-soft); color: var(--cw-green); }
body.adm-page #aiToggleIcon.is-off { background: var(--cw-red-soft); color: var(--cw-red); }
body.adm-page #aiTestResult:not(:empty) { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 13px; }

/* Existing list pages inside the shell: their own card chrome goes, the frame is the card. */
body.adm-page .adm-main > .data-section { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; border-radius: 0; }
body.adm-page .adm-main > .data-section > .section-header { padding: 0 0 18px; margin: 0 0 16px; border-bottom: 1px solid var(--cw-border-soft); background: transparent; }
body.adm-page .adm-main > .data-section > .section-header h2 { font-size: 19px; font-weight: 600; color: var(--cw-text-primary); }
body.adm-page .adm-main > .data-section > .section-header h2 i { display: none; }


/* ---- My Account ----------------------------------------------------------- */
body.adm-page .adm-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.adm-page .adm-profile-head { display: flex; align-items: center; gap: 20px; padding-top: 4px; }
body.adm-page .adm-avatar {
    width: 84px; height: 84px; flex-shrink: 0; margin: 0;
    border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--cw-primary-soft); color: var(--cw-primary); font-size: 32px;
    border: 1px solid var(--cw-border);
}
body.adm-page .adm-profile-meta { min-width: 0; flex: 1; }
body.adm-page .adm-profile-name { margin: 0; font-size: 16px; font-weight: 600; color: var(--cw-text-primary); overflow-wrap: anywhere; }
body.adm-page .adm-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
body.adm-page .adm-upload .adm-help { margin: 0; flex-basis: 100%; }
body.adm-page .adm-upload-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin: 0; }
body.adm-page #profileImageInput:focus-visible + * , body.adm-page .adm-upload:focus-within .adm-upload-btn { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
body.adm-page .adm-upload-actions { gap: 8px; margin: 0; }
body.adm-page #display-role .role-badge, body.adm-page #display-role span { font-size: 11px; }

body.adm-page .adm-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 12px; padding-top: 16px; }
body.adm-page .adm-choice {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    padding: 10px; border: 1px solid var(--cw-border); border-radius: 12px;
    cursor: pointer; background: var(--cw-surface);
    transition: border-color .15s ease, background-color .15s ease;
}
body.adm-page .adm-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
body.adm-page .adm-choice:has(input:checked) { border-color: var(--cw-primary); background: var(--cw-primary-soft); }
body.adm-page .adm-choice:has(input:focus-visible) { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
body.adm-page .adm-choice-swatch { display: block; height: 64px; border-radius: 8px; border: 1px solid var(--cw-border); }
body.adm-page .adm-choice-swatch.light { background: linear-gradient(90deg, #0E1A2E 0 24%, #F8FAFC 24% 100%); }
body.adm-page .adm-choice-swatch.dark { background: linear-gradient(90deg, #070E1B 0 24%, #0B1426 24% 100%); }
body.adm-page .adm-choice-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
body.adm-page .adm-choice-label i { color: var(--cw-text-secondary); }

body.adm-page .adm-color input[type="color"] { width: 38px; height: 38px; padding: 2px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-bg); cursor: pointer; flex-shrink: 0; }
body.adm-page .adm-row-control.adm-color input[type="text"] { width: 110px; text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.adm-page .adm-presets { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
body.adm-page .adm-preset { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--cw-surface); box-shadow: 0 0 0 1px var(--cw-border); cursor: pointer; padding: 0; }
body.adm-page .adm-preset:hover { box-shadow: 0 0 0 2px var(--cw-primary); }
body.adm-page .adm-preset:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 3px; }
body.adm-page .adm-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; margin-top: 16px; border: 1px dashed var(--cw-border); border-radius: 12px; }
body.adm-page .adm-preview-chip { display: flex; align-items: center; justify-content: center; min-width: 84px; height: 40px; padding: 0 12px; border-radius: 8px; color: #FFFFFF; font-size: 12px; font-weight: 600; background: var(--cw-ink-navy); }


/* ---- List pages in the shell (users, reference data, activity log) -------
   Same recipe as Customer/Supplier Master (DESIGN.md §6.6–6.11). */
body.adm-page .header h1 { font-size: 19px; font-weight: 600; }
body.adm-page .header > div { font-size: 13px; color: var(--cw-text-secondary); }
body.adm-page .adm-main .btn { transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
body.adm-page .adm-main .btn-primary { background: var(--cw-primary-soft); color: var(--cw-primary-dark); border: 1px solid var(--cw-primary-soft); }
body.adm-page .adm-main .btn-primary:hover { background: var(--cw-primary-soft); border-color: var(--cw-primary); transform: none; }
body.adm-page .adm-main .btn-success { background: var(--cw-green-soft); color: var(--cw-green); border: 1px solid var(--cw-green-soft); }
body.adm-page .adm-main .btn-success:hover { border-color: var(--cw-green); transform: none; }
body.adm-page .adm-main .btn-secondary { background: var(--cw-surface); color: var(--cw-text-secondary); border: 1px solid var(--cw-border); }
body.adm-page .adm-main .btn-secondary:hover { background: var(--cw-surface-soft); color: var(--cw-text-primary); transform: none; }
body.adm-page .adm-main .btn:disabled { opacity: .55; cursor: not-allowed; }

body.adm-page .filters-section { background: var(--cw-surface-soft); border: 1px solid var(--cw-border); border-radius: 12px; box-shadow: none; }
body.adm-page .filters-header { border-bottom: 1px solid var(--cw-border); }
body.adm-page .filters-header h3 { font-size: 13px; font-weight: 600; color: var(--cw-text-primary); }
body.adm-page .filter-group label { font-size: 11px; font-weight: 600; color: var(--cw-text-secondary); letter-spacing: .02em; }
body.adm-page .filter-input { border-radius: 8px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--cw-text-primary); padding: 8px 10px; font-size: 13px; min-height: 38px; }

/* Radius only on desktop: phones keep the base part's bottom-sheet modal (square bottom corners). */
@media (min-width: 1000px) { body.adm-page .modal { border-radius: 16px; } }
body.adm-page .modal { border: 1px solid var(--cw-border); }
body.adm-page .modal-header { background: var(--cw-surface); color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border); border-radius: 16px 16px 0 0; padding: 16px 20px; }
body.adm-page .modal-header h3 { font-size: 15px; }
body.adm-page .modal-body { padding: 20px; }
body.adm-page .modal .form-group label { font-size: 12px; color: var(--cw-text-secondary); font-weight: 600; }
body.adm-page .modal .form-group :is(input, select, textarea) { border-radius: 8px; border: 1px solid var(--input-border); padding: 8px 10px; font-size: 13px; }
body.adm-page .close-btn { color: var(--cw-text-secondary); }
body.adm-page .close-btn:hover { background: var(--cw-border-soft); transform: none; }

body.adm-page .status-badge { border-radius: 9999px; padding: 4px 10px; font-size: 11px; font-weight: 600; }
body.adm-page .status-active { background: var(--cw-green-soft); color: var(--cw-green); }
body.adm-page .status-inactive { background: var(--cw-red-soft); color: var(--cw-red); }
body.adm-page .status-warn { background: var(--cw-orange-soft); color: var(--cw-text-primary); }
/* Users: staff numbers WhatsApp sign-in cannot use yet (DESIGN.md §6.15). */
body.adm-page .adm-phone-check {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
    background: var(--cw-orange-soft); border: 1px solid var(--cw-border); color: var(--cw-text-primary); font-size: 13px;
}
body.adm-page .adm-phone-check[hidden] { display: none; }
body.adm-page .adm-phone-check > i { color: var(--cw-orange); }
body.adm-page .adm-phone-check > span:first-of-type { flex: 1 1 240px; }
body.adm-page .adm-phone-check-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.adm-page .action-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--cw-surface-soft); border: 1px solid var(--cw-border); color: var(--cw-text-secondary); font-size: 13px; }
body.adm-page .action-icon:hover { background: var(--cw-border-soft); transform: none; }
body.adm-page .action-icon.edit-icon { color: var(--cw-orange); }
body.adm-page .action-icon.delete-icon { color: var(--cw-red); }

body.adm-page table.dataTable thead th { background: var(--cw-surface-soft) !important; color: var(--cw-text-secondary) !important; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; border-bottom: 1px solid var(--cw-border); }
body.adm-page table.dataTable tbody td { font-size: 13px; color: var(--cw-text-primary); border-bottom: 1px solid var(--cw-border-soft); }
body.adm-page .dataTables_wrapper { font-size: 13px; color: var(--cw-text-secondary); }
body.adm-page .dataTables_wrapper .dataTables_length,
body.adm-page .dataTables_wrapper .dataTables_filter { margin: 4px 0 12px; }
body.adm-page .dataTables_wrapper .dataTables_length label,
body.adm-page .dataTables_wrapper .dataTables_filter label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cw-text-secondary); }
body.adm-page .dataTables_filter input,
body.adm-page .dataTables_length select { width: auto; min-height: 36px; margin: 0; border-radius: 8px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--cw-text-primary); padding: 6px 10px; font-size: 13px; }
body.adm-page .dataTables_filter input { width: 220px; max-width: 100%; }
body.adm-page .dt-buttons { display: inline-flex; gap: 6px; flex-wrap: wrap; margin: 4px 12px 12px 0; }
body.adm-page .dt-button { margin: 0 !important; background: var(--cw-surface) !important; color: var(--cw-text-secondary) !important; border: 1px solid var(--cw-border) !important; border-radius: 8px !important; font-size: 12.5px !important; }
body.adm-page .dt-button:hover { background: var(--cw-surface-soft) !important; color: var(--cw-text-primary) !important; }
body.adm-page .dataTables_paginate .paginate_button { border-radius: 8px; color: var(--cw-text-secondary) !important; }
body.adm-page .dataTables_paginate .paginate_button.current { background: var(--cw-primary-soft) !important; color: var(--cw-primary-dark) !important; border-color: var(--cw-primary-soft) !important; }
body.adm-page .dataTables_paginate .paginate_button:hover { background: var(--cw-surface-soft) !important; color: var(--cw-text-primary) !important; border-color: var(--cw-border) !important; }
body.adm-page .dataTables_info { font-size: 12.5px; color: var(--cw-text-secondary); }

/* the base part forces 16px on every field (stops iOS zoom). Desktop has no zoom, so the
   shell uses the 14px control scale there; phones keep 16px. */
@media (min-width: 1000px) {
    body.adm-page .adm-main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) { font-size: 14px !important; }
}

/* ---- Laptop -------------------------------------------------------------- */
@media (min-width: 1000px) and (max-width: 1279px) {
    body.adm-page .adm-frame { grid-template-columns: 208px minmax(0, 1fr); }
    body.adm-page .adm-main { padding: 22px 22px 28px; }
}

/* ---- Phones & tablets ---------------------------------------------------- */
@media (max-width: 999px) {
    body.adm-page .adm-frame { display: block; min-height: 0; border-radius: 16px; }
    body.adm-page .adm-nav { display: none; }
    body.adm-page .adm-main { padding: 0 16px 20px; }

    body.adm-page .adm-picker {
        display: block;
        position: sticky; top: 0; z-index: 20;
        margin: 0 -16px 16px; /* full-bleed across the frame */
        background: var(--cw-surface);
        border-bottom: 1px solid var(--cw-border-soft);
        border-radius: 16px 16px 0 0;
    }
    body.adm-page .adm-picker-summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "kicker hint" "current hint";
        align-items: center;
        column-gap: 12px;
        min-height: 58px;
        padding: 10px 16px;
        cursor: pointer;
        list-style: none;
    }
    body.adm-page .adm-picker-summary::-webkit-details-marker { display: none; }
    body.adm-page .adm-picker-kicker { grid-area: kicker; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cw-text-secondary); }
    body.adm-page .adm-picker-current { grid-area: current; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 600; color: var(--cw-text-primary); }
    body.adm-page .adm-picker-current i { color: var(--cw-primary); font-size: 15px; width: 18px; text-align: center; }
    body.adm-page .adm-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body.adm-page .adm-picker-hint {
        grid-area: hint;
        display: inline-flex; align-items: center; gap: 6px;
        min-height: 36px; padding: 0 12px;
        border-radius: 9999px; border: 1px solid var(--cw-border);
        font-size: 13px; font-weight: 600; color: var(--cw-text-secondary);
    }
    body.adm-page .adm-picker-hint i { font-size: 11px; transition: transform .18s ease; }
    body.adm-page .adm-picker[open] .adm-picker-hint i { transform: rotate(180deg); }
    body.adm-page .adm-picker-nav { padding: 4px 12px 14px; max-height: calc(100vh - 260px); max-height: calc(100dvh - 180px - 65px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--cw-border-soft); }
    body.adm-page .adm-picker-nav .adm-nav-group { margin-top: 14px; }
    body.adm-page .adm-picker-nav .adm-nav-title { margin-left: 4px; font-size: 11px; }
    body.adm-page .adm-picker-nav .adm-nav-link { min-height: 44px; font-size: 15px; padding: 10px 12px; }
    body.adm-page .adm-picker-nav .adm-nav-link i { font-size: 15px; width: 20px; }

    body.adm-page .adm-panel-head { padding-bottom: 14px; }
    body.adm-page .adm-panel-title { font-size: 18px; }
    body.adm-page .adm-fields { grid-template-columns: minmax(0, 1fr); }
    /* 16px stops iOS zooming into a focused field. */
    body.adm-page .adm-panel :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea) { font-size: 16px; min-height: 44px; }
    body.adm-page .adm-main .btn { min-height: 44px; }
    body.adm-page .adm-row-icon { width: 36px; height: 36px; font-size: 15px; }
    body.adm-page .adm-switch { width: 46px; height: 26px; }
    body.adm-page .adm-switch-track::after { width: 20px; height: 20px; }
    body.adm-page .adm-switch input:checked + .adm-switch-track::after { transform: translateX(20px); }
    body.adm-page .adm-main > .data-section > .section-header h2 { font-size: 18px; }
    body.adm-page .adm-avatar { width: 72px; height: 72px; font-size: 28px; }
    body.adm-page .adm-preset { width: 44px; height: 44px; }
    body.adm-page .adm-color input[type="color"] { width: 44px; height: 44px; }
}

@media (max-width: 600px) {
    /* Rows whose control is a field stack the field under the label. */
    body.adm-page .adm-row.field { grid-template-columns: minmax(0, 1fr); }
    body.adm-page .adm-row.field .adm-row-control { justify-self: stretch; }
    body.adm-page .adm-row.field .adm-row-control :is(input, select) { width: 100%; }
    body.adm-page .adm-actions { justify-content: stretch; }
    body.adm-page .adm-actions .btn { flex: 1 1 100%; justify-content: center; }
    body.adm-page .adm-tiles { grid-template-columns: minmax(0, 1fr); }
    /* The switch already shows the state; the text label would squeeze the row. */
    body.adm-page .adm-row-control .toggle-status { display: none; }
    body.adm-page .adm-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.adm-page .adm-profile-head { align-items: flex-start; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    body.adm-page .adm-nav-link, body.adm-page .adm-switch-track, body.adm-page .adm-switch-track::after, body.adm-page .adm-tile { transition: none; }
}

/* Controls in a setting row share one width (declared last so it beats the panel-wide 100%). */
body.adm-page .adm-panel .adm-row-control > :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select) { width: 260px; }
body.adm-page .adm-panel .adm-row-control.adm-color > input[type="text"] { width: 110px !important; } /* :is() above outranks a plain attribute selector */
@media (max-width: 600px) {
    body.adm-page .adm-panel .adm-row.field .adm-row-control > :is(input, select) { width: 100%; flex: 1; }
}
/* Dark mode: the pastel primary keeps its tint; its label uses the brighter accent for contrast. */
body.dark-mode.adm-page .adm-main .btn-primary { color: var(--cw-primary); }
/* DataTables' sorted-column shading reads as a stray grey stripe on the white frame. */
body.adm-page table.dataTable.display tbody tr > .sorting_1,
body.adm-page table.dataTable.order-column tbody tr > .sorting_1 { background-color: transparent !important; box-shadow: none !important; }
body.adm-page table.dataTable tbody tr:hover > td { background-color: var(--table-hover) !important; }

/* ---- Contrast and override fixes (review) -------------------------------- */
/* Pill text uses primary text on the tint (green on green-soft was 2.5:1); the icon keeps the hue. */
body.adm-page .adm-pill { color: var(--cw-text-primary); }
body.adm-page .adm-pill i { color: var(--cw-green); }
body.dark-mode.adm-page .dataTables_paginate .paginate_button.current { color: var(--cw-text-primary) !important; }
body.dark-mode.adm-page .adm-main .btn-primary { color: var(--cw-text-primary); }
/* Dark: the off track must still separate from the white knob and the surface. */
body.dark-mode.adm-page .adm-switch-track { background: var(--cw-text-muted); }
/* the base part sizes presets and theme cards with !important; the shell's own sizes must win. */
body.adm-page .adm-preset.preset-btn { width: 36px !important; height: 36px !important; }
@media (max-width: 999px) { body.adm-page .adm-preset.preset-btn { width: 44px !important; height: 44px !important; } }
body.adm-page .adm-choice.theme-mode-option { border-width: 1px !important; border-color: var(--cw-border) !important; }
body.adm-page .adm-choice.theme-mode-option:has(input:checked) { border-color: var(--cw-primary) !important; }
/* Uploads turned off by an Admin: the button reads as disabled, not as a dead control. */
body.adm-page #profileImageInput:disabled + .adm-upload-btn { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Phosphor line icons (DESIGN.md §6.19): the glyphs sit lighter than Font Awesome's solid set, so they get
   their own optical sizes. Tiles and row icons grow to a 36px soft square so the line icon has air. */
body.adm-page .adm-nav-link i.ph { font-size: 18px; width: 18px; }
body.adm-page .adm-picker-current i.ph { font-size: 19px; width: 20px; }
body.adm-page .adm-row-icon { width: 36px; height: 36px; border-radius: 10px; }
body.adm-page .adm-row-icon i.ph { font-size: 19px; }
body.adm-page .adm-tile { padding: 16px; border-radius: 14px; }
body.adm-page .adm-tile:hover { border-color: var(--cw-contour); background: var(--cw-surface-soft); }
body.adm-page .adm-tile:hover .adm-row-icon { transform: none; }
@media (max-width: 999px) {
    body.adm-page .adm-picker-nav .adm-nav-link i.ph { font-size: 20px; width: 22px; }
    body.adm-page .adm-row-icon { width: 40px; height: 40px; }
    body.adm-page .adm-row-icon i.ph { font-size: 21px; }
}

/* Reference data actions and badges: token tints instead of the old inline saturated colours. */
body.adm-page .action-icon.toggle-icon.is-on { color: var(--cw-green); }
body.adm-page .action-icon.toggle-icon.is-off { color: var(--cw-text-muted); }
body.adm-page .action-icon.tone-purple { color: var(--cw-purple); }
body.adm-page .action-icon.tone-orange { color: var(--cw-orange); }
body.adm-page .action-icon:disabled { opacity: .55; cursor: not-allowed; }
body.adm-page .adm-code {
    padding: 2px 6px; border-radius: 6px;
    background: var(--cw-surface-soft); border: 1px solid var(--cw-border-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600;
    color: var(--cw-text-primary);
}
body.adm-page table.adm-cards .cell-actions { white-space: nowrap; }
body.adm-page table.adm-cards .status-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* Phones: each row of a .adm-cards table (reference data, users) is a card (DESIGN.md §6.20). Reference + status on top, the name large,
   extra fields as label/value lines, then every action in one row of 40px buttons — nothing hidden behind a
   collapse toggle, nothing stacked into a 300px-tall row. Responsive collapse is off below 1000px. */
@media (max-width: 999px) {
    body.page-settings-data .table-scroll-hint,
    body.page-users .table-scroll-hint { display: none; }
    body.adm-page .dataTables_filter label { display: flex; width: 100%; }
    body.adm-page .dataTables_filter input { flex: 1; width: auto; min-width: 0; }
    body.adm-page table.adm-cards,
    body.adm-page table.adm-cards tbody { display: block; width: 100% !important; min-width: 0 !important; border: 0; }
    body.adm-page table.adm-cards thead { display: none; }
    body.adm-page table.adm-cards tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 4px 12px;
        margin: 0 0 10px;
        padding: 12px 14px;
        border: 1px solid var(--cw-border);
        border-radius: 14px;
        background: var(--cw-surface) !important;
    }
    body.adm-page table.adm-cards tbody tr:hover > td { background: transparent !important; }
    body.adm-page table.adm-cards tbody td {
        display: block;
        padding: 0 !important; /* the shared mobile DataTables block pads cells with !important */
        border: 0;
        background: transparent !important;
        box-shadow: none !important;
        min-width: 0;
        text-align: left;
    }
    body.adm-page table.adm-cards td.cell-id { grid-column: 1; grid-row: 1; font-size: 12px; color: var(--cw-text-muted); font-variant-numeric: tabular-nums; }
    body.adm-page table.adm-cards td.cell-id::before { content: "#"; }
    body.adm-page table.adm-cards td.cell-status { grid-column: 2; grid-row: 1; justify-self: end; }
    body.adm-page table.adm-cards tbody tr:not(:has(td.cell-id)) td.cell-name { grid-column: 1; grid-row: 1; }
    body.adm-page table.adm-cards td.cell-name { grid-column: 1 / -1; font-size: 15px; font-weight: 600; color: var(--cw-text-primary); overflow-wrap: anywhere; }
    body.adm-page table.adm-cards td.cell-meta {
        grid-column: 1 / -1;
        display: flex; justify-content: space-between; gap: 12px;
        font-size: 13px; color: var(--cw-text-primary);
        text-align: right; overflow-wrap: anywhere;
    }
    body.adm-page table.adm-cards td.cell-meta::before { content: attr(data-label); flex-shrink: 0; text-align: left; color: var(--cw-text-secondary); font-size: 12px; }
    body.adm-page table.adm-cards td.cell-actions {
        grid-column: 1 / -1;
        display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
        margin-top: 8px; padding-top: 10px !important;
        border-top: 1px solid var(--cw-border-soft);
    }
    body.adm-page table.adm-cards td.cell-actions:empty { display: none; }
    /* a detail with no value (e.g. no phone) is left out rather than shown as a bare label */
    body.adm-page table.adm-cards td.cell-meta:empty,
    body.adm-page table.adm-cards td.cell-meta:has(> span:only-child:empty) { display: none; }
    body.adm-page table.adm-cards td.cell-actions .action-icon { width: 40px; height: 40px; min-width: 40px; margin: 0; font-size: 15px; }
    body.adm-page table.adm-cards td.dataTables_empty { grid-column: 1 / -1; text-align: center; }
    /* Types with no extra fields (locations, contract/bag types…): actions sit beside the name. */
    body.adm-page table.adm-cards tbody tr:not(:has(td.cell-meta)) td.cell-name { grid-column: 1; grid-row: 2; }
    body.adm-page table.adm-cards tbody tr:not(:has(td.cell-meta)) td.cell-actions {
        grid-column: 2; grid-row: 2; align-self: center;
        flex-wrap: nowrap; margin: 0; padding-top: 0 !important; border-top: 0;
    }
}

/* Commodity catalog (settings-data.php?type=commodities, DESIGN.md §6.20): three header actions wrap instead of
   overflowing and stack full-width on phones; the note sits under the header; the code field reads in capitals. */
body.adm-page .commodity-catalog > .section-header { flex-wrap: wrap; gap: 10px; }
body.adm-page .commodity-catalog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
body.adm-page .commodity-catalog > .adm-note { margin: 0 0 16px; }
body.adm-page .commodity-quality.is-empty { color: var(--cw-text-secondary); }
/* "Not open to transactions yet" is a muted pill: its icon must not carry the green of an open commodity. */
body.adm-page .adm-pill.muted i { color: var(--cw-text-secondary); }
.commodity-form { text-align: left; }
.commodity-form label { display: block; margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.commodity-form .swal2-input { width: 100%; margin: 6px 0 0; box-sizing: border-box; }
.commodity-form .commodity-code-input { text-transform: uppercase; }
.commodity-form .commodity-form-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--cw-text-secondary); }
@media (max-width: 600px) {
    body.adm-page .commodity-catalog-actions { width: 100%; }
    body.adm-page .commodity-catalog-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ===================== SEND US YOUR RECORDS (data-send.php, dashboard card) =====================
   The company sends its past records for NegoceFlow to bring in. Square, flat, big targets (DESIGN.md §13, §19). */
.ds-card {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin: 0 0 20px; padding: 16px 20px; border-radius: 0; box-shadow: none;
    background: var(--surface, var(--bg-card)); color: var(--ink, var(--text-primary));
    border: 1px solid var(--line, var(--border-color)); border-left: 4px solid var(--accent, #2F5D8C);
}
.ds-card-icon {
    flex: 0 0 48px; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-tint, #E4ECF4); color: var(--accent, #2F5D8C); font-size: 22px;
}
.ds-card-text { flex: 1 1 260px; min-width: 0; }
.ds-card-text h2 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 600; color: var(--ink, var(--text-primary)); }
.ds-card-text p { margin: 0; color: var(--ink-2, var(--text-secondary)); line-height: 1.45; }
.ds-card-go, .ds .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 0; }

.ds { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.ds-panel {
    padding: 20px; border-radius: 0; box-shadow: none;
    background: var(--surface, var(--bg-card)); color: var(--ink, var(--text-primary));
    border: 1px solid var(--line, var(--border-color));
}
.ds-panel h2 { margin: 0 0 12px; font-size: 1.1rem; font-weight: 600; }
.ds-panel > p { margin: 0 0 14px; line-height: 1.5; }
.ds-msg { margin: 0; padding: 12px 16px; border-radius: 0; display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.ds-msg-ok { background: var(--positive-tint, #E3EFE6); color: var(--positive, #2E6A43); border: 1px solid currentColor; }
.ds-msg-error { background: var(--negative-tint, #F7E2DD); color: var(--negative, #A3392A); border: 1px solid currentColor; }
.ds-how { margin: 0 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.ds-upload { display: flex; flex-direction: column; gap: 12px; }
.ds-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 140px; padding: 20px; text-align: center; cursor: pointer; border-radius: 0;
    border: 2px dashed var(--line-strong, var(--border-color)); background: var(--surface-sunken, var(--bg-primary));
    color: var(--ink, var(--text-primary));
}
.ds-drop i { font-size: 30px; color: var(--accent, #2F5D8C); }
.ds-drop strong { font-size: 1.05rem; }
.ds-drop span { color: var(--ink-2, var(--text-secondary)); font-size: 0.95rem; }
.ds-drop:hover, .ds-drop:focus-within { border-color: var(--accent, #2F5D8C); }
.ds-drop input[type="file"] { max-width: 100%; min-height: 44px; margin-top: 6px; font: inherit; color: var(--ink-2, var(--text-secondary)); }
.ds-send { width: 100%; font-size: 1.05rem; }
.ds-tip { margin: 12px 0 0; display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2, var(--text-secondary)); line-height: 1.45; }
.ds-tip i { margin-top: 3px; color: var(--ink-3, var(--text-muted)); }
.ds-empty { margin: 0; color: var(--ink-2, var(--text-secondary)); }
.ds-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ds-file {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0;
    border-top: 1px solid var(--line, var(--border-light));
}
.ds-file:first-child { border-top: 0; }
.ds-file > i { font-size: 22px; color: var(--ink-3, var(--text-muted)); width: 24px; text-align: center; }
.ds-file-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.ds-file-main > span { color: var(--ink-2, var(--text-secondary)); }
.ds-file form { margin: 0; }
.ds-remove { min-height: 44px; }
.ds-received { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--positive, #2E6A43); font-weight: 500; }
@media (max-width: 600px) {
    .ds-card { padding: 14px 16px; }
    .ds-card-go { width: 100%; }
    .ds-panel { padding: 16px; }
}
.ds-card-go, .ds-card-go:hover { text-decoration: none; }
.ds-upload + .ds-tip { margin-top: 18px; }

/* ================================================================================================
   PART: THE DESIGN (was ui-new.css)
   ================================================================================================ */

/* The new NegoceFlow design (DESIGN.md, section 19 wins where it differs).
   Every rule here is scoped to <html data-look>, which ui-design.php sets on staff pages only, so sign-in and onboarding
   keep the parts above. The look is per device (sidebar.php, nfLook):
     data-look="light"  light page, light sidebar (default)
     data-look="cocoa"  light page, cocoa sidebar
     data-look="dark"   dark page and sidebar (body.dark-mode is set too, for the dark rules of the parts above)
   It gives every page the colours, type and square corners; the dashboard also gets proposal B's cards. */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

/* ===================== TOKENS (DESIGN.md §16) ===================== */
html[data-look] {
    --ground: #F4EDE0; --surface: #FFFFFF; --surface-sunken: #FAF6EE;
    --ink: #4A2E1F; --ink-2: #6E584A; --ink-3: #7F6A5B;
    --line: #E2D6C2; --line-strong: #B9A68C;
    --accent: #2F5D8C; --accent-hover: #244A70; --accent-tint: #E4ECF4; --accent-ink: #FFFFFF;
    --positive: #2E6A43; --positive-tint: #E3EFE6;
    --negative: #A3392A; --negative-tint: #F7E2DD;
    --warn: #8A5A0F; --warn-tint: #F8ECD6;
    --field: #C8A97E;
    --font: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
    --font-title: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
    --shadow-float: 0 8px 24px rgba(74, 46, 31, 0.16);
    /* KPI group colours (§19): edge / icon colour, and its pale tint */
    --g-blue: #2F5D8C; --g-blue-t: #EEF3F8;
    --g-tan: #A57E46; --g-tan-t: #F7F0E4;
    --g-clay: #A0613A; --g-clay-t: #F6EAE2;
    --g-sage: #557552; --g-sage-t: #ECF2EB;
    /* sidebar: light by default (§19) */
    --sb-bg: #FFFFFF; --sb-line: #E2D6C2; --sb-ink: #4A2E1F; --sb-ink-2: #6E584A; --sb-ink-3: #7F6A5B;
    --sb-hover: #FAF6EE; --sb-active: #F4EDE0; --sb-marker: #C8A97E; --sb-route: #4A2E1F; --sb-cap: #2F5D8C;
    color-scheme: light;
}
html[data-look="cocoa"] {
    --sb-bg: #4A2E1F; --sb-line: rgba(244, 237, 224, 0.12); --sb-ink: #F4EDE0; --sb-ink-2: #D8C7B4; --sb-ink-3: #BFA994;
    --sb-hover: rgba(244, 237, 224, 0.07); --sb-active: #64432F; --sb-marker: #C8A97E; --sb-route: #F4EDE0; --sb-cap: #C8A97E;
}
html[data-look="dark"] {
    --ground: #1E140E; --surface: #2A1D14; --surface-sunken: #241910;
    --ink: #F4EDE0; --ink-2: #C9B8A6; --ink-3: #A8937F;
    --line: #3E2E22; --line-strong: #5A4433;
    --accent: #9DBEE2; --accent-hover: #BCD3EC; --accent-tint: #2C3B4D;
    --positive: #86C59D; --positive-tint: #22362A;
    --negative: #F0998A; --negative-tint: #3F231D;
    --warn: #E6BC6E; --warn-tint: #3B2D14;
    --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.4);
    --g-blue: #9DBEE2; --g-blue-t: #26303B;
    --g-tan: #D9BC8E; --g-tan-t: #33281C;
    --g-clay: #E0A07A; --g-clay-t: #362219;
    --g-sage: #A6C3A1; --g-sage-t: #232D22;
    --sb-bg: #170F0A; --sb-line: #3E2E22; --sb-ink: #F4EDE0; --sb-ink-2: #C9B8A6; --sb-ink-3: #A8937F;
    --sb-hover: rgba(244, 237, 224, 0.06); --sb-active: #3A281C; --sb-marker: #C8A97E; --sb-route: #F4EDE0; --sb-cap: #C8A97E;
    color-scheme: dark;
}

/* The classic tokens, pointed at the new palette: every page that uses them takes the new colours. Set on body so they
   win over body.dark-mode's own values. */
html[data-look] body {
    --cw-bg: var(--ground);
    --cw-surface: var(--surface);
    --cw-surface-soft: var(--surface-sunken);
    --cw-tint-blue: var(--accent-tint);
    --cw-tint-orange: var(--g-tan-t);
    --cw-border: var(--line);
    --cw-border-soft: var(--line);
    --cw-text-primary: var(--ink);
    --cw-text-secondary: var(--ink-2);
    --cw-text-muted: var(--ink-3);
    --cw-primary: var(--accent);
    --cw-primary-soft: var(--accent-tint);
    --cw-primary-dark: var(--accent-hover);
    --cw-orange: var(--g-tan);
    --cw-orange-soft: var(--g-tan-t);
    --cw-green: var(--positive);
    --cw-green-soft: var(--positive-tint);
    --cw-purple: var(--g-clay);
    --cw-purple-soft: var(--g-clay-t);
    --cw-red: var(--negative);
    --cw-red-soft: var(--negative-tint);
    --cw-ink-navy: var(--ink);
    --cw-sidebar-active-bg: var(--sb-active);
    --cw-contour: var(--field);
    --cw-nav-bg: var(--sb-bg);
    --cw-nav-bg-soft: var(--sb-hover);
    --cw-nav-border: var(--sb-line);
    --cw-nav-text: var(--sb-ink-2);
    --cw-nav-text-strong: var(--sb-ink);
    --cw-nav-muted: var(--sb-ink-3);
    --cw-nav-active-bg: var(--sb-active);
    --cw-nav-accent: var(--sb-marker);

    --navy-primary: var(--ink);
    --navy-dark: var(--ink);
    --navy-light: var(--ink-2);
    --navy-accent: var(--accent);
    --navy-hover: var(--accent-hover);
    --success: var(--positive);
    --warning: var(--warn);
    --danger: var(--negative);
    --bg-primary: var(--ground);
    --bg-secondary: var(--surface-sunken);
    --bg-card: var(--surface);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);
    --border-color: var(--line);
    --border-light: var(--line);
    --shadow-color: rgba(74, 46, 31, 0.04);
    --shadow-hover: rgba(74, 46, 31, 0.08);
    --input-bg: var(--surface);
    --input-border: var(--line-strong);
    --table-hover: var(--surface-sunken);
    --skeleton-base: var(--surface-sunken);
    --skeleton-shine: var(--line);

    background: var(--ground);
    color: var(--ink);
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
}

/* ===================== BASE ===================== */
/* Square corners everywhere (§5). Round things that mean "a dot" keep their shape. */
html[data-look] *,
html[data-look] *::before,
html[data-look] *::after { border-radius: 0 !important; }
html[data-look] .dash-season-dot,
html[data-look] .status-dot,
html[data-look] .notif-dot { border-radius: 50% !important; }

html[data-look] body,
html[data-look] button,
html[data-look] input,
html[data-look] select,
html[data-look] textarea { font-family: var(--font); }
html[data-look] .main-content { background: var(--ground); }
html[data-look] :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-look] ::selection { background: var(--accent); color: var(--accent-ink); }

/* Page titles in Barlow Condensed (§4) */
html[data-look] .main-content h1,
html[data-look] .header h1,
html[data-look] .dash-hero-greeting {
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 0;
    color: var(--ink);
}

/* Buttons: blue only for actions (§3) */
html[data-look] .btn-primary,
html[data-look] button.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    box-shadow: none;
}
html[data-look] .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
html[data-look="dark"] .btn-primary,
html[data-look="dark"] button.btn-primary { background: #2F5D8C; border-color: #2F5D8C; color: #FFFFFF; }

/* Fields */
html[data-look] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-look] select,
html[data-look] textarea {
    border-color: var(--line-strong);
}

/* Tables: quiet header on the sunken surface, 1px lines */
html[data-look] table.dataTable thead th,
html[data-look] .main-content table thead th {
    background: var(--surface-sunken);
    color: var(--ink-2);
    border-bottom: 1px solid var(--line);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

/* ===================== SIDEBAR (§6, light by default) ===================== */
html[data-look] .sidebar,
html[data-look] .sidebar.sidebar-light {
    background: var(--sb-bg);
    color: var(--sb-ink-2);
    border-right: 1px solid var(--sb-line);
    box-shadow: none;
}
html[data-look] .sidebar .sidebar-header,
html[data-look] .sidebar .sidebar-logo-section { border-bottom: 1px solid var(--sb-line); background: transparent; }
html[data-look] .sidebar .sidebar-title {
    color: var(--sb-ink);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0;
}
html[data-look] .sidebar .sidebar-mark .nf-route { fill: var(--sb-route) !important; }
html[data-look] .sidebar .sidebar-mark .nf-cap { fill: var(--sb-cap) !important; }
html[data-look] .sidebar .sidebar-toggle-btn { background: transparent; color: var(--sb-ink-2); }
html[data-look] .sidebar .sidebar-toggle-btn:hover { background: var(--sb-hover); color: var(--sb-ink); }

/* Section names: sentence case in the body font, not small monospace capitals (§11) */
html[data-look] .sidebar .sidebar-menu-title {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--sb-ink-3);
}
html[data-look] .sidebar .sidebar-menu-title:hover { background: var(--sb-hover); color: var(--sb-ink); }
html[data-look] .sidebar .sidebar-menu a,
html[data-look] .sidebar .sidebar-menu button {
    color: var(--sb-ink-2);
    font-size: 14px;
    font-weight: 400;
    min-height: 36px;
}
html[data-look] .sidebar .sidebar-menu a:hover,
html[data-look] .sidebar .sidebar-menu button:hover { background: var(--sb-hover); color: var(--sb-ink); }
html[data-look] .sidebar .sidebar-menu a.active,
html[data-look] .sidebar .sidebar-menu button.active,
html[data-look] .sidebar .submenu-toggle.active {
    background: var(--sb-active);
    color: var(--sb-ink);
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--sb-marker);
}
html[data-look] .sidebar .sidebar-menu i { font-size: 14px; width: 18px; }
html[data-look] .sidebar .submenu-arrow { color: var(--sb-ink-3); }
html[data-look] .sidebar .sidebar-submenu { background: transparent; }
html[data-look] .sidebar .sidebar-submenu a { color: var(--sb-ink-2); }

/* Campaign selector in the sidebar */
html[data-look] .sidebar .campaign-context {
    background: var(--sb-hover);
    border: 1px solid var(--sb-line);
}
html[data-look] .sidebar .campaign-context-single { color: var(--sb-ink); }
html[data-look] .sidebar .campaign-context-label,
html[data-look] .sidebar .campaign-context label { color: var(--sb-ink-3); text-transform: none; letter-spacing: 0; font-family: var(--font); }
html[data-look] .sidebar .campaign-context select,
html[data-look] .sidebar .campaign-context select option {
    background: var(--sb-bg);
    color: var(--sb-ink);
    border: 1px solid var(--sb-line);
}
html[data-look] .sidebar .campaign-context-icon {
    background: var(--sb-bg);
    color: var(--sb-ink);
    border: 1px solid var(--sb-line);
}

/* Settings sits alone at the bottom of the sidebar, apart from the pages (mockup); signing out is in the account menu at
   the top right, so the sidebar has no sign-out button (Thino, 2026-11-04). */
html[data-look] .sidebar .sidebar-menu-section { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
html[data-look] .sidebar .sidebar-menu--settings { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--sb-line); }
html[data-look] .sidebar .sidebar-logout { display: none; }

/* Bottom of the sidebar: language (phones), look */
html[data-look] .sidebar .sidebar-lang,
html[data-look] .sidebar .sidebar-theme,
html[data-look] .sidebar .sidebar-logout { border-color: var(--sb-line); }
html[data-look] .sidebar .sidebar-theme,
html[data-look] .sidebar .sidebar-logout { background: transparent; border-top: 1px solid var(--sb-line); }
html[data-look] .sidebar .sidebar-theme button,
html[data-look] .sidebar.sidebar-light .sidebar-theme button {
    width: 100% !important;
    background: transparent !important;
    border: 1px solid var(--sb-line) !important;
    color: var(--sb-ink-2) !important;
    box-shadow: none !important;
    font-family: var(--font) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    justify-content: center !important;
}
html[data-look] .sidebar .sidebar-theme button:hover { background: var(--sb-hover) !important; color: var(--sb-ink) !important; transform: none !important; }
html[data-look] .sidebar .sidebar-theme button i,
html[data-look] .sidebar .sidebar-theme button span { color: inherit !important; font-size: 13px !important; }
/* Phones: the menu's foot stays slim (Thino 2026-11-17), language and look on two short rows. */
@media (max-width: 768px) {
    html[data-look] .sidebar .sidebar-theme { padding: 4px 8px; }
    html[data-look] .sidebar .sidebar-theme button { min-height: 44px; padding: 0 12px !important; }
}
html[data-look] .sidebar .sidebar-logout button,
html[data-look] .sidebar.sidebar-light .sidebar-logout button {
    background: transparent !important;
    border: 1px solid var(--sb-line) !important;
    color: var(--sb-ink-2) !important;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
}
html[data-look] .sidebar .sidebar-logout button:hover { background: var(--sb-hover) !important; color: var(--sb-ink) !important; transform: none; }
html[data-look] .sidebar .sidebar-logout button i,
html[data-look] .sidebar .sidebar-logout button span { font-size: 13px; color: inherit; }
html[data-look] .sidebar .sidebar-lang a,
html[data-look] .sidebar .sidebar-lang button { color: var(--sb-ink-2); }

/* ===================== PHONE BOTTOM BAR ===================== */
html[data-look] .mobile-bottom-nav {
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: none;
}
html[data-look] .mobile-nav-item { color: var(--ink-2); font-family: var(--font); font-size: 11px; }
html[data-look] .mobile-nav-item:hover,
html[data-look] .mobile-nav-item:focus { color: var(--ink); background: var(--surface-sunken); }
html[data-look] .mobile-nav-item.active {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 3px 0 var(--accent);
}
html[data-look] .mobile-nav-item.active i { transform: none; color: var(--accent); }
html[data-look] .mobile-nav-more { color: var(--ink-2); }
html[data-look] .mobile-nav-fab i,
html[data-look] .mobile-nav-fab .fa-plus { color: var(--accent-ink); }

/* ===================== TOP BAR AND GREETING (dashboard) ===================== */
html[data-look] body.page-dashboard .dash-topbar { background: transparent; border-bottom: 1px solid var(--line); }
html[data-look] .time-filter-tabs { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
html[data-look] .time-filter-tabs button { color: var(--ink-2); font-family: var(--font); font-weight: 500; }
html[data-look] .time-filter-tabs button.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
html[data-look="dark"] .time-filter-tabs button.active { background: #2F5D8C; color: #FFFFFF; }

html[data-look] body.page-dashboard .dash-hero {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}
html[data-look] body.page-dashboard .dash-hero-art { display: none; }
html[data-look] body.page-dashboard .dash-hero-overline { color: var(--ink-3); letter-spacing: 0; text-transform: none; font-family: var(--font); }
html[data-look] body.page-dashboard .dash-hero-greeting { font-size: 30px; }
html[data-look] body.page-dashboard .dash-hero-name { color: var(--ink); }
html[data-look] body.page-dashboard .dash-hero-sub { color: var(--ink-2); }
html[data-look] body.page-dashboard .dash-season-pill { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
html[data-look] body.page-dashboard .dash-season-dot { background: var(--positive); }

/* ===================== DASHBOARD KPI CARDS (proposal B, §19) ===================== */
html[data-look] [data-kpi-group="headline"]  { --g: var(--g-blue); --gt: var(--g-blue-t); }
html[data-look] [data-kpi-group="financing"] { --g: var(--g-tan);  --gt: var(--g-tan-t); }
html[data-look] [data-kpi-group="owed"]      { --g: var(--g-clay); --gt: var(--g-clay-t); }
html[data-look] [data-kpi-group="season"]    { --g: var(--g-sage); --gt: var(--g-sage-t); }

/* Group headings: a square of the group colour, the name, and what the figures cover */
html[data-look] .kpi-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    grid-column: 1 / -1;
    margin: 6px 0 -2px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
}
html[data-look] .kpi-group-head .kpi-group-name::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    background: var(--g);
}
html[data-look] .kpi-group-head .kpi-group-scope { font-size: 12px; font-weight: 400; color: var(--ink-3); text-align: right; }
html[data-look] .dashboard-primary-kpi + .kpi-group-head,
html[data-look] .kpi-group-head[data-kpi-group="headline"] { margin-bottom: 10px; }

html[data-look] body.page-dashboard .dashboard-primary-kpi {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 16px;
    margin-bottom: 20px;
}
html[data-look] body.page-dashboard .dashboard-primary-kpi:has(> .kpi-card:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
html[data-look] body.page-dashboard .dashboard-primary-kpi:has(> .kpi-card:only-child) { grid-template-columns: 1fr; }
html[data-look] body.page-dashboard .dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    row-gap: 12px;
}

/* Each figure is its own white card: 1px line, 3px top edge in the group colour */
html[data-look] body.page-dashboard .kpi-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--g, var(--line-strong));
    box-shadow: none;
    padding: 16px 18px 16px;
    transform: none;
}
html[data-look] body.page-dashboard .kpi-card:hover { box-shadow: none; transform: none; border-color: var(--line-strong); border-top-color: var(--g); }
html[data-look] body.page-dashboard .kpi-card::after,
html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card::after { display: none; }
html[data-look] body.page-dashboard .kpi-card-accent { display: none; }

/* Icons: thin outlines in the text colour, no tint and no colour (Thino, 2026-11-04). The inline colours are the classic
   design's. The group colour is only the card's top edge and the heading's square. */
html[data-look] body.page-dashboard .kpi-card-icon,
html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card-icon,
html[data-look] body.page-dashboard .dashboard-kpi-grid .kpi-card-icon {
    background: transparent !important;
    color: var(--ink-2) !important;
    width: auto;
    height: auto;
    font-size: 20px;
    justify-content: flex-start;
}

/* Figure, name, detail: big figure first, the name under it in sentence case (§7.4) */
html[data-look] body.page-dashboard .kpi-card-value {
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink) !important;
}
html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card-value { font-size: 28px; }
html[data-look] body.page-dashboard .dashboard-kpi-grid .kpi-card-value { font-size: 22px; }
html[data-look] body.page-dashboard .kpi-card-label,
html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card-label,
html[data-look] body.page-dashboard .dashboard-kpi-grid .kpi-card-label {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-2);
}
html[data-look] body.page-dashboard .kpi-card-sub { font-size: 12.5px; color: var(--ink-3); }
html[data-look] body.page-dashboard .kpi-scope { color: var(--ink-3); background: transparent; }

/* The profit card is the answer: on the group tint, a larger figure, green or red only by its sign */
html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card:has(#kpiProfit) { background: var(--gt); }
html[data-look] body.page-dashboard #kpiProfit { font-size: 34px; }
html[data-look] body.page-dashboard #kpiProfit.is-negative { color: var(--negative) !important; }
html[data-look] body.page-dashboard #kpiProfit.is-positive { color: var(--positive) !important; }

/* Changes up and down: green good, red bad, plain ink for stock, grey dash when nothing to compare */
html[data-look] body.page-dashboard .kpi-change[hidden],
html[data-look] body.page-dashboard .kpi-card-sub[hidden] { display: none; }
html[data-look] body.page-dashboard .kpi-change {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-2);
}
html[data-look] body.page-dashboard .kpi-change-mark { font-weight: 600; white-space: nowrap; }
html[data-look] body.page-dashboard .kpi-change-text { color: var(--ink-3); }
html[data-look] body.page-dashboard .kpi-change.is-good .kpi-change-mark { color: var(--positive); }
html[data-look] body.page-dashboard .kpi-change.is-bad .kpi-change-mark { color: var(--negative); }
html[data-look] body.page-dashboard .kpi-change.is-none .kpi-change-mark,
html[data-look] body.page-dashboard .kpi-change.is-flat .kpi-change-mark { color: var(--ink-3); font-weight: 500; }

/* Counts row, insights and charts: cards on the same terms */
html[data-look] body.page-dashboard .category-cards-wrapper,
html[data-look] body.page-dashboard .dash-ai-card,
html[data-look] body.page-dashboard .prices-chart-card,
html[data-look] body.page-dashboard .overview-chart-card,
html[data-look] body.page-dashboard .chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
}
html[data-look] body.page-dashboard .category-card { background: transparent; box-shadow: none; }
html[data-look] body.page-dashboard .category-card:hover { background: var(--surface-sunken); transform: none; }
html[data-look] body.page-dashboard .category-card-label { color: var(--ink-2); text-transform: none; letter-spacing: 0; font-family: var(--font); }
html[data-look] body.page-dashboard .category-card-count { color: var(--ink); font-weight: 500; }
html[data-look] body.page-dashboard .category-card-icon { background: transparent !important; color: var(--ink-2) !important; box-shadow: none; font-size: 20px; }
html[data-look] body.page-dashboard .category-card-icon i { color: inherit !important; }
html[data-look] body.page-dashboard .badge-count {
    background: var(--surface) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line-strong);
    box-shadow: none;
    font-weight: 500;
}
html[data-look] body.page-dashboard .category-cards-scope { background: transparent; }
html[data-look] body.page-dashboard h3 { font-family: var(--font); font-weight: 500; color: var(--ink); letter-spacing: 0; text-transform: none; }

@media (min-width: 1000px) and (max-width: 1279px) {
    html[data-look] body.page-dashboard .dashboard-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    html[data-look] body.page-dashboard .dashboard-kpi-grid .kpi-card-value { font-size: 20px; }
}
@media (max-width: 999px) {
    html[data-look] body.page-dashboard .dashboard-primary-kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
    html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card:has(#kpiProfit) { grid-column: 1 / -1; }
    html[data-look] body.page-dashboard .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    html[data-look] body.page-dashboard .kpi-card { padding: 12px 12px 14px; }
    html[data-look] body.page-dashboard .dashboard-primary-kpi .kpi-card-value { font-size: 22px; }
    html[data-look] body.page-dashboard #kpiProfit { font-size: 28px; }
    html[data-look] body.page-dashboard .dashboard-kpi-grid .kpi-card-value { font-size: 19px; }
    html[data-look] .kpi-group-head { flex-direction: column; gap: 2px; }
    html[data-look] .kpi-group-head .kpi-group-scope { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    html[data-look] *, html[data-look] *::before, html[data-look] *::after { animation: none !important; transition: none !important; }
}

/* Coverage keeps its meaning in colour as well as in its word: full green, partial amber, low red */
html[data-look] body.page-dashboard #kpiCoverage[data-level="full"] { color: var(--positive) !important; }
html[data-look] body.page-dashboard #kpiCoverage[data-level="partial"] { color: var(--warn) !important; }
html[data-look] body.page-dashboard #kpiCoverage[data-level="low"] { color: var(--negative) !important; }
html[data-look] .sidebar .campaign-context-status { color: var(--positive); }
html[data-look="cocoa"] .sidebar .campaign-context-status,
html[data-look="dark"] .sidebar .campaign-context-status { color: #9FD3AE; }
html[data-look="cocoa"] .sidebar .campaign-context-status i,
html[data-look="dark"] .sidebar .campaign-context-status i { color: inherit; }

/* ===================== TOP BAR, PERIOD, ADD (Thino, 2026-11-04) ===================== */
/* "Ajouter" is the one filled blue button of the top bar */
html[data-look] .desktop-quick-add-btn {
    background: var(--accent) !important;
    color: var(--accent-ink) !important;
    border: 1px solid var(--accent) !important;
    box-shadow: none !important;
    font-family: var(--font);
    font-weight: 500;
}
html[data-look] .desktop-quick-add-btn:hover { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }
html[data-look] .desktop-quick-add-btn i,
html[data-look] .desktop-quick-add-btn span { color: inherit !important; }
html[data-look="dark"] .desktop-quick-add-btn { background: #2F5D8C !important; border-color: #2F5D8C !important; color: #FFFFFF !important; }
/* Quick add menu: plain outline icons, no coloured squares */
html[data-look] .dqa-icon,
html[data-look] .quick-add-icon { background: transparent !important; color: var(--ink-2) !important; box-shadow: none !important; }

/* The period buttons sit on the greeting row (dashboard.php), as one segmented control */
html[data-look] body.page-dashboard .dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
html[data-look] body.page-dashboard .dash-hero-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 768px) {
    html[data-look] body.page-dashboard .dash-hero { flex-direction: column; align-items: stretch; padding: 8px 0 !important; }
    html[data-look] body.page-dashboard .dash-hero-left { margin: 0 !important; padding: 0 !important; }
    html[data-look] body.page-dashboard .dash-hero-right { margin-left: 0; }
    html[data-look] .time-filter-tabs { display: flex; width: 100%; }
    html[data-look] .time-filter-tabs button { flex: 1 1 auto; padding: 0 6px; }
}
html[data-look] .time-filter-tabs {
    display: inline-flex;
    gap: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
html[data-look] .time-filter-tabs button {
    height: 36px;
    padding: 0 12px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--ink-2);
    font: 500 13px var(--font);
    box-shadow: none;
}
html[data-look] .time-filter-tabs button:last-child { border-right: 0; }
html[data-look] .time-filter-tabs button:hover { background: var(--surface-sunken); color: var(--ink); }
html[data-look] .time-filter-tabs button.active,
html[data-look="dark"] .time-filter-tabs button.active { background: var(--accent-tint); color: var(--accent); box-shadow: none; }
html[data-look] .time-filter-tabs button.active { font-weight: 600; }
@media (max-width: 768px) {
    html[data-look] .time-filter-tabs button { min-height: 44px; font-size: 14px; }
}
/* The period buttons' status line (dashboard.php): "Updating the figures…", or the failure and its Try again button */
html[data-look] body.page-dashboard .dash-period-status { flex-basis: 100%; margin: 0; min-height: 0; color: var(--ink-3); font: 400 13px var(--font); }
html[data-look] body.page-dashboard .dash-period-status:empty { display: none; }
html[data-look] body.page-dashboard .dash-period-status.is-error { color: var(--negative); }
html[data-look] body.page-dashboard .dash-period-retry { min-height: 44px; padding: 0 14px; margin-left: 4px; background: transparent; border: 1px solid var(--accent); border-radius: 0; color: var(--accent); font: 600 14px var(--font); cursor: pointer; }
/* While a period loads, its figures dim so nobody reads the old ones as the new */
html[data-look] body.page-dashboard .main-content.is-period-loading :is(.kpi-card-value, .kpi-card-sub, .kpi-change, .category-card-count, .dc-plot, .dc-big, .dc-ring-box) { opacity: .45; }
@media (prefers-reduced-motion: no-preference) {
    html[data-look] body.page-dashboard :is(.kpi-card-value, .kpi-card-sub, .kpi-change, .category-card-count, .dc-plot, .dc-big, .dc-ring-box) { transition: opacity .15s ease-out; }
}
html[data-look] body.page-dashboard .category-cards-period { color: var(--ink-3); font: 400 12px var(--font); }

/* Total revenue: a plain card like the others, no tan gradient */
html[data-look] body.page-dashboard .revenue-highlight {
    background: var(--surface) !important;
    border: 1px solid var(--line);
    box-shadow: none;
    color: var(--ink);
}
html[data-look] body.page-dashboard .revenue-highlight::before,
html[data-look] body.page-dashboard .revenue-highlight::after { display: none; }
html[data-look] body.page-dashboard .revenue-highlight-label,
html[data-look] body.page-dashboard .revenue-highlight-sub { color: var(--ink-2) !important; text-transform: none; letter-spacing: 0; }
html[data-look] body.page-dashboard .revenue-highlight-value { color: var(--ink) !important; font-weight: 500; }
html[data-look] body.page-dashboard .revenue-highlight-sub i { color: var(--ink-3) !important; }

/* Chart headers: the icon in ink, like every other icon */
html[data-look] body.page-dashboard h3 i { color: var(--ink-2) !important; }
html[data-look] body.page-dashboard .dash-ai-card { border-left: 1px solid var(--line) !important; }
html[data-look] body.page-dashboard .dash-ai-card i { color: var(--ink-2); }

/* ===================== EVERY OTHER PAGE (tokens, type, cards, controls) =====================
   The shared pieces of the staff pages, restyled the same way as the dashboard: no shadows, 1px lines, sentence case,
   outline icons in ink, blue only for actions. Page by page layouts follow. */
/* Page head: the title on the page ground in Barlow Condensed, the top-bar controls beside it, no card */
html[data-look] .main-content > .header {
    background: transparent;
    box-shadow: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 0 14px;
}
html[data-look] .main-content > .header h1 {
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1.05;
}
html[data-look] .main-content > .header h1 i { display: none; }
html[data-look] .breadcrumb { color: var(--ink-3); font-size: 13px; }
html[data-look] .breadcrumb a { color: var(--ink-2); }
html[data-look] .breadcrumb i { color: var(--ink-3); }

/* Cards and sections */
html[data-look] .filters-section,
html[data-look] .data-section,
html[data-look] .stat-card,
html[data-look] .adm-panel,
html[data-look] .adm-section,
html[data-look] .modal-content,
html[data-look] .chart-container,
html[data-look] .lot-card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
}
html[data-look] .filters-section { background: var(--surface); }
html[data-look] .filters-header { border-bottom: 1px solid var(--line); }
html[data-look] .filters-header h3,
html[data-look] .section-header h2,
html[data-look] .adm-section-title,
html[data-look] .adm-panel-title,
html[data-look] .modal-header h3 {
    font-family: var(--font);
    font-weight: 500;
    font-size: 17px;
    color: var(--ink);
    letter-spacing: 0;
    text-transform: none;
}
html[data-look] .filters-header h3 i,
html[data-look] .section-header h2 i,
html[data-look] .filter-group label i,
html[data-look] .modal-header h3 i { color: var(--ink-2) !important; }
html[data-look] .filter-group label,
html[data-look] .form-group label,
html[data-look] .adm-field label {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    text-transform: none;
    letter-spacing: 0;
}
/* Fields (DESIGN.md 7.2): "Obligatoire" / "Facultatif" written after the label in ink-3, help under the field */
html[data-look] .field-note { font-style: normal; font-weight: 400; color: var(--ink-3); }
html[data-look] .form-group .field-hint { display: block; margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }

/* Stat cards: figure first, name under it in sentence case, the icon an outline in ink */
html[data-look] .stat-card { border-top: 3px solid var(--g-blue); }
html[data-look] .stat-card:hover { transform: none; box-shadow: none; }
html[data-look] .stat-card-icon {
    background: transparent !important;
    color: var(--ink-2) !important;
    width: auto;
    height: auto;
    font-size: 20px;
    box-shadow: none;
    justify-content: flex-start;
    margin-left: 0;
    margin-right: auto;
}
html[data-look] .stat-card { text-align: left; }
html[data-look] .stat-card-value,
html[data-look] body.dark-mode .stat-card-value { font-family: var(--font); font-weight: 500; letter-spacing: 0; color: var(--ink) !important; }
html[data-look] .stat-card-label,
html[data-look] body .stat-card-label {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-2);
}

/* Buttons: one filled blue action; every other button is an outline in ink */
html[data-look] .btn { font-family: var(--font); font-weight: 500; box-shadow: none; text-transform: none; letter-spacing: 0; }
html[data-look] .btn:hover { transform: none; box-shadow: none; }
html[data-look] .btn-success,
html[data-look] body.page-suppliers .btn-success {
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    color: var(--accent-ink) !important;
}
html[data-look] .btn-success:hover { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }
html[data-look] .section-header-actions .btn-primary,
html[data-look] .section-header .btn-primary,
html[data-look] .filters-header .btn-primary,
html[data-look] .btn-secondary,
html[data-look] body.page-suppliers .btn-secondary,
html[data-look] .dt-button,
html[data-look] button.dt-button,
html[data-look] div.dt-buttons > .dt-button {
    background: var(--surface) !important;
    border: 1px solid var(--line-strong) !important;
    color: var(--ink) !important;
    box-shadow: none !important;
    font-family: var(--font);
    font-weight: 500;
}
html[data-look] .section-header-actions .btn-primary:hover,
html[data-look] .section-header .btn-primary:hover,
html[data-look] .filters-header .btn-primary:hover,
html[data-look] .btn-secondary:hover,
html[data-look] .dt-button:hover { background: var(--surface-sunken) !important; }
html[data-look] .section-header-actions .btn-primary i,
html[data-look] .section-header .btn-primary i,
html[data-look] .filters-header .btn-primary i,
html[data-look] .dt-button i { color: var(--ink-2) !important; }
html[data-look] .btn-danger { background: var(--surface) !important; border: 1px solid var(--negative) !important; color: var(--negative) !important; }

/* Row action buttons in tables: quiet outlines */
html[data-look] .row-actions .btn,
html[data-look] .action-btn,
html[data-look] td .btn-icon {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink-2) !important;
    box-shadow: none !important;
}
html[data-look] .row-actions .btn:hover,
html[data-look] .action-btn:hover { border-color: var(--line-strong) !important; color: var(--ink) !important; }

/* Status badges: small, sentence case; colour only where it means good or bad */
html[data-look] .status-badge,
html[data-look] .badge {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    border-width: 0 !important;
    padding: 2px 8px;
}
html[data-look] .status-badge i { display: none; }

/* Tables */
html[data-look] table.dataTable tbody td,
html[data-look] .main-content table tbody td { border-color: var(--line); color: var(--ink); }
html[data-look] table.dataTable tbody tr:hover > * { background: var(--surface-sunken) !important; box-shadow: none !important; }
html[data-look] table.dataTable tbody tr > .sorting_1 { background: transparent !important; box-shadow: none !important; }
html[data-look] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-look] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--accent-tint) !important;
    border: 1px solid var(--accent-tint) !important;
    color: var(--accent) !important;
}
html[data-look] .dataTables_wrapper .dataTables_paginate .paginate_button { font-size: 14px; color: var(--ink-2) !important; }
html[data-look] .dataTables_wrapper .dataTables_info,
html[data-look] .dataTables_wrapper .dataTables_length,
html[data-look] .dataTables_wrapper .dataTables_filter { color: var(--ink-2); font-size: 13px; }

/* The currency beside the language in the top bar (sidebar.php) */
html[data-look] .fx-view-static {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    font: 500 13px var(--font);
    white-space: nowrap;
}
html[data-look] .fx-view-static[hidden] { display: none; }
html[data-look] .fx-view-switch { border: 1px solid var(--line); background: var(--surface); }
html[data-look] .fx-view-switch i { color: var(--ink-2); }

/* Inventory: warehouse cards centred (Thino); loads as plain cards */
html[data-look] #warehouseCards {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px !important;
}
html[data-look] #warehouseCards > * { flex: 0 1 260px; min-width: 220px; border-left-width: 1px !important; border-top: 3px solid var(--g-tan) !important; }

/* Settings: row and tile icons are outlines in ink, no tinted squares */
html[data-look] body.adm-page .adm-row-icon,
html[data-look] body.adm-page .adm-row-icon.green,
html[data-look] body.adm-page .adm-row-icon.orange,
html[data-look] body.adm-page .adm-row-icon.purple,
html[data-look] body.adm-page .adm-row-icon.red,
html[data-look] body.adm-page .adm-row-icon.blue { background: transparent !important; color: var(--ink-2) !important; }
html[data-look] body.adm-page .adm-tile { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
html[data-look] body.adm-page .adm-tile:hover { border-color: var(--line-strong); background: var(--surface-sunken); transform: none; }
html[data-look] body.adm-page .adm-nav-link.active,
html[data-look] body.adm-page .adm-nav-link[aria-current="page"] { background: var(--ground); color: var(--ink); box-shadow: inset 3px 0 0 var(--field); }

/* ===================== LIST PAGES (DESIGN.md §8, mockup "Achats") =====================
   One row per line, the actions behind one "⋯" button (ui-new.js), the filters folded under
   "Filtres · N", and the table toolbar on one quiet line. */
html[data-look] table.dataTable tbody td,
html[data-look] .main-content .data-section table tbody td {
    padding: 10px 12px;
    font-size: 14px;
    vertical-align: middle;
}
html[data-look] table.dataTable thead th,
html[data-look] .main-content .data-section table thead th {
    padding: 10px 12px;
    font: 500 12px var(--font);
    color: var(--ink-2);
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--line-strong) !important;
}
html[data-look] table.dataTable tbody tr > *,
html[data-look] table.dataTable tbody tr.odd > *,
html[data-look] table.dataTable tbody tr.even > * { background: var(--surface); box-shadow: none !important; }
html[data-look] table.dataTable.stripe tbody tr.odd > *,
html[data-look] table.dataTable.display tbody tr.odd > * { box-shadow: none !important; }
html[data-look] table.dataTable tbody td:first-child { white-space: nowrap; font-weight: 500; }
html[data-look] table.dataTable tbody td span[style*="monospace"] { font-family: var(--font) !important; font-size: 14px !important; letter-spacing: 0; }
html[data-look] table.dataTable tbody td small,
html[data-look] table.dataTable tbody td .text-muted { font-size: 12px; color: var(--ink-3); }
html[data-look] table.dataTable td.dt-type-numeric,
html[data-look] table.dataTable td.dt-right { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Row actions: one ⋮ button, the menu lists every action with its name (ui-new.js; row-actions.js looks the same) */
html[data-look] td.nf-has-row-menu { white-space: nowrap; text-align: right; width: 1%; }
html[data-look] .nf-row-menu { display: inline-block; position: relative; }
html[data-look] .row-actions-toggle,
html[data-look] td .row-actions-toggle.action-icon,
html[data-look] .nf-row-menu-btn {
    width: 36px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink-2);
    font: 700 18px/1 var(--font);
    cursor: pointer;
    box-shadow: none !important;
}
html[data-look] .row-actions-toggle i,
html[data-look] .nf-row-menu-btn i { font-size: 15px; color: inherit !important; }
html[data-look] .row-actions-toggle:hover,
html[data-look] .row-actions-toggle[aria-expanded="true"],
html[data-look] .nf-row-menu-btn:hover,
html[data-look] .nf-row-menu-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
html[data-look] .nf-row-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html[data-look] .row-actions-menu,
html[data-look] .nf-row-menu-list {
    position: fixed;
    z-index: 3000;
    min-width: 200px;
    max-width: 280px;
    padding: 4px 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: 0 6px 18px rgba(28, 18, 12, 0.12);
    text-align: left;
}
html[data-look] .nf-row-menu-list[hidden] { display: none; }
html[data-look] .row-actions-menu { border-radius: 0 !important; border: 1px solid var(--line-strong) !important; background: var(--surface) !important; }
html[data-look] .row-actions-item { font: 400 14px var(--font); color: var(--ink); border-radius: 0 !important; min-height: 40px; }
html[data-look] .row-actions-item:hover,
html[data-look] .row-actions-item:focus { background: var(--surface-sunken); }
html[data-look] .row-actions-item i { color: var(--ink-2) !important; }
html[data-look] .row-actions-item.is-danger,
html[data-look] .row-actions-item.is-danger i { color: var(--negative) !important; }
html[data-look] .row-actions-sep { background: var(--line); }
html[data-look] .nf-row-menu-list > .action-icon {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    height: auto !important;
    min-height: 40px;
    margin: 0 !important;
    padding: 8px 14px !important;
    background: transparent !important;
    border: 0 !important;
    color: var(--ink) !important;
    font: 400 14px var(--font);
    text-align: left;
    white-space: normal;
    justify-content: flex-start;
    box-shadow: none !important;
    transform: none !important;
}
html[data-look] .nf-row-menu-list > .action-icon:hover,
html[data-look] .nf-row-menu-list > .action-icon:focus-visible { background: var(--surface-sunken) !important; outline: none; }
html[data-look] .nf-row-menu-list > .action-icon i { color: var(--ink-2) !important; width: 16px; flex: 0 0 16px; }
html[data-look] .nf-row-menu-list > .action-icon.delete-icon,
html[data-look] .nf-row-menu-list > .action-icon.delete-icon i { color: var(--negative) !important; }
html[data-look] .nf-row-menu-label { flex: 1 1 auto; }
/* Phones and touch screens: 44 px tall menu items and a 44 x 44 ⋮ (DESIGN.md §13, as row-actions.css). */
@media (max-width: 768px), (pointer: coarse) {
    html[data-look] .row-actions-item,
    html[data-look] .nf-row-menu-list > .action-icon { min-height: 44px; }
    html[data-look] .row-actions-toggle,
    html[data-look] td .row-actions-toggle.action-icon,
    html[data-look] .nf-row-menu-btn { min-width: 44px; min-height: 44px; }
}

/* Lone row actions (1 or 2 buttons): quiet outlines */
html[data-look] td > .action-icon {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink-2) !important;
    box-shadow: none !important;
}
html[data-look] td > .action-icon:hover { border-color: var(--line-strong) !important; color: var(--ink) !important; }
html[data-look] td > .action-icon i { color: inherit !important; }

/* Filters fold under their heading button at every width (sidebar.php .filters-toggle + ui-new.js) */
html[data-look] .filters-section[data-nf-fold] { padding: 12px 16px; }
html[data-look] .filters-section.filters-collapsed .filters-grid { display: none !important; }
html[data-look] .filters-section.filters-collapsed .filters-header { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
html[data-look] .filters-section.filters-collapsed { padding: 0 !important; border: 0; background: transparent; margin-bottom: 12px; }
html[data-look] .filters-section .filters-header h3 { margin: 0; }
html[data-look] .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    font: 500 14px var(--font);
    cursor: pointer;
}
html[data-look] .filters-toggle i { color: var(--ink-2) !important; }
html[data-look] .filters-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html[data-look] .filters-chevron { display: inline-block !important; margin-left: 2px; font-size: 11px; transition: transform .15s; }
html[data-look] .filters-toggle[aria-expanded="true"] .filters-chevron { transform: rotate(180deg); }
html[data-look] .nf-filters-set .filters-toggle { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent); }
html[data-look] .filters-section.filters-collapsed:not(.nf-filters-set) .filters-header .btn { display: none; }

/* Table toolbar: export buttons and the page length on one quiet line */
@media (min-width: 1025px) {
    html[data-look] div.dt-buttons { display: inline-flex; gap: 8px; }
    html[data-look] .dt-button,
    html[data-look] div.dt-buttons > .dt-button { min-height: 36px !important; padding: 0 12px !important; font-size: 13px !important; margin: 0 !important; }
}
html[data-look] .dataTables_wrapper .dataTables_length select,
html[data-look] .dataTables_wrapper .dataTables_filter input {
    min-height: 36px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font: 400 14px var(--font);
    border-radius: 0;
}
html[data-look] .dataTables_wrapper .dataTables_length { margin-left: 12px; }

@media (max-width: 768px) {
    html[data-look] table.dataTable tbody td,
    html[data-look] .main-content .data-section table tbody td { padding: 10px 8px; }
}

/* ===================== SALE DETAILS (mockup "Détail d'une vente") =====================
   Result cards on top (net profit on the tint, larger, green or red), quantity and price beside the
   amounts, then the receipt and documents. Built by viewSaleDetail() in sales.php for the new design. */
html[data-look] #saleDetailModal.nf-sale-wide .modal { max-width: 1040px !important; width: calc(100% - 32px); }
html[data-look] .nf-sale-head { margin-bottom: 18px; }
html[data-look] .nf-sale-title { font: 700 26px/1.1 var(--font-title); text-transform: uppercase; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html[data-look] .nf-sale-sub { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
html[data-look] .nf-sale-route { margin-top: 6px; color: var(--ink-3); font-size: 13px; }
html[data-look] .nf-sale-route i { color: var(--ink-3); margin: 0 2px; }
html[data-look] .nf-group-head { display: flex; align-items: center; gap: 8px; font: 500 15px var(--font); color: var(--ink); margin: 0 0 10px; }
html[data-look] .nf-group-dot { width: 10px; height: 10px; background: var(--g-blue); display: inline-block; }
html[data-look] .nf-group-note { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 400; }
html[data-look] .nf-sale-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
html[data-look] .nf-sale-kpi { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--g-blue); padding: 14px 16px; min-width: 0; }
html[data-look] .nf-sale-kpi.is-main { background: var(--accent-tint); }
html[data-look] .nf-sale-kpi-label { font: 500 13px var(--font); color: var(--ink-2); }
html[data-look] .nf-sale-kpi-value { font: 500 22px/1.2 var(--font); color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
html[data-look] .nf-sale-kpi.is-main .nf-sale-kpi-value { font-size: 28px; }
html[data-look] .nf-sale-kpi-value.is-good { color: var(--positive); }
html[data-look] .nf-sale-kpi-value.is-bad { color: var(--negative); }
html[data-look] .nf-sale-kpi-sub { margin-top: 4px; font-size: 12px; color: var(--ink-3); min-height: 1em; }
html[data-look] .nf-sale-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
html[data-look] .nf-panel { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; }
html[data-look] .nf-panel h4 { font: 500 16px var(--font); color: var(--ink); margin: 0 0 8px; text-transform: none; letter-spacing: 0; }
html[data-look] .nf-kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
html[data-look] .nf-kv > span:first-child { color: var(--ink-2); }
html[data-look] .nf-kv > span:last-child { color: var(--ink); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
html[data-look] .nf-kv:last-child { border-bottom: 0; }
html[data-look] .nf-kv.is-total { border-top: 1px solid var(--line-strong); font-weight: 500; }
html[data-look] .nf-kv.is-total > span:first-child { color: var(--ink); font-weight: 500; }
html[data-look] .nf-kv.is-good > span:last-child { color: var(--positive); }
html[data-look] .nf-kv.is-bad > span:last-child { color: var(--negative); }
html[data-look] .nf-sale-docs > div:first-of-type { border-top: 0 !important; padding-top: 0 !important; }
@media (max-width: 768px) {
    html[data-look] .nf-sale-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html[data-look] .nf-sale-kpi.is-main { grid-column: 1 / -1; }
    html[data-look] .nf-sale-kpi-value { font-size: 18px; }
    html[data-look] .nf-sale-kpi { padding: 12px; }
    html[data-look] .nf-sale-panels { grid-template-columns: 1fr; }
}

/* Modal close: the tokens part draws the × with two bars; keep that instead of the outline mask */
html[data-look] .close-btn > i.fa-times::before {
    -webkit-mask: none;
    mask: none;
    position: absolute;
    display: block;
    width: 1.1em;
    height: 1.6px;
    vertical-align: 0;
}
html[data-look] .close-btn > i.fa-times::after { height: 1.6px; }

/* ===================== FORM DRAWERS (mockup "Ajouter une livraison") =====================
   The long add/edit forms open as a right-hand drawer over the list, full height, with the title on top,
   the fields scrolling in titled sections, and Save / Cancel always visible at the bottom. On phones the
   drawer is a full-screen sheet. Same forms, same fields, same handlers. */
html[data-look] #purchaseModal.active,
html[data-look] #saleModal.active,
html[data-look] #deliveryModal.active,
html[data-look] #paymentModal.active,
html[data-look] #expenseModal.active,
html[data-look] #supplierModal.active,
html[data-look] #customerModal.active,
html[data-look] #financingModal.active {
    justify-content: flex-end;
    align-items: stretch;
    padding: 0 !important;
    background: rgba(28, 18, 12, 0.38);
}
html[data-look] #purchaseModal.active > .modal,
html[data-look] #saleModal.active > .modal,
html[data-look] #deliveryModal.active > .modal,
html[data-look] #paymentModal.active > .modal,
html[data-look] #expenseModal.active > .modal,
html[data-look] #supplierModal.active > .modal,
html[data-look] #customerModal.active > .modal,
html[data-look] #financingModal.active > .modal {
    width: min(720px, 100%) !important;
    max-width: 720px !important;
    height: 100%;
    max-height: 100% !important;
    margin: 0;
    border: 0 !important;
    border-left: 1px solid var(--line-strong) !important;
    border-radius: 0 !important;
    box-shadow: -8px 0 24px rgba(28, 18, 12, 0.12) !important;
    display: flex;
    flex-direction: column;
    animation: nf-drawer-in .18s ease-out;
}
@keyframes nf-drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html[data-look] .modal-overlay .modal { animation: none !important; } }
html[data-look] #purchaseModal.active > .modal > .modal-body,
html[data-look] #saleModal.active > .modal > .modal-body,
html[data-look] #deliveryModal.active > .modal > .modal-body,
html[data-look] #paymentModal.active > .modal > .modal-body,
html[data-look] #expenseModal.active > .modal > .modal-body,
html[data-look] #supplierModal.active > .modal > .modal-body,
html[data-look] #customerModal.active > .modal > .modal-body,
html[data-look] #financingModal.active > .modal > .modal-body { flex: 1 0 auto; padding: 20px 24px 0 !important; }
html[data-look] #purchaseModal .form-actions,
html[data-look] #saleModal .form-actions,
html[data-look] #deliveryModal .form-actions,
html[data-look] #paymentModal .form-actions,
html[data-look] #expenseModal .form-actions,
html[data-look] #supplierModal .form-actions,
html[data-look] #customerModal .form-actions,
html[data-look] #financingModal .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 10px;
    margin: 20px -24px 0 !important;
    padding: 14px 24px !important;
    background: var(--surface);
    border-top: 1px solid var(--line);
}
html[data-look] #purchaseModal .form-actions .btn-primary,
html[data-look] #saleModal .form-actions .btn-primary,
html[data-look] #deliveryModal .form-actions .btn-primary,
html[data-look] #paymentModal .form-actions .btn-primary,
html[data-look] #expenseModal .form-actions .btn-primary,
html[data-look] #supplierModal .form-actions .btn-primary,
html[data-look] #customerModal .form-actions .btn-primary,
html[data-look] #financingModal .form-actions .btn-primary {
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    color: var(--accent-ink) !important;
}
html[data-look] #purchaseModal .form-actions .btn-primary i,
html[data-look] #saleModal .form-actions .btn-primary i,
html[data-look] #deliveryModal .form-actions .btn-primary i,
html[data-look] #paymentModal .form-actions .btn-primary i,
html[data-look] #expenseModal .form-actions .btn-primary i,
html[data-look] #supplierModal .form-actions .btn-primary i,
html[data-look] #customerModal .form-actions .btn-primary i,
html[data-look] #financingModal .form-actions .btn-primary i { color: inherit !important; }
html[data-look] .modal-overlay .modal-header {
    background: var(--surface) !important;
    color: var(--ink) !important;
    border-bottom: 1px solid var(--line);
    padding: 16px 24px !important;
    border-radius: 0 !important;
}
html[data-look] .modal-overlay .modal-header .close-btn { color: var(--ink-2) !important; border-radius: 0; }
html[data-look] .modal-overlay .modal-header .close-btn:hover { background: var(--surface-sunken) !important; transform: none; }
/* Sections inside the drawers: a plain title and a rule, no tinted boxes */
html[data-look] .delivery-section,
html[data-look] .form-section {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    padding: 0 0 18px !important;
    margin: 0 0 18px !important;
    box-shadow: none !important;
}
html[data-look] .delivery-section-title,
html[data-look] .form-section-title,
html[data-look] .delivery-section h4 {
    font: 500 15px var(--font) !important;
    color: var(--ink) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
html[data-look] .delivery-section-title i,
html[data-look] .form-section-title i { display: none; }
html[data-look] .modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-look] .modal select,
html[data-look] .modal textarea {
    border-radius: 0 !important;
    border: 1px solid var(--line-strong) !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    font-family: var(--font);
    min-height: 40px;
}
html[data-look] .modal input:focus,
html[data-look] .modal select:focus,
html[data-look] .modal textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent) !important; box-shadow: none !important; }
html[data-look] .modal .form-group label i { display: none; }
/* The Visual Quality stars are icons inside labels too: keep them (they are the field itself). */
html[data-look] .modal .form-group .star-rating .star-label i { display: inline-block; }
html[data-look] .modal .form-group .star-rating .star-label { font-size: 24px; line-height: 1; padding: 4px 2px; }
/* Chosen (and hovered) stars are filled so the rating reads at a glance; the rest stay outlined. */
html[data-look] .star-rating .star-label:hover i.fa-star,
html[data-look] .star-rating .star-label:hover ~ .star-label i.fa-star,
html[data-look] .star-rating .star-radio:checked + .star-label i.fa-star,
html[data-look] .star-rating .star-radio:checked ~ .star-label i.fa-star { --nf-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.52 2.3a.53.53 0 0 1 .96 0l2.31 4.68a2.12 2.12 0 0 0 1.6 1.16l5.16.76a.53.53 0 0 1 .3.9l-3.74 3.64a2.12 2.12 0 0 0-.61 1.88l.88 5.14a.53.53 0 0 1-.77.56l-4.62-2.43a2.12 2.12 0 0 0-1.97 0L6.4 21.01a.53.53 0 0 1-.77-.56l.88-5.14a2.12 2.12 0 0 0-.61-1.88L2.16 9.8a.53.53 0 0 1 .3-.9l5.16-.76a2.12 2.12 0 0 0 1.6-1.16z'/%3E%3C/svg%3E"); }
@media (max-width: 768px) {
    html[data-look] #purchaseModal.active > .modal,
    html[data-look] #saleModal.active > .modal,
    html[data-look] #deliveryModal.active > .modal,
    html[data-look] #paymentModal.active > .modal,
    html[data-look] #expenseModal.active > .modal,
    html[data-look] #supplierModal.active > .modal,
    html[data-look] #customerModal.active > .modal,
    html[data-look] #financingModal.active > .modal { width: 100% !important; border-left: 0 !important; }
    html[data-look] #purchaseModal .form-actions .btn,
    html[data-look] #saleModal .form-actions .btn,
    html[data-look] #deliveryModal .form-actions .btn,
    html[data-look] #paymentModal .form-actions .btn,
    html[data-look] #expenseModal .form-actions .btn,
    html[data-look] #supplierModal .form-actions .btn,
    html[data-look] #customerModal .form-actions .btn,
    html[data-look] #financingModal .form-actions .btn { flex: 1 1 0; }
}

/* Above the phone bottom bar (z-index 1001), below SweetAlert (1060) */
html[data-look] #purchaseModal,
html[data-look] #saleModal,
html[data-look] #deliveryModal,
html[data-look] #paymentModal,
html[data-look] #expenseModal,
html[data-look] #supplierModal,
html[data-look] #customerModal,
html[data-look] #financingModal { z-index: 1004; }
/* Chooser inside forms: Clear is a quiet text button inside the field */
html[data-look] .searchable-dropdown-clear {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ink-2) !important;
    font: 500 13px var(--font) !important;
    min-height: 40px;
    top: 0;
}
html[data-look] .searchable-dropdown-clear:hover { color: var(--ink) !important; text-decoration: underline; }
html[data-look] .searchable-dropdown-arrow { color: var(--ink-2); }

/* ===================== SETTINGS (mockup "Paramètres") =====================
   The settings frame is one white card: the section list on the left, the form on the right. Inner
   panels are plain (no boxes inside the box); group titles in sentence case; Save filled blue. */
html[data-look] body.adm-page .adm-panel,
html[data-look] body.adm-page .adm-section {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
html[data-look] body.adm-page .adm-frame { background: var(--surface); border: 1px solid var(--line); border-radius: 0; box-shadow: none; }
html[data-look] body.adm-page .adm-nav { background: var(--surface); border-right: 1px solid var(--line); }
html[data-look] body.adm-page .adm-nav-title {
    font: 500 12px var(--font) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--ink-3) !important;
}
html[data-look] body.adm-page .adm-nav-link { font: 400 14px var(--font); color: var(--ink-2); border-radius: 0 !important; }
html[data-look] body.adm-page .adm-nav-link:hover { background: var(--surface-sunken); color: var(--ink); }
html[data-look] body.adm-page .adm-nav-link.active,
html[data-look] body.adm-page .adm-nav-link[aria-current="page"] {
    background: var(--accent-tint) !important;
    color: var(--accent) !important;
    box-shadow: inset 3px 0 0 var(--accent) !important;
    font-weight: 500;
}
html[data-look] body.adm-page .adm-nav-link i,
html[data-look] body.adm-page .adm-nav-link .ph { color: inherit; }
html[data-look] body.adm-page .adm-main .btn-primary {
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    color: var(--accent-ink) !important;
}
html[data-look] body.adm-page .adm-main .btn-primary i { color: inherit !important; }
html[data-look] body.adm-page .adm-main .btn { border-radius: 0 !important; }
html[data-look] body.adm-page .adm-panel :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea) {
    border-radius: 0 !important;
    border: 1px solid var(--line-strong) !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    min-height: 40px;
}
html[data-look] body.adm-page .adm-row { border-color: var(--line) !important; }
html[data-look] body.adm-page .adm-callout,
html[data-look] body.adm-page .adm-note { border-radius: 0 !important; }

/* ===================== OUTLINE ICONS (DESIGN.md §19) =====================
   Generated by tools/ui-icons.py. The Font Awesome icons are drawn as thin outline icons (the
   mockups' set, Lucide-style, 1.6 stroke) in the text colour: no tinted squares, no colour. Classes not listed keep
   their Font Awesome glyph. */
html[data-look] {
    --nf-i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
    --nf-i-arrowdown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E");
    --nf-i-arrowup: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5'/%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3C/svg%3E");
    --nf-i-bag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
    --nf-i-bank: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 22h18'/%3E%3Cpath d='M6 18v-7'/%3E%3Cpath d='M10 18v-7'/%3E%3Cpath d='M14 18v-7'/%3E%3Cpath d='M18 18v-7'/%3E%3Cpath d='m12 2 8 5H4Z'/%3E%3C/svg%3E");
    --nf-i-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E");
    --nf-i-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3Ccircle cx='12' cy='8' r='2'/%3E%3Cpath d='M15 13a3 3 0 1 0-6 0'/%3E%3C/svg%3E");
    --nf-i-box: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E");
    --nf-i-building: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20'/%3E%3Cpath d='M9 22v-4h6v4M8 6h.01M16 6h.01M12 6h.01M12 10h.01M12 14h.01M16 10h.01M16 14h.01M8 10h.01M8 14h.01'/%3E%3C/svg%3E");
    --nf-i-bulb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E");
    --nf-i-bus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6v6'/%3E%3Cpath d='M15 6v6'/%3E%3Cpath d='M2 12h19.6'/%3E%3Cpath d='M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Cpath d='M9 18h5'/%3E%3Ccircle cx='16' cy='18' r='2'/%3E%3C/svg%3E");
    --nf-i-calc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20'/%3E%3Cpath d='M8 6h8M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01M8 10h.01M12 10h.01M16 10h.01'/%3E%3C/svg%3E");
    --nf-i-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
    --nf-i-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E");
    --nf-i-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E");
    --nf-i-cash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E");
    --nf-i-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m19 9-5 5-4-4-3 3'/%3E%3C/svg%3E");
    --nf-i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --nf-i-checkc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
    --nf-i-clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
    --nf-i-coins: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M18.09 10.37A6 6 0 1 1 10.34 18'/%3E%3Cpath d='M7 6h1v4'/%3E%3C/svg%3E");
    --nf-i-contact: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    --nf-i-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9'/%3E%3Crect x='14' y='3' width='7' height='5'/%3E%3Crect x='14' y='12' width='7' height='9'/%3E%3Crect x='3' y='16' width='7' height='5'/%3E%3C/svg%3E");
    --nf-i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --nf-i-edit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.38 2.62a2.12 2.12 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E");
    --nf-i-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --nf-i-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M8 13h8M8 17h5'/%3E%3C/svg%3E");
    --nf-i-filter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54Z'/%3E%3C/svg%3E");
    --nf-i-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' x2='4' y1='22' y2='15'/%3E%3C/svg%3E");
    --nf-i-flask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3h6'/%3E%3Cpath d='M10 9V3h4v6l5 10a1 1 0 0 1-.9 1.5H5.9A1 1 0 0 1 5 19Z'/%3E%3Cpath d='M7 15h10'/%3E%3C/svg%3E");
    --nf-i-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z'/%3E%3C/svg%3E");
    --nf-i-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20'/%3E%3Cpath d='M2 12h20'/%3E%3C/svg%3E");
    --nf-i-handcoins: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17'/%3E%3Cpath d='m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9'/%3E%3Cpath d='m2 16 6 6'/%3E%3Ccircle cx='16' cy='9' r='2.9'/%3E%3Ccircle cx='6' cy='5' r='3'/%3E%3C/svg%3E");
    --nf-i-handshake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m11 17 2 2a1 1 0 1 0 3-3'/%3E%3Cpath d='m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4'/%3E%3Cpath d='m21 3 1 11h-2'/%3E%3Cpath d='M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3'/%3E%3Cpath d='M3 4h8'/%3E%3C/svg%3E");
    --nf-i-hash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h16M4 15h16M10 3 8 21M16 3l-2 18'/%3E%3C/svg%3E");
    --nf-i-help: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
    --nf-i-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/%3E%3Cpath d='M9 22V12h6v10'/%3E%3C/svg%3E");
    --nf-i-hourglass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 22h14'/%3E%3Cpath d='M5 2h14'/%3E%3Cpath d='M17 22v-4.17a2 2 0 0 0-.59-1.42L12 12l-4.41 4.41A2 2 0 0 0 7 17.83V22'/%3E%3Cpath d='M7 2v4.17a2 2 0 0 0 .59 1.42L12 12l4.41-4.41A2 2 0 0 0 17 6.17V2'/%3E%3C/svg%3E");
    --nf-i-idcard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14'/%3E%3Ccircle cx='8' cy='12' r='2'/%3E%3Cpath d='M14 10h4M14 14h4M5.5 16a3 3 0 0 1 5 0'/%3E%3C/svg%3E");
    --nf-i-inbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
    --nf-i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
    --nf-i-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 10 5-10 5L2 7Z'/%3E%3Cpath d='m2 17 10 5 10-5'/%3E%3Cpath d='m2 12 10 5 10-5'/%3E%3C/svg%3E");
    --nf-i-leaf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E");
    --nf-i-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
    --nf-i-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6h11M10 12h11M10 18h11M4 6h1M4 12h1M4 18h1'/%3E%3C/svg%3E");
    --nf-i-locate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='2' x2='5' y1='12' y2='12'/%3E%3Cline x1='19' x2='22' y1='12' y2='12'/%3E%3Cline x1='12' x2='12' y1='2' y2='5'/%3E%3Cline x1='12' x2='12' y1='19' y2='22'/%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --nf-i-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    --nf-i-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
    --nf-i-map: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z'/%3E%3Cpath d='M15 5.764v15'/%3E%3Cpath d='M9 3.236v15'/%3E%3C/svg%3E");
    --nf-i-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E");
    --nf-i-more: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E");
    --nf-i-note: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5Z'/%3E%3Cpath d='M15 3v6h6'/%3E%3C/svg%3E");
    --nf-i-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18'/%3E%3Cpath d='M9 3v18'/%3E%3C/svg%3E");
    --nf-i-pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z'/%3E%3C/svg%3E");
    --nf-i-percent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 5 5 19'/%3E%3Ccircle cx='6.5' cy='6.5' r='2.5'/%3E%3Ccircle cx='17.5' cy='17.5' r='2.5'/%3E%3C/svg%3E");
    --nf-i-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
    --nf-i-pie: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.21 15.89A10 10 0 1 1 8 2.83'/%3E%3Cpath d='M22 12A10 10 0 0 0 12 2v10Z'/%3E%3C/svg%3E");
    --nf-i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 4.99-5.54 10.19-7.4 11.8a1 1 0 0 1-1.2 0C9.54 20.19 4 14.99 4 10a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    --nf-i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    --nf-i-pluscircle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12h8M12 8v8'/%3E%3C/svg%3E");
    --nf-i-polygon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.83 2.38a2 2 0 0 1 2.34 0l8 5.74a2 2 0 0 1 .73 2.25l-3.04 9.26a2 2 0 0 1-1.9 1.37H7.04a2 2 0 0 1-1.9-1.37L2.1 10.37a2 2 0 0 1 .73-2.25z'/%3E%3C/svg%3E");
    --nf-i-print: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V2h12v7'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E");
    --nf-i-receipt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8'/%3E%3Cpath d='M12 17.5v-11'/%3E%3C/svg%3E");
    --nf-i-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E");
    --nf-i-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
    --nf-i-save: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z'/%3E%3Cpath d='M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7'/%3E%3Cpath d='M7 3v4a1 1 0 0 0 1 1h7'/%3E%3C/svg%3E");
    --nf-i-scale: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E");
    --nf-i-scroll: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 12h-5M15 8h-5M19 17V5a2 2 0 0 0-2-2H4'/%3E%3Cpath d='M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3'/%3E%3C/svg%3E");
    --nf-i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    --nf-i-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.54 21.69a.5.5 0 0 0 .94-.03L22 2.5a.5.5 0 0 0-.64-.64L2.34 8.52a.5.5 0 0 0-.03.94l7.93 3.18a2 2 0 0 1 1.11 1.11Z'/%3E%3Cpath d='m21.85 2.15-10.94 10.94'/%3E%3C/svg%3E");
    --nf-i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/%3E%3C/svg%3E");
    --nf-i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3Z'/%3E%3C/svg%3E");
    --nf-i-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.52 2.3a.53.53 0 0 1 .96 0l2.31 4.68a2.12 2.12 0 0 0 1.6 1.16l5.16.76a.53.53 0 0 1 .3.9l-3.74 3.64a2.12 2.12 0 0 0-.61 1.88l.88 5.14a.53.53 0 0 1-.77.56l-4.62-2.43a2.12 2.12 0 0 0-1.97 0L6.4 21.01a.53.53 0 0 1-.77-.56l.88-5.14a2.12 2.12 0 0 0-.61-1.88L2.16 9.8a.53.53 0 0 1 .3-.9l5.16-.76a2.12 2.12 0 0 0 1.6-1.16z'/%3E%3C/svg%3E");
    --nf-i-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E");
    --nf-i-swap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h14l-3-3'/%3E%3Cpath d='M20 16H6l3 3'/%3E%3C/svg%3E");
    --nf-i-table: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18'/%3E%3Cpath d='M3 9h18M3 15h18M9 3v18'/%3E%3C/svg%3E");
    --nf-i-tag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2H2v10l9.29 9.29a1 1 0 0 0 1.41 0l8.59-8.59a1 1 0 0 0 0-1.41Z'/%3E%3Cpath d='M7 7h.01'/%3E%3C/svg%3E");
    --nf-i-transfer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 3 4 4-4 4'/%3E%3Cpath d='M20 7H4'/%3E%3Cpath d='m8 21-4-4 4-4'/%3E%3Cpath d='M4 17h16'/%3E%3C/svg%3E");
    --nf-i-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E");
    --nf-i-trophy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9H4.5a2.5 2.5 0 0 1 0-5H6'/%3E%3Cpath d='M18 9h1.5a2.5 2.5 0 0 0 0-5H18'/%3E%3Cpath d='M4 22h16'/%3E%3Cpath d='M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22'/%3E%3Cpath d='M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22'/%3E%3Cpath d='M18 2H6v7a6 6 0 0 0 12 0V2Z'/%3E%3C/svg%3E");
    --nf-i-truck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.62L18.3 9.38a1 1 0 0 0-.78-.38H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E");
    --nf-i-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m17 8-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%3E%3C/svg%3E");
    --nf-i-useradd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6M22 11h-6'/%3E%3C/svg%3E");
    --nf-i-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
    --nf-i-vault: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 8v1M12 15v1M8 12h1M15 12h1'/%3E%3C/svg%3E");
    --nf-i-walk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z'/%3E%3Cpath d='M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z'/%3E%3Cpath d='M16 17h4'/%3E%3Cpath d='M4 13h4'/%3E%3C/svg%3E");
    --nf-i-wallet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'/%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4Z'/%3E%3C/svg%3E");
    --nf-i-warehouse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z'/%3E%3Cpath d='M6 18h12'/%3E%3Cpath d='M6 14h12'/%3E%3Crect x='6' y='10' width='12' height='12'/%3E%3C/svg%3E");
    --nf-i-wrench: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E");
    --nf-i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
    --nf-i-xcircle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E");
}
html[data-look] i.fa-address-book,
html[data-look] i.fa-arrow-down,
html[data-look] i.fa-arrow-right-from-bracket,
html[data-look] i.fa-arrow-up,
html[data-look] i.fa-arrows-rotate,
html[data-look] i.fa-bars,
html[data-look] i.fa-bell,
html[data-look] i.fa-boxes-packing,
html[data-look] i.fa-boxes-stacked,
html[data-look] i.fa-brain,
html[data-look] i.fa-building,
html[data-look] i.fa-building-columns,
html[data-look] i.fa-calculator,
html[data-look] i.fa-calendar,
html[data-look] i.fa-calendar-alt,
html[data-look] i.fa-calendar-check,
html[data-look] i.fa-calendar-day,
html[data-look] i.fa-calendar-days,
html[data-look] i.fa-calendar-plus,
html[data-look] i.fa-cart-plus,
html[data-look] i.fa-cart-shopping,
html[data-look] i.fa-cash-register,
html[data-look] i.fa-chart-area,
html[data-look] i.fa-chart-bar,
html[data-look] i.fa-chart-line,
html[data-look] i.fa-chart-pie,
html[data-look] i.fa-check,
html[data-look] i.fa-check-circle,
html[data-look] i.fa-chevron-down,
html[data-look] i.fa-chevron-left,
html[data-look] i.fa-chevron-right,
html[data-look] i.fa-circle-check,
html[data-look] i.fa-circle-info,
html[data-look] i.fa-circle-plus,
html[data-look] i.fa-circle-question,
html[data-look] i.fa-circle-user,
html[data-look] i.fa-circle-xmark,
html[data-look] i.fa-cog,
html[data-look] i.fa-coins,
html[data-look] i.fa-credit-card,
html[data-look] i.fa-credit-card-alt,
html[data-look] i.fa-draw-polygon,
html[data-look] i.fa-earth-africa,
html[data-look] i.fa-edit,
html[data-look] i.fa-exclamation-triangle,
html[data-look] i.fa-eye,
html[data-look] i.fa-file-alt,
html[data-look] i.fa-file-contract,
html[data-look] i.fa-file-csv,
html[data-look] i.fa-file-excel,
html[data-look] i.fa-file-export,
html[data-look] i.fa-file-invoice-dollar,
html[data-look] i.fa-file-lines,
html[data-look] i.fa-file-pdf,
html[data-look] i.fa-filter,
html[data-look] i.fa-flag-checkered,
html[data-look] i.fa-flask,
html[data-look] i.fa-floppy-disk,
html[data-look] i.fa-gear,
html[data-look] i.fa-globe,
html[data-look] i.fa-hand-holding-dollar,
html[data-look] i.fa-hand-holding-usd,
html[data-look] i.fa-handshake,
html[data-look] i.fa-handshake-angle,
html[data-look] i.fa-hashtag,
html[data-look] i.fa-home,
html[data-look] i.fa-hourglass-half,
html[data-look] i.fa-house,
html[data-look] i.fa-id-badge,
html[data-look] i.fa-id-card,
html[data-look] i.fa-inbox,
html[data-look] i.fa-info-circle,
html[data-look] i.fa-layer-group,
html[data-look] i.fa-leaf,
html[data-look] i.fa-lightbulb,
html[data-look] i.fa-list,
html[data-look] i.fa-list-ol,
html[data-look] i.fa-list-ul,
html[data-look] i.fa-location-crosshairs,
html[data-look] i.fa-location-dot,
html[data-look] i.fa-lock,
html[data-look] i.fa-magnifying-glass,
html[data-look] i.fa-map-location-dot,
html[data-look] i.fa-map-marker-alt,
html[data-look] i.fa-money-bill-transfer,
html[data-look] i.fa-money-bill-wave,
html[data-look] i.fa-moon,
html[data-look] i.fa-palette,
html[data-look] i.fa-paper-plane,
html[data-look] i.fa-paperclip,
html[data-look] i.fa-pen,
html[data-look] i.fa-pen-to-square,
html[data-look] i.fa-people-group,
html[data-look] i.fa-percent,
html[data-look] i.fa-person-walking,
html[data-look] i.fa-phone,
html[data-look] i.fa-plus,
html[data-look] i.fa-plus-circle,
html[data-look] i.fa-print,
html[data-look] i.fa-question-circle,
html[data-look] i.fa-ranking-star,
html[data-look] i.fa-receipt,
html[data-look] i.fa-right-left,
html[data-look] i.fa-rotate,
html[data-look] i.fa-save,
html[data-look] i.fa-scale-balanced,
html[data-look] i.fa-screwdriver-wrench,
html[data-look] i.fa-scroll,
html[data-look] i.fa-search,
html[data-look] i.fa-seedling,
html[data-look] i.fa-shield-halved,
html[data-look] i.fa-sign-in-alt,
html[data-look] i.fa-sign-out-alt,
html[data-look] i.fa-star,
html[data-look] i.fa-sticky-note,
html[data-look] i.fa-sun,
html[data-look] i.fa-sync,
html[data-look] i.fa-sync-alt,
html[data-look] i.fa-table,
html[data-look] i.fa-tag,
html[data-look] i.fa-tags,
html[data-look] i.fa-times,
html[data-look] i.fa-times-circle,
html[data-look] i.fa-trash,
html[data-look] i.fa-triangle-exclamation,
html[data-look] i.fa-truck,
html[data-look] i.fa-truck-fast,
html[data-look] i.fa-truck-field,
html[data-look] i.fa-truck-moving,
html[data-look] i.fa-upload,
html[data-look] i.fa-user,
html[data-look] i.fa-user-circle,
html[data-look] i.fa-user-plus,
html[data-look] i.fa-users,
html[data-look] i.fa-vault,
html[data-look] i.fa-wallet,
html[data-look] i.fa-warehouse,
html[data-look] i.fa-weight-hanging,
html[data-look] i.fa-xmark { font-family: inherit !important; font-weight: 400; }
html[data-look] i.fa-address-book::before,
html[data-look] i.fa-arrow-down::before,
html[data-look] i.fa-arrow-right-from-bracket::before,
html[data-look] i.fa-arrow-up::before,
html[data-look] i.fa-arrows-rotate::before,
html[data-look] i.fa-bars::before,
html[data-look] i.fa-bell::before,
html[data-look] i.fa-boxes-packing::before,
html[data-look] i.fa-boxes-stacked::before,
html[data-look] i.fa-brain::before,
html[data-look] i.fa-building::before,
html[data-look] i.fa-building-columns::before,
html[data-look] i.fa-calculator::before,
html[data-look] i.fa-calendar::before,
html[data-look] i.fa-calendar-alt::before,
html[data-look] i.fa-calendar-check::before,
html[data-look] i.fa-calendar-day::before,
html[data-look] i.fa-calendar-days::before,
html[data-look] i.fa-calendar-plus::before,
html[data-look] i.fa-cart-plus::before,
html[data-look] i.fa-cart-shopping::before,
html[data-look] i.fa-cash-register::before,
html[data-look] i.fa-chart-area::before,
html[data-look] i.fa-chart-bar::before,
html[data-look] i.fa-chart-line::before,
html[data-look] i.fa-chart-pie::before,
html[data-look] i.fa-check::before,
html[data-look] i.fa-check-circle::before,
html[data-look] i.fa-chevron-down::before,
html[data-look] i.fa-chevron-left::before,
html[data-look] i.fa-chevron-right::before,
html[data-look] i.fa-circle-check::before,
html[data-look] i.fa-circle-info::before,
html[data-look] i.fa-circle-plus::before,
html[data-look] i.fa-circle-question::before,
html[data-look] i.fa-circle-user::before,
html[data-look] i.fa-circle-xmark::before,
html[data-look] i.fa-cog::before,
html[data-look] i.fa-coins::before,
html[data-look] i.fa-credit-card::before,
html[data-look] i.fa-credit-card-alt::before,
html[data-look] i.fa-draw-polygon::before,
html[data-look] i.fa-earth-africa::before,
html[data-look] i.fa-edit::before,
html[data-look] i.fa-exclamation-triangle::before,
html[data-look] i.fa-eye::before,
html[data-look] i.fa-file-alt::before,
html[data-look] i.fa-file-contract::before,
html[data-look] i.fa-file-csv::before,
html[data-look] i.fa-file-excel::before,
html[data-look] i.fa-file-export::before,
html[data-look] i.fa-file-invoice-dollar::before,
html[data-look] i.fa-file-lines::before,
html[data-look] i.fa-file-pdf::before,
html[data-look] i.fa-filter::before,
html[data-look] i.fa-flag-checkered::before,
html[data-look] i.fa-flask::before,
html[data-look] i.fa-floppy-disk::before,
html[data-look] i.fa-gear::before,
html[data-look] i.fa-globe::before,
html[data-look] i.fa-hand-holding-dollar::before,
html[data-look] i.fa-hand-holding-usd::before,
html[data-look] i.fa-handshake::before,
html[data-look] i.fa-handshake-angle::before,
html[data-look] i.fa-hashtag::before,
html[data-look] i.fa-home::before,
html[data-look] i.fa-hourglass-half::before,
html[data-look] i.fa-house::before,
html[data-look] i.fa-id-badge::before,
html[data-look] i.fa-id-card::before,
html[data-look] i.fa-inbox::before,
html[data-look] i.fa-info-circle::before,
html[data-look] i.fa-layer-group::before,
html[data-look] i.fa-leaf::before,
html[data-look] i.fa-lightbulb::before,
html[data-look] i.fa-list::before,
html[data-look] i.fa-list-ol::before,
html[data-look] i.fa-list-ul::before,
html[data-look] i.fa-location-crosshairs::before,
html[data-look] i.fa-location-dot::before,
html[data-look] i.fa-lock::before,
html[data-look] i.fa-magnifying-glass::before,
html[data-look] i.fa-map-location-dot::before,
html[data-look] i.fa-map-marker-alt::before,
html[data-look] i.fa-money-bill-transfer::before,
html[data-look] i.fa-money-bill-wave::before,
html[data-look] i.fa-moon::before,
html[data-look] i.fa-palette::before,
html[data-look] i.fa-paper-plane::before,
html[data-look] i.fa-paperclip::before,
html[data-look] i.fa-pen::before,
html[data-look] i.fa-pen-to-square::before,
html[data-look] i.fa-people-group::before,
html[data-look] i.fa-percent::before,
html[data-look] i.fa-person-walking::before,
html[data-look] i.fa-phone::before,
html[data-look] i.fa-plus::before,
html[data-look] i.fa-plus-circle::before,
html[data-look] i.fa-print::before,
html[data-look] i.fa-question-circle::before,
html[data-look] i.fa-ranking-star::before,
html[data-look] i.fa-receipt::before,
html[data-look] i.fa-right-left::before,
html[data-look] i.fa-rotate::before,
html[data-look] i.fa-save::before,
html[data-look] i.fa-scale-balanced::before,
html[data-look] i.fa-screwdriver-wrench::before,
html[data-look] i.fa-scroll::before,
html[data-look] i.fa-search::before,
html[data-look] i.fa-seedling::before,
html[data-look] i.fa-shield-halved::before,
html[data-look] i.fa-sign-in-alt::before,
html[data-look] i.fa-sign-out-alt::before,
html[data-look] i.fa-star::before,
html[data-look] i.fa-sticky-note::before,
html[data-look] i.fa-sun::before,
html[data-look] i.fa-sync::before,
html[data-look] i.fa-sync-alt::before,
html[data-look] i.fa-table::before,
html[data-look] i.fa-tag::before,
html[data-look] i.fa-tags::before,
html[data-look] i.fa-times::before,
html[data-look] i.fa-times-circle::before,
html[data-look] i.fa-trash::before,
html[data-look] i.fa-triangle-exclamation::before,
html[data-look] i.fa-truck::before,
html[data-look] i.fa-truck-fast::before,
html[data-look] i.fa-truck-field::before,
html[data-look] i.fa-truck-moving::before,
html[data-look] i.fa-upload::before,
html[data-look] i.fa-user::before,
html[data-look] i.fa-user-circle::before,
html[data-look] i.fa-user-plus::before,
html[data-look] i.fa-users::before,
html[data-look] i.fa-vault::before,
html[data-look] i.fa-wallet::before,
html[data-look] i.fa-warehouse::before,
html[data-look] i.fa-weight-hanging::before,
html[data-look] i.fa-xmark::before {
    content: "" !important;
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    background-color: currentColor;
    -webkit-mask: var(--nf-i) center / contain no-repeat;
    mask: var(--nf-i) center / contain no-repeat;
}
html[data-look] i.fa-address-book { --nf-i: var(--nf-i-book); }
html[data-look] i.fa-arrow-down { --nf-i: var(--nf-i-arrowdown); }
html[data-look] i.fa-arrow-right-from-bracket { --nf-i: var(--nf-i-logout); }
html[data-look] i.fa-arrow-up { --nf-i: var(--nf-i-arrowup); }
html[data-look] i.fa-arrows-rotate { --nf-i: var(--nf-i-refresh); }
html[data-look] i.fa-bars { --nf-i: var(--nf-i-more); }
html[data-look] i.fa-bell { --nf-i: var(--nf-i-bell); }
html[data-look] i.fa-boxes-packing { --nf-i: var(--nf-i-bag); }
html[data-look] i.fa-boxes-stacked { --nf-i: var(--nf-i-box); }
html[data-look] i.fa-brain { --nf-i: var(--nf-i-spark); }
html[data-look] i.fa-building { --nf-i: var(--nf-i-building); }
html[data-look] i.fa-building-columns { --nf-i: var(--nf-i-bank); }
html[data-look] i.fa-calculator { --nf-i: var(--nf-i-calc); }
html[data-look] i.fa-calendar { --nf-i: var(--nf-i-calendar); }
html[data-look] i.fa-calendar-alt { --nf-i: var(--nf-i-calendar); }
html[data-look] i.fa-calendar-check { --nf-i: var(--nf-i-calendar); }
html[data-look] i.fa-calendar-day { --nf-i: var(--nf-i-calendar); }
html[data-look] i.fa-calendar-days { --nf-i: var(--nf-i-calendar); }
html[data-look] i.fa-calendar-plus { --nf-i: var(--nf-i-calendar); }
html[data-look] i.fa-cart-plus { --nf-i: var(--nf-i-cart); }
html[data-look] i.fa-cart-shopping { --nf-i: var(--nf-i-cart); }
html[data-look] i.fa-cash-register { --nf-i: var(--nf-i-cash); }
html[data-look] i.fa-chart-area { --nf-i: var(--nf-i-chart); }
html[data-look] i.fa-chart-bar { --nf-i: var(--nf-i-chart); }
html[data-look] i.fa-chart-line { --nf-i: var(--nf-i-chart); }
html[data-look] i.fa-chart-pie { --nf-i: var(--nf-i-pie); }
html[data-look] i.fa-check { --nf-i: var(--nf-i-check); }
html[data-look] i.fa-check-circle { --nf-i: var(--nf-i-checkc); }
html[data-look] i.fa-chevron-down { --nf-i: var(--nf-i-down); }
html[data-look] i.fa-chevron-left { --nf-i: var(--nf-i-left); }
html[data-look] i.fa-chevron-right { --nf-i: var(--nf-i-right); }
html[data-look] i.fa-circle-check { --nf-i: var(--nf-i-checkc); }
html[data-look] i.fa-circle-info { --nf-i: var(--nf-i-info); }
html[data-look] i.fa-circle-plus { --nf-i: var(--nf-i-pluscircle); }
html[data-look] i.fa-circle-question { --nf-i: var(--nf-i-help); }
html[data-look] i.fa-circle-user { --nf-i: var(--nf-i-contact); }
html[data-look] i.fa-circle-xmark { --nf-i: var(--nf-i-xcircle); }
html[data-look] i.fa-cog { --nf-i: var(--nf-i-gear); }
html[data-look] i.fa-coins { --nf-i: var(--nf-i-coins); }
html[data-look] i.fa-credit-card { --nf-i: var(--nf-i-card); }
html[data-look] i.fa-credit-card-alt { --nf-i: var(--nf-i-card); }
html[data-look] i.fa-draw-polygon { --nf-i: var(--nf-i-polygon); }
html[data-look] i.fa-earth-africa { --nf-i: var(--nf-i-globe); }
html[data-look] i.fa-edit { --nf-i: var(--nf-i-edit); }
html[data-look] i.fa-exclamation-triangle { --nf-i: var(--nf-i-alert); }
html[data-look] i.fa-eye { --nf-i: var(--nf-i-eye); }
html[data-look] i.fa-file-alt { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-file-contract { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-file-csv { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-file-excel { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-file-export { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-file-invoice-dollar { --nf-i: var(--nf-i-receipt); }
html[data-look] i.fa-file-lines { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-file-pdf { --nf-i: var(--nf-i-file); }
html[data-look] i.fa-filter { --nf-i: var(--nf-i-filter); }
html[data-look] i.fa-flag-checkered { --nf-i: var(--nf-i-flag); }
html[data-look] i.fa-flask { --nf-i: var(--nf-i-flask); }
html[data-look] i.fa-floppy-disk { --nf-i: var(--nf-i-save); }
html[data-look] i.fa-gear { --nf-i: var(--nf-i-gear); }
html[data-look] i.fa-globe { --nf-i: var(--nf-i-globe); }
html[data-look] i.fa-hand-holding-dollar { --nf-i: var(--nf-i-handcoins); }
html[data-look] i.fa-hand-holding-usd { --nf-i: var(--nf-i-handcoins); }
html[data-look] i.fa-handshake { --nf-i: var(--nf-i-handshake); }
html[data-look] i.fa-handshake-angle { --nf-i: var(--nf-i-handshake); }
html[data-look] i.fa-hashtag { --nf-i: var(--nf-i-hash); }
html[data-look] i.fa-home { --nf-i: var(--nf-i-home); }
html[data-look] i.fa-hourglass-half { --nf-i: var(--nf-i-hourglass); }
html[data-look] i.fa-house { --nf-i: var(--nf-i-home); }
html[data-look] i.fa-id-badge { --nf-i: var(--nf-i-idcard); }
html[data-look] i.fa-id-card { --nf-i: var(--nf-i-idcard); }
html[data-look] i.fa-inbox { --nf-i: var(--nf-i-inbox); }
html[data-look] i.fa-info-circle { --nf-i: var(--nf-i-info); }
html[data-look] i.fa-layer-group { --nf-i: var(--nf-i-layers); }
html[data-look] i.fa-leaf { --nf-i: var(--nf-i-leaf); }
html[data-look] i.fa-lightbulb { --nf-i: var(--nf-i-bulb); }
html[data-look] i.fa-list { --nf-i: var(--nf-i-list); }
html[data-look] i.fa-list-ol { --nf-i: var(--nf-i-list); }
html[data-look] i.fa-list-ul { --nf-i: var(--nf-i-list); }
html[data-look] i.fa-location-crosshairs { --nf-i: var(--nf-i-locate); }
html[data-look] i.fa-location-dot { --nf-i: var(--nf-i-pin); }
html[data-look] i.fa-lock { --nf-i: var(--nf-i-lock); }
html[data-look] i.fa-magnifying-glass { --nf-i: var(--nf-i-search); }
html[data-look] i.fa-map-location-dot { --nf-i: var(--nf-i-map); }
html[data-look] i.fa-map-marker-alt { --nf-i: var(--nf-i-pin); }
html[data-look] i.fa-money-bill-transfer { --nf-i: var(--nf-i-transfer); }
html[data-look] i.fa-money-bill-wave { --nf-i: var(--nf-i-cash); }
html[data-look] i.fa-moon { --nf-i: var(--nf-i-moon); }
html[data-look] i.fa-palette { --nf-i: var(--nf-i-panel); }
html[data-look] i.fa-paper-plane { --nf-i: var(--nf-i-send); }
html[data-look] i.fa-paperclip { --nf-i: var(--nf-i-clip); }
html[data-look] i.fa-pen { --nf-i: var(--nf-i-pen); }
html[data-look] i.fa-pen-to-square { --nf-i: var(--nf-i-edit); }
html[data-look] i.fa-people-group { --nf-i: var(--nf-i-users); }
html[data-look] i.fa-percent { --nf-i: var(--nf-i-percent); }
html[data-look] i.fa-person-walking { --nf-i: var(--nf-i-walk); }
html[data-look] i.fa-phone { --nf-i: var(--nf-i-phone); }
html[data-look] i.fa-plus { --nf-i: var(--nf-i-plus); }
html[data-look] i.fa-plus-circle { --nf-i: var(--nf-i-pluscircle); }
html[data-look] i.fa-print { --nf-i: var(--nf-i-print); }
html[data-look] i.fa-question-circle { --nf-i: var(--nf-i-help); }
html[data-look] i.fa-ranking-star { --nf-i: var(--nf-i-trophy); }
html[data-look] i.fa-receipt { --nf-i: var(--nf-i-receipt); }
html[data-look] i.fa-right-left { --nf-i: var(--nf-i-swap); }
html[data-look] i.fa-rotate { --nf-i: var(--nf-i-refresh); }
html[data-look] i.fa-save { --nf-i: var(--nf-i-save); }
html[data-look] i.fa-scale-balanced { --nf-i: var(--nf-i-scale); }
html[data-look] i.fa-screwdriver-wrench { --nf-i: var(--nf-i-wrench); }
html[data-look] i.fa-scroll { --nf-i: var(--nf-i-scroll); }
html[data-look] i.fa-search { --nf-i: var(--nf-i-search); }
html[data-look] i.fa-seedling { --nf-i: var(--nf-i-leaf); }
html[data-look] i.fa-shield-halved { --nf-i: var(--nf-i-shield); }
html[data-look] i.fa-sign-in-alt { --nf-i: var(--nf-i-logout); }
html[data-look] i.fa-sign-out-alt { --nf-i: var(--nf-i-logout); }
html[data-look] i.fa-star { --nf-i: var(--nf-i-star); }
html[data-look] i.fa-sticky-note { --nf-i: var(--nf-i-note); }
html[data-look] i.fa-sun { --nf-i: var(--nf-i-sun); }
html[data-look] i.fa-sync { --nf-i: var(--nf-i-refresh); }
html[data-look] i.fa-sync-alt { --nf-i: var(--nf-i-refresh); }
html[data-look] i.fa-table { --nf-i: var(--nf-i-table); }
html[data-look] i.fa-tag { --nf-i: var(--nf-i-tag); }
html[data-look] i.fa-tags { --nf-i: var(--nf-i-tag); }
html[data-look] i.fa-times { --nf-i: var(--nf-i-x); }
html[data-look] i.fa-times-circle { --nf-i: var(--nf-i-xcircle); }
html[data-look] i.fa-trash { --nf-i: var(--nf-i-trash); }
html[data-look] i.fa-triangle-exclamation { --nf-i: var(--nf-i-alert); }
html[data-look] i.fa-truck { --nf-i: var(--nf-i-truck); }
html[data-look] i.fa-truck-fast { --nf-i: var(--nf-i-truck); }
html[data-look] i.fa-truck-field { --nf-i: var(--nf-i-truck); }
html[data-look] i.fa-truck-moving { --nf-i: var(--nf-i-bus); }
html[data-look] i.fa-upload { --nf-i: var(--nf-i-upload); }
html[data-look] i.fa-user { --nf-i: var(--nf-i-contact); }
html[data-look] i.fa-user-circle { --nf-i: var(--nf-i-contact); }
html[data-look] i.fa-user-plus { --nf-i: var(--nf-i-useradd); }
html[data-look] i.fa-users { --nf-i: var(--nf-i-users); }
html[data-look] i.fa-vault { --nf-i: var(--nf-i-vault); }
html[data-look] i.fa-wallet { --nf-i: var(--nf-i-wallet); }
html[data-look] i.fa-warehouse { --nf-i: var(--nf-i-warehouse); }
html[data-look] i.fa-weight-hanging { --nf-i: var(--nf-i-scale); }
html[data-look] i.fa-xmark { --nf-i: var(--nf-i-x); }
html[data-look] .sidebar a[href^="dashboard.php"] > i { --nf-i: var(--nf-i-dash); }
html[data-look] .sidebar a[href^="purchases.php"] > i { --nf-i: var(--nf-i-cart); }
html[data-look] .sidebar a[href^="deliveries.php"] > i { --nf-i: var(--nf-i-truck); }
html[data-look] .sidebar a[href^="sales.php"] > i { --nf-i: var(--nf-i-receipt); }
html[data-look] .sidebar a[href^="payments.php"] > i { --nf-i: var(--nf-i-wallet); }
html[data-look] .sidebar a[href^="suppliers.php"] > i { --nf-i: var(--nf-i-users); }
html[data-look] .sidebar a[href^="customers.php"] > i { --nf-i: var(--nf-i-contact); }
html[data-look] .sidebar a[href^="pricing.php"] > i { --nf-i: var(--nf-i-tag); }
html[data-look] .sidebar a[href^="banks.php"] > i { --nf-i: var(--nf-i-bank); }
html[data-look] .sidebar a[href^="supplier-ranking.php"] > i { --nf-i: var(--nf-i-trophy); }
html[data-look] .sidebar a[href^="financing.php"] > i { --nf-i: var(--nf-i-coins); }
html[data-look] .sidebar a[href^="expenses.php"] > i { --nf-i: var(--nf-i-card); }
html[data-look] .sidebar a[href^="petty-cash.php"] > i { --nf-i: var(--nf-i-cash); }
html[data-look] .sidebar a[href^="ai-reports.php"] > i { --nf-i: var(--nf-i-spark); }
html[data-look] .sidebar a[href^="inventory.php"] > i { --nf-i: var(--nf-i-box); }
html[data-look] .sidebar a[href^="fleet.php"] > i { --nf-i: var(--nf-i-bus); }
html[data-look] .sidebar a[href^="bags-log.php"] > i { --nf-i: var(--nf-i-bag); }
html[data-look] .sidebar a[href^="settings.php"] > i { --nf-i: var(--nf-i-gear); }
html[data-look] .sidebar a[href^="money-swaps.php"] > i { --nf-i: var(--nf-i-swap); }
html[data-look] .sidebar a[href^="contacts.php"] > i { --nf-i: var(--nf-i-book); }
html[data-look] .sidebar a.submenu-toggle > i:first-child { --nf-i: var(--nf-i-chart); }
/* ===================== END OUTLINE ICONS ===================== */

/* Inventory: the wholesale (En gros) tag, square and tan like the field colour (DESIGN.md §19, 2026-11-05). */
html[data-look] .lot-card-tag {
    border-radius: 0;
    background: var(--g-tan-t);
    color: var(--ink);
    border: 1px solid var(--field);
    font-family: var(--font);
}

/* ===================== Read-only company (subscription ended, DESIGN.md §19) ===================== */
html[data-look] body .billing-banner { border-radius: 0; background: var(--warn-tint); color: var(--ink); border: 1px solid var(--warn);
    font-size: 15px; padding: 12px 16px; }
html[data-look] body .billing-banner i { color: var(--warn); }
html[data-look] body .billing-banner--grace { background: var(--negative-tint); border-color: var(--negative); }
html[data-look] body .billing-banner--grace i { color: var(--negative); }
html[data-look] body .billing-banner a { color: var(--accent); font-weight: 600; }
html[data-look] body .billing-banner .billing-banner-action { padding: 0 16px; border: 1px solid var(--accent); background: var(--surface);
    text-decoration: none; }
html[data-look] body .billing-banner .billing-banner-action:hover { background: var(--accent-tint); }


/* My devices (account.php, remember-lib.php): one row per phone or computer that stays signed in. */
html[data-look] body.adm-page .dev-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--cw-border); }
html[data-look] body.adm-page .dev-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--cw-border); }
html[data-look] body.adm-page .dev-icon { flex: none; width: 24px; text-align: center; font-size: 20px; color: var(--cw-text-secondary); }
html[data-look] body.adm-page .dev-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html[data-look] body.adm-page .dev-name { font-weight: 600; color: var(--cw-text-primary); overflow-wrap: anywhere; }
html[data-look] body.adm-page .dev-this { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--cw-border); font-size: 12px; font-weight: 600; color: var(--cw-text-secondary); }
html[data-look] body.adm-page .dev-meta { font-size: 13px; color: var(--cw-text-muted); }
html[data-look] body.adm-page .dev-btn { flex: none; min-height: 44px; text-decoration: none; }
@media (max-width: 480px) {
    html[data-look] body.adm-page .dev-row { flex-wrap: wrap; }
    html[data-look] body.adm-page .dev-btn { width: 100%; justify-content: center; }
}
html[data-look] body.adm-page .adm-note[hidden] { display: none; }

/* ===================== DASHBOARD CHARTS (Thino's picks, 2026-11-16; DESIGN.md §19) =====================
   Profit or loss by month, the purchase price with its range and the farm gate price, the expenses ring, and the
   small charts inside three KPI cards (advance coverage gauge, stock bought to goal, gross margin line).
   Drawn by dashboard-charts.js. Flat fills, square ends, colours from the tokens. */
html[data-look] {
    --dc-ring-1: #C8A97E; --dc-ring-2: #A57E46; --dc-ring-3: #E6D5B8; --dc-ring-4: #7F6A5B;
}
html[data-look="dark"] {
    --dc-ring-1: #C8A97E; --dc-ring-2: #8C6A3C; --dc-ring-3: #5C4A33; --dc-ring-4: #A8937F;
}
html[data-look] body.page-dashboard .dc-card { display: flex; flex-direction: column; min-width: 0; }
html[data-look] body.page-dashboard .dc-plot { position: relative; }
html[data-look] body.page-dashboard .dc-plot[hidden] { display: none; }
html[data-look] body.page-dashboard .dc-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 10px 0 2px; min-height: 34px; }
html[data-look] body.page-dashboard .dc-big b { font-size: 28px; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; }
html[data-look] body.page-dashboard .dc-big span { font-size: 13px; color: var(--ink-2); }
html[data-look] body.page-dashboard .dc-good { color: var(--positive); }
html[data-look] body.page-dashboard .dc-bad { color: var(--negative); }
html[data-look] body.page-dashboard .dc-empty { margin: 24px 0; font-size: 14px; color: var(--ink-2); text-align: center; }
html[data-look] body.page-dashboard .dc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
html[data-look] body.page-dashboard .dc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
html[data-look] body.page-dashboard .dc-legend [hidden] { display: none; }
html[data-look] body.page-dashboard .dc-sw { display: inline-block; width: 12px; height: 12px; flex: none; }
html[data-look] body.page-dashboard .dc-sw-good { background: var(--positive); }
html[data-look] body.page-dashboard .dc-sw-bad { background: var(--negative); }
html[data-look] body.page-dashboard .dc-sw-band { background: var(--accent-tint); }
html[data-look] body.page-dashboard .dc-sw-line { width: 16px; height: 0; border-top: 2px solid var(--accent); }
html[data-look] body.page-dashboard .dc-sw-dash { width: 16px; height: 0; border-top: 2px dashed var(--field); }
html[data-look] body.page-dashboard .dc-row-exp { margin-bottom: 12px; }
html[data-look] body.page-dashboard .dc-ring-box { display: flex; align-items: center; gap: 32px; }
html[data-look] body.page-dashboard .dc-ring { width: 170px; height: 170px; flex: none; }
html[data-look] body.page-dashboard .dc-ring-l { font: 500 13px var(--font); fill: var(--ink-2); }
html[data-look] body.page-dashboard .dc-ring-v { font: 500 17px var(--font); fill: var(--ink); }
html[data-look] body.page-dashboard .dc-ring-list { flex: 1; min-width: 0; max-width: 560px; }
html[data-look] body.page-dashboard .dc-ring-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: center;
    padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
html[data-look] body.page-dashboard .dc-ring-row:first-child { border-top: 0; }
html[data-look] body.page-dashboard .dc-ring-row b { font-weight: 500; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
html[data-look] body.page-dashboard .dc-ring-name { min-width: 0; overflow-wrap: anywhere; }
html[data-look] body.page-dashboard .dc-ring-name small { display: block; font-size: 12px; color: var(--ink-3); }
html[data-look] body.page-dashboard .dc-ring-total { border-top: 1px solid var(--ink); font-weight: 500; }
/* the small charts inside the KPI cards */
html[data-look] body.page-dashboard .kpi-mini { margin-top: 12px; }
html[data-look] body.page-dashboard .kpi-mini-cap { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--ink-3); }
html[data-look] body.page-dashboard .kpi-gauge { position: relative; display: flex; height: 14px; }
html[data-look] body.page-dashboard .kpi-gauge-z1 { background: var(--negative-tint); }
html[data-look] body.page-dashboard .kpi-gauge-z2 { background: var(--warning-tint); }
html[data-look] body.page-dashboard .kpi-gauge-z3 { background: var(--positive-tint); }
html[data-look] body.page-dashboard .kpi-gauge-val { position: absolute; left: 0; top: 4px; height: 6px; background: var(--ink); }
html[data-look] body.page-dashboard .kpi-gauge-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
html[data-look] body.page-dashboard .kpi-goal { position: relative; height: 10px; background: var(--surface-sunken); border: 1px solid var(--line); }
html[data-look] body.page-dashboard .kpi-goal i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--g, #557552); }
html[data-look] body.page-dashboard .kpi-spark { position: relative; height: 38px; }
html[data-look] body.page-dashboard .kpi-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
html[data-look] body.page-dashboard .kpi-spark path { stroke: var(--g, #557552); stroke-width: 2; }
html[data-look] body.page-dashboard .kpi-spark-dot { position: absolute; width: 7px; height: 7px; transform: translate(-50%, -50%); background: var(--g, #557552); }
html[data-look="dark"] body.page-dashboard .kpi-goal i,
html[data-look="dark"] body.page-dashboard .kpi-spark-dot { background: var(--g, #A6C3A1); }
html[data-look="dark"] body.page-dashboard .kpi-spark path { stroke: var(--g, #A6C3A1); }
@media (max-width: 699px) {
    html[data-look] body.page-dashboard .dc-big b { font-size: 24px; }
    html[data-look] body.page-dashboard .dc-ring-box { flex-direction: column; align-items: stretch; gap: 16px; }
    html[data-look] body.page-dashboard .dc-ring { margin: 0 auto; }
}

/* ==========================================================================
   Guided tour for new people (tour.js, tour-lib.php). Tan marks the guide, blue only what you press, square corners,
   no shadows. The dim is four plain sheets around the lit button, so the button itself stays tappable.
   ========================================================================== */
html[data-look] button.user-menu-item { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
html[data-look] .nft { font-family: var(--font, 'Barlow', Arial, sans-serif); color: var(--ink, #4A2E1F); font-size: 16px; line-height: 1.4; }
html[data-look] .nft *, html[data-look] .nft *::before, html[data-look] .nft *::after { box-sizing: border-box; border-radius: 0; }
html[data-look] .nft-ic { display: block; flex: none; }
html[data-look] .nft-dim { position: fixed; z-index: 10000; background: rgba(24, 14, 8, 0.62); }
html[data-look] .nft-dim-all { inset: 0; }
html[data-look] .nft-ring { position: fixed; z-index: 10001; pointer-events: none; outline: 3px solid var(--field, #C8A97E); }
html[data-look] .nft-card { position: fixed; z-index: 10002; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--line, #E2D6C2);
    border-top: 4px solid var(--field, #C8A97E); padding: 16px 20px 12px; color: var(--ink, #4A2E1F); }
html[data-look] .nft-card.is-free { padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
html[data-look] .nft-arrow { position: fixed; z-index: 10003; width: 0; height: 0; border: 10px solid transparent; pointer-events: none; }
html[data-look] .nft-arrow.is-up { border-bottom-color: var(--field, #C8A97E); }
html[data-look] .nft-arrow.is-down { border-top-color: var(--surface, #fff); }
html[data-look] .nft-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -10px 4px 0; min-height: 44px; }
html[data-look] .nft-step { font-size: 13px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-2, #6E584A); }
html[data-look] .nft-head { display: flex; gap: 14px; align-items: center; }
html[data-look] .nft-tile { width: 52px; height: 52px; flex: none; display: grid; place-items: center; background: var(--g-tan-t, #F7F0E4); border: 1px solid var(--line, #E2D6C2); color: var(--ink, #4A2E1F); }
html[data-look] .nft .nft-title { margin: 0; font-family: var(--font-title, 'Barlow Condensed', 'Arial Narrow', sans-serif); font-weight: 700; font-size: 26px; line-height: 1.02;
    text-transform: uppercase; color: var(--ink, #4A2E1F); letter-spacing: .2px; }
html[data-look] .nft-card.is-welcome .nft-title { font-size: 34px; }
html[data-look] .nft .nft-text { margin: 8px 0 14px; font-size: 16px; color: var(--ink-2, #6E584A); }
html[data-look] .nft-card.is-welcome .nft-text { font-size: 18px; color: var(--ink, #4A2E1F); }
html[data-look] .nft-video { margin: 0 0 14px; }
html[data-look] .nft-video-btn { display: flex; width: 100%; gap: 12px; align-items: center; padding: 8px; min-height: 64px; text-align: left; cursor: pointer;
    border: 1px solid var(--line, #E2D6C2); background: var(--surface-sunken, #FAF6EE); color: var(--ink, #4A2E1F); font: inherit; }
html[data-look] .nft-video-btn:hover { border-color: var(--line-strong, #B9A68C); }
html[data-look] .nft-thumb { display: block; position: relative; flex: none; width: 96px; height: 54px; background: #140C08; overflow: hidden; }
html[data-look] .nft-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
html[data-look] .nft-thumb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; display: grid; place-items: center; background: #4A2E1F; color: #F4EDE0; }
html[data-look] .nft-thumb-len { position: absolute; right: 0; bottom: 0; background: #4A2E1F; color: #F4EDE0; font-size: 12px; font-weight: 600; padding: 1px 6px; }
html[data-look] .nft-video-words b { display: block; font-weight: 600; font-size: 16px; }
html[data-look] .nft-video-words small { color: var(--ink-2, #6E584A); font-size: 14px; }
html[data-look] .nft-video-big .nft-video-btn { padding: 0; border: 0; background: none; display: block; }
html[data-look] .nft-video-big .nft-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; max-width: 100%; border: 1px solid var(--line, #E2D6C2); }
html[data-look] .nft-video-big .nft-thumb-play { width: 64px; height: 64px; left: auto; top: auto; right: 12px; bottom: 12px; transform: none; }
html[data-look] .nft-video-big .nft-thumb-len { left: 0; right: auto; font-size: 14px; padding: 3px 8px; }
html[data-look] .nft-video-off { display: flex; gap: 10px; align-items: center; padding: 10px 12px; font-size: 15px; background: var(--warn-tint, #F8ECD6); border-left: 4px solid var(--warn, #8A5A0F); color: var(--ink, #4A2E1F); }
html[data-look] .nft-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
html[data-look] .nft-btn { height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap;
    font: 600 16px var(--font, 'Barlow', Arial, sans-serif); border: 1px solid var(--line-strong, #B9A68C); background: var(--surface, #fff); color: var(--ink, #4A2E1F); }
html[data-look] .nft-btn:hover { background: var(--surface-sunken, #FAF6EE); }
html[data-look] .nft-btn.nft-pri { background: var(--accent, #2F5D8C); border-color: var(--accent, #2F5D8C); color: var(--accent-ink, #fff); }
html[data-look] .nft-btn.nft-pri:hover { background: var(--accent-hover, #244A70); border-color: var(--accent-hover, #244A70); }
html[data-look="dark"] .nft-btn.nft-pri, html[data-look="dark"] .nft-btn.nft-pri * { color: #1E140E !important; }
html[data-look] .nft-btn.nft-sq { width: 48px; padding: 0; }
html[data-look] .nft-btn.nft-grow { flex: 1 1 160px; }
html[data-look] .nft-card.is-welcome .nft-btn { height: 56px; font-size: 18px; }
html[data-look] .nft-card.is-welcome .nft-btn.nft-sq { width: 56px; }
html[data-look] .nft-btn:focus-visible, html[data-look] .nft-video-btn:focus-visible, html[data-look] .nft-link:focus-visible, html[data-look] .nft-x:focus-visible { outline: 3px solid var(--field, #C8A97E); outline-offset: 2px; }
html[data-look] .nft-x { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--ink-2, #6E584A); cursor: pointer; padding: 0; }
html[data-look] .nft-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; margin-top: 4px; }
html[data-look] .nft-dots { display: flex; gap: 6px; align-items: center; }
html[data-look] .nft-dots i { width: 8px; height: 8px; background: var(--line-strong, #B9A68C); }
html[data-look] .nft-dots i.past { background: var(--ink-2, #6E584A); }
html[data-look] .nft-dots i.on { width: 20px; background: var(--ink, #4A2E1F); }
html[data-look] .nft-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer;
    font: 500 15px var(--font, 'Barlow', Arial, sans-serif); color: var(--ink-2, #6E584A); text-decoration: underline; text-underline-offset: 3px; }
html[data-look] .nft-hint { font-size: 14px; color: var(--ink-2, #6E584A); }
/* "Continue the tour": a small tab after the person paused it, above the phone's bottom bar and under any open form. */
html[data-look] .nft-pill { position: fixed; z-index: 1000; right: 24px; bottom: 24px; display: flex; align-items: stretch; background: var(--surface, #fff);
    border: 1px solid var(--line-strong, #B9A68C); border-left: 4px solid var(--field, #C8A97E); }
html[data-look] .nft-pill .nft-btn { border: 0; height: 52px; }
html[data-look] .nft-pill .nft-pill-x { width: 48px; padding: 0; border-left: 1px solid var(--line, #E2D6C2); color: var(--ink-2, #6E584A); }
@media (max-width: 768px) {
    html[data-look] .nft-pill { left: 12px; right: auto; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
    html[data-look] .nft-card { border-left-width: 1px; }
    html[data-look] .nft-card.is-free { border-left: 0; border-right: 0; }
    html[data-look] .nft-card.is-welcome .nft-title { font-size: 30px; }
}
/* The video window */
html[data-look] .nft-player-wrap { position: fixed; inset: 0; z-index: 10010; background: rgba(10, 6, 4, 0.86); display: grid; place-items: center; padding: 16px; }
html[data-look] .nft-player { width: min(1040px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #140C08; color: #F4EDE0; border: 1px solid #3E2E22; }
html[data-look] .nft-player-bar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; }
html[data-look] .nft-player-who { flex: 1; min-width: 0; }
html[data-look] .nft-player-who b { display: block; font-size: 17px; font-weight: 600; }
html[data-look] .nft-player-who small { color: #C9B8A6; font-size: 14px; }
html[data-look] .nft .nft-x-dark { color: #F4EDE0; }
html[data-look] .nft-player-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 170px); background: #000; }
html[data-look] .nft-player-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
html[data-look] .nft-player-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid #3E2E22; }
html[data-look] .nft .nft-link-dark { color: #F4EDE0; }
html[data-look] .nft-player .nft-btn.nft-pri { background: #9DBEE2; border-color: #9DBEE2; color: #140C08; }
html[data-look] .nft-player-wrap.is-phone { padding: 0; }
html[data-look] .nft-player-wrap.is-phone .nft-player { width: 100%; height: 100%; border: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
html[data-look] .nft-player-wrap.is-phone .nft-player-screen { flex: 1; aspect-ratio: auto; max-height: none; }
@media (prefers-reduced-motion: no-preference) {
    html[data-look] .nft-card { animation: nft-in .16s ease-out; }
    @keyframes nft-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
