/* ═══════════════════════════════════════════════════
   FLEET OS — Premium Design System (HDR Solid Colors)
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Brand */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --primary-glow: rgba(99, 102, 241, .18);

    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --violet: #8b5cf6;

    /* Sidebar */
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: rgba(255, 255, 255, .07);
    --sidebar-active: #4f46e5;
    --sidebar-text: rgba(255, 255, 255, .5);

    /* UI */
    --border: #e5e7ef;
    --text: #111827;
    --text-light: #6b7280;
    --bg: #f3f4f8;
    --surface: #ffffff;

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, .07);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .08);
    --shadow: 0 6px 20px rgba(0, 0, 0, .10);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, .14);

    /* Radius */
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
}

/* ── Reset ──────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c4c9d4;
    border-radius: 3px;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */
.sidebar {
    width: 256px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 200;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.brand {
    padding: 22px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.brand-text {
    font-size: .95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.brand-sub {
    font-size: .68rem;
    color: rgba(255, 255, 255, .4);
    margin-top: 2px;
    font-weight: 500;
}

nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .28);
    padding: 18px 12px 6px;
}

.nav-item {
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: 11px;
    font-size: .875rem;
    font-weight: 600;
    transition: all .18s;
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: rgba(255, 255, 255, .85);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .4);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: #a5b4fc;
    border-radius: 0 4px 4px 0;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.backup-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .22);
    border-radius: 10px;
    padding: 11px 14px;
}

.backup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .5;
        transform: scale(.85)
    }
}

.backup-text {
    font-size: .73rem;
    color: var(--success);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════ */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Top Bar ──────────────────────── */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

#menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 6px 10px;
    transition: all .18s;
    flex-shrink: 0;
}

#menu-toggle:hover {
    background: var(--bg);
    color: var(--text);
}

#page-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: .82rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(99, 102, 241, .35);
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: .82rem;
    font-weight: 700;
}

.user-role {
    font-size: .67rem;
    color: white;
    background: var(--primary);
    padding: 2px 9px;
    border-radius: 20px;
    font-weight: 700;
}

/* ── Content Wrapper ──────────────── */
.content-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 26px 28px;
}

/* ═══════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════ */
.section {
    display: none;
    animation: fadeIn .22s cubic-bezier(.4, 0, .2, 1);
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.section-header h2 {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -.03em;
}

/* ═══════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--r-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

/* Solid accent top-right circle */
.stat-card::after {
    content: '';
    position: absolute;
    top: -28px;
    right: -28px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #e0e7ff;
    opacity: .6;
}

.stat-card.accent-green::after {
    background: #d1fae5;
}

.stat-card.accent-amber::after {
    background: #fef3c7;
}

.stat-card.accent-cyan::after {
    background: #cffafe;
}

/* Solid left accent bar */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
}

.stat-card.accent-green::before {
    background: var(--success);
}

.stat-card.accent-amber::before {
    background: var(--accent);
}

.stat-card.accent-cyan::before {
    background: var(--info);
}

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

.stat-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -.03em;
    line-height: 1;
}

.stat-sub {
    font-size: .78rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--r);
    font-weight: 700;
    font-size: .85rem;
    border: none;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    letter-spacing: -.01em;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 18px rgba(99, 102, 241, .45);
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: #adb5c9;
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .25);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 14px rgba(239, 68, 68, .38);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, .25);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .38);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 7px 14px;
    font-size: .78rem;
    border-radius: var(--r-sm);
    gap: 5px;
}

/* ═══════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════ */
.filter-bar {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 18px;
    box-shadow: var(--shadow-xs);
}

.filter-bar .form-group {
    margin: 0;
    min-width: 160px;
    flex: 1;
}

/* ═══════════════════════════════════════════════
   PREMIUM RESET BUTTON
   ═══════════════════════════════════════════════ */
.btn-reset-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: .84rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .02em;
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(139, 92, 246, .4), 0 1px 3px rgba(0, 0, 0, .12);
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-reset-premium::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background .18s;
    border-radius: inherit;
}

