* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #3b82f6;
    --content-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #2563eb;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --topbar-h: 56px;
    --bottomnav-h: 62px;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

button, a, .btn, .filter-btn, .quick-action, .nav-group-header, .menu-toggle {
    touch-action: manipulation;
}

.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 268px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 200;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-close {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-logo {
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    border-bottom: none;
    letter-spacing: -0.02em;
}

.sidebar-logo span {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    margin-left: 268px;
    flex: 1 1 auto;
    padding: 24px 28px;
    min-width: 0;
    width: calc(100% - 268px);
    max-width: none;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Full-width scroll container for data tables */
.table-scroll,
.history-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    margin: 0;
}

/* Edge-to-edge tables inside cards (desktop) — except smart tables */
.card > .table-scroll:not(.smart-table-wrap),
.card > .history-table-wrap:not(.smart-table-wrap) {
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
    max-width: calc(100% + 48px);
}

.card > .table-scroll:first-child:not(.smart-table-wrap),
.card > .history-table-wrap:first-child:not(.smart-table-wrap) {
    margin-top: -8px;
}

/* Tables fill available width on desktop */
.table-scroll .data-table,
.history-table-wrap .data-table,
.card > table.data-table,
.main-content > table.data-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
    box-shadow: none;
    margin-bottom: 0;
}

