/* ============================================================
 *  Sollatek Connect Web - Design System
 *  A single source of truth for the admin portal & public pages.
 * ============================================================ */

/* ── Design tokens ───────────────────────────────────────────── */
:root {
    /* Surfaces */
    --bg:           #070B14;
    --surface:      #0F1524;
    --surface-2:    #161E30;
    --surface-3:    #1D2739;
    --border:       #202B3F;
    --border-2:     #2A374E;
    --overlay:      rgba(4, 8, 18, 0.72);

    /* Brand & semantic */
    --primary:      #38BDF8;
    --primary-600:  #0EA5E9;
    --primary-700:  #0284C7;
    --accent:       #14B8A6;
    --accent-600:   #0D9488;
    --success:      #10B981;
    --warning:      #F59E0B;
    --danger:       #EF4444;
    --danger-soft:  #F87171;
    --info:         #60A5FA;

    /* Text */
    --text:         #F8FAFC;
    --text-2:       #CBD5E1;
    --text-3:       #94A3B8;
    --text-4:       #64748B;
    --text-5:       #475569;

    /* Focus */
    --ring:         0 0 0 3px rgba(56, 189, 248, 0.28);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Radii */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* Shadows */
    --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --sh-md: 0 8px 24px rgba(2, 6, 15, 0.45);
    --sh-lg: 0 20px 50px rgba(2, 6, 15, 0.55);

    /* Transitions */
    --t-fast: 140ms cubic-bezier(.4, 0, .2, 1);
    --t:      200ms cubic-bezier(.4, 0, .2, 1);

    /* Sidebar width */
    --sb-w: 260px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }

html {
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(1100px 680px at 8% -4%, rgba(56, 189, 248, 0.10), transparent 60%),
        radial-gradient(900px 600px at 102% 104%, rgba(20, 184, 166, 0.08), transparent 60%),
        linear-gradient(180deg, #070B14 0%, #0A1120 100%);
    background-attachment: fixed;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #7DD3FC; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: 700;
    color: var(--text);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.42); }

/* ── Utilities ───────────────────────────────────────────────── */
.container { max-width: 1320px; margin: 0 auto; padding: 24px; }
.stack > * + * { margin-top: var(--s, 16px); }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.text-muted { color: var(--text-3); }
.text-dim { color: var(--text-4); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── App Shell (sidebar + main) ──────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: var(--sb-w) 1fr;
    min-height: 100vh;
}
/* Legacy JS (app.js / production.js / products.js) toggles the shell visible
   with `style.display = 'block'`. Force the grid layout regardless of that
   inline style so the sidebar + main column render correctly. */
.app-shell[style*="display: block"],
.app-shell[style*="display:block"],
.app-shell[style*="display: flex"],
.app-shell[style*="display:flex"] { display: grid !important; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, rgba(15, 21, 36, 0.92), rgba(10, 15, 28, 0.96));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand img { height: 28px; }
.sidebar-brand .bname { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.sidebar-brand .btag  { font-size: 10px; letter-spacing: 1.4px; color: var(--text-4); text-transform: uppercase; }

.side-section {
    padding: 14px 10px 8px;
    font-size: 10.5px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-4);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: rgba(148, 163, 184, 0.06); color: var(--text); }
.nav-item.active,
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.04));
    color: var(--text);
    box-shadow: inset 2px 0 0 var(--primary);
}
.nav-item svg { width: 18px; height: 18px; color: var(--text-3); transition: color var(--t-fast); flex-shrink: 0; }
.nav-item:hover svg,
.nav-item.active svg,
.nav-item.is-active svg { color: var(--primary); }