.btn-reset-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, .5), 0 2px 6px rgba(0, 0, 0, .1);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
}

.btn-reset-premium:hover::after {
    background: rgba(255, 255, 255, .08);
}

.btn-reset-premium:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, .35);
}

.btn-reset-premium i {
    transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}

.btn-reset-premium:hover i {
    transform: rotate(-180deg);
}

/* Style the native calendar picker icon — small, right-aligned, indigo tint */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: invert(40%) sepia(80%) saturate(500%) hue-rotate(210deg);
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 4px;
    flex-shrink: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}



/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */
.table-wrap {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    background: #f8f9fc;
    color: var(--text-light);
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 13px 18px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 18px;
    font-size: .875rem;
    color: var(--text);
    border-bottom: 1px solid #f1f3f8;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background .12s;
}

tbody tr:hover {
    background: #f5f3ff;
}

.row-actions {
    display: flex;
    gap: 6px;
}

/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.badge-pending {
    background: #fef3c7;
    color: #78350f;
}

.badge-in-transit {
    background: #ede9fe;
    color: #4c1d95;
}

.badge-delivered {
    background: #d1fae5;
    color: #065f46;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-transit {
    background: #ede9fe;
    color: #5b21b6;
}

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: .01em;
}

input,
select,
textarea {
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-size: .875rem;
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    font-family: 'Inter', inherit;
    background: white;
    width: 100%;
}

input,
select,
textarea {
    padding: 10px 14px;
    border: 1.5px solid #d4d8f0;
    border-radius: 10px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    font-family: 'Inter', inherit;
    background: linear-gradient(to bottom, #ffffff, #f8f9ff);
    width: 100%;
    box-sizing: border-box;
}

input:hover,
select:hover {
    border-color: #a5b4fc;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .14), 0 1px 4px rgba(0, 0, 0, .06);
    background: white;
}

/* Custom dropdown arrow for selects */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='5 8 10 13 15 8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 38px;
    cursor: pointer;
}


.auto-calc {
    background: #f8f9fc;
    color: var(--text-light);
    cursor: default;
}

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 41, .65);
    backdrop-filter: blur(5px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.modal {
    background: white;
    border-radius: var(--r-xl);
    padding: 28px;
    width: 740px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .25);
    animation: modalIn .22s cubic-bezier(.4, 0, .2, 1);
}

.modal-sm {
    width: 460px;
}

@keyframes modalIn {
    from {
        transform: scale(.94) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.modal-close {
    background: var(--bg);
    border: none;
    border-radius: var(--r-sm);
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-light);
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s;
}

.modal-close:hover {
    background: #e5e7eb;
    color: var(--text);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1.5px solid var(--border);
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-cell {
    text-align: center;
    color: var(--text-light);
    padding: 40px !important;
    font-size: .88rem;
}

.empty-cell a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.empty-cell a:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 52px 24px;
    color: var(--text-light);
    font-size: .9rem;
}

/* ═══════════════════════════════════════════════
   DASHBOARD PANELS
   ═══════════════════════════════════════════════ */
.dash-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 20px;
}

/* ── Dashboard Date Filter Bar ──────────────────── */
.dash-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 10px 16px;
    box-shadow: var(--shadow-xs);
}

