/* ===== Fleet ERP - Premium Dark Theme ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    /* Brand — مؤسسة المجد والريادة (Glory & Leadership) */
    --brand-navy: #002137;
    --brand-navy-light: #002D47;
    --brand-navy-dark: #001524;
    --brand-orange: #F15A24;
    --brand-orange-dark: #D14E1A;
    --brand-grey: #939598;
    /* خلفية النماذج — أبيض + علامة مائية ترس (مطابقة لنموذج المباشرة) */
    --form-page-bg: #ffffff;
    --form-watermark: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20120%20120'%3E%3Ccircle%20cx%3D'60'%20cy%3D'60'%20r%3D'48'%20fill%3D'none'%20stroke%3D'%2523cbd5e1'%20stroke-width%3D'8'%2F%3E%3Ccircle%20cx%3D'60'%20cy%3D'60'%20r%3D'18'%20fill%3D'%2523cbd5e1'%20opacity%3D'.35'%2F%3E%3Cg%20fill%3D'%2523cbd5e1'%20opacity%3D'.35'%3E%3Crect%20x%3D'56'%20y%3D'8'%20width%3D'8'%20height%3D'18'%20rx%3D'2'%2F%3E%3Crect%20x%3D'56'%20y%3D'94'%20width%3D'8'%20height%3D'18'%20rx%3D'2'%2F%3E%3Crect%20x%3D'8'%20y%3D'56'%20width%3D'18'%20height%3D'8'%20rx%3D'2'%2F%3E%3Crect%20x%3D'94'%20y%3D'56'%20width%3D'18'%20height%3D'8'%20rx%3D'2'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
    --brand-bg-image: var(--form-watermark);
    --app-bg-overlay: none;

    /* Light Theme (Main Content) — white like brand letterhead */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8F9FB;
    --bg-subtle: #F5F6F8;
    --bg-input: #FFFFFF;
    --border: #E5E8EC;
    --border-light: #D1D5DB;
    --text-primary: #002137;
    --text-secondary: #334155;
    --text-muted: #939598;
    
    /* Dark Theme (Sidebar & Header) */
    --dark-bg-primary: var(--brand-navy-dark);
    --dark-bg-secondary: var(--brand-navy);
    --dark-border: #1a4060;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #c8daea;
    --dark-text-muted: #8aa3b8;

    /* Accents */
    --accent: var(--brand-orange);
    --accent-glow: rgba(241, 90, 36, 0.15);
    --accent-dark: var(--brand-orange-dark);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: var(--brand-navy);
    --purple: #8b5cf6;

    --sidebar-w: 240px;
    --header-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --transition: all 0.25s ease;
}

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

html { font-size: 14px; }
@media (max-width: 1280px) and (min-width: 1024px) { html { font-size: 13px; } }

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--form-page-bg);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== APP BACKGROUND (main content area only) ===== */
.main-content {
    flex: 1;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    position: relative;
    isolation: isolate;
    background: var(--form-page-bg);
    box-sizing: border-box;
}

.main-content.bg-ready::before {
    content: '';
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--form-watermark);
    background-size: min(480px, 62vw) auto;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.18;
    transition: opacity 0.35s ease;
}

.main-content.bg-ready.bg-expanded::before {
    opacity: 0.34;
}

@media (min-width: 1024px) {
    .main-content.bg-ready::before {
        right: var(--sidebar-w);
    }
}

.app-brand-overlay {
    position: fixed;
    inset: 0;
    z-index: 10060;
    background: rgba(0, 33, 55, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.app-brand-overlay[hidden] { display: none !important; }
body.brand-overlay-open { overflow: hidden; }
.app-brand-overlay-panel {
    position: relative;
    width: min(920px, 96vw);
    max-height: min(88vh, 760px);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    background: #fff;
}
.app-brand-overlay-bg {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(88vh, 760px);
    object-fit: cover;
}
.app-brand-overlay-bg.is-hidden { display: none; }
.app-brand-overlay-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(280px, 55vw);
    max-height: 40vh;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
    z-index: 2;
}
.app-brand-overlay-logo.is-hidden { display: none; }
.app-brand-overlay-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 14px 16px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 33, 55, 0.88), rgba(0, 33, 55, 0));
    z-index: 3;
}
.app-brand-overlay-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #0c2340;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.app-brand-overlay-close:hover { background: #fff; }

/* ===== Brand scrollbars (navy / orange) ===== */
body,
.table-wrapper,
.sheet-scroll-wrap,
.page-content,
#reportContent .table-wrapper {
    --sb-track: #E6ECF2;
    --sb-thumb: var(--brand-navy);
    --sb-thumb-hover: var(--brand-orange);
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
}

.sidebar,
.sidebar-nav {
    --sb-track: rgba(0, 33, 55, 0.45);
    --sb-thumb: var(--brand-navy-light);
    --sb-thumb-hover: var(--brand-orange);
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
}

body::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar,
.sheet-scroll-wrap::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
#reportContent .table-wrapper::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track,
.sheet-scroll-wrap::-webkit-scrollbar-track,
.page-content::-webkit-scrollbar-track,
#reportContent .table-wrapper::-webkit-scrollbar-track {
    background: var(--sb-track);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: var(--sb-track);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb,
.sheet-scroll-wrap::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb,
#reportContent .table-wrapper::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sb-thumb);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover,
.sheet-scroll-wrap::-webkit-scrollbar-thumb:hover,
.page-content::-webkit-scrollbar-thumb:hover,
#reportContent .table-wrapper::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-hover);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ===== APP LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(185deg, var(--brand-navy-dark) 0%, var(--brand-navy) 52%, #003556 100%);
    border-left: 3px solid var(--brand-orange);
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0,33,55,0.18);
}
.sidebar.open { transform: translateX(0); box-shadow: -8px 0 40px rgba(0,33,55,0.35); }
.sidebar-overlay.active { display: block; }

.sidebar-header {
    height: var(--header-h);
    min-height: var(--header-h);
    padding: 0 12px;
    border-bottom: 2px solid rgba(241,90,36,0.45);
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.sidebar-brand-block {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.sidebar-brand-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background: #FFFFFF;
    padding: 8px 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
    border: 1px solid rgba(241,90,36,0.25);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.sidebar-logo > div {
    min-width: 0;
    overflow: hidden;
}

.logo-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1), 0 4px 12px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: #fff;
}

.logo-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

.sidebar-header h2 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--dark-text-primary);
    white-space: nowrap;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header .subtitle {
    font-size: 0.68rem;
    color: var(--dark-text-muted);
    line-height: 1.1;
}

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--dark-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    line-height: 1;
    color: rgba(255,255,255,0.82);
    margin-bottom: 2px;
    position: relative;
}

.nav-item > span:not(.nav-icon):not(.nav-badge) {
    line-height: 1;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background: rgba(241,90,36,0.14);
    color: #ffffff;
}

.nav-item:hover .nav-icon svg { stroke: var(--brand-orange); }

.nav-item.active {
    background: linear-gradient(270deg, rgba(241,90,36,0.22) 0%, rgba(241,90,36,0.08) 100%);
    color: #ffffff;
    font-weight: 700;
}

.nav-item.active .nav-icon svg { stroke: var(--brand-orange); }

.nav-item.active::before {
    content: '';
    position: absolute;
    right: 0; top: 5px; bottom: 5px;
    width: 4px;
    background: var(--brand-orange);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(241,90,36,0.55);
}

.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; display:flex; align-items:center; justify-content:center; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 2px; }
.top-header svg { width: 20px; height: 20px; stroke-width: 2px; }

.nav-badge {
    margin-right: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 8px;
}

.sidebar-version {
    text-align: center;
    font-size: 0.7rem;
    color: var(--dark-text-muted);
    padding: 8px;
}

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

/* ===== TOP HEADER ===== */
.top-header {
    height: var(--header-h);
    min-height: var(--header-h);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    border-bottom: 2px solid rgba(241,90,36,0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(12px);
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: visible;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 42%;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
}

.header-notif-wrap {
    position: relative;
    z-index: 5;
}

.header-news {
    flex: 1 1 120px;
    min-width: 0;
    max-width: min(560px, 36vw);
    height: 34px;
    border: 1px solid rgba(241,90,36,0.22);
    border-radius: 999px;
    background: rgba(6,16,24,0.42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    overflow: hidden;
    position: relative;
}

.header-news::before,
.header-news::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34px;
    pointer-events: none;
    z-index: 2;
}

.header-news::before {
    right: 0;
    background: linear-gradient(to left, rgba(7,17,24,0.82), rgba(7,17,24,0));
}

.header-news::after {
    left: 0;
    background: linear-gradient(to right, rgba(7,17,24,0.82), rgba(7,17,24,0));
}

.header-news-track {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    white-space: nowrap;
    padding: 0 12px;
    animation: headerTicker 26s linear infinite;
    will-change: transform;
}

.header-news-track.is-static {
    animation: none;
    justify-content: center;
    width: 100%;
}

.news-chip {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    line-height: 1;
}

.news-sep {
    color: rgba(241,90,36,0.72);
    font-size: 0.8rem;
}

@keyframes headerTicker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .header-news-track { animation: none; }
}

.btn-menu {
    display: none;
    background: none; border: none;
    color: var(--dark-text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-page-guide {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(241, 90, 36, 0.55);
    background: rgba(241, 90, 36, 0.18);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.btn-page-guide:hover {
    background: rgba(241, 90, 36, 0.32);
    transform: translateY(-1px);
}
.btn-page-guide svg,
.btn-page-guide i[data-lucide] {
    width: 16px;
    height: 16px;
}

.page-guide-body { text-align: right; line-height: 1.65; }
.page-guide-hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(12,35,64,0.06), rgba(241,90,36,0.08));
    border: 1px solid rgba(12,35,64,0.1);
}
.page-guide-hero-icon { font-size: 2rem; line-height: 1; }
.page-guide-hero-title { margin: 0 0 6px; font-size: 1.15rem; color: var(--brand-navy); }
.page-guide-hero-summary { margin: 0; font-size: 0.92rem; color: var(--text-secondary); }
.page-guide-section { margin-bottom: 16px; }
.page-guide-section h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--brand-navy);
    font-weight: 800;
}
.page-guide-section p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.page-guide-list,
.page-guide-steps {
    margin: 0;
    padding-right: 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.page-guide-list li,
.page-guide-steps li { margin-bottom: 6px; }
.page-guide-detail-block {
    background: linear-gradient(135deg, #fff8f0 0%, #fff 100%);
    border: 1px solid #ffd9b3;
    border-radius: 10px;
    padding: 14px 16px;
}
.page-guide-detail-block h4 { color: #c45a00; }
.page-guide-detail {
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--text-secondary);
}
.page-guide-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.page-guide-link-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary, #f8fafc);
    cursor: pointer;
    text-align: right;
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}
.page-guide-link-btn:hover {
    border-color: var(--accent);
    background: rgba(241, 90, 36, 0.06);
}
.page-guide-link-label { font-weight: 700; font-size: 0.88rem; color: var(--brand-navy); }
.page-guide-link-desc { font-size: 0.78rem; color: var(--text-muted); }

.header-date {
    font-size: 0.8rem;
    color: var(--dark-text-muted);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--info));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

#headerUsername { font-size: 0.85rem; color: var(--dark-text-secondary); }

