/* /Applications/XAMPP/xamppfiles/htdocs/PG- BMS/css/style.css */
/* ═══════════════════════════════════════════════════════════════
   PG Construction Fleet ERP — Redesigned Design System
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    --page-bg: #F7F8FC;
    --sidebar-bg: #1A1D2E;
    --sidebar-active-bg: #F5C518;
    --sidebar-active-text: #1A1D2E;
    --sidebar-inactive-text: #9CA3AF;
    --sidebar-icon-inactive: #6B7280;
    --sidebar-hover: rgba(255,255,255,0.07);

    --primary-accent: #F5C518;
    --brand-dark: #1A1D2E;

    --card-bg: #FFFFFF;
    --card-border: #EAECF0;
    --card-shadow: 0 1px 4px rgba(0,0,0,0.06);

    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --purple: #8B5CF6;

    --text-primary: #1A1D2E;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #EAECF0;
    --bg-light: #F9FAFB;

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Legacy compat aliases */
    --primary-blue: #3B82F6;
    --primary-blue-dark: #2563EB;
    --primary-blue-light: #EFF6FF;
    --white: #FFFFFF;
    --success-green: #10B981;
    --danger-red: #EF4444;
    --warning-orange: #F59E0B;
    --danger-bg: #FEF2F2;
    --success-bg: #ECFDF5;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--page-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Utilities ─── */
.hidden { display: none !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-accent);
    color: var(--brand-dark);
}
.btn-primary:hover {
    background-color: #e6b800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,197,24,0.35);
}

.btn-block {
    width: 100%;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
    font-weight: 500;
}
.btn-text:hover {
    color: var(--primary-accent);
    background-color: rgba(245,197,24,0.08);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}

/* ─── Login Screen ─── */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-dark);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(245,197,24,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.08) 0%, transparent 50%);
}
.login-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 400px;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header h2 {
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 22px;
}
.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}
.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 1rem;
    text-align: center;
}

/* ═══════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════ */
#app-screen {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
    width: 220px;
    min-width: 220px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background-color: var(--primary-accent);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}
/* Hide the <i> tag from old markup if present */
.logo-icon i { display: none; }

.logo-text {
    font-weight: 600;
    font-size: 15px;
    color: #FFFFFF;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 10px;
    border-radius: 8px;
    color: var(--sidebar-inactive-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-item i {
    font-size: 18px;
    color: var(--sidebar-icon-inactive);
    transition: color 0.2s;
    width: 20px;
    text-align: center;
}
.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: #FFFFFF;
}
.nav-item:hover i {
    color: #FFFFFF;
}
.nav-item.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-right: none;
}
.nav-item.active i {
    color: var(--sidebar-active-text);
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer .btn,
.sidebar-footer button,
#logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 0;
    border-radius: 8px;
    color: var(--danger) !important;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    font-family: inherit;
}
#logout-btn:hover {
    background: rgba(239,68,68,0.1);
}
#logout-btn i {
    font-size: 18px;
    color: var(--danger);
    width: 20px;
    text-align: center;
}

/* ─── Main Wrapper ─── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--page-bg);
}

/* ─── Topbar ─── */
.topbar {
    height: 60px;
    background-color: var(--white);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.current-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-profile #current-username {
    display: none; /* Hide text username for cleaner look */
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--brand-dark);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Hide old icon inside avatar */
.avatar i { display: none; }

.mobile-only { display: none; }

/* ─── Content Area ─── */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.08) transparent;
}
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 6px; }

/* ═══════════════════════════════════════
   DASHBOARD — KPI CARDS
   ═══════════════════════════════════════ */
.dashboard-grid {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border) !important;
    border-top: 1px solid var(--card-border) !important;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--card-shadow);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