.dash-qf-btn {
    padding: 7px 18px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.dash-qf-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.dash-qf-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

.dash-custom-range {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.dash-custom-range span {
    font-size: .8rem;
    color: var(--text-light);
}

.dash-custom-range input[type="date"] {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .82rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
}

/* ── Dashboard KPI Grid (9 cards) ───────────────── */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dash-kpi-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow .18s, transform .18s;
}

.dash-kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.dash-kpi-profit-card {
    border-color: var(--success);
    background: #f0fdf4;
}

.dash-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.dash-kpi-body {
    flex: 1;
    min-width: 0;
}

.dash-kpi-label {
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}

.dash-kpi-value {
    font-size: 1.18rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Dashboard Chart Cards ──────────────────────── */
.dash-charts-row {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

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

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

.dash-chart-full {
    margin-bottom: 18px;
}

.dash-chart-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    padding: 16px 18px;
    overflow: hidden;
}

.dash-chart-title {
    font-size: .82rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.01em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.dash-chart-wrap {
    position: relative;
    height: 200px;
    width: 100%;
}

.dash-chart-wrap canvas {
    max-height: 100%;
}

.panel-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbff;
}

.panel-header h4 {
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.panel-link {
    font-size: .78rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

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

.panel-table th,
.panel-table td {
    padding: 11px 16px;
    font-size: .82rem;
}

/* ═══════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════ */
.settings-tabs {
    display: flex;
    gap: 4px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-xs);
    width: fit-content;
}

.settings-tab {
    padding: 9px 24px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-light);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    letter-spacing: -.01em;
}

.settings-tab:hover {
    background: var(--bg);
    color: var(--text);
}

.settings-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

.settings-panel {
    display: none;
    animation: fadeIn .2s ease;
}

.settings-panel.active {
    display: block;
}

.settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 16px;
}

.settings-panel-header h3 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 3px;
}

.settings-panel-header p {
    font-size: .82rem;
    color: var(--text-light);
}

/* ── Custom Fields List ──────────── */
.fields-builder {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f3f8;
    transition: background .12s;
    cursor: default;
}

.field-item:last-child {
    border-bottom: none;
}

.field-item:hover {
    background: #fafbff;
}

.field-item.dragging {
    opacity: .4;
    box-shadow: var(--shadow);
    background: var(--primary-light);
    border-radius: var(--r);
}

.field-item.drag-over {
    border-top: 2.5px solid var(--primary);
    background: var(--primary-light);
}

.field-drag-handle {
    color: #d1d5db;
    cursor: grab;
    font-size: .88rem;
    padding: 4px;
    flex-shrink: 0;
    transition: color .15s;
    border-radius: 4px;
}

.field-drag-handle:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.field-drag-handle:active {
    cursor: grabbing;
}

.field-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.field-item-info strong {
    font-size: .875rem;
    font-weight: 700;
    color: var(--text);
}

.field-options-hint {
    font-size: .7rem;
    color: var(--text-light);
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 20px;
}

/* Field Tags */
.field-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .66rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.field-tag-section {
    background: #ecfdf5;
    color: #065f46;
}

.field-tag-req {
    background: #fef2f2;
    color: #b91c1c;
}

.field-tag-sys {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.field-item.system-field {
    background: #f8fafc;
    border-left: 4px solid var(--primary);
}

.field-item.system-field .field-drag-handle {
    color: var(--primary);
}

.field-options-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #64748b;
}

/* ═══════════════════════════════════════════════
   COMPANY SETTINGS
   ═══════════════════════════════════════════════ */
.company-settings-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 20px;
    background: #f5f3ff;
    border: 1.5px dashed #c4b5fd;
    border-radius: var(--r-lg);
    flex-wrap: wrap;
}

.logo-preview {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    background: white;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.logo-upload-info {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
    min-width: 160px;
}

.logo-upload-title {
    font-size: .88rem;
    font-weight: 800;
    color: var(--text);
}

.logo-upload-sub {
    font-size: .76rem;
    color: var(--text-light);
}

.logo-upload-info .btn {
    align-self: flex-start;
}

.company-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ── Locked Field ─────────────────── */
.field-locked {
    background: #f9fafb;
    color: var(--text-light);
    cursor: not-allowed;
    border-style: dashed;
    border-color: #d1d5db;
    user-select: none;
}

.field-locked:focus {
    box-shadow: none;
    border-color: #d1d5db;
}

.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #78350f;
    font-size: .63rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 20px;
    margin-left: 7px;
    text-transform: uppercase;
    letter-spacing: .05em;
    vertical-align: middle;
}