/* When a nav-item is also a tab-btn, suppress the pill-style .tab-btn.active */
.sidebar .tab-btn { all: unset; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); width: 100%; box-sizing: border-box; }
.sidebar .tab-btn svg { width: 18px; height: 18px; color: var(--text-3); transition: color var(--t-fast); flex-shrink: 0; }
.sidebar .tab-btn:hover { background: rgba(148, 163, 184, 0.06); color: var(--text); }
.sidebar .tab-btn:hover svg { color: var(--primary); }
.sidebar .tab-btn.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.04));
    color: var(--text);
    box-shadow: inset 2px 0 0 var(--primary);
    border: 0;
}
.sidebar .tab-btn.active svg { color: var(--primary); }
.sidebar .tab-btn .count {
    margin-left: auto;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: var(--r-full);
    background: rgba(239, 68, 68, 0.15); color: var(--danger-soft);
}
.nav-item .count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--r-full);
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-soft);
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
    font-size: 13px;
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
    flex-shrink: 0;
}
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 32px;
    background: rgba(10, 15, 28, 0.72);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.topbar .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.page { padding: 28px 32px 60px; }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 12px; }
    .sidebar-brand { border-bottom: 0; border-right: 1px solid var(--border); padding: 4px 14px 4px 6px; margin: 0 8px 0 0; }
    .side-section, .sidebar-footer { display: none; }
    .nav-item { padding: 8px 12px; flex-shrink: 0; font-size: 13px; }
    .topbar, .page { padding-left: 20px; padding-right: 20px; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-md);
}
.card-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.card-h h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.card-h .sub { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.card-b { padding: 22px; }
.card-f {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(4, 8, 18, 0.25);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Tile (landing-style feature block) */
.tile {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.tile:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: var(--sh-lg);
}
.tile-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.25);
    margin-bottom: 18px;
}
.tile h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tile p  { color: var(--text-3); font-size: 14px; line-height: 1.6; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
    user-select: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
    background: linear-gradient(180deg, var(--primary), var(--primary-600));
    color: var(--bg);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.28);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(56, 189, 248, 0.38); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: rgba(56, 189, 248, 0.3); }

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: rgba(148, 163, 184, 0.08); color: var(--text); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #DC2626; }

.btn-success {
    background: var(--success);
    color: #062014;
}
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-warning {
    background: var(--warning);
    color: #3B1D01;
}
.btn-warning:hover:not(:disabled) { background: #D97706; }

.btn-info {
    background: var(--primary-700);
    color: #fff;
}
.btn-info:hover:not(:disabled) { background: var(--primary-600); }

/* ── Forms ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label,
.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.1px;
}
.field .help, .hint {
    font-size: 11.5px;
    color: var(--text-4);
    min-height: 1em;
}
.input,
.form-group input,
.form-group select,
.form-group textarea,
.modal input, .modal select, .modal textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
}
.input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-4); }
.input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}
.input:disabled,
.input[readonly] { opacity: 0.7; cursor: not-allowed; }

.form-group { margin-bottom: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* Password toggle */
.password-input-container { position: relative; }
.password-input-container input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-3);
    padding: 8px;
    border-radius: var(--r-sm);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--t-fast), color var(--t-fast);
}
.password-toggle:hover { background: rgba(148, 163, 184, 0.08); color: var(--primary); }
.password-toggle .icon, .password-toggle svg { width: 18px; height: 18px; }

/* Search input variant */
.search-input,
.input-search {
    padding: 10px 14px 10px 38px;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") 12px center/16px no-repeat var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    color: var(--text);
    width: 320px;
    max-width: 100%;
}
.search-input:focus, .input-search:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
    outline: none;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
    display: inline-flex;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    gap: 2px;
}
.tab-btn {
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-3);
    background: transparent;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
    display: inline-flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    background: rgba(56, 189, 248, 0.14);
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.35);
    font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    min-width: 20px;
    height: 20px;
    border-radius: var(--r-full);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-left: 4px;
    justify-content: center;
}
.tab-btn.active .badge { background: var(--danger); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-container,
.tbl-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-md);
}
.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
th, td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13.5px;
    vertical-align: middle;
}
thead th {
    background: rgba(10, 15, 28, 0.6);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: rgba(56, 189, 248, 0.04); }
tbody tr:last-child td { border-bottom: 0; }

/* Sortable header */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: rgba(56, 189, 248, 0.06); color: var(--text); }
.th-content { display: inline-flex; align-items: center; gap: 6px; }
.sort-icon { color: var(--primary); opacity: 0.7; display: inline-flex; width: 14px; justify-content: center; font-size: 12px; }