.btn-logout {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-logout:hover { background: var(--danger); color: #fff; }

/* ===== GLOBAL ACTIVITY FILTER (compact) ===== */
.global-activity-wrap {
    padding: 0 18px;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.global-activity-bar {
    margin: 6px 0 0;
    padding: 6px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.global-activity-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.global-activity-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin: 0;
}

.global-activity-select {
    width: auto;
    min-width: 148px;
    max-width: 240px;
    min-height: 42px;
    height: auto;
    padding: 10px 12px 10px 34px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    overflow: visible;
}

select.global-activity-select {
    background-position:
        calc(0% + 12px) 50%,
        calc(0% + 17px) 50%;
}

.global-activity-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.global-activity-hint--active {
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.86rem;
}

/* ===== VEHICLE ACCOUNT — CUSTODY PANEL ===== */
.va-custody-panel {
    margin: 0 0 16px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(241, 90, 36, 0.12);
}

.va-custody-panel-inner { padding: 14px 16px; }

.va-custody-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.va-custody-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px 14px;
    margin-bottom: 12px;
}

.va-custody-lbl {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.va-custody-deposit-box {
    padding: 12px 14px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
}

.va-custody-deposit-title { font-weight: 800; margin-bottom: 8px; }

.va-custody-deposit-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.va-custody-deposit-stats div span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.va-custody-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.va-custody-row-active td { background: rgba(241, 90, 36, 0.08) !important; }

.va-custody-panel-loading,
.va-custody-panel-error {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .va-custody-panel-actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; }
    .va-custody-table { font-size: 0.78rem; }
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    padding: 16px 18px;
    background: transparent;
    position: relative;
    z-index: 1;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===== CARDS ===== */
.card {
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    box-shadow: 0 2px 12px rgba(0,33,55,0.06);
    backdrop-filter: blur(4px);
}

.card:hover { border-color: var(--border-light); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    border-radius: 16px;
    min-height: 155px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* photo layer — blended on top of card gradient */
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    mix-blend-mode: luminosity;
    transition: transform 0.5s ease;
    z-index: 0;
    pointer-events: none;
}
.stat-card:hover::before { transform: scale(1.06); }

/* no ::after needed — gradient lives on the card itself */

/* Gradient is set directly on the card (reliable fallback + color) */
/* ::before adds the photo on top, ::after adds a semi-transparent darkening layer */
.stat-card-drivers   {
    background: linear-gradient(160deg, #001524 0%, #002D47 100%);
    box-shadow: 0 8px 24px rgba(0,33,55,0.35);
}
.stat-card-vehicles  {
    background: linear-gradient(160deg, #065f46 0%, #10b981 100%);
    box-shadow: 0 8px 24px rgba(5,150,105,0.35);
}
.stat-card-orders    {
    background: linear-gradient(160deg, #D14E1A 0%, #F15A24 100%);
    box-shadow: 0 8px 24px rgba(241,90,36,0.35);
}
.stat-card-violations{
    background: linear-gradient(160deg, #7f1d1d 0%, #ef4444 100%);
    box-shadow: 0 8px 24px rgba(220,38,38,0.35);
}
.stat-card-vouchers  {
    background: linear-gradient(160deg, #4c1d95 0%, #a78bfa 100%);
    box-shadow: 0 8px 24px rgba(124,58,237,0.35);
}
.stat-card-documents {
    background: linear-gradient(160deg, #134e4a 0%, #2dd4bf 100%);
    box-shadow: 0 8px 24px rgba(13,148,136,0.35);
}

/* Photo overlay on top of gradient */
.stat-card-drivers::before   { background-image: url('https://images.unsplash.com/photo-1600880292203-757bb62b4baf?w=500&q=70&auto=format'); opacity: 0.18; }
.stat-card-vehicles::before  { background-image: url('https://images.unsplash.com/photo-1601584115197-04ecc0da31d7?w=500&q=70&auto=format'); opacity: 0.18; }
.stat-card-orders::before    { background-image: url('https://images.unsplash.com/photo-1553413077-190dd305871c?w=500&q=70&auto=format'); opacity: 0.18; }
.stat-card-violations::before{ background-image: url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=500&q=70&auto=format'); opacity: 0.18; }
.stat-card-vouchers::before  { background-image: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?w=500&q=70&auto=format'); opacity: 0.18; }
.stat-card-documents::before { background-image: url('https://images.unsplash.com/photo-1568667256549-094345857637?w=500&q=70&auto=format'); opacity: 0.18; }

.stat-card:hover { transform: translateY(-4px); }

/* All inner elements must be z-index: 2 to sit above overlays */
.sc-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
}

.sc-icon-circle {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}
.sc-icon-circle svg { stroke: #fff; }
/* color modifiers for icon circle — used in non-dashboard pages */
.sc-icon-circle.sc-blue   { background: rgba(0,33,55,0.55);   border-color: rgba(241,90,36,0.45); }
.sc-icon-circle.sc-green  { background: rgba(5,150,105,0.4);   border-color: rgba(16,185,129,0.5); }
.sc-icon-circle.sc-red    { background: rgba(220,38,38,0.4);   border-color: rgba(239,68,68,0.5); }
.sc-icon-circle.sc-amber  { background: rgba(180,83,9,0.4);    border-color: rgba(245,158,11,0.5); }
.sc-icon-circle.sc-purple { background: rgba(124,58,237,0.4);  border-color: rgba(167,139,250,0.5); }
.sc-icon-circle.sc-teal   { background: rgba(13,148,136,0.4);  border-color: rgba(45,212,191,0.5); }

.sc-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.02em;
}

.sc-number {
    position: relative;
    z-index: 2;
    font-size: 2.6rem;
    font-weight: 900;
    color: #ffffff;
    text-align: right;
    padding: 0 16px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
}

.sc-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 14px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(4px);
}
.sc-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.sc-dot.green  { background: #34d399; box-shadow: 0 0 6px #34d399; }

/* بطاقات إحصائية داخل تبويبات السيارة — خلفية فاتحة ونص داكن */
.stat-card.veh-stat-plain {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 120px;
}
.stat-card.veh-stat-plain::before { display: none; }
.stat-card.veh-stat-plain .sc-top { padding-top: 12px; }
.stat-card.veh-stat-plain .sc-title {
    color: var(--text-secondary);
    font-weight: 700;
}
.stat-card.veh-stat-plain .sc-number {
    color: var(--text-primary);
    text-shadow: none;
    font-size: 1.35rem !important;
    font-weight: 800;
    padding: 6px 16px 4px;
}
.stat-card.veh-stat-plain .sc-number.veh-stat-success { color: var(--success); }
.stat-card.veh-stat-plain .sc-number.veh-stat-danger { color: var(--danger); }
.stat-card.veh-stat-plain .sc-footer {
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    backdrop-filter: none;
    font-weight: 600;
    line-height: 1.5;
}
.veh-weekly-stats .stat-card.veh-stat-plain:hover { transform: none; }
.sc-dot.red    { background: #f87171; box-shadow: 0 0 6px #f87171; }
.sc-dot.amber  { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.sc-dot.blue   { background: #60a5fa; box-shadow: 0 0 6px #60a5fa; }
.sc-sep { color: rgba(255,255,255,0.3); margin: 0 2px; }

/* unused old classes — keep for other pages */
.stat-card-bg-icon { display: none; }
.stat-icon-flat { display: none; }
.stat-info { display: none; }
.stat-label, .stat-value, .stat-sub { display: none; }

/* Keep .stat-icon for other pages */
.stat-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 28px; height: 28px; stroke-width: 1.6px; }
.stat-icon.blue  { background: linear-gradient(135deg, #001524, #002137); color: #fff; box-shadow: 0 6px 16px rgba(0,33,55,0.35); }
.stat-icon.green { background: linear-gradient(135deg, #059669, #10b981); color: #fff; box-shadow: 0 6px 16px rgba(5,150,105,0.3); }
.stat-icon.yellow{ background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; box-shadow: 0 6px 16px rgba(217,119,6,0.3); }
.stat-icon.orange{ background: linear-gradient(135deg, #c2410c, #ea580c); color: #fff; box-shadow: 0 6px 16px rgba(234,88,12,0.3); }
.stat-icon.amber { background: linear-gradient(135deg, #b45309, #d97706); color: #fff; box-shadow: 0 6px 16px rgba(217,119,6,0.3); }
.stat-icon.red   { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; box-shadow: 0 6px 16px rgba(220,38,38,0.3); }
.stat-icon.purple{ background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; box-shadow: 0 6px 16px rgba(124,58,237,0.3); }

/* ===== SECTION STAT CARDS (with .stat-icon) — gradient like dashboard ===== */
.stat-card:has(.stat-icon) {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    min-height: auto;
    position: relative;
    overflow: hidden;
    cursor: default;
    border: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:has(.stat-icon):hover { transform: translateY(-3px); }

/* Photo layer */
.stat-card:has(.stat-icon)::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    mix-blend-mode: luminosity;
    opacity: 0.22;
    z-index: 0;
    transition: transform 0.5s ease;
}
.stat-card:has(.stat-icon):hover::before { transform: scale(1.08); }

.stat-card:has(.stat-icon.blue) {
    background: linear-gradient(135deg, #001524 0%, #002137 55%, #002D47 100%);
    box-shadow: 0 8px 24px rgba(0,33,55,0.4);
}
.stat-card:has(.stat-icon.blue)::before {
    background-image: url('https://images.unsplash.com/photo-1600880292203-757bb62b4baf?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.green) {
    background: linear-gradient(135deg, #065f46 0%, #059669 55%, #10b981 100%);
    box-shadow: 0 8px 24px rgba(5,150,105,0.4);
}
.stat-card:has(.stat-icon.green)::before {
    background-image: url('https://images.unsplash.com/photo-1601584115197-04ecc0da31d7?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.yellow) {
    background: linear-gradient(135deg, #92400e 0%, #d97706 55%, #f59e0b 100%);
    box-shadow: 0 8px 24px rgba(180,83,9,0.4);
}
.stat-card:has(.stat-icon.yellow)::before {
    background-image: url('https://images.unsplash.com/photo-1553413077-190dd305871c?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.orange) {
    background: linear-gradient(135deg, #9a3412 0%, #c2410c 55%, #ea580c 100%);
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4);
}
.stat-card:has(.stat-icon.orange)::before {
    background-image: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.amber) {
    background: linear-gradient(135deg, #78350f 0%, #b45309 55%, #d97706 100%);
    box-shadow: 0 8px 24px rgba(180, 83, 9, 0.4);
}
.stat-card:has(.stat-icon.amber)::before {
    background-image: url('https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.red) {
    background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 55%, #ef4444 100%);
    box-shadow: 0 8px 24px rgba(220,38,38,0.4);
}
.stat-card:has(.stat-icon.red)::before {
    background-image: url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.purple) {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #a855f7 100%);
    box-shadow: 0 8px 24px rgba(124,58,237,0.4);
}
.stat-card:has(.stat-icon.purple)::before {
    background-image: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?w=500&q=70&auto=format');
}
.stat-card:has(.stat-icon.indigo) {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #6366f1 100%);
    box-shadow: 0 8px 24px rgba(79,70,229,0.4);
}
.stat-card:has(.stat-icon.indigo)::before {
    background-image: url('https://images.unsplash.com/photo-1568667256549-094345857637?w=500&q=70&auto=format');
}

/* Icon box inside section cards */
.stat-card:has(.stat-icon) .stat-icon {
    background: rgba(255,255,255,0.18) !important;
    box-shadow: none !important;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    width: 52px; height: 52px;
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2;
}
.stat-card:has(.stat-icon) .stat-icon svg { stroke: #fff; }

/* Text inside section cards */
.stat-card:has(.stat-icon) .stat-info { display: block; flex: 1; position: relative; z-index: 2; }
.stat-card:has(.stat-icon) .stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.82);
    margin-bottom: 4px;
}
.stat-card:has(.stat-icon) .stat-value {
    display: block;
    font-size: 1.55rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.stat-card:has(.stat-icon) .stat-sub {
    display: inline-block;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.7);
    margin-top: 5px;
    background: rgba(0,0,0,0.18);
    padding: 2px 8px;
    border-radius: 10px;
}
.stat-icon.indigo{ background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,0.3); }

#tabFinance .card-finance-tab {
    background: #ffffff;
    border: 1px solid var(--border);
}

@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 500px)  { .stats-grid { grid-template-columns: 1fr; } }


/* ===== BUTTONS ===== */
.btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary { background: var(--brand-navy); color: rgba(255,255,255,0.9); border-color: rgba(241,90,36,0.3); }
.btn-primary:hover { background: var(--accent); color: #ffffff; border-color: var(--accent); box-shadow: 0 4px 12px var(--accent-glow); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: #0a0e1a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-link-name {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    text-align: inherit;
    transition: var(--transition);
}
.btn-link-name:hover {
    text-decoration: underline;
    color: var(--accent);
    opacity: 0.85;
}
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-control {
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    transition: var(--transition);
}

.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Weekly sheet table — must override the global table width:100% */
.sheet-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.sheet-scroll-inner {
    max-height: 520px;
    overflow-y: auto;
}
.sheet-table {
    width: max-content !important;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
}
.sheet-table th {
    padding: 8px 12px;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.07);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}
.sheet-table td {
    padding: 7px 12px;
    text-align: center;
    border: 1px solid var(--border);
    white-space: nowrap;
}
.sheet-table tr:hover td { background: rgba(99,179,237,0.08) !important; }


table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead { background: var(--dark-bg-secondary); }

th {
    padding: 12px 14px;
    text-align: right;
    font-weight: 700;
    color: var(--dark-text-primary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--dark-border);
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
    transition: var(--transition);
}

tr { transition: var(--transition); }

tr:hover td {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

tr:hover {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* ===== COMPACT FLEET / DATA TABLES ===== */
.vehicles-page .page-content,
.vehicles-page { --fleet-density: 1; }

.stats-grid-compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.stats-grid-compact .stat-card {
    min-height: 82px;
    border-radius: 12px;
}
.stats-grid-compact .sc-top { padding: 8px 10px 0; }
.stats-grid-compact .sc-icon-circle { width: 28px; height: 28px; }
.stats-grid-compact .sc-icon-circle svg { width: 14px; height: 14px; }
.stats-grid-compact .sc-title { font-size: 0.68rem; }
.stats-grid-compact .sc-number { font-size: 1.35rem; padding: 2px 10px 0; }
.stats-grid-compact .sc-footer { display: none; }

.fleet-card-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.98);
    position: relative;
    z-index: 1;
}
.fleet-card-bar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.fleet-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 2px 8px;
    border-radius: 999px;
}
.toolbar-compact { gap: 6px; margin-bottom: 0; flex: 1; min-width: 0; }
.toolbar-compact .form-control,
.toolbar-compact .btn { min-height: 32px; padding: 5px 10px; font-size: 0.78rem; }
.fleet-select { width: auto; min-width: 96px; max-width: 130px; }
.fleet-toolbar { justify-content: flex-end; }

.table-scroll-sticky {
    overflow: auto;
    max-height: calc(100vh - var(--header-h) - 200px);
    -webkit-overflow-scrolling: touch;
}
.table-scroll-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--dark-border);
    background: var(--dark-bg-secondary) !important;
}

.table-compact.fleet-table {
    font-size: 0.76rem;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.table-compact.fleet-table th {
    padding: 5px 7px;
    font-size: 0.66rem;
    letter-spacing: 0;
    background: var(--dark-bg-secondary) !important;
}
.table-compact.fleet-table td {
    padding: 4px 7px;
    font-size: 0.74rem;
    line-height: 1.25;
}
.fleet-table .badge {
    padding: 1px 6px;
    font-size: 0.62rem;
    border-radius: 10px;
    white-space: nowrap;
}
.badge-xs { padding: 1px 5px !important; font-size: 0.6rem !important; }
.fleet-plate { font-weight: 700; color: var(--accent); white-space: nowrap; font-size: 0.73rem; }
.fleet-type { display: block; font-weight: 600; font-size: 0.72rem; }
.fleet-model { display: block; color: var(--text-muted); font-size: 0.65rem; line-height: 1.1; }
.fleet-driver { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; }
.fleet-actions { white-space: nowrap; }
.fleet-actions .btn-icon.btn-info { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.fleet-actions .btn-icon.btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.fleet-actions .btn-icon.btn-danger { color: #fff; }

.fleet-row-age-exceeded { background: rgba(239, 68, 68, 0.08) !important; }
.fleet-row-age-exceeded:hover { background: rgba(239, 68, 68, 0.12) !important; }
.fleet-row-age-warning { background: rgba(245, 158, 11, 0.06) !important; }
.fleet-row-age-warning:hover { background: rgba(245, 158, 11, 0.1) !important; }

.btn-xs {
    padding: 2px 6px;
    font-size: 0.72rem;
    line-height: 1.2;
    min-height: 24px;
    min-width: 24px;
}
.btn-icon { padding: 2px 5px; }

/* ===== EMPLOYEES TABLE ===== */
.employees-page { --emp-density: 1; }

.employees-intro {
    margin-bottom: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(0, 131, 143, 0.1), rgba(0, 131, 143, 0.03));
    border: 1px solid rgba(0, 131, 143, 0.22);
    border-radius: var(--radius);
}
.employees-intro strong { font-size: 1rem; }
.employees-intro-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.employees-card { padding: 0; overflow: hidden; }
.employees-card .table-wrapper { border: none; border-radius: 0; }

.employees-table tbody tr { transition: background 0.15s ease, box-shadow 0.15s ease; }
.employees-table .employee-name-cell { padding: 2px 6px; min-width: 160px; }

.btn-employee-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    text-align: right;
    transition: var(--transition);
}
.btn-employee-name:hover,
.btn-employee-name:focus-visible {
    background: rgba(0, 131, 143, 0.12);
    color: #006974;
    outline: none;
    box-shadow: 0 0 0 1px rgba(0, 131, 143, 0.18);
}
.btn-employee-name:active { transform: scale(0.98); }

.employee-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #26a69a);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.employee-name-text { line-height: 1.3; }

.employees-table .emp-num {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    width: 36px;
}
.employees-table .emp-role { color: var(--text-muted); font-size: 0.72rem; }
.employees-table .emp-phone {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 0.74rem;
}
.employees-table .emp-plate { font-weight: 700; color: var(--accent); white-space: nowrap; }

.employees-actions { white-space: nowrap; }
.employees-actions .btn { cursor: pointer; }
.employees-actions .btn-icon.btn-info { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.employees-actions .btn-icon.btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.employees-actions .btn-icon.btn-danger { color: #fff; }

.employees-footer {
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}
.employees-footer-meta { font-size: 0.85rem; color: var(--text-muted); }

.employees-filter-card { margin-bottom: 12px; padding: 12px 16px; }
.employees-filter-title {
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 1400px) {
    .stats-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fleet-col-hide-md { display: none; }
}
@media (max-width: 1100px) {
    .stats-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fleet-col-hide-sm { display: none; }
    .fleet-card-bar { flex-direction: column; align-items: stretch; }
    .fleet-toolbar { justify-content: stretch; }
}
@media (max-width: 768px) {
    .stats-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .table-scroll-sticky { max-height: calc(100vh - var(--header-h) - 260px); }
}

/* ===== GLASS CARD ===== */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,33,55,0.08);
}

/* ===== NOTIFICATION BELL ===== */
.notification-bell {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(241, 90, 36, 0.5);
    color: #ffffff;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 7px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.notification-bell:hover {
    background: rgba(241, 90, 36, 0.28);
    border-color: var(--brand-orange);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.22);
}

.top-header .notification-bell svg,
.notification-bell svg {
    stroke: #ffffff;
    width: 20px;
    height: 20px;
}

.notification-bell .count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--brand-navy-dark);
    animation: pulse 2s infinite;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: min(340px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid rgba(0, 33, 55, 0.1);
    border-top: 3px solid var(--brand-orange);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 33, 55, 0.22);
    z-index: 10050;
    max-height: min(440px, calc(100dvh - var(--header-h) - 24px));
    overflow-x: hidden;
    overflow-y: auto;
    display: none;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.notification-bell.has-critical {
    color: #fff;
    background: rgba(220, 38, 38, 0.22);
    border-color: rgba(248, 113, 113, 0.75);
    animation: bellShake 2.5s ease-in-out infinite;
}

.notification-bell.has-critical svg {
    stroke: #fecaca;
}

.notification-bell .count.count-critical {
    background: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
}

@keyframes bellShake {
    0%, 88%, 100% { transform: rotate(0); }
    90% { transform: rotate(12deg); }
    94% { transform: rotate(-10deg); }
    98% { transform: rotate(6deg); }
}

.notification-dropdown.open { display: block; animation: notifDropIn 0.22s ease; }

@keyframes notifDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    border-bottom: 2px solid rgba(241, 90, 36, 0.45);
    color: #fff;
}

.notif-panel-head-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.notif-panel-head-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(241, 90, 36, 0.18);
    border: 1px solid rgba(241, 90, 36, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notif-panel-head-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.notif-panel-meta {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    text-align: left;
    line-height: 1.35;
    max-width: 46%;
}

.notif-section-label {
    padding: 10px 16px 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, rgba(0, 33, 55, 0.05), transparent);
    border-bottom: 1px solid rgba(0, 33, 55, 0.06);
}

.notif-section-critical {
    color: #b91c1c;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), transparent);
}

.notif-empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    background: var(--bg-subtle);
    line-height: 1.5;
}

.notif-panel-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.notif-panel-foot .btn-sm {
    font-size: 0.72rem;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
}

.notification-bell.bell-ring {
    animation: bellRing 0.55s ease-in-out 2;
}
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid rgba(0, 33, 55, 0.06);
    text-align: right;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    color: var(--text-primary);
    transition: background 0.18s ease;
}

.notif-item:hover { background: rgba(0, 33, 55, 0.035); }

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-title {
    display: block;
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--brand-navy);
    line-height: 1.45;
}

.notif-item-sub {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

.notif-item-arrow {
    color: var(--brand-orange);
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0.85;
    margin-top: 2px;
    flex-shrink: 0;
}

.notif-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: rgba(0, 33, 55, 0.06);
    border: 1px solid rgba(0, 33, 55, 0.08);
}

.notif-icon-wrap--inbox {
    background: rgba(0, 33, 55, 0.08);
    border-color: rgba(0, 33, 55, 0.14);
}

.notif-icon-wrap--critical {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
}

.notif-icon-wrap--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
}

.notif-icon-wrap--info {
    background: rgba(0, 33, 55, 0.06);
    border-color: rgba(241, 90, 36, 0.22);
}

.notif-item-unread {
    background: linear-gradient(90deg, rgba(0, 33, 55, 0.05) 0%, #fff 100%);
    border-right: 3px solid var(--brand-navy);
}

.notif-item-critical {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.07) 0%, #fff 100%);
    border-right: 3px solid var(--danger);
}

.notif-item-warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.07) 0%, #fff 100%);
    border-right: 3px solid var(--warning);
}

.notif-item-actionable {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 33, 55, 0.06);
}

.notif-item-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.notif-item-actions .btn-sm {
    font-size: 0.7rem;
    padding: 5px 9px;
    font-weight: 700;
}

/* ===== ALERT ACTION BANNER ===== */
.alert-action-banner {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.12), rgba(244, 121, 32, 0.1));
    border-bottom: 1px solid rgba(220, 38, 38, 0.35);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.alert-action-banner.open {
    max-height: 80px;
    padding: 10px 16px;
}

.alert-action-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.alert-action-banner-icon { font-size: 1.2rem; }

.alert-action-banner-text {
    flex: 1;
    min-width: 200px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.alert-action-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.alert-banner-dismiss { min-width: 36px; padding: 4px 10px; }

.alert-center-modal .notif-panel-foot {
    position: sticky;
    bottom: 0;
}

.alert-center-modal {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    margin: -4px 0;
}

.alert-center-modal .notif-item:last-of-type {
    border-bottom: none;
}

.notif-item .notif-time { color: var(--text-muted); font-size: 0.7rem; }

/* ===== QUICK ACTIONS ===== */
/* ===== DASHBOARD HERO BANNER ===== */
.dashboard-hero {
    background:
        linear-gradient(rgba(0,33,55,0.38), rgba(0,33,55,0.52));
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(241,90,36,0.18);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
    min-height: 190px;
}
.dashboard-hero.bg-ready {
    background:
        linear-gradient(rgba(0,33,55,0.38), rgba(0,33,55,0.52)),
        url('../img/hero-banner.webp') center 78%/cover no-repeat;
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: 30%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(241,90,36,0.12) 0%, transparent 65%);
    pointer-events: none;
}
.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: 10%;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(0,33,55,0.08) 0%, transparent 65%);
    pointer-events: none;
}

/* ===== HERO — LEFT BRAND COLUMN ===== */
.hero-brand-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    z-index: 1;
}
.hero-logo-ring {
    position: relative;
    width: 120px; height: 120px;
    flex-shrink: 0;
}
.hero-logo-img {
    width: 120px; height: 120px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
    position: relative;
    z-index: 1;
    border: none;
    box-shadow: none;
    transform: scaleX(-1);
    filter: drop-shadow(0 4px 16px rgba(241,90,36,0.25));
}
.hero-logo-orbit { display: none; }
.hero-logo-orbit::after { display: none; }
.hero-brand-info { text-align: center; }
.hero-brand-name {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.hero-accent-gold {
    color: #e8c97a;
    text-shadow: 0 0 12px rgba(232,201,122,0.5);
}
.hero-brand-en {
    font-size: 0.7rem;
    color: rgba(241,90,36,0.7);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}
.hero-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.68rem;
    color: #10b981;
    font-weight: 700;
    margin-top: 6px;
}
.hero-live-dot {
    width: 6px; height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* ===== HERO — CENTER TYPEWRITER COLUMN ===== */
.hero-center-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 10px;
    z-index: 1;
    min-width: 0;
    flex: 1;
}
.hero-tagline-small {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: left;
}
.hero-typewriter-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    min-height: 2.4rem;
}
.hero-type-text {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
    white-space: nowrap;
    text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.hero-cursor-blink {
    font-size: 1.4rem;
    font-weight: 300;
    color: #F15A24;
    animation: cursorBlink 0.9s step-end infinite;
    line-height: 1;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.hero-pill.teal   { background: rgba(241,90,36,0.15);  border: 1px solid rgba(241,90,36,0.3);  color: #F15A24; }
.hero-pill.blue   { background: rgba(0,33,55,0.15);  border: 1px solid rgba(0,33,55,0.3);  color: #7eb8d4; }
.hero-pill.green  { background: rgba(5,150,105,0.15);  border: 1px solid rgba(5,150,105,0.3);  color: #34d399; }
.hero-pill.amber  { background: rgba(217,119,6,0.15);  border: 1px solid rgba(217,119,6,0.3);  color: #fbbf24; }
.hero-pill.purple { background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3); color: #c084fc; }

/* ===== HERO — RIGHT MOCKUP COLUMN ===== */
.hero-mockup-col {
    flex-shrink: 0;
    width: 420px;
    z-index: 1;
}
.hero-mockup-frame {
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(241,90,36,0.25),
        0 20px 50px rgba(0,0,0,0.5),
        0 0 30px rgba(241,90,36,0.08);
    transform: perspective(900px) rotateY(4deg) rotateX(-2deg);
    transition: transform 0.4s ease;
}
.hero-mockup-frame:hover {
    transform: perspective(900px) rotateY(1deg) rotateX(-0.5deg);
}
.hero-mockup-topbar {
    background: #0a1628;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-bottom: 1px solid rgba(241,90,36,0.15);
}
.hero-mock-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hero-mock-dot.red   { background: #ef4444; }
.hero-mock-dot.amber { background: #f59e0b; }
.hero-mock-dot.green { background: #10b981; }
.hero-mock-title {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    margin-right: 8px;
    flex: 1;
    text-align: center;
    letter-spacing: 0.03em;
}

@media (max-width: 1100px) {
    .hero-mockup-col { width: 340px; }
}
@media (max-width: 900px) {
    .hero-mockup-col { display: none; }
    .hero-center-col { flex: 1; }
}
@media (max-width: 600px) {
    .dashboard-hero { flex-direction: column; align-items: flex-start; min-height: auto; padding: 20px; }
    .hero-brand-col { flex-direction: row; }
    .hero-logo-ring { width: 60px; height: 60px; }
    .hero-logo-img { width: 60px; height: 60px; }
    .hero-type-text { font-size: 1rem; }
}

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.quick-action-btn {
    padding: 8px 16px;
    background: var(--brand-navy);
    border: 1px solid rgba(241,90,36,0.25);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quick-action-btn svg { width: 16px; height: 16px; stroke-width: 2px; color: var(--accent); }
.quick-action-btn i[data-lucide] { color: var(--accent); }

.quick-action-btn:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.quick-action-btn:hover svg { color: #ffffff; }

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RISK SCORE / ACCOUNTING CARDS ===== */
.stat-card.risk-high,
.stat-card.risk-medium,
.stat-card.risk-low {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 20px !important;
    border-radius: 16px;
    border: none !important;
    position: relative;
    overflow: hidden;
    min-height: 110px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card.risk-high:hover,
.stat-card.risk-medium:hover,
.stat-card.risk-low:hover { transform: translateY(-3px); }

/* photo layer */
.stat-card.risk-high::before,
.stat-card.risk-medium::before,
.stat-card.risk-low::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    mix-blend-mode: luminosity;
    opacity: 0.2;
    z-index: 0;
    transition: transform 0.5s ease;
}
.stat-card.risk-high:hover::before,
.stat-card.risk-medium:hover::before,
.stat-card.risk-low:hover::before { transform: scale(1.08); }

.stat-card.risk-low {
    background: linear-gradient(135deg, #065f46 0%, #059669 55%, #10b981 100%);
    box-shadow: 0 8px 24px rgba(5,150,105,0.4);
}
.stat-card.risk-low::before {
    background-image: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?w=500&q=70&auto=format');
}
.stat-card.risk-medium {
    background: linear-gradient(135deg, #92400e 0%, #d97706 55%, #f59e0b 100%);
    box-shadow: 0 8px 24px rgba(180,83,9,0.4);
}
.stat-card.risk-medium::before {
    background-image: url('https://images.unsplash.com/photo-1553413077-190dd305871c?w=500&q=70&auto=format');
}
.stat-card.risk-high {
    background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 55%, #ef4444 100%);
    box-shadow: 0 8px 24px rgba(220,38,38,0.4);
}
.stat-card.risk-high::before {
    background-image: url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=500&q=70&auto=format');
}

/* text fix for accounting cards */
.stat-card.risk-high .stat-info,
.stat-card.risk-medium .stat-info,
.stat-card.risk-low .stat-info { display: block; position: relative; z-index: 2; }

.stat-card.risk-high .stat-label,
.stat-card.risk-medium .stat-label,
.stat-card.risk-low .stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
}
.stat-card.risk-high .stat-value,
.stat-card.risk-medium .stat-value,
.stat-card.risk-low .stat-value {
    display: block !important;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
/* also handle inline color overrides from JS */
.stat-card.risk-high [style*="color:"],
.stat-card.risk-medium [style*="color:"],
.stat-card.risk-low [style*="color:"] { color: #ffffff !important; }

/* ===== ACCOUNTING MODULE LAYOUT ===== */
.acc-layout-root {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.acc-sidebar {
    width: min(260px, 100%);
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    padding: 0;
    overflow: hidden;
}
.acc-sidebar-header {
    position: relative;
    padding: 22px 18px 18px;
    background: linear-gradient(160deg, #002137, #002D47);
    overflow: hidden;
}
.acc-sidebar-header-bg {
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?w=400&q=60') center/cover no-repeat;
    opacity: 0.12;
    mix-blend-mode: luminosity;
}
.acc-sidebar-header-inner {
    position: relative;
    z-index: 1;
}
.acc-sidebar-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
    line-height: 1;
}
.acc-sidebar-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}
.acc-sidebar-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}
.acc-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
}
.acc-nav-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 4px;
    flex-shrink: 0;
}
.acc-main {
    flex: 1;
    min-width: 0;
}
.acc-loading,
.acc-loading-inner {
    text-align: center;
    padding: 48px 16px;
}
.acc-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 540px) {
    .acc-stats-overview { grid-template-columns: 1fr; gap: 8px; }
}

/* ===== ACCOUNTING SIDEBAR NAV BUTTON ===== */
.acc-nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    transition: var(--transition);
}
.acc-nav-btn:hover {
    background: rgba(241,90,36,0.08);
    color: var(--text-primary);
}

/* ===== REPORT TABS ===== */
.report-tabs {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.stats-grid-report-debts {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.stats-grid-report-debts .stat-card:has(.stat-icon) {
    cursor: default;
    min-height: auto;
}
.stats-grid-report-debts .stat-card:has(.stat-icon) .stat-value {
    font-size: 1.25rem;
    line-height: 1.2;
}
.stats-grid-report-debts .stat-card:has(.stat-icon) .stat-label {
    font-size: 0.76rem;
    line-height: 1.35;
}
.stats-grid-report-debts .stat-card:has(.stat-icon) .stat-sub {
    font-size: 0.72rem;
    margin-top: 4px;
}
.report-content-area,
#reportFilters {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.report-tabs .tab {
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.8rem;
    background: #002D47;
    color: rgba(255,255,255,0.75);
}
.report-tabs .tab.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ===== EXPIRY DANGER ROW ===== */
.expiry-danger { background: rgba(239,68,68,0.06) !important; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(99,102,241,0.15); color: var(--info); }
.badge-secondary { background: rgba(148,163,184,0.2); color: var(--text-muted); }
.badge-muted { background: rgba(107,113,148,0.15); color: var(--text-muted); }
.badge-accent { background: var(--accent-glow); color: var(--accent); }

.custody-photo-badge {
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 4px 10px;
    border-radius: 999px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.custody-photo-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.custody-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.custody-photo-card {
    margin: 0;
    text-align: center;
}
.custody-photo-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    background: var(--surface-2);
}
.custody-photo-card figcaption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.custody-photo-missing img {
    opacity: 0.35;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 6px;
    border-bottom: none;
    margin-bottom: 16px;
    overflow-x: auto;
    padding: 4px 2px;
    flex-wrap: wrap;
}

.tab {
    padding: 9px 18px;
    font-size: 0.84rem;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 30px;
    transition: var(--transition);
    white-space: nowrap;
    background: #002D47;
    font-family: inherit;
}

.tab:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.6);
    background: #152d42;
}
.tab.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}

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

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }

/* POS Merchant Statement reconciliation */
.pos-reconcile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 10px;
}
.pos-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.pos-stat-card strong {
    display: block;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}
.pos-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.pos-reconcile-intro {
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(59,130,246,0.04), transparent);
}

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

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; }

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow);
    min-width: 280px;
    text-align: center;
}

.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #0a0e1a; }
.toast-info { background: var(--info); color: #fff; }

/* ===== SEARCH & FILTER BAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
}

.search-box input:focus { outline: none; border-color: var(--accent); }

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

/* ===== EXPIRY COLORS ===== */
.expiry-valid { color: var(--success); }
.expiry-warning { color: var(--warning); }
.expiry-expired { color: var(--danger); font-weight: 700; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-secondary); }

/* ===== FOOTER ===== */
.app-footer {
    padding: 16px 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.72);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}

.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 400px;
    text-align: center;
}

.confirm-box p { margin-bottom: 20px; font-size: 0.95rem; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #001a2e;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.login-bg-slide {
    position: absolute;
    top: -4%;
    right: -4%;
    bottom: -4%;
    left: -4%;
    width: 108%;
    height: 108%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.06);
    will-change: opacity, transform;
    animation: loginBgShow 24s ease-in-out infinite;
}

.login-bg-slide:nth-child(1) { animation-delay: 0s; }
.login-bg-slide:nth-child(2) { animation-delay: 6s; }
.login-bg-slide:nth-child(3) { animation-delay: 12s; }
.login-bg-slide:nth-child(4) { animation-delay: 18s; }

.login-bg-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, rgba(0, 33, 55, 0.82) 0%, rgba(0, 33, 55, 0.55) 45%, rgba(0, 33, 55, 0.78) 100%),
        radial-gradient(circle at 20% 20%, rgba(244, 121, 32, 0.12), transparent 42%);
}

@keyframes loginBgShow {
    0% {
        opacity: 0;
        transform: scale(1.06);
    }
    4% {
        opacity: 1;
    }
    21% {
        opacity: 1;
        transform: scale(1.12);
    }
    25%, 100% {
        opacity: 0;
        transform: scale(1.14);
    }
}

.login-page.bg-ready::before {
    display: none;
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-card .logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .logo-section .icon {
    width: 90px; height: 90px;
    background: transparent;
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin-bottom: 12px;
}

.login-card h1 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.login-card .subtitle { color: var(--text-muted); font-size: 0.85rem; }

.login-card .form-control {
    padding: 12px 16px;
    font-size: 0.95rem;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 12px;
    display: none;
}

.login-password-wrap {
    position: relative;
}

.login-password-wrap .form-control {
    padding-left: 44px;
}

.login-password-toggle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.65;
    padding: 0;
}

.login-password-toggle:hover {
    opacity: 1;
    background: rgba(0, 33, 55, 0.06);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #002137);
    cursor: pointer;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .login-bg-slide {
        animation: none;
        opacity: 0;
        transform: none;
    }
    .login-bg-slide:first-child {
        opacity: 1;
    }
}

/* ===== DRIVER PROFILE CARDS ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(241,90,36,0.05), rgba(0,33,55,0.05));
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--info));
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.profile-info h2 { font-size: 1.2rem; font-weight: 700; }
.profile-info .meta { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }
.profile-info .meta span { margin-left: 16px; }

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    margin-right: auto;
}
.btn-employee-file {
    white-space: nowrap;
    font-weight: 700;
    padding: 10px 16px;
    box-shadow: 0 4px 14px rgba(241, 90, 36, 0.25);
}
.ef-file-modal-intro {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin-right: auto;
}

.profile-stat {
    text-align: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.profile-stat .val { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.profile-stat .lbl { font-size: 0.7rem; color: var(--text-muted); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
    /* Layout: override sidebar width for mobile/tablet */
    .sidebar { width: min(82vw, 290px); z-index: 200; }
    .app-footer { display: none; }
    .page-content { padding: 12px; padding-bottom: 82px; }

    /* Top Header */
    :root { --header-h: 52px; }
    .top-header { padding: 0 12px; gap: 8px; }
    .btn-menu {
        display: flex; align-items: center; justify-content: center;
        width: 36px; height: 36px; border-radius: 8px; padding: 0;
        background: rgba(241,90,36,0.08); border: 1px solid rgba(241,90,36,0.18);
        flex-shrink: 0;
    }
    .btn-menu i[data-lucide] { width: 20px; height: 20px; }
    .page-title { font-size: 0.88rem; font-weight: 700; }
    .page-title i[data-lucide] { width: 16px; height: 16px; vertical-align: middle; }
    .btn-page-guide { padding: 6px 8px; }
    .btn-page-guide .page-guide-label { display: none; }
    .header-date { display: none; }
    .header-user span { display: none; }
    .btn-logout { display: none; }
    .notification-bell {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 8px;
        padding: 6px;
        border-width: 1.5px;
    }
    .notification-bell i[data-lucide],
    .notification-bell svg { width: 18px; height: 18px; }
    .user-avatar-sm { width: 30px; height: 30px; font-size: 0.75rem; flex-shrink: 0; }
    .header-left { gap: 6px; }
    .header-right { gap: 8px; }
    .header-news { display: none; }

    /* Dashboard stat cards (sc-*) */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { border-radius: 14px; }
    .sc-top { padding: 12px 12px 0; }
    .sc-icon-circle { width: 38px; height: 38px; }
    .sc-icon-circle svg { width: 18px; height: 18px; stroke-width: 2px; }
    .sc-title { font-size: 0.76rem; }
    .sc-number { font-size: 1.9rem; padding: 4px 12px 2px; }
    .sc-footer { font-size: 0.65rem; padding: 8px 12px 12px; gap: 4px; }
    .sc-sep { display: none; }

    /* Section stat cards (stat-icon) */
    .stat-card:has(.stat-icon) { padding: 12px 14px; gap: 12px; }
    .stat-card:has(.stat-icon) .stat-icon { width: 42px; height: 42px; font-size: 1.15rem; border-radius: 10px; }
    .stat-card:has(.stat-icon) .stat-value { font-size: 1.25rem; }
    .stat-card:has(.stat-icon) .stat-label { font-size: 0.7rem; }

    /* Buttons */
    .btn { font-size: 0.82rem; padding: 9px 14px; border-radius: 8px; }
    .btn-sm { font-size: 0.76rem; padding: 6px 10px; }
    .btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
    .btn-icon svg, .btn-icon i[data-lucide] { width: 16px; height: 16px; }
    .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .toolbar .btn { justify-content: center; width: 100%; }

    /* Cards */
    .card { padding: 14px; border-radius: 14px; }
    .card-header { margin-bottom: 12px; }
    .card-header h3, .section-title, .card h3 { font-size: 0.9rem; }

    /* Forms */
    .form-row, .form-row-3, .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 10px; }
    .form-label { font-size: 0.8rem; margin-bottom: 5px; }
    .form-control { font-size: 16px; padding: 9px 12px; border-radius: 8px; }
    select { font-size: 16px; }

    /* Tables */
    .table-container { border-radius: 10px; }
    table { min-width: 560px; font-size: 0.8rem; }
    th { font-size: 0.72rem; padding: 10px 8px; }
    td { padding: 9px 8px; font-size: 0.8rem; }

    /* Hero */
    .dashboard-hero { min-height: auto; border-radius: 14px; padding: 16px; }
    .hero-type-text { font-size: 1.2rem; }
    .hero-logo-img { width: 80px; height: 80px; }
    .hero-pills { gap: 4px; flex-wrap: wrap; }
    .hero-pill { font-size: 0.62rem; padding: 3px 8px; border-radius: 20px; }
    .quick-actions { gap: 6px; flex-wrap: wrap; }
    .quick-action-btn { padding: 8px 12px; font-size: 0.76rem; border-radius: 8px; }

    /* Sidebar nav items */
    .nav-item { font-size: 0.88rem; padding: 11px 14px; }
    .nav-icon svg { width: 17px; height: 17px; }
    .sidebar-header h2 { font-size: 0.95rem; }
    .nav-section-title { font-size: 0.65rem; }

    /* Modal */
    .modal { margin: 8px; max-height: calc(100dvh - 16px); border-radius: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; }
    .modal-header h3 { font-size: 0.92rem; }
    .modal-close { width: 30px; height: 30px; font-size: 1rem; }

    /* Profile */
    .profile-header { flex-direction: column; text-align: center; gap: 12px; }
    .profile-stats { width: 100%; justify-content: center; }

    /* Hero tagline — hidden on mobile */
    .hero-tagline-small { display: none; }

    /* Assistant — floats above bottom nav */
    .assistant-toggle-btn {
        bottom: 72px; left: 14px;
        width: 46px; height: 46px; font-size: 0;
        padding: 0;
    }
    .assistant-panel {
        left: 8px; right: 8px; width: auto; bottom: 72px;
        height: min(560px, calc(100dvh - 155px));
        border-radius: 16px;
    }
    .assistant-messages { min-height: 120px; }
}