/* Remove old colored borders */
.stat-card.negative,
.stat-card.positive {
    border-top: 1px solid var(--card-border) !important;
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.stat-card-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.stat-card-icon.success { background: #ECFDF5; color: var(--success); }
.stat-card-icon.info    { background: #EFF6FF; color: var(--info); }
.stat-card-icon.warning { background: #FFF7ED; color: var(--warning); }
.stat-card-icon.danger  { background: #FEF2F2; color: var(--danger); }
.stat-card-icon.purple  { background: #F5F3FF; color: var(--purple); }

.stat-card .value,
.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-dark);
    margin-top: 12px;
    line-height: 1.1;
}

/* Legacy stat-icon/stat-details (hide icon since new layout uses stat-card-icon) */
.stat-card .stat-icon { display: none; }
.stat-card .stat-details h3 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}
.stat-card .stat-details .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-dark);
    margin-top: 12px;
}

/* ═══════════════════════════════════════
   DASHBOARD — MAIN CONTENT GRID
   ═══════════════════════════════════════ */
.dash-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.dash-stacked-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dash-full-width {
    width: 100%;
}

.dash-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1024px) {
    .dash-bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Card common ─── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Trip Panel (dark header) ─── */
.trip-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--card-shadow);
    padding: 0;
}
.trip-panel-header {
    background: var(--brand-dark);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.trip-panel-header .trip-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 15px;
}
.trip-panel-header .trip-panel-title i {
    color: var(--primary-accent);
    font-size: 18px;
}

.btn-trip-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-accent);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-trip-new:hover {
    background: #e6b800;
    transform: translateY(-1px);
}

/* ─── Summary Strip ─── */
.trip-summary-strip {
    background: var(--page-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 13px;
    flex-wrap: wrap;
}
.trip-summary-strip .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
}
.trip-summary-strip .stat-item:first-child { padding-left: 0; }
.trip-summary-strip .stat-item:not(:last-child) {
    border-right: 1px solid var(--card-border);
}
.trip-summary-strip .stat-label {
    color: var(--text-secondary);
}
.trip-summary-strip .stat-value {
    color: var(--brand-dark);
    font-weight: 700;
}

/* ─── Trip Table ─── */
.trip-table-wrap {
    padding: 0;
}

/* ─── Empty State ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
}
.empty-state-icon {
    font-size: 48px;
    color: #D1D5DB;
    margin-bottom: 12px;
}
.empty-state-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}
.empty-state .btn {
    margin-top: 4px;
}

/* ─── Recent Trips Section ─── */
.recent-trips-section {
    border-top: 1px solid var(--card-border);
    padding: 16px 20px 20px;
}
.recent-trips-section .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recent-trips-section .section-title h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark);
}
.view-all-link {
    font-size: 13px;
    color: var(--primary-accent);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.view-all-link:hover {
    color: #d4a700;
}

/* ─── Driver Cash Snapshot Card ─── */
.driver-snapshot-card .card-title i {
    color: var(--purple);
}
.driver-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}
.driver-list-item:last-child {
    border-bottom: none;
}
.driver-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-dark);
}
.driver-balance {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 14px;
}
.driver-balance.positive { color: var(--success); }
.driver-balance.negative { color: var(--danger); }
.driver-balance.zero { color: var(--text-muted); }

/* ─── Alert Cards ─── */
.alerts-card .card-title i {
    color: var(--danger);
}
.alert-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: transform 0.15s;
}
.alert-item:last-child { margin-bottom: 0; }
.alert-item:hover { transform: translateX(2px); }

.alert-bar {
    width: 3px;
    min-width: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}
.alert-item.danger  { background: #FEF2F2; }
.alert-item.danger .alert-bar { background: var(--danger); }
.alert-item.warning { background: #FFFBEB; }
.alert-item.warning .alert-bar { background: var(--warning); }
.alert-item.info    { background: #EFF6FF; }
.alert-item.info .alert-bar { background: var(--info); }

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}
.alert-content i {
    font-size: 16px;
    margin-top: 1px;
}
.alert-item.danger .alert-content i { color: var(--danger); }
.alert-item.warning .alert-content i { color: var(--warning); }
.alert-item.info .alert-content i { color: var(--info); }

.alert-text-wrap {
    display: flex;
    flex-direction: column;
}
.alert-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--brand-dark);
}
.alert-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ═══════════════════════════════════════
   TABLES (global)
   ═══════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}
th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    background-color: var(--bg-light);
    letter-spacing: 0.3px;
}
tr:hover {
    background-color: #FAFBFC;
}
tr:last-child td {
    border-bottom: none;
}

