/* 3DM Operations — internal dashboard
   Brand: blue #20669A (sections), orange #FFA500 (accents) */

:root {
    --blue: #20669A;
    --blue-dark: #184e75;
    --orange: #FFA500;
    --ink: #1f2933;
    --muted: #6b7785;
    --line: #dfe4ea;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --danger: #b91c1c;
    --sidebar-bg: #15324a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #cdd9e4;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 28px 36px 60px;
    max-width: 1200px;
}

/* ── Brand ──────────────────────────────────────────────── */
.brand {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.brand-mark {
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    letter-spacing: 1px;
}
.brand-sub { color: var(--orange); font-size: 13px; font-weight: 600; text-transform: uppercase; }

/* ── Sidebar nav ────────────────────────────────────────── */
.nav { flex: 1; padding: 10px 0; }
.nav-section { margin-bottom: 14px; }
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e6edf3;
    padding: 6px 20px;
}
.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 20px;
    color: #9fb0c0;
    font-size: 13.5px;
    border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.nav-link.active {
    background: rgba(255,255,255,0.10);
    color: #fff;
    border-left-color: var(--orange);
    font-weight: 400;
}
.nav-link.pending { color: #8194a6; }
.soon {
    font-size: 9px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.12);
    color: #9fb0c0;
    padding: 1px 6px;
    border-radius: 8px;
}
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.logout { color: #9fb0c0; font-size: 13px; }

/* ── Tab bar (area sub-nav; pages within an area) ───────── */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    margin: 0 0 24px;
}
.tab-break { flex-basis: 100%; height: 0; }