@media (max-width: 480px) {
    /* Tighter on very small phones */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .card { padding: 12px; }
    .page-content { padding: 10px; padding-bottom: 82px; }
    .sc-number { font-size: 1.65rem; }
    .sc-title { font-size: 0.7rem; }
    .sc-icon-circle { width: 34px; height: 34px; }
    .sc-icon-circle svg { width: 16px; height: 16px; }
    .hero-type-text { font-size: 1.05rem; }
    .hero-logo-img { width: 66px; height: 66px; }
    :root { --header-h: 50px; }
    .top-header { padding: 0 10px; }
    .modal { margin: 4px; }
    .btn { font-size: 0.8rem; padding: 8px 12px; }
    .quick-action-btn { font-size: 0.72rem; padding: 7px 10px; }
    table { min-width: 500px; }
    th { font-size: 0.68rem; padding: 8px 6px; }
    td { font-size: 0.76rem; padding: 8px 6px; }
    .stat-card:has(.stat-icon) { padding: 10px 12px; gap: 10px; }
    .stat-card:has(.stat-icon) .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; }
    .stat-card:has(.stat-icon) .stat-value { font-size: 1.1rem; }
    .stat-card:has(.stat-icon) .stat-label { font-size: 0.66rem; }
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    background: linear-gradient(180deg, #002D47 0%, #002137 100%);
    border-top: 1px solid rgba(241,90,36,0.18);
    z-index: 150;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
@media (max-width: 768px) {
    .mobile-bottom-nav { display: flex; }
}
.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-height: 54px;
    cursor: pointer;
    border-radius: 10px;
    padding: 6px 2px;
    transition: all 0.2s ease;
    color: rgba(255,255,255,0.4);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.mob-nav-item i[data-lucide] { width: 22px; height: 22px; stroke-width: 1.8px; }
.mob-nav-item span { font-size: 0.6rem; font-weight: 600; font-family: inherit; }
.mob-nav-item.active { color: #F15A24; }
.mob-nav-item:active { background: rgba(255,255,255,0.06); transform: scale(0.93); }

/* ===== MOBILE: Touch improvements ===== */
@media (hover: none) and (pointer: coarse) {
    .nav-item { padding: 13px 14px; min-height: 44px; }
    .btn, .btn-primary, .btn-secondary, .btn-danger, .btn-success { min-height: 44px; }
    .form-control, select, input[type=text], input[type=password], input[type=number],
    input[type=email], input[type=date], textarea { min-height: 44px; font-size: 16px; }
    .quick-action-btn { min-height: 42px; }
    .stat-card { -webkit-tap-highlight-color: transparent; }
}

/* ===== DESKTOP: sidebar always visible ===== */
@media (min-width: 1024px) {
    .sidebar { transform: none !important; width: var(--sidebar-w); }
    .main-content {
        margin-right: var(--sidebar-w);
        width: calc(100% - var(--sidebar-w));
        max-width: calc(100% - var(--sidebar-w));
    }
    .btn-menu { display: none !important; }
    .mobile-bottom-nav { display: none !important; }
}

/* ===== ASSISTANT WELCOME VIDEO (first open) ===== */
.assistant-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 21, 41, 0.72);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.assistant-welcome-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.assistant-welcome-card {
    width: min(920px, 96vw);
    max-height: min(860px, 94dvh);
    background: #0b243b;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    box-shadow: 0 28px 90px rgba(0,0,0,0.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #fff;
}
.assistant-welcome-top,
.assistant-welcome-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
}
.assistant-welcome-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.assistant-welcome-brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
}
.assistant-welcome-brand strong {
    display: block;
    font-size: 0.95rem;
}
.assistant-welcome-brand span {
    display: block;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
}
.assistant-welcome-skip {
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}
.assistant-welcome-skip:hover { background: rgba(255,255,255,0.08); }
.assistant-welcome-stage {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
    max-height: min(70dvh, 560px);
}
.assistant-welcome-stage video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}
.assistant-welcome-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background: rgba(241, 90, 36, 0.95);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.assistant-welcome-foot span {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
}
@media (max-width: 640px) {
    .assistant-welcome-card { border-radius: 14px; }
    .assistant-welcome-brand strong { font-size: 0.88rem; }
    .assistant-welcome-stage { max-height: 52dvh; }
}