/* Production data table override */
#dataTable table { background: transparent; }
#dataTable thead { background: rgba(10, 15, 28, 0.6); }
#dataTable tbody tr { border-bottom: 1px solid var(--border); }
#dataTable tbody td { color: var(--text); }
#dataTable .status-badge { padding: 3px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; border: 1px solid transparent; }

/* ── Status pills ────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.status-approved, #dataTable .status-approved {
    background: rgba(16, 185, 129, 0.14); color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}
.status-pending {
    background: rgba(245, 158, 11, 0.14); color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}
.status-rejected, #dataTable .status-rejected {
    background: rgba(239, 68, 68, 0.14); color: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Inline row action button (details toggle) */
.details-btn,
#dataTable .details-btn {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}
.details-btn:hover,
#dataTable .details-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.55);
    transform: translateY(-1px);
}
.details-btn.active { background: var(--primary); color: var(--bg); border-color: var(--primary); }

/* Action buttons column */
.action-buttons { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.action-buttons .btn { padding: 6px 12px; font-size: 12px; }

/* ── Modals ──────────────────────────────────────────────────── */
/* Overlay-style (modal-overlay + modal-dialog) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(6px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
/* Support legacy JS that toggles modals via inline style="display: block|flex" */
.modal-overlay[style*="display: block"],
.modal-overlay[style*="display:block"],
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] { display: flex !important; }