/* ─── Status Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.badge-success { background: #ECFDF5; color: var(--success); }
.badge-danger  { background: #FEF2F2; color: var(--danger); }
.badge-warning { background: #FFFBEB; color: var(--warning); }
.badge-info    { background: #EFF6FF; color: var(--info); }

/* ═══════════════════════════════════════
   SECTION HEADER (trips form sections)
   ═══════════════════════════════════════ */
.section-header {
    background: var(--page-bg);
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 14px;
    border-left: 4px solid var(--primary-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--brand-dark);
}

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 24px;
    border-radius: var(--radius-lg);
    width: 80%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* ═══════════════════════════════════════
   RIGHT COLUMN STACKED CARDS
   ═══════════════════════════════════════ */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

/* Medium screens (tablets / narrow desktops) */
@media (max-width: 1400px) {
    .dashboard-grid {
        flex-wrap: wrap;
    }
    .stat-card {
        flex: 1 1 calc(33.33% - 12px);
        min-width: 160px;
    }
}

/* At this breakpoint, sidebar(220) + content needs 2 cols to still work */
@media (max-width: 900px) {
    .dash-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-only {
        display: inline-flex;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--brand-dark);
    }
    .topbar { padding: 0 16px; }
    .content-area { padding: 16px; }

    .dashboard-grid {
        flex-direction: column;
    }
    .stat-card {
        flex: 1 1 100%;
    }
    .dash-content-grid {
        grid-template-columns: 1fr;
    }
    .trip-summary-strip {
        flex-wrap: wrap;
        gap: 8px;
    }
    .trip-summary-strip .stat-item {
        border-right: none !important;
        padding: 4px 0;
    }
}


/* ═══════════════════════════════════════
   TRIP MANAGEMENT REDESIGN
   ═══════════════════════════════════════ */

/* Tabs */
.tab-group {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.tab-btn {
    background: transparent;
    color: #6B7280;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    color: var(--brand-dark);
}
.tab-btn.active {
    background: var(--brand-dark);
    color: var(--white);
}

/* Progress Bar */
.step-progress-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px 32px;
    border: 1px solid var(--card-border);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    position: relative;
}
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #E5E7EB;
    color: #9CA3AF;
}
.step-item.active .step-circle {
    background: var(--primary-accent);
    color: var(--brand-dark);
    font-weight: 700;
}
.step-item.completed .step-circle {
    background: var(--success);
    color: var(--white);
}
.step-label {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}
.step-item.active .step-label {
    color: var(--brand-dark);
    font-weight: 600;
}
.step-line {
    flex-grow: 1;
    height: 2px;
    background: #E5E7EB;
    margin: 0 16px;
    position: relative;
    top: -12px;
    z-index: 1;
}

/* Form Cards */
.form-card {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--card-border);
    margin-bottom: 24px;
}
.form-card-header {
    margin-bottom: 24px;
}
.form-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 4px;
}
.form-card-subtitle {
    font-size: 13px;
    color: #6B7280;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* Inputs */
.input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.input-field {
    width: 100%;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--brand-dark);
    transition: all 0.2s ease;
    font-family: inherit;
}
.input-field:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
    outline: none;
}
.input-with-prefix {
    position: relative;
}
.input-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #6B7280;
}
.input-with-prefix .input-field {
    padding-left: 28px;
}

/* Checkbox Toggle Cards */
.toggle-card {
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.toggle-card input[type="checkbox"] {
    accent-color: var(--primary-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    user-select: none;
}
.toggle-card.off-day-checked {
    background: rgba(245,197,24,0.08);
    border-color: rgba(245,197,24,0.3);
}
.off-day-note {
    font-size: 12px;
    color: var(--warning);
    margin-top: 4px;
    display: none;
}
.toggle-card.off-day-checked + .off-day-note {
    display: block;
}

/* Trip Entry Cards */
.trip-entry-card {
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
}
.trip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.trip-card-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--brand-dark);
}
.btn-delete-trip {
    color: var(--danger);
    background: #FEF2F2;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-delete-trip:hover {
    background: #fee2e2;
}