/* Config component tables (backbone + trim groups, form and read-only views) */
.ct-wrap { margin-top: 14px; overflow-x: auto; }
.ct-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #20669A; font-weight: 700; margin-bottom: 2px; border-bottom: 1px solid rgba(32,102,154,.2); padding-bottom: 3px; }
.ct { border-collapse: collapse; font-size: 13px; }
.ct th { text-align: left; padding: 5px 8px 3px; color: #6f8398; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ct td { padding: 3px 8px; }
.ct td.rl { color: #6f8398; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ct td.v { font-variant-numeric: tabular-nums; min-width: 70px; }
.ct input, .ct select { padding: 6px 8px; border: 1px solid rgba(0,0,0,.18); border-radius: 6px; font-size: 13.5px; width: 108px; }
.ct input[type=text] { width: 140px; }
.tab {
    padding: 8px 14px;
    font-size: 13.5px;
    color: #5a6b7b;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tab:hover { color: var(--orange); text-decoration: none; }
.tab.active {
    color: #17242f;
    border-bottom-color: var(--orange);
    font-weight: 600;
}
.tab.pending { color: #9aa8b4; }
.tab .soon { background: rgba(0,0,0,0.07); color: #7a8894; }

/* ── Page header ────────────────────────────────────────── */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; color: var(--blue-dark); }
.page-head .muted { max-width: 760px; }
.breadcrumb { margin-bottom: 10px; font-size: 13px; }

/* ── Panels ─────────────────────────────────────────────── */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 18px;
}
.panel h2 { margin-top: 0; font-size: 16px; color: var(--blue-dark); }
.placeholder p { margin: 6px 0; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: #f0f3f6; text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger { color: var(--danger); border-color: #e3b4b4; background: #fff; }
.btn-danger:hover { background: #fbeaea; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Stat cards (home) ──────────────────────────────────── */
.cards-row { display: flex; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    border-radius: 8px;
    padding: 16px 22px;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    color: var(--ink);
}
.stat-card:hover { text-decoration: none; border-top-color: var(--orange); }
.stat-num { font-size: 30px; font-weight: 700; color: var(--blue-dark); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.quick-link {
    border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: #fbfcfd;
}
.quick-link:hover { border-color: var(--blue); text-decoration: none; }

/* ── Toolbar / search ───────────────────────────────────── */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-form { display: flex; gap: 8px; }
.search-form input { min-width: 280px; }

/* ── Lists ──────────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-title { font-weight: 600; }
.tags { color: var(--muted); font-size: 12px; }

/* ── Forms ──────────────────────────────────────────────── */
.form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .4px; }
.form input[type=text], .form input[type=password], .form input[type=date], .form textarea, .form select,
input[type=password], select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form textarea { resize: vertical; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 150px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.actions form { margin: 0; }
code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ── Filters / summary (tasks) ──────────────────────────── */
.filters { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 14px 0; font-size: 13px; }
.filters select { width: auto; display: inline-block; }
.filters .check { display: flex; align-items: center; gap: 6px; }
.summary-row { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.summary-stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 16px; font-size: 13px; }
.summary-stat b { color: var(--blue-dark); font-size: 16px; margin-right: 4px; }

/* ── Task sections ──────────────────────────────────────── */
.task-section {
    background: #e6ebef;
    border: 1px solid #d4dae0;
    border-radius: 8px;
    padding: 16px 20px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(31, 41, 51, 0.06);
}
.task-section h2 { font-size: 16px; color: var(--blue-dark); border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.task-section h2 .count { color: var(--muted); font-size: 13px; font-weight: 400; }
.task { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
.task-high { border-left-color: var(--danger); }
.task-medium { border-left-color: var(--orange); }
.task-low { border-left-color: #4a9c5a; }
.task > summary { padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task > summary::-webkit-details-marker { display: none; }
.task-title { font-weight: 600; }
.task-desc { color: var(--muted); }
.task-due { color: var(--muted); font-size: 12px; margin-left: auto; }
.task-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.task-quick { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.task-quick form { margin: 0; }
.task-edit { margin-top: 8px; }
.edit-toggle { cursor: pointer; color: var(--blue); font-size: 13px; }
.add-task > summary { cursor: pointer; font-weight: 600; color: var(--blue-dark); }

/* ── Badges ─────────────────────────────────────────────── */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.p-high { background: #fde2e2; color: #b91c1c; }
.p-medium { background: #fff0d6; color: #9a6700; }
.p-low { background: #e2f3e6; color: #2f7d3f; }
.s-to-do { background: #eceff2; color: #4a5663; }
.s-in-progress { background: #dceaf6; color: #1d5a86; }
.s-waiting { background: #fff0d6; color: #9a6700; }
.s-done { background: #e2f3e6; color: #2f7d3f; }

/* ── Chips / tags ───────────────────────────────────────── */
.tag-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { background: #eef1f4; color: var(--muted); font-size: 12px; padding: 2px 10px; border-radius: 10px; }

/* ── Markdown body ──────────────────────────────────────── */
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--blue-dark); }
.markdown-body { line-height: 1.65; }
.markdown-body code { font-size: 13px; }
.markdown-body pre { background: #f4f6f8; padding: 12px; border-radius: 6px; overflow-x: auto; }
.markdown-body table { border-collapse: collapse; margin: 12px 0; font-size: 13px; width: 100%; max-width: 720px; }
.markdown-body th { text-align: left; background: #f7f9fb; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; padding: 7px 10px; border: 1px solid var(--line); }
.markdown-body td { padding: 7px 10px; border: 1px solid var(--line); }
.markdown-body tbody tr:hover { background: #f7f9fb; }

/* ── Reference Guides ───────────────────────────────────── */
.rg-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rg-section { scroll-margin-top: 16px; }
.rg-section h2 { border-bottom: 2px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.rg-block { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: #fbfcfd; }
.rg-block > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--blue-dark); list-style: none; }
.rg-block > summary::-webkit-details-marker { display: none; }
.rg-block > summary::before { content: "▸ "; color: var(--muted); }
.rg-block[open] > summary::before { content: "▾ "; }
.rg-block[open] > summary { border-bottom: 1px solid var(--line); }
.rg-block .markdown-body { padding: 4px 18px 14px; }

/* ── Unit converter ─────────────────────────────────────── */
.uc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.uc-conv { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fbfcfd; }
.uc-conv h3 { margin: 0 0 10px; font-size: 14px; color: var(--blue-dark); }
.uc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.uc-unit { width: 56px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
.uc-input { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }

/* ── Calculator tools ───────────────────────────────────── */
.tool-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 18px 0 16px; }
.tool-tab { padding: 9px 20px; cursor: pointer; font-weight: 600; color: var(--muted); background: none; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -2px; font-family: inherit; font-size: 13.5px; }
.tool-tab:hover { color: var(--blue); }
.tool-tab.active { color: var(--blue-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff; }
a.tool-tab { text-decoration: none; display: inline-block; }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tool-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; background: #fbfcfd; }
.tool-card h3 { margin: 0 0 10px; font-size: 14px; color: var(--blue-dark); }
.tool-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.tool-card input[type=number] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
.tool-result { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.tool-result span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.tool-result b { color: var(--blue-dark); font-size: 16px; }
.tool-balance { margin: 16px 0 8px; font-weight: 600; color: var(--ink); }
.tool-card .u { text-transform: none; color: var(--muted); font-weight: 400; }
.cw-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cw-in { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }

/* ── Login ──────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.login-card { background: #fff; padding: 32px; border-radius: 10px; width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.login-brand { border: none; padding: 0 0 18px; justify-content: center; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.login-card .btn { margin-top: 16px; }
.alert { background: #fbeaea; color: var(--danger); border: 1px solid #e3b4b4; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.notice { background: #e2f3e6; color: #2f7d3f; border: 1px solid #b6dcc0; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }

/* ── Service Orders ─────────────────────────────────────── */
.so-tabs { display: flex; gap: 8px; }

.so-card {
    display: flex; align-items: stretch; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    margin-bottom: 8px;
}
.so-card-main { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.so-card-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink); flex: 1; }
.so-card-link:hover { text-decoration: none; }
.so-card-link:hover .so-cust { text-decoration: underline; }
.so-num { font-weight: 700; color: var(--blue-dark); }
.so-cust { font-weight: 600; }
.so-desc { color: var(--muted); font-size: 13px; }
.so-meta { display: flex; align-items: center; gap: 8px; }
.so-pill { font-size: 11px; padding: 2px 9px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.so-urg { font-size: 12px; font-weight: 600; white-space: nowrap; }
.so-urg-red { color: var(--danger); }
.so-urg-orange { color: #b5740a; }
.so-urg-green { color: #0a8c43; }
.so-urg-gray { color: var(--muted); }
.so-reorder { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-right: 8px; }
.so-reorder form { margin: 0; }
.so-reorder .btn { padding: 0 6px; line-height: 1.4; }

.so-summary-head { cursor: pointer; font-weight: 600; color: var(--blue-dark); }
.so-summary-head .count { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.so-matches { margin: 10px 0; }
.so-inline-create { display: flex; gap: 6px; align-items: center; margin: 0; }
.so-inline-create select { width: auto; }

.so-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.so-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.so-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.so-vendor { margin-bottom: 8px; }
.so-vendor > summary { cursor: pointer; padding: 6px 0; }
.so-email { margin-top: 8px; }
.so-email-body { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

.so-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.so-detail-head form { margin: 0; }

.so-parts .so-part-cell { padding: 6px 4px; }
.so-part-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.so-part-form input[type=text], .so-part-form input[type=number], .so-part-form select { width: auto; padding: 6px 8px; }
.so-part-form input[name=part_name] { flex: 1; min-width: 160px; }
.so-sku { width: 110px !important; }
.so-qty { width: 64px !important; }
.so-notes { flex: 1; min-width: 140px !important; }
.so-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.so-part-cell { display: flex; gap: 8px; align-items: center; }
.so-part-del { margin: 0; }
.so-addpart { margin-top: 12px; }

.so-imgcol { flex: 1; min-width: 220px; }
.so-imglist { list-style: none; margin: 6px 0; padding: 0; }
.so-imglist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.so-imglist form { margin: 0; }
.so-upload { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ── Task Tracker: areas + add-by-placement ─────────────── */
.area-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.area-pill {
    display: inline-block; padding: 5px 12px; border: 1px solid var(--line);
    border-radius: 14px; background: #fff; color: var(--blue);
    font-size: 12.5px; font-weight: 600;
}
.area-pill:hover { background: var(--blue); color: #fff; border-color: var(--blue); text-decoration: none; }
.task-section { scroll-margin-top: 16px; }
.area-add { margin-bottom: 14px; }
.area-add-row {
    cursor: pointer; list-style: none; display: inline-block;
    color: var(--blue); font-weight: 600; font-size: 13px;
    padding: 7px 14px; border: 1px solid var(--blue); border-radius: 6px; background: #fff;
}
.area-add-row::-webkit-details-marker { display: none; }
.area-add-row:hover { background: #f0f6fb; }

.task-section-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; padding-bottom: 8px; }
.task-section-head h2 { border: none; margin: 0; padding: 0; color: var(--blue-dark); }
.area-edit-toggle { cursor: pointer; list-style: none; }
.area-edit-toggle::-webkit-details-marker { display: none; }
.area-del-form { margin: 0; }

/* up/down reorder arrows (areas + tasks), pushed to far right of the row */
.reorder { display: inline-flex; gap: 2px; margin-left: auto; }
.reorder form { margin: 0; }
.reorder .btn { padding: 2px 8px; line-height: 1.2; }
.area-reorder { align-self: center; }
.task-reorder { align-self: center; }

.area-inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.area-inline-form input[type=text] { width: auto; min-width: 240px; }

.task-add { margin-bottom: 8px; }
.task-add-row {
    cursor: pointer; list-style: none;
    border: 1px dashed var(--line); border-radius: 6px;
    padding: 8px 14px; color: var(--blue); font-size: 13px; font-weight: 600; background: #fbfcfd;
}
.task-add-row::-webkit-details-marker { display: none; }
.task-add-row:hover { border-color: var(--blue); background: #f0f6fb; }
.task-add[open] { border: 1px solid var(--line); border-radius: 6px; padding: 0 12px 12px; background: #fbfcfd; margin-bottom: 12px; }
.task-add[open] .task-add-row { border: none; background: none; padding: 10px 2px; }

/* ── Shopify Snapshot ───────────────────────────────────── */
.ss-group { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; background: #fbfcfd; }
.ss-group > summary { cursor: pointer; padding: 8px 12px; font-size: 13px; }
.ss-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 14px; border-top: 1px solid var(--line); }
.ss-name { font-weight: 600; }
.ss-note { font-size: 12px; }
.ss-note-preview { font-size: 12px; }
.ss-uncollected { list-style: none; margin: 8px 0 0; padding: 0; }
.ss-uncollected li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Data grid table (Vehicle Library etc.) ─────────────── */
.grid-table {
    width: 100%; border-collapse: collapse; background: var(--panel);
    border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px;
}
.grid-table th {
    text-align: left; background: #f7f9fb; color: var(--muted);
    font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    padding: 9px 12px; border-bottom: 1px solid var(--line);
}
.grid-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.grid-table tr:last-child td { border-bottom: none; }
.grid-table tbody tr:hover { background: #f7f9fb; }
.filters input[type=text] { width: 200px; display: inline-block; }
.mr-head { font-weight: 700; color: var(--blue-dark); margin-bottom: 4px !important; }

/* two-row catalog filter bar: search row + on-the-fly filter row */
.catalog-filters { margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.cf-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cf-search input[type=text] {
    width: 360px; max-width: 100%; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 6px;
    font-size: 14px; font-family: inherit; background: #fff;
}
.cf-filters { font-size: 13px; }
.cf-filters span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.cf-filters select { width: auto; display: inline-block; }
.cf-filters .cf-arrow { color: var(--blue-dark); font-weight: 700; font-size: 15px; margin: 0 1px; }
.cf-more > summary { cursor: pointer; color: var(--muted); font-size: 12px; width: fit-content; }
.cf-more > summary:hover { color: var(--blue); }
.cf-more[open] > summary { margin-bottom: 8px; color: var(--blue-dark); font-weight: 600; }

/* ── Kit detail tabs (CSS-only, no JS) ──────────────────── */
.kit-tabs > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.kit-tablabels { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.kit-tablabels label {
    padding: 9px 20px; cursor: pointer; font-weight: 600; color: var(--muted);
    border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -2px;
}
.kit-tablabels label:hover { color: var(--blue); }
#kt-kit:checked ~ .kit-tablabels label[for=kt-kit],
#kt-spares:checked ~ .kit-tablabels label[for=kt-spares] {
    color: var(--blue-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff;
}
.kit-panel { display: none; }
#kt-kit:checked ~ #panel-kit { display: block; }
#kt-spares:checked ~ #panel-spares { display: block; }

/* ── Kit list: search row + filter pills ────────────────── */
.kit-search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.kit-search-row input[type=text] {
    width: 360px; max-width: 100%; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff;
}
.kit-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
    display: inline-block; padding: 6px 14px; border: 1px solid var(--line);
    border-radius: 16px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600;
}
.pill:hover { border-color: var(--blue); text-decoration: none; }
.pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Suspension Kit BOM ─────────────────────────────────── */
.kit-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.kit-list-head h2 { margin: 0; }
.kit-bom td, .kit-bom th { font-size: 12.5px; }
.kit-qty-form { margin: 0; }
.kit-qty-form input { width: 56px; padding: 4px 6px; }
.kit-avail-form { margin: 0; }
.kit-avail-form select { width: auto; padding: 4px 6px; font-size: 12px; }
.kit-bom tfoot .kit-subtotal td { background: #f7f9fb; font-weight: 600; border-top: 2px solid var(--line); }
.kit-add-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.kit-add-form input[type=text] { flex: 1; min-width: 200px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.kit-rollup { max-width: 360px; }
.kit-rollup .kit-total td { border-top: 2px solid var(--line); background: #f7f9fb; }

/* ── Vendors (admin) ────────────────────────────────────── */
.vd-vendor > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.vd-vendor > summary::-webkit-details-marker { display: none; }
.vd-body { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.vd-body p { margin: 4px 0; }
.vd-disc-list { margin: 4px 0 0; padding-left: 18px; }
.vd-disc-list li { margin: 2px 0; }
.vd-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.vd-actions form { margin: 0; }
.vd-edit { flex: 1; min-width: 200px; }
.vd-disc-row { margin-top: 8px; }
.vd-disc-row > div { min-width: 120px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .content { padding: 20px; }
}
