/* ============================================================
   Oski — Trade Plate Driver Management
   Navy (#1B2E4B) + Amber (#F59E0B) theme
   ============================================================ */

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

:root {
    --navy-900: #0f1e32;
    --navy-800: #152438;
    --navy-700: #1B2E4B;
    --navy-600: #243d63;
    --navy-500: #2d4d7e;
    --navy-100: #e8eef6;
    --navy-50:  #f2f5fa;
    --amber:    #F59E0B;
    --amber-h:  #D97706;
    --amber-l:  #FEF3C7;
    --slate-50: #f8fafc;
    --slate-100:#f1f5f9;
    --slate-200:#e2e8f0;
    --slate-300:#cbd5e1;
    --slate-400:#94a3b8;
    --slate-500:#64748b;
    --slate-600:#475569;
    --slate-700:#334155;
    --white:    #ffffff;
    --red-50:   #fef2f2;
    --red-100:  #fee2e2;
    --red-200:  #fecaca;
    --red-600:  #dc2626;
    --red-700:  #b91c1c;
    --green-50: #f0fdf4;
    --green-200:#bbf7d0;
    --green-500:#22c55e;
    --green-600:#16a34a;
    --green-700:#15803d;
    --green-800:#166534;
    --sidebar-w: 240px;
    --radius:   8px;
    --shadow:   0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--slate-700); background: var(--slate-50); line-height: 1.5; }
a { color: inherit; text-decoration: none; }

/* ---- Sidebar ---- */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--navy-700);
    display: flex; flex-direction: column;
    padding: 0; z-index: 100;
}
.sidebar-logo { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav { flex: 1; padding: 12px 8px; list-style: none; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    color: rgba(255,255,255,.7); font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-user {
    padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08);
    display: flex; flex-direction: column; gap: 8px;
}
.sidebar-user-info { display: flex; flex-direction: column; gap: 2px; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: 13px; }
.sidebar-user-email { color: rgba(255,255,255,.5); font-size: 11px; }

/* ---- Main layout ---- */
.app-layout { display: flex; min-height: 100vh; }
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--white); border-bottom: 1px solid var(--slate-200); padding: 16px 24px; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--navy-700); }
.page-content { flex: 1; padding: 24px; }

/* ---- Auth pages ---- */
.auth-bg {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-900) 100%);
    padding: 16px;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 28px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-logo p { color: rgba(255,255,255,.6); font-size: 13px; }

/* ---- Cards ---- */
.card {
    background: var(--white); border-radius: var(--radius);
    border: 1px solid var(--slate-200); box-shadow: var(--shadow);
}
.card-header { padding: 20px 20px 0; }
.card-title { font-size: 16px; font-weight: 700; color: var(--navy-700); display: flex; align-items: center; gap: 8px; }
.card-desc { color: var(--slate-500); font-size: 13px; margin-top: 4px; }
.card-body { padding: 20px; }
.card-header + .card-body { padding-top: 16px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: none; transition: background .15s, opacity .15s;
    text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy-700); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-600); }