/* Due Amount Display */
.due-amount-line {
    font-size: 13px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.due-amount-line.positive {
    color: var(--danger);
    font-weight: 600;
}
.due-amount-line.zero {
    color: var(--success);
    font-weight: 500;
}

/* Empty State (Trips) */
.trips-empty-state {
    text-align: center;
    border: 2px dashed #E5E7EB;
    border-radius: 12px;
    padding: 40px;
    color: #9CA3AF;
}
.trips-empty-state i {
    font-size: 48px;
    color: #D1D5DB;
    margin-bottom: 12px;
}

/* Summary Strip (Step 2) */
.bottom-summary-strip {
    background: #F7F8FC;
    border-radius: 10px;
    padding: 14px 20px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
}
.summary-stat {
    display: flex;
    flex-direction: column;
}
.summary-stat-label {
    font-size: 11px;
    color: #6B7280;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.summary-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-dark);
}
.summary-stat-value.text-danger {
    color: var(--danger);
}

/* Buttons */
.btn-secondary {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #374151;
}
.btn-secondary:hover {
    background: #F9FAFB;
}
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

/* Step 3 - Fuel & Expenses */
.subsection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.subsection-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-dark);
}
.optional-tag {
    font-size: 11px;
    color: #9CA3AF;
    background: #F3F4F6;
    border-radius: 100px;
    padding: 2px 8px;
}
.chip-auto-calc {
    background: #EFF6FF;
    color: var(--info);
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.section-divider {
    height: 1px;
    background: #F3F4F6;
    margin: 24px 0;
}
.expense-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.expense-chip {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.expense-chip:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}
.expense-row-card {
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: auto 1fr 2fr auto;
    gap: 16px;
    align-items: center;
}
.expense-cat-label {
    background: #F3F4F6;
    color: #374151;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

/* Step 4 - Review & Save */
.review-basic-info {
    background: #F9FAFB;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}
.review-info-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}
.review-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-dark);
}
.review-trips-list {
    margin-bottom: 24px;
}
.review-trip-item {
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.review-trip-item:last-child {
    border-bottom: none;
}
.financial-summary-card {
    background: var(--brand-dark);
    border-radius: 12px;
    padding: 20px;
    color: var(--white);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.fin-stat-label {
    color: #9CA3AF;
    font-size: 12px;
    margin-bottom: 4px;
}
.fin-stat-value {
    font-size: 16px;
    font-weight: 700;
}
.fin-stat-net {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    margin-top: 8px;
}
.fin-stat-net .fin-stat-value {
    color: var(--primary-accent);
    font-size: 22px;
    font-weight: 800;
}
.btn-save-ledger {
    background: var(--success);
    color: var(--white);
    font-weight: 700;
    font-size: 15px;
    padding: 12px 32px;
}
.btn-save-ledger:hover {
    background: #059669;
    color: var(--white);
}

/* Ledger History Table */
.history-table-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}
.history-table-header {
    background: var(--brand-dark);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-table-title {
    color: var(--white);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-filters {
    display: flex;
    gap: 12px;
}
.history-filter-input {
    background: var(--white);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    outline: none;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table th {
    background: #F9FAFB;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
}
.history-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--brand-dark);
    border-bottom: 1px solid #F3F4F6;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.btn-icon-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    color: #6B7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 4px;
}
.btn-icon-action:hover {
    background: #F3F4F6;
    color: var(--brand-dark);
}

/* Hide tabs content by default */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Driver Expenses Redesign */
.expense-total-chip {
    background: #FEF3C7;
    color: #92400E;
    font-size: 13px;
    font-weight: 700;
    border-radius: 100px;
    padding: 4px 14px;
}
.expense-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.expense-card {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 14px;
}
.expense-card-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}
.expense-input-wrapper {
    position: relative;
    width: 100%;
}
.expense-input-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 13px;
}
.expense-input {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 8px 10px 8px 28px;
    font-size: 14px;
    color: #1A1D2E;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.expense-input:focus {
    border-color: #F5C518;
    box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
    outline: none;
}
.custom-exp-sublabel {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}
.custom-exp-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.custom-exp-row .expense-input-wrapper {
    flex: 1;
}
.btn-remove-custom {
    background: #FEF2F2;
    color: #EF4444;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.btn-remove-custom:hover {
    background: #fee2e2;
}
.btn-add-custom {
    background: transparent;
    border: 1px dashed #D1D5DB;
    color: #6B7280;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-add-custom:hover {
    border-color: #F5C518;
    color: #F5C518;
    background: #FFFBEB;
}

