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

/* ==========================================================================
   Rafiki Tours & Travel — design system
   Tokens → base → shell → components → pages → responsive
   ========================================================================== */

:root {
    --ink: #17201D;
    --ink-2: #3B4744;
    --muted: #6B7672;
    --subtle: #9AA39F;
    --canvas: #F6F5F1;
    --surface: #FFFFFF;
    --surface-2: #FAF9F6;
    --border: #E8E5DE;
    --border-strong: #D6D2C8;

    --brand: #0F766E;          /* acacia teal */
    --brand-hover: #0B5F58;
    --brand-soft: #E6F4F1;
    --accent: #D97706;         /* savanna amber */
    --accent-soft: #FDF3E3;
    --sidebar: #10231F;
    --sidebar-2: #173129;
    --sidebar-ink: #C9D6D1;

    --success: #15803D;  --success-soft: #E8F6EC;
    --warning: #B45309;  --warning-soft: #FEF3E2;
    --danger:  #C2410C;  --danger-soft:  #FDECE4;
    --info:    #0369A1;  --info-soft:    #E7F2FA;
    --violet:  #6D28D9;  --violet-soft:  #F1EBFD;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(23, 32, 29, .05);
    --shadow: 0 1px 2px rgba(23, 32, 29, .04), 0 6px 18px rgba(23, 32, 29, .05);
    --shadow-lg: 0 18px 40px rgba(23, 32, 29, .16);
    --sidebar-w: 260px;
    --topbar-h: 68px;
    --focus: 0 0 0 3px rgba(15, 118, 110, .2);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body {
    margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4, h5 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: var(--muted) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.small-caps { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--subtle); }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
    background: linear-gradient(180deg, var(--sidebar) 0%, #0C1C19 100%);
    color: var(--sidebar-ink); display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: linear-gradient(135deg, #14B8A6, var(--brand)); color: #fff; font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(20, 184, 166, .35);
}
.brand-name { color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.15; }
.brand-sub { color: #E9B872; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-section { margin: 18px 10px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6F8A82; }
.nav-link-x {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 10px;
    color: var(--sidebar-ink); font-weight: 500; transition: background .15s, color .15s;
}
.nav-link-x i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .85; }
.nav-link-x:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link-x.active { background: rgba(20, 184, 166, .16); color: #fff; box-shadow: inset 3px 0 0 #2DD4BF; }
.nav-link-x.active i { color: #5EEAD4; opacity: 1; }
.sidebar-foot { padding: 14px 20px; font-size: .75rem; color: #6F8A82; border-top: 1px solid rgba(255,255,255,.06); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px; padding: 0 28px;
    background: rgba(246, 245, 241, .86); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; color: var(--ink); }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; border: 0; background: var(--surface); border-radius: 10px; width: 40px; height: 40px; box-shadow: var(--shadow-sm); }
.chip {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--ink-2); font-weight: 500;
}
.chip i { color: var(--muted); }
.division-select { border: 0; background: transparent; font-weight: 600; color: var(--ink); padding: 0 4px; max-width: 280px; }
.division-select:focus { box-shadow: none; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: linear-gradient(135deg, var(--accent), #F59E0B); color: #fff; font-weight: 700; font-size: .85rem;
}
.user-menu .dropdown-toggle::after { display: none; }
.user-menu .btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px; }
.user-name { display: block; font-weight: 600; line-height: 1.1; text-align: left; }
.user-role { font-size: .75rem; color: var(--muted); }

.content { padding: 28px; max-width: 1480px; width: 100%; }
.backdrop { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.page-title { font-size: 1.75rem; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted); margin: 4px 0 0; max-width: 720px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cards ---------- */
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-x + .card-x { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2, .card-head h3 { font-size: 1rem; margin: 0; }
.card-head .hint { color: var(--muted); font-size: .82rem; }
.card-body-x { padding: 18px 22px 22px; }
.card-pad { padding: 22px; }

.stat {
    position: relative; overflow: hidden; padding: 20px; height: 100%;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 10px; color: inherit;
}
a.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); color: inherit; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-weight: 600; font-size: .85rem; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat-foot { color: var(--muted); font-size: .8rem; }
.tone-brand .stat-icon { background: var(--brand-soft); color: var(--brand); }
.tone-accent .stat-icon { background: var(--accent-soft); color: var(--accent); }
.tone-info .stat-icon { background: var(--info-soft); color: var(--info); }
.tone-violet .stat-icon { background: var(--violet-soft); color: var(--violet); }
.tone-success .stat-icon { background: var(--success-soft); color: var(--success); }
.tone-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }

.meter { height: 8px; border-radius: 999px; background: #EFECE5; overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; }

/* ---------- Tables ---------- */
.table-x { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-x th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); font-weight: 700;
    padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; text-align: left;
}
.table-x td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr:hover td { background: #FBFAF7; }
.table-x .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: .8rem; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.cell-amber { background: var(--accent-soft) !important; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--subtle); display: block; margin-bottom: 8px; }

/* ---------- Badges ---------- */
.badge-x {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; white-space: nowrap; background: #F0EEE8; color: var(--ink-2);
}
.badge-x::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-x.plain::before { display: none; }
.b-success { background: var(--success-soft); color: var(--success); }
.b-warning { background: var(--warning-soft); color: var(--warning); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-brand { background: var(--brand-soft); color: var(--brand); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-muted { background: #F0EEE8; color: var(--muted); }

/* ---------- Buttons & forms ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; }
.btn-sm { border-radius: 8px; padding: .3rem .7rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #B45309; color: #fff; }
.btn-light { background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); }
.btn-light:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { background: #EFECE5; color: var(--ink); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }

.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-bottom: 6px; }
.form-control, .form-select {
    border-radius: 10px; border-color: var(--border-strong); padding: .55rem .8rem; background-color: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: var(--focus); }
.form-text { color: var(--muted); }
.text-uppercase::placeholder { text-transform: none; }
.field-validation-error, .text-danger { color: var(--danger) !important; font-size: .8rem; }
.input-validation-error { border-color: var(--danger) !important; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.form-section { padding: 22px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 16px; }
.form-section-title i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.form-foot {
    display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px;
    background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check-tile {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
    cursor: pointer; background: #fff; font-weight: 500;
}
.check-tile:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.check-tile input { accent-color: var(--brand); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; }
.filters .search { min-width: 240px; flex: 1 1 240px; max-width: 360px; }

.alert-x { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.alert-x i { font-size: 1.1rem; margin-top: 1px; }
.alert-x.success { background: var(--success-soft); color: var(--success); }
.alert-x.danger { background: var(--danger-soft); color: var(--danger); }
.alert-x.warning { background: var(--warning-soft); color: var(--warning); }
.alert-x.info { background: var(--info-soft); color: var(--info); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); color: var(--muted); }

.secret-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; letter-spacing: .06em;
    padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; display: inline-block;
}

/* ---------- Dashboard ---------- */
.hero {
    border-radius: var(--radius-lg); padding: 24px 26px; margin-bottom: 22px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(1200px 300px at 100% 0%, rgba(217, 119, 6, .38), transparent 60%),
                linear-gradient(120deg, #0F3B35 0%, #0F766E 100%);
}
.hero h1 { color: #fff; font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; }
.hero p { margin: 0; color: rgba(255, 255, 255, .78); }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-pill { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem; color: #fff; }
.hero-pill:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.list-x { list-style: none; margin: 0; padding: 0; }
.list-x li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.list-x li:last-child { border-bottom: 0; }
.time-pill { min-width: 62px; text-align: center; padding: 6px 8px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-hover); font-weight: 700; line-height: 1.1; }
.time-pill small { display: block; font-weight: 600; font-size: .68rem; opacity: .8; }
.time-pill.amber { background: var(--accent-soft); color: var(--warning); }
.list-main { flex: 1; min-width: 0; }
.list-main .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main .s { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; font-weight: 500; color: var(--ink-2); }
.alert-row.danger { background: var(--danger-soft); }
.alert-row.warning { background: var(--warning-soft); }
.alert-row i { color: var(--danger); }
.alert-row.warning i { color: var(--warning); }
.chart-box { position: relative; height: 260px; }
.chart-box.short { height: 220px; }
.chart-box.sm { height: 220px; }

.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-pill.warn { background: rgba(251, 191, 36, .22); border-color: rgba(251, 191, 36, .45); }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .18); font-weight: 600; font-size: .82rem; color: #fff; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #5EEAD4; box-shadow: 0 0 0 0 rgba(94, 234, 212, .7); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(94, 234, 212, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.dash-tabs { display: flex; gap: 4px; padding: 4px; background: #ECE9E2; border-radius: 12px; margin-bottom: 22px; width: max-content; max-width: 100%; overflow-x: auto; }
.dash-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.dash-tabs a:hover { color: var(--ink); }
.dash-tabs a.active { background: #fff; color: var(--brand-hover); box-shadow: var(--shadow-sm); }

.section-label { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.section-label > span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: .78rem; }
.section-link { margin-left: auto; font-size: .82rem; font-weight: 600; }

.status-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rail-cell { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; color: var(--ink); border-right: 1px solid var(--border); transition: background .15s; }
.rail-cell:last-child { border-right: 0; }
.rail-cell:hover { background: #FBFAF7; color: var(--ink); }
.rail-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .82rem; }
.rail-value { font-size: 1.9rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.rail-sub { color: var(--muted); font-size: .76rem; }
.rail-cell.rail-alert { background: var(--accent-soft); }
.rail-cell.rail-alert .rail-label, .rail-cell.rail-alert .rail-sub { color: var(--warning); font-weight: 700; }
.rail-cell.rail-alert .rail-value { color: var(--warning); }

.meter-lg { height: 14px; gap: 2px; background: #EFECE5; }
.meter-lg > span { border-radius: 3px; }
.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-weight: 500; }
.legend-list li:last-child { border-bottom: 0; }
.legend-list li b { margin-left: auto; font-size: 1.05rem; }
.legend-list li.muted { color: var(--subtle); }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.swatch.hollow { border: 2px dashed var(--border-strong); }
.note { display: flex; gap: 8px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.note i { margin-top: 1px; }
.list-x.compact li { padding: 8px 0; gap: 10px; }
.list-x.compact .time-pill { min-width: 54px; padding: 5px 6px; }
.card-foot-link { padding: 12px 22px 16px; font-size: .85rem; font-weight: 600; }
.footnote { color: var(--subtle); font-size: .78rem; margin: 6px 2px 0; }

.fleet-panel { display: grid; grid-template-columns: 260px 1fr; gap: 8px; padding: 18px 22px 22px; align-items: center; }
.fleet-donut { position: relative; }
.fleet-donut .chart-box { height: 230px; }
.donut-center { position: absolute; top: 0; left: 0; right: 0; height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center b { font-size: 2rem; font-weight: 800; line-height: 1; }
.donut-center span { color: var(--muted); font-size: .76rem; }
.fleet-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.fleet-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.fleet-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); color: var(--ink); }
.ft-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.ft-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .82rem; }
.ft-value { font-size: 1.6rem; font-weight: 800; line-height: 1.05; }
.ft-sub { color: var(--muted); font-size: .74rem; }
.fleet-tile.attention { background: var(--accent-soft); border-color: #F5D9A8; }
.fleet-tile.attention .ft-label, .fleet-tile.attention .ft-value { color: var(--warning); }

.alert-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 22px; padding: 18px 22px 14px; }
.ag-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.alert-row span { min-width: 0; }

.dash-filters { padding: 12px 16px; border-bottom: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); min-width: 0; }
a.kpi:hover { border-color: var(--border-strong); color: var(--ink); }
.kpi-label { color: var(--muted); font-weight: 600; font-size: .82rem; }
.kpi-value { font-size: 1.65rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.kpi-value.neg { color: var(--danger); }
.kpi-sub { color: var(--muted); font-size: .76rem; }
.kpi.kpi-alert { background: var(--accent-soft); border-color: #F5D9A8; }
.kpi.kpi-alert .kpi-label, .kpi.kpi-alert .kpi-value { color: var(--warning); }
.table-x td:has(.inline-bar) { min-width: 180px; }
.table-x td:has(.inline-bar) .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.inline-bar { height: 4px; border-radius: 999px; background: #F0EEE8; margin-top: 6px; max-width: 220px; }
.inline-bar > span { display: block; height: 100%; border-radius: 999px; background: #0D9488; }
.table-x tfoot td { padding: 12px 16px; font-weight: 700; border-top: 2px solid var(--border); background: var(--surface-2); }
.costing-out { padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }
.costing-out.neg { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1199.98px) {
    .status-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rail-cell:nth-child(3n) { border-right: 0; }
    .rail-cell:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
    .kpi-grid, .kpi-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fleet-panel { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .status-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rail-cell { border-right: 0 !important; border-bottom: 1px solid var(--border); padding: 14px 16px; }
    .rail-cell:nth-child(odd) { border-right: 1px solid var(--border) !important; }
    .kpi-grid, .kpi-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fleet-panel, .alert-groups { padding-left: 16px; padding-right: 16px; }
    .hero { padding: 20px; }
}
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---------- Booking / itinerary ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.summary-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); font-weight: 700; }
.summary-grid dd { margin: 2px 0 0; font-weight: 600; }
.days-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--warning); font-weight: 700; }

.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-day { position: relative; margin-bottom: 16px; }
.tl-dot {
    position: absolute; left: -34px; top: 14px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .8rem; display: grid; place-items: center;
    box-shadow: 0 0 0 4px var(--canvas);
}
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.tl-date { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tl-notes { color: var(--ink-2); }
.tl-notes p { margin: 0 0 .4rem; }

.rte-toolbar { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.rte-toolbar button { border: 0; background: transparent; width: 32px; height: 30px; border-radius: 7px; color: var(--ink-2); }
.rte-toolbar button:hover { background: #ECE9E2; }
.rte {
    min-height: 96px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 0 0 10px 10px; background: #fff; outline: none;
}
.rte:focus { border-color: var(--brand); box-shadow: var(--focus); }
.rte:empty::before { content: attr(data-placeholder); color: var(--subtle); }
.rte p { margin: 0 0 .4rem; }

/* ---------- Movements board ---------- */
.day-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-group { padding: 10px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; display: flex; justify-content: space-between; }
.seg { display: inline-flex; background: #ECE9E2; border-radius: 10px; padding: 3px; }
.seg a { padding: 5px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.status-form select { font-size: .8rem; padding: .2rem 1.8rem .2rem .6rem; border-radius: 8px; }

/* ---------- Allocation ---------- */
.job-card { display: flex; gap: 14px; align-items: center; }
.job-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.job-icon.safari { background: var(--accent-soft); color: var(--accent); }
.job-icon.movement { background: var(--info-soft); color: var(--info); }
.conflict { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; font-weight: 500; }
.conflict.Block { background: var(--danger-soft); color: var(--danger); }
.conflict.Warning { background: var(--warning-soft); color: var(--warning); }
.conflict.Info { background: var(--info-soft); color: var(--info); }
.slot { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.slot + .slot { margin-top: 10px; }
.slot.filled { border-style: solid; background: var(--surface-2); }
.slot-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }

/* ---------- Audit ---------- */
.diff { width: 100%; font-size: .82rem; }
.diff td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-word; }
.diff .old { color: var(--danger); text-decoration: line-through; text-decoration-color: rgba(194, 65, 12, .35); }
.diff .new { color: var(--success); }

/* ---------- Session warning ---------- */
.session-warning { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(12, 28, 25, .55); backdrop-filter: blur(4px); }
.session-warning[hidden] { display: none; }
.session-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px; text-align: center; }
.session-card h2 { font-size: 1.3rem; font-weight: 800; margin: 12px 0 6px; }
.session-card p { color: var(--muted); margin-bottom: 20px; }
.session-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; background: var(--accent-soft); color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(12, 28, 25, .45); z-index: 1035; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .topbar { padding: 0 16px; gap: 8px; }
    .content { padding: 18px 16px; }
    .chip.hide-sm, .user-name, .user-role { display: none; }
}
@media (max-width: 575.98px) {
    .page-title { font-size: 1.4rem; }
    .division-select { max-width: 150px; }
    .filters .form-control, .filters .form-select, .filters .search { min-width: 0; width: 100%; max-width: none; }
    .card-head, .card-body-x, .form-section, .filters, .pager { padding-left: 16px; padding-right: 16px; }
}
@media print {
    .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
    .main { margin: 0; }
    .card-x { box-shadow: none; }
}