.btn-amber { background: var(--amber); color: var(--navy-900); }
.btn-amber:hover:not(:disabled) { background: var(--amber-h); }
.btn-outline { background: transparent; color: var(--slate-700); border: 1px solid var(--slate-200); }
.btn-outline:hover:not(:disabled) { background: var(--slate-50); }
.btn-ghost { background: transparent; color: rgba(255,255,255,.7); }
.btn-ghost:hover:not(:disabled) { color: #fff; }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--red-700); }
.btn-success { background: var(--green-600); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--green-700); }
.btn-secondary { background: var(--slate-100); color: var(--slate-700); }
.btn-secondary:hover:not(:disabled) { background: var(--slate-200); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--slate-700); }
.form-control {
    width: 100%; padding: 9px 12px; border-radius: var(--radius);
    border: 1px solid var(--slate-200); font-size: 14px; color: var(--slate-700);
    background: var(--white); outline: none; transition: border-color .15s;
}
.form-control:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(27,46,75,.1); }
.form-control::placeholder { color: var(--slate-400); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ---- Alerts ---- */
.alert { display: flex; align-items: flex-start; gap: 8px; padding: 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--red-50); border: 1px solid var(--red-200); color: var(--red-700); }
.alert-success { background: var(--green-50); border: 1px solid var(--green-200); color: var(--green-700); }
.alert-amber { background: var(--amber-l); border: 1px solid #fde68a; color: #92400e; }
.alert svg { flex-shrink: 0; margin-top: 1px; }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 99px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
/* role badges */
.badge-driver   { background: #e0f2fe; color: #0369a1; }
.badge-ops      { background: #ede9fe; color: #6d28d9; }
.badge-accounts { background: #d1fae5; color: #065f46; }
.badge-manager  { background: var(--amber-l); color: #92400e; }
/* job status badges */
.badge-pending    { background: var(--slate-100); color: var(--slate-600); }
.badge-assigned   { background: #dbeafe; color: #1d4ed8; }
.badge-inprogress { background: var(--amber-l); color: #92400e; }
.badge-droppedoff { background: #ede9fe; color: #6d28d9; }
.badge-completed  { background: #d1fae5; color: #065f46; }
/* expense status badges */
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-paid     { background: #dbeafe; color: #1d4ed8; }
.badge-rejected { background: var(--red-100); color: var(--red-700); }

/* ---- Stats grid ---- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
@media (min-width: 900px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--navy-700); margin-top: 4px; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-row { display: flex; align-items: center; justify-content: space-between; }
.stat-icon-blue { background: #dbeafe; color: #1d4ed8; }
.stat-icon-amber { background: var(--amber-l); color: #92400e; }
.stat-icon-purple { background: #ede9fe; color: #6d28d9; }
.stat-icon-green { background: #d1fae5; color: #065f46; }

/* ---- Job / list rows ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--navy-700); }
.section-sub { color: var(--slate-500); font-size: 13px; margin-top: 2px; }
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card {
    background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow); display: block;
    transition: box-shadow .15s;
}
.job-card:hover { box-shadow: var(--shadow-md); }
.job-card-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.job-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--navy-50); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--navy-700); }
.job-info { flex: 1; min-width: 0; }
.job-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.job-number { font-weight: 700; color: var(--navy-700); }
.job-reg { font-size: 11px; background: var(--slate-100); color: var(--slate-600); padding: 2px 8px; border-radius: 4px; font-family: monospace; }
.job-route { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--slate-500); margin-bottom: 4px; white-space: nowrap; overflow: hidden; }
.job-route span { overflow: hidden; text-overflow: ellipsis; }
.job-meta { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--slate-400); }
.job-arrow { color: var(--slate-300); flex-shrink: 0; margin-top: 8px; }

/* ---- Empty state ---- */
.empty-state { padding: 64px 24px; text-align: center; }
.empty-state svg { color: var(--slate-300); margin: 0 auto 12px; display: block; }
.empty-state p { color: var(--slate-500); font-weight: 500; }
.empty-state span { color: var(--slate-400); font-size: 13px; margin-top: 4px; display: block; }

/* ---- Job detail ---- */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 2fr 1fr; } }
.info-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--slate-100); }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-400); }
.info-value { color: var(--navy-700); font-weight: 500; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-thumb { aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid var(--slate-200); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-400); margin-bottom: 12px; }

/* ---- Expense row ---- */
.expense-card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 16px; }
.expense-card.pending-border { border-color: #fde68a; }
.expense-inner { display: flex; gap: 16px; align-items: flex-start; }
.expense-body { flex: 1; }
.expense-title { font-weight: 700; color: var(--navy-700); margin-bottom: 2px; }
.expense-amount { font-size: 24px; font-weight: 700; color: var(--navy-700); }
.expense-meta { font-size: 12px; color: var(--slate-500); margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.expense-actions { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.processed-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); }
.processed-main { font-size: 13px; font-weight: 600; color: var(--navy-700); }
.processed-sub { font-size: 11px; color: var(--slate-400); margin-top: 2px; }
.processed-right { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy-700); }

/* ---- Admin / team ---- */
.member-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); margin-bottom: 8px; }
.member-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-100); display: flex; align-items: center; justify-content: center; color: var(--navy-600); flex-shrink: 0; }
.member-info { flex: 1; margin-left: 12px; }
.member-name { font-weight: 600; color: var(--navy-700); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.member-sub { font-size: 11px; color: var(--slate-500); margin-top: 2px; }
.member-right { display: flex; align-items: center; gap: 8px; }
.invite-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--slate-50); margin-bottom: 8px; }
.invite-token { font-size: 11px; color: #2563eb; font-family: monospace; word-break: break-all; margin-top: 4px; }

/* ---- Inline form rows ---- */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }

/* ---- Upload area ---- */
.upload-area {
    border: 2px dashed var(--slate-200); border-radius: var(--radius);
    padding: 24px; text-align: center; cursor: pointer;
    color: var(--slate-400); transition: border-color .15s;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--navy-700); color: var(--navy-700); }
.upload-area input[type=file] { display: none; }

/* ---- Utility ---- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.text-muted { color: var(--slate-400); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 672px; }
.inactive-badge { background: var(--red-100); color: var(--red-600); font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* ---- Logo ---- */
.logo { display: flex; align-items: center; gap: 8px; }

/* ---- Toast ---- */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--navy-700); color: #fff; padding: 12px 16px;
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    font-size: 13px; max-width: 320px;
    animation: slide-in .2s ease;
}
.toast.toast-success { background: var(--green-600); }
.toast.toast-error { background: var(--red-600); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Landing page ---- */
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: rgba(27,46,75,.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,.08); }
.landing-nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.hero { min-height: 100vh; background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-900) 100%); display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 24px 64px; }
.hero-inner { max-width: 700px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: #fff; line-height: 1.1; margin-bottom: 20px; }
.hero h1 span { color: var(--amber); }
.hero p { font-size: 18px; color: rgba(255,255,255,.7); margin-bottom: 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features-section { padding: 80px 24px; max-width: 1100px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 40px; }
.feature-card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--navy-50); display: flex; align-items: center; justify-content: center; color: var(--navy-700); margin-bottom: 16px; }
.feature-title { font-size: 16px; font-weight: 700; color: var(--navy-700); margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: var(--slate-500); line-height: 1.6; }
.section-heading { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--navy-700); }
.section-heading span { color: var(--amber); }
.cta-section { background: var(--navy-700); padding: 80px 24px; text-align: center; }
.cta-section h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: #fff; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,.7); margin-bottom: 32px; font-size: 16px; }
.landing-footer { background: var(--navy-900); color: rgba(255,255,255,.4); padding: 24px; text-align: center; font-size: 13px; }