/* ===== ASSISTANT CHAT — ChatGPT-style ===== */
.assistant-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 21, 41, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.assistant-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.assistant-toggle-btn {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1001;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f15a24, #c2410c);
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(241,90,36,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: visible;
}
.assistant-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 10px 36px rgba(241,90,36,0.45); }
.assistant-toggle-btn.active { transform: scale(0.96); }
.assistant-icon { position: relative; z-index: 1; line-height: 1; }
.assistant-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(241,90,36,0.35);
    animation: assistantPulse 2s ease-in-out infinite;
}
@keyframes assistantPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.25); opacity: 0; }
}

.assistant-panel {
    position: fixed;
    left: 24px;
    bottom: 92px;
    z-index: 1000;
    width: 420px;
    height: min(640px, calc(100dvh - 120px));
    background: #f7f7f8;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
.assistant-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.assistant-panel.is-expanded {
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(1);
    width: min(920px, 94vw);
    height: min(860px, 92dvh);
    border-radius: 24px;
    box-shadow: 0 32px 100px rgba(0,0,0,0.28);
}
.assistant-panel.is-expanded.open {
    transform: translate(-50%, -50%) scale(1);
}

.assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.assistant-header-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.assistant-avatar {
    width: 38px; height: 38px;
    background: #fff;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(241,90,36,0.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.assistant-avatar img { width: 100%; height: 100%; object-fit: contain; }
.assistant-icon img.ast-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.assistant-toggle-btn .assistant-icon { display: flex; align-items: center; justify-content: center; }
.assistant-name { font-size: 0.92rem; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assistant-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; color: #64748b; margin-top: 2px;
}
.assistant-status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
    animation: statusPulse 2s ease infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.assistant-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.assistant-icon-btn {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.assistant-icon-btn:hover { background: #f1f5f9; color: #0f172a; }
.assistant-icon-btn-close:hover { background: #fee2e2; color: #dc2626; }
.assistant-panel.is-expanded .icon-expand { display: none; }
.assistant-panel:not(.is-expanded) .icon-shrink { display: none; }

.assistant-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f7f7f8;
}

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}
.assistant-panel.is-expanded .assistant-messages {
    padding: 28px max(16px, calc((100% - 720px) / 2));
}

.assistant-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: msgSlideIn 0.25s ease;
    max-width: 100%;
}
@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.assistant-msg.user-msg { justify-content: flex-end; }

.msg-avatar {
    width: 32px; height: 32px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    margin-top: 22px;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: contain; }

.msg-content { flex: 1; min-width: 0; max-width: calc(100% - 44px); }
.msg-content-user { flex: none; max-width: 85%; }

.msg-meta {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px; font-size: 0.72rem; color: #94a3b8;
}
.msg-meta-user { justify-content: flex-end; }
.msg-sender { font-weight: 600; color: #64748b; }

.msg-bubble {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.75;
    word-break: break-word;
    color: #1e293b;
}
.bot-msg .msg-bubble {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.user-msg .msg-bubble {
    background: linear-gradient(135deg, #002137, #003d66);
    color: #fff;
    border-radius: 16px 4px 16px 16px;
    text-align: right;
    box-shadow: 0 4px 14px rgba(0,33,55,0.2);
}
.msg-bubble .msg-p { margin: 0 0 8px; }
.msg-bubble .msg-p:last-child { margin-bottom: 0; }
.msg-bubble .msg-li {
    position: relative;
    padding-right: 16px;
    margin-bottom: 6px;
}
.msg-bubble .msg-li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--accent, #f15a24);
    font-weight: 700;
}
.msg-bubble .msg-ol { margin-bottom: 6px; padding-right: 4px; }
.msg-bubble .msg-heading { font-weight: 700; color: #0f172a; margin: 10px 0 6px; }
.msg-bubble .msg-h1 { font-size: 1rem; }
.msg-bubble .msg-h2 { font-size: 0.95rem; }
.msg-bubble .msg-h3 { font-size: 0.9rem; }
.msg-bubble strong { color: #0f172a; font-weight: 700; }
.user-msg .msg-bubble strong { color: #fff; }

.msg-table-wrap { overflow-x: auto; margin: 10px 0; border-radius: 10px; border: 1px solid rgba(0,0,0,0.08); }
.msg-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.msg-table th, .msg-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid rgba(0,0,0,0.06); }
.msg-table th { background: #f1f5f9; font-weight: 700; color: #0f172a; }
.msg-table tr:last-child td { border-bottom: none; }

.typing-msg .msg-bubble { padding: 16px 20px; min-width: 56px; }
.typing-dots { display: inline-flex; gap: 5px; align-items: center; height: 12px; }
.typing-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.assistant-quick {
    padding: 10px 14px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: #fff;
    flex-shrink: 0;
}
.assistant-quick-btn {
    background: #f7f7f8;
    border: 1px solid rgba(0,0,0,0.08);
    color: #475569;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.assistant-quick-btn:hover {
    background: #fff7ed;
    border-color: #f15a24;
    color: #c2410c;
    box-shadow: 0 2px 8px rgba(241,90,36,0.12);
}

.assistant-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f15a24, #ea580c);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(241,90,36,0.25);
}
.assistant-action-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(241,90,36,0.35); }
.stream-action { display: block; }

.assistant-composer {
    padding: 12px 14px 14px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.assistant-composer-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f7f7f8;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 16px;
    padding: 8px 8px 8px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.assistant-composer-box:focus-within {
    border-color: rgba(241,90,36,0.45);
    box-shadow: 0 0 0 3px rgba(241,90,36,0.1);
    background: #fff;
}
.assistant-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 6px 0;
    font-size: 0.9rem;
    color: #1e293b;
    font-family: inherit;
    direction: rtl;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
}
.assistant-input::placeholder { color: #94a3b8; }
.assistant-send-btn {
    width: 36px; height: 36px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.assistant-send-btn:hover { background: #f15a24; transform: scale(1.05); }
.assistant-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.assistant-composer-hint {
    margin-top: 8px;
    text-align: center;
    font-size: 0.68rem;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .assistant-panel.is-expanded {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    .assistant-panel.is-expanded.open { transform: none; }
}

@media (max-width: 480px) {
    .assistant-panel {
        left: 8px; right: 8px; width: auto; bottom: 72px;
        height: min(580px, calc(100dvh - 150px));
        border-radius: 18px;
    }
    .assistant-toggle-btn { left: 12px; bottom: 72px; width: 46px; height: 46px; }
    .assistant-messages { padding: 14px 12px; gap: 16px; }
    .assistant-composer-hint { display: none; }
}

/* =====================================================
   Document Manager Styles — v1.0
   ===================================================== */

/* ── Document grid ── */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* ── Per-type card ── */
.doc-type-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.doc-type-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.07); }

.doc-type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.doc-type-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ── Empty slot / drop target ── */
.doc-empty-slot {
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.doc-empty-slot:hover { background: var(--accent-glow); }

/* ── File list inside a type card ── */
.doc-files-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.doc-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.1s;
}
.doc-file-item:hover { background: var(--bg-card-hover); }

.doc-preview-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid var(--border);
}
.doc-preview-pdf {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    cursor: pointer;
    gap: 2px;
    flex-shrink: 0;
    background: var(--bg-primary);
}
.doc-preview-pdf:hover { border-color: var(--accent); }

.doc-file-info { flex: 1; min-width: 0; }

.doc-file-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Small icon buttons ── */
.btn-icon-sm {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.1s;
    padding: 0;
}
.btn-icon-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon-sm.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); }

/* ── Upload drop zone ── */
.upload-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.upload-drop-zone:hover { border-color: var(--accent); background: var(--accent-glow); }
.upload-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.01);
}

/* ── Mobile doc grid ── */
@media (max-width: 600px) {
    .doc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .doc-type-header { padding: 8px 10px; }
    .doc-type-icon { font-size: 1.1rem; }
}
@media (max-width: 380px) {
    .doc-grid { grid-template-columns: 1fr; }
}

/* ==================================================================
   MOBILE RESPONSIVE OVERHAUL — v2.0
   Converts tables to cards, fixes layouts, improves touch targets.
   ================================================================== */

/* ===== Tables that auto-convert to cards on mobile =====
   Markup:    `<table class="mobile-cards">`  (or any table inside `.responsive-table`).
   Each `<td>` should receive `data-label="عنوان العمود"` (auto-applied by `js/mobile.js`). */
@media (max-width: 768px) {
    /* Sticky-headed horizontal scrolling for any table that's NOT mobile-cards */
    .table-wrapper, .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        position: relative;
    }
    .table-wrapper::after, .table-container::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        width: 24px;
        height: 100%;
        background: linear-gradient(to left, rgba(0,0,0,0.06), transparent);
        pointer-events: none;
        display: block;
    }

    /* ── CARD MODE — tables with `mobile-cards` class OR auto-converted ── */
    table.mobile-cards,
    .responsive-table table {
        min-width: 0 !important;
        display: block;
        background: transparent;
    }
    table.mobile-cards thead,
    .responsive-table thead {
        display: none;
    }
    table.mobile-cards tbody,
    .responsive-table tbody {
        display: block;
    }
    table.mobile-cards tr,
    .responsive-table tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        margin-bottom: 10px;
        padding: 10px 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }
    table.mobile-cards td,
    .responsive-table tbody td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 7px 0 !important;
        border: none !important;
        border-bottom: 1px dashed var(--border) !important;
        text-align: right;
        white-space: normal;
        font-size: 0.85rem;
        min-height: 32px;
    }
    table.mobile-cards td:last-child,
    .responsive-table tbody td:last-child {
        border-bottom: 0 !important;
        padding-top: 10px !important;
        flex-wrap: wrap;
    }
    table.mobile-cards td::before,
    .responsive-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.72rem;
        flex-shrink: 0;
        max-width: 45%;
        text-align: right;
    }
    /* When data-label is empty (like serial number column), hide the label */
    table.mobile-cards td[data-label=""]::before,
    .responsive-table tbody td[data-label=""]::before { display: none; }
    table.mobile-cards td[data-label="#"]::before,
    .responsive-table tbody td[data-label="#"]::before {
        content: "#"; font-size: 0.65rem; opacity: 0.5;
    }

    /* Hide rows of total cells from empty-state */
    table.mobile-cards tr td.empty-state,
    .responsive-table tbody td.empty-state {
        display: block !important;
        text-align: center;
        padding: 20px !important;
    }
    table.mobile-cards tr td.empty-state::before,
    .responsive-table tbody td.empty-state::before { display: none; }

    /* Action buttons inside cards take full width and wrap better */
    table.mobile-cards td .btn-sm,
    .responsive-table tbody td .btn-sm {
        flex: 1;
        min-width: 90px;
        justify-content: center;
    }
}

