:root {
    --sidebar-bg:    #0f2447;
    --sidebar-width: 240px;
    --primary:       #1a3c6e;
    --accent:        #e8a020;
}

/* ── Base ──────────────────────────────────────────────────────────── */
body { font-family: 'Inter', sans-serif; background: #f0f4fb; margin: 0; }

/* ── Sidebar ───────────────────────────────────────────────────────── */
#sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-width);
    height: 100vh; background: var(--sidebar-bg); overflow-y: auto;
    z-index: 1000; transition: transform .25s;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon { font-size: 1.6rem; color: var(--accent); }
.brand-name { font-size: .82rem; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub  { font-size: .68rem; color: rgba(255,255,255,.45); }

.nav-group {
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: rgba(255,255,255,.3);
    padding: 16px 16px 4px;
}
#sidebar .nav-link {
    display: flex; align-items: center; gap: 9px;
    color: rgba(255,255,255,.7); padding: 9px 16px;
    border-radius: 6px; margin: 2px 8px; font-size: .83rem;
    text-decoration: none; transition: all .15s;
}
#sidebar .nav-link:hover  { background: rgba(255,255,255,.1); color: #fff; }
#sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }

/* ── Main ──────────────────────────────────────────────────────────── */
#main { margin-left: var(--sidebar-width); min-height: 100vh; }

.top-bar {
    background: #fff; border-bottom: 1px solid #e5eaf2;
    padding: 11px 24px; display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 100;
}
.breadcrumb-text { font-size: .85rem; font-weight: 500; color: #374151; }
.sidebar-toggle   { background: none; border: none; cursor: pointer; color: #374151; padding: 0; }

.page-body { padding: 24px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.07); border-radius: 10px; }
.card-header {
    background: #fff; border-bottom: 1px solid #f0f3f9;
    font-weight: 600; font-size: .88rem; padding: 14px 20px;
}

/* ── Tables ────────────────────────────────────────────────────────── */
.table th {
    background: #f6f9ff; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .05em; color: #6b7280; font-weight: 600;
}

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-label    { font-weight: 500; font-size: .82rem; color: #374151; margin-bottom: 4px; }
.form-control, .form-select {
    border-color: #d1d9e6; border-radius: 7px; font-size: .87rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,60,110,.1);
}
.form-control-sm { font-size: .8rem; }

/* ── Zoho fetch bar ────────────────────────────────────────────────── */
.zoho-bar {
    background: linear-gradient(135deg,#1a3c6e,#2a5298);
    border-radius: 10px; padding: 16px 20px; color: #fff; margin-bottom: 22px;
}
.zoho-bar .form-control {
    background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3);
    color: #fff;
}
.zoho-bar .form-control::placeholder { color: rgba(255,255,255,.5); }
.zoho-bar .form-control:focus        { background: rgba(255,255,255,.25); }

/* ── Vehicle card ──────────────────────────────────────────────────── */
.vehicle-card {
    background: #f8fafe; border: 1px solid #dde8ff;
    border-radius: 8px; padding: 14px 16px 12px; margin-bottom: 10px;
    position: relative;
}
.remove-vehicle-btn {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; color: #dc3545;
    font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0;
}

/* ── Action bar ────────────────────────────────────────────────────── */
.action-bar {
    background: #fff; border: none; box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border-radius: 10px; padding: 12px 18px; margin-bottom: 20px;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

/* ── Document preview ──────────────────────────────────────────────── */
.doc-preview { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }

/* ── Shared doc CSS (SI + BOL) ─────────────────────────────────────── */
.si-doc, .bol-doc {
    font-family: Arial, sans-serif; font-size: 10px; padding: 22px;
    max-width: 800px; margin: 0 auto; color: #111;
}
.si-doc table, .bol-doc table { width: 100%; border-collapse: collapse; }
.si-doc td, .si-doc th,
.bol-doc td, .bol-doc th    { border: 1px solid #333; padding: 5px 7px; vertical-align: top; }
.si-doc th, .bol-doc th     { font-weight: 700; }

.co-name { font-size: 12px; font-weight: 800; color: #1a3c6e; text-transform: uppercase; }
.co-addr { font-size: 8px;  color: #555; }
.fv      { font-size: 10px; font-weight: 700; }
.fa      { font-size: 9px;  color: #333; }
.fl      { font-size: 7px;  text-transform: uppercase; color: #888; font-weight: 700; display: block; margin-bottom: 2px; }

.copy-banner {
    background: #1a3c6e; color: #fff; text-align: center;
    font-size: 11px; font-weight: 700; letter-spacing: 2px; padding: 5px;
}

/* ── Print ─────────────────────────────────────────────────────────── */
@media print {
    /* Hide UI chrome */
    #sidebar, .top-bar, .action-bar, .no-print,
    .btn, .alert, .zoho-bar, .breadcrumb-text { display: none !important; }

    /* Reset layout */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
    #main { margin-left: 0 !important; padding: 0 !important; }
    .page-body { padding: 0 !important; }
    .doc-preview { box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }

    /* A4 page setup */
   @page {
    size: A4 portrait;
    margin: 0;
}

    /* Document fills full A4 width */
   .si-doc, .bol-doc {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10mm 12mm !important;
    font-size: 8.5px !important;
    box-sizing: border-box !important;
}

    /* Tables fill width, no overflow */
    .si-doc table, .bol-doc table {
        width: 100% !important;
        table-layout: fixed !important;
        word-wrap: break-word !important;
    }

    /* Avoid cutting rows across pages */
    .si-doc tr, .bol-doc tr { page-break-inside: avoid; }
}

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #main { margin-left: 0; }
}
