/* ============================================================
 *  CorridorOps — Design System
 *  ============================================================ */

:root {
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .10);
}

.tabnum { font-variant-numeric: tabular-nums; }

/* ---- Cards ---- */
.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e8ecf2;
}
.card-tight {
    border-radius: 12px;
}

/* ---- Pills / chips ---- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.15;
}
.dot {
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    display: inline-block;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .18rem .5rem;
    border-radius: 7px;
    font-size: .7rem;
    font-weight: 600;
}

/* ---- Sidebar ---- */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem .75rem;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: .15s;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}
.sidebar-link.active {
    background: rgba(42, 157, 143, .18);
    color: #fff;
    border-left: 3px solid #2a9d8f;
    padding-left: .6rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
    transition: .15s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: #1f3a5f; color: #fff; }
.btn-primary:hover { background: #16293f; }
.btn-accent { background: #2a9d8f; color: #fff; }
.btn-accent:hover { background: #21867a; }
.btn-ghost { background: #fff; color: #1f3a5f; border: 1px solid #d7dee8; }
.btn-ghost:hover { background: #f1f4f8; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a53125; }
.btn-warn { background: #e9a03b; color: #fff; }
.btn-warn:hover { background: #cf8a2b; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Form ---- */
.input, .select, .textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    font-size: .85rem;
    background: #fff;
    font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
    outline: 2px solid #2a9d8f33;
    border-color: #2a9d8f;
}
.input-sm { padding: .4rem .55rem; font-size: .82rem; border-radius: 8px; }
.input[readonly] { background: #f8fafc; color: #64748b; cursor: default; }

/* Multi-line parts receipt search */
.part-suggest { position: relative; }
.part-suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}
.part-suggest-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .65rem;
  align-items: center;
  width: 100%;
  padding: .55rem .75rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f1f4f8;
  cursor: pointer;
  font-family: inherit;
}
.part-suggest-item:last-child { border-bottom: 0; }
.part-suggest-item:hover, .part-suggest-item:focus { background: #f4faf9; outline: none; }
.part-suggest-empty { padding: .75rem; font-size: .82rem; color: #94a3b8; }
.receive-lines tbody tr { border-bottom: 1px solid #eef2f6; }
.receive-lines tbody tr:last-child { border-bottom: 0; }

/* ---- Phone (driver app) ---- */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    font-size: .6rem;
    font-weight: 600;
    color: #64748b;
    flex: 1;
    padding: .35rem 0;
    text-decoration: none;
    transition: .15s;
}
.nav-item.active { color: #2a9d8f; }

.phone-frame {
    width: 390px;
    max-width: 100%;
    height: 800px;
    background: #0f172a;
    border-radius: 42px;
    padding: 12px;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .4);
    margin: 0 auto;
}
.phone-inner {
    width: 100%;
    height: 100%;
    background: #f4f6f9;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.phone-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 72px;
}
.phone-bottomnav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    border-top: 1px solid #e8ecf2;
    display: flex;
    align-items: center;
    padding: 0 .5rem;
}
.big-btn {
    min-height: 56px;
    border-radius: 14px;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: .15s;
    text-decoration: none;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 10px;
    font-size: .82rem;
    z-index: 9999;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
    max-width: 90%;
    text-align: center;
}

/* ---- SOS pulse ---- */
.sos-pulse { animation: pulse 1.6s infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .55); }
    50%      { box-shadow: 0 0 0 14px rgba(192, 57, 43, 0); }
}

/* ---- Scrollbar ---- */
.scroll-thin::-webkit-scrollbar { height: 6px; width: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ---- Signature pad ---- */
.sig-pad {
    background: #fff;
    border: 1.5px dashed #94a3b8;
    border-radius: 12px;
    touch-action: none;
    cursor: crosshair;
    width: 100%;
}

/* ---- Tooltips ---- */
.tip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #94a3b8;
}
.tip:hover .tip-content { display: block; }
.tip-content {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 0;
    background: #0f172a;
    color: #fff;
    font-size: .72rem;
    padding: .5rem .7rem;
    border-radius: 8px;
    width: 240px;
    z-index: 100;
    line-height: 1.4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.tip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 12px;
    border: 6px solid transparent;
    border-top-color: #0f172a;
}

/* ---- Help banner ---- */
.help-banner {
    background: #eef2f7;
    border-left: 4px solid #2a9d8f;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .83rem;
    color: #1f3a5f;
    margin-bottom: 1rem;
}
.help-banner b { color: #1f3a5f; }

/* ---- Sign-in page ---- */
.login-page { min-height: 100vh; background: #f5f7fa; }
.login-main { display: flex; flex-direction: column; padding: 1.25rem; min-height: 100vh; }
.login-form { width: 100%; max-width: 24rem; margin: auto; display: flex; flex-direction: column; gap: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 2rem 1.75rem; box-shadow: 0 10px 30px -12px rgba(31, 58, 95, .18); }
.login-badge { align-self: center; font-size: .7rem; font-weight: 600; color: #1f3a5f; background: #eef2f7; border-radius: 999px; padding: .2rem .7rem; }
.login-input { position: relative; display: block; }
.login-input > .ico-16 { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.login-input .input { padding-left: 2.25rem; padding-right: 2.5rem; height: 2.75rem; }
.login-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: .4rem; color: #64748b; cursor: pointer; }
.login-eye:hover { background: #f1f5f9; color: #1f3a5f; }
.login-eye:focus-visible { outline: 2px solid #2a9d8f; outline-offset: 1px; }
.login-submit { height: 2.75rem; justify-content: center; gap: .5rem; font-size: .9rem; }

/* ---- Switch (role="switch", aria-checked) ---- */
.switch { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: transparent; padding: .15rem 0; cursor: pointer; font-family: inherit; font-size: .8rem; color: #64748b; }
.switch-track { position: relative; width: 2.25rem; height: 1.25rem; border-radius: 999px; background: #cbd5e1; transition: background .15s; flex-shrink: 0; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 4px); height: calc(1.25rem - 4px); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); transition: transform .15s; }
.switch[aria-checked="true"] { color: #15803d; font-weight: 600; }
.switch[aria-checked="true"] .switch-track { background: #2a9d8f; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(1rem); }
.switch:focus-visible .switch-track { outline: 2px solid #2a9d8f; outline-offset: 2px; }
.switch:disabled { cursor: not-allowed; opacity: .6; }

/* ---- Language toggle ---- */
.lang-toggle {
    display: inline-flex;
    background: #eef2f7;
    border-radius: 8px;
    padding: 2px;
}
.lang-toggle button {
    padding: .3rem .7rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}
.lang-toggle button.active {
    background: #fff;
    color: #1f3a5f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* ---- Progress bars ---- */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar > div {
    height: 100%;
    border-radius: 999px;
    transition: width .3s;
}

/* ---- Kanban ---- */
.kanban-col {
    background: #f8fafc;
    border-radius: 12px;
    padding: .75rem;
    min-height: 160px;
}
.kanban-card {
    background: #fff;
    border-radius: 10px;
    padding: .65rem;
    margin-bottom: .5rem;
    border: 1px solid #e8ecf2;
    cursor: pointer;
    transition: .15s;
    font-size: .75rem;
    text-decoration: none;
    display: block;
}
.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

/* ---- Work order status ---- */
.wo-status {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 700;
}
.wo-ouvert  { background: #fee2e2; color: #991b1b; }
.wo-en-cours { background: #dbeafe; color: #1e40af; }
.wo-pieces   { background: #fef3c7; color: #92400e; }
.wo-cloture  { background: #d1fae5; color: #065f46; }

/* ---- Vertical timeline ---- */
.timeline-vert {
    position: relative;
    padding-left: 1.5rem;
}
.timeline-vert::before {
    content: '';
    position: absolute;
    left: .4rem;
    top: .3rem;
    bottom: .3rem;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item {
    position: relative;
    padding-bottom: .75rem;
    font-size: .78rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: .25rem;
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    background: #2a9d8f;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
}

/* ---- Parts rows ---- */
.parts-row {
    padding: .5rem;
    border-bottom: 1px solid #f1f5f9;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: .5rem;
    align-items: center;
    font-size: .78rem;
}
.parts-row:last-child { border-bottom: none; }

.badge-stock {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 5px;
    font-size: .65rem;
    font-weight: 700;
}
.stock-ok  { background: #d1fae5; color: #065f46; }
.stock-low { background: #fef3c7; color: #92400e; }
.stock-out { background: #fee2e2; color: #991b1b; }

/* ---- Calendar ---- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-day {
    min-height: 60px;
    background: #f8fafc;
    border-radius: 8px;
    padding: .35rem;
    font-size: .68rem;
    border: 1px solid #e8ecf2;
    position: relative;
}
.calendar-day.today {
    background: #e6f6f4;
    border-color: #2a9d8f;
}
.calendar-day .day-num {
    font-weight: 700;
    color: #475569;
}
.calendar-event {
    background: #2a9d8f;
    color: #fff;
    padding: .1rem .3rem;
    border-radius: 4px;
    font-size: .6rem;
    margin-top: .15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-event.warn   { background: #e9a03b; }
.calendar-event.danger { background: #c0392b; }

/* ---- Truck mini card ---- */
.truck-mini {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .7rem;
    flex-shrink: 0;
}

/* ============================================================
 *  Console additions (frontend/) — rail, accordion, scroll, forms
 *  ============================================================ */

/* ---- Sidebar rail ---- */
.sidebar { width: 16rem; transition: width .18s ease; }
.sidebar.collapsed { width: 4.75rem; }
.sidebar .brand-mark { display: none; }
.sidebar.collapsed .brand-mark { display: block; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-group-label span,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-foot-text { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .sidebar-link.active { border-left-width: 0; box-shadow: inset 3px 0 0 #2a9d8f; }
.sidebar.collapsed .nav-group-label { justify-content: center; }
.sidebar.collapsed .nav-group-label .chev,
.sidebar.collapsed .nav-group-count { display: none !important; }
.sidebar.collapsed .nav-group-items { display: block !important; }
.sidebar-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Sidebar accordion ---- */
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); margin-top: .25rem; padding-top: .25rem; }
.nav-group-label {
    display: flex; align-items: center; gap: .5rem;
    width: 100%; padding: .55rem .75rem; border: 0; border-radius: .5rem; background: transparent; cursor: pointer;
    font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); font-family: inherit;
}
.nav-group-label:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-group-label:focus-visible { outline: 2px solid #2a9d8f; outline-offset: -2px; }
.nav-group-name { flex: 1; text-align: left; }
.nav-group-label .chev { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; transition: transform .15s; }
.nav-group-count { display: none; font-size: 10px; letter-spacing: 0; color: rgba(255,255,255,.75); background: rgba(255,255,255,.1); border-radius: 999px; min-width: 1.25rem; padding: 0 .35rem; line-height: 1.1rem; text-align: center; }
.nav-group.closed .nav-group-label { color: rgba(255,255,255,.5); }
.nav-group.closed .nav-group-label .chev { transform: rotate(-90deg); }
.nav-group.closed .nav-group-count { display: inline-block; }
.nav-group.closed .nav-group-items { display: none; }
.nav-badge { margin-left: auto; background: #e9a03b; color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem; display: inline-flex; align-items: center; justify-content: center; }
.sidebar.collapsed .nav-badge { position: absolute; top: 2px; right: 8px; }
.sidebar.collapsed .sidebar-link { position: relative; }

/* ---- Contained scrolling ---- */
.table-scroll { overflow: auto; }
.table-scroll table { min-width: 640px; }
.table-scroll thead th { background: #f8fafc; }
body { overflow-x: hidden; }

/* ---- Pending / honest empty state ---- */
.pending-state {
    display: flex; align-items: flex-start; gap: .75rem;
    background: #fdf3e3; border: 1px dashed #e9a03b; color: #92400e;
    border-radius: 12px; padding: .85rem 1rem; font-size: .85rem;
}
.pending-state i { color: #e9a03b; flex-shrink: 0; margin-top: 2px; }

/* ---- Row actions ---- */
.icon-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.9rem; height: 1.9rem; border-radius: 8px; color: #64748b; border: 0; background: transparent; cursor: pointer; margin-left: .15rem;
}
.icon-action:hover { background: #eef2f7; color: #1f3a5f; }
.icon-action[data-danger]:hover { background: #fbeae8; color: #c0392b; }

/* ---- Detail list ---- */
.detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem 1.25rem; }
.detail-list dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; }
.detail-list dd { margin: .15rem 0 0; font-size: .9rem; color: #1e293b; }

/* ---- Forms ---- */
.input-error { border-color: #c0392b !important; outline: 2px solid #c0392b22; }
.toast-error { background: #c0392b; }

/* ---- Leaflet ---- */
.map-box { height: 420px; border-radius: 12px; overflow: hidden; }
.map-box.small { height: 320px; }
.map-box.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  height: 100vh !important;
  width: 100vw;
  border-radius: 0;
  background: #0f172a;
}
.map-fullscreen-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}
.leaflet-container { font-family: inherit; isolation: isolate; }
.truck-label { background: #fff; border: 1px solid #d7dee8; color: #1f3a5f; font-weight: 700; font-size: 10px; padding: 1px 5px; border-radius: 6px; box-shadow: none; }
.truck-label::before { display: none; }

/* ---- Kanban scroll ---- */
.kanban-col { max-height: 320px; overflow-y: auto; }

/* ============================================================
 *  Refinements — denser, quieter console
 *  ============================================================ */

/* ---- Icon sizing: Lucide copies the class onto the generated <svg> ---- */
.ico-14, .ico-14 svg { width: 14px; height: 14px; flex-shrink: 0; }
.ico-16, .ico-16 svg { width: 16px; height: 16px; flex-shrink: 0; }
.ico-18, .ico-18 svg { width: 18px; height: 18px; flex-shrink: 0; }
svg.lucide { stroke-width: 1.75; }

/* ---- Surfaces ---- */
.card { border-radius: 10px; box-shadow: none; border: 1px solid #e3e8ef; }
.card.p-4, .card.p-5, .card.p-3 { }
.btn { border-radius: 8px; font-weight: 500; padding: .45rem .8rem; }
.input, .select, .textarea { border-radius: 8px; font-size: .84rem; padding: .5rem .65rem; }
.pill { font-weight: 500; }
.chip { font-weight: 500; }
.help-banner { background: #f8fafc; border-left: 3px solid #cbd5e1; color: #475569; font-size: .8rem; padding: .6rem .85rem; }
h1.text-2xl { font-size: 1.35rem; letter-spacing: -0.01em; }
.kanban-col, .kanban-card { border-radius: 8px; }

/* ---- Top bar ---- */
.topbar {
    height: 56px; background: #fff; border-bottom: 1px solid #e3e8ef;
    padding: 0 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20;
}
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; color: rgba(255,255,255,.7); border: 0; background: transparent; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar .icon-action { width: 34px; height: 34px; color: #475569; margin: 0; }
.badge-dot {
    position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: #c0392b; color: #fff; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.lang-toggle { padding: 2px; }
.lang-toggle button { padding: .25rem .55rem; font-size: .7rem; }

/* ---- Search ---- */
.search-icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.search-input { padding-left: 2.1rem; height: 36px; background: #f8fafc; border-color: #e3e8ef; }
.search-input:focus { background: #fff; }
.search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .25); z-index: 60; max-height: 70vh; overflow-y: auto; padding: .25rem 0;
}
.search-group { padding: .25rem 0; }
.search-group + .search-group { border-top: 1px solid #f1f5f9; }
.search-group-title { display: flex; align-items: center; gap: .4rem; padding: .35rem .85rem .2rem; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.search-group-title svg { width: 12px; height: 12px; }
.search-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem .85rem; text-decoration: none; color: inherit; }
.search-item:hover, .search-item:focus { background: #f4f6f9; outline: none; }
.search-item-title { font-size: .84rem; font-weight: 600; color: #1f3a5f; }
.search-item-sub { font-size: .72rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: .75rem .85rem; font-size: .78rem; color: #64748b; }

/* ---- Profile ---- */
.profile-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .5rem .25rem .25rem; border-radius: 8px; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.profile-btn:hover { background: #f1f4f8; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: #1f3a5f; color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .25); z-index: 60; padding: .25rem; }
.menu-head { padding: .55rem .75rem .5rem; border-bottom: 1px solid #f1f5f9; margin-bottom: .25rem; font-size: .8rem; }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .75rem; border-radius: 6px; font-size: .82rem; color: #1e293b; text-decoration: none; border: 0; background: transparent; cursor: pointer; font-family: inherit; text-align: left; }
.menu-item:hover { background: #f4f6f9; }
.menu-item svg { color: #64748b; }
.menu-sep { height: 1px; background: #f1f5f9; margin: .25rem 0; }

/* ---- Dashboard ---- */
.stat { display: block; padding: .8rem 1rem; text-decoration: none; color: inherit; }
a.stat:hover { border-color: #cbd5e1; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: #94a3b8; margin-top: .1rem; }
.alert-row { display: flex; align-items: flex-start; gap: .5rem; padding: .45rem .6rem; background: #fff; border: 1px solid #eef2f7; border-radius: 8px; }
.pipeline-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.pipeline-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .4rem .2rem; border-radius: 6px; background: #f8fafc; text-decoration: none; color: inherit; min-width: 0; }
.pipeline-cell:hover { background: #eef2f7; }
.pipeline-cell.empty { opacity: .45; }
.pipeline-count { font-weight: 700; font-size: .95rem; color: #1f3a5f; font-variant-numeric: tabular-nums; }
.pipeline-label { font-size: 9px; text-transform: uppercase; letter-spacing: .03em; color: #64748b; text-align: center; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 900px) { .pipeline-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.compact-table th { text-align: left; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: #64748b; padding: .35rem .5rem; border-bottom: 1px solid #eef2f7; }
.compact-table td { padding: .5rem .5rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.compact-table tr:last-child td { border-bottom: 0; }
.compact-table tr.cursor-pointer:hover td { background: #f8fafc; }
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li + li { border-top: 1px solid #f1f5f9; }
.action-list a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .25rem; font-size: .82rem; color: #1e293b; text-decoration: none; }
.action-list a:hover span { color: #1f3a5f; }
.action-list b { font-variant-numeric: tabular-nums; color: #1f3a5f; }
.pipeline-label { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- List toolbar: search, filters, count, export/import ---- */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; margin-bottom: .75rem; }
.list-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; flex: 1 1 auto; min-width: 0; }
.list-meta { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.list-search { position: relative; display: inline-flex; align-items: center; flex: 0 1 260px; min-width: 180px; }
.list-search svg { position: absolute; left: .6rem; color: #94a3b8; pointer-events: none; }
.list-search input { width: 100%; height: 34px; padding: 0 .65rem 0 2rem; border: 1px solid #d7dee8; border-radius: 8px; font-size: .82rem; background: #fff; }
.list-search input:focus, .list-select:focus, .list-period input:focus { outline: 2px solid #2a9d8f33; border-color: #2a9d8f; }
.list-select { height: 34px; padding: 0 1.8rem 0 .65rem; border: 1px solid #d7dee8; border-radius: 8px; font-size: .8rem; color: #475569; background-color: #fff; max-width: 190px; cursor: pointer; }
.list-select.is-active { color: #1f3a5f; font-weight: 600; border-color: #1f3a5f; background-color: #eef2f7; }
.list-period { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .5rem; border: 1px solid #d7dee8; border-radius: 8px; background: #fff; color: #64748b; font-size: .78rem; }
.list-period input { border: 0; font-size: .78rem; color: #1e293b; background: transparent; padding: 0; width: 7.4rem; }
.list-period.is-active { border-color: #1f3a5f; background: #eef2f7; }
.list-period-label { white-space: nowrap; }
.list-toggle { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .65rem; border: 1px solid #d7dee8; border-radius: 8px; background: #fff; font-size: .8rem; color: #475569; cursor: pointer; white-space: nowrap; }
.list-toggle.is-active { border-color: #1f3a5f; background: #eef2f7; color: #1f3a5f; font-weight: 600; }
.list-reset { display: inline-flex; align-items: center; gap: .25rem; height: 34px; padding: 0 .5rem; border: 0; background: transparent; color: #64748b; font-size: .78rem; cursor: pointer; border-radius: 8px; }
.list-reset:hover { color: #c0392b; background: #fbeae8; }
.list-count { font-size: .75rem; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: .25rem; }
.wizard-head { padding: 1.25rem 1.5rem .9rem; border-bottom: 1px solid #f1f5f9; }
.wizard-body { padding: 1.25rem 1.5rem; }
.wizard-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.5rem; border-top: 1px solid #f1f5f9; }
.wizard-steps { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: .9rem; list-style: none; padding: 0; }
.wizard-step, .wizard-step a { display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; color: #94a3b8; text-decoration: none; }
.wizard-step + .wizard-step::before { content: ''; width: 1.25rem; height: 1px; background: #e2e8f0; margin-right: .1rem; }
.wizard-dot { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; background: #f1f5f9; color: #94a3b8; flex-shrink: 0; }
.wizard-step.is-done .wizard-dot, .wizard-step.is-current .wizard-dot { background: #2a9d8f; color: #fff; }
.wizard-step.is-current .wizard-label { color: #1f3a5f; font-weight: 600; }
.wizard-step.is-done .wizard-label { color: #475569; }
.wizard-step a:hover .wizard-label { color: #2a9d8f; text-decoration: underline; }
@media (max-width: 640px) {
  .wizard-head, .wizard-body, .wizard-foot { padding-left: 1rem; padding-right: 1rem; }
  .wizard-step:not(.is-current) .wizard-label { display: none; }
}
.list-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; margin-top: .75rem; font-size: .78rem; color: #64748b; }
.list-pager-range { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-pager-pages { display: inline-flex; align-items: center; gap: .25rem; }
.list-page { min-width: 32px; height: 32px; padding: 0 .5rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d7dee8; border-radius: 8px; background: #fff; color: #475569; font-size: .78rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.list-page:hover:not(:disabled) { border-color: #1f3a5f; color: #1f3a5f; }
.list-page.is-current { background: #1f3a5f; border-color: #1f3a5f; color: #fff; font-weight: 600; }
.list-page:disabled { opacity: .4; cursor: default; }
.list-page-gap { padding: 0 .2rem; color: #94a3b8; }
.list-pager-size { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.list-pager-size select { height: 32px; padding: 0 1.6rem 0 .5rem; border: 1px solid #d7dee8; border-radius: 8px; background-color: #fff; font-size: .78rem; color: #475569; cursor: pointer; }
.btn-sm { padding: .35rem .65rem; font-size: .78rem; gap: .35rem; }
.spin { animation: co-spin 1s linear infinite; }
@keyframes co-spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
  .list-search { flex: 1 1 100%; }
  .list-meta { width: 100%; justify-content: flex-end; }
}

/* Analytics: charts dimmed while the filtered series reload. */
[data-analytics-body] { transition: opacity .15s ease; }
[data-analytics-body].is-loading { opacity: .45; pointer-events: none; }
.analytics-block { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin: .25rem 0 .75rem; }

/* File viewer: uploaded documents, POD signature and photos, fuel receipts. */
.viewer-dialog { max-width: 64rem !important; }
.viewer { display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid #f1f5f9; }
.viewer-body { position: relative; display: flex; align-items: center; justify-content: center; background: #0f172a; min-height: 50vh; }
.viewer-stage { width: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-image { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.viewer-pdf { width: 100%; height: 70vh; border: 0; background: #fff; }
.viewer-empty { display: inline-flex; align-items: center; gap: .5rem; padding: 3rem 1rem; color: #cbd5e1; font-size: .8rem; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 999px; background: rgba(255,255,255,.9); color: #1f3a5f; display: inline-flex; align-items: center; justify-content: center; z-index: 1; }
.viewer-nav:hover { background: #fff; }
.viewer-prev { left: .6rem; }
.viewer-next { right: .6rem; }
.viewer-thumbs { display: flex; gap: .35rem; flex-wrap: wrap; padding: .6rem 1.1rem; border-top: 1px solid #f1f5f9; }
.viewer-thumb { font-size: .7rem; padding: .25rem .6rem; border-radius: 999px; background: #f1f5f9; color: #475569; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-thumb.is-active { background: #2a9d8f; color: #fff; }
.file-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; padding: .2rem .55rem; border-radius: 999px; background: #f1f5f9; color: #1f3a5f; }
.file-chip:hover { background: #e2e8f0; }
@media (max-width: 640px) {
  .viewer-body { min-height: 40vh; }
  .viewer-image, .viewer-pdf { max-height: 60vh; }
  .viewer-pdf { height: 60vh; }
}

/* File viewer: uploaded documents, POD signature and photos, fuel receipts. */
.viewer-dialog { max-width: 64rem !important; }
.viewer { display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid #f1f5f9; }
.viewer-body { position: relative; display: flex; align-items: center; justify-content: center; background: #0f172a; min-height: 50vh; }
.viewer-stage { width: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-image { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.viewer-pdf { width: 100%; height: 70vh; border: 0; background: #fff; }
.viewer-empty { display: inline-flex; align-items: center; gap: .5rem; padding: 3rem 1rem; color: #cbd5e1; font-size: .8rem; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 999px; background: rgba(255,255,255,.9); color: #1f3a5f; display: inline-flex; align-items: center; justify-content: center; z-index: 1; }
.viewer-nav:hover { background: #fff; }
.viewer-prev { left: .6rem; }
.viewer-next { right: .6rem; }
.viewer-thumbs { display: flex; gap: .35rem; flex-wrap: wrap; padding: .6rem 1.1rem; border-top: 1px solid #f1f5f9; }
.viewer-thumb { font-size: .7rem; padding: .25rem .6rem; border-radius: 999px; background: #f1f5f9; color: #475569; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-thumb.is-active { background: #2a9d8f; color: #fff; }
.file-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; padding: .2rem .55rem; border-radius: 999px; background: #f1f5f9; color: #1f3a5f; }
.file-chip:hover { background: #e2e8f0; }
@media (max-width: 640px) {
  .viewer-body { min-height: 40vh; }
  .viewer-image, .viewer-pdf { max-height: 60vh; }
  .viewer-pdf { height: 60vh; }
}
.unread-dot { display: inline-block; width: 7px; height: 7px; border-radius: 9999px; background: #2563eb; }