/* ===== Stat cards: better on small phones ===== */
@media (max-width: 768px) {
    .stats-grid { gap: 8px; margin-bottom: 14px; }
    .stat-card { min-height: 120px; border-radius: 12px; }
    .sc-top { padding: 10px 12px 0; }
    .sc-icon-circle { width: 34px; height: 34px; }
    .sc-icon-circle svg { width: 16px; height: 16px; }
    .sc-title { font-size: 0.72rem; line-height: 1.3; }
    .sc-number { font-size: 1.55rem; padding: 2px 12px 0; }
    .sc-footer { font-size: 0.62rem; padding: 6px 12px 10px; }
}
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .sc-number { font-size: 1.35rem; }
}

/* ===== Toolbar / Filters — wrap correctly on mobile ===== */
@media (max-width: 768px) {
    .toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .toolbar .search-box,
    .toolbar > .btn-primary,
    .toolbar > button {
        grid-column: 1 / -1;
    }
    .toolbar select,
    .toolbar input:not([type=date]) {
        width: 100% !important;
        min-width: 0 !important;
    }
    .toolbar input[type=date] { width: 100% !important; }
}

/* ===== Tabs — horizontal scroll cleanly ===== */
@media (max-width: 768px) {
    .tabs, .report-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        margin-bottom: 12px;
        scroll-snap-type: x proximity;
    }
    .tabs::-webkit-scrollbar,
    .report-tabs::-webkit-scrollbar { display: none; }
    .tab, .report-tabs .tab {
        scroll-snap-align: start;
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: 0.78rem;
    }
}

/* ===== Profile Header — properly stacks on mobile ===== */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }
    .profile-avatar { width: 60px; height: 60px; font-size: 1.6rem; }
    .profile-info h2 { font-size: 1.05rem; }
    .profile-info .meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 12px;
    }
    .profile-info .meta span { margin: 0; font-size: 0.78rem; }
    .profile-stats {
        margin-right: 0;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    .profile-stat { flex: 1; padding: 8px 10px; }
    .profile-stat .val { font-size: 1.1rem; }
    .profile-stat .lbl { font-size: 0.65rem; }
}

/* ===== Accounts Module — stack sidebar on mobile/tablet ===== */
@media (max-width: 1023px) {
    .accounting-layout,
    .acc-layout-root {
        flex-direction: column;
        gap: 12px !important;
        padding-bottom: max(72px, env(safe-area-inset-bottom));
    }
    .accounting-layout > .card:first-child,
    .accounting-layout .card.acc-sidebar,
    .acc-layout-root > .card.acc-sidebar,
    .acc-sidebar {
        width: 100% !important;
        max-width: 100%;
        position: relative !important;
        top: 0 !important;
    }
    .accounting-layout .nav-menu,
    .accounting-layout .acc-sidebar-nav,
    .acc-layout-root .acc-sidebar-nav {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px !important;
        padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)) !important;
    }
    .accounting-layout .nav-menu::-webkit-scrollbar,
    .acc-sidebar-nav::-webkit-scrollbar { display: none; }
    .acc-sidebar-nav .acc-nav-btn {
        flex-shrink: 0;
        width: auto !important;
        padding: 7px 14px !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
        border-radius: 20px !important;
    }
    .acc-sidebar-header { padding: 14px 16px !important; }
    .acc-sidebar-subtitle { display: none !important; }
    .acc-sidebar-icon { font-size: 1.35rem !important; margin-bottom: 2px; }
    /* Main content: readable width — no sideways overflow into edge */
    #pageContent .acc-main .card,
    #pageContent #accountingContent .card { max-width: 100%; overflow-x: auto; }
}

/* ===== Driver Profile / Vehicle Profile Tabs Content ===== */
@media (max-width: 768px) {
    /* tabBasic grid-2 collapse to one col, but show inline labels */
    .tab-content .grid-2,
    .tab-content .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    .tab-content .grid-2 > div,
    .tab-content .grid-3 > div {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 6px 8px;
        background: var(--bg-secondary);
        border-radius: 8px;
        font-size: 0.82rem;
    }
    .tab-content .grid-2 > div strong,
    .tab-content .grid-3 > div strong {
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.76rem;
        flex-shrink: 0;
    }
}

/* ===== Daily Ops / Shifts — improvements ===== */
@media (max-width: 768px) {
    /* Compact shift list table when not mobile-cards */
    .daily-shifts-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===== Modal on Mobile = full-screen slide-up sheet ===== */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal {
        margin: 0;
        max-width: 100%;
        width: 100%;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
        animation: slideUpSheet 0.28s cubic-bezier(0.32,0.72,0,1);
    }
    @keyframes slideUpSheet {
        from { transform: translateY(100%); opacity: 0.6; }
        to   { transform: translateY(0);   opacity: 1; }
    }
    /* Pull handle */
    .modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 4px;
        margin: 8px auto 0;
        flex-shrink: 0;
    }
    .modal-header { padding: 10px 16px 12px; }
    .modal-body { padding: 12px 16px; }
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 10px 16px;
        flex-wrap: wrap;
    }
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
}

/* ===== Form section title — better visual on mobile ===== */
@media (max-width: 768px) {
    .form-section-title {
        font-size: 0.85rem !important;
        font-weight: 800;
        color: var(--accent);
        padding: 8px 0 6px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 10px !important;
    }
}

/* ===== Header — make username show on med-mobile ===== */
@media (max-width: 768px) and (min-width: 481px) {
    .header-user span { display: inline; max-width: 80px; overflow: hidden; text-overflow: ellipsis; font-size: 0.75rem; }
}

/* ===== Bottom navigation: badge & better gestures ===== */
.mob-nav-item { position: relative; }
.mob-nav-badge {
    position: absolute;
    top: 6px;
    right: 22%;
    background: var(--danger);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #002137;
}

/* ===== iOS Safari fixes ===== */
@supports (-webkit-touch-callout: none) {
    .form-control,
    input[type=text], input[type=password], input[type=number],
    input[type=email], input[type=tel], input[type=date], textarea, select {
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }
}

/* ===== Pull-to-refresh hint (visual only) ===== */
@media (max-width: 768px) {
    .page-content { overscroll-behavior-y: contain; }
}

/* ===== Image / hero-bg performance on mobile ===== */
@media (max-width: 768px) {
    .top-header {
        background: linear-gradient(180deg, rgba(7,17,24,0.95), rgba(13,30,43,0.95));
    }
    .sidebar {
        background: linear-gradient(180deg, rgba(7,17,24,0.96), rgba(13,30,43,0.98));
    }
}

/* ===== Quick action grid on phones ===== */
@media (max-width: 768px) {
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .quick-action-btn {
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.74rem;
        text-align: center;
    }
}
@media (max-width: 360px) {
    .quick-actions { grid-template-columns: 1fr; }
}

/* ===== Assistant on small phones ===== */
@media (max-width: 768px) {
    .assistant-panel { left: 6px !important; right: 6px !important; width: auto !important; }
    .assistant-quick { padding: 6px 8px; gap: 4px; }
    .assistant-quick-btn { padding: 4px 8px; font-size: 0.7rem; }
}

/* ===== Notification dropdown on phones — full-width ===== */
@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-height: calc(100dvh - 80px);
        z-index: 10050 !important;
    }
}

/* ===== Hide noisy elements that overflow on mobile ===== */
@media (max-width: 480px) {
    /* Some long file inputs / drop zones */
    .upload-drop-zone { padding: 16px 12px; min-height: 90px; font-size: 0.8rem; }
}

/* ===== Make Profile back-button sticky on mobile ===== */
@media (max-width: 768px) {
    .page-content > .btn-outline:first-child {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--bg-card);
        margin: -12px -12px 12px !important;
        padding: 10px 14px !important;
        border-radius: 0 0 12px 12px !important;
        border: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        text-align: right;
    }
}

/* ===== Card padding tighter on small phones ===== */
@media (max-width: 480px) {
    .card { padding: 12px 12px; border-radius: 12px; }
    .card-header { margin-bottom: 10px; }
    .stat-card { min-height: 110px; }
    .sc-number { font-size: 1.4rem; }
    .sc-icon-circle { width: 32px; height: 32px; }
    .sc-icon-circle svg { width: 14px; height: 14px; }
}

/* ===== Better focus states for keyboard users ===== */
.btn:focus-visible,
.form-control:focus-visible,
.nav-item:focus-visible,
.mob-nav-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Empty-state on mobile ===== */
@media (max-width: 480px) {
    .empty-state { padding: 36px 12px; }
    .empty-state .icon { font-size: 2.2rem; }
    .empty-state h3 { font-size: 0.95rem; }
}

/* ===== Dashboard hero on small phones ===== */
@media (max-width: 480px) {
    .dashboard-hero {
        padding: 14px;
        gap: 12px;
    }
    .hero-brand-col { gap: 12px; }
    .hero-logo-ring, .hero-logo-img { width: 54px; height: 54px; }
    .hero-brand-name { font-size: 0.9rem; }
    .hero-brand-en { font-size: 0.6rem; }
    .hero-type-text { font-size: 0.95rem; }
    .hero-live-badge { font-size: 0.6rem; padding: 2px 8px; }
}

/* ===== Charts / SVG mockup — hide on smaller screens, already in 900px ===== */

/* ===== Better drop-down (select) appearance on iOS ===== */
select.form-control {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(0% + 12px) 50%,
        calc(0% + 17px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-left: 30px;
}

/* ===== Hint text below scrollable tables ===== */
@media (max-width: 768px) {
    .table-wrapper:not(.no-scroll-hint)::before,
    .table-container:not(.no-scroll-hint)::before {
        content: '👈 اسحب لرؤية باقي الأعمدة';
        display: block;
        font-size: 0.7rem;
        color: var(--text-muted);
        text-align: center;
        padding: 4px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
    }
    /* Hide hint when table is in card mode */
    .responsive-table .table-wrapper::before,
    .responsive-table .table-container::before,
    table.mobile-cards + ::before { display: none !important; }
    .responsive-table .table-wrapper, .responsive-table .table-container {
        overflow: visible;
    }
}

/* ===== Safe-area paddings for notch / home bar ===== */
.sidebar { padding-top: env(safe-area-inset-top, 0); }
.app-container { padding-left: env(safe-area-inset-left, 0); padding-right: env(safe-area-inset-right, 0); }

/* ===== Improved spinner visibility ===== */
.spinner { border-color: rgba(0,0,0,0.06); border-top-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   VAT REPORT — لوحة الضريبة
══════════════════════════════════════════════════════════════ */
.vat-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
}
.vat-filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.vat-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 768px) { .vat-summary-cards { grid-template-columns: 1fr; } }

.vat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    border-right: 4px solid transparent;
}
.vat-card-output { border-right-color: var(--danger); }
.vat-card-input  { border-right-color: var(--success); }
.vat-card-danger { border-right-color: var(--danger); background: rgba(239,68,68,0.06); }
.vat-card-success{ border-right-color: var(--success); background: rgba(16,185,129,0.06); }

.vat-card-icon { font-size: 2rem; flex-shrink: 0; }
.vat-card-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.vat-card-amount { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.vat-card-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.vat-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}
.vat-section-header {
    background: var(--bg-hover);
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.vat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.vat-table th {
    padding: 10px 16px;
    background: rgba(0,0,0,0.04);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.vat-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.vat-total-row td {
    background: var(--bg-hover);
    font-weight: 700;
}
.vat-net-box {
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-top: 8px;
}
.vat-net-box-danger  { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); }
.vat-net-box-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); }
.vat-net-title   { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.vat-net-formula { font-size: 1.4rem; font-weight: 800; margin-bottom: 12px; }
.vat-net-hint    { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Print — preserve brand colors ===== */
@media print {
    html, body, *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .sidebar,
    .sidebar-overlay,
    .top-header,
    .mobile-bottom-nav,
    .toast-container,
    .notification-dropdown,
    .app-footer,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        width: 100% !important;
    }

    .page-content {
        padding: 0 !important;
    }
}

/* Hijri date picker — منتقي التاريخ الهجري */
.hijri-date-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%230c2340' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 38px;
}

.hijri-date-picker {
    position: absolute;
    z-index: 10050;
    width: 320px;
    max-width: calc(100vw - 16px);
    padding: 10px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #dce4ef);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(12, 35, 64, 0.18);
}