/* ── Tagline Warning ─────────────── */
.tagline-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--r);
    padding: 12px 16px;
    margin-top: 8px;
}

.tagline-warning i {
    color: #d97706;
    font-size: 1rem;
    flex-shrink: 0;
}

.tagline-warning-text {
    font-size: .82rem;
    color: #78350f;
    line-height: 1.5;
}

.tagline-warning-text strong {
    font-weight: 800;
}

.tagline-warning-text a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1.5px solid rgba(79, 70, 229, .3);
}

.tagline-warning-text a:hover {
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════
   MIS REPORTS
   ═══════════════════════════════════════════════ */
.mis-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.mis-stat-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.mis-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
}

.breakdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.breakdown-label {
    min-width: 140px;
    font-size: .82rem;
    font-weight: 700;
}

.breakdown-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.breakdown-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width .5s;
}

.breakdown-amount {
    font-size: .82rem;
    font-weight: 800;
    min-width: 90px;
    text-align: right;
    color: var(--text);
}

/* ── Dashboard Mini-Stat Rows (Operational / Profit panels) ── */
.mini-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 4px;
    font-size: .85rem;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

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

.mini-stat-row.total-row {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
    border-bottom: none;
    font-weight: 800;
    font-size: .95rem;
}

.val-green {
    color: var(--success);
    font-weight: 700;
}

.val-red {
    color: var(--danger);
    font-weight: 700;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ═══════════════════════════════════════════════
   OPERATIONS REPORT KPI CARDS
   ═══════════════════════════════════════════════ */
.ops-kpi-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow .18s, transform .18s;
}

.ops-kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.ops-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.ops-kpi-label {
    font-size: .73rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ops-kpi-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -.02em;
}

.ops-kpi-profit {
    border-color: var(--success);
    background: #f0fdf4;
}

/* ── Ops Final Totals Bar ────────────────────── */
.ops-totals-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 20px 30px;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 0;
}

.ops-total-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
}

.ops-total-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ops-total-val {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -.02em;
}

.ops-total-sep {
    width: 1px;
    height: 50px;
    background: var(--border);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   EXPENSE TOTAL BAR
   ═══════════════════════════════════════════════ */
.expense-total-bar {
    background: var(--primary-light);
    border: 1px solid #c7d2fe;
    border-radius: var(--r-lg);
    padding: 14px 22px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap;
    gap: 8px;
}

.expense-total-bar span {
    font-size: .85rem;
    color: #4338ca;
    font-weight: 600;
}

.expense-total-bar strong {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--primary-dark);
}

/* ═══════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: var(--r-lg);
    background: white;
    box-shadow: var(--shadow-lg);
    font-size: .85rem;
    font-weight: 600;
    border-left: 4px solid var(--primary);
    animation: toastIn .3s cubic-bezier(.34, 1.56, .64, 1);
    transition: opacity .3s, transform .3s;
    pointer-events: auto;
    min-width: 240px;
    max-width: 340px;
}

.toast.hide {
    opacity: 0;
    transform: translateX(30px);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

.toast-success {
    border-color: var(--success);
}

.toast-success i {
    color: var(--success);
}

.toast-error {
    border-color: var(--danger);
}

.toast-error i {
    color: var(--danger);
}

.toast-info {
    border-color: var(--info);
}

.toast-info i {
    color: var(--info);
}

.toast-warning {
    border-color: var(--warning);
}

.toast-warning i {
    color: var(--warning);
}

/* ═══════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════ */
@media print {

    .sidebar,
    .topbar,
    .filter-bar,
    .row-actions,
    #toast-container,
    .modal-overlay,
    .btn-primary,
    .btn-outline,
    .btn-danger,
    .report-actions {
        display: none !important;
    }

    body {
        height: auto;
        overflow: visible;
    }

    .content-wrap {
        padding: 0;
        overflow: visible;
    }

    .section {
        display: block !important;
    }

    #sec-dashboard,
    #sec-trips,
    #sec-expenses,
    #sec-settings {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .dash-panels {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 300;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    #menu-toggle {
        display: flex;
    }

    .content-wrap {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
        height: 56px;
    }

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

    .dash-panels {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .company-fields-grid {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        width: 100%;
    }

    .settings-tab {
        flex: 1;
        text-align: center;
    }

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

    .section-header h2 {
        font-size: 1.3rem;
    }

    .logo-upload-area {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-value {
        font-size: 1.45rem;
    }

    .filter-bar {
        padding: 12px 14px;
        gap: 10px;
    }

    .filter-bar .form-group {
        min-width: calc(50% - 5px);
    }

    .breakdown-label {
        min-width: 100px;
    }

    .table-wrap {
        border-radius: var(--r);
    }

    th,
    td {
        padding: 11px 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .filter-bar .form-group {
        min-width: 100%;
    }

    .report-actions {
        gap: 6px;
    }

    .modal {
        padding: 20px;
    }

    .topbar-right .user-info {
        display: none;
    }

    .content-wrap {
        padding: 12px;
    }
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 41, .55);
    z-index: 299;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
    display: block;
}

/* ═══════════════════════════════════════════════
   PREMIUM LOGIN OVERLAY
   ═══════════════════════════════════════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f0c29 0%, #1e1b4b 40%, #302b63 70%, #24243e 100%);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

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

/* Animated floating shapes */
.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: loginFloat 18s ease-in-out infinite;
}