/* Driver Balance Panel & Cash Give Section */
.driver-balance-panel {
    background: linear-gradient(135deg, #1A1D2E 0%, #2D3148 100%);
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    display: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.driver-balance-panel.active {
    display: flex;
}
.balance-label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.balance-value {
    font-size: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}
.balance-positive {
    color: #10B981;
}
.balance-negative {
    color: #EF4444;
}
.balance-zero {
    color: #9CA3AF;
}
.balance-note {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
}
.balance-driver-name {
    font-size: 15px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    text-align: right;
}
.balance-status-pill {
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.status-pill-positive {
    background: rgba(16,185,129,0.15);
    color: #10B981;
}
.status-pill-negative {
    background: rgba(239,68,68,0.15);
    color: #EF4444;
}
.status-pill-zero {
    background: rgba(156,163,175,0.15);
    color: #9CA3AF;
}

/* Sticky Chip Redesigned to Premium Banner */
.driver-balance-sticky {
    position: sticky;
    top: 20px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #1A1D2E 0%, #2D3148 100%);
    border-radius: 12px;
    padding: 12px 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 99;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.driver-balance-sticky.active {
    display: flex;
}
.sticky-label {
    font-size: 11px;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.sticky-value {
    font-size: 20px;
    font-weight: 800;
    margin-left: 12px;
}
.sticky-driver {
    font-size: 13px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sticky-driver i {
    color: #F5C518;
    font-size: 16px;
}

/* Give Cash Section */
.give-cash-container {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 16px;
    display: none;
}
.give-cash-container.active {
    display: block;
}
.give-cash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.give-cash-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1A1D2E;
}
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #E5E7EB;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.3s;
}
.toggle-switch.on {
    background: #F5C518;
}
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.toggle-switch.on .toggle-thumb {
    transform: translateX(18px);
}
.give-cash-expandable {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}
.give-cash-expandable.expanded {
    max-height: 500px;
    opacity: 1;
    padding-top: 16px;
}
.cash-input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.cash-btn-submit {
    background: #F5C518;
    color: #1A1D2E;
    font-weight: 700;
    font-size: 13px;
    padding: 9px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.cash-btn-submit:hover {
    background: #e5b510;
}
.cash-success-chip {
    background: #ECFDF5;
    color: #10B981;
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ─── VENDOR MANAGEMENT SYSTEM ─── */

/* Layout & Zones */
.vendor-module { display: flex; flex-direction: column; gap: 1.5rem; padding-bottom: 2rem; }

/* Zone A: Dashboard */
.vendor-dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 768px) { .vendor-dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
.vendor-recent-strip { background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); padding: 1rem; margin-top: 1rem; }
.vendor-recent-strip h3 { font-size: 1rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
.vendor-recent-strip a { color: var(--primary-color); font-size: 0.85rem; font-weight: 500; cursor: pointer; text-decoration: none; }
.vendor-recent-strip table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.vendor-recent-strip th, .vendor-recent-strip td { padding: 0.5rem; text-align: left; border-bottom: 1px solid #f3f4f6; }
.vendor-recent-strip th { background: #f9fafb; font-weight: 600; color: var(--text-muted); }
.vendor-recent-strip tr:last-child td { border-bottom: none; }

/* Zone B: Vendor List */
.vendor-filters-bar { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.vendor-filters-bar input, .vendor-filters-bar select { flex: 1; min-width: 150px; padding: 0.6rem 0.875rem; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 0.9rem; }

.vendor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 1200px) { .vendor-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .vendor-grid { grid-template-columns: 1fr; } }

.vendor-card { background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; border-left: 4px solid transparent; transition: all 0.2s; }
.vendor-card.selected { border-left-color: #F59E0B; background: #fffbeb; }

.vendor-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.vendor-card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-color); margin: 0; }
.vendor-badge { padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; background: #f3f4f6; color: var(--text-muted); }

.vendor-card-middle { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); }
.vendor-card-middle .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.vendor-card-middle .status-dot.active { background-color: #10B981; }
.vendor-card-middle .status-dot.inactive { background-color: #9CA3AF; }

.vendor-card-balance { padding-top: 0.75rem; border-top: 1px solid #f3f4f6; font-weight: 600; font-size: 0.95rem; display: flex; justify-content: space-between; align-items: center; }

.vendor-card-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.75rem; }
.vendor-card-actions button { flex: 1; padding: 0.4rem; font-size: 0.8rem; }
.vendor-card-actions .btn-icon { flex: 0 0 auto; width: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Zone C: Ledger */
.vendor-ledger-zone { display: none; background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden; margin-top: 1rem; }
.vendor-ledger-zone.active { display: block; }
.ledger-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem; border-bottom: 1px solid #f3f4f6; position: sticky; top: 0; background: white; z-index: 10; }
.ledger-header h2 { margin: 0; font-size: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.ledger-header-actions { display: flex; gap: 0.5rem; }

.ledger-summary-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1.25rem; background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
@media (max-width: 768px) { .ledger-summary-bar { grid-template-columns: repeat(2, 1fr); } }
.ledger-stat { display: flex; flex-direction: column; gap: 0.25rem; }
.ledger-stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; }
.ledger-stat-value { font-size: 1.1rem; font-weight: 700; }

.ledger-action-bar { display: flex; gap: 0.75rem; padding: 1.25rem; align-items: center; flex-wrap: wrap; }
.ledger-action-bar .date-filter { display: flex; gap: 0.5rem; align-items: center; margin-left: auto; }
@media (max-width: 768px) { .ledger-action-bar .date-filter { margin-left: 0; width: 100%; } }
.ledger-action-bar input[type="date"] { padding: 0.4rem; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 0.85rem; }

.ledger-table-container { overflow-x: auto; padding: 0 1.25rem 1.25rem 1.25rem; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ledger-table th, .ledger-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #f3f4f6; }
.ledger-table th { background: #f9fafb; font-weight: 600; color: var(--text-muted); position: sticky; top: 0; }
.ledger-table tbody tr:hover { background-color: #fefce8; }
.ledger-table td.actions { opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.ledger-table tr:hover td.actions { opacity: 1; }

.badge-bill { background-color: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-payment { background-color: #dcfce7; color: #16a34a; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-advance { background-color: #dbeafe; color: #2563eb; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-block; }

.text-red { color: #dc2626 !important; }
.text-green { color: #16a34a !important; }
.text-blue { color: #2563eb !important; }
.text-amber { color: #d97706 !important; }

/* Modals */
.vendor-modal-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.vendor-modal-container.active { opacity: 1; pointer-events: auto; }
.vendor-modal-card { background: white; border-radius: 12px; width: 100%; max-width: 580px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 10px 25px rgba(0,0,0,0.15); transform: translateY(20px); transition: transform 0.2s; }
.vendor-modal-container.active .vendor-modal-card { transform: translateY(0); }

.vendor-modal-header { padding: 1.25rem; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 1.1rem; }
.vendor-modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }
.vendor-modal-footer { padding: 1.25rem; border-top: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; background: #f9fafb; border-radius: 0 0 12px 12px; }

.form-section-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; margin-bottom: 0.75rem; padding-bottom: 0.25rem; border-bottom: 1px dashed #e5e7eb; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-color); }
.form-group input, .form-group select, .form-group textarea { padding: 0.6rem 0.875rem; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 0.9rem; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); }

.modal-tabs { display: flex; border-bottom: 1px solid #e5e7eb; margin-bottom: 1rem; }
.modal-tab { flex: 1; text-align: center; padding: 0.75rem; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.modal-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.empty-state { padding: 3rem; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 1rem; background: #f9fafb; border-radius: 10px; border: 1px dashed #d1d5db; }
.empty-state i { font-size: 3rem; color: #9ca3af; }

/* ─── Premium Today's Trips Single-Line Rows ─── */
.today-trips-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #fdfdfd;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 24 24' stroke-width='0.5' stroke='%2394a3b8' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Ccircle cx='7' cy='17' r='2' /%3E%3Ccircle cx='17' cy='17' r='2' /%3E%3Cpath d='M5 17h-2v-11a1 1 0 0 1 1 -1h9v12m-4 0h6m4 0h2v-6h-8m0 -5h5l3 5' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 300px;
    background-attachment: local;
    position: relative;
}

.today-trips-list::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(253, 253, 253, 0.93); /* Fade out the truck outline significantly */
    pointer-events: none;
    z-index: 0;
}

.today-trip-row {
    position: relative;
    z-index: 1; /* Keep cards above overlay */
    background: #ffffff;
    border: 1px solid #eaecf0;
    border-left: 4px solid var(--primary-accent);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
    gap: 0.75rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.today-trip-row:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    border-left-color: #f59e0b;
}

/* Section 1: Truck & Vehicle */
.tt-row-vehicle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
}

.tt-truck-icon-bg {
    width: 32px;
    height: 32px;
    background: rgba(245,197,24,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
}

.tt-vehicle-info {
    display: flex;
    flex-direction: column;
}

.tt-vehicle-no {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--brand-dark);
}

.tt-driver {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Section 2: Customer */
.tt-row-customer {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 120px;
    flex: 1;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tt-row-customer i { color: var(--primary-color); opacity: 0.7; }

/* Section 3: Route */
.tt-row-route {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1.5;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
}

.tt-route-icon {
    color: #10b981;
    font-size: 14px;
}

.tt-route-text {
    font-weight: 600;
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-route-text i {
    color: #9ca3af;
    font-size: 11px;
}

/* Section 4: Status & Amount */
.tt-row-finance {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 160px;
    justify-content: flex-end;
}

.tt-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tt-status.active { background: #e0e7ff; color: #4338ca; }
.tt-status.completed { background: #dcfce7; color: #15803d; }
.tt-status.draft { background: #ffedd5; color: #c2410c; }

.tt-amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: #10b981;
    font-family: 'Space Grotesk', monospace;
    white-space: nowrap;
}

/* Section 5: Action */
.tt-row-action {
    display: flex;
    align-items: center;
}

.tt-view-btn {
    background: #f1f5f9;
    color: var(--brand-dark);
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tt-view-btn:hover {
    background: var(--brand-dark);
    color: white;
}

/* ═══════════════════════════════════════
   REPORTS MODULE
   ═══════════════════════════════════════ */
.reports-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reports-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
}

.reports-filter-group {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.report-filter-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.report-filter-btn.active {
    background: var(--white);
    color: var(--brand-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}
@media (max-width: 1024px) {
    .reports-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.report-kpi-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.report-kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
}
.report-kpi-card.rev::after { background: var(--success); }
.report-kpi-card.exp::after { background: var(--danger); }
.report-kpi-card.prof::after { background: var(--warning); }
.report-kpi-card.veh::after { background: var(--info); }

.report-kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.reports-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 1024px) {
    .reports-charts-grid { grid-template-columns: 1fr; }
}

.report-chart-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.report-chart-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--brand-dark);
}

.reports-data-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.reports-tabs {
    display: flex;
    border-bottom: 1px solid var(--card-border);
    background: #f8fafc;
}

.report-tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.report-tab-btn:hover {
    color: var(--brand-dark);
}
.report-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-accent);
    background: var(--white);
}

.report-tab-pane {
    display: none;
    padding: 0;
}
.report-tab-pane.active {
    display: block;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}
.report-table th {
    background: #f1f5f9;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}
.report-table td {
    padding: 16px;
    border-bottom: 1px solid #eaecf0;
    font-size: 0.9rem;
    color: var(--brand-dark);
    font-weight: 500;
}
.report-table tr:hover td {
    background: #f8fafc;
}

/* Utility Classes */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }


/* READ-ONLY ROLE (Driver Supervisor) */
body.role-readonly .btn-primary:not(#btn-next-1):not(#btn-next-2):not(#btn-next-3):not(.tab-btn),
body.role-readonly .btn-save,
body.role-readonly .btn-save-draft,
body.role-readonly .btn-danger,
body.role-readonly .btn-success,
body.role-readonly .remove-row-btn,
body.role-readonly .action-btn[onclick*="delete"],
body.role-readonly .action-btn[onclick*="edit"],
body.role-readonly button[type="submit"],
body.role-readonly [id^="btn-add-"],
body.role-readonly [id$="-add-btn"],
body.role-readonly [id^="add-"] {
    display: none !important;
}

body.role-readonly #tab-new-entry input,
body.role-readonly #tab-new-entry select,
body.role-readonly #tab-new-entry textarea,
body.role-readonly form input,
body.role-readonly form select,
body.role-readonly form textarea {
    pointer-events: none;
    opacity: 0.8;
}

body.role-readonly .filters-card input,
body.role-readonly .filters-card select {
    pointer-events: auto;
    opacity: 1;
}

body.role-readonly .btn-save-ledger,
body.role-readonly .edit-btn,
body.role-readonly .delete-btn,
body.role-readonly .btn-delete-payment {
    display: none !important;
}

body.role-readonly button[onclick*="openAddVendorModal"],
body.role-readonly button[onclick*="deleteVendor"],
body.role-readonly button[onclick*="editSelectedVendor"],
body.role-readonly button[onclick*="openTransactionModal"],
body.role-readonly button[onclick*="saveVendor"],
body.role-readonly button[onclick*="saveTransaction"],
body.role-readonly #ledger-btn-delete,
body.role-readonly #ledger-btn-edit {
    display: none !important;
}

/* Ultra Modern Modal Styles */
.ultra-modal-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(229, 231, 235, 0.5);
    position: relative;
    overflow: hidden;
}

.ultra-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9CA3AF;
    cursor: pointer;
    transition: color 0.2s;
}

.ultra-close-btn:hover {
    color: #374151;
}

.ultra-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.car-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: white;
    font-size: 32px;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.ultra-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.ultra-modal-body p {
    text-align: center;
    color: #6B7280;
    font-size: 15px;
    margin-bottom: 24px;
}

.ultra-details-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F9FAFB;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.ultra-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ultra-label {
    font-size: 13px;
    color: #6B7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ultra-value {
    font-size: 14px;
    color: #111827;
    font-weight: 700;
}

.ultra-modal-actions {
    display: flex;
    gap: 12px;
}

.ultra-modal-actions .btn {
    flex: 1;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.ultra-btn-continue {
    background: #111827;
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.ultra-btn-continue:hover {
    background: #1F2937;
    box-shadow: 0 8px 20px -6px rgba(17, 24, 39, 0.5);
}

/* Line Animation */
.ultra-line-anim {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #10B981;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ultra-btn-continue.animating .ultra-line-anim {
    width: 100%;
}
.ultra-btn-continue.animating span {
    opacity: 0.7;
}

#ultra-confirm-date {
    font-weight: 900 !important;
    font-size: 16px !important;
    color: #000000 !important;
    background: #FEF3C7;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #FDE68A;
}


/* ==========================================================================
   STRICT MOBILE RESPONSIVENESS OVERRIDES
   These rules only apply to screens smaller than 768px.
   Desktop layout (> 768px) is 100% untouched.
   ========================================================================== */
@media (max-width: 768px) {
    /* Grids to Single Column */
    .form-grid-3,
    .form-grid-2,
    .dashboard-stats,
    .dash-content-grid,
    .stat-card-grid,
    .vendor-grid,
    .vehicle-metrics-grid,
    .review-basic-info .form-grid-3,
    .review-finance-info .form-grid-3 {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Modals & Dialogs */
    .modal-content,
    .ultra-modal {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        padding: 16px !important;
    }

    /* Make Tables Horizontally Scrollable without breaking */
    .data-table,
    .history-table,
    .master-table,
    table {
        white-space: nowrap !important;
        min-width: 600px !important; /* Force width so it triggers parent scroll */
    }

    /* Ensure table wrappers scroll horizontally */
    .table-container,
    .panel > div[style*="overflow"],
    .ultra-modal-body > div[style*="overflow"],
    .dashboard-panel > div[style*="overflow"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }

    /* Stack Headers & Search Bars */
    .page-header,
    .dashboard-header,
    .filter-bar,
    .history-filters,
    .action-bar,
    .ledger-action-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .page-header button,
    .filter-bar input,
    .filter-bar select,
    .history-filters input,
    .history-filters select,
    .action-bar button,
    .ledger-action-bar button,
    .ledger-action-bar input {
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Content Area Padding Adjustment */
    .main-content {
        padding: 16px !important;
    }

    /* Fix Sidebar Overlay & Mobile Toggle */
    .sidebar {
        width: 250px !important;
        min-width: 250px !important;
        box-shadow: 4px 0 15px rgba(0,0,0,0.5) !important;
    }
    
    /* Ensure the mobile toggle button doesn't hide */
    .mobile-only {
        display: inline-flex !important;
    }
}