.hdp-select-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.hdp-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.hdp-select-wrap .hdp-sel {
    width: 100%;
    height: 34px;
    border: 1px solid var(--border, #dce4ef);
    border-radius: 8px;
    background: var(--bg-secondary, #f4f8fc);
    color: var(--primary, #0c2340);
    font-size: 0.82rem;
    padding: 0 6px;
    cursor: pointer;
}

.hdp-select-wrap .hdp-sel:focus {
    outline: none;
    border-color: var(--accent, #e8a020);
}

.hdp-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border, #dce4ef);
}

.hdp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.hdp-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    color: var(--primary, #0c2340);
    font-size: 0.92rem;
}

.hdp-nav {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border, #dce4ef);
    border-radius: 8px;
    background: var(--bg-secondary, #f4f8fc);
    color: var(--primary, #0c2340);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.hdp-nav:hover { border-color: var(--accent, #e8a020); color: var(--accent, #e8a020); }

.hdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.hdp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.hdp-day {
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text, #1e293b);
    cursor: pointer;
    font-size: 0.85rem;
}

.hdp-day:hover { background: rgba(232, 160, 32, 0.15); }

.hdp-day.hdp-selected {
    background: var(--accent, #e8a020);
    color: #fff;
    font-weight: 700;
}

.hdp-empty { visibility: hidden; pointer-events: none; }

/* Weekly reports — فلتر الاسبوعيات */
.wr-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
.wr-focused-table th {
    background: #0c2340 !important;
    color: #fff !important;
    font-size: 0.78rem;
}
.wr-svc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.wr-svc-weekly { background: rgba(16,185,129,0.15); color: #047857; }
.wr-svc-deduct { background: rgba(232,160,32,0.18); color: #b45309; }
.wr-svc-odo { background: rgba(12,35,64,0.08); color: #0c2340; }
.wr-svc-oil { background: rgba(234,179,8,0.18); color: #a16207; }
.wr-svc-summary { background: rgba(217,234,247,0.8); color: #0c2340; border: 1px solid rgba(12,35,64,0.15); }

/* Weekly tracking table */
.wt-table-wrap { overflow-x: auto; }
.wt-table { font-size: 0.82rem; min-width: 1080px; }
.wt-table th {
    background: #0c2340 !important;
    color: #fff !important;
    font-size: 0.74rem;
    white-space: nowrap;
}
.wt-table .wt-inp {
    min-width: 72px;
    padding: 6px 8px;
    font-size: 0.82rem;
    text-align: center;
}
.wt-table .wt-inp-sm { min-width: 88px; }
.wt-table .wt-inp-xs { min-width: 52px; max-width: 60px; }
.wt-col-cash .wt-inp { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.35); }
.wt-col-pos .wt-inp { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.35); }
.wt-col-pos .wt-inp-disabled { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.wt-col-weekly .wt-inp { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.35); }
.wt-col-deduct .wt-inp { background: rgba(232,160,32,0.1); border-color: rgba(232,160,32,0.35); }
.wt-rem-warn { color: #b91c1c; font-weight: 700; }
.wt-rem-ok { color: #047857; font-weight: 700; }

/* Compliance center — مركز المتابعة اليومي */
.cmp-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.cmp-doc-grid-inner {
    display: grid;
    gap: 8px;
}
.cmp-doc-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(12,35,64,0.1);
    border-radius: 10px;
    padding: 10px 12px;
}
.cmp-doc-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0c2340;
    margin-bottom: 6px;
}
.cmp-doc-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.cmp-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.cmp-pill.cmp-ok { background: rgba(16,185,129,0.15); color: #047857; }
.cmp-pill.cmp-warn { background: rgba(245,158,11,0.18); color: #b45309; }
.cmp-pill.cmp-bad { background: rgba(239,68,68,0.15); color: #b91c1c; }
.cmp-pill.cmp-muted { background: rgba(100,116,139,0.12); color: #475569; }
.cmp-table { font-size: 0.82rem; min-width: 900px; }
.cmp-table th {
    background: #0c2340 !important;
    color: #fff !important;
    font-size: 0.74rem;
    white-space: nowrap;
}
.cmp-row-expired { background: rgba(239,68,68,0.06) !important; }
.cmp-row-warning { background: rgba(245,158,11,0.07) !important; }
.cmp-tabs .tab { font-size: 0.82rem; }

/* Government PDF archive — رفع احترافي */
.gov-upload-panel {
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(12, 35, 64, 0.1);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(12, 35, 64, 0.03), rgba(217, 234, 247, 0.35));
}
.gov-upload-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(12, 35, 64, 0.08);
}
.gov-upload-head h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #0c2340;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gov-upload-head p {
    margin: 6px 0 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.55;
}
.gov-upload-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 18px;
    padding: 18px 20px 20px;
}
@media (max-width: 900px) {
    .gov-upload-body { grid-template-columns: 1fr; }
}
.gov-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
@media (max-width: 640px) {
    .gov-type-grid { grid-template-columns: 1fr; }
}
.gov-type-card {
    border: 2px solid rgba(12, 35, 64, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    text-align: right;
}
.gov-type-card:hover {
    border-color: rgba(241, 90, 36, 0.45);
    box-shadow: 0 4px 14px rgba(12, 35, 64, 0.06);
}
.gov-type-card.active {
    border-color: var(--brand-orange, #F15A24);
    background: rgba(241, 90, 36, 0.06);
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.12);
}
.gov-type-card .gov-type-icon {
    font-size: 1.35rem;
    margin-bottom: 6px;
}
.gov-type-card strong {
    display: block;
    font-size: 0.88rem;
    color: #0c2340;
}
.gov-type-card span {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.gov-upload-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
@media (max-width: 480px) {
    .gov-upload-meta { grid-template-columns: 1fr; }
}
.gov-drop-zone {
    border: 2px dashed rgba(12, 35, 64, 0.18);
    border-radius: 14px;
    padding: 28px 18px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    min-height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.gov-drop-zone:hover,
.gov-drop-zone.drag-over {
    border-color: var(--brand-orange, #F15A24);
    background: rgba(241, 90, 36, 0.04);
    transform: translateY(-1px);
}
.gov-drop-zone.has-file {
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.05);
    cursor: default;
}
.gov-drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 35, 64, 0.06);
    color: #0c2340;
    margin-bottom: 4px;
}
.gov-drop-zone.has-file .gov-drop-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}
.gov-drop-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0c2340;
}
.gov-drop-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.gov-file-preview {
    width: 100%;
    max-width: 360px;
}
.gov-file-preview .gov-file-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0c2340;
    word-break: break-all;
    margin-bottom: 4px;
}
.gov-file-preview .gov-file-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.gov-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.gov-upload-side {
    border: 1px solid rgba(12, 35, 64, 0.08);
    border-radius: 12px;
    background: #fff;
    padding: 16px;
}
.gov-upload-side h4 {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: #0c2340;
}
.gov-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.gov-steps li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.gov-steps li span {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(12, 35, 64, 0.08);
    color: #0c2340;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gov-archive-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
}
@media (max-width: 768px) {
    .gov-archive-card {
        grid-template-columns: 1fr;
    }
}
.gov-archive-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.gov-archive-main strong {
    display: block;
    font-size: 0.9rem;
    color: #0c2340;
    word-break: break-all;
    margin-bottom: 6px;
}
.gov-archive-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 0.76rem;
    color: var(--text-muted);
}
.gov-archive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.gov-archive-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
}
.gov-archive-empty .gov-empty-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

/* Weekly revenue sheet — كشف إجمالي الإيرادات */
.rev-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.rev-tabs-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.rev-tab {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.rev-tab:hover { border-color: var(--accent); color: var(--accent); }
.rev-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}
.rev-sheet { padding: 0; overflow: hidden; }
.rev-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.rev-sheet-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.rev-meta { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }
.rev-table-wrap { overflow-x: auto; padding: 0; }
.rev-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 720px;
}
.rev-table th {
    background: #0c2340;
    color: #fff;
    padding: 10px 12px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.08);
}
.rev-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    vertical-align: middle;
}
.rev-cat { font-weight: 700; background: rgba(12,35,64,0.04); min-width: 120px; }
.rev-date { text-align: center; font-weight: 700; background: rgba(0,131,143,0.06); }
.rev-num { text-align: center; font-variant-numeric: tabular-nums; }
.rev-pos { background: rgba(255,237,213,0.35); }
.rev-cash { background: rgba(254,249,195,0.45); }
.rev-total { background: rgba(16,185,129,0.08); }
.rev-notes-col { min-width: 220px; }
.rev-notes { font-size: 0.82rem; color: var(--text-muted); }
.rev-notes-wrap { line-height: 1.6; }
.rev-note-chip {
    display: inline-block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    margin: 2px 4px 2px 0;
    font-size: 0.78rem;
}
.rev-row-weekly td { border-top: 2px solid #0c2340; }
.rev-row-arrears td { background: rgba(254,249,195,0.2); }
.rev-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0;
    border-top: 2px solid #0c2340;
    margin-top: 0;
}
.rev-summary-box {
    text-align: center;
    border-left: 1px solid var(--border);
    padding: 12px 8px;
}
.rev-summary-box:first-child { border-left: none; }
.rev-summary-head {
    background: #0c2340;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 4px;
    margin: -12px -8px 8px;
}
.rev-summary-val { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rev-final .rev-summary-val { color: var(--accent); font-size: 1.1rem; }
.rev-pos .rev-summary-val { color: #f59e0b; }
.rev-cash .rev-summary-val { color: #f59e0b; }
.rev-weekly-total .rev-summary-val { color: var(--success); }
.rev-deficit .rev-summary-val { color: var(--danger); }
.rev-surplus .rev-summary-val { color: var(--success); }
.rev-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--border);
}
.rev-sign-block { text-align: center; }
.rev-sign-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.rev-sign-name { font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.rev-sign-line {
    border-top: 1px dashed var(--border);
    padding-top: 28px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.rev-sheet-empty { text-align: center; padding: 40px 20px; }
.rev-sheet-edit .rev-inp { text-align: center; padding: 6px 8px; font-size: 0.85rem; }
.rev-table-edit td { vertical-align: top; }
.rev-muted { text-align: center; color: var(--text-muted); }
.rev-arrear-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 0.75fr 1fr auto;
    gap: 6px;
    margin-bottom: 6px;
}
.rev-arrear-row.rev-arrear-outstanding {
    grid-template-columns: 1.1fr 1fr 0.75fr 1fr auto auto;
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    padding: 6px;
}
.rev-arrear-tag {
    align-self: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--warning);
    white-space: nowrap;
}
.rev-row-outstanding .rev-cat { color: var(--warning); }
.rev-note-chip.rev-note-outstanding {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.1);
}
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.1);
}
.rev-summary-edit .form-control { text-align: center; margin-top: 4px; }
.rev-summary-manual .rev-view-adjust {
    text-align: center;
    padding: 6px 8px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 4px;
    min-height: 38px;
}
.rev-manual-tag {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(241, 90, 36, 0.2);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    vertical-align: middle;
}
.rev-manual-adjust-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-top: 0;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
.rev-manual-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}
@media (max-width: 768px) {
    .rev-signatures { grid-template-columns: 1fr; }
    .rev-arrear-row { grid-template-columns: 1fr; }
}

/* Employee file checklist */
.ef-overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px 16px 0;
}
.ef-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.ef-stat span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.ef-stat strong { font-size: 1.05rem; }
.ef-checklist-table { width: 100%; }
.ef-checklist-table th,
.ef-checklist-table td { padding: 8px 10px; vertical-align: middle; }
.ef-checklist-radio { text-align: center; width: 56px; }
.ef-note-inp { min-width: 140px; padding: 6px 8px; font-size: 0.82rem; }
.ef-contract-banner {
    margin: -8px 0 16px;
    padding: 10px 14px;
    background: rgba(12, 35, 64, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.ef-contract-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
    font-size: 0.85rem;
}
.ef-contract-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.ef-contract-item .form-label { font-size: 0.8rem; margin-bottom: 4px; }

/* Residency daily report — مطابقة شيت الإقامات */
#reportContent {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
#reportContent > .card,
#reportContent .rpt-residency-head {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}
#reportContent .card:has(.table-wrapper) {
    overflow: hidden;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
}
#reportContent .card:has(.table-wrapper) .card-header {
    padding: 20px 20px 12px;
}
#reportContent .table-wrapper,
#reportContent .sheet-scroll-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 var(--radius) var(--radius);
    border-left: none;
    border-right: none;
    border-bottom: none;
}
.rpt-residency-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    max-width: 100%;
}
.rpt-residency-kpi {
    background: #fff;
    border: 1px solid rgba(12,35,64,0.12);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}