.login-shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6366f1, #8b5cf6);
    top: -10%;
    left: -5%;
    animation-duration: 20s;
}

.login-shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #06b6d4, #3b82f6);
    bottom: -5%;
    right: -5%;
    animation-duration: 16s;
    animation-delay: -5s;
}

.login-shape-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #ec4899, #f43f5e);
    top: 50%;
    left: 60%;
    animation-duration: 22s;
    animation-delay: -3s;
}

.login-shape-4 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #10b981, #06b6d4);
    top: 20%;
    right: 20%;
    animation-duration: 14s;
    animation-delay: -8s;
}

@keyframes loginFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(15px, 30px) scale(1.02);
    }
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    padding: 44px 40px;
    width: 100%;
    max-width: 430px;
    box-shadow:
        0 25px 60px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: loginCardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 34px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 12px 40px rgba(99, 102, 241, 0.6);
    }
}

.login-header h2 {
    font-size: 1.85rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.92rem;
    font-weight: 400;
}

/* Login Form Input Fields */
.login-field-group {
    margin-bottom: 16px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.login-input-wrap input {
    width: 100%;
    padding: 14px 48px 14px 44px;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.25s;
    outline: none;
}

.login-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-input-wrap input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-input-wrap input:focus~.login-input-icon,
.login-input-wrap input:focus+.login-input-icon {
    color: #818cf8;
}

/* Password Eye Toggle */
.login-eye-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s;
    z-index: 1;
}

.login-eye-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Forgot Password */
.login-extras {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 22px;
    margin-top: -4px;
}

.login-forgot-link {
    color: #818cf8;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    padding: 2px 0;
}

.login-forgot-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* Submit Button */
.login-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    letter-spacing: -0.01em;
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.login-submit-btn i {
    transition: transform 0.2s;
}

.login-submit-btn:hover i {
    transform: translateX(3px);
}

/* Login Footer */
.login-footer {
    margin-top: 28px;
}

.login-divider {
    position: relative;
    text-align: center;
    margin-bottom: 14px;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider span {
    background: rgba(30, 27, 75, 0.6);
    padding: 0 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
}

.login-hint {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.login-hint strong {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
    margin-top: 10px;
}

/* ═══════════════════════════════════════════════
   CLOUD BACKUP
   ═══════════════════════════════════════════════ */
.backup-action-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px 26px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.backup-action-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.backup-action-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.backup-action-header p {
    font-size: 0.85rem;
    color: var(--text-light);
    max-width: 400px;
}

.backup-history-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.backup-history-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: #fafbff;
}

.backup-history-header h4 {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
}

/* Auto Backup Card */
.backup-auto-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.backup-auto-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 26px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), transparent);
    flex-wrap: wrap;
}

