/* ══ Work Orders — Fleetio-style ════════════════════════════ */
.wo-shell,
.wo-form-view,
.rem-page {
    /* Accent follows the active app theme (harvested into --wo-accent), with the
       original green as fallback — so Workshop + Reminders share one accent. */
    --wo-green: var(--wo-accent, #1f9d57);
    --wo-green-dark: color-mix(in srgb, var(--wo-accent, #1f9d57) 84%, #000);
    --wo-ink: #1a1d23;
    --wo-muted: #6b7280;
    --wo-line: #eceff2;
    /* shared palette — used by both the work-order and reminders sub-systems */
    --wo-text-2: #5a6473;
    --wo-text-3: #7a8494;
    --wo-faint: #9aa4b2;
    --wo-faint-2: #c2c9d4;
    --wo-line-2: #e6e8ec;
    --wo-line-3: #eef1f5;
    --wo-bg-subtle: #fafbfc;
    --wo-chip: #f1f3f6;
    --wo-over: #d8472f;
    --wo-soon: #b5780c;
    --wo-ok: #22c55e;
    --wo-danger: #ef4444;
}
.wo-shell {
    padding: 0;
    background: #f4f6f8;
    min-height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--wo-ink);
    box-sizing: border-box;
}

/* ── Top bar ───────────────────────────────────────────────── */
.wo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 14px;
    background: #fff;
}
.wo-topbar h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--wo-ink);
    letter-spacing: -0.01em;
}
.wo-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 7px;
    background: var(--wo-accent, #cc7e1a);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16,24,40,.08);
    transition: filter .14s;
}
.wo-btn-primary:hover { filter: brightness(.92); color: #fff; }

/* ── Tabs ──────────────────────────────────────────────────── */
/* Folder-style tabs: inactive read as plain text; the active tab lifts to a
   white card (border + soft shadow, rounded top) that notches into the sheet
   below it. Mirrors the TMS .tms-tabs styling. */
.wo-tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 0 24px;
    border-bottom: 1px solid var(--wo-line);
    background: #fff;
    flex-wrap: wrap;
}
.wo-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--wo-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color .14s;
}
.wo-tab:hover:not(.is-active) { color: var(--wo-ink); }
.wo-tab.is-active {
    background: #fff;
    color: var(--wo-ink);
    font-weight: 600;
    border-color: var(--wo-line);
    box-shadow: 0 -4px 10px rgba(16,24,40,.06);
    position: relative;
    z-index: 2;
}
.wo-tab .wo-tab-count { font-size: 11px; font-weight: 600; color: #9aa4b2; }

/* ── Status dots ───────────────────────────────────────────── */
.wo-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.wo-dot--open       { background: #14b8a6; }
.wo-dot--assigned   { background: #6366f1; }
.wo-dot--progress   { background: #f59e0b; }
.wo-dot--hold       { background: #f97316; }
.wo-dot--approval   { background: #8b5cf6; }
.wo-dot--closed     { background: #22c55e; }
.wo-dot--overdue    { background: #ef4444; }
.wo-dot--all        { background: #cbd5e1; }

/* ── Toolbar ───────────────────────────────────────────────── */
.wo-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid var(--wo-line);
    flex-wrap: wrap;
}
.wo-search { position: relative; width: 280px; max-width: 100%; }
.wo-search i {
    position: absolute; top: 50%; left: 12px;
    transform: translateY(-50%);
    color: #9aa4b2; font-size: 13px; pointer-events: none;
}
.wo-search input {
    width: 100%; height: 36px; padding: 0 12px 0 34px;
    border: 1px solid #dfe3e8; border-radius: 7px;
    font-size: 13px; color: var(--wo-ink); outline: none; box-sizing: border-box;
}
.wo-search input:focus { border-color: var(--wo-green); box-shadow: 0 0 0 3px rgba(31,157,87,.12); }
.wo-toolbar-select {
    height: 36px; padding: 0 30px 0 12px;
    border: 1px solid #dfe3e8; border-radius: 7px;
    font-size: 13px; color: var(--wo-ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M5 6L0 0h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none; appearance: none; outline: none; cursor: pointer;
}
.wo-toolbar-select:focus { border-color: var(--wo-green); }
.wo-toolbar-spacer { flex: 1; }
.wo-count { font-size: 12px; color: var(--wo-muted); }

/* ── Table ─────────────────────────────────────────────────── */
.wo-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.wo-table thead th {
    padding: 10px 16px; background: #fbfcfd;
    font-size: 12px; font-weight: 600; color: var(--wo-muted);
    border-top: 1px solid var(--wo-line); border-bottom: 1px solid var(--wo-line);
    text-align: left; white-space: nowrap;
}
.wo-table tbody tr { border-bottom: 1px solid var(--wo-line); transition: background .1s; }
.wo-table tbody tr:hover { background: #f9fafb; }
.wo-table tbody tr:hover .wo-row-actions { opacity: 1; }
.wo-table td { padding: 11px 16px; vertical-align: middle; color: var(--wo-ink); }

.wo-vehicle { display: flex; align-items: center; gap: 10px; }
.wo-vehicle-thumb {
    position: relative; width: 38px; height: 30px; border-radius: 6px;
    background: #eef1f4; display: inline-flex; align-items: center;
    justify-content: center; color: #9aa4b2; font-size: 14px; flex-shrink: 0;
}
.wo-vehicle-thumb .wo-vehicle-statusdot {
    position: absolute; right: -3px; bottom: -3px;
    width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff;
}
.wo-vehicle-link { font-weight: 600; color: var(--wo-green); text-decoration: none; }
.wo-vehicle-link:hover { text-decoration: underline; color: var(--wo-green-dark); }

.wo-number { font-weight: 600; color: var(--wo-ink); }
.wo-status-inline { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.wo-tasks { line-height: 1.4; }
.wo-tasks .wo-task-main { color: var(--wo-ink); font-weight: 500; }
.wo-tasks .wo-task-sub  { font-size: 11.5px; color: #9aa4b2; margin-top: 2px; }
.wo-date { color: #4b5563; }
.wo-date.overdue { color: #ef4444; border-bottom-color: #f3b4b4; font-weight: 600; }
.wo-empty-cell { color: #c4cdd6; }
.wo-cost { font-weight: 600; color: var(--wo-ink); }
.wo-row-actions { display: inline-flex; gap: 4px; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.wo-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: 1px solid #dfe3e8; border-radius: 6px;
    background: #fff; color: #6b7280; font-size: 12px; cursor: pointer; text-decoration: none;
}
.wo-action-btn:hover { border-color: var(--wo-green); color: var(--wo-green); }
.wo-action-btn--danger:hover { border-color: #ef4444; color: #ef4444; }
.wo-check { width: 38px; }
.wo-check input { cursor: pointer; }
.wo-empty { padding: 64px 20px; text-align: center; color: #9aa4b2; }
.wo-empty i { font-size: 38px; margin-bottom: 14px; display: block; color: #cbd5e1; }
.wo-empty p { font-size: 14px; margin: 0; }

/* ── Full-page form view (in-panel) ─────────────────────────── */
.wo-form-view {
    background: #f4f6f8;
    min-height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1d23;
}
.wof-page { min-height: 100%; }
.wof-page-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    max-width: 1100px;
}
.wof-hint { font-size: 11.5px; color: #9aa4b2; margin-top: 4px; }

/* ══ Purchase Orders ═════════════════════════════════════════ */
.po-number-chip {
    display: inline-block; margin-left: 8px;
    padding: 2px 12px; border-radius: 6px;
    background: #f1f5f9; color: #64748b;
    font-size: 14px; font-weight: 600;
}
.po-status-badge {
    display: inline-block; margin-left: 10px;
    padding: 3px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
}
.po-parts-count { color: #1a1d23; font-weight: 600; }

/* status dots */
.po-dot--draft     { background: #9ca3af; }
.po-dot--pending   { background: #f59e0b; }
.po-dot--rejected  { background: #ef4444; }
.po-dot--approved  { background: #22c55e; }
.po-dot--purchased { background: #3b82f6; }
.po-dot--partial   { background: #f59e0b; }
.po-dot--full      { background: #16a34a; }
.po-dot--canceled  { background: #6b7280; }

/* line-items gate */
.po-gate {
    padding: 40px 20px; text-align: center;
    color: #9aa4b2; font-size: 13px;
}

/* documents dropzone */
.po-dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 32px 20px;
    border: 2px dashed #dde1e7; border-radius: 10px;
    background: #fbfcfd; color: #6b7280; cursor: pointer;
    transition: border-color .14s, background .14s;
}
.po-dropzone:hover, .po-dropzone.is-drag { border-color: var(--wo-green, #1f9d57); background: #f3faf6; }
.po-dropzone i { font-size: 26px; color: #c4cdd6; margin-bottom: 4px; }
.po-dropzone-main { font-size: 14px; font-weight: 600; color: #475569; }
.po-dropzone-sub { font-size: 12px; color: #9aa4b2; }
.po-dropzone.is-drag i, .po-dropzone:hover i { color: var(--wo-green, #1f9d57); }

.po-doc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.po-doc-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: 1px solid #eceff2; border-radius: 8px;
    font-size: 13px; background: #fff;
}
.po-doc-item i.fa-file { color: #9aa4b2; }
.po-doc-name { font-weight: 600; color: #1a1d23; text-decoration: none; }
a.po-doc-name:hover { color: var(--wo-green, #1f9d57); text-decoration: underline; }
.po-doc-size { margin-left: auto; font-size: 11.5px; color: #9aa4b2; }

/* order summary card */
.po-summary-card { max-width: 380px; align-self: flex-end; width: 100%; }

/* show: totals + receive */
.po-totals { margin-top: 12px; margin-left: auto; max-width: 320px; }
.po-total-row {
    display: flex; justify-content: space-between; padding: 5px 0;
    font-size: 13px; color: #374151; border-bottom: 1px solid #f4f6f8;
}
.po-total-grand {
    border-bottom: none; border-top: 2px solid #eceff2; margin-top: 4px; padding-top: 8px;
    font-size: 15px; font-weight: 700; color: #1a1d23;
}
.po-total-grand b { color: var(--wo-green, #1f9d57); }

.po-receive-card { border: 1px solid #cfe8d8; background: #f8fcfa; }
.po-untracked-tag {
    margin-left: 6px; padding: 1px 7px; border-radius: 999px;
    background: #f1f5f9; color: #94a3b8; font-size: 10.5px; font-weight: 600;
}
.wof-page-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #eceff2;
}
.wof-page-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
    color: #1a1d23;
    letter-spacing: -0.01em;
}
.wof-page-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wof-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .14s, color .14s;
}
.wof-back:hover { border-color: #1f9d57; color: #1f9d57; }
.wo-btn-ghost {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .14s, border-color .14s;
}
.wo-btn-ghost:hover { background: #f4f6f8; border-color: #c4cdd6; }

.wo-form-loading {
    padding: 60px 24px;
    text-align: center;
    color: #9aa4b2;
    font-size: 14px;
}
.wo-form-loading i { margin-right: 8px; }

.wof-page-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    border-top: 1px solid #eceff2;
    box-shadow: 0 -2px 8px rgba(16,24,40,.04);
}

/* Validation feedback */
.wof-form-banner {
    margin: 14px 24px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
}
.wof-form-banner i { margin-right: 6px; }
.wof-field.has-error input,
.wof-field.has-error select,
.wof-field.has-error textarea { border-color: #ef4444; }
.wof-error {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: #ef4444;
}

/* ══ Parts & Inventory ═══════════════════════════════════════ */
.pt-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border-bottom: 1px solid #eceff2;
}
@media (max-width: 900px) {
    .pt-cards { grid-template-columns: repeat(2, 1fr); }
}
.pt-card {
    padding: 16px 24px;
    border-right: 1px solid #eceff2;
}
.pt-card:last-child { border-right: none; }
.pt-card-label {
    font-size: 12px;
    color: #6b7280;
    border-bottom: 1px dotted #c4cdd6;
    display: inline-block;
    padding-bottom: 1px;
    margin-bottom: 6px;
}
.pt-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1d23;
}
.pt-card-value.pt-danger { color: #ef4444; }
.pt-card-value.pt-warn   { color: #f59e0b; }

/* ── Inventory locations ────────────────────────────────────── */
.pt-loc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 1px 4px 1px 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11.5px;
    white-space: nowrap;
}
.pt-loc-chip b { color: #1a1d23; font-weight: 700; }

.pt-loc-manager {
    padding: 14px 24px;
    background: #fbfcfd;
    border-bottom: 1px solid #eceff2;
}
.pt-loc-manager-add {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 480px;
}
.pt-loc-manager-add input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
}
.pt-loc-manager-add input:focus { border-color: #1f9d57; }
.pt-loc-manager-list { display: flex; flex-direction: column; gap: 6px; max-width: 480px; }
.pt-loc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #eceff2;
    border-radius: 8px;
    font-size: 13px;
}
.pt-loc-item i.fa-warehouse { color: #9aa4b2; font-size: 12px; }
.pt-loc-item-name { font-weight: 600; color: #1a1d23; }
.pt-loc-item-meta { margin-left: auto; font-size: 11.5px; color: #9aa4b2; }
.pt-loc-empty { font-size: 12.5px; color: #9aa4b2; padding: 6px 2px; }

/* Per-location stock rows (part form sidebar) */
.pt-loc-row {
    border: 1px solid #eceff2;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    background: #fbfcfd;
}
.pt-loc-row-top {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}
.pt-loc-row-top select {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    font-size: 12.5px;
    min-width: 0;
}
.pt-loc-row-top input.pt-loc-qty {
    width: 70px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    font-size: 12.5px;
}
.pt-loc-row-bins { display: flex; gap: 6px; }
.pt-loc-row-bins input {
    flex: 1;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e7eaef;
    border-radius: 6px;
    font-size: 11.5px;
    min-width: 0;
}
.pt-new-location-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #1f9d57;
    text-decoration: none;
    font-weight: 600;
}
.pt-new-location-link:hover { color: #18854a; text-decoration: underline; }

/* ── Part photo (form) ──────────────────────────────────────── */
.pt-photo-field { display: flex; align-items: center; gap: 16px; }
.pt-photo-preview {
    width: 88px; height: 88px; flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f4f6f8;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    color: #c4cdd6; font-size: 28px;
}
.pt-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.pt-photo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-photo-hint { width: 100%; font-size: 11.5px; color: #9aa4b2; margin-top: 2px; }

/* part thumbnail in list */
.pt-thumb { overflow: hidden; }
.pt-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* ── Part detail (show) view ────────────────────────────────── */
.pt-show {
    --wo-green: var(--wo-accent, #1f9d57);
    --wo-ink: #1a1d23;
    background: #f4f6f8;
    min-height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.pt-show-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: #fff;
    border-bottom: 1px solid #eceff2;
}
.pt-show-thumb {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 10px;
    background: #eef1f4;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: #9aa4b2; font-size: 22px;
}
.pt-show-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pt-show-headmain { flex: 1; min-width: 0; }
.pt-show-title { font-size: 22px; font-weight: 700; color: var(--wo-ink); letter-spacing: -0.01em; }
.pt-show-summary { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 8px; }
.pt-summary-item { display: flex; flex-direction: column; gap: 1px; }
.pt-summary-item span { font-size: 11px; color: #9aa4b2; }
.pt-summary-item b { font-size: 13px; color: #1a1d23; font-weight: 600; }
.pt-show-headactions { flex-shrink: 0; }

.pt-show-tabs {
    display: flex; align-items: center; gap: 4px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid #eceff2;
    flex-wrap: wrap;
}
.pt-show-tab {
    padding: 12px 14px;
    margin-bottom: -1px;
    border: none; background: transparent;
    border-bottom: 2px solid transparent;
    font-size: 13px; font-weight: 500; color: #6b7280;
    cursor: pointer; font-family: inherit;
}
.pt-show-tab:hover { color: var(--wo-ink); }
.pt-show-tab.is-active { color: var(--wo-ink); font-weight: 600; border-bottom-color: var(--wo-green); }
.pt-show-tab .wo-tab-count { font-size: 11px; color: #9aa4b2; margin-left: 2px; }

.pt-show-pane { padding: 20px 24px; }
.pt-show-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .pt-show-grid { grid-template-columns: 1fr; } }
.pt-show-col { display: flex; flex-direction: column; gap: 16px; }
.pt-show-empty { padding: 24px 4px; text-align: center; color: #9aa4b2; font-size: 13px; }

.pt-detail-rows { display: flex; flex-direction: column; }
.pt-detail-row {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #f4f6f8;
    font-size: 13px;
}
.pt-detail-row:last-child { border-bottom: none; }
.pt-detail-row span { color: #6b7280; }
.pt-detail-row b { color: #1a1d23; font-weight: 600; text-align: right; }

.pt-loc-box {
    border: 1px solid #eceff2;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}
.pt-loc-box-head { margin-bottom: 10px; }
.pt-loc-box-name { font-size: 15px; font-weight: 700; color: var(--wo-green); }
.pt-loc-box-sub { display: block; font-size: 11.5px; color: #9aa4b2; margin-top: 1px; }
.pt-loc-box-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid #f0f2f5; }
.pt-loc-stat { padding: 10px 12px 4px 0; }
.pt-loc-stat span { display: block; font-size: 11px; color: #9aa4b2; border-bottom: 1px dotted #c4cdd6; padding-bottom: 1px; margin-bottom: 4px; }
.pt-loc-stat b { font-size: 18px; font-weight: 700; color: #1a1d23; }
.pt-loc-box-total {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; margin-top: 4px;
    border-top: 1px solid #eceff2;
    font-size: 13px; color: #374151;
}
.pt-loc-box-value {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 8px;
    font-size: 14px; font-weight: 700; color: var(--wo-ink);
}
.pt-loc-box-value b { color: var(--wo-green); }

/* ── Service Reminders ──────────────────────────────────────── */
.sr-row { cursor: pointer; }
.sr-row .wo-check, .sr-row .wo-row-actions { cursor: default; }

/* Resolve dropdown */
.sr-resolve-dd { position: relative; display: inline-block; }
.sr-resolve-menu {
    position: absolute; top: calc(100% + 4px); right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,24,40,.14);
    padding: 6px;
    z-index: 3100;
}
.sr-drawer-actions .sr-resolve-menu { left: 0; right: auto; }
.sr-dd-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: #9aa4b2; padding: 8px 10px 4px;
}
.sr-dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 7px;
    font-size: 13px; color: #1a1d23; text-decoration: none; cursor: pointer;
}
.sr-dd-item:hover { background: #f3faf6; color: #18854a; }
.sr-dd-item i { color: #9aa4b2; width: 16px; text-align: center; }
.sr-dd-item:hover i { color: #18854a; }

/* Right slide-over detail drawer */
.sr-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(16,24,40,.28);
    z-index: 3000;
    opacity: 0; transition: opacity .18s ease;
}
.sr-drawer-backdrop.is-open { opacity: 1; }
.sr-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 460px; max-width: 92vw;
    background: #fff;
    z-index: 3001;
    box-shadow: -8px 0 28px rgba(16,24,40,.16);
    transform: translateX(100%);
    transition: transform .22s ease;
    overflow-y: auto;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.sr-drawer.is-open { transform: translateX(0); }
.sr-drawer-inner { padding: 18px 22px 28px; }

.sr-drawer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sr-drawer-eyebrow { font-size: 12px; font-weight: 600; color: #1f9d57; }
.sr-drawer-close {
    width: 30px; height: 30px; border: none; background: transparent;
    color: #9aa4b2; cursor: pointer; border-radius: 6px; font-size: 15px;
}
.sr-drawer-close:hover { background: #f1f5f9; color: #1a1d23; }

.sr-drawer-title { font-size: 21px; font-weight: 700; color: #1a1d23; letter-spacing: -.01em; line-height: 1.2; }
.sr-drawer-sub { font-size: 13px; color: #6b7280; margin-top: 4px; }

.sr-drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }

.sr-drawer-rows { display: flex; flex-direction: column; }
.sr-drawer-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
}
.sr-drawer-row > span { color: #6b7280; flex-shrink: 0; padding-top: 1px; }
.sr-drawer-row > b { color: #1a1d23; font-weight: 600; text-align: right; }
.sr-drawer-row b small { color: #9aa4b2; font-size: 11.5px; margin-top: 2px; }
.sr-drawer-row b.sr-overdue, .sr-drawer-row b.sr-overdue small { color: #ef4444; }

@media (max-width: 560px) { .sr-drawer { width: 100vw; } }

/* Drawer shared sections (used by Service Tasks detail too) */
.sr-drawer-section { margin-top: 18px; }
.sr-drawer-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: #9aa4b2; margin-bottom: 8px;
}
.sr-drawer-line {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 0; border-bottom: 1px solid #f4f6f8; font-size: 13px;
}
.sr-drawer-line span { color: #1a1d23; }
.sr-drawer-line b { color: #1a1d23; font-weight: 600; white-space: nowrap; }

.st-drawer-usage {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    margin: 16px 0 4px;
    border: 1px solid #eceff2; border-radius: 10px; overflow: hidden;
}
.st-drawer-usage-stat { padding: 12px 14px; text-align: center; border-right: 1px solid #eceff2; }
.st-drawer-usage-stat:last-child { border-right: none; }
.st-drawer-usage-stat b { display: block; font-size: 19px; font-weight: 700; color: #1a1d23; }
.st-drawer-usage-stat span { font-size: 11px; color: #9aa4b2; }


.sr-progress {
    width: 100%; height: 7px;
    background: #eef1f4; border-radius: 999px; overflow: hidden;
}
.sr-progress--lg { height: 12px; }
.sr-progress-bar { height: 100%; border-radius: 999px; transition: width .2s; }
.sr-progress-label { font-size: 11px; color: #6b7280; margin-top: 4px; }
.sr-progress-label.overdue { color: #ef4444; font-weight: 600; }
.sr-progress-nodata { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #9aa4b2; font-style: italic; }
.sr-progress-nodata i { font-size: 12px; }
.sr-nextdue { display: inline-flex; align-items: center; gap: 7px; }
.sr-track-ic { color: #9aa4b2; font-size: 12px; }

.sr-hero { display: flex; flex-direction: column; gap: 12px; }
.sr-hero-main { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sr-hero-vehicle { font-size: 15px; font-weight: 700; color: #1a1d23; }
.sr-hero-vehicle i { color: #9aa4b2; margin-right: 6px; }
.sr-hero-due { font-size: 15px; font-weight: 700; color: #22c55e; }
.sr-hero-due.overdue { color: #ef4444; }

.sr-unit { color: #9aa4b2; font-weight: 400; text-transform: none; }

/* ── Service Tasks ──────────────────────────────────────────── */
.st-usage {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
@media (max-width: 720px) { .st-usage { grid-template-columns: repeat(2, 1fr); } }
.st-usage-stat { padding: 14px 18px; border-right: 1px solid #eceff2; }
.st-usage-stat:last-child { border-right: none; }
.st-usage-stat span { display: block; font-size: 11px; color: #9aa4b2; margin-bottom: 4px; }
.st-usage-stat b { font-size: 20px; font-weight: 700; color: #1a1d23; }

.st-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.st-chip {
    display: inline-flex; align-items: center;
    padding: 5px 12px; border-radius: 999px;
    background: #f1f5f9; color: #475569;
    font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.st-chip:hover { background: #e2e8f0; color: #1f9d57; }

#st-subtasks {
    height: auto; min-height: 96px; padding: 6px;
}
#st-subtasks option { padding: 4px 8px; border-radius: 5px; }

.pt-archived-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Modal XL (legacy / delete modal) ───────────────────────── */
@media (min-width: 1200px) {
    .modal-xl { width: 1100px; }
}

/* ══ Work Order Form — Fleetio 2-column layout ══════════════ */
.wof-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 20px 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .wof-layout { grid-template-columns: 1fr; }
}

.wof-main { display: flex; flex-direction: column; gap: 16px; }

.wof-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}
.wof-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9aa4b2;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f2f5;
}

.wof-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

.wof-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wof-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.wof-field { display: flex; flex-direction: column; gap: 5px; }
.wof-field label {
    font-size: 11px; font-weight: 600; color: #6b7280;
    text-transform: uppercase; letter-spacing: .04em;
}
.wof-field input,
.wof-field select,
.wof-field textarea {
    width: 100%; height: 36px; padding: 0 12px;
    border: 1px solid #dde1e7; border-radius: 7px;
    font-size: 13px; color: #1a1d23; background: #fff;
    outline: none; box-sizing: border-box; font-family: inherit;
}
.wof-field textarea { height: auto; padding: 8px 12px; resize: vertical; }
.wof-field input:focus,
.wof-field select:focus,
.wof-field textarea:focus {
    border-color: var(--wo-green);
    box-shadow: 0 0 0 3px rgba(31,157,87,.1);
}
.wof-req { color: #ef4444; }

/* ── Line item tabs ─────────────────────────────────────────── */
.wof-line-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f0f2f5;
    margin-bottom: 14px;
}
.wof-line-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .12s, border-color .12s;
    font-family: inherit;
}
.wof-line-tab:hover { color: var(--wo-ink); }
.wof-line-tab.is-active { color: var(--wo-green); border-bottom-color: var(--wo-green); font-weight: 600; }

/* ── Parts / service task table ─────────────────────────────── */
.wof-parts-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.wof-parts-table thead th {
    padding: 7px 10px; background: #f8f9fb;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; color: #8c95a3;
    border: 1px solid #eaecef; text-align: left;
}
.wof-parts-table tbody td { padding: 4px 6px; border: 1px solid #f0f0f0; vertical-align: middle; }
.wof-parts-table input {
    height: 30px; padding: 0 8px;
    border: 1px solid #dde1e7; border-radius: 6px;
    font-size: 12px; width: 100%; box-sizing: border-box;
}
.wof-parts-table input:focus { border-color: var(--wo-green); outline: none; }

.wof-add-part-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px;
    border: 1px dashed #dde1e7; border-radius: 7px;
    background: transparent; color: #6b7280; font-size: 12px;
    cursor: pointer; font-family: inherit; margin-top: 4px;
}
.wof-add-part-btn:hover { border-color: var(--wo-green); color: var(--wo-green); }

.wof-remove-part-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: none; background: transparent;
    color: #d1d5db; cursor: pointer; border-radius: 5px; font-size: 13px;
}
.wof-remove-part-btn:hover { color: #ef4444; background: #fef2f2; }

/* ── Cost summary sidebar ───────────────────────────────────── */
.wof-cost-card { font-size: 13px; }

/* Headline cards */
.wof-cost-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.wof-cost-cell {
    border: 1px solid #eceff2; border-radius: 8px; padding: 9px 11px;
}
.wof-cost-cell--total { grid-column: 1 / -1; background: #f3faf6; border-color: #cfe8d8; }
.wof-cost-cell span { display: block; font-size: 11px; color: #9aa4b2; }
.wof-cost-cell b { font-size: 16px; font-weight: 700; color: #1a1d23; }
.wof-cost-cell--total b { color: var(--wo-green, #1f9d57); }

/* Per line-item breakdown */
.wof-breakdown { display: flex; flex-direction: column; }
.wof-bd-row {
    display: grid; grid-template-columns: 1fr auto; column-gap: 10px;
    padding: 7px 0; border-bottom: 1px solid #f4f6f8; font-size: 12.5px;
}
.wof-bd-name { color: #1a1d23; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wof-bd-amt { font-weight: 700; color: #1a1d23; white-space: nowrap; text-align: right; }
.wof-bd-sub { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: #9aa4b2; font-size: 11px; margin-top: 2px; }
.wof-bd-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; margin-right: 2px; }
.wof-bd-dot--labor { background: #6366f1; }
.wof-bd-dot--parts { background: #14b8a6; }
.wof-bd-empty { font-size: 12px; color: #9aa4b2; padding: 6px 0; }
.wof-cost-row {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f4f6f8;
    color: #374151;
    gap: 8px;
}
.wof-cost-row > span:first-child { flex: 1; white-space: nowrap; }
.wof-cost-row > span:last-child { font-weight: 600; white-space: nowrap; min-width: 60px; text-align: right; }
.wof-markup-row { flex-wrap: wrap; gap: 4px; }
.wof-markup-inputs { display: flex; align-items: center; gap: 4px; }
.wof-mini-select {
    height: 26px; padding: 0 4px; font-size: 11px;
    border: 1px solid #dde1e7; border-radius: 5px;
    background: #f9fafb; width: 40px;
}
.wof-mini-input {
    height: 26px; width: 60px; padding: 0 6px;
    border: 1px solid #dde1e7; border-radius: 5px; font-size: 12px;
    box-sizing: border-box;
}
.wof-mini-label { font-size: 11px; color: #6b7280; }
.wof-cost-divider { height: 1px; background: #e5e7eb; margin: 8px 0; }
.wof-cost-total {
    display: flex; justify-content: space-between;
    align-items: center; padding-top: 6px;
    font-size: 15px; font-weight: 700; color: var(--wo-ink);
}
.wof-cost-total span:last-child { color: var(--wo-green); font-size: 16px; }

/* ── Status log ─────────────────────────────────────────────── */
.wof-status-log { display: flex; flex-direction: column; gap: 10px; }
.wof-log-row { display: flex; gap: 10px; align-items: flex-start; }
.wof-log-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.wof-log-body { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; align-items: baseline; }
.wof-log-label { font-weight: 700; color: #111; }
.wof-log-from { color: #9aa4b2; }
.wof-log-by { color: #6b7280; }
.wof-log-time { color: #c4cdd6; font-size: 11px; }
.wof-log-note { width: 100%; color: #4b5563; font-style: italic; margin-top: 2px; }

/* ── Reminders hub ─────────────────────────────────────────────── */
.rh-sections { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:14px; }
.rh-section { cursor:pointer; transition:box-shadow .15s, transform .15s; }
.rh-section:hover { box-shadow:0 4px 14px rgba(15,23,42,.08); transform:translateY(-1px); }
.rh-section-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.rh-section-icon { width:34px; height:34px; border-radius:8px; background:#eef6f1; color:#1f9d57; display:flex; align-items:center; justify-content:center; font-size:15px; }
.rh-section-title { font-weight:600; font-size:14px; color:#1a1d23; flex:1; }
.rh-section-go { color:#c2c9d4; font-size:12px; }
.rh-section-stats { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; }
.rh-stat { text-align:center; padding:8px 4px; border-radius:8px; background:#f7f8fa; }
.rh-stat b { display:block; font-size:18px; color:#1a1d23; }
.rh-stat span { font-size:11px; color:#7a8494; }
.rh-stat.is-danger b { color:#ef4444; }
.rh-stat.is-warn b { color:#f59e0b; }
.rh-attention { display:flex; flex-direction:column; }
.rh-attn-row { display:flex; align-items:center; gap:12px; padding:10px 6px; border-bottom:1px solid #eef1f5; cursor:pointer; }
.rh-attn-row:last-child { border-bottom:none; }
.rh-attn-row:hover { background:#fafbfc; }
.rh-attn-icon { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:13px; flex:none; }
.rh-attn-icon.is-danger { background:#fde8e8; color:#ef4444; }
.rh-attn-icon.is-warn { background:#fdf3e0; color:#f59e0b; }
.rh-attn-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.rh-attn-main b { font-size:13px; color:#1a1d23; font-weight:600; }
.rh-attn-main span { font-size:12px; color:#7a8494; }
.rh-attn-detail { font-size:12px; color:#7a8494; white-space:nowrap; }
.rh-attn-detail.is-danger { color:#ef4444; font-weight:600; }

/* ── Renewals combined Vehicle/Contact toggle ──────────────────── */
.rn-combined-topbar { gap:16px; }
.rn-kind-toggle { display:inline-flex; background:var(--wo-chip); border-radius:9px; padding:3px; gap:2px; }
.rn-kind-btn { border:none; background:transparent; color:var(--wo-text-2); font-size:13px; font-weight:600;
    padding:7px 16px; border-radius:7px; cursor:pointer; display:inline-flex; align-items:center; gap:7px;
    transition:background .12s, color .12s; }
.rn-kind-btn i { font-size:12px; }
.rn-kind-btn:hover { color:var(--wo-ink); }
.rn-kind-btn.is-active { background:#fff; color:var(--wo-green); box-shadow:0 1px 3px rgba(15,23,42,.12); }
.rn-kind-pane .wo-topbar { padding-top:6px; }

/* ── Unified Reminders page: header + top-level tabs ───────────── */
.rem-header { background:#fff; padding:18px 24px 0; border-bottom:0.5px solid var(--color-border-tertiary, var(--wo-line-2)); }
.rem-title { font-size:20px; font-weight:600; color:var(--wo-ink); margin:0 0 12px; }
.rem-tabs { display:flex; gap:4px; }
.rem-tab { border:none; background:transparent; color:var(--wo-text-2); font-size:14px; font-weight:600;
    padding:10px 16px; border-bottom:2px solid transparent; cursor:pointer; display:inline-flex; align-items:center; gap:8px;
    transition:color .12s, border-color .12s; }
.rem-tab i { font-size:14px; }
.rem-tab:hover { color:var(--wo-ink); }
.rem-tab.is-active { color:var(--wo-green); border-bottom-color:var(--wo-green); }
.rem-tab-badge { background:var(--wo-danger); color:#fff; font-size:11px; font-weight:700; line-height:1;
    padding:3px 7px; border-radius:10px; min-width:18px; text-align:center; }
.rem-pane .wo-shell { padding-top:6px; }
.rem-pane .rn-combined-topbar { padding-top:14px; }

/* ── Reminders Overview (redesign: attention-first) ────────────── */
.rov { padding:4px 0 8px; }
.rov-card { background:#fff; border:0.5px solid var(--wo-line-2); border-radius:12px; padding:14px 16px; margin-bottom:14px; }
.rov-chead { display:flex; align-items:center; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.rov-chead h3 { font-size:14px; font-weight:600; margin:0; color:var(--wo-ink); }
.rov-sub { font-size:12.5px; color:var(--wo-text-2); }
.rov-sub b.over { color:var(--wo-over); font-weight:600; }
.rov-sub b.soon { color:var(--wo-soon); font-weight:600; }
.rov-actions { margin-left:auto; display:flex; gap:8px; }
.rov-btn { font-size:12.5px; font-weight:600; color:#fff; border:none; border-radius:8px; padding:7px 13px; display:inline-flex; align-items:center; gap:6px; background:var(--wo-accent, #cc7e1a); cursor:pointer; text-decoration:none; box-shadow:0 1px 2px rgba(16,24,40,.08); transition:filter .14s; }
.rov-btn:hover { filter:brightness(.92); color:#fff; }
.rov-btn i { font-size:11px; }

.rov-clear { display:flex; align-items:center; gap:12px; padding:14px 4px; }
.rov-clear i { font-size:22px; color:var(--wo-ok); }
.rov-clear b { font-size:13.5px; color:var(--wo-ink); display:block; }
.rov-clear span { font-size:12.5px; color:var(--wo-text-2); }

.rov-na { display:flex; align-items:center; gap:12px; padding:9px 6px; border-top:0.5px solid var(--wo-line-3); cursor:pointer; border-radius:8px; }
.rov-na:first-of-type { border-top:none; }
.rov-na:hover { background:var(--wo-bg-subtle); }
.rov-na-ic { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; flex:none; }
.rov-na-ic.over { background:#fde8e8; color:var(--wo-over); }
.rov-na-ic.soon { background:#fdf3e0; color:var(--wo-soon); }
.rov-na-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.rov-na-main b { font-size:13px; font-weight:600; color:var(--wo-ink); }
.rov-na-main span { font-size:12px; color:var(--wo-text-3); }
.rov-na-pill { font-size:12px; font-weight:600; white-space:nowrap; }
.rov-na-pill.over { color:var(--wo-over); }
.rov-na-pill.soon { color:var(--wo-soon); }
.rov-go { color:var(--wo-faint-2); font-size:14px; }
.rov-more { text-align:center; padding:9px 0 2px; font-size:12.5px; color:var(--wo-text-3); }

.rov-legend { margin-left:auto; display:flex; gap:14px; font-size:11.5px; color:var(--wo-text-2); }
.rov-legend i { width:9px; height:9px; border-radius:2px; display:inline-block; margin-right:5px; }
.rov-src { display:flex; align-items:center; gap:12px; padding:11px 6px; border-top:0.5px solid var(--wo-line-3); cursor:pointer; border-radius:8px; }
.rov-src:first-of-type { border-top:none; }
.rov-src:hover { background:var(--wo-bg-subtle); }
.rov-src-ic { width:30px; height:30px; border-radius:8px; background:var(--wo-chip); color:var(--wo-text-2); display:flex; align-items:center; justify-content:center; font-size:15px; flex:none; }
.rov-src-name { width:140px; flex:none; }
.rov-src-name b { font-size:13px; font-weight:600; color:var(--wo-ink); display:block; }
.rov-src-name span { font-size:11.5px; color:var(--wo-faint); }
.rov-src-bar { flex:1; height:9px; border-radius:5px; overflow:hidden; display:flex; background:var(--wo-line-3); }
.rov-src-bar i { display:block; height:100%; }
.rov-src-meta { width:150px; flex:none; text-align:right; font-size:12px; color:var(--wo-text-3); }
.rov-src-meta .over { color:var(--wo-over); font-weight:600; }
.rov-src-meta .soon { color:var(--wo-soon); font-weight:600; }
.rov-src-meta .none { color:var(--wo-faint); }

.rov-cov { display:flex; align-items:center; gap:18px; flex-wrap:wrap; padding:4px 2px; }
.rov-cov-stat b { font-size:20px; font-weight:600; color:var(--wo-ink); }
.rov-cov-stat b.warn { color:var(--wo-soon); }
.rov-cov-stat span { font-size:12px; color:var(--wo-text-2); display:block; }
.rov-cov-arrow { color:var(--wo-faint-2); font-size:13px; }
.rov-cov-cta { margin-left:auto; }

/* ============================================================
   Modern modal refresh (global)
   Overrides the dated Bootstrap-3 modal chrome (square corners,
   grey header/footer bars, tiny x close, harsh shadow) for every
   modal in the app. Chrome-only: no input-height or overflow
   changes, so dense forms / dropdowns / datepickers are untouched.
   Accent uses --wo-accent (harvested per active theme).
   ============================================================ */
.modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18), 0 2px 8px rgba(16, 24, 40, 0.08);
}
.modal-backdrop.in { opacity: 0.32; }

.modal-header,
.ui-dialog-titlebar.ui-widget-header {
    background: #fff;
    padding: 20px 24px;
    border-bottom: 1px solid #eceef2;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}
.modal-title,
.ui-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2433;
    line-height: 1.4;
}
.modal-title .icon,
.ui-dialog-title .icon { margin-right: 6px; }

/* Circular close button, top-right */
.modal-header .close,
.ui-dialog-titlebar.ui-widget-header .close,
.modal-header button.ui-dialog-titlebar-close {
    width: 32px;
    height: 32px;
    border: 1px solid #e3e6ec;
    border-radius: 50%;
    opacity: 1;
    font-size: 18px;
    line-height: 30px;
    text-align: center;
    color: #8a93a6;
    text-shadow: none;
    margin: 0;
    transition: background .14s, color .14s, border-color .14s;
}
.modal-header .close:hover,
.modal-header .close:focus {
    background: #f3f4f7;
    color: #1d2433;
    border-color: #d6dae2;
    opacity: 1;
}

.modal-body { padding: 24px; }

.modal-footer {
    background: #fff;
    padding: 16px 24px 22px;
    border-top: 0;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

/* Buttons in modals: rounded corners (radius only — no size change) */
.modal-content .btn { border-radius: 9px; }

/* Folder tabs (match Service Tasks / Workshop) */
.modal-content .nav-tabs { border-bottom: 1px solid #e6eaf0; display: flex; align-items: flex-end; gap: 2px; }
.modal-content .nav-tabs > li { margin: 0 0 -1px; }
.modal-content .nav-tabs > li > a {
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    color: #6b7280;
    font-weight: 500;
    background: transparent;
    margin-right: 2px;
}
.modal-content .nav-tabs > li > a:hover {
    background: transparent;
    color: #1a1d23;
}
.modal-content .nav-tabs > li.active > a,
.modal-content .nav-tabs > li.active > a:hover,
.modal-content .nav-tabs > li.active > a:focus {
    color: #1a1d23;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-bottom: none;
    box-shadow: 0 -4px 10px rgba(16, 24, 40, .06);
}
/* hide the theme's accent underline bar (.nav-default > li.active:after) */
.modal-content .nav-tabs > li.active:after { display: none !important; }

/* Inputs: soften corners to match (no height change) */
.modal-content .form-control { border-radius: 9px; }
.modal-content .form-control:focus {
    border-color: var(--wo-accent, #cc7e1a);
    box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.05);
}

/* Tabs placed directly under .modal-content (e.g. Show Address) align with header/body */
.modal-content > .nav-tabs { padding: 0 24px; margin: 0; }
.modal-content > .nav-tabs > li > a { padding: 13px 4px; }

/* ============================================================
   Map-tool modals (Ruler, Show address)
   Anchored beside their map-control buttons, with no backdrop and
   click-through so the map stays usable while open (the ruler needs
   to receive map clicks). JS sets the exact top/right per button;
   these are the fallback position + sizing.
   ============================================================ */
.map-tool-modal { pointer-events: none; }            /* let clicks reach the map */
.map-tool-modal .modal-dialog {
    pointer-events: auto;                            /* …except on the dialog itself */
    position: fixed;
    margin: 0;
    top: 60px;
    right: 66px;                                     /* clear the 36px control bar (right:18) + gap */
}
#showAddress .modal-dialog { width: 420px; }
#rulerModal  .modal-dialog { width: 300px; }

@media (max-width: 600px) {
    .map-tool-modal .modal-dialog {
        top: 12px; right: 12px; left: 12px; width: auto;
    }
}

/* ============================================================
   Account "Setup" modal — modern stacked form spacing
   (chrome comes from the global modal block above; this adds
   the generous field rhythm, scoped so other modals are untouched)
   ============================================================ */
.setup-modal .tab-content { padding-top: 18px; }
.setup-modal .form-group { margin-bottom: 18px; }
.setup-modal .form-group > label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #1d2433;
    margin-bottom: 7px;
}
.setup-modal .form-control { height: 40px; border-radius: 9px; }
.setup-modal textarea.form-control,
.setup-modal select[multiple].form-control { height: auto; }
.setup-modal .help-block { font-size: 11.5px; color: #9aa2ae; margin-top: 6px; margin-bottom: 0; }
.setup-modal h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1d2433;
    margin: 24px 0 12px;
}
.setup-modal hr { margin: 18px 0; border-top: 1px solid #eceef2; }
.setup-modal .radio,
.setup-modal .checkbox { margin: 6px 0; }

/* ── List loading skeleton (shown in *-table-wrap until the AJAX rows load) ─ */
.ws-skel { padding: 4px 0; }
.ws-skel-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wo-line, #eceff2);
    background: #fff;
}
.ws-skel-row:first-child { border-radius: 10px 10px 0 0; }
.ws-skel-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eef1f5 25%, #e2e6ec 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: ws-skel-shimmer 1.2s ease-in-out infinite;
}
.ws-skel-line.sk-grow { flex: 1; }
.ws-skel-line.sk-sm   { width: 64px; flex: none; }
.ws-skel-line.sk-md   { width: 110px; flex: none; }
.ws-skel-line.sk-dot  { width: 18px; height: 18px; border-radius: 50%; flex: none; }
@keyframes ws-skel-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ws-skel-line { animation: none; }
}