.modal-dialog {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 26px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--sh-lg);
    animation: dialog-in 220ms cubic-bezier(.16, 1, .3, 1);
}
@keyframes dialog-in {
    from { transform: translateY(-8px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1);      opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.modal-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 22px;
    flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.modal-message { color: var(--text-3); font-size: 14px; line-height: 1.6; margin: 8px 0 20px; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn {
    padding: 10px 18px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--t-fast), transform var(--t-fast);
}
.modal-btn-cancel {
    background: var(--surface-2);
    color: var(--text-2);
    border-color: var(--border-2);
}
.modal-btn-cancel:hover { background: var(--surface-3); color: var(--text); }
.modal-btn-confirm {
    background: linear-gradient(180deg, var(--primary), var(--primary-600));
    color: var(--bg);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.28);
}
.modal-btn-confirm:hover { transform: translateY(-1px); }
.modal-btn-danger { background: var(--danger); color: #fff; }
.modal-btn-danger:hover { background: #DC2626; }

/* Legacy-style modal (.modal > .modal-content) - toggled with inline display */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(6px);
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}
.modal[style*="display: block"],
.modal[style*="display:flex"],
.modal[style*="display: flex"],
.modal.open { display: flex !important; align-items: flex-start; justify-content: center; padding-top: 6vh; }
.modal .modal-content {
    position: relative;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    max-width: 620px;
    width: 100%;
    padding: 28px 28px 22px;
    box-shadow: var(--sh-lg);
}
.modal .close {
    position: absolute;
    right: 14px;
    top: 10px;
    font-size: 22px;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    transition: color var(--t-fast), background var(--t-fast);
}
.modal .close:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.modal .modal-content h2,
.modal .modal-content h3 { margin-bottom: 14px; letter-spacing: -0.2px; }
.modal .modal-content .btn-primary,
.modal .modal-content button[type="submit"] {
    background: linear-gradient(180deg, var(--primary), var(--primary-600));
    color: var(--bg);
    padding: 10px 18px;
    border-radius: var(--r-md);
    border: 0;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.22);
    cursor: pointer;
    transition: transform var(--t-fast);
}
.modal .modal-content .btn-primary:hover,
.modal .modal-content button[type="submit"]:hover { transform: translateY(-1px); }

/* ── Notifications ───────────────────────────────────────────── */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}
.notification {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-left: 4px solid var(--primary);
    border-radius: var(--r-md);
    padding: 14px 18px;
    box-shadow: var(--sh-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: notif-in 240ms cubic-bezier(.16, 1, .3, 1);
    opacity: 1;
    transition: opacity 220ms, transform 220ms;
    min-width: 280px;
    max-width: 400px;
}
.notification.success { border-left-color: var(--success); }
.notification.error   { border-left-color: var(--danger); }
.notification.warning { border-left-color: var(--warning); }
.notification.info    { border-left-color: var(--primary); }

.notification-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.notification.success .notification-icon { color: var(--success); }
.notification.error   .notification-icon { color: var(--danger); }
.notification.warning .notification-icon { color: var(--warning); }

.notification-content { flex: 1; min-width: 0; }
.notification-title {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text);
}
.notification-message {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.5;
}
.notification-close {
    background: none;
    border: 0;
    font-size: 18px;
    color: var(--text-4);
    cursor: pointer;
    padding: 0 4px;
    transition: color var(--t-fast);
}
.notification-close:hover { color: var(--text); }
.notification.removing { animation: notif-out 220ms forwards; }
@keyframes notif-in  { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes notif-out { to   { transform: translateX(30px); opacity: 0; } }

/* ── State messages ──────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--r-md);
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px;
}
.alert-error   { background: rgba(239, 68, 68, 0.1);  color: var(--danger-soft); border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success);      border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning);      border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-info    { background: rgba(56, 189, 248, 0.1); color: var(--primary);      border: 1px solid rgba(56, 189, 248, 0.3); }

.error   { color: var(--danger-soft); font-size: 13px; margin-top: 6px; }
.success { color: var(--success);      font-size: 13px; margin-top: 6px; }

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-3);
}
.empty-state h3 { font-size: 18px; color: var(--text); font-weight: 700; margin-bottom: 6px; }
.empty-state p  { font-size: 13.5px; }

.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-3);
    font-size: 14px;
}

/* ── Full-screen loader ──────────────────────────────────────── */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background:
        radial-gradient(800px 500px at 20% -10%, rgba(56, 189, 248, 0.15), transparent 60%),
        linear-gradient(180deg, var(--bg), #0A1120);
    z-index: 9999;
}
.loading-spinner {
    width: 46px; height: 46px;
    border: 3px solid rgba(56, 189, 248, 0.18);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.loading-screen p { color: var(--text-2); font-size: 14px; letter-spacing: 0.3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Split-screen Login (with product showcase) ──────────────── */
.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bg);
}
/* Legacy JS sets `style.display = 'block'` when showing the login screen.
   Force the grid layout regardless. */
.auth-split[style*="display: block"],
.auth-split[style*="display:block"],
.auth-split[style*="display: flex"],
.auth-split[style*="display:flex"] { display: grid !important; }

/* ── Left: Product showcase ─────────────────────────────────── */
.auth-showcase {
    position: relative;
    overflow: hidden;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(780px 520px at 100% 0%, rgba(56, 189, 248, 0.15), transparent 62%),
        radial-gradient(780px 520px at 0% 100%, rgba(20, 184, 166, 0.10), transparent 62%),
        linear-gradient(140deg, #070B14 0%, #0D1626 55%, #0A1B2E 100%);
}
.auth-showcase::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.06), transparent 40%);
    pointer-events: none;
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 2;
}
.showcase-brand-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    /* background: rgba(56, 189, 248, 0.12); */
    /* border: 1px solid rgba(56, 189, 248, 0.3); */
    padding: 10px;
    flex-shrink: 0;
}
.showcase-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.showcase-brand .bname { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.showcase-brand .btag  { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-4); margin-top: 2px; }

.showcase-body {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    min-height: 0;
}

.showcase-slide {
    display: none;
    flex-direction: column;
    opacity: 0;
    animation: showcase-in 500ms cubic-bezier(.16, 1, .3, 1) forwards;
}
.showcase-slide.active { display: flex; }
@keyframes showcase-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.showcase-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    font-size: 11px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.32);
    border-radius: var(--r-full);
    align-self: flex-start;
    margin-bottom: 20px;
}

.showcase-image-wrap {
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.showcase-image-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
}

.showcase-title {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1.2px;
    color: var(--primary);
    line-height: 1.05;
}
.showcase-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    margin-top: 6px;
}
.showcase-divider {
    height: 3px;
    width: 48px;
    background: var(--accent);
    border-radius: 2px;
    margin: 16px 0;
}
.showcase-desc {
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.65;
    max-width: 540px;
}
.showcase-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}
.showcase-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}
.showcase-feature-ico {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20, 184, 166, 0.12);
    color: var(--accent);
    border: 1px solid rgba(20, 184, 166, 0.28);
    flex-shrink: 0;
}