.backup-auto-info h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.backup-auto-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    max-width: 420px;
}

/* Toggle Switch */
.backup-toggle {
    position: relative;
    display: inline-flex;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.backup-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.backup-toggle-slider {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.backup-toggle-slider::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.backup-toggle input:checked+.backup-toggle-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.backup-toggle input:checked+.backup-toggle-slider::before {
    transform: translateX(26px);
}

/* Schedule Grid */
.backup-schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.backup-schedule-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    transition: background 0.15s;
}

.backup-schedule-item:hover {
    background: rgba(99, 102, 241, 0.02);
}

.backup-schedule-item:nth-child(2n) {
    border-right: none;
}

.backup-schedule-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.backup-schedule-icon {
    width: 44px;
    height: 44px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.backup-schedule-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.backup-schedule-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.backup-schedule-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.backup-time-input {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    width: 120px;
}

.backup-time-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Status Badge */
.backup-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #fee2e2;
    color: #dc2626;
}

.backup-status-badge.active {
    background: #d1fae5;
    color: #059669;
}

/* Backup row badges */
.backup-type-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.backup-type-manual {
    background: #e0e7ff;
    color: #4338ca;
}

.backup-type-auto {
    background: #d1fae5;
    color: #047857;
}

.backup-success-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #d1fae5;
    color: #059669;
}

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

    .backup-schedule-item {
        border-right: none;
    }

    .backup-schedule-item:nth-last-child(2) {
        border-bottom: 1px solid var(--border);
    }

    .backup-auto-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-card {
        padding: 32px 24px;
    }

    .login-logo-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .backup-action-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Custom Confirmation Modal ────── */
.confirm-modal-card {
    border-radius: 28px !important;
    padding: 32px !important;
    text-align: center;
}

.confirm-icon {
    width: 72px;
    height: 72px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 20px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

.confirm-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ── Hubs Management ──────────────────────────── */
.hub-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.hub-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(99, 102, 241, .04), rgba(99, 102, 241, .01));
}

.hub-panel-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.hub-add-bar {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, .008);
}

.hub-add-bar input {
    flex: 1;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: .9rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color .2s;
}

.hub-add-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.hub-list {
    padding: 0;
}

.hub-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.hub-item:last-child {
    border-bottom: none;
}

.hub-item:hover {
    background: rgba(99, 102, 241, .03);
}

.hub-item-name {
    font-size: .92rem;
    font-weight: 500;
    color: var(--text);
}

.hub-item-actions {
    display: flex;
    gap: 6px;
}

.hub-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: .88rem;
}

/* Sub-field chip bar */
.hub-subfield-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(99, 102, 241, .03), transparent);
}

.hub-subfield-bar-label {
    font-size: .82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.hub-sf-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, .08);
    border: 1px solid rgba(99, 102, 241, .15);
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--primary);
}

.hub-sf-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(239, 68, 68, .1);
    color: var(--danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: .85rem;
    line-height: 1;
    transition: background .15s;
}

.hub-sf-chip button:hover {
    background: rgba(239, 68, 68, .25);
}

/* ── Mobile Layout Adjustments ───────────────── */
@media (max-width: 1024px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .sidebar {
        position: fixed;
        left: -256px;
        height: 100vh;
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(256px);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.open {
        display: block;
    }

    #menu-toggle {
        display: block;
    }

    .main {
        width: 100%;
    }

    .topbar {
        padding: 0 16px;
    }

    .content-wrap {
        padding: 16px;
    }

    .dash-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .dash-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-custom-range {
        justify-content: space-between;
    }

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

    .section-header .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Backup Table Styling ──────────────────── */
.backup-type-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 700;
}

.backup-type-auto {
    background: #f1f5f9;
    color: #475569;
}

.backup-type-manual {
    background: #e0e7ff;
    color: #4338ca;
}