.rpt-residency-kpi strong {
    display: block;
    font-size: 1.35rem;
    color: #0c2340;
    margin-top: 4px;
}
.rpt-residency-kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.rpt-residency-kpi-warn {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.35);
}
.rpt-residency-kpi-warn strong { color: #b45309; }
.rpt-residency-kpi-bad {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.35);
}
.rpt-residency-kpi-bad strong { color: #b91c1c; }
.rpt-residency-kpi-muted strong { color: var(--text-secondary); }
.rpt-residency-table {
    width: max-content !important;
    min-width: 100%;
}
.rpt-residency-table thead th {
    font-size: 0.78rem;
    white-space: nowrap;
}

/* Violation detail — click row in vehicle/driver profile */
.vl-row-click { cursor: pointer; transition: background 0.15s ease; }
.vl-row-click:hover { background: rgba(0, 131, 143, 0.07); }
.vl-photo-thumb {
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border);
    vertical-align: middle;
}
.vl-detail-ref {
    text-align: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: rgba(12, 35, 64, 0.06);
    border: 1px solid rgba(12, 35, 64, 0.12);
    border-radius: 10px;
    font-weight: 700;
    color: #0c2340;
}
.vl-detail-photo { text-align: center; margin-bottom: 14px; }
.vl-detail-photo img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid var(--border);
}
.vl-detail-photo-empty {
    padding: 24px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-radius: 10px;
    font-size: 0.88rem;
}
.vl-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}
.vl-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
}
.vl-detail-row span { color: var(--text-muted); }
.vl-detail-row strong { color: #0c2340; text-align: left; }

/* Violation detail document — GLORAD professional */
.vl-detail-modal .modal-body { padding: 0; background: #f8fafc; }
.vl-detail-modal .modal-header {
    background: #0c2340;
    color: #fff;
    border-bottom: 3px solid #e8a020;
}
.vl-detail-modal .modal-header h3 { color: #fff; font-size: 1rem; }
.vl-detail-modal .modal-close { color: #fff; opacity: 0.85; }
.vl-detail-modal .modal-footer {
    background: #fff;
    border-top: 1px solid #e5e8ec;
    padding: 12px 16px;
}
.vl-doc {
    padding: 16px 18px 18px;
    background: #fff;
    border: 1px solid rgba(12, 35, 64, 0.12);
    border-radius: 0 0 12px 12px;
}
.vl-doc-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid #0c2340;
}
@media (max-width: 720px) {
    .vl-doc-head { grid-template-columns: 1fr; text-align: center; }
    .vl-doc-head-brand { justify-content: center; }
    .vl-doc-ref-card { margin: 0 auto; }
}
.vl-doc-head-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.vl-doc-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}
.vl-doc-company {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0c2340;
    line-height: 1.3;
}
.vl-doc-company-en {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    direction: ltr;
    text-align: left;
}
.vl-doc-head-title { text-align: center; }
.vl-doc-head-title h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0c2340;
}
.vl-doc-head-title h2 {
    margin: 4px 0 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #e8a020;
    letter-spacing: 0.04em;
}
.vl-doc-ref-card {
    justify-self: end;
    min-width: 148px;
    padding: 10px 14px;
    text-align: center;
    background: linear-gradient(160deg, #0c2340 0%, #10304d 100%);
    border-radius: 10px;
    border: 1px solid rgba(232, 160, 32, 0.45);
    box-shadow: 0 8px 20px rgba(12, 35, 64, 0.22);
}
.vl-doc-ref-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}
.vl-doc-ref-num {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.06em;
    font-family: ui-monospace, 'Cairo', monospace;
}
.vl-doc-ref-sub {
    display: block;
    margin-top: 4px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.55);
}
.vl-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #d9eaf7;
    border: 1px solid rgba(12, 35, 64, 0.12);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0c2340;
}
.vl-doc-tbl {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 12px;
}
.vl-doc-tbl td {
    border: 1px solid #0c2340;
    padding: 7px 10px;
    vertical-align: middle;
    font-size: 0.82rem;
}
.vl-doc-lbl {
    width: 34%;
    background: #0c2340;
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
}
.vl-doc-lbl small {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    opacity: 0.75;
    margin-top: 2px;
}
.vl-doc-val {
    background: #d9eaf7;
    color: #0c2340;
    font-weight: 700;
}
.vl-doc-tbl tr:nth-child(even) .vl-doc-val { background: #fff; }
.vl-doc-notes { font-weight: 600; line-height: 1.5; white-space: pre-wrap; }
.vl-doc-attach {
    border: 1px solid rgba(12, 35, 64, 0.15);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.vl-doc-attach-head {
    padding: 8px 12px;
    background: #0c2340;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
.vl-doc-attach-ok { text-align: center; padding: 12px; }
.vl-doc-attach-ok img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(12, 35, 64, 0.15);
}
.vl-doc-attach-hint {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.vl-doc-attach-empty-body {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: #f8fafc;
}

.settings-notif-box {
    padding: 14px 16px;
    border: 1px solid var(--border-color, rgba(12, 35, 64, 0.12));
    border-radius: 12px;
    background: var(--bg-secondary, #f8fafc);
}

.settings-notif-card .card-title {
    margin: 0;
}

/* ─── Keeta order detail — Elosool × Keeta (mirrors partner portal) ─── */
.keeta-detail-modal .modal-body { padding: 0; background: #fff; max-height: 85vh; overflow: auto; }
.keeta-detail-modal .modal-header { background: var(--brand-navy); color: #fff; }
.keeta-detail-modal .modal-header h3 { color: #fff; }
.keeta-detail-shell {
    direction: rtl;
    font-family: 'Cairo', 'Tajawal', Tahoma, sans-serif;
    padding: 16px;
    background: #fff;
}
.elosool-keeta-brandbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(241, 90, 36, 0.25);
}
.elosool-keeta-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--brand-navy);
}
.elosool-keeta-brand strong { font-weight: 800; }
.elosool-mark { font-size: 1.2rem; }
.elosool-x { color: var(--text-muted); font-weight: 300; }
.keeta-mark {
    background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-dark));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
}
.keeta-breadcrumb { font-size: 0.78rem; color: var(--text-muted); }
.keeta-order-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 33, 55, 0.06);
}
.keeta-order-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1;
    min-width: 72px;
}
.keeta-order-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 20px;
}
.keeta-field-pair { font-size: 0.84rem; line-height: 1.5; }
.keeta-field-lbl { color: var(--text-muted); margin-left: 4px; }
.keeta-field-val { color: var(--text-primary); font-weight: 600; word-break: break-word; }
.keeta-map-link { color: #2563eb; font-weight: 600; text-decoration: none; }
.keeta-map-link:hover { text-decoration: underline; }
.keeta-section {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0, 33, 55, 0.04);
}
.keeta-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(0, 33, 55, 0.04), transparent);
    border-bottom: 1px solid var(--border);
}
.keeta-section-head h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand-navy);
}
.keeta-section-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(241, 90, 36, 0.12);
    color: var(--brand-orange-dark);
    font-weight: 700;
}
.keeta-merchant-grid,
.keeta-driver-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 24px;
    padding: 16px;
}
.keeta-section-flow .keeta-driver-grid {
    border-bottom: 1px dashed var(--border);
    margin-bottom: 4px;
}
.keeta-flow-field { font-size: 0.84rem; }
.keeta-flow-lbl { color: var(--text-muted); }
.keeta-flow-val { font-weight: 600; color: var(--text-primary); }
/* Horizontal flow timeline — like Keeta partner portal */
.keeta-flow-timeline {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 20px 16px 24px;
    gap: 0;
    scrollbar-width: thin;
    align-items: flex-start;
}
.keeta-flow-step {
    flex: 0 0 auto;
    min-width: 118px;
    max-width: 140px;
    text-align: center;
    position: relative;
}
.keeta-flow-check {
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(145deg, #22c55e, #16a34a);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.35);
    border: 3px solid #fff;
    outline: 2px solid rgba(34, 197, 94, 0.3);
}
.keeta-flow-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-top: 10px;
    line-height: 1.35;
    min-height: 2.6em;
}
.keeta-flow-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
    white-space: pre-line;
}
.keeta-flow-connector {
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 6px;
    min-width: 48px;
    position: relative;
}
.keeta-flow-connector::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #86efac);
    border-radius: 2px;
}
.keeta-flow-duration {
    display: block;
    position: relative;
    z-index: 1;
    margin: 0 auto;
    width: fit-content;
    max-width: 90px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #15803d;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 3px 8px;
    line-height: 1.3;
    text-align: center;
}
.keeta-flow-empty {
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}
/* Keeta-brand orange timeline (partner portal style) */
.keeta-flow-timeline-brand .keeta-flow-check {
    background: linear-gradient(145deg, var(--brand-orange, #f15a24), #ea580c);
    box-shadow: 0 3px 10px rgba(241, 90, 36, 0.35);
    outline-color: rgba(241, 90, 36, 0.25);
}
.keeta-flow-timeline-brand .keeta-flow-connector::before {
    background: linear-gradient(90deg, var(--brand-orange, #f15a24), #fdba74);
}
.keeta-flow-timeline-brand .keeta-flow-duration {
    color: #c2410c;
    background: #fff7ed;
    border-color: #fed7aa;
}
.keeta-courier-movements-wrap {
    padding: 12px 14px 16px;
    max-height: min(720px, calc(100vh - 280px));
    overflow-y: auto;
}
.keeta-registry-detail-flow .keeta-section-compact {
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}
.keeta-courier-orders { display: grid; gap: 16px; }
.keeta-courier-order-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.keeta-courier-order-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 33, 55, 0.04);
    border-bottom: 1px solid var(--border);
}
.keeta-courier-ops {
    padding: 0 12px 12px;
    border-top: 1px dashed var(--border);
}
.keeta-courier-ops h5 {
    margin: 12px 0 8px;
    font-size: 0.85rem;
    color: var(--brand-navy);
}

/* Keeta orders hub — list + detail like partner portal */
.keeta-orders-split {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    min-height: min(640px, calc(100vh - 300px));
    direction: ltr;
}
.keeta-orders-list-pane {
    flex: 0 0 min(340px, 34vw);
    width: min(340px, 34vw);
    max-width: 340px;
    direction: rtl;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(760px, calc(100vh - 260px));
}
.keeta-orders-list-host {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px 12px;
}
.keeta-orders-detail-pane {
    flex: 1 1 auto;
    min-width: 0;
    direction: rtl;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: auto;
    box-shadow: 0 2px 12px rgba(0, 33, 55, 0.06);
    max-height: min(760px, calc(100vh - 260px));
}
.keeta-orders-detail-pane .keeta-detail-shell {
    padding: 12px 14px 20px;
    min-height: 100%;
}
.keeta-saved-order-list { display: flex; flex-direction: column; gap: 8px; }
.keeta-saved-order-item {
    border: 1px solid var(--border);
    border-right: 3px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.keeta-saved-order-item:hover { box-shadow: 0 4px 14px rgba(0, 33, 55, 0.07); }
.keeta-saved-order-item.active {
    border-color: rgba(241, 90, 36, 0.45);
    border-right-color: var(--brand-orange);
    background: rgba(241, 90, 36, 0.04);
}
.keeta-saved-order-item.has-flow { border-right-color: rgba(34, 197, 94, 0.35); }
.keeta-saved-order-item.active.has-flow { border-right-color: var(--brand-orange); }
.keeta-saved-order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.keeta-saved-order-meta { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keeta-saved-order-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }
.keeta-saved-order-ids {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.keeta-id-chip {
    font-size: 0.65rem; font-family: ui-monospace, monospace; direction: ltr;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(0, 33, 55, 0.06); color: var(--text-secondary);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.keeta-id-chip-key {
    background: rgba(249, 115, 22, 0.12); color: #c2410c; font-weight: 700;
    border: 1px solid rgba(249, 115, 22, 0.25);
}
.keeta-order-search { flex: 1 1 220px; min-width: 200px; max-width: 420px; }
.keeta-search-hint { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.keeta-id-key { color: #c2410c; font-weight: 700; background: rgba(249, 115, 22, 0.08); padding: 1px 4px; border-radius: 3px; }
.keeta-field-pair.keeta-id-key .keeta-field-val { color: #c2410c; font-weight: 700; font-family: ui-monospace, monospace; }
.keeta-flow-dot { color: #15803d; font-weight: 700; }
@media (max-width: 960px) {
    .keeta-orders-split { flex-direction: column; direction: rtl; min-height: 0; }
    .keeta-orders-list-pane {
        flex: none; width: 100%; max-width: none;
        max-height: min(280px, 42vh); order: -1;
    }
    .keeta-orders-detail-pane { max-height: none; min-height: 480px; }
}
.keeta-section-ops .keeta-ops-wrap { max-height: 320px; overflow: auto; margin: 0; border: none; border-radius: 0; }
.keeta-ops-table { width: 100%; font-size: 0.78rem; border-collapse: collapse; }
.keeta-ops-table th, .keeta-ops-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: top;
}
.keeta-ops-table th {
    background: var(--brand-navy);
    color: #fff;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}
.keeta-ops-table tbody tr:hover { background: rgba(241, 90, 36, 0.04); }
/* Import master-detail layout */
.keeta-import-master-detail {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 14px;
    min-height: 420px;
    align-items: start;
    background: #fff !important;
}
@media (max-width: 960px) {
    .keeta-import-master-detail { grid-template-columns: 1fr; }
    .keeta-order-top { grid-template-columns: 1fr; }
}
.keeta-import-list-col {
    max-height: 620px;
    overflow-y: auto;
    padding-left: 4px;
}
.keeta-import-detail-col {
    min-height: 400px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff !important;
    background-image: none !important;
    overflow: auto;
    max-height: 620px;
}
#keetaInlineDetail {
    background: #fff !important;
    min-height: 360px;
}
.keeta-list-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 8px;
}
.keeta-inline-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}
.keeta-inline-placeholder span { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.keeta-order-cards { display: flex; flex-direction: column; gap: 8px; }

/* Keeta order center table — مطابق لمركز الطلبات في Keeta */
.keeta-order-center-wrap { width: 100%; }
.keeta-oc-scroll {
    max-height: min(520px, 58vh);
    overflow: auto;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
}
.keeta-order-center-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.keeta-order-center-table thead th {
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 10px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}
.keeta-order-center-table tbody td {
    padding: 11px 10px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
    color: #333;
}
.keeta-order-center-table tbody tr:nth-child(even) { background: #fafafa; }
.keeta-order-center-table tbody tr:hover { background: rgba(255, 209, 0, 0.1); }
.keeta-order-center-table tbody tr.active { background: rgba(255, 209, 0, 0.18); }
.keeta-oc-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}
.keeta-oc-city { max-width: 180px; }
.keeta-oc-driver { font-weight: 600; white-space: nowrap; }
.keeta-oc-action { width: 72px; text-align: center; }
.keeta-oc-view {
    background: none;
    border: none;
    color: #f15a24;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    font-family: inherit;
}
.keeta-oc-view:hover { text-decoration: underline; }
.keeta-oc-status-delivered { color: #52c41a; font-weight: 600; }
.keeta-oc-status-cancelled { color: #ff4d4f; font-weight: 600; }
.keeta-oc-status-pending { color: #faad14; font-weight: 600; }
.keeta-oc-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}
.keeta-oc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.keeta-oc-detail-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: auto;
    max-height: min(480px, 50vh);
    min-height: 200px;
}
.keeta-extract-page .keeta-preview-orders .keeta-oc-detail-panel {
    max-height: min(520px, 52vh);
}
.keeta-extract-page .keeta-preview-orders .keeta-oc-scroll {
    max-height: min(560px, 62vh);
}
.keeta-oc-split .keeta-orders-list-host { padding: 0 4px 8px; }
.keeta-oc-amount-cell { white-space: nowrap; }
.keeta-oc-amount { font-weight: 700; color: var(--danger); }
.keeta-oc-amount-zero { color: #999; font-weight: 600; }
.keeta-penalty-center-table .keeta-oc-type { font-weight: 600; }
.keeta-extract-page .keeta-preview-penalties .keeta-oc-scroll {
    max-height: min(560px, 62vh);
}
.keeta-order-card {
    position: relative;
    border: 1px solid var(--border);
    border-right: 3px solid transparent;
    border-radius: 10px;
    background: #fff;
    padding: 12px 36px 12px 12px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.keeta-order-card:hover { box-shadow: 0 4px 16px rgba(0, 33, 55, 0.08); }
.keeta-order-card.active {
    border-color: rgba(241, 90, 36, 0.45);
    border-right-color: var(--brand-orange);
    background: rgba(241, 90, 36, 0.04);
    box-shadow: 0 4px 16px rgba(241, 90, 36, 0.12);
}
.keeta-order-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; align-items: flex-start; }
.keeta-order-card-meta { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.55; }
.keeta-card-expand {
    position: absolute;
    top: 8px;
    left: 8px;
    border: none;
    background: var(--bg-subtle);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.6;
}
.keeta-card-expand:hover { opacity: 1; background: rgba(241, 90, 36, 0.15); }
.keeta-import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.keeta-import-stat {
    text-align: center;
    padding: 12px 8px;
    border-radius: 10px;
    background: rgba(0, 33, 55, 0.04);
    border: 1px solid rgba(0, 33, 55, 0.08);
}
.keeta-import-stat .n { font-size: 1.35rem; font-weight: 800; color: var(--brand-orange); }
.keeta-import-stat .l { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.keeta-banner {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.55;
}
.keeta-banner-warn {
    background: rgba(241, 90, 36, 0.1);
    border: 1px solid rgba(241, 90, 36, 0.35);
    color: #9a3412;
}
.keeta-banner-ok {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #166534;
}
.keeta-import-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-radius: 8px;
}
.keeta-meta-warn { color: var(--brand-orange-dark); font-weight: 700; }
.keeta-preview-card { overflow: visible; }

/* ─── Keeta hub — clean white, no watermark ─── */
/* العلامة المائية = .main-content.bg-ready::before (brand-header.png ثابتة خلف الصفحة)
   بطاقات .card شفافة 96% + blur → الشعار يظهر من تحتها خصوصاً في عمود التفاصيل */
.main-content.bg-ready:has(#keetaTabContent)::before,
.main-content.bg-ready:has(.keeta-page)::before,
.main-content.keeta-active.bg-ready::before,
.main-content:has(.keeta-page).bg-ready::before,
.main-content.keeta-active::before {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    content: none !important;
}
.page-content.keeta-page {
    background: #eef1f5 !important;
    min-width: 0;
    max-width: 100%;
    overflow-x: visible;
}
.main-content.keeta-active {
    min-width: 0;
    overflow-x: auto;
}
.page-content.keeta-page .card {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
#keetaTabContent {
    position: relative;
    z-index: 2;
    background: transparent;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}
#keetaTabContent .card,
.keeta-imports-card,
.keeta-preview-panel,
.keeta-preview-inner,
.keeta-preview-body,
.keeta-import-master-detail,
.keeta-import-list-col,
.keeta-detail-shell,
#keetaInlineDetail,
.keeta-import-detail-col,
.keeta-section,
.keeta-section-head,
.keeta-merchant-grid,
.keeta-driver-grid,
.keeta-order-top,
.keeta-order-card,
.elosool-keeta-brandbar,
.keeta-flow-timeline {
    background: #ffffff !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: var(--text-primary, #1e293b);
}
/* طبقة بيضاء صلبة خلف عمود التفاصيل — تمنع أي bleed من الخلفية الثابتة */
.keeta-import-detail-col {
    position: relative;
    isolation: isolate;
    z-index: 2;
}
.keeta-import-detail-col::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}
.keeta-import-detail-col > * {
    position: relative;
    z-index: 1;
}
.keeta-imports-card {
    margin-bottom: 14px;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}
#keetaExtractList {
    max-width: 100%;
    min-width: 0;
}
.keeta-preview-panel {
    min-height: 480px;
    padding: 0 !important;
    overflow: visible;
    margin-bottom: 14px;
    max-width: 100%;
    min-width: 0;
}
.keeta-preview-inner { min-height: 480px; }
.keeta-preview-body { padding: 14px; }
.keeta-field-val,
.keeta-flow-val,
.keeta-detail-shell h4,
.keeta-extract-head-text h2 {
    color: var(--text-primary, #1e293b) !important;
}
.keeta-import-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: min(440px, 52vh);
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.keeta-import-table {
    width: max-content;
    min-width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}
.keeta-import-table th,
.keeta-import-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}
.keeta-hub-intro {
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid rgba(244, 121, 32, 0.2);
    background: #fff;
    padding: 0;
}
.keeta-hub-intro > summary {
    cursor: pointer;
    font-weight: 700;
    padding: 10px 14px;
    list-style: none;
    color: var(--brand-navy);
}
.keeta-hub-intro > summary::-webkit-details-marker { display: none; }
.keeta-hub-intro-hint { font-weight: 400; font-size: 0.78rem; color: var(--text-muted); margin-right: 6px; }
.keeta-hub-intro-body {
    padding: 0 14px 12px;
    font-size: 0.84rem;
    line-height: 1.75;
    color: var(--text-secondary);
}
.keeta-hub-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 4px;
}
.keeta-hub-tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ─── Keeta extract tab — professional workspace ─── */
.keeta-setup-details {
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px dashed rgba(244, 121, 32, 0.35);
    background: rgba(244, 121, 32, 0.04);
}
.keeta-setup-details > summary {
    cursor: pointer;
    font-weight: 700;
    padding: 12px 14px;
    list-style: none;
}
.keeta-setup-details > summary::-webkit-details-marker { display: none; }
.keeta-setup-body { margin-top: 10px; padding: 14px; border: 1px solid var(--border); }
.keeta-setup-tip {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.55;
}
.keeta-setup-tip.ok { background: rgba(16, 185, 129, 0.1); color: #0f766e; }
.keeta-setup-tip.info { background: rgba(59, 130, 246, 0.08); color: #1e40af; }
.keeta-setup-nested { margin: 10px 0; font-size: 0.84rem; }
.keeta-setup-nested summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.keeta-setup-nested ol { padding-right: 18px; line-height: 1.85; margin-top: 8px; }
.keeta-token-box { padding: 12px; background: var(--bg-secondary); border-radius: 8px; font-size: 0.85rem; }
.keeta-token-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: stretch; }
.keeta-token-row code {
    flex: 1;
    min-width: 200px;
    padding: 8px 10px;
    background: #0f172a;
    color: #86efac;
    border-radius: 6px;
    word-break: break-all;
    font-size: 0.78rem;
}

.keeta-extract-split {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    min-height: min(560px, calc(100vh - 260px));
    margin-top: 14px;
    direction: ltr;
}
.keeta-extract-detail-pane {
    flex: 1 1 auto;
    min-width: 0;
    direction: rtl;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: auto;
    box-shadow: 0 2px 12px rgba(0, 33, 55, 0.06);
    max-height: min(720px, calc(100vh - 240px));
}
.keeta-extract-list-pane {
    flex: 0 0 min(380px, 36vw);
    width: min(380px, 36vw);
    max-width: 380px;
    direction: rtl;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff !important;
    max-height: min(720px, calc(100vh - 240px));
}
.keeta-extract-list-pane .keeta-extract-list-host {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px 12px;
}
.keeta-extract-list-pane .keeta-import-table-wrap {
    max-height: none;
    border: none;
    border-radius: 0;
}
.keeta-extract-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 33, 55, 0.03);
}
.keeta-extract-list-head .card-title { margin: 0; font-size: 0.92rem; }
/* keeta-import-table-wrap — see Keeta hub section above (single definition) */
.keeta-import-table th {
    background: var(--brand-navy);
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    position: sticky;
    top: 0;
    z-index: 1;
}
.keeta-import-tr { cursor: pointer; transition: background 0.12s; }
.keeta-import-tr:hover { background: rgba(241, 90, 36, 0.06); }
.keeta-import-tr.active { background: rgba(241, 90, 36, 0.12); }
.keeta-import-tr.active td:first-child { box-shadow: inset 3px 0 0 var(--brand-orange); }
.keeta-import-tr.junk { opacity: 0.55; }
@media (max-width: 960px) {
    .keeta-extract-split {
        flex-direction: column;
        direction: rtl;
        min-height: 0;
    }
    .keeta-extract-list-pane {
        flex: none;
        width: 100%;
        max-width: none;
        max-height: min(320px, 45vh);
        order: -1;
    }
    .keeta-extract-detail-pane {
        min-height: 420px;
        max-height: none;
    }
}

/* legacy */
.keeta-extract-layout { display: flex; flex-direction: row; gap: 16px; width: 100%; direction: ltr; }
.keeta-sidebar-tools { display: flex; gap: 6px; }
.keeta-extract-list-host {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    padding: 8px;
    background: #fff;
}
.keeta-list-loading, .keeta-list-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}
.keeta-sidebar-hint {
    margin: 0 0 8px;
    padding: 8px 10px;
    font-size: 0.75rem;
    background: rgba(241, 90, 36, 0.1);
    border-radius: 8px;
    color: #9a3412;
}
.keeta-import-sidebar-list { display: flex; flex-direction: column; gap: 6px; }
.keeta-import-row {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-right: 3px solid transparent;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.keeta-import-row:hover { box-shadow: 0 3px 12px rgba(0, 33, 55, 0.08); }
.keeta-import-row.active {
    border-color: rgba(241, 90, 36, 0.4);
    border-right-color: var(--brand-orange);
    background: rgba(241, 90, 36, 0.05);
}
.keeta-import-row.junk { opacity: 0.65; border-style: dashed; }
.keeta-import-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.keeta-import-row-top strong { font-size: 0.9rem; color: var(--brand-navy); }
.keeta-import-del {
    margin-right: auto;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.keeta-import-del:hover { color: var(--danger); }
.keeta-imp-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}
.keeta-imp-badge.new { background: rgba(241, 90, 36, 0.15); color: #c2410c; }
.keeta-imp-badge.saved { background: rgba(34, 197, 94, 0.15); color: #166534; }
.keeta-imp-badge.dup { background: rgba(234, 179, 8, 0.15); color: #854d0e; }
.keeta-imp-badge.rev { background: rgba(100, 116, 139, 0.12); color: #475569; }
.keeta-import-row-type { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px; }
.keeta-import-row-stats {
    display: flex;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.keeta-import-row-time { font-size: 0.68rem; color: var(--text-muted); }

.keeta-extract-main {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    min-height: 560px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 16px rgba(0, 33, 55, 0.08);
}
.keeta-extract-body {
    flex: 1;
    overflow: auto;
    padding: 14px;
    background: #fff;
}
.keeta-extract-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    background: #fff !important;
}
.keeta-welcome-icon { font-size: 3rem; opacity: 0.45; margin-bottom: 12px; }
.keeta-extract-welcome h3 { margin: 0 0 8px; color: var(--brand-navy); font-size: 1.1rem; }
.keeta-extract-welcome p { margin: 0; max-width: 420px; font-size: 0.88rem; line-height: 1.6; }

.keeta-extract-workspace { display: flex; flex-direction: column; height: 100%; min-height: 520px; }
.keeta-extract-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.keeta-extract-head-text h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--brand-navy);
}
.keeta-extract-head-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.keeta-extract-time { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); }
.keeta-extract-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.keeta-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
}
.keeta-detail-empty-icon { font-size: 2.5rem; opacity: 0.5; margin-bottom: 12px; }
.keeta-detail-empty h4 { margin: 0 0 8px; color: var(--brand-navy); }
.keeta-detail-empty p { margin: 0; max-width: 380px; line-height: 1.6; font-size: 0.88rem; }
.keeta-section-empty { padding: 16px; color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.keeta-order-num-sm { font-size: 1.2rem; font-weight: 800; }
.keeta-card-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    white-space: nowrap;
}
.keeta-card-badge.muted { background: rgba(100, 116, 139, 0.12); color: #64748b; }
.keeta-order-card.has-details { border-right-color: rgba(34, 197, 94, 0.5); }
.keeta-import-stat.warn .n { color: #b45309; }
.keeta-import-stat.warn { background: rgba(234, 179, 8, 0.08); border-color: rgba(234, 179, 8, 0.2); }

/* ─── Keeta extract tab — expanded readable layout ─── */
#keetaTabContent.keeta-extract-active {
    width: 100%;
    max-width: none;
}
.keeta-extract-page {
    width: 100%;
    max-width: none;
}
.keeta-extract-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 131, 143, 0.22);
    background: linear-gradient(135deg, rgba(0, 131, 143, 0.08), rgba(217, 234, 247, 0.45));
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-primary);
}
.keeta-extract-intro-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.keeta-extract-page .keeta-extract-split {
    min-height: calc(100vh - 210px);
    gap: 20px;
    align-items: stretch;
}
.keeta-extract-page .keeta-extract-list-pane {
    flex: 0 0 clamp(320px, 36vw, 500px);
    width: clamp(320px, 36vw, 500px);
    max-width: none;
    max-height: calc(100vh - 200px);
    min-height: calc(100vh - 220px);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0, 33, 55, 0.08);
}
.keeta-extract-page .keeta-extract-list-head {
    padding: 14px 16px;
}
.keeta-extract-page .keeta-extract-list-head .card-title {
    font-size: 1.05rem;
}
.keeta-extract-page .keeta-extract-list-pane .keeta-extract-list-host {
    padding: 10px 12px 14px;
}
.keeta-extract-page .keeta-extract-detail-pane {
    flex: 1 1 60%;
    min-width: 0;
    min-height: calc(100vh - 220px);
    max-height: calc(100vh - 200px);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 33, 55, 0.1);
}
.keeta-extract-page .keeta-import-table-wrap {
    max-height: none;
    border: none;
    border-radius: 0;
    overflow-x: auto;
}
.keeta-extract-page .keeta-import-table {
    width: 100%;
    font-size: 0.92rem;
}
.keeta-extract-page .keeta-import-table th {
    font-size: 0.88rem;
    padding: 12px 10px;
    white-space: nowrap;
}
.keeta-extract-page .keeta-import-table td {
    font-size: 0.92rem;
    padding: 11px 10px;
    vertical-align: middle;
}
.keeta-extract-page .keeta-preview-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.keeta-extract-page .keeta-preview-body {
    flex: 1 1 auto;
    padding: 18px 22px 22px;
    overflow: auto;
}
.keeta-extract-page .keeta-extract-head {
    padding: 16px 20px;
}
.keeta-extract-page .keeta-extract-head-text h2 {
    font-size: 1.28rem;
    font-weight: 800;
}
.keeta-extract-page .keeta-extract-head-text p {
    font-size: 0.92rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    line-height: 1.55;
}
.keeta-extract-page .keeta-import-master-detail {
    grid-template-columns: minmax(380px, 44%) 1fr;
    gap: 18px;
    min-height: calc(100vh - 320px);
}
.keeta-extract-page .keeta-import-list-col,
.keeta-extract-page .keeta-import-detail-col {
    max-height: calc(100vh - 340px);
    min-height: 520px;
}
.keeta-extract-page .keeta-list-hint {
    font-size: 0.92rem;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 33, 55, 0.04);
    color: var(--text-secondary);
}
.keeta-extract-page .keeta-order-card {
    padding: 14px 40px 14px 14px;
}
.keeta-extract-page .keeta-order-card-meta {
    font-size: 0.9rem;
    line-height: 1.65;
}
.keeta-extract-page .keeta-order-num-sm {
    font-size: 1.35rem;
}
.keeta-extract-page .keeta-import-stat .n {
    font-size: 1.7rem;
}
.keeta-extract-page .keeta-import-stat .l {
    font-size: 0.82rem;
}
.keeta-extract-page .keeta-field-pair {
    font-size: 0.95rem;
    line-height: 1.6;
}
.keeta-extract-page .keeta-detail-shell h4 {
    font-size: 1.05rem;
}
.keeta-extract-page .keeta-inline-placeholder {
    min-height: 420px;
    font-size: 0.95rem;
}
.keeta-extract-page .keeta-extract-welcome {
    min-height: calc(100vh - 280px);
}
.keeta-extract-page .keeta-extract-welcome h3 {
    font-size: 1.25rem;
}
.keeta-extract-page .keeta-extract-welcome p {
    font-size: 0.95rem;
    max-width: 520px;
}
@media (max-width: 1100px) {
    .keeta-extract-page .keeta-extract-split {
        flex-direction: column;
        min-height: 0;
    }
    .keeta-extract-page .keeta-extract-list-pane,
    .keeta-extract-page .keeta-extract-detail-pane {
        width: 100%;
        flex: none;
        max-height: none;
        min-height: 0;
    }
    .keeta-extract-page .keeta-extract-list-pane {
        max-height: min(380px, 42vh);
    }
    .keeta-extract-page .keeta-import-master-detail {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .keeta-extract-page .keeta-import-list-col,
    .keeta-extract-page .keeta-import-detail-col {
        max-height: min(480px, 55vh);
        min-height: 280px;
    }
}

/* Keeta registry — merchants + courier movement log */
.keeta-registry-card,
.keeta-registry-list,
.keeta-registry-detail {
    background: #fff !important;
}
.keeta-registry-split {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 14px;
    align-items: start;
}
@media (max-width: 960px) {
    .keeta-registry-split { grid-template-columns: 1fr; }
}
.keeta-registry-table { width: 100%; font-size: 0.84rem; }
.keeta-registry-table th,
.keeta-registry-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
.keeta-courier-list { max-height: 620px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.keeta-courier-item {
    border: 1px solid var(--border);
    border-right: 3px solid transparent;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.keeta-courier-item:hover { box-shadow: 0 4px 14px rgba(0, 33, 55, 0.07); }
.keeta-courier-item.active { border-color: rgba(241, 90, 36, 0.45); border-right-color: var(--brand-orange); background: rgba(241, 90, 36, 0.04); }
.keeta-courier-item.unlinked { border-right-color: rgba(234, 179, 8, 0.45); }
.keeta-courier-item.linked { border-right-color: rgba(34, 197, 94, 0.45); }
.keeta-courier-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.keeta-courier-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.76rem; color: var(--text-muted); }
.keeta-courier-erp { font-size: 0.78rem; color: var(--brand-navy); margin-top: 6px; }
.keeta-movements-wrap { max-height: 620px; overflow: auto; }
.keeta-movements-table { width: 100%; font-size: 0.8rem; }
.keeta-movements-table th,
.keeta-movements-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
.keeta-movements-table tr.mv-timeline td:first-child { color: #15803d; }
.keeta-movements-table tr.mv-operation td:first-child { color: #1d4ed8; }

/* ===== Keeta — الأداء اليومي (جدول مضغوط + تمرير أفقي) ===== */
#perfContent,
#keetaTabContent:has(#perfDailyTable) {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}
.perf-daily-card {
    max-width: 100%;
    overflow: hidden;
}
.perf-daily-card-header {
    flex-wrap: wrap;
    gap: 8px;
}
.perf-daily-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: min(70vh, 640px);
}
table.perf-daily-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    font-size: 0.8rem;
    border-collapse: separate;
    border-spacing: 0;
}
table.perf-daily-table th,
table.perf-daily-table td {
    padding: 7px 9px;
    white-space: nowrap;
    vertical-align: middle;
}
table.perf-daily-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--dark-bg-secondary, #f1f5f9) !important;
}
table.perf-daily-table .perf-col-idx { width: 2.2rem; text-align: center; }
table.perf-daily-table .perf-col-date { min-width: 5.5rem; }
table.perf-daily-table .perf-col-name-ar { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; }
table.perf-daily-table .perf-col-name-en { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
table.perf-daily-table .perf-col-keeta { max-width: 7.5rem; font-size: 0.68rem; }
table.perf-daily-table .perf-col-keeta code { font-size: inherit; }
table.perf-daily-table .perf-col-num,
table.perf-daily-table .perf-col-pct,
table.perf-daily-table .perf-col-target { text-align: center; }
table.perf-daily-table .perf-col-money { text-align: center; min-width: 4.5rem; }
table.perf-daily-table .perf-col-actions {
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}
table.perf-daily-table thead .perf-col-actions {
    z-index: 3;
    background: var(--dark-bg-secondary, #f1f5f9) !important;
}
table.perf-daily-table .perf-col-actions .btn {
    padding: 3px 7px;
    font-size: 0.72rem;
    min-height: 28px;
}
table.perf-daily-table .badge { font-size: 0.65rem; padding: 2px 6px; }
.perf-ellipsis { cursor: help; }
@media (max-width: 900px) {
    table.perf-daily-table { font-size: 0.76rem; }
    table.perf-daily-table th,
    table.perf-daily-table td { padding: 6px 7px; }
}

/* Keeta — تقرير الأداء اليومي (مطابق لشيت Excel) */
.keeta-daily-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.keeta-daily-sheet-banner {
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.12), rgba(244, 121, 32, 0.08));
    border: 1px solid rgba(34, 139, 34, 0.22);
    border-radius: 12px;
    padding: 14px 16px 12px;
}
.keeta-daily-sheet-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.keeta-daily-sheet-date {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.keeta-daily-sheet-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.keeta-daily-sheet-targets span {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    padding: 4px 10px;
}
.keeta-daily-sheet-targets b {
    color: var(--primary, #f47920);
    margin-left: 4px;
}
.keeta-daily-sheet-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    color: #1b5e20;
}
.keeta-daily-sheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 12px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
}
.keeta-daily-sheet-toolbar-field {
    flex: 1;
    min-width: 140px;
}
.keeta-daily-sheet-toolbar-field .form-label {
    font-size: 0.72rem;
    margin-bottom: 4px;
}
.keeta-daily-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.keeta-daily-pill {
    flex: 1;
    min-width: 100px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}
.keeta-daily-pill-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.keeta-daily-pill strong {
    font-size: 1.05rem;
}
.keeta-daily-pill--ok strong { color: var(--success, #16a34a); }
.keeta-daily-pill--warn strong { color: var(--warning, #d97706); }
.keeta-daily-pill--info strong { color: #0d6efd; }
.keeta-daily-pill--danger strong { color: var(--danger, #dc2626); }
.keeta-daily-table-card .card-header {
    padding: 8px 14px;
    min-height: auto;
}
table.perf-daily-report-table thead th {
    background: #c8e6c9 !important;
    color: #1b5e20;
    font-size: 0.7rem;
    line-height: 1.35;
    text-align: center;
    vertical-align: middle;
    max-width: 9rem;
    white-space: normal;
    word-break: break-word;
}
table.perf-daily-report-table tbody tr:nth-child(even) td {
    background: rgba(200, 230, 201, 0.12);
}
table.perf-daily-report-table tbody td {
    font-size: 0.78rem;
    text-align: center;
}
table.perf-daily-report-table tbody td:nth-child(3) {
    text-align: right;
    min-width: 12rem;
    max-width: 16rem;
}
.keeta-daily-empty {
    text-align: center;
    padding: 28px 16px !important;
    color: var(--text-muted);
    white-space: normal !important;
    line-height: 1.7;
}
