/* 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: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6f8398;
    padding: 6px 20px;
}
.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 20px;
    color: #cdd9e4;
    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: 600;
}
.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; }

/* ── 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; }
/* Inline editable field (label + small control on one line) */
.inline-field { display: flex; align-items: center; gap: 8px; margin: 1em 0; }
.inline-form { display: inline; margin: 0; }
.inline-select { width: auto; display: inline-block; padding: 4px 8px; font-size: 13px; }
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; }

/* ── 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 0; }
.cf-set { margin-bottom: 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; }
/* Single filter dropdown — one panel, sectioned (no nested accordions) */
.filter-dd { display: inline-block; margin: 14px 0 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 220px; }
.filter-dd[open] { display: block; }
.filter-dd-btn { cursor: pointer; padding: 9px 16px; font-weight: 700; color: var(--blue-dark); list-style: none; user-select: none; }
.filter-dd-btn::-webkit-details-marker { display: none; }
.filter-dd-btn::before { content: '▸  '; color: var(--muted); }
.filter-dd[open] > .filter-dd-btn::before { content: '▾  '; }
.filter-dd-btn:hover { background: #f7f9fb; border-radius: 8px; }
.filter-dd-on { margin-left: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--blue); padding: 1px 8px; border-radius: 10px; }
.filter-dd-panel { padding: 0 16px 4px; border-top: 1px solid var(--line); }
.filter-dd-sum { margin-left: 10px; font-weight: 400; font-size: 12px; color: var(--muted); }
/* each filter section = its own defined container */
.cf-sec { padding: 12px 14px 14px; margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.cf-sec > h4 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-dark); font-weight: 700; }
.cf-actions { display: flex; gap: 10px; align-items: center; padding: 2px 0 14px; }
.cf-apply { margin-top: 10px; }
.cf-brands { display: flex; gap: 14px; align-items: flex-start; }
.cf-brand-col { flex: 1; min-width: 220px; }
.cf-brand { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px 14px; }
.cf-brand-head { font-size: 14px; font-weight: 700; color: var(--blue-dark); margin: 0 0 6px 2px; }
.cf-shopnav-head { font-size: 13px; color: var(--blue-dark); font-weight: 700; margin: 12px 0 4px; }
.cf-brand .cf-shopnav-head:first-of-type { margin-top: 0; }
.cf-shopnav-leaf { display: block; padding: 4px 8px; border-radius: 5px; color: var(--blue-dark); font-size: 13px; }
.cf-shopnav-leaf:hover { background: #eef4f9; text-decoration: none; }
.cf-shopnav-leaf.active { background: var(--blue); color: #fff; }

/* ── Kit detail tabs (CSS-only, no JS) ──────────────────── */
.kit-tabs > input[type=radio] { display: 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-overview:checked ~ .kit-tablabels label[for=kt-overview],
#kt-description:checked ~ .kit-tablabels label[for=kt-description],
#kt-parts:checked ~ .kit-tablabels label[for=kt-parts] {
    color: var(--blue-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff;
}
.kit-panel { display: none; }
#kt-overview:checked ~ #panel-overview { display: block; }
#kt-description:checked ~ #panel-description { display: block; }
#kt-parts:checked ~ #panel-parts { display: block; }

/* ── Part detail tabs (Details | Shopify) ───────────────── */
.ptabs > input[type=radio] { display: none; }
.ptab-labels { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.ptab-labels 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;
}
.ptab-labels label:hover { color: var(--blue); }
#pt-details:checked ~ .ptab-labels label[for=pt-details],
#pt-rel:checked ~ .ptab-labels label[for=pt-rel],
#pt-shopify:checked ~ .ptab-labels label[for=pt-shopify],
#pt-bom:checked ~ .ptab-labels label[for=pt-bom],
#pt-eng:checked ~ .ptab-labels label[for=pt-eng],
#pt-fitment:checked ~ .ptab-labels label[for=pt-fitment] {
    color: var(--blue-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff;
}
.ptab-panel { display: none; }
#pt-details:checked ~ #panel-pt-details { display: block; }
#pt-rel:checked ~ #panel-pt-rel { display: block; }
#pt-shopify:checked ~ #panel-pt-shopify { display: block; }
#pt-bom:checked ~ #panel-pt-bom { display: block; }
#pt-eng:checked ~ #panel-pt-eng { display: block; }
#pt-fitment:checked ~ #panel-pt-fitment { display: block; }

/* Categories config (engineering-tab checkboxes) */
.cat-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.cat-check { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cat-check input { width: auto; }
/* Category list with per-category spec-parameter drill-down */
.cat-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.cat-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.cat-row .cat-check { border: none; padding: 0; min-width: 220px; }
.cat-params > summary { cursor: pointer; color: var(--blue-dark); font-size: 13px; font-weight: 600; }
.cat-params ul { margin: 8px 0 2px; columns: 2; font-size: 13px; color: var(--muted); }
.cat-params li { margin: 2px 0; }

/* drift flag — Shopify value disagrees with the DB / across listings */
.drift { color: #b3541e; font-weight: 600; }

/* Accessory add row — name + URL + button on one row */
.acc-row { display: flex; gap: 14px; align-items: flex-end; }
.acc-row > div { flex: 1; }
.acc-row .acc-row-btn { flex: 0 0 auto; }
.acc-row input { width: 100%; }
/* divider line above the accessory list, with gap; no per-row lines below */
.fitment-list.acc-list { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.fitment-list.acc-list li { border-bottom: none; }

/* Boilerplate flow placeholders (per-kit content markers) */
.bp-placeholder { border: 1px dashed #c4ccd4; border-radius: 8px; background: #f6f8fa; padding: 12px 14px; margin-bottom: 22px; }
.bp-placeholder > b { color: #5a6573; }
.bp-placeholder .muted { margin: 2px 0 0; }
.bp-ph-tag { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #8a96a3; background: #e7edf2; border-radius: 4px; padding: 1px 7px; margin-right: 8px; vertical-align: middle; }

/* WYSIWYG (Quill) boilerplate editor */
.wysiwyg-form { margin-bottom: 22px; }
.wysiwyg-editor .ql-editor { min-height: 140px; font-size: 14px; }
.wysiwyg-form .ql-toolbar { border-radius: 6px 6px 0 0; }
.wysiwyg-form .ql-container { border-radius: 0 0 6px 6px; }

/* Shopify description preview (composed output) */
.desc-preview { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; background: #fff; }
.desc-preview img { max-width: 160px; height: auto; }
.desc-preview ul { margin: 4px 0 10px 18px; }
.desc-preview p { margin: 6px 0; }
.desc-source { margin-top: 10px; }
.desc-source-text { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; white-space: pre; }

/* Persistent Product Development dropdown header (megamenu) */
.pd-header { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; margin-bottom: 18px; }
.pd-header-prompt { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 8px; }
.pd-header-label { font-size: 14px; color: var(--blue-dark); margin-right: 4px; font-weight: 700; text-decoration: none; padding: 7px 13px; border-radius: 6px; }
.pd-header-label:hover { background: #eef4f9; }
.pd-header-label.active { background: var(--blue); color: #fff; }
.pd-header-label.active:hover { background: var(--blue); }
.pd-menu { position: relative; }
.pd-menu-btn { font-weight: 700; color: var(--blue-dark); background: none; border: none; cursor: pointer; padding: 7px 13px; border-radius: 6px; font-size: 14px; }
.pd-menu:hover .pd-menu-btn { background: #eef4f9; }
.pd-flyout { display: none; position: absolute; top: 100%; left: 0; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 14px; gap: 24px; min-width: 240px; max-width: 1100px; flex-wrap: wrap; }
.pd-menu:hover .pd-flyout { display: flex; }
.pd-flyout-col { display: flex; flex-direction: column; gap: 1px; }
.pd-flyout-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin: 8px 0 3px; white-space: nowrap; }
.pd-flyout-leaf { display: block; padding: 5px 8px; border-radius: 5px; text-decoration: none; color: var(--blue-dark); font-size: 13px; white-space: nowrap; }
a.pd-flyout-leaf:hover { background: #eef4f9; }
.pd-flyout-leaf.soon { color: var(--muted); }
.pd-home-link { margin-left: auto; font-size: 13px; color: var(--muted); text-decoration: none; padding: 7px 10px; }
.pd-home-link:hover { color: var(--blue); }

/* Shopify Product Development — brand top header + line cards */
.brand-tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin: 4px 0 22px; }
.brand-tab { padding: 11px 26px; font-weight: 700; font-size: 16px; color: var(--muted); border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; margin-bottom: -2px; text-decoration: none; }
.brand-tab:hover { color: var(--blue); }
.brand-tab.active { color: var(--blue-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff; }
.brand-tabs .pd-refresh { margin-left: auto; align-self: center; margin-bottom: 6px; }
.proddev-soon { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #8a96a3; background: #eef1f4; border-radius: 4px; padding: 1px 6px; }
/* nested tree (Family → Collection) */
.pd-tree { max-width: 760px; }
.pd-group { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.pd-group > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--blue-dark); }
.pd-group > summary::-webkit-details-marker { color: var(--muted); }
.pd-leaves { display: flex; flex-direction: column; padding: 4px 16px 12px 30px; gap: 2px; }
.pd-leaves-flat { padding-left: 16px; }
.pd-leaf { display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--blue-dark); }
a.pd-leaf:hover { background: #eef4f9; }
.pd-leaf-soon { color: var(--muted); }

/* Product Tool — breadcrumb + collapsible help guides (tool-wide + per-container) */
.pd-crumb { margin: 0 0 10px; font-size: 13px; }
.pd-crumb a { color: var(--muted); text-decoration: none; }
.pd-crumb a:hover { color: var(--blue); text-decoration: underline; }
details.pd-help { border: 1px solid var(--line); border-radius: 8px; background: #f7fafc; margin: 0 0 16px; }
details.pd-help > summary { cursor: pointer; padding: 9px 14px; font-size: 13px; font-weight: 700; color: var(--blue-dark); }
details.pd-help > summary::-webkit-details-marker { color: var(--muted); }
details.pd-help .pd-help-body { padding: 2px 16px 12px; font-size: 13px; color: var(--ink); }
details.pd-help .pd-help-body p { margin: 7px 0; }
details.pd-help .pd-help-body code { background: #eef2f6; padding: 0 3px; border-radius: 3px; font-size: 12px; }
/* per-container help: an always-visible help line under a section header */
.pd-help-line { font-size: 12px; color: var(--muted); margin: -2px 0 10px; }
.pd-help-line::before { content: "ℹ "; }
.pd-help-line code { background: #eef2f6; padding: 0 3px; border-radius: 3px; }

/* Catalog Sync dashboard */
.syncbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin: 14px 0 8px; background: #eef1f4; }
.syncbar-seg { display: block; height: 100%; }
.seg-matched { background: #2ecc71; }
.seg-unmatched { background: #e74c3c; }
.seg-nosku { background: #95a5a6; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }
.sync-cat > summary { cursor: pointer; font-size: 15px; padding: 4px 0; display: flex; align-items: center; gap: 12px; }
.sync-cat > summary::-webkit-details-marker { color: var(--muted); }
.catbar { flex: 1; max-width: 220px; height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.catbar-fill { display: block; height: 100%; background: #e74c3c; }
.catbar-fill.blue { background: #3498db; }
.ok { color: #1e8e4e; font-weight: 600; }
.yes { color: #1e8e4e; font-weight: 700; }
.no { color: #c0c6cd; font-weight: 700; }

/* Sales rollup (3DM kit Parts List) */
.sales-panel { background: #f3f7fa; border-left: 4px solid var(--blue); }
.metric-lbl { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.metric-val { margin: 2px 0 0; font-size: 22px; font-weight: 700; color: var(--blue-dark); }

/* ── Kit list: Kits | Boilerplate sub-tabs ──────────────── */
.subtabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 10px 0 16px; }
.subtab { padding: 9px 20px; font-weight: 600; color: var(--muted); border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -2px; }
.subtab:hover { color: var(--blue); text-decoration: none; }
.subtab.active { color: var(--blue-dark); background: #fff; border-color: var(--line); border-bottom: 2px solid #fff; }
.bp-form { margin-bottom: 18px; }
.bp-form textarea { width: 100%; }

/* ── 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); }

/* ── Kit details: source-labeled sections ───────────────── */
.src-head { font-weight: 700; color: var(--blue-dark); margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.src-head.src-shopify { color: #5a3a8a; }

/* ── Kit specs (structured Front/Rear) ──────────────────── */
.spec-grid { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 8px; }
.spec-col { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: #fbfcfd; }
.fitment-list { list-style: none; margin: 0 0 10px; padding: 0; }
.fitment-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.fitment-list form { margin: 0; }
.fitment-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fitment-add select { width: auto; min-width: 280px; }
.spec-head { font-weight: 700; color: var(--blue-dark); margin: 0 0 6px; }
.spec-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; margin: 10px 0 3px; }
.spec-col input, .spec-col select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; }
.spec-lb { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--blue-dark); font-weight: 600; }

/* ── 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); }
.bom-group-header td { background: var(--blue-dark); color: #fff; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 6px 12px; }
.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; }

/* ── Parts Catalog: Category Builder + hybrid Specs tab ─── */
.cat-builder { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.cat-builder > summary { padding: 10px 14px; cursor: pointer; }
.cat-builder-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.cat-builder-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.cat-sub-row { border-top: 1px dashed var(--line); }
.cat-sub-row > span:first-child { flex: 1; min-width: 220px; }
.cat-inline-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.cat-inline-form input[type=text] { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-family: inherit; width: 180px; }
.spec-group-head { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; font-size: 14px; color: var(--blue-dark); }
.spec-group-link { font-weight: 400; }
.spec-field-rm { background: none; border: none; cursor: pointer; padding: 0 2px; font-size: 13px; }
.spec-source-banner { font-size: 13px; padding: 9px 13px; border-radius: 6px; border-left: 4px solid; margin-bottom: 4px; line-height: 1.5; }
.spec-source-library { background: #f0f5fb; border-color: var(--blue); color: #1a3a55; }
.spec-source-adhoc { background: #fffbf0; border-color: #e6a817; color: #5a3e00; }

/* ── Order Processing: Overview tab ─────────────────────── */
.ov-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ov-card h2 { margin: 0; }
.ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ov-metrics { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.ov-metric { display: flex; flex-direction: column; }
.ov-metric-val { font-size: 22px; font-weight: 700; color: var(--blue-dark); }
.ov-metric-label { font-size: 12px; color: var(--muted); }
.ov-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); margin-bottom: 10px; }
.ov-bar > span { display: block; height: 100%; }
.ov-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.ov-legend li { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.ov-legend b { color: var(--text); }
.ov-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.ov-need { margin: 12px 0 0; font-size: 13px; color: var(--text); }

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