.card:has(> table.data-table),
.main-content:has(> table.data-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-logo-link {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.sidebar-logo-img {
    max-width: 168px;
    width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    background: transparent;
}

.mobile-topbar-brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    min-width: 0;
}

.mobile-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.sidebar-section {
    padding: 16px 12px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    font-weight: 600;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d1d5db;
    text-decoration: none;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-menu a.active {
    background: var(--sidebar-active);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    min-width: 0;
    max-width: 100%;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--info);
}

.kpi-card.success { border-left-color: var(--success); }
.kpi-card.warning { border-left-color: var(--warning); }
.kpi-card.danger { border-left-color: var(--danger); }

.kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: -0.02em;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-primary { background: var(--accent-gradient); color: white; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: #e5e7eb; color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table-scroll .data-table,
.history-table-wrap .data-table,
.card > table.data-table,
.main-content > table.data-table {
    box-shadow: none;
    border-radius: 0;
}

.data-table th {
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tr:hover td {
    background: #f9fafb;
}

.data-table tr.row-low-stock td {
    background: #fff7ed;
}

.data-table tr.row-low-stock td:first-child {
    border-left: 3px solid var(--warning);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-container {
    position: relative;
    height: 300px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    min-width: 0;
}

.grid-2 > * {
    min-width: 0;
}

.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.action-links a {
    color: var(--info);
    text-decoration: none;
    margin-right: 8px;
    font-size: 13px;
}

.action-links a:hover { text-decoration: underline; }

.score-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto;
    border: 8px solid;
}

.notification-item {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-item-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.notification-item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.notification-item-body { flex: 1; min-width: 0; }

.notif-sev-critical, .notif-sev-error { border-left: 3px solid #dc2626; }
.notif-sev-warning { border-left: 3px solid #f59e0b; }
.notif-sev-success { border-left: 3px solid #16a34a; }
.notif-sev-info { border-left: 3px solid #2563eb; }

.badge-notif-success { background: #dcfce7; color: #166534; }
.badge-notif-info { background: #dbeafe; color: #1e40af; }
.badge-notif-warning { background: #fef3c7; color: #92400e; }
.badge-notif-critical, .badge-notif-error { background: #fee2e2; color: #991b1b; }

.app-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.app-topbar-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.app-topbar-link:hover { color: var(--primary); }

.notify-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.notify-bell-btn:hover { border-color: var(--primary); }

.notify-bell-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.notify-critical-pill {
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
}

.mobile-topbar-notify { margin-left: auto; margin-right: 8px; }

.mobile-topbar-notify .notify-bell-btn {
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

.notify-panel {
    position: fixed;
    top: 72px;
    right: 16px;
    width: min(380px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 1200;
    overflow: hidden;
}

.notify-panel-head, .notify-panel-foot {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notify-panel-foot { border-bottom: 0; border-top: 1px solid var(--border); }

.notify-panel-body {
    max-height: 360px;
    overflow-y: auto;
}

.notify-panel-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.notify-panel-item:hover { background: #f8fafc; }

.notify-panel-empty, .notify-panel-loading { padding: 20px 14px; text-align: center; }

.btn-block { display: block; width: 100%; text-align: center; }

@media (max-width: 768px) {
    .app-topbar { display: none; }
    .notify-panel { top: 56px; right: 8px; }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827 0%, #1e3a5f 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
}

.login-back {
    display: inline-block;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 16px;
}
.login-back:hover { color: var(--info); }

.login-box p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .login-box {
        padding: 28px 20px;
        margin: 16px;
        border-radius: 12px;
    }
}

/* ========== Mobile & tablet responsive ========== */

.mobile-topbar,
.mobile-bottom-nav {
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 180;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Tablet & phone */
@media (max-width: 1024px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--topbar-h);
        padding: 0 12px;
        padding-top: env(safe-area-inset-top, 0);
        background: var(--sidebar-bg);
        color: white;
        z-index: 220;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        font-size: 22px;
        cursor: pointer;
        flex-shrink: 0;
        line-height: 1;
    }

    .menu-toggle:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .mobile-topbar-title {
        flex: 1;
        font-size: 17px;
        font-weight: 700;
        letter-spacing: -0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-topbar-title span {
        background: linear-gradient(135deg, #60a5fa, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .mobile-topbar-action {
        min-width: 44px;
        height: 38px;
        padding: 0 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--accent-gradient);
        color: white;
        text-decoration: none;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 600;
        flex-shrink: 0;
    }

    .sidebar {
        width: min(320px, 92vw);
        z-index: 210;
        transform: translateX(-110%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
        top: 0;
        padding-top: env(safe-area-inset-top, 0);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-search {
        flex-shrink: 0;
    }

    .sidebar-menu {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: auto;
        min-height: 0;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }

    body.menu-open {
        overflow: hidden;
    }

    .main-content {
        margin-left: 0;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        padding: 14px 14px calc(var(--bottomnav-h) + 20px + env(safe-area-inset-bottom, 0));
        padding-top: calc(var(--topbar-h) + 14px + env(safe-area-inset-top, 0));
    }

    /* App shell only — marketing/landing pages must scroll normally */
    html:has(.layout) {
        height: 100%;
    }

    body:has(.layout) {
        height: 100%;
        overflow: hidden;
    }

    .layout {
        flex-direction: column;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        min-height: 0;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0));
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
        z-index: 215;
        box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.1);
        transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    .mobile-bottom-nav.nav-hidden {
        transform: translateY(100%);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 9px;
        font-weight: 600;
        border: none;
        background: transparent;
        cursor: pointer;
        min-height: var(--bottomnav-h);
        font-family: inherit;
        padding: 4px 2px;
    }

    .bottom-nav-item.active {
        color: var(--info);
    }

    .bottom-nav-icon {
        font-size: 17px;
        line-height: 1;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }

    .page-header h1 {
        font-size: 21px;
    }

    .page-header .btn {
        min-height: 44px;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .table-scroll .data-table,
    .history-table-wrap .data-table {
        font-size: 13px;
    }

    .table-scroll .data-table th,
    .table-scroll .data-table td,
    .history-table-wrap .data-table th,
    .history-table-wrap .data-table td {
        padding: 10px 12px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kpi-value {
        font-size: 20px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 220px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .doc-layout {
        grid-template-columns: 1fr;
    }

    .doc-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-row input,
    .filter-row select,
    .filter-row .btn {
        width: 100%;
    }

    .bom-row {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        gap: 8px;
        margin-bottom: 14px;
    }

    .quick-action {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        padding: 8px 10px;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
        padding: 8px 12px;
    }

    .nav-group-header {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 12px;
    }

    .sidebar-menu a {
        min-height: 44px;
        padding: 12px 16px;
        margin: 2px 10px;
    }

    .lightbox {
        padding: 16px;
        padding-top: calc(16px + env(safe-area-inset-top, 0));
        z-index: 9999;
    }

    .lightbox-close {
        top: calc(12px + env(safe-area-inset-top, 0));
        right: 16px;
        font-size: 36px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Phone */
@media (max-width: 480px) {
    .main-content {
        padding: 12px 12px calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom, 0));
        padding-top: calc(var(--topbar-h) + 12px + env(safe-area-inset-top, 0));
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-card,
    .dash-card {
        padding: 12px;
    }

    .kpi-value,
    .dash-card .val {
        font-size: 18px;
    }

    .page-header h1 {
        font-size: 19px;
    }

    .filter-bar {
        gap: 6px;
    }

    .filter-btn {
        flex: 1 1 calc(33.333% - 6px);
        text-align: center;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        padding: 6px 8px;
    }

    .quick-action {
        flex: 1 1 calc(50% - 6px);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .score-ring {
        width: 110px;
        height: 110px;
        font-size: 26px;
    }

    .bottom-nav-item span:last-child {
        font-size: 9px;
    }
}

.sidebar-search { padding: 0 12px 12px; }
.sidebar-search-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #374151;
    background: #1f2937;
    color: white;
    font-size: 13px;
}
.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: auto;
}
.sidebar-menu { overflow-y: auto; flex: 1; min-height: 0; }
.sidebar-menu a { display: flex; align-items: center; }
.sidebar-logout { color: #f87171 !important; margin-top: 8px; }

.nav-group { border-bottom: 1px solid #1f2937; }
.nav-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
    text-align: left;
}
.nav-group-header:hover { color: #fff; }
.nav-arrow { transition: transform 0.2s; font-size: 10px; }
.nav-group.open .nav-arrow { transform: rotate(180deg); }
.nav-group-links { display: none; padding-bottom: 6px; }
.nav-group.open .nav-group-links { display: block; }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.quick-action {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: var(--shadow);
}
.quick-action:hover {
    border-color: var(--info);
    color: var(--info);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Lightbox */
.lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.88); align-items: center; justify-content: center;
    flex-direction: column; padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90%; max-height: 82vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); cursor: default; }
.lightbox-close { position: absolute; top: 20px; right: 32px; color: #fff; font-size: 44px; cursor: pointer; line-height: 1; }
.lightbox-caption { color: #e5e7eb; margin-top: 16px; font-size: 14px; }

/* Document gallery */
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.folder-list { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.folder-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; border-radius: 8px; color: #374151; text-decoration: none;
    font-size: 14px; margin-bottom: 2px;
}
.folder-item:hover { background: #f3f4f6; }
.folder-item.active { background: #dbeafe; color: #1e40af; font-weight: 600; }
.folder-item .count { font-size: 12px; color: #9ca3af; }
.folder-icon { margin-right: 8px; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.doc-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid #eef0f3; }
.doc-thumb { width: 100%; height: 150px; object-fit: cover; cursor: zoom-in; background: #f3f4f6; display: block; }
.doc-thumb-file {
    width: 100%; height: 150px; display: flex; align-items: center; justify-content: center;
    background: #f3f4f6; color: #6b7280; font-size: 13px; text-decoration: none; flex-direction: column; gap: 6px;
}
.doc-meta { padding: 10px 12px; }
.doc-meta .doc-title { font-weight: 600; font-size: 14px; color: #111827; word-break: break-word; }
.doc-meta .doc-sub { font-size: 12px; color: #6b7280; margin-top: 3px; }
.doc-kind-tag { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 999px; background: #eef2ff; color: #4338ca; text-transform: uppercase; margin-top: 6px; }

/* Attachment widget (embedded in entity pages) */
.attach-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.attach-thumb { width: 90px; }
.attach-thumb img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid #e5e7eb; }
.attach-thumb .cap { font-size: 11px; color: #6b7280; margin-top: 4px; text-align: center; word-break: break-word; }
.attach-file-icon { width: 90px; height: 90px; display: flex; align-items: center; justify-content: center; background: #f3f4f6; border-radius: 8px; color: #6b7280; text-decoration: none; }
.pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 6px; font-size: 13px; text-decoration: none; background: white; border: 1px solid var(--border); color: var(--text-primary); }
.pagination a.active { background: var(--info); color: white; border-color: var(--info); }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; align-items: end; }
.filter-row input, .filter-row select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; }
.product-identity { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.product-thumb {
    width: 48px; height: 48px; flex: 0 0 48px; object-fit: cover;
    border-radius: 9px; border: 1px solid #dbe2ea; background: #f3f6fa;
}
.product-thumb-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    color: #31557c; background: linear-gradient(145deg, #edf4fb, #dce9f6);
    font-weight: 700; font-size: 17px;
}
.bom-kit-heading { display: flex; align-items: center; gap: 14px; }
.bom-kit-thumb {
    width: 64px; height: 64px; flex: 0 0 64px; object-fit: cover;
    border-radius: 12px; border: 1px solid #dbe2ea; background: #f3f6fa;
}
.bom-row { display: grid; grid-template-columns: minmax(260px, 2fr) 1fr auto; gap: 12px; margin-bottom: 10px; align-items: center; }
.bom-product-picker { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bom-product-picker select { flex: 1; min-width: 0; }
.bom-component-preview {
    width: 52px; height: 52px; flex: 0 0 52px; overflow: hidden;
    border-radius: 9px; border: 1px solid #dbe2ea; background: #f3f6fa;
}
.bom-component-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.bom-component-fallback {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: #31557c; background: linear-gradient(145deg, #edf4fb, #dce9f6);
    font-weight: 700; font-size: 17px;
}
.bom-component-preview img[hidden], .bom-component-fallback[hidden] { display: none; }
@media (max-width: 768px) {
    .bom-row { grid-template-columns: 1fr; align-items: stretch; }
    .bom-kit-heading { align-items: flex-start; }
    .bom-kit-thumb { width: 54px; height: 54px; flex-basis: 54px; }
}
.chat-layout-compact { min-height: 400px; }

/* GCP Usage page */
.gcp-status-banner {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.gcp-status-ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.gcp-status-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.gcp-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.gcp-kv-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 14px;
}
.gcp-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); font-weight: 600; }
.gcp-link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gcp-tip-list { padding-left: 20px; line-height: 1.7; }
.gcp-tip-list li { margin-bottom: 8px; }
.gcp-steps { padding-left: 20px; line-height: 1.8; }

@media (max-width: 1024px) {
    .gcp-kv-grid { grid-template-columns: 1fr 1fr; }

    .card > .table-scroll:not(.smart-table-wrap),
    .card > .history-table-wrap:not(.smart-table-wrap) {
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
    }

    /* Wide tables scroll horizontally on tablet */
    .table-scroll .data-table,
    .history-table-wrap .data-table {
        min-width: 720px;
        width: max-content;
    }

    /* Card-style rows when data-label is present (mobile-friendly) */
    .table-scroll.table-mobile-cards .data-table thead,
    .history-table-wrap.table-mobile-cards .data-table thead {
        display: none;
    }

    .table-scroll.table-mobile-cards .data-table tbody tr,
    .history-table-wrap.table-mobile-cards .data-table tbody tr {
        display: block;
        background: #f8fafc;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    .table-scroll.table-mobile-cards .data-table tbody td,
    .history-table-wrap.table-mobile-cards .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 0;
        border: none;
        text-align: right;
    }

    .table-scroll.table-mobile-cards .data-table tbody td::before,
    .history-table-wrap.table-mobile-cards .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-secondary);
        text-align: left;
        flex: 1;
    }

    .table-scroll.table-mobile-cards .data-table tbody td:last-child,
    .history-table-wrap.table-mobile-cards .data-table tbody td:last-child {
        border-top: 1px dashed var(--border);
        margin-top: 6px;
        padding-top: 12px;
    }
}
@media (max-width: 480px) {
    .gcp-kv-grid { grid-template-columns: 1fr; }
}

/* ========== Desktop full-width professional layout ========== */
@media (min-width: 1025px) {
    .main-content {
        padding: 28px 36px 40px;
        width: calc(100vw - 268px);
        max-width: none;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .data-table td:last-child {
        white-space: normal;
    }
}

/* ========== Premium Dashboard ========== */
.dash-header { align-items: flex-start; }
.dash-header-actions { display: flex; gap: 10px; flex-shrink: 0; }
.dash-section { margin-bottom: 28px; }
.dash-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.dash-section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.dash-section-note { display: block; font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.dash-filter { margin: 0; }
.dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.dash-kpi {
    background: var(--card-bg); border-radius: var(--radius); padding: 16px 18px;
    border: 1px solid var(--border); box-shadow: var(--shadow); border-left: 4px solid var(--info);
    text-decoration: none; color: inherit;
}
.dash-kpi-link:hover { box-shadow: var(--shadow-lg); }
.dash-kpi-good { border-left-color: var(--success); }
.dash-kpi-warn { border-left-color: var(--warning); }
.dash-kpi-danger { border-left-color: var(--danger); }
.dash-kpi-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-kpi-val { display: block; font-size: 24px; font-weight: 700; margin-top: 6px; }
.dash-section-period { background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%); border: 1px solid #e0e7ff; border-radius: var(--radius); padding: 20px; }
.dash-kpi-today { margin-bottom: 0; }
.dash-financial-summary .dash-kpi { border-left-color: var(--primary); }
.dash-custom-range { align-items: end; gap: 12px; margin: 12px 0 16px; max-width: 520px; }
.dash-filter-wrap { flex-wrap: wrap; gap: 6px; }
.dash-quick-actions { margin-bottom: 20px; }
.dash-chart-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-top-table { margin-top: 8px; }
.dash-top-table td, .dash-top-table th { padding: 8px 10px; }
.dash-reminder-list { display: flex; flex-direction: column; gap: 10px; }
.dash-reminder {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: white; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
    box-shadow: var(--shadow); border-left: 4px solid var(--info);
}
.dash-reminder.overdue { border-left-color: var(--danger); background: #fef2f2; }
.dash-reminder.priority-high { border-left-color: var(--warning); }
.dash-reminder-main { display: flex; flex-direction: column; gap: 2px; }
.dash-reminder-meta { display: flex; align-items: center; gap: 10px; }
.dash-reminder-date { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.dash-empty { padding: 24px; text-align: center; background: white; border-radius: var(--radius); border: 1px dashed var(--border); color: var(--text-secondary); }
.dash-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.dash-widget .dash-notify-row, .dash-widget .dash-activity-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dash-activity-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
@media (max-width: 900px) {
    .dash-widget-grid { grid-template-columns: 1fr; }
}
.dash-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-panel { min-width: 0; overflow: visible; }
.dash-panel .dash-fit-table { width: 100%; min-width: 0; box-shadow: none; margin: 0; }
.dash-chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-chart-box { min-height: 280px; }
.dash-chart-box canvas { height: 220px !important; max-height: 220px; }
.dash-builder-desc { font-size: 13px; margin-bottom: 16px; }
.dash-builder-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 20px; }
.dash-builder-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.dash-builder-controls select { min-width: 160px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.dash-builder-output { min-height: 200px; }
.dash-desktop-only { display: block; }

@media (max-width: 1024px) {
    .dash-desktop-only { display: none; }
    .dash-grid-2, .dash-chart-row { grid-template-columns: 1fr; }
    .dash-kpi-val { font-size: 20px; }
    .dash-section-period { padding: 14px; }
    .dash-panel .dash-fit-table thead { display: none; }
    .dash-panel .dash-fit-table tbody tr {
        display: block; background: #f8fafc; border: 1px solid var(--border);
        border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
    }
    .dash-panel .dash-fit-table tbody td {
        display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: none;
    }
    .dash-panel .dash-fit-table tbody td::before {
        content: attr(data-label); font-weight: 600; font-size: 11px;
        text-transform: uppercase; color: var(--text-secondary);
    }
}

@media (max-width: 480px) {
    .dash-chart-row-3 { grid-template-columns: 1fr; }
    .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dash-kpi { padding: 12px; }
    .dash-kpi-val { font-size: 17px; }
}

/* Analytics hub */
.analytics-filter-form { margin-top: 12px; }
.analytics-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.analytics-empty { text-align: center; padding: 16px !important; font-size: 13px; }
.analytics-filters .form-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Report engine UI */
.report-filter-grid { align-items: end; gap: 10px 14px; }
.report-toolbar-card { padding: 16px; }
.report-export-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-record-count { margin: 10px 0 0; font-size: 13px; }
.report-data-table th, .report-data-table td { vertical-align: middle; }
.report-table-card { overflow: hidden; }
.report-empty { text-align: center; padding: 24px !important; }
.report-link-grid { display: flex; flex-wrap: wrap; gap: 8px; }
@media print {
    .no-print, .sidebar, .dash-filter, .report-toolbar-card { display: none !important; }
}

.file-multi-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Demo mode + login */
.demo-banner {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: linear-gradient(90deg, #1e3a8a, #2563eb);
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}
.demo-banner-text { flex: 1 1 200px; text-align: center; }
.demo-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.demo-banner-warn { background: linear-gradient(90deg, #92400e, #d97706); }
.demo-banner-btn {
    display: inline-block;
    color: white;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
}
.demo-banner-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}
.demo-banner-btn-primary {
    background: white;
    color: #1d4ed8;
    border-color: white;
}
.demo-banner-btn-primary:hover {
    background: #eff6ff;
    color: #1d4ed8;
}
.demo-banner-link {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.mobile-demo-action {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.mobile-demo-signin {
    background: white;
    color: #1d4ed8 !important;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-secondary);
    font-size: 13px;
}
.login-divider::before, .login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.login-footnote { font-size: 12px; text-align: center; line-height: 1.5; }
.sidebar-user-bar {
    flex-shrink: 0;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sidebar-user-name {
    font-size: 13px;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-action {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    flex-shrink: 0;
}
.product-form-card { max-width: 760px; }
.form-section { margin-bottom: 1.25rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.form-group-full { grid-column: 1 / -1; }
.product-select-dropdown {
    min-height: 42px;
    font-size: 15px;
    padding: 10px 14px;
}
.pricing-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.purchase-totals-panel {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.purchase-grand-total div:last-child {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary, #2563eb);
}

.audit-log-table { min-width: 900px; }
.audit-log-table .nowrap { white-space: nowrap; }
.audit-changes-cell details { font-size: 12px; }
.activity-timeline { display: flex; flex-direction: column; gap: 0; }
.activity-timeline-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.activity-timeline-dot {
    width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
    background: var(--primary);
}
.activity-timeline-dot.badge-danger { background: var(--danger); }
.activity-timeline-dot.badge-success { background: var(--success); }
.activity-timeline-body { flex: 1; min-width: 0; }
.activity-timeline-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.activity-timeline-diff { margin-top: 6px; font-size: 12px; }
.activity-timeline-card { margin-top: 16px; }
.pagination-bar { display: flex; gap: 12px; align-items: center; }

.ai-score-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.ai-health-ring {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin: 12px 0 8px;
}
.ai-grade-excellent .ai-health-ring { color: #10b981; }
.ai-grade-good .ai-health-ring { color: #3b82f6; }
.ai-grade-average .ai-health-ring { color: #f59e0b; }
.ai-grade-needs-attention .ai-health-ring { color: #ef4444; }
.ai-score-list { list-style: none; padding: 0; margin: 0; }
.ai-score-list li {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.ai-rec-grid, .ai-insight-grid, .ai-alert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.ai-rec-card { border-left: 4px solid var(--info); }
.ai-rec-card.priority-high { border-left-color: var(--danger); }
.ai-rec-card.priority-medium { border-left-color: var(--warning); }
.ai-insight-card, .ai-alert-card { padding: 16px; }
.ai-insight-icon { font-size: 20px; margin-right: 8px; }
.ai-mini-list { margin: 0; padding-left: 18px; }
.ai-mini-list li { margin: 6px 0; }
@media (max-width: 900px) {
    .ai-score-grid, .ai-rec-grid, .ai-insight-grid, .ai-alert-grid { grid-template-columns: 1fr; }
}
.password-field {
    display: flex;
    align-items: stretch;
}
.password-field input {
    flex: 1;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.password-toggle {
    min-width: 58px;
    border: 1px solid #cbd5e1;
    border-left: 0;
    border-radius: 0 6px 6px 0;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
}