.showcase-footer {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.showcase-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}
.showcase-dot {
    width: 6px; height: 6px;
    border-radius: var(--r-full);
    background: rgba(148, 163, 184, 0.4);
    cursor: pointer;
    transition: all var(--t);
    border: 0;
    padding: 0;
}
.showcase-dot.active {
    width: 32px;
    background: var(--primary);
}
.showcase-copyright {
    font-size: 12px;
    color: var(--text-4);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Right: Form panel ──────────────────────────────────────── */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--bg);
}
.auth-form {
    width: 100%;
    max-width: 400px;
}
.auth-form h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 6px;
}
.auth-form .auth-lead {
    color: var(--text-3);
    font-size: 14px;
    margin-bottom: 32px;
}
.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}
.auth-label.with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.auth-label .auth-link {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--primary);
}
.auth-label .auth-link:hover { color: #7DD3FC; }
.auth-input-group {
    position: relative;
    margin-bottom: 20px;
}
.auth-input-group .auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-4);
    pointer-events: none;
    width: 18px; height: 18px;
}
.auth-input {
    width: 100%;
    padding: 14px 46px;
    padding-right: 46px;
    font-size: 15px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
}
.auth-input::placeholder { color: var(--text-4); }
.auth-input:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}
.auth-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-4);
    padding: 8px;
    border-radius: var(--r-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
}
.auth-eye:hover { color: var(--primary); background: rgba(148, 163, 184, 0.06); }
.auth-eye svg { width: 18px; height: 18px; }

.auth-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(180deg, var(--primary), var(--primary-600));
    color: var(--bg);
    border: 0;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.3);
    margin-top: 12px;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(56, 189, 248, 0.4); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 16px;
    color: var(--text-4);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}

.auth-secondary {
    width: 100%;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
    text-align: center;
    display: block;
}
.auth-secondary:hover { background: rgba(56, 189, 248, 0.06); border-color: var(--primary); }

/* Responsive: stack on smaller screens */
@media (max-width: 980px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .auth-form-panel { padding: 32px 24px; min-height: 100vh; }
}

/* ── Legacy auth-gate (kept for products.html if needed) ─────── */
.auth-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(22, 30, 48, 0.85), rgba(15, 21, 36, 0.94));
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    padding: 36px 32px 32px;
    backdrop-filter: blur(14px);
}
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    gap: 10px;
    text-align: center;
}
.auth-brand img { height: 38px; }
.auth-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.auth-title .accent { color: var(--primary); }
.auth-sub {
    color: var(--text-3);
    font-size: 13.5px;
    margin-top: 2px;
}

/* ── Floating login error banner ─────────────────────────────── */
#loginError {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11500;
    max-width: 600px;
    width: calc(100% - 32px);
    padding: 12px 18px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--r-md);
    font-size: 13px;
    box-shadow: var(--sh-lg);
    opacity: 0;
    transition: opacity 260ms;
    pointer-events: none;
}
#loginError.show { opacity: 1; pointer-events: auto; }
#loginError.hidden { opacity: 0; pointer-events: none; }

/* ── Inputs for date pickers ─────────────────────────────────── */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.7);
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ── Users grid (legacy) - keep for JS that references it ────── */
@media (min-width: 768px) {
    .users-grid {
        display: grid;
        grid-template-columns: 2fr 2fr 1.2fr 1fr auto auto auto;
    }
}

/* ── Tag chip ────────────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
}

/* ── Section heading ─────────────────────────────────────────── */
.eyebrow {
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-4);
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}
.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.page-subtitle {
    color: var(--text-3);
    font-size: 13.5px;
    margin-top: 3px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
    padding: 40px 24px 28px;
    text-align: center;
    color: var(--text-4);
    font-size: 12.5px;
    line-height: 1.6;
}
.footer .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin-bottom: 10px;
}
.footer .links a { color: var(--text-3); }
.footer .links a:hover { color: var(--primary); }
.footer .sep { color: var(--text-5); }
