/* SpringBlinds Inventory — portal layout: top bar + menu bar + portlet dashboard */
:root {
  --page: #EDF0F3; --panel: #FFFFFF; --panel2: #F6F8FA; --line: #D5DBE1; --line2: #E7EBEF;
  --ink: #1E2A33; --ink2: #5B6873; --ink3: #8E99A3;
  --topbar: #FFFFFF; --nav: #25475C; --nav-ink: #E3ECF1; --nav-active: #183445; --nav-hover: #2E566E;
  --link: #1F6FA8; --focus: 0 0 0 3px rgba(31,111,168,.35);
  --tile-in: #3E7C57; --tile-out: #B0612F; --tile-move: #3A6B98; --tile-adj: #6B5B98;
  --t-in: #2F6B47; --t-out: #9A4F20; --t-move: #2C5E8C; --t-adj: #5A4A88; --t-red: #B3261E;
  --red: #C8372D; --amber: #D9822B;
  --row-alt: #F7F9FA; --row-hover: #EAF2F8; --low-bg: #FCEDEC;
  --ok-bg: #E4F2E9; --err-bg: #FBE7E5; --warn-bg: #FDF0DE;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #14191D; --panel: #1D2429; --panel2: #232B31; --line: #333E46; --line2: #2A333A;
    --ink: #E6ECF0; --ink2: #A3AFB8; --ink3: #75828C;
    --topbar: #1D2429; --nav: #1A3342; --nav-ink: #D5E2EA; --nav-active: #0F2230; --nav-hover: #224256;
    --link: #6DB3E8;
    --t-in: #7BC79A; --t-out: #E8A06F; --t-move: #86B6E3; --t-adj: #B3A5DE; --t-red: #F28B82;
    --row-alt: #20282E; --row-hover: #243745; --low-bg: #3A2222;
    --ok-bg: #1F3527; --err-bg: #3D2220; --warn-bg: #3A2E1C;
  }
}

/* ---- colour roles (one value per role, light / dark) — 2026-10-18 colour unification ---- */
:root {
  --brand: var(--nav); --brand-ink: #25475C;
  --accent: var(--link); --accent-solid: #1F6FA8; --accent-soft: #E6F0F8; --accent-line: #B9D0E6;
  --ok: #3E7C57; --t-ok: #2F6B47; --ok-line: #A9D5B8;
  --danger: #C8372D; --err-line: #EDB5AF;
  --t-warn: #9A5B13; --warn-line: #E8C79A;
  /* names older screens already ask for (they used to fall back to their own hex) */
  --muted: var(--ink2); --text: var(--ink); --green: var(--t-ok); --t-green: var(--t-ok); --red: #C8372D;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-ink: #9CC3E0;
    --accent-solid: #2F7FBF; --accent-soft: #1B2E3D; --accent-line: #34536E;
    --ok: #4E9A6C; --t-ok: #7BC79A; --ok-line: #2F5A3D;
    --danger: #D9534A; --err-line: #6A3530;
    --t-warn: #E8A06F; --warn-line: #6A4E2A;
  }
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 var(--font);
       -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--link); }
:focus-visible { outline: none; box-shadow: var(--focus); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- header: brand + search + language ---------- */
.topbar { display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px; background: var(--topbar);
          border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.brand span { font-size: 13px; color: var(--ink2); }
.global-search { flex: 1; max-width: 560px; display: flex; }
.global-search input { width: 100%; height: 36px; border-radius: 6px; padding: 0 12px 0 34px;
  background: var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238E99A3' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 11px center; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented a { padding: 5px 10px; font-size: 12px; color: var(--ink2); text-decoration: none; }
.segmented a.active { background: var(--nav); color: #fff; font-weight: 600; }

/* ---------- menu bar ---------- */
.menubar { display: flex; align-items: stretch; gap: 2px; background: var(--nav); padding: 0 12px; overflow-x: auto;
           position: sticky; top: 0; z-index: 20; }
.menubar a { display: flex; align-items: center; gap: 7px; padding: 0 13px; height: 40px; color: var(--nav-ink);
             text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.menubar a:hover { background: var(--nav-hover); }
.menubar a.active { background: var(--nav-active); border-bottom-color: #fff; color: #fff; }
.menubar .sep { width: 1px; margin: 10px 6px; background: rgba(255,255,255,.18); }
.menubar svg { width: 16px; height: 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.in { background: #7FC79B; } .dot.out { background: #F0A36D; } .dot.move { background: #8CBDEB; } .dot.adj { background: #B9A9E8; }

main { padding: 20px 20px 48px; max-width: 1560px; margin: 0 auto; }
h1 { font-size: 20px; font-weight: 700; margin: 2px 0 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
h3, .card-title { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.muted { color: var(--ink2); font-size: 13px; }
.small-link { font-size: 13px; color: var(--link); text-decoration: none; }
.small-link:hover { text-decoration: underline; }

/* ---------- portlets / cards ---------- */
.card, .portlet { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; }
.portlet > h2 { font-size: 14px; font-weight: 700; margin: -2px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.portlet > h2 a { font-size: 12.5px; font-weight: 500; }
.flash-wrap { margin-bottom: 14px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 14px; border: 1px solid var(--line); }
.flash-success { background: var(--ok-bg); } .flash-error { background: var(--err-bg); }
.warn-box { background: var(--warn-bg); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 6px;
            padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.warn-box .btn { margin-top: 10px; margin-right: 6px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
       border: 1px solid transparent; border-radius: 5px; background: var(--link); color: #fff; font: 600 13px var(--font);
       text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--panel2); filter: none; }
.btn.danger { background: var(--red); }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=time], input[type=file], input[type=email], input[type=tel], input[type=url], select, textarea {
  height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
  color: var(--ink); font: 13.5px var(--font); min-width: 0; }
textarea { height: auto; padding: 7px 9px; }
input[type=file] { padding: 4px 6px; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: var(--focus); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--link); }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.filter-bar input[type=text] { flex: 1 1 200px; }
.check { font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

form .field { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
form .field > label:first-child { width: 120px; flex-shrink: 0; font-size: 13px; color: var(--ink2); text-align: right; }
form .field input[type=text], form .field input[type=email], form .field input[type=tel], form .field input[type=number], form .field input[type=date], form .field input[type=time], form .field select, form .field textarea { flex: 1; }
form .field.checkbox label { width: auto; }
.field-stack { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.field-row { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.field-row select, .field-row input { flex: 1; min-width: 0; }
.layout-2col { display: flex; gap: 16px; align-items: flex-start; }
.layout-2col .list-col { flex: 1.6; min-width: 0; }
.layout-2col .form-col { flex: 1; min-width: 300px; position: sticky; top: calc(var(--hdr) + 11px); }
.two-cards { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.two-cards > .card { flex: 1; min-width: 340px; }
.form-card { max-width: 660px; }
.danger-card { border-top: 3px solid var(--red); }
.big-url { font-size: 20px; font-weight: 700; }

/* ---------- spreadsheet-style tables ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--line); border-radius: 4px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: var(--panel2); text-align: left; font-weight: 600; font-size: 12.5px;
     color: var(--ink2); padding: 6px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 5px 9px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
th + th, td + td { border-left: 1px solid var(--line2); }
tbody tr:nth-child(even) td { background: var(--row-alt); }
tbody tr:hover td { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
td.nowrap { white-space: nowrap; }
tr.low-stock td { background: var(--low-bg) !important; }
tr.low-stock td.num strong { color: var(--t-red); }
tr.cancelled td { color: var(--ink3); text-decoration: line-through; }
tr.cancelled td .badge { text-decoration: none; }
.breakdown span { display: inline-block; background: var(--panel2); border: 1px solid var(--line2); padding: 0 6px; border-radius: 4px; margin: 1px 3px 1px 0; font-size: 12px; }
.breakdown span.neg { background: var(--low-bg); color: var(--t-red); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge.in { background: rgba(62,124,87,.14); color: var(--t-in); }
.badge.out { background: rgba(176,97,47,.15); color: var(--t-out); }
.badge.transfer { background: rgba(58,107,152,.14); color: var(--t-move); }
.badge.adjust { background: rgba(107,91,152,.15); color: var(--t-adj); }
.badge.on { background: var(--panel2); color: var(--ink2); }
.badge.off { background: var(--low-bg); color: var(--t-red); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.reminders { list-style: none; margin: 0; padding: 0; }
.reminders li a { display: block; padding: 6px 0 6px 12px; margin-bottom: 8px; border-left: 3px solid var(--line); color: var(--ink); text-decoration: none; }
.reminders li a:hover { background: var(--panel2); }
.reminders .n { display: block; font-size: 22px; font-weight: 700; line-height: 1.15; }
.reminders .l { font-size: 12.5px; color: var(--link); }
.reminders .red a { border-left-color: var(--red); }
.reminders .amber a { border-left-color: var(--amber); }
.reminders .calm a { border-left-color: var(--tile-move); }
.reminders .zero a { border-left-color: var(--line); }
.reminders .zero .n { color: var(--ink3); }
.shortcuts { list-style: none; margin: 0; padding: 0; columns: 1; }
.shortcuts li a { display: block; padding: 4px 0; font-size: 13px; text-decoration: none; }
.shortcuts li a:hover { text-decoration: underline; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px;
        border-radius: 5px; color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; text-align: center; padding: 10px;
        background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 2px, transparent 2px 9px); transition: filter .15s; }
.tile:hover { filter: brightness(1.08); }
.tile svg { width: 30px; height: 30px; }
.tile.in { background-color: var(--tile-in); } .tile.out { background-color: var(--tile-out); }
.tile.move { background-color: var(--tile-move); } .tile.adj { background-color: var(--tile-adj); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; }
.kpi .k-label { font-size: 13px; color: var(--ink); font-weight: 600; }
.kpi .k-value { font-size: 22px; font-weight: 700; margin: 2px 0; }
.kpi .k-sub { font-size: 12px; color: var(--ink2); }
.chg { font-weight: 700; }
.chg.up { color: var(--t-in); } .chg.down { color: var(--t-out); }

.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line2); }
.chart .axis-label { fill: var(--ink2); font-size: 11px; }
.chart .bar-in { fill: var(--tile-in); } .chart .bar-out { fill: var(--tile-out); }
.chart .val { fill: var(--ink2); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { margin-bottom: 9px; }
.hbars .hb-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.hbars .hb-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .hb-track { height: 8px; background: var(--panel2); border-radius: 4px; margin-top: 3px; overflow: hidden; }
.hbars .hb-fill { height: 100%; border-radius: 4px; background: var(--tile-out); }
.hbars.value .hb-fill { background: var(--tile-move); }

/* ---------- entry screens (large, touch-friendly) ---------- */
.entry { max-width: 660px; }
.act-in { --act: var(--tile-in); } .act-out { --act: var(--tile-out); } .act-move { --act: var(--tile-move); } .act-adj { --act: var(--tile-adj); }
.entry-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.entry-head h1 { margin: 0; font-size: 22px; }
.entry-icon { width: 42px; height: 42px; border-radius: 6px; background: var(--act); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.entry-icon svg { width: 24px; height: 24px; }
.group { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--act, var(--link)); border-radius: 6px; overflow: hidden; }
.group + .group { border-top-width: 1px; }
.group .field { margin: 0; min-height: 54px; padding: 6px 16px; border-bottom: 1px solid var(--line2); }
.group .field:last-child { border-bottom: 0; }
.group .field:focus-within { background: var(--row-hover); }
.group .field > label:first-child { width: 120px; text-align: left; font-size: 14.5px; color: var(--ink); font-weight: 500; }
.group input[type=text], .group input[type=number], .group input[type=date], .group select {
  height: 42px; font-size: 16.5px; }
.stock-preview { font-size: 12.5px; color: var(--ink2); padding: 3px 2px 0; min-height: 16px; }
.stock-preview .nf { color: var(--t-red); }
.loc-stock { font-size: 13px; color: var(--act, var(--link)); font-weight: 700; white-space: nowrap; }
.stepper { flex: 1; display: flex; align-items: center; gap: 10px; }
.stepper button { width: 46px; height: 46px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2);
                  color: var(--act); font: 700 24px var(--font); cursor: pointer; line-height: 1; }
.stepper button:active { transform: scale(.95); }
.group .stepper input { flex: 1; width: 100%; min-width: 0; text-align: center; font-size: 22px; font-weight: 700; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.btn-big { width: 100%; height: 54px; margin-top: 14px; border: 0; border-radius: 6px; background: var(--act);
           color: #fff; font: 700 17px var(--font); cursor: pointer; }
.btn-big:hover { filter: brightness(1.08); }
.btn-big:active { transform: scale(.99); }
details.bulk { margin-top: 18px; }
details.bulk summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--link); }
details.bulk .card { margin-top: 10px; }
details.bulk form .field > label:first-child { text-align: left; width: 110px; }

/* ---------- item form sections ---------- */
.form-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-sections .card { margin: 0; }
.form-sections .card.wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.grid-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-fields .field > label:first-child { width: 110px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) { .dash { grid-template-columns: 250px minmax(0, 1fr); } .dash .col-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; } .dash .col-right { display: block; }
  .tiles, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-sections, .grid-fields { grid-template-columns: 1fr; }
  .layout-2col { flex-direction: column; } .layout-2col .form-col { position: static; width: 100%; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .global-search { order: 3; max-width: none; flex-basis: 100%; }
  main { padding: 14px 12px 40px; }
  .group .field { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 14px; }
  .group .field > label:first-child { width: auto; font-size: 12.5px; color: var(--ink2); }
  .group .stepper button { width: 52px; height: 52px; }
  .two-cards > .card { min-width: 0; }
  form .field > label:first-child { width: 96px; }
}

/* refinements */
form .field.checkbox > label:first-child { width: 120px; }
.form-sections form .field.checkbox > label:first-child, .form-sections .field.checkbox > label:first-child { width: 120px; }
@media (max-width: 900px) {
  .dash .col-center { order: -1; }
  .reminders { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
}
@media (max-width: 700px) { form .field.checkbox > label:first-child { width: 96px; } }
form .field .field-stack input[type=text] { flex: none; height: 42px; }

/* ---------- orders & email review ---------- */
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; }
.status-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.status-chips a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
                  color: var(--ink); text-decoration: none; font-size: 13px; }
.status-chips a b { margin-left: 4px; color: var(--ink2); }
.status-chips a.active { background: var(--nav); border-color: var(--nav); color: #fff; }
.status-chips a.active b { color: #fff; }
.status, .kind { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-new { background: rgba(58,107,152,.14); color: var(--t-move); }
.st-in_progress { background: rgba(217,130,43,.16); color: var(--t-out); }
.st-shipped { background: rgba(107,91,152,.15); color: var(--t-adj); }
.st-done { background: rgba(62,124,87,.14); color: var(--t-in); }
.st-cancelled { background: var(--panel2); color: var(--ink3); }
.k-po { background: rgba(58,107,152,.14); color: var(--t-move); }
.k-online { background: rgba(62,124,87,.14); color: var(--t-in); }
.k-tracking { background: rgba(107,91,152,.15); color: var(--t-adj); }
.k-other { background: var(--panel2); color: var(--ink2); }
td.overdue { color: var(--t-red); font-weight: 700; }
.lines-table input { width: 100%; height: 30px; }
.lines-table td { padding: 3px 5px; }
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.review-mail { position: sticky; top: calc(var(--hdr) + 11px); max-height: calc(100vh - var(--hdr) - 24px); overflow: auto; }
.mail-meta { display: grid; grid-template-columns: 90px 1fr; gap: 3px 10px; margin: 0 0 10px; font-size: 13px; }
.mail-meta dt { color: var(--ink2); } .mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 var(--font); background: var(--panel2);
             border: 1px solid var(--line2); border-radius: 4px; padding: 10px; margin: 0 0 10px; }
[hidden] { display: none !important; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-grid .card { margin: 0; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.pill.on { background: var(--ok-bg); color: var(--t-in); } .pill.off { background: var(--panel2); color: var(--ink2); }
.nav-count { background: var(--danger); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 17px; }
@media (max-width: 1000px) { .review, .admin-grid { grid-template-columns: minmax(0, 1fr); } .review-mail { position: static; max-height: none; } }

.hold { font-size: 11.5px; color: var(--t-out); margin-top: 2px; white-space: normal; }
.hold-list { margin: 6px 0 0; padding-left: 18px; }
.auto-rules { display: grid; gap: 10px; }
.auto-rules .check { white-space: normal; align-items: flex-start; }
.auto-rules .check input { margin-top: 2px; }
.pill { margin-left: 4px; }

/* tracker */
table.tracker th.dkt { background: var(--page); }
table.tracker tr.grp th { text-align: center; padding: 3px; font-size: 11px; }
table.tracker td.remark { max-width: 260px; white-space: normal; font-size: 12px; }
.st-open { background: rgba(62,124,87,.14); color: var(--t-in); }
.st-progress { background: rgba(217,130,43,.16); color: var(--t-out); }
.st-closed { background: var(--panel2); color: var(--ink2); }
.k-measure { background: rgba(107,91,152,.15); color: var(--t-adj); }
.k-ignore { background: var(--panel2); color: var(--ink3); }
.lines-table input { min-width: 48px; }
@media (prefers-color-scheme: dark) { table.tracker th.dkt { background: var(--accent-soft); } }
/* apartments */
.apt-table td, .apt-table th { font-size: 12.5px; padding: 4px 7px; }
.apt-table tr.unit-first td { border-top: 2px solid var(--line); }
.apt-table tbody tr:nth-child(even) td { background: transparent; }
.site-card summary { cursor: pointer; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.site-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink2); }
.site-grid textarea { width: 100%; resize: vertical; }
.site-grid input, .site-grid select { width: 100%; box-sizing: border-box; }
.apt-table td { white-space: nowrap; }

/* combined tracker */
.expander { border: 1px solid var(--line); background: var(--panel); color: var(--ink2); border-radius: 4px;
            width: 22px; height: 22px; line-height: 18px; font-size: 12px; cursor: pointer; padding: 0; }
.expander[aria-expanded="true"] { background: var(--nav); color: #fff; border-color: var(--nav); }
tr.detail-row > td { background: var(--panel2) !important; padding: 8px 10px 12px; }
tr.detail-row:hover > td { background: var(--panel2) !important; }
.site-line { font-size: 12.5px; margin-bottom: 6px; line-height: 1.6; }
.spec-table { width: auto; min-width: 60%; font-size: 12px; background: var(--panel); border: 1px solid var(--line); }
.spec-table th { position: static; font-size: 11.5px; padding: 3px 7px; }
.spec-table td { padding: 3px 7px; white-space: nowrap; }
.spec-table tbody tr:nth-child(even) td { background: var(--row-alt); }
/* admin */
.admin-link { font-size: 12.5px; color: var(--ink2); text-decoration: none; margin-right: 10px; padding: 4px 9px;
              border: 1px solid var(--line); border-radius: 14px; white-space: nowrap; }
.admin-link.on { background: var(--nav); color: #fff; border-color: var(--nav); }
.login-wrap { display: flex; justify-content: center; padding-top: 40px; }
.login-card { width: 100%; max-width: 420px; }
/* admin */
.admin-link { font-size: 12.5px; color: var(--ink2); text-decoration: none; margin-right: 10px; padding: 4px 9px;
              border: 1px solid var(--line); border-radius: 14px; white-space: nowrap; }
.admin-link.on { background: var(--nav); color: #fff; border-color: var(--nav); }
.top-right { display: flex; align-items: center; }
.login-wrap { display: flex; justify-content: center; padding-top: 40px; }
.login-card { width: 100%; max-width: 420px; }
/* dealers */
.month-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; }
.month-bars .mb { text-align: center; font-size: 11.5px; }
.month-bars .mb-bar { height: 90px; display: flex; align-items: flex-end; background: var(--panel2); border-radius: 3px; }
.month-bars .mb-bar > div { width: 100%; background: var(--t-move); border-radius: 3px 3px 0 0; min-height: 0; }
.month-bars .mb-n { font-weight: 700; margin-top: 3px; } .month-bars .mb-l { color: var(--ink3); }
/* monthly report */
table.report td, table.report th { padding: 5px 8px; }
table.report tr.grp-head td { background: var(--panel2); font-weight: 700; color: var(--brand-ink); }
table.report tr.sub td { font-weight: 700; background: var(--page); }
table.report tfoot td { font-weight: 700; background: var(--nav); color: #fff; }
table.report .this-month { background: rgba(58,107,152,.08); }
.contact-line { margin: -4px 0 12px; font-size: 13.5px; }
@media (prefers-color-scheme: dark) { table.report tr.sub td { background: var(--panel2); } }
/* memos */
.memo-card { margin-top: 16px; }
.memo-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.memo-add textarea { flex: 1; min-height: 44px; resize: vertical; }
.memo-list { list-style: none; margin: 0; padding: 0; }
.memo-list li { border-top: 1px solid var(--line2); padding: 8px 2px; }
.memo-meta { font-size: 11.5px; color: var(--ink2); margin-bottom: 2px; }
.memo-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-edit summary { font-size: 12px; cursor: pointer; margin-top: 3px; }
.memo-edit textarea { width: 100%; margin-top: 6px; }
.memo-flag { text-decoration: none; font-size: 12px; }
.memo-inline { margin-top: 8px; font-size: 12.5px; line-height: 1.6; }
.memo-card { margin: 0 0 16px; }
.memo-list { max-height: 260px; overflow-y: auto; }

.rules-form .rule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line2); }
.rules-form .rule-n { display: inline-flex; width: 22px; height: 22px; border-radius: 11px; background: var(--nav); color: #fff;
                      align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
tr.new-row td { background: var(--panel2); }
.section-title { font-size: 18px; margin: 26px 0 10px; }
.rules-form .rule-sub { padding-left: 30px; font-size: 13px; }

.check-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600;
             background: rgba(217,130,43,.16); color: var(--t-out); white-space: nowrap; }
.status-chips a.check-chip { border-color: var(--t-out); color: var(--t-out); }
.status-chips a.check-chip.active { background: var(--t-out); color: #fff; }

.cleanup-list { list-style: none; margin: 0; padding: 0; }
.cleanup-list li { padding: 6px 2px; border-top: 1px solid var(--line2); }
.cleanup-list .check { white-space: normal; align-items: flex-start; }
.btn .nav-count { margin-left: 4px; }
/* back button: clearly visible, same on every screen */
.btn.back-btn { background: var(--panel); color: var(--nav); border: 1.5px solid var(--nav); font-weight: 700;
                padding: 0 14px; gap: 4px; }
.btn.back-btn:hover { background: var(--nav); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.back-btn { color: var(--brand-ink); border-color: var(--brand-ink); }
  .btn.back-btn:hover { background: #9CC3E0; color: #14191D; } }

/* =====================================================================
   Soft-minimal refresh (layouts unchanged, only the look)
   ===================================================================== */
:root { --page: #F4F5F7; --line: #E2E6EA; --line2: #EEF1F3; --panel2: #F7F8FA; --row-alt: transparent; --row-hover: #F1F5F9;
        --radius-card: 14px; --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03); }
@media (prefers-color-scheme: dark) {
  :root { --page: #121518; --line: #2B333A; --line2: #232A30; --panel2: #1A2025; --row-alt: transparent; --row-hover: #1E2830;
          --shadow-card: none; }
}
h1 { font-size: 22px; letter-spacing: -.01em; }
.card, .portlet { border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 16px 18px; }

/* menu bar: light instead of a heavy dark band */
.topbar { border-bottom: 0; }
.menubar { background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(16,24,40,.02); }
.menubar a { color: var(--ink2); height: 44px; border-bottom-width: 2px; }
.menubar a:hover { background: var(--panel2); color: var(--ink); }
.menubar a.active { background: transparent; color: var(--nav); border-bottom-color: var(--nav); font-weight: 700; }
.menubar .sep { background: var(--line); }
@media (prefers-color-scheme: dark) { .menubar a.active { color: var(--brand-ink); border-bottom-color: var(--brand-ink); } }

/* controls */
.btn { border-radius: 9px; height: 34px; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=time], input[type=file], input[type=password], select, textarea { border-radius: 8px; height: 34px; }
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
textarea { height: auto; }
.segmented { border-radius: 9px; }
.flash, .warn-box { border-radius: 10px; }

/* tables: no spreadsheet grid, quiet header, roomier rows */
.table-wrap { border-radius: 12px; }
th { background: var(--panel); color: var(--ink3); font-weight: 600; font-size: 12px; padding: 9px 12px; }
td { padding: 8px 12px; }
th + th, td + td { border-left: 0; }
tbody tr:nth-child(even) td { background: transparent; }
.lines-table td { padding: 4px 6px; }
.apt-table td, .apt-table th { padding: 6px 9px; }

/* status / type tags as pills */
.status, .kind, .badge, .pill, .check-tag { border-radius: 999px; padding: 2px 10px; }
.status-chips a { border-radius: 999px; }

/* quick-action tiles: solid colour, no stripes */
.tile { background-image: none; border-radius: 14px; }

/* =====================================================================
   Home: bento grid
   ===================================================================== */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: 14px; }
.bt { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-card);
      min-width: 0; text-decoration: none; color: var(--ink); }
.bt-label { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 8px; }

.bt-hero { grid-column: span 4; display: flex; flex-direction: column; border: 0; }
.hero-orders { background: var(--accent-soft); color: var(--brand-ink); }
.hero-stock { background: var(--warn-bg); color: var(--t-warn); }
.bt-hero .bt-label { color: inherit; opacity: .85; }
.hero-n { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.02em; margin: 6px 0 10px; }
.hero-n small { font-size: 20px; font-weight: 600; margin-left: 4px; }
.hero-sub { font-size: 13.5px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 14px; }
.hero-chips span { background: rgba(255,255,255,.75); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; }
.bt-hero:hover { filter: brightness(.98); }
@media (prefers-color-scheme: dark) {
  .hero-orders { background: var(--accent-soft); color: var(--brand-ink); } .hero-stock { background: var(--warn-bg); color: var(--t-warn); }
  .hero-chips span { background: rgba(255,255,255,.1); }
}

.bt-actions { grid-column: span 4; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; border: 0;
              background: transparent; box-shadow: none; }
.bt-actions .tile { min-height: 96px; }

.bt-alerts { grid-column: span 4; }
.alert-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.alert-grid a { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 10px; text-decoration: none;
                color: var(--ink); background: var(--panel2); }
.alert-grid a:hover { background: var(--row-hover); }
.alert-grid b { font-size: 20px; font-weight: 700; min-width: 22px; }
.alert-grid span { font-size: 12.5px; color: var(--ink2); line-height: 1.25; }
.alert-grid .red a { background: var(--err-bg); } .alert-grid .red b { color: var(--t-red); }
.alert-grid .amber a { background: var(--warn-bg); } .alert-grid .amber b { color: var(--t-out); }
.alert-grid .calm a { background: var(--accent-soft); } .alert-grid .calm b { color: var(--t-move); }
.alert-grid .zero b { color: var(--ink3); font-weight: 500; } .alert-grid .zero span { color: var(--ink3); }
@media (prefers-color-scheme: dark) { .alert-grid .calm a { background: var(--accent-soft); } }

.bt-chart { grid-column: span 8; }
.bt-chart svg { width: 100%; height: auto; display: block; }
.bt-kpis { grid-column: span 4; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kpi-t { padding: 14px 16px; }
.kpi-t.out { background: #FBEEE3; border-color: transparent; } .kpi-t.in { background: #E6F2EA; border-color: transparent; }
@media (prefers-color-scheme: dark) { .kpi-t.out { background: #33241A; } .kpi-t.in { background: #1C2F24; } }
.kpi-n { font-size: 30px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.kpi-s { font-size: 12px; color: var(--ink2); margin-top: 4px; }

.bt-top { grid-column: span 5; } .bt-loc { grid-column: span 3; } .bt-links { grid-column: span 4; }
.bt-links .shortcuts { columns: 2; column-gap: 18px; }

@media (max-width: 1250px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bt-hero, .bt-actions { grid-column: span 3; } .bt-alerts { grid-column: span 6; }
  .alert-grid { grid-template-columns: repeat(4, 1fr); }
  .bt-chart { grid-column: span 6; } .bt-kpis { grid-column: span 6; grid-template-columns: repeat(4, 1fr); }
  .bt-top { grid-column: span 6; } .bt-loc, .bt-links { grid-column: span 3; }
}
@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr; }
  .bento > * { grid-column: 1 / -1 !important; }
  .alert-grid { grid-template-columns: 1fr 1fr; } .bt-kpis { grid-template-columns: 1fr 1fr; }
  .hero-n { font-size: 52px; } .bt-links .shortcuts { columns: 1; }
}
input[type=password] { padding: 0 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 13.5px var(--font); min-width: 0; }

/* =====================================================================
   Refresh: soft minimal (all screens) + bento home
   Same layouts and menus; lighter surfaces, rounder corners, calmer tables.
   ===================================================================== */
:root {
  --page: #F4F6F8; --line: #E1E6EB; --line2: #EDF0F3; --row-alt: transparent; --row-hover: #F2F6FA;
  --radius: 10px; --radius-lg: 14px;
  --soft-in: #E6F2EA; --soft-out: #F8EBE1; --soft-move: #E5EEF7; --soft-adj: #EEEBF7;
}
@media (prefers-color-scheme: dark) {
  :root { --page: #121619; --line: #2C353C; --line2: #242C32; --row-hover: #1E2830;
          --soft-in: #1C3326; --soft-out: #3A2819; --soft-move: #1B2D3E; --soft-adj: #2A2540; }
}

/* menu bar: light, the current screen underlined */
.topbar { border-bottom: none; }
.menubar { background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 14px; }
.menubar a { color: var(--ink2); font-weight: 500; border-bottom: 2px solid transparent; height: 44px; }
.menubar a:hover { background: var(--panel2); color: var(--ink); }
.menubar a.active { background: transparent; color: var(--nav); border-bottom-color: var(--nav); font-weight: 650; }
.menubar .sep { background: var(--line); }
@media (prefers-color-scheme: dark) { .menubar a.active { color: var(--brand-ink); border-bottom-color: var(--brand-ink); } }

/* cards and headings */
h1 { font-weight: 650; letter-spacing: -.01em; }
h3, .card-title { font-weight: 650; }
.card, .portlet { border-color: var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.flash, .warn-box { border-radius: var(--radius); }

/* controls */
.btn { border-radius: 8px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], select, textarea { border-radius: 8px; }
.segmented { border-radius: 8px; }
.status-chips a { border-radius: 999px; }

/* tables: no spreadsheet grid, more air */
th { background: var(--panel); color: var(--ink2); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line2); }
th { padding: 8px 10px; }
th + th, td + td { border-left: none; }
tbody tr:nth-child(even) td { background: transparent; }
tbody tr:hover td { background: var(--row-hover); }
.table-wrap { border-radius: var(--radius); }
table.lines-table td, .apt-table td, .spec-table td { padding: 5px 8px; }

/* status and kind labels as pills */
.status, .kind, .pill, .check-tag { border-radius: 999px; padding: 2px 10px; }

/* ---------------- bento home ---------------- */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "hero hero alerts alerts"
    "hero hero alerts alerts"
    "a1 a2 a3 a4"
    "k1 k2 k3 k4"
    "chart chart chart top"
    "loc loc links links"; }
.b-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px;
          color: var(--ink); text-decoration: none; min-width: 0; }
.b-label { font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 6px; }
.b-sub { font-size: 12.5px; color: var(--ink2); }
.b-empty { margin: 4px 0 0; }

.b-hero { grid-area: hero; display: flex; flex-direction: column; background: var(--soft-move); border-color: transparent; }
.b-hero .b-label, .b-hero .b-sub { color: var(--t-move); }
.b-hero .b-big { font-size: 64px; font-weight: 700; line-height: 1.05; color: var(--t-move); letter-spacing: -.02em; margin: 2px 0 8px; }
.b-hero .b-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 14px; }
.b-hero .b-chips span { background: var(--panel); color: var(--t-move); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; }
.b-hero:hover { filter: brightness(.98); }

.b-alerts { grid-area: alerts; }
.b-alert-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.b-alert-list a { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: 12px;
                  background: var(--panel2); color: var(--ink); text-decoration: none; }
.b-alert-list a:hover { filter: brightness(.97); }
.b-alert-list .n { font-size: 22px; font-weight: 700; min-width: 28px; }
.b-alert-list .l { font-size: 12.5px; }
.b-alert-list .red a { background: var(--err-bg); } .b-alert-list .red .n { color: var(--t-red); }
.b-alert-list .amber a { background: var(--warn-bg); } .b-alert-list .amber .n { color: var(--t-out); }
.b-alert-list .calm a { background: var(--soft-move); } .b-alert-list .calm .n { color: var(--t-move); }
.b-alert-list .zero a { background: transparent; border: 1px dashed var(--line); }
.b-alert-list .zero .n, .b-alert-list .zero .l { color: var(--ink3); }

.b-action { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; font-size: 15px; font-weight: 650;
            border-color: transparent; }
.b-action svg { width: 26px; height: 26px; }
.b-action:hover { filter: brightness(.97); transform: translateY(-1px); }
.b-action.in { background: var(--soft-in); color: var(--t-in); grid-area: a1; }
.b-action.out { background: var(--soft-out); color: var(--t-out); grid-area: a2; }
.b-action.move { background: var(--soft-move); color: var(--t-move); grid-area: a3; }
.b-action.adj { background: var(--soft-adj); color: var(--t-adj); grid-area: a4; }

.b-kpi .b-num { font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 2px; }
.b-chart { grid-area: chart; }
.b-chart svg { width: 100%; height: auto; }
.b-top { grid-area: top; }
.b-loc { grid-area: loc; }
.b-links { grid-area: links; }
.b-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.b-link-grid a { font-size: 13px; color: var(--link); text-decoration: none; padding: 4px 0; }
.b-link-grid a:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "hero hero" "alerts alerts" "a1 a2" "a3 a4" "k1 k2" "k3 k4" "chart chart" "top loc" "links links"; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr;
    grid-template-areas: "hero" "alerts" "a1" "a2" "a3" "a4" "k1" "k2" "k3" "k4" "chart" "top" "loc" "links"; }
  .b-alert-list { grid-template-columns: 1fr 1fr; }
  .b-hero .b-big { font-size: 52px; }
}

.b-hero .b-split { height: 12px; border-radius: 999px; background: var(--t-move); opacity: .9; overflow: hidden; margin-top: 14px; }
.b-hero .b-split span { display: block; height: 100%; background: #9CC3E0; }
.b-hero .b-split-legend { display: flex; gap: 14px; font-size: 12px; color: var(--t-move); margin-top: 6px; }
.b-hero .b-split-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.b-hero .b-split-legend i.o { background: #9CC3E0; } .b-hero .b-split-legend i.p { background: var(--t-move); }
.b-chart svg { max-height: 260px; }

/* ---------- document entry (inbound / outbound) ---------- */
.doc .entry-head h1 { margin: 0; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.doc-grid .field { margin: 0; }
.req { color: var(--red); }
.doc-tabs { display: flex; gap: 4px; margin: 4px 0 0 4px; }
.doc-tabs button { border: 1px solid var(--line); border-bottom: none; background: var(--panel2); color: var(--ink2); font: inherit;
                   font-size: 13.5px; font-weight: 600; padding: 8px 16px; border-radius: 10px 10px 0 0; cursor: pointer; }
.doc-tabs button.active { background: var(--panel); color: var(--ink); }
.doc-tabs button b { margin-left: 4px; color: var(--t-move); }
.doc-pane { border-top-left-radius: 0; }
.scan-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-row #scan { flex: 1; min-width: 260px; height: 40px; font-size: 15px; background: #FFFBE6; border-color: var(--warn-line); }
@media (prefers-color-scheme: dark) { .scan-row #scan { background: #2E2A18; border-color: #7A6A2A; } }
.scan-msg { font-size: 13px; color: var(--t-in); } .scan-msg.bad { color: var(--t-red); font-weight: 600; }
.doc-lines td { vertical-align: middle; }
.doc-lines input.ln-note { width: 100%; min-width: 120px; height: 30px; }
.doc-lines tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: var(--panel2); }
.doc-lines tr.over td { background: var(--err-bg) !important; }
.over-note { font-size: 11.5px; color: var(--t-red); margin-top: 2px; }
.mini-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mini-step button { width: 30px; height: 30px; border: none; background: var(--panel2); font-size: 16px; cursor: pointer; color: var(--ink); }
.mini-step input { width: 64px; height: 30px; border: none; text-align: center; font-weight: 700; border-radius: 0; }
.pick-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; margin-bottom: 8px; }
.pick-filters .field { margin: 0; }
.pick-wrap { max-height: 460px; overflow-y: auto; }
.pick-table input.pk-qty { width: 70px; height: 28px; text-align: right; }
.pick-actions { margin-top: 10px; }
.doc .btn-big { margin-top: 14px; }
.act-in .btn-big { background: var(--tile-in); } .act-out .btn-big { background: var(--tile-out); }
@media (max-width: 900px) { .doc-grid, .pick-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .doc-grid, .pick-filters { grid-template-columns: 1fr; } }
/* ---------- moves by customer / supplier ---------- */
.bp { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.bp-parties { position: sticky; top: calc(var(--hdr) + 11px); max-height: calc(100vh - var(--hdr) - 24px); overflow: auto; }
.bp-filter { width: 100%; margin-bottom: 8px; }
.bp-list { list-style: none; margin: 0; padding: 0; }
.bp-list li a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.bp-list li a b { margin-left: auto; font-size: 12px; color: var(--t-move); }
.bp-list li a:hover { background: var(--panel2); }
.bp-list li.active a { background: var(--soft-move); font-weight: 650; }
.bp-list li.none a { color: var(--ink3); }
.bp-type { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; flex-shrink: 0; }
.t-sup { background: var(--soft-in); color: var(--t-in); } .t-cus { background: var(--soft-out); color: var(--t-out); } .t-both { background: var(--soft-adj); color: var(--t-adj); }
.bp-docs { max-height: 360px; overflow-y: auto; }
.bp-docs tr.sel td { background: var(--soft-move) !important; font-weight: 600; }
.bp-main .card + .card { margin-top: 0; }
@media (max-width: 900px) { .bp { grid-template-columns: 1fr; } .bp-parties { position: static; max-height: 300px; } }

.row-actions { display: inline-flex; gap: 4px; align-items: center; }
.btn.danger-text { color: var(--t-red); }
.btn.danger-text:hover { background: var(--err-bg); }
.danger-zone { margin-top: 16px; border-color: var(--err-bg); }
/* mode banner on the entry screens: impossible to miss which way stock is moving */
.mode-banner { margin: 0 0 12px; padding: 12px 18px; border-radius: 12px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.mode-banner.mode-out { background: var(--tile-out); color: #fff; }
.mode-banner.mode-in { background: var(--tile-in); color: #fff; }
.mode-banner.no-loc { opacity: .75; }

/* outbound = pink (orange stays for 'in progress' and alerts) */
:root { --tile-out: #C2456E; --soft-out: #FBE8EF; --t-outbound: #A8365D; }
@media (prefers-color-scheme: dark) { :root { --soft-out: #3A1E2A; --t-outbound: #F0A3BF; } }
.dot.out { background: #F29BBB; }
.badge.out { background: rgba(194, 69, 110, .14); color: var(--t-outbound); }
.b-action.out { color: var(--t-outbound); }
.t-cus { color: var(--t-outbound); }
.kpi-t.out { background: #FBE8EF; }
@media (prefers-color-scheme: dark) { .kpi-t.out { background: #3A1E2A; } }
.st-outbound { background: rgba(194, 69, 110, .14); color: var(--t-outbound); }

.b-alert-list .outb a { background: var(--soft-out); } .b-alert-list .outb .n { color: var(--t-outbound); }
.b-hero.b-hero-out { background: var(--soft-out); }
.b-hero.b-hero-out .b-label, .b-hero.b-hero-out .b-sub, .b-hero.b-hero-out .b-big, .b-hero.b-hero-out .b-chips span { color: var(--t-outbound); }

/* admin home: two big tiles side by side (open orders | this month's outbound) */
.bento.bento-admin { grid-template-areas:
    "heroA heroB alerts alerts"
    "heroA heroB alerts alerts"
    "a1 a2 a3 a4"
    "k1 k2 k3 k4"
    "chart chart chart top"
    "loc loc links links"; }
.bento-admin .b-hero-a { grid-area: heroA; }
.bento-admin .b-hero-b { grid-area: heroB; }
.bento-admin .b-hero .b-big { font-size: 56px; }
@media (max-width: 1100px) {
  .bento.bento-admin { grid-template-areas: "heroA heroB" "alerts alerts" "a1 a2" "a3 a4" "k1 k2" "k3 k4" "chart chart" "top loc" "links links"; }
}
@media (max-width: 640px) {
  .bento.bento-admin { grid-template-areas: "heroA" "heroB" "alerts" "a1" "a2" "a3" "a4" "k1" "k2" "k3" "k4" "chart" "top" "loc" "links"; }
}

.fixed-party { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 8px;
               background: var(--soft-out); color: var(--t-outbound); }
.fixed-party .muted { color: var(--t-outbound); opacity: .75; font-size: 12.5px; }

.mode-banner.to-supplier { outline: 3px dashed rgba(255,255,255,.7); outline-offset: -6px; }

/* labels and short values never break onto two lines */
.badge, .status, .pill, .check-tag { white-space: nowrap; display: inline-block; }
table.moves-table td.nowrap, table td.nowrap { white-space: nowrap; }

/* ---------- moves: period buttons, view toggle, document view ---------- */
.moves-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.period-chips { margin: 0; }
.doc-view .day { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.doc-view .day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; background: var(--panel2);
                      border-bottom: 1px solid var(--line); font-size: 14px; }
.doc-view .day-sums { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.doc-view details.doc { border-top: 1px solid var(--line2); }
.doc-view details.doc:first-of-type { border-top: none; }
.doc-view details.doc > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; cursor: pointer; list-style: none; }
.doc-view details.doc > summary::-webkit-details-marker { display: none; }
.doc-view details.doc > summary::before { content: "▸"; color: var(--ink3); width: 10px; }
.doc-view details.doc[open] > summary::before { content: "▾"; }
.doc-view details.doc > summary:hover { background: var(--row-hover); }
.doc-view .doc-party { font-weight: 650; }
.doc-view .doc-no { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--ink2); }
.doc-view .doc-meta { margin-left: auto; font-size: 13px; color: var(--ink2); }
.doc-view .all-cancelled > summary { opacity: .55; text-decoration: line-through; }
.doc-view table.doc-lines-view { width: 100%; margin: 0 0 6px; }
.doc-view table.doc-lines-view td { padding: 5px 14px 5px 34px; border-bottom: none; font-size: 13px; }
.doc-view table.doc-lines-view td + td { padding-left: 10px; }
.doc-view table.doc-lines-view tr.cancelled td { opacity: .55; text-decoration: line-through; }
.doc-totals { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }

/* ---------- tracker: status in place, remark column, DKT toggle, shortcut note ---------- */
select.status-pick { appearance: none; -webkit-appearance: none; border: none; cursor: pointer; font: inherit; font-size: 12px;
                     font-weight: 600; height: auto; padding: 2px 10px; border-radius: 999px; text-align: center; }
select.status-pick:hover { filter: brightness(.95); outline: 1px solid var(--line); }
td.remark-cell { width: 240px; min-width: 240px; max-width: 240px; }
td.remark-cell .clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
                         font-size: 12.5px; line-height: 1.4; white-space: normal; }
.remark-full { margin: 2px 0 8px; font-size: 13px; white-space: pre-wrap; }
table.tracker.hide-dkt .dkt { display: none; }
table.tracker.hide-dkt tr.grp { display: none; }   /* 11/15 Aaron: the empty group row above the headers only shows with the outsource (DKT) columns */
.filter-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--soft-move); font-size: 13.5px; }

input.safety-in { width: 70px; height: 28px; text-align: right; padding: 0 6px; }
input.safety-in.ok { border-color: var(--t-in); background: var(--soft-in); }
input.safety-in.bad { border-color: var(--t-red); }

.cmp-box { margin: 8px 0; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.cmp-box.same { background: var(--soft-in); color: var(--t-in); }
.cmp-box.diff { background: var(--warn-bg); }
.cmp-box ul { margin: 6px 0 0; padding-left: 18px; }
.cmp-add { color: var(--t-in); font-weight: 600; } .cmp-miss { color: var(--t-red); font-weight: 600; }
/* item name: wide enough for names like "3.25" Square Smart Cassette for Insertable Fabric Black" on one or two lines */
th.col-name { min-width: 320px; }
table.doc-lines-view td:nth-child(2) { min-width: 320px; }

/* ---------- building page: one foldable group per unit, search ---------- */
.unit-tools { margin-top: 0; }
table.apt-table tbody.unit { border-top: 1px solid var(--line); }
table.apt-table tr.unit-head { cursor: pointer; background: var(--panel); }
table.apt-table tr.unit-head:hover td { background: var(--row-hover); }
table.apt-table tr.unit-head td { font-size: 13.5px; }
table.apt-table tbody.unit.open tr.unit-head td { background: var(--soft-move); }
table.apt-table .caret { display: inline-block; width: 12px; color: var(--ink3); }
table.apt-table tbody.unit.open .caret { transform: rotate(90deg); }
table.apt-table .unit-sum { color: var(--ink2); }
table.apt-table tr.unit-line td { font-size: 12.5px; }
table.apt-table tr.unit-line.hit td { background: rgba(255, 214, 102, .25); }

.merge-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.merge-form select { min-width: 360px; max-width: 100%; }

details.to-direct { margin-top: 12px; }
details.to-direct > summary { cursor: pointer; }

/* ---------- menu groups ---------- */
.menubar .nav-group { position: relative; display: inline-flex; }
.menubar .nav-btn { background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 10px 12px;
                    display: inline-flex; align-items: center; gap: 4px; border-bottom: 2px solid transparent; }
.menubar .nav-group.active > .nav-btn { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.menubar .caret-d { font-size: 10px; color: var(--ink3); }
.menubar .nav-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; z-index: 50; padding: 6px;
                     background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.menubar .nav-group.open .nav-menu { display: block; }
.menubar .nav-menu a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; border-bottom: none; white-space: nowrap; }
.menubar .nav-menu a:hover { background: var(--row-hover); }
.menubar .nav-menu a.active { background: var(--soft-move); font-weight: 650; }
.menubar .nav-menu .nav-menu-main { margin-top: 4px; border-top: 1px solid var(--line2); border-radius: 0 0 8px 8px; font-weight: 650; color: var(--accent); }

/* ---------- messages float so they are always seen ---------- */
.toast-wrap { position: fixed; top: calc(var(--hdr) + 12px); right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px;
              width: min(440px, calc(100vw - 40px)); margin: 0; }
.toast-wrap .flash { display: flex; align-items: flex-start; gap: 10px; margin: 0; box-shadow: 0 10px 28px rgba(0,0,0,.15);
                     animation: toast-in .2s ease-out; transition: opacity .25s, transform .25s; }
.toast-wrap .flash > span { flex: 1; }
/* 11/16 Aaron: 알림창이 투명 — 어두운 화면에서는 색이 반투명(rgba)이라 뒤 글자가 비침. 알림은 늘 불투명 바탕 위에 색을 얹는다. */
.toast-wrap .flash { background: var(--panel) !important; }
.toast-wrap .flash-success { background: linear-gradient(var(--ok-bg), var(--ok-bg)), var(--panel) !important; }
.toast-wrap .flash-error { background: linear-gradient(var(--err-bg), var(--err-bg)), var(--panel) !important; }
.toast-wrap .flash-warning { background: linear-gradient(var(--warn-bg), var(--warn-bg)), var(--panel) !important; }
.toast-wrap .flash.gone { opacity: 0; transform: translateX(20px); }
.toast-x { background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 2px; }
.toast-x:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- settings: tabs, compact cards ---------- */
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; flex-wrap: wrap; }
.settings-tabs button { background: none; border: none; font: inherit; padding: 9px 16px; cursor: pointer; color: var(--ink2);
                        border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs button.active { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.set-card { margin-bottom: 14px; max-width: 900px; }
.set-card > .muted:first-of-type { margin-top: 0; }
details.set-card > summary { cursor: pointer; list-style: none; }
details.set-card > summary::-webkit-details-marker { display: none; }
details.set-card > summary { display: flex; align-items: center; gap: 8px; margin: 0; }
details.set-card > summary::after { content: '▸'; margin-left: auto; color: var(--ink3); font-weight: 400; }
details.set-card[open] > summary { margin-bottom: 12px; }
details.set-card[open] > summary::after { content: '▾'; }
.set-form .field { max-width: 560px; }
.mail-status { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--panel2); font-size: 13.5px; }
.mail-status.bad { background: rgba(220, 60, 60, .09); color: var(--t-red); }

.doc-tools { display: flex; justify-content: flex-end; gap: 6px; margin: -4px 0 8px; }

/* ---------- '⋯ more' menu, page notes, period select ---------- */
.more-menu { position: relative; display: inline-flex; }
.more-list { display: none; position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; z-index: 60; padding: 6px;
             background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.more-menu.open .more-list { display: block; }
.more-list a { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; white-space: nowrap; font-size: 14px; }
.more-list a:hover { background: var(--row-hover); }
.more-sep { display: block; height: 1px; background: var(--line2); margin: 4px 6px; }
details.page-note { margin: -6px 0 10px; font-size: 13px; }
details.page-note > summary { cursor: pointer; color: var(--ink3); list-style: none; display: inline-flex; align-items: center; gap: 5px; }
details.page-note > summary::-webkit-details-marker { display: none; }
details.page-note > summary::before, .note-info::before { content: "i"; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 13px; height: 13px; border: 1.3px solid currentColor; border-radius: 50%; font: 700 9px/1 Georgia, "Times New Roman", serif; font-style: italic; box-sizing: border-box; }
details.page-note > p { margin: 6px 0 0; }
.period-select { height: 32px; border-radius: 999px; padding: 0 12px; font-size: 13px; }
.chip-sep { width: 1px; height: 20px; background: var(--line); display: inline-block; margin: 0 4px; }

/* ---------- side panel (quick view) ---------- */
.peek { position: fixed; top: 0; right: 0; height: 100vh; width: min(480px, 100vw); background: var(--panel); z-index: 300;
        box-shadow: -12px 0 40px rgba(0,0,0,.15); transform: translateX(105%); transition: transform .22s ease-out; display: flex; flex-direction: column; }
.peek.open { transform: none; }
.peek-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 30, .18); z-index: 290; }
.peek-close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 26px; cursor: pointer; color: var(--ink3); z-index: 2; }
.peek-body { overflow-y: auto; padding: 22px 24px 30px; }
.peek-kicker { font-size: 12px; color: var(--ink3); text-transform: uppercase; letter-spacing: .04em; }
.peek-head h2 { margin: 2px 0 8px; font-size: 20px; padding-right: 30px; }
.peek-facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 14px 0; font-size: 13.5px; }
.peek-facts dt { color: var(--ink3); } .peek-facts dd { margin: 0; }
.peek-facts .pre { white-space: pre-wrap; }
.peek h3 { font-size: 13px; color: var(--ink2); margin: 16px 0 6px; }
.peek-table { width: 100%; font-size: 13px; } .peek-table td { padding: 5px 6px; border-bottom: 1px solid var(--line2); }
.peek-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.peek-row:hover { background: var(--row-hover); }
.peek-doc { padding: 6px 0; border-bottom: 1px solid var(--line2); font-size: 13.5px; }
.peek-memo { font-size: 13px; padding: 4px 0; }
.peek-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.neg { color: var(--t-red); }
[data-peek] { cursor: pointer; }

a.peek-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--ink3); }
a.peek-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- reorder / usage ---------- */
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.ro-group { margin-bottom: 18px; }
.ro-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 2px; }
.ro-lead { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.ro-lead input { width: 64px; height: 28px; text-align: right; }
tr.ro-urgent td { background: rgba(220, 60, 60, .05); }
.usage-table td.zero { color: var(--ink3); }
.usage-table .bar-cell { width: 90px; min-width: 90px; }
.usage-table .bar { display: block; height: 8px; border-radius: 4px; background: var(--tile-out); }
.usage-table tfoot td { border-top: 2px solid var(--line); }
.status.st-urgent { background: rgba(220, 60, 60, .12); color: var(--t-red); }

/* menu lists sit over the page, never inside the (scrollable) menu bar */
.menubar .nav-menu { position: fixed; top: 0; left: 0; }
.menubar .nav-btn { height: 44px; border-bottom-width: 2px; }

/* ---------- receiving ---------- */
.rcv-table td { vertical-align: top; }
.rcv-table .small, .small { font-size: 12px; }
.rcv-table input.rcv-code { width: 190px; } .rcv-table input.rcv-per, .rcv-table input.rcv-qty { width: 80px; text-align: right; }
.rcv-table tr.miss td { background: rgba(220, 60, 60, .06); }
.rcv-table input.bad { border-color: var(--t-red); }
.warn-box.bad { background: rgba(220, 60, 60, .09); color: var(--t-red); }
.b-alert-list .blue a { background: var(--soft-move); }

.trk-table { width: 100%; margin-top: 12px; font-size: 13px; }
.trk-table td, .trk-table th { padding: 6px 8px; border-bottom: 1px solid var(--line2); text-align: left; }

.xc-table td { vertical-align: top; }
.xc-table .xc-val { font-weight: 600; } .xc-table .xc-excel { color: var(--accent); }

/* ---------- bay window cutbacks ---------- */
.cb b { font-weight: 700; }
.cb-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--panel2); color: var(--ink2); white-space: nowrap; }
.cb-tag.bad { background: rgba(220, 60, 60, .12); color: var(--t-red); }
.cb-box { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--soft-move); }
.cb-table { margin-top: 6px; font-size: 13px; } .cb-table td { padding: 3px 10px 3px 0; }

.cb-depth-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 2px; font-size: 13px; }
input.cb-in { width: 78px; height: 28px; padding: 0 6px; text-align: right; }

.danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.danger-zone form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.danger-btn { background: transparent; color: var(--t-red); border: 1px solid rgba(220, 60, 60, .45); }
.btn.danger-btn:hover { background: rgba(220, 60, 60, .08); }

input.term-unsure { border-color: var(--warn-line); background: var(--warn-bg); }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tm-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.tm-grid textarea { font: 12.5px/1.5 ui-monospace, Consolas, monospace; min-height: 180px; }

/* the remark is hard to miss */
.remark-banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #fff4c2; border: 1px solid var(--warn-line); color: var(--t-warn); font-size: 14px; white-space: pre-wrap; }
td.remark-cell.has-remark { background: #fffbe6; }
.cmp-remark { margin: 4px 0 6px; }

.crit-summary { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: rgba(220, 60, 60, .1); color: var(--t-red); font-weight: 650; }
.cmp-box li.crit, .cmp-box li.crit strong { color: var(--t-red); }

/* ---------- schedule ---------- */
.sch-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sch-head { font-size: 12px; color: var(--ink3); text-align: center; padding: 2px 0; }
.sch-day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-height: 90px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.sch-grid.week .sch-day { min-height: 360px; }
.sch-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.sch-day.other-month { opacity: .45; }
.sch-day.weekend { background: var(--panel2); }
.sch-date { font-size: 12px; font-weight: 650; color: var(--ink2); }
.sch-ev { display: block; padding: 4px 6px; border-radius: 7px; font-size: 12px; line-height: 1.3; text-decoration: none; color: var(--ink); border-left: 3px solid; background: var(--panel2); }
.sch-ev:hover { filter: brightness(.96); }
.sch-ev.done { opacity: .5; text-decoration: line-through; }
.sch-kind { font-weight: 700; font-size: 11px; }
.sch-who { font-weight: 600; } .sch-what { color: var(--ink2); }
.sch-rush { color: var(--t-red); font-weight: 700; font-size: 11px; }
.sk-pick { border-color: #16a34a; } .sk-pick .sch-kind { color: #16a34a; }
.sk-ship { border-color: #2563eb; } .sk-ship .sch-kind { color: #2563eb; }
.sk-inst { border-color: #9333ea; } .sk-inst .sch-kind { color: #9333ea; }
.sk-deli { border-color: #ea580c; } .sk-deli .sch-kind { color: #ea580c; }
.sk-out { border-color: #64748b; } .sk-out .sch-kind { color: #64748b; }
.sk-other { border-color: #a3a3a3; }
.sch-legend { margin-left: 10px; display: inline-flex; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.sch-legend .sch-ev { display: inline-block; padding: 1px 6px; }
.sch-late { margin-bottom: 12px; border-color: rgba(220, 60, 60, .35); }
.sch-late summary { cursor: pointer; color: var(--t-red); }
.sch-late-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; margin-top: 8px; }
.sch-late-list > div { display: flex; gap: 6px; align-items: center; } .sch-late-list .sch-ev { flex: 1; }
@media (max-width: 900px) { .sch-grid.week { grid-template-columns: 1fr; } .sch-grid.week .sch-head { display: none; } .sch-grid.week .sch-day { min-height: 0; } }

hr.soft { border: none; border-top: 1px solid var(--line2); margin: 14px 0 8px; }

.top-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.top-cat { height: 28px; font-size: 12px; max-width: 170px; }

/* ---------- top 20 per supplier ---------- */
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: start; }
.top-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: grid; grid-template-columns: 24px 1fr auto; grid-template-rows: auto 4px; column-gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.top-list .rank { color: var(--ink3); font-weight: 650; text-align: right; }
.top-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .cnt { white-space: nowrap; }
.top-list .bar { grid-column: 2 / 4; height: 4px; background: var(--panel2); border-radius: 2px; overflow: hidden; }
.top-list .bar i { display: block; height: 100%; background: var(--tile-out); border-radius: 2px; }

#pick-body tr.added td:first-child::after { content: " ✓"; color: var(--t-green, #16a34a); font-weight: 700; }
#pick-body tr.added { background: rgba(22, 163, 74, .06); }

.merge-find { position: relative; display: inline-block; }
#merge-q { width: 280px; }
.merge-results { position: absolute; z-index: 40; top: 100%; left: 0; min-width: 440px; max-height: 320px; overflow-y: auto; margin-top: 4px;
                 background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px; }
.merge-results a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13px; }
.merge-results a:hover { background: var(--row-hover); }
.merge-picked { display: inline-block; padding: 5px 10px; border-radius: 8px; background: var(--soft-move); font-size: 13px; }
button.linklike { border: none; background: none; cursor: pointer; font-size: 15px; color: var(--ink3); }

.dup-card { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 14px; align-items: center; margin-bottom: 10px; }
.dup-arrow { font-size: 20px; color: var(--ink3); }
.dup-tags, .dup-full { grid-column: 1 / -1; }
.dup-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.dup-tags .chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--panel2); }
.dup-tags .dup-items-all { background: var(--ok-bg); color: var(--t-ok); }
.dup-tags .dup-items-some { background: var(--warn-bg); color: var(--t-warn); }
.dup-tags .dup-items-none, .dup-tags .dup-warn { background: var(--err-bg); color: var(--t-red); }
.dup-cmp summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.dup-cmp table { margin-top: 6px; font-size: 13px; }
.dup-cmp tr.dup-diff td { background: var(--warn-bg); }
.dup-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.dup-actions .dup-sp { flex: 1; }
@media (max-width: 900px) { .dup-card { grid-template-columns: 1fr; } .dup-arrow { display: none; } }

.who-badge { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--soft-move); color: var(--ink); }
.who-badge.role-owner { background: rgba(147, 51, 234, .12); }
.who-badge.role-installer { background: rgba(22, 163, 74, .12); }
.plain-table td, .plain-table th { padding: 4px 8px 4px 0; text-align: left; }

/* ================= Sales (Airtable-style) ================= */
.sb { --sb-line: var(--line); display: flex; flex-direction: column; min-height: calc(100vh - 130px); margin: -8px -8px 0; }
.sb-tabs { display: flex; gap: 2px; align-items: flex-end; padding: 6px 8px 0; background: var(--nav); border-radius: 10px 10px 0 0; overflow-x: auto; }
.sb-tab { border: none; background: transparent; color: rgba(255,255,255,.85); padding: 8px 14px; border-radius: 8px 8px 0 0; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sb-tab:hover { background: rgba(255,255,255,.1); }
.sb-tab.on { background: var(--panel); color: var(--ink); font-weight: 650; }
.sb-tab.add { font-size: 18px; padding: 4px 12px; }
.sb-tab .caret { font-size: 10px; color: var(--ink3); }
#sb-tsel, #sb-vsel { margin: 6px; height: 34px; max-width: 70vw; }
.sb-body { display: flex; flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--sb-line); border-top: none; border-radius: 0 0 10px 10px; }
.sb-side { width: 200px; flex: 0 0 200px; border-right: 1px solid var(--sb-line); padding: 10px 8px; }
.sb-side-h { font-size: 11px; font-weight: 700; color: var(--ink3); text-transform: uppercase; margin: 2px 6px 6px; }
.sb-v { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.sb-v:hover { background: var(--row-hover); } .sb-v.on { background: var(--accent-soft); font-weight: 650; }
.sb-v .vi { color: var(--ink3); } .sb-v .vmenu { margin-left: auto; border: none; background: none; cursor: pointer; color: var(--ink3); visibility: hidden; }
.sb-v:hover .vmenu, .sb-v.on .vmenu { visibility: visible; }
.sb-addv { display: block; width: 100%; text-align: left; border: none; background: none; padding: 5px 8px; font-size: 13px; color: var(--ink2); cursor: pointer; border-radius: 6px; }
.sb-addv:hover { background: var(--row-hover); }
.sb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-toolbar { display: flex; gap: 4px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--sb-line); flex-wrap: wrap; }
.sb-tb { border: none; background: none; padding: 5px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--ink2); }
.sb-tb:hover { background: var(--row-hover); } .sb-tb.act { background: var(--accent-soft); color: var(--link); }
.sb-toolbar .sp { flex: 1; } #tb-search { height: 30px; width: 180px; }
.sb-view { flex: 1; min-height: 0; overflow: auto; position: relative; }
.sb-grid-wrap { overflow: auto; max-height: calc(100vh - 230px); }
.sb-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sb-grid th, .sb-grid td { border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 0 8px; height: 32px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--panel2); font-weight: 600; cursor: pointer; user-select: none; }
.sb-grid th.fh .ti, .opts .ti, .rml .ti { display: inline-block; min-width: 18px; color: var(--ink3); font-size: 11px; }
.sb-grid th .rs { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.sb-grid th.fh { position: sticky; }
.sb-grid .rn { position: sticky; left: 0; z-index: 2; background: var(--panel); width: 54px; min-width: 54px; text-align: right; color: var(--ink3); font-size: 12px; }
.sb-grid thead .rn { z-index: 4; background: var(--panel2); }
.sb-grid .prim { position: sticky; left: 54px; z-index: 2; background: var(--panel); border-right: 2px solid var(--line); font-weight: 600; }
.sb-grid thead .prim { z-index: 4; background: var(--panel2); }
.sb-grid tr.rw:hover td { background: var(--row-hover); }
.sb-grid td.c { cursor: default; } .sb-grid td.c.sel { box-shadow: inset 0 0 0 2px var(--link); }
.sb-grid .rn .ex { display: none; border: none; background: none; cursor: pointer; color: var(--link); font-size: 14px; }
.sb-grid tr:hover .rn .ex { display: inline; } .sb-grid tr:hover .rn .n { display: none; }
.sb-grid tr.h-medium td { height: 56px; } .sb-grid tr.h-tall td { height: 88px; white-space: normal; vertical-align: top; padding-top: 6px; }
.sb-grid .addf { width: 44px; text-align: center; font-size: 18px; color: var(--ink3); }
.sb-grid tr.addrow td { color: var(--ink3); cursor: pointer; } .sb-grid tr.addrow:hover td { background: var(--row-hover); }
.sb-grid tr.grp td { background: var(--panel2); font-weight: 600; position: sticky; left: 0; }
.sb-grid tr[class*=" c-"] td.rn { box-shadow: inset 4px 0 0 var(--rc); }
.sb-grid .num { display: block; text-align: right; font-variant-numeric: tabular-nums; }
.sb-grid .thumb { height: 24px; border-radius: 4px; margin-right: 3px; vertical-align: middle; }
.sb-foot { padding: 6px 12px; font-size: 12px; color: var(--ink3); border-top: 1px solid var(--line2); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; margin: 1px 3px 1px 0; line-height: 18px; background: var(--c-bg, #eef); color: var(--c-fg, #334); }
.chip.link { background: var(--accent-soft); color: var(--link); } .chip.file { background: var(--panel2); }
.chk.on { color: var(--t-ok); font-weight: 800; }
.c-blue { --c-bg: #cfe2ff; --c-fg: #0b3b8f; --rc: #3b82f6; } .c-cyan { --c-bg: #c9f1fb; --c-fg: #0c5566; --rc: #06b6d4; }
.c-teal { --c-bg: #c6f2e3; --c-fg: #0d5a45; --rc: #14b8a6; } .c-green { --c-bg: #d1f5d3; --c-fg: #1c5d22; --rc: #22c55e; }
.c-yellow { --c-bg: #fdf0b8; --c-fg: #6b5000; --rc: #eab308; } .c-orange { --c-bg: #fee0c2; --c-fg: #7a3a06; --rc: #f97316; }
.c-red { --c-bg: #fdd5d5; --c-fg: #841c1c; --rc: #ef4444; } .c-pink { --c-bg: #fbd3ea; --c-fg: #7d1650; --rc: #ec4899; }
.c-purple { --c-bg: #e4d7fb; --c-fg: #4c1d95; --rc: #8b5cf6; } .c-gray { --c-bg: #e5e7eb; --c-fg: #374151; --rc: #9ca3af; }
.sb-pop { position: absolute; z-index: 75; min-width: 220px; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.16); padding: 8px; }
.sb-pop.wide { max-width: 640px; }
.sb-pop input, .sb-pop select, .sb-pop textarea { width: 100%; margin-bottom: 6px; }
.sb-pop .opts { max-height: 280px; overflow-y: auto; }
.sb-pop .opt { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sb-pop .opt:hover { background: var(--row-hover); } .sb-pop .opt.on { background: rgba(37,99,235,.08); }
.sb-pop .opt input { width: auto; margin: 0; }
.sb-pop .pa, .sb-modal .pa { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.sb-pop .menu, .sb-pop .menu .mbtn { display: flex; flex-direction: column; }
.sb-pop .menu button, .sb-pop .menu .mbtn { border: none; background: none; text-align: left; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sb-pop .menu button:hover, .sb-pop .menu .mbtn:hover { background: var(--row-hover); }
.sb-pop .menu hr { border: none; border-top: 1px solid var(--line2); margin: 4px 0; }
.danger:not(.btn) { color: var(--t-red) !important; }
.sb-pop .flt .fr { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.sb-pop .flt .fr select, .sb-pop .flt .fr input { width: auto; flex: 1; margin: 0; min-width: 90px; }
.sb-pop .flt .w { width: 60px; font-size: 12px; color: var(--ink3); }
.sb-pop .files .fl { padding: 4px 0; font-size: 13px; } .sb-pop .up { display: inline-block; margin-top: 6px; cursor: pointer; }
.sb-modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.sb-modal { background: var(--panel); border-radius: 14px; padding: 18px 20px; width: 440px; max-width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.sb-modal.wide { width: 640px; } .sb-modal.rec { width: 980px; padding: 0; }
.sb-modal h3 { margin: 0 0 10px; } .sb-modal .lb { display: block; font-size: 12px; color: var(--ink3); margin: 10px 0 4px; }
.sb-modal input, .sb-modal select, .sb-modal textarea { width: 100%; }
.sb-modal .chrow { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; } .sb-modal .chrow input { flex: 1; }
.sb-modal .sw { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--rc); cursor: pointer; flex: 0 0 22px; }
.sb-modal .trow { padding: 6px 0; border-bottom: 1px solid var(--line2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .sb-modal .trow .btn { margin-left: auto; }
.rm-head { display: flex; gap: 10px; align-items: baseline; padding: 14px 18px; border-bottom: 1px solid var(--line); } .rm-head h3 { margin: 0; }
.rm-head .rm-x { margin-left: auto; font-size: 22px; }
.rm-body { display: grid; grid-template-columns: 1fr 320px; min-height: 60vh; }
.rm-fields { padding: 14px 18px; overflow-y: auto; max-height: 76vh; }
.rmf { margin-bottom: 12px; } .rml { font-size: 12px; color: var(--ink3); margin-bottom: 4px; }
.rmv { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 8px; cursor: pointer; white-space: pre-wrap; word-break: break-word; }
.rmv.editing { padding: 2px; cursor: text; } .rmv .rm-in { width: 100%; box-sizing: border-box; border: 0; outline: 0; background: transparent; font: inherit; padding: 4px 8px; }   /* 11/15: card fields edited in place */
.rm-hist > summary { cursor: pointer; list-style: none; } .rm-hist > summary::-webkit-details-marker { display: none; } .rm-hist > summary h4 { display: inline; } .rm-hist > summary::before { content: '▸ '; color: var(--ink3); } .rm-hist[open] > summary::before { content: '▾ '; }
.rmv:hover { border-color: var(--line); background: var(--row-hover); }
.rmv .thumb { height: 60px; border-radius: 6px; margin: 2px; }
.rm-side { background: var(--panel2); border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; max-height: 76vh; }
.rm-side h4 { margin: 4px 0 8px; } .rm-side textarea { width: 100%; } .rm-side .btn { margin: 6px 0 14px; }
.cmt, .hi { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.sb-kanban { display: flex; gap: 10px; padding: 10px; align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 260px; background: var(--panel2); border-radius: 10px; padding: 8px; max-height: calc(100vh - 240px); overflow-y: auto; }
.kh { margin: 2px 4px 8px; font-size: 13px; }
.kadd { width: 100%; border: none; background: none; color: var(--ink3); cursor: pointer; padding: 6px; border-radius: 6px; } .kadd:hover { background: var(--row-hover); }
.sb-card { background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.sb-card:hover { border-color: var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.sb-card[class*=" c-"] { border-left: 4px solid var(--rc); }
.sb-card .ct { font-weight: 650; margin-bottom: 4px; } .sb-card .cf { margin-top: 3px; } .sb-card .cl { display: block; font-size: 11px; color: var(--ink3); }
.sb-card .cov { height: 140px; background: var(--panel2); border-radius: 8px; margin: -4px -4px 8px; overflow: hidden; }
.sb-card .cov img { width: 100%; height: 100%; object-fit: cover; }
.sb-card.add { color: var(--ink3); text-align: center; background: none; border-style: dashed; width: 100%; }
.sb-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 12px; }
.sb-list { padding: 8px; }
@media (max-width: 760px) {
  .sb { margin: -8px -10px 0; } .sb-side { width: auto; flex: none; border-right: none; padding: 0; }
  .sb-body { flex-direction: column; } .sb-toolbar .sb-tb:not(#tb-filter):not(#tb-sort) { display: none; }
  #tb-search { width: 120px; } .sb-modal.rec { width: 100%; } .rm-body { grid-template-columns: 1fr; } .rm-side { border-left: none; border-top: 1px solid var(--line); }
  .sb-modal-back { padding: 0; } .sb-modal { border-radius: 0; min-height: 100vh; }
}

.sb .sch-box { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }

/* ---------- schedule board ---------- */
.bd-tools select { height: 36px; }
.bd-ev { display: block; width: 100%; text-align: left; border: none; border-left: 3px solid var(--kc, #a3a3a3); background: var(--panel2);
         border-radius: 7px; padding: 4px 6px; margin: 0; font: inherit; font-size: 12px; line-height: 1.35; color: var(--ink); cursor: pointer; text-decoration: none; }
.bd-ev:hover { filter: brightness(.96); }
.bd-ev.done { opacity: .5; text-decoration: line-through; }
.bd-ev .bd-kind { font-weight: 700; font-size: 11px; color: var(--kc, #737373); }
.bd-ev .bd-time { font-size: 11px; color: var(--ink2); }
.bd-ev .bd-title { display: block; font-weight: 600; }
.bd-ev .bd-st { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--line2); margin-right: 4px; }
.bd-ev .bd-src { font-size: 11px; color: var(--ink3); }
.bd-ev .bd-chg { font-size: 10px; font-weight: 700; color: var(--t-warn); background: var(--warn-bg); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.k-measure { --kc: #0891b2; } .k-install { --kc: #9333ea; } .k-deliver { --kc: #ea580c; } .k-ship { --kc: #2563eb; }
.k-pickup { --kc: #16a34a; } .k-service { --kc: #db2777; } .k-out { --kc: #64748b; } .k-other { --kc: #a3a3a3; }
.bd-ev.tcol { --kc: var(--tc); }
:root { --tc-0: #2563eb; --tc-1: #9333ea; --tc-2: #16a34a; --tc-3: #ea580c; --tc-4: #db2777; --tc-5: #0891b2; --tc-6: #ca8a04; --tc-7: #64748b; }
.bd-legend { margin-left: 10px; display: inline-flex; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.bd-legend .bd-ev { display: inline-block; width: auto; padding: 1px 6px; cursor: default; }
.sch-day .bd-ev { margin-bottom: 4px; }
.bd-list { display: grid; gap: 10px; }
.bd-day { padding: 12px 14px; } .bd-day.today { border-color: var(--accent); }
.bd-dayhead { font-weight: 650; margin-bottom: 6px; }
.bd-day .bd-ev { margin-bottom: 6px; font-size: 14px; padding: 8px 10px; }
.bd-late-row { display: flex; gap: 8px; align-items: center; } .bd-late-row .bd-ev { flex: 1; }
.bd-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bd-back[hidden] { display: none; }
.bd-card { width: min(460px, 100%); max-height: 90vh; overflow-y: auto; }
.bd-cardhead { display: flex; align-items: center; gap: 8px; } .bd-cardhead #bd-x { margin-left: auto; font-size: 22px; }
.bd-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.bd-edit { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
.bd-edit label { display: flex; flex-direction: column; font-size: 12px; color: var(--ink2); gap: 3px; }
.bd-chgline { margin-top: 8px; font-size: 12px; color: var(--t-warn); }
@media (max-width: 700px) { .bd-tools { gap: 6px; } .bd-tools .btn { padding: 6px 10px; } }
/* ---------- Boss home ---------- */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.boss-ev { margin-bottom: 6px; font-size: 14px; padding: 8px 10px; }
.stage-row { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.stage-name { font-weight: 600; margin-bottom: 4px; }
.stage-chips .chip { text-decoration: none; } .stage-chips .chip.zero { opacity: .45; }
.bd-cardhead .bd-ev { display: inline-block; width: auto; cursor: default; }

/* ================= Sales: as close to Airtable as possible ================= */
.sb .sb-tabs { background: #f3e8fb !important; border-bottom: 1px solid #e3d3f0; padding: 6px 8px 0 !important; gap: 0 !important; border-radius: 10px 10px 0 0; display: flex; align-items: flex-end; overflow-x: auto; }
.sb .sb-tab { background: transparent !important; color: var(--ink) !important; border: none !important; border-radius: 6px 6px 0 0 !important;
              padding: 7px 12px !important; font-size: 13px !important; font-weight: 500 !important; white-space: nowrap; position: relative; box-shadow: none !important; }
.sb .sb-tab:not(.on):not(.add):not(.more)::after { content: ""; position: absolute; right: 0; top: 9px; bottom: 9px; width: 1px; background: #d6c3e6; }
.sb .sb-tab:hover:not(.on) { background: rgba(0,0,0,.05) !important; }
.sb .sb-tab.on { background: var(--panel) !important; font-weight: 650 !important; box-shadow: 0 -1px 0 #e3d3f0, 1px 0 0 #e3d3f0, -1px 0 0 #e3d3f0 !important; }
.sb .sb-tab.add, .sb .sb-tab.more { color: var(--ink2) !important; font-weight: 400 !important; padding: 7px 10px !important; }
.sb #sb-tsel { background: var(--panel); border: 1px solid #e3d3f0; }
/* grid */
.sb .sb-grid th.rn, .sb .sb-grid td.rn { position: relative; width: 64px; min-width: 64px; }
.sb .sb-grid td.rn .rsel { display: none; margin: 0; vertical-align: middle; }
.sb .sb-grid tr.rw:hover td.rn .n, .sb .sb-grid tr.rw.picked td.rn .n { display: none; }
.sb .sb-grid tr.rw:hover td.rn .rsel, .sb .sb-grid tr.rw.picked td.rn .rsel { display: inline-block; }
.sb .sb-grid tr.rw.picked td { background: var(--accent-soft); }
.sb .sb-grid #sel-all { margin: 0; }
.sb .sb-grid tr.gsp td { height: 14px; background: var(--panel2); border: none !important; padding: 0; }
.sb .sb-grid tr.grp td { background: var(--panel2); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 6px 10px; cursor: pointer; }
.sb .sb-grid tr.grp .gchev { display: inline-block; width: 18px; color: var(--ink2); font-size: 12px; vertical-align: middle; }
.sb .sb-grid tr.grp .gbox { display: inline-flex; flex-direction: column; vertical-align: middle; gap: 2px; }
.sb .sb-grid tr.grp .gl { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); font-weight: 600; }
.sb .sb-grid tr.grp .gv .chip { font-size: 13px; padding: 2px 10px; }
.sb .sb-grid tr.grp .gc { margin-left: 10px; color: var(--ink2); font-size: 12px; vertical-align: middle; }
.sb .sb-grid tr.gadd td { height: 30px; color: var(--ink3); cursor: pointer; border-bottom: 1px solid var(--line2); }
.sb .sb-grid tr.gadd td.rn { text-align: center; font-size: 16px; }
.sb .sb-grid tr.gadd:hover td { background: var(--panel2); }
.sb .sb-bulk { position: sticky; bottom: 10px; margin: 8px auto 0; width: max-content; display: flex; gap: 8px; align-items: center; padding: 8px 12px;
               background: var(--nav); color: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 13px; }
.sb .sb-bulk button { background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
.sb .sb-bulk button.danger { background: var(--danger); }
/* panels (sort / hide / pickers) */
.sb .sb-pop .pp-h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 8px; gap: 12px; }
.sb .sb-pop .pp-h .linklike { font-weight: 400; font-size: 12px; }
.sb .sb-pop .pp-q { width: 100%; box-sizing: border-box; border: none; border-bottom: 1px solid var(--line2); border-radius: 0; padding: 6px 4px; margin-bottom: 6px; outline: none; font-size: 13px; }
.sb .sb-pop .fl { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; }
.sb .sb-pop .fl-i { display: flex; gap: 8px; align-items: center; text-align: left; border: none; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.sb .sb-pop .fl-i:hover, .sb .sb-pop .fl-i.on { background: var(--page); }
.sb .sb-pop .fl-i[hidden], .sb .sb-pop .hrow[hidden] { display: none; }
.sb .sb-pop .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.sb .sb-pop .seg button { border: none; background: var(--panel); padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.sb .sb-pop .seg button.on { background: var(--accent-solid); color: #fff; }
.sb .sb-pop .hl { max-height: 380px; overflow-y: auto; }
.sb .sb-pop .hrow { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; font-size: 13px; }
.sb .sb-pop .hrow:hover { background: var(--panel2); }
.sb .sb-pop .hrow.dragging { opacity: .4; }
.sb .sb-pop .hrow .hn { flex: 1; }
.sb .sb-pop .hrow .grip { color: var(--ink3); cursor: grab; letter-spacing: -2px; }
.sb .sb-pop .tg { position: relative; display: inline-block; width: 26px; height: 15px; flex: 0 0 auto; }
.sb .sb-pop .tg input { opacity: 0; width: 0; height: 0; position: absolute; }
.sb .sb-pop .tgs { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; cursor: pointer; }
.sb .sb-pop .tgs::before { content: ""; position: absolute; width: 11px; height: 11px; left: 2px; top: 2px; background: var(--panel); border-radius: 50%; transition: .15s; }
.sb .sb-pop .tg input:checked + .tgs { background: var(--accent-solid); }
.sb .sb-pop .tg input:checked + .tgs::before { transform: translateX(11px); }
.sb .sb-pop .pa2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sb .sb-pop .btn.sm { padding: 6px 8px; font-size: 12px; }

/* Airtable-style icons, type picker, new-table menu */
.sb svg.ico { vertical-align: -3px; color: var(--ink2); flex: 0 0 auto; }
.sb .ti { display: inline-flex; align-items: center; margin-right: 6px; color: var(--ink2); }
.sb .sb-grid th .ti svg.ico { color: var(--ink2); }
.sb .tp-q { margin-bottom: 8px; background: var(--panel2); border-radius: 8px !important; border: none !important; padding: 9px 12px !important; }
.sb .tp-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.sb .tp-i { display: flex; align-items: center; gap: 4px; border: none; background: none; text-align: left; padding: 7px 10px; border-radius: 7px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.sb .tp-i:hover, .sb .tp-i.on { background: var(--page); }
.sb .tp-i[hidden] { display: none; }
.sb .tp-cur { display: flex; align-items: center; gap: 4px; width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; font: inherit; cursor: pointer; text-align: left; }
.sb .tp-cur .muted { margin-left: auto; }
.sb .stars { color: #f5a623; letter-spacing: 1px; }
.sb .tm-h { font-size: 12px; color: var(--ink2); margin: 6px 8px 4px; }
.sb .sb-pop label.fl-i { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sb .sb-pop label.fl-i:hover { background: var(--page); }

.sb .sb-grid td.rn .rgrip { display: none; position: absolute; left: 2px; top: 50%; transform: translateY(-50%); color: var(--ink3); cursor: grab; letter-spacing: -2px; font-size: 12px; }
.sb .sb-grid tr.rw:hover td.rn .rgrip { display: inline-block; }
.sb .sb-grid tr.rw.rdragging td { opacity: .45; background: var(--accent-soft); }

/* row grip: wider, easy to grab */
.sb .sb-grid td.rn .rgrip { left: 0; top: 0; bottom: 0; transform: none; width: 22px; display: none; align-items: center; justify-content: center;
                            color: var(--ink3); cursor: grab; border-radius: 4px; letter-spacing: 0; }
.sb .sb-grid tr.rw:hover td.rn .rgrip { display: flex; }
.sb .sb-grid td.rn .rgrip:hover { background: var(--line2); color: var(--brand-ink); }
.sb .sb-grid td.rn .rgrip:active { cursor: grabbing; }
.sb .sb-grid td.rn { padding-left: 24px; }
/* table tabs: in the program's own blue-gray, navy text */
.sb .sb-tabs { background: var(--line2) !important; border-bottom: 1px solid var(--line) !important; }
.sb .sb-tab { color: var(--brand-ink) !important; }
.sb .sb-tab:not(.on):not(.add):not(.more)::after { background: #c6d3e2 !important; }
.sb .sb-tab:hover:not(.on) { background: rgba(31,78,121,.07) !important; }
.sb .sb-tab.on { background: var(--panel) !important; color: var(--brand-ink) !important; box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line) !important; }
.sb .sb-tab.on .caret { color: var(--brand-ink); }
.sb .sb-tab.add, .sb .sb-tab.more { color: var(--link) !important; }
.sb #sb-tsel { border-color: var(--line); }

/* search: a magnifier that opens the box */
.sb .tb-sbox { display: inline-flex; align-items: center; gap: 4px; }
.sb .tb-sbtn { border: none; background: none; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--ink2); display: inline-flex; }
.sb .tb-sbtn:hover { background: var(--page); }
.sb .tb-sbtn svg.ico { width: 17px; height: 17px; color: var(--ink2); }
.sb .tb-sbox #tb-search { width: 0; padding: 0; border: none; opacity: 0; transition: width .15s, opacity .15s; }
.sb .tb-sbox.open #tb-search { width: 200px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; opacity: 1; }

.bd-q { width: 100%; box-sizing: border-box; margin: 10px 0 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.bd-res { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.bd-ri { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; text-align: left; border: none; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.bd-ri:hover { background: var(--row-hover); } .bd-ri.new { color: var(--accent); }
.bd-cur { margin-left: auto; }
.bd-lab { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.bd-lab.sales { background: #e0ecff; color: #1d4ed8; } .bd-lab.order { background: #fde8d7; color: #b45309; } .bd-lab.new { background: #ede9fe; color: #6d28d9; }
.bd-picked { margin: 10px 0; padding: 8px 10px; background: var(--panel2); border-radius: 8px; }
.bd-edit input, .bd-edit select { min-width: 140px; }

.sb .fmenu { min-width: 230px; }
.sb .fmenu button { display: flex; align-items: center; gap: 10px; width: 100%; }
.sb .fmenu button svg.ico { color: var(--ink2); }
.sb .fmenu button.danger, .sb .fmenu button.danger svg.ico { color: var(--t-red); }
.sb .fmenu hr { margin: 4px 0; border: none; border-top: 1px solid var(--line2); }
.sb .fdesc { margin-left: 4px; color: var(--ink3); font-size: 12px; cursor: help; }

.sb .sb-grid .drop-l { box-shadow: inset 3px 0 0 var(--link); }
.sb .sb-grid .drop-r { box-shadow: inset -3px 0 0 var(--link); }

.bd-line { display: flex; gap: 6px; align-items: stretch; margin-bottom: 6px; }
.bd-line .bd-ev { flex: 1; margin-bottom: 0 !important; }
.bd-done { flex: 0 0 auto; width: 48px; border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--t-ok); border-radius: 8px; font-size: 18px; font-weight: 700; cursor: pointer; }
.bd-done:hover { background: var(--ok-bg); }
.bd-donebar { margin-top: 12px; }
.bd-bigdone { width: 100%; padding: 12px; font-size: 16px; background: var(--ok); border-color: var(--t-ok); }

/* opened from the home-screen icon (app mode): keep clear of the phone's notch / status bar */
@media (display-mode: standalone) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* phone: menu words stay on one line; lists become cards; button rows wrap */
.menubar a, .menubar .nav-btn { white-space: nowrap; }
@media (max-width: 760px) {
  table.mcards, table.mcards tbody { display: block; width: 100%; }
  table.mcards thead { display: none; }
  table.mcards tr { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; background: var(--panel); }
  table.mcards td { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; border: none !important; padding: 3px 0 !important;
                    white-space: normal !important; text-align: right; }
  table.mcards td[data-label]::before { content: attr(data-label); color: var(--ink3); font-size: 12px; text-align: left; flex: 0 0 auto; }
  table.mcards td:not([data-label]) { justify-content: flex-end; gap: 6px; flex-wrap: wrap; padding-top: 8px !important; }
  table.mcards td .hold { text-align: right; }
  .pick-actions, .doc-pane .toolbar, .doc-pane .btn-row { flex-wrap: wrap; }
  .doc-pane .btn { white-space: normal; }
  #pick-add { width: 100%; }
}
.inbox-others { margin-top: 12px; }
.inbox-others summary { cursor: pointer; }
@media (max-width: 760px) { .pick-actions > span { flex-wrap: wrap; margin-left: 0 !important; width: 100%; } .pick-actions > span .btn { flex: 1 1 45%; } }

.ro-mark { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px; background: var(--page); color: var(--ink2); font-size: 12px; font-weight: 600; }
.ro-form { opacity: .6; }
.home-io { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.home-io a { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 12px; border-radius: 14px; font-size: 20px; font-weight: 700; text-decoration: none; }
.home-io a.in { background: #e7f6ee; color: #166534; border: 1px solid #bfe6cf; }
.home-io a.out { background: #fdebf0; color: #9f1239; border: 1px solid #f6c6d4; }
.home-io a.small { font-size: 15px; padding: 12px; background: var(--panel); color: var(--ink2); border: 1px solid var(--line); }
.home-io a:hover { filter: brightness(.97); }

.perm-first { display: flex; gap: 14px; flex-wrap: wrap; }
.perm-first label { display: flex; gap: 6px; align-items: center; }
/* sales: view only */
body[data-ro="1"] .sb #sb-addr, body[data-ro="1"] .sb #sb-addf, body[data-ro="1"] .sb #sb-addt, body[data-ro="1"] .sb .gadd,
body[data-ro="1"] .sb .rsel, body[data-ro="1"] .sb #sel-all, body[data-ro="1"] .sb .rgrip, body[data-ro="1"] .sb .sb-bulk { display: none !important; }

/* home alerts: number and label centered on each other (was baseline, which sat the label low) */
.b-alert-list a { align-items: center; }
.b-alert-list .n { line-height: 1; }
.b-alert-list .l { line-height: 1.3; }

/* ---------- 메뉴 권한 표 (설정 → 관리자) ---------- */
.perm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 12px; font-size: 12.5px; color: var(--ink2); }
.perm-legend .i { display: inline-flex; align-items: center; gap: 6px; }
.perm-legend .k { flex-basis: 100%; }
.perm-legend .pchip { width: auto; height: 24px; padding: 0 10px; pointer-events: none; }
.perm-wrap { border: 1px solid var(--line); border-radius: 12px; }
.perm-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.perm-table col.c { width: 112px; }
.perm-table th { position: sticky; top: var(--hdr); z-index: 2; background: var(--panel); color: var(--ink3); font-weight: 600; font-size: 12px;
  padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); border-left: 0; white-space: normal; word-break: keep-all; line-height: 1.25; }
.perm-table th:first-child { text-align: left; padding-left: 14px; border-top-left-radius: 12px; }
.perm-table th:last-child { border-top-right-radius: 12px; }
.perm-table td { padding: 4px 8px; border-bottom: 1px solid var(--line2); border-left: 0; vertical-align: middle; text-align: center; }
.perm-table tr:last-child td { border-bottom: 0; }
.perm-table td.perm-n { text-align: left; padding-left: 26px; word-break: keep-all; line-height: 1.3; }
.perm-table tr.perm-g td { background: var(--panel2); font-weight: 700; font-size: 12.5px; text-align: left; padding: 6px 14px; }
.pchip { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 30px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink2); font-size: 13px; line-height: 1; white-space: nowrap; }
.pchip .pa { position: absolute; right: 9px; top: 50%; width: 10px; height: 10px; margin-top: -5px; opacity: .6; }
.pchip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 14px; border: 0; margin: 0; padding: 0; border-radius: 8px; }
.pchip:hover { filter: brightness(.97); }
.pchip:focus-within { box-shadow: var(--focus); }
.pchip.lv-edit { background: #e7f6ee; color: #166534; border-color: #bfe6cf; font-weight: 600; }
.pchip.lv-view { background: #e8f0fe; color: #1d4ed8; border-color: #c7d7fb; font-weight: 600; }
.pchip.lv-hide { background: var(--panel); color: var(--ink3); }
.pchip.fixed { background: var(--panel2); color: var(--ink3); border-style: dashed; gap: 5px; padding: 0 10px; }
.pchip.fixed svg { width: 13px; height: 13px; flex: none; }
.pchip.fixed .ft { font-weight: 400; }
@media (prefers-color-scheme: dark) {
  .pchip.lv-edit { background: #1f3527; color: #7bc79a; border-color: #2f5a3e; }
  .pchip.lv-view { background: #1c2b44; color: #93b7f5; border-color: #2d4670; }
}
@media (max-width: 600px) {
  .perm-table col.c { width: 68px; }
  .perm-table td { padding: 4px 3px; } .perm-table th { padding: 9px 3px; }
  .perm-table td.perm-n { padding-left: 12px; font-size: 12.5px; }
  .pchip { padding: 0 4px; font-size: 12px; } .pchip .pa { display: none; } .pchip.fixed { padding: 0 4px; }
}
@media (max-width: 440px) {
  .perm-table col.c { width: 54px; }
  .perm-table td.perm-n { padding-left: 8px; font-size: 12px; } .perm-table tr.perm-g td { padding-left: 8px; }
  .pchip { font-size: 11.5px; height: 28px; } .pchip.fixed .ft { display: none; }
}

/* inbox review: 'always ignore this sender' set apart from the other buttons, quiet so it isn't hit by mistake */
.form-actions .ignore-sender-wrap { margin-left: auto; padding-left: 24px; }
.btn-ignore-sender { background: none; border: 0; padding: 6px 2px; color: var(--ink3); font: inherit; font-size: 12.5px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-ignore-sender:hover { color: var(--t-red); }
.ignore-undo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ignore-sender-warn { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--err-bg); color: var(--t-red);
  font-size: 12.5px; font-weight: 600; text-align: right; }
.ignore-sender-warn div { font-weight: 400; }

/* ---------- top bar stays on screen (logo + search + menu) ----------
   computer / tablet: both rows stay at the top while scrolling.
   phone (narrow): the search row scrolls away, only the menu row stays, to keep the screen free. */
:root { --hdr: 101px; }
html { scroll-padding-top: calc(var(--hdr) + 8px); }
.topbar { position: sticky; top: 0; z-index: 21; }
.menubar { top: 56px; }
@media (max-width: 700px) {
  :root { --hdr: 45px; }
  .topbar { position: static; }
  .menubar { top: 0; }
}

/* ---------- sales grid: type right in the cell (like Airtable) ---------- */
.sb-grid td.c.editing { overflow: visible; z-index: 5; }
.sb-grid td.c.editing:not(.prim) { position: relative; }
.sb-grid td.c .sb-ined { position: absolute; left: -1px; top: -1px; width: calc(100% + 2px); height: calc(100% + 2px); min-width: 0; margin: 0;
  padding: 0 8px; border: 2px solid var(--link); border-radius: 0; background: var(--panel); color: var(--ink); font: inherit; font-size: 13px;
  outline: none; box-shadow: 0 6px 18px rgba(0,0,0,.14); z-index: 6; }
.sb-grid td.c textarea.sb-ined { height: auto; min-height: 150px; width: max(100%, 340px); padding: 6px 8px; line-height: 1.45;
  white-space: pre-wrap; resize: vertical; }
.sb-grid-wrap.inedit { padding-bottom: 160px; }
.update-problem code { display: block; margin-top: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }

/* ---------- row number cell: grip · checkbox · expand in fixed slots, one line, nothing moves on hover ---------- */
.sb .sb-grid th.rn, .sb .sb-grid td.rn { position: sticky; left: 0; width: 76px; min-width: 76px; max-width: 76px; padding: 0; }
.sb .sb-grid .prim { left: 76px; }
.sb .sb-grid td.rn .rgrip, .sb .sb-grid td.rn .rsel, .sb .sb-grid td.rn .ex, .sb .sb-grid td.rn .n,
.sb .sb-grid th.rn #sel-all { position: absolute; top: 50%; transform: translateY(-50%); margin: 0; }
.sb .sb-grid td.rn .rgrip { left: 2px; bottom: auto; height: 24px; width: 20px; }
.sb .sb-grid td.rn .rsel, .sb .sb-grid th.rn #sel-all { left: 26px; width: 14px; height: 14px; }
.sb .sb-grid td.rn .ex { left: 46px; width: 24px; height: 24px; padding: 0; border-radius: 5px; align-items: center; justify-content: center; line-height: 0; }
.sb .sb-grid td.rn .ex svg { display: block; }
.sb .sb-grid td.rn .ex:hover { background: var(--line2); }
.sb .sb-grid td.rn .n { right: 10px; line-height: 1; }
.sb .sb-grid tr.rw:hover td.rn .ex { display: flex; }

/* ---------- home: monthly in/out chart fills the card ---------- */
.mchart { display: flex; gap: 8px; height: 230px; padding: 18px 4px 0 0; }
.mchart .mc-y { position: relative; width: 44px; flex: 0 0 44px; margin-bottom: 26px; }
.mchart .mc-y span { position: absolute; right: 0; transform: translateY(50%); font-size: 11px; color: var(--ink2); }
.mchart .mc-plot { position: relative; flex: 1; display: flex; min-width: 0; margin-bottom: 26px; }
.mchart .mc-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line2); }
.mchart .mc-m { position: relative; flex: 1; min-width: 0; }
.mchart .mc-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.mchart .mc-bar { position: relative; width: min(34px, 30%); min-height: 0; border-radius: 4px 4px 2px 2px; }
.mchart .mc-bar.in { background: var(--tile-in); } .mchart .mc-bar.out { background: var(--tile-out); }
.mchart .mc-bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px;
  font-size: 11px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.mchart .mc-x { position: absolute; top: 100%; left: 0; right: 0; padding-top: 8px; text-align: center; font-size: 12px; color: var(--ink2); }
@media (max-width: 640px) {
  .mchart { gap: 4px; }
  .mchart .mc-y { width: 32px; flex-basis: 32px; }
  .mchart .mc-y span { font-size: 10px; }
  .mchart .mc-bars { gap: 2px; }
  .mchart .mc-bar { width: 42%; }
  .mchart .mc-bar b { font-size: 9px; letter-spacing: -.3px; }
}

/* ---------- sales: Create new menu, find a view, sections ---------- */
.sb-create { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: var(--panel2); border-radius: 8px; padding: 8px 10px;
  font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left; }
.sb-create:hover { background: var(--row-hover); } .sb-create .pl { font-size: 17px; line-height: 1; color: var(--ink2); }
.sb-vfind { display: flex; align-items: center; gap: 6px; margin: 6px 0 8px; padding: 0 8px; color: var(--ink3); }
.sb-vfind input { border: none; background: none; height: 30px; padding: 0; font-size: 13px; width: 100%; outline: none; box-shadow: none; color: var(--ink); }
.sb-vlist .sb-v { gap: 8px; } .sb-vlist .sb-v .vn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-vlist .sb-v.in-sec { padding-left: 22px; }
.sb-vico, .vico { flex: 0 0 auto; }
.sb-sec { display: flex; align-items: center; gap: 6px; padding: 7px 8px 5px; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink2); cursor: pointer; border-radius: 6px; }
.sb-sec:hover { background: var(--row-hover); } .sb-sec .sn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-sec .chev { font-size: 10px; transition: transform .12s; } .sb-sec.closed .chev { transform: rotate(-90deg); }
.sb-sec .vmenu { border: none; background: none; cursor: pointer; color: var(--ink3); visibility: hidden; } .sb-sec:hover .vmenu { visibility: visible; }
.sb-v.drop-t, .sb-sec.drop-t { box-shadow: inset 0 2px 0 var(--link); } .sb-v.drop-b, .sb-sec.drop-b { box-shadow: inset 0 -2px 0 var(--link); }
.cn-menu { display: flex; flex-direction: column; min-width: 210px; }
.cn-menu .cn-i { display: flex; align-items: center; gap: 10px; border: none; background: none; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left; }
.cn-menu .cn-i:hover { background: var(--row-hover); } .cn-menu hr { border: none; border-top: 1px solid var(--line2); margin: 5px 6px; width: auto; }

/* ---------- sales: calendar ---------- */
.sb-cal { padding: 10px 12px 16px; }
.cal-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; } .cal-h .cal-t { font-size: 16px; margin-left: 8px; } .cal-h .cal-nd { margin-left: auto; }
.cal-g { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-wk, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wk span { padding: 6px 8px; font-size: 12px; color: var(--ink3); background: var(--panel2); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 104px; padding: 4px 4px 6px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); min-width: 0; }
.cal-row .cal-d:nth-child(7) { border-right: none; } .cal-row:last-child .cal-d { border-bottom: none; }
.cal-d.out { background: var(--panel2); } .cal-d.out .cal-n { color: var(--ink3); }
.cal-d.drop-on { background: rgba(37,99,235,.08); }
.cal-n { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink2); padding: 0 2px 3px; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--link); }
.cal-add { border: none; background: none; color: var(--ink3); cursor: pointer; font-size: 15px; line-height: 1; visibility: hidden; padding: 0 2px; }
.cal-d:hover .cal-add { visibility: visible; }
.cal-ev { font-size: 12px; line-height: 1.3; padding: 3px 6px; margin-top: 3px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line2);
  border-left: 3px solid #2d7ff9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev[class*=" c-"] { border-left-color: var(--rc); } .cal-ev:hover { box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.cal-ev .tm { color: var(--ink3); margin-right: 4px; }
.cal-d.today .cal-n { color: var(--link); font-weight: 700; }
@media (max-width: 760px) { .cal-d { min-height: 70px; padding: 2px; } .cal-ev { font-size: 10.5px; padding: 2px 3px; } .cal-wk span { padding: 4px; } .sb-cal { padding: 6px 0; } }

/* ---------- sales: timeline / gantt ---------- */
.tl-nav { display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
.sb-tl { overflow: auto; max-height: calc(100vh - 290px); border-top: 1px solid var(--line2); position: relative; }
.tl-r { display: flex; min-height: 34px; border-bottom: 1px solid var(--line2); width: max-content; min-width: 100%; }
.tl-l { position: sticky; left: 0; z-index: 3; flex: 0 0 auto; display: flex; align-items: center; gap: 0; background: var(--panel); border-right: 2px solid var(--line); font-size: 13px; }
.tl-l .tl-name { flex: 0 0 220px; width: 220px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; cursor: pointer; }
.tl-l .tl-c { flex: 0 0 130px; width: 130px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 1px solid var(--line2); align-self: stretch; display: flex; align-items: center; }
.tl-track { position: relative; flex: 0 0 auto; }
.tl-head { position: sticky; top: 0; z-index: 5; background: var(--panel2); min-height: 48px; }
.tl-head .tl-l { background: var(--panel2); color: var(--ink3); font-weight: 600; font-size: 12px; z-index: 6; }
.tl-head .tl-l .tl-name { cursor: default; }
.tl-mh, .tl-dh { position: relative; height: 24px; } .tl-mh span, .tl-dh span { position: absolute; top: 0; height: 24px; line-height: 24px; font-size: 11.5px; color: var(--ink2); padding-left: 4px; border-left: 1px solid var(--line2); overflow: hidden; white-space: nowrap; }
.tl-mh span { font-weight: 650; color: var(--ink); } .tl-dh span.we { background: rgba(0,0,0,.03); } .tl-dh span i { font-style: normal; color: var(--ink3); margin-left: 3px; font-size: 10px; }
.tl-g .tl-l { font-weight: 700; padding-left: 10px; background: var(--panel2); } .tl-g { background: var(--panel2); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #e5484d; opacity: .55; }
.tl-bar { position: absolute; top: 5px; height: 24px; border-radius: 6px; background: #cfe0ff; border: 1px solid #9dbcf5; color: #1b3a73; font-size: 12px;
  display: flex; align-items: center; overflow: hidden; cursor: grab; user-select: none; }
.tl-bar[class*=" c-"] { background: color-mix(in srgb, var(--rc) 30%, white); border-color: var(--rc); color: #1f2937; }
.tl-bar span { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-bar .tl-rz { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.tl-bar:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* ---------- sales: list ---------- */
.sb-listv { padding: 8px 12px 16px; overflow: auto; max-height: calc(100vh - 250px); }
.lv-g { display: flex; align-items: center; gap: 6px; padding: 10px 4px 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.lv-r { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 8px; margin-bottom: 6px; background: var(--panel); cursor: pointer; font-size: 13px; min-width: 0; }
.lv-r:hover { border-color: var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.05); } .lv-r[class*=" c-"] { border-left: 4px solid var(--rc); }
.lv-t { flex: 0 0 260px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-f { flex: 0 1 auto; min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.lv-add { border: 1px dashed var(--line); background: none; border-radius: 8px; width: 100%; padding: 8px; color: var(--ink3); cursor: pointer; font: inherit; }

/* ---------- sales: form ---------- */
.sb-form { padding: 20px 12px 40px; display: flex; justify-content: center; background: var(--panel2); min-height: 100%; }
.fm-card { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px 26px; }
.fm-card h2 { margin: 0 0 6px; font-size: 22px; } .fm-desc { margin: 0 0 18px; white-space: pre-wrap; }
.fm-f { margin-bottom: 16px; } .fm-f > label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.fm-f input:not([type=checkbox]), .fm-f select, .fm-f textarea { width: 100%; }
.fm-f .req { color: var(--t-red, #c62828); } .fm-chk { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.fm-multi { display: flex; flex-wrap: wrap; gap: 6px 12px; } .fm-multi label { display: flex; align-items: center; gap: 4px; }
.fm-act { margin-top: 20px; } .fm-act .btn { min-width: 120px; }
.fm-done { text-align: center; } .fm-done p { margin: 8px 0 18px; }
.fm-opts .opt { justify-content: space-between; } .fm-opts .opt label { display: flex; align-items: center; gap: 6px; cursor: pointer; } .fm-opts .fm-req { font-size: 12px; color: var(--ink3); }
@media (max-width: 760px) { .fm-card { padding: 18px 16px; } .sb-form { padding: 8px 0 30px; } }
.tl-bar.nar { overflow: visible; } .tl-bar.nar span { position: absolute; left: calc(100% + 6px); padding: 0; color: var(--ink); font-weight: 500; }
.tl-g .tl-l .muted { margin-left: 6px; font-weight: 500; }
.mchart .mc-x small { display: block; font-size: 10px; color: var(--ink3); line-height: 1.2; }
.mchart .mc-plot, .mchart .mc-y { margin-bottom: 36px; }
@media (max-width: 640px) { .mchart .mc-x { font-size: 10px; letter-spacing: -.3px; } .mchart .mc-bar b { display: none; } .mchart .mc-bar { width: 44%; } }

/* ---------- schedule board: 이사·보스 click = open the row / order, ⋯ = details; small "done" ---------- */
.bd-evw { position: relative; display: block; }
.sch-day .bd-evw { margin-bottom: 4px; } .sch-day .bd-evw .bd-ev { margin-bottom: 0; }
.bd-day .bd-evw .bd-ev { margin-bottom: 0; } .bd-line .bd-evw { flex: 1; min-width: 0; } .bd-late-row .bd-evw { flex: 1; }
.bd-evw .bd-ev { padding-right: 30px; }
.bd-more { position: absolute; top: 3px; right: 3px; width: 24px; height: 22px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--ink2); font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.bd-more:hover { background: var(--row-hover); color: var(--ink); }
.bd-close { margin-left: auto; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--ink2); font-size: 16px; cursor: pointer; }
.bd-close:hover { background: var(--row-hover); color: var(--ink); }
.bd-donebar { display: flex; justify-content: flex-end; margin-top: 14px; }
.bd-findone { width: auto; padding: 6px 12px; font-size: 13px; background: var(--panel); color: var(--t-ok); border: 1px solid var(--ok-line); }
.bd-findone:hover { background: var(--ok-bg); }
.ignore-undo form { display: inline-flex; align-items: center; margin: 0; } .ignore-undo .btn { margin: 0; }

/* ---------- NEW marks, auto-registered notice, 'already registered' hint ---------- */
.new-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .03em; line-height: 1; padding: 3px 5px; border-radius: 4px;
  background: var(--danger); color: #fff; vertical-align: 1px; }
.status-chips .new-chip { color: var(--t-red); } .status-chips .new-chip b { background: var(--err-bg); color: var(--t-red); }
.auto-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--brand-ink); font-size: 14px; }
.auto-notice .btn { margin: 0; }
.auto-notice .auto-x { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--panel); color: var(--brand-ink); cursor: pointer; }
.same-order { margin-top: 4px; font-size: 12.5px; color: var(--t-ok); white-space: normal; }
.same-order form .btn { margin: 0 0 0 4px; }
@media (prefers-color-scheme: dark) { .auto-notice { background: var(--accent-soft); border-color: var(--accent-line); color: var(--brand-ink); } .auto-notice .auto-x { background: transparent; color: inherit; border-color: var(--accent-line); } }
.bcat { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--line2); color: var(--ink2); vertical-align: 1px; white-space: nowrap; }
.bcat.ferg { background: #e8f0fe; color: #1d4ed8; }
.warn-box.inline-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .warn-box.inline-note .btn { margin: 0; }
.ferg-name { width: 230px; height: 30px; }
.bcat.bc0 { background: #e7f6ee; color: #166534; } .bcat.bc1 { background: #f3e8ff; color: #6b21a8; }
.bcat.bc2 { background: #ffedd5; color: #9a3412; } .bcat.bc3 { background: #ccfbf1; color: #115e59; }
.bcat.bc4 { background: #fce7f3; color: #9d174d; } .bcat.bc5 { background: #fef9c3; color: #854d0e; }
.bcat.bc6 { background: #e0e7ff; color: #3730a3; } .bcat.bc7 { background: #fee2e2; color: #991b1b; }

/* ---------- building-category badge colours (12 colours x light / solid) ---------- */
.bcat.xl0, .bc-dot.xl0 { background: #BFDBFE; color: #1E3A8A; } .bcat.xs0, .bc-dot.xs0 { background: #1E3A8A; color: #fff; }
.bcat.xl1, .bc-dot.xl1 { background: #BBF7D0; color: #14532D; } .bcat.xs1, .bc-dot.xs1 { background: #15803D; color: #fff; }
.bcat.xl2, .bc-dot.xl2 { background: #FECACA; color: #7F1D1D; } .bcat.xs2, .bc-dot.xs2 { background: #B91C1C; color: #fff; }
.bcat.xl3, .bc-dot.xl3 { background: #FED7AA; color: #7C2D12; } .bcat.xs3, .bc-dot.xs3 { background: #C2410C; color: #fff; }
.bcat.xl4, .bc-dot.xl4 { background: #FEF08A; color: #713F12; } .bcat.xs4, .bc-dot.xs4 { background: #A16207; color: #fff; }
.bcat.xl5, .bc-dot.xl5 { background: #DDD6FE; color: #4C1D95; } .bcat.xs5, .bc-dot.xs5 { background: #6D28D9; color: #fff; }
.bcat.xl6, .bc-dot.xl6 { background: #FBCFE8; color: #831843; } .bcat.xs6, .bc-dot.xs6 { background: #BE185D; color: #fff; }
.bcat.xl7, .bc-dot.xl7 { background: #99F6E4; color: #134E4A; } .bcat.xs7, .bc-dot.xs7 { background: #0F766E; color: #fff; }
.bcat.xl8, .bc-dot.xl8 { background: #BAE6FD; color: #0C4A6E; } .bcat.xs8, .bc-dot.xs8 { background: #0369A1; color: #fff; }
.bcat.xl9, .bc-dot.xl9 { background: #E7D3BE; color: #4A2C17; } .bcat.xs9, .bc-dot.xs9 { background: #7C4A26; color: #fff; }
.bcat.xl10, .bc-dot.xl10 { background: #D1D5DB; color: #374151; } .bcat.xs10, .bc-dot.xs10 { background: #4B5563; color: #fff; }
.bcat.xl11, .bc-dot.xl11 { background: #D6D3D1; color: #1C1917; } .bcat.xs11, .bc-dot.xs11 { background: #1C1917; color: #fff; }
.bc-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; vertical-align: middle; }
.bc-dot[class*="xl"] { box-shadow: 0 0 0 1px var(--line), inset 0 0 0 5px currentColor; }
.bc-pop { position: absolute; z-index: 80; width: min(520px, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.bc-pop[hidden] { display: none; }
.bc-h { font-size: 12px; color: var(--ink2); font-weight: 600; margin: 4px 0 6px; } .bc-grid + .bc-h { margin-top: 12px; }
.bc-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.bc-sw { border: 2px solid transparent; border-radius: 10px; background: var(--panel); padding: 6px 2px; cursor: pointer; }
.bc-sw:hover:not(:disabled) { border-color: #C8D3DE; } .bc-sw.on { border-color: #2563eb; }
.bc-sw:disabled { opacity: .3; cursor: not-allowed; }
.bc-sw .bcat { font-size: 11px; }
@media (max-width: 560px) { .bc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* colour dot next to the category name: solid = filled, light = pale centre with a strong ring */
.bc-name { display: flex; align-items: center; gap: 10px; }
.bc-name .bc-dot { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.bc-name .bc-dot:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #93B4D8; }
.bc-dot.ds0 { background: #1E3A8A; } .bc-dot.dl0 { background: #BFDBFE; border: 5px solid #1E3A8A; }
.bc-dot.ds1 { background: #15803D; } .bc-dot.dl1 { background: #BBF7D0; border: 5px solid #15803D; }
.bc-dot.ds2 { background: #B91C1C; } .bc-dot.dl2 { background: #FECACA; border: 5px solid #B91C1C; }
.bc-dot.ds3 { background: #C2410C; } .bc-dot.dl3 { background: #FED7AA; border: 5px solid #C2410C; }
.bc-dot.ds4 { background: #A16207; } .bc-dot.dl4 { background: #FEF08A; border: 5px solid #A16207; }
.bc-dot.ds5 { background: #6D28D9; } .bc-dot.dl5 { background: #DDD6FE; border: 5px solid #6D28D9; }
.bc-dot.ds6 { background: #BE185D; } .bc-dot.dl6 { background: #FBCFE8; border: 5px solid #BE185D; }
.bc-dot.ds7 { background: #0F766E; } .bc-dot.dl7 { background: #99F6E4; border: 5px solid #0F766E; }
.bc-dot.ds8 { background: #0369A1; } .bc-dot.dl8 { background: #BAE6FD; border: 5px solid #0369A1; }
.bc-dot.ds9 { background: #7C4A26; } .bc-dot.dl9 { background: #E7D3BE; border: 5px solid #7C4A26; }
.bc-dot.ds10 { background: #4B5563; } .bc-dot.dl10 { background: #D1D5DB; border: 5px solid #4B5563; }
.bc-dot.ds11 { background: #1C1917; } .bc-dot.dl11 { background: #D6D3D1; border: 5px solid #1C1917; }

/* 4 more colours */
.bcat.xl12 { background: #D9F99D; color: #365314; } .bcat.xs12 { background: #4D7C0F; color: #fff; } .bc-dot.ds12 { background: #4D7C0F; } .bc-dot.dl12 { background: #D9F99D; border: 5px solid #4D7C0F; }
.bcat.xl13 { background: #C7D2FE; color: #312E81; } .bcat.xs13 { background: #4338CA; color: #fff; } .bc-dot.ds13 { background: #4338CA; } .bc-dot.dl13 { background: #C7D2FE; border: 5px solid #4338CA; }
.bcat.xl14 { background: #F5D0FE; color: #701A75; } .bcat.xs14 { background: #A21CAF; color: #fff; } .bc-dot.ds14 { background: #A21CAF; } .bc-dot.dl14 { background: #F5D0FE; border: 5px solid #A21CAF; }
.bcat.xl15 { background: #E5E7B5; color: #3F3F12; } .bcat.xs15 { background: #6B6B1F; color: #fff; } .bc-dot.ds15 { background: #6B6B1F; } .bc-dot.dl15 { background: #E5E7B5; border: 5px solid #6B6B1F; }
.bc-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } .bc-pop { width: min(640px, calc(100vw - 16px)); }
@media (max-width: 560px) { .bc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* badge a little further from the name; 'new' number without a box */
.order-row .bcat { margin-left: 6px; }
.status-chips .new-chip b { background: none; color: var(--t-red); padding: 0; }
.status-chips .new-chip.active b { color: #fff; }
/* month picker: text in the middle of the pill (Windows drew it low) */
.status-chips .period-select { align-self: center; height: 32px; line-height: 30px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }

/* suggestion list under fields (replaces the browser's datalist, which phones often don't open) */
.cb-list { position: absolute; z-index: 400; max-height: 280px; max-width: min(460px, calc(100vw - 16px)); overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 26px rgba(0,0,0,.16); padding: 4px; }
.cb-list[hidden] { display: none; }
.cb-opt { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-opt b { font-weight: 600; } .cb-opt span { color: var(--ink2); font-size: 12.5px; margin-left: 4px; }
.cb-opt:hover, .cb-opt.on { background: var(--row-hover); }

/* settings tables: role names + tracker files + backups (phone layout) */
.role-labels .plain-table { width: 100%; max-width: 640px; table-layout: fixed; }
.role-labels .rl-key { width: 130px; }
.role-labels .plain-table input { width: 100%; min-width: 0; box-sizing: border-box; }
.role-labels .rl-key { vertical-align: middle; white-space: normal; word-break: keep-all; }
@media (max-width: 640px) {
  .role-labels .plain-table, .role-labels .plain-table tbody { display: block; }
  .role-labels .plain-table thead { display: none; }
  .role-labels .plain-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
  .role-labels .plain-table td { padding: 0; width: auto; }
  .role-labels .rl-key { grid-column: 1 / -1; }
  .stack-table, .stack-table tbody { display: block; width: 100%; }
  .stack-table thead { display: none; }
  .stack-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line2); }
  .stack-table td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .stack-table td.st-main { flex: 1 1 100%; font-weight: 600; word-break: break-all; }
  .stack-table td.st-sub { color: var(--ink2); font-size: 13px; }
  .stack-table td.st-full { flex: 1 1 100%; font-size: 13px; }
  .stack-table td.st-end { margin-left: auto; }
  .stack-table td[colspan] { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .role-labels .plain-table td { border: 0 !important; }
  .set-pane .check { display: block; white-space: normal; padding-left: 24px; text-indent: -24px; margin-bottom: 6px; }
  .set-pane .check input[type=checkbox] { vertical-align: -2px; margin: 0 6px 0 3px; }
  .dp-table { table-layout: fixed; }
  .dp-table td { padding: 4px 3px !important; }
  .dp-table input { width: 100% !important; min-width: 0; box-sizing: border-box; }
  .dp-table th:nth-child(1) { width: 32%; } .dp-table th:nth-child(3) { width: 24%; }
}

/* ---- phone layout pass (390px): filters, card tables, scroll hints, overflow fixes ---- */
.table-wrap.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0,0,0,.15)); mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0,0,0,.15)); }
.table-wrap.more-l.more-r { -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.15), #000 28px, #000 calc(100% - 28px), rgba(0,0,0,.15)); mask-image: linear-gradient(to right, rgba(0,0,0,.15), #000 28px, #000 calc(100% - 28px), rgba(0,0,0,.15)); }
.table-wrap.more-l:not(.more-r) { -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.15), #000 28px); mask-image: linear-gradient(to right, rgba(0,0,0,.15), #000 28px); }
.bp > *, .layout-2col > * { min-width: 0; }
@media (max-width: 640px) {
  /* filters: 6-column grid so edges line up */
  .filter-bar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: center; }
  .filter-bar > * { grid-column: span 3; min-width: 0; }
  .filter-bar > input[type=hidden], .filter-bar > script { display: none; }
  .filter-bar > input[type=text], .filter-bar > input[type=search] { grid-column: 1 / -1; max-width: none !important; width: 100%; }
  .filter-bar > select, .filter-bar > input[type=date] { width: 100%; max-width: none; }
  .filter-bar > span { display: none; }
  .filter-bar > .btn { grid-column: span 2; width: 100%; justify-content: center; text-align: center; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
  .filter-bar > .check { white-space: normal; }
  .filter-bar > .inline-label { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
  .filter-bar > .inline-label select { flex: 1; min-width: 0; width: 100%; }
  .filter-bar > .segmented { justify-self: start; }

  /* card tables */
  .table-wrap.mc-wrap { overflow: visible; max-height: none; border: 0; background: transparent; }
  table.m-cards, table.m-cards > tbody { display: block; width: 100%; }
  table.m-cards > thead { display: none; }
  table.m-cards > tbody > tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 11px 12px; border: 1px solid var(--line2); border-radius: 10px; margin-bottom: 8px; background: var(--panel); }
  table.m-cards > tbody > tr[hidden] { display: none; }
  table.m-cards > tbody > tr > td { display: block; flex: 0 0 calc(50% - 6px); min-width: 0; padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal; height: auto; }
  table.m-cards > tbody > tr > td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 500; color: var(--ink3); margin-bottom: 1px; }
  table.m-cards > tbody > tr > td[data-label=""]::before, table.m-cards > tbody > tr > td:not([data-label])::before { display: none; }
  table.m-cards > tbody > tr > td.mc-title, table.m-cards > tbody > tr > td.mc-lead { order: -1; flex: 0 1 auto; align-self: center; font-weight: 650; font-size: 14.5px; }
  table.m-cards > tbody > tr > td.mc-title::before, table.m-cards > tbody > tr > td.mc-lead::before { display: none; }
  table.m-cards > tbody > tr > td.mc-break { order: -1; flex: 0 0 100%; height: 0; overflow: hidden; }
  table.m-cards > tbody > tr > td { background: transparent !important; }
  table.m-cards > tbody > tr > td.mc-full, table.m-cards > tbody > tr.mc-wide > td { flex: 1 1 100%; }
  table.m-cards > tbody > tr > td.mc-hide, table.m-cards > tbody > tr > td.mc-empty { display: none; }
  table.m-cards > tbody > tr.mc-wide { padding: 8px 12px; }
  table.m-cards.hide-dkt .dkt { display: none !important; }
  table.m-cards > tbody > tr > td .clamp2 { -webkit-line-clamp: 3; }
  table.m-cards > tbody > tr.low-stock { border-color: var(--err-line); background: var(--low-bg); }
  table.m-cards > tbody > tr.detail-row { margin-top: -6px; border-top-left-radius: 0; border-top-right-radius: 0; }
  table.m-cards > tbody > tr.detail-row > td:first-child { display: none; }
  table.m-cards > tbody > tr.detail-row > td { overflow-x: auto; }

  /* overflow fixes */
  .doc-view table.doc-lines-view td { padding-left: 12px; }
  table.doc-lines-view td:nth-child(2) { min-width: 0; }
  .page-head { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 640px) {
  .table-wrap:has(> table.mcards) { border: 0; overflow: visible; max-height: none; background: transparent; }
  .page-head > .segmented { width: 100%; display: flex; }
  .page-head > .segmented > a { flex: 1; text-align: center; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
  .usage-table th:first-child, .usage-table td:first-child, table.report th:first-child, table.report td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line2); }
  .usage-table td:nth-child(2) { min-width: 150px; max-width: 170px; white-space: normal; }
}
@media (max-width: 640px) {
  .layout-2col { align-items: stretch; }
  .layout-2col .form-col { min-width: 0; }
  .doc-view table.doc-lines-view, .doc-view table.doc-lines-view > tbody { display: block; width: 100%; }
  .doc-view table.doc-lines-view > tbody > tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 12px 6px 14px; border-top: 1px solid var(--line2); }
  .doc-view table.doc-lines-view > tbody > tr > td { display: block; padding: 0 !important; }
  .doc-view table.doc-lines-view > tbody > tr > td:nth-child(2) { order: 1; flex: 1 1 100%; }
  .doc-view table.doc-lines-view > tbody > tr > td:nth-child(n+3) { order: 2; }
  .doc-view table.doc-lines-view > tbody > tr > td:empty { display: none; }
}

td.mc-break { display: none; }
@media (max-width: 640px) {
  table.m-cards > tbody > tr > td.mc-break { display: block; }
  table.m-cards > tbody > tr { row-gap: 6px; }
  .filter-bar { align-items: end; }
  .filter-bar > :not(.btn) + .btn { grid-column: 1 / span 2; }
  .filter-bar > .check { align-self: center; }
}
@media (max-width: 640px) {
  .toolbar > form { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .toolbar input[type=file] { min-width: 0; max-width: 100%; width: 100%; }
}
@media (max-width: 640px) { .filter-bar > .inline-label { font-size: 12px; gap: 5px; } .filter-bar > .inline-label select { flex: 1 1 auto; font-size: 14px; color: var(--ink); height: 34px; } }

/* phone: stacked form fields keep their full height (flex:1 in a column made them collapse) */
@media (max-width: 700px) {
  .group .field > input, .group .field > select, .group .field > textarea, .group .field > .field-stack, .group .field > .stepper { flex: none !important; }
  .group .field > input[type=text], .group .field > input[type=date], .group .field > input[type=time], .group .field > input[type=number], .group .field > select { height: 42px; }
}
@media (max-width: 640px) { .ro-lead input, .ro-lead .btn { height: 34px; } .ro-lead .btn { display: inline-flex; align-items: center; } }
/* phone: one control height everywhere outside tables (touch size) */
@media (max-width: 640px) {
  main input[type=text]:not(td input), main input[type=number]:not(td input), main input[type=date]:not(td input),
  main input[type=password]:not(td input), main input[type=search]:not(td input), main select:not(td select) { height: 40px; }
  main .btn:not(.btn-xs):not(td .btn) { min-height: 40px; }
  .filter-bar > .inline-label select, .ro-lead input, .ro-lead .btn { height: 40px; }
}
/* phone: "nothing here" rows sit in the middle */
@media (max-width: 760px) {
  table.mcards td[colspan] { justify-content: center !important; text-align: center !important; padding: 10px 0 !important; }
  table.mcards td[colspan]::before { display: none; }
}
@media (max-width: 640px) { table.m-cards > tbody > tr > td[colspan].muted { text-align: center !important; } }

/* ---- schedule: same day cards for list / week / month on phones ---- */
.sch-wd { display: none; }
.sch-over { display: none; }
.sch-pop[hidden] { display: none; }
.sch-pop { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .42); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sch-pop .sch-pick { width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto; margin: 0; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.sch-pick-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sch-pick-top .bd-dayhead { margin: 0; font-size: 16px; }
.sch-pick-x { cursor: pointer; }
@media (max-width: 640px) {
  /* week: one card per day, like the list view */
  .sch-grid.week { gap: 10px; }
  .sch-grid.week .sch-day { background: var(--panel); border-radius: var(--radius-lg, 14px); padding: 12px 14px; min-height: 0; opacity: 1; }
  .sch-grid.week .sch-day.weekend { background: var(--panel); }
  .sch-grid.week .sch-date { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
  .sch-grid.week .sch-wd { display: inline; }
  .sch-grid.week .bd-ev { font-size: 14px; padding: 8px 10px; margin-bottom: 6px; }
  /* month: compact grid with dots, tap a day to list it below */
  .sch-grid.month { gap: 3px; }
  .sch-grid.month .sch-head { font-size: 11px; }
  .sch-grid.month .sch-day { min-height: 54px; padding: 4px 3px; border-radius: 8px; gap: 2px; flex-direction: row; flex-wrap: wrap; align-content: flex-start; cursor: pointer; }
  .sch-grid.month .sch-date { flex: 1 1 100%; font-size: 11.5px; text-align: center; }
  .sch-grid.month .sch-over { display: contents; }
  .sch-grid.month .bd-evw { display: contents; }
  .sch-grid.month .bd-more, .sch-grid.month .small-link { display: none; }
  .sch-grid.month .bd-ev { width: 7px; height: 7px; min-height: 0; padding: 0 !important; margin: 1px !important; border: 0; border-radius: 50%; background: var(--kc, #a3a3a3); font-size: 0; overflow: hidden; pointer-events: none; }
  .sch-grid.month .bd-ev.done { opacity: .35; }
  .sch-grid.month .sch-day.picked { border-color: var(--link); box-shadow: 0 0 0 2px rgba(31,111,168,.25); }
}

/* TOP 20 cards: everything centred */
.top-card-head { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.top-list li { grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; row-gap: 3px; }
.top-list .bar { grid-column: 1 / 4; }

/* phone: label + field pulled to the left, field fills to the right edge */
@media (max-width: 640px) {
  form .field > label:first-child, .grid-fields .field > label:first-child, details.bulk form .field > label:first-child { width: 88px; text-align: left; }
  form .field { gap: 8px; }
  form .field > input, form .field > select, form .field > textarea, form .field > .field-stack, form .field > .cb-wrap { flex: 1 1 auto; min-width: 0; width: 100%; }
}

/* phone header: role + logout on the left, language on the right */
@media (max-width: 700px) {
  .topbar .top-right { flex: 1 1 100%; margin-left: 0; gap: 8px; }
  .topbar .top-right > .segmented { margin-left: auto; }
  .topbar .top-right .admin-link { margin-right: 0; }
}

/* sales mail review (layout only for now) */
.sm-entry { display: flex; justify-content: flex-end; gap: 8px; margin: 0 -8px 18px; }   /* the table panel sticks out 8px (.sb) */
.sm-entry .btn b { margin-left: 4px; color: var(--ink3); }
.sm-soon { font-size: 12px; vertical-align: middle; }
.sm-banner { margin-bottom: 10px; }
.sm-accounts { margin: 0 0 10px; font-size: 13px; }
.sm-how { margin-top: 12px; } .sm-how summary { cursor: pointer; font-weight: 600; } .sm-how ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
#sales-mail > summary { cursor: pointer; list-style-position: outside; }
.sm-show { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0; }

/* back link: always just above the page title, left */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 4px; font-size: 13.5px; font-weight: 600; color: var(--link); text-decoration: none; padding: 2px 0; }
.back-link:hover { text-decoration: underline; }
.back-link.cv { gap: 6px; }
.back-link.cv::before { content: ""; width: 6px; height: 6px; margin-left: 2px; border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg); flex: none; }
@media (max-width: 640px) { .back-link { font-size: 14px; padding: 6px 0 2px; } }

/* field names break between words, not in the middle of one */
form .field > label:first-child { word-break: keep-all; overflow-wrap: break-word; }

/* phone menu bar: the tab you are in is bold */
@media (max-width: 700px) {
  .menubar > a.active, .menubar .nav-group.active > .nav-btn { font-weight: 800; color: var(--ink); }
}

/* show / hide a typed password */
.pw-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.pw-wrap > input { width: 100%; padding-right: 44px !important; }
.pw-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; background: transparent;
          color: var(--ink3); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.pw-eye:hover { background: var(--panel2); color: var(--ink); }
.pw-eye svg { width: 18px; height: 18px; }
.pw-eye[aria-pressed="true"] { color: var(--link); }

/* 이사 looking at the Hub as Boss / installer */
.viewas-bar { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
              padding: 8px 14px; background: #7c3aed; color: #fff; font-size: 13.5px; font-weight: 600; }
.viewas-bar a { color: #fff; background: rgba(255,255,255,.18); border-radius: 999px; padding: 3px 12px; text-decoration: none; }
.viewas-bar a:hover { background: rgba(255,255,255,.3); }
.who-link { text-decoration: none; }
.viewas-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }

/* Today: rows per stage (bar + numbers) */
.stage-row { padding: 11px 0; }
.stage-row:last-child { border-bottom: 0; }
.stage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stage-head .stage-name { font-weight: 650; font-size: 14.5px; color: var(--link); text-decoration: none; margin: 0; }
.stage-sum { font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.stage-sum b { color: var(--ink); }
.stage-sum a { color: inherit; text-decoration: none; } .stage-sum a:hover { text-decoration: underline; }
.stage-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line2); margin: 7px 0 6px; }
.stage-bar a { display: block; height: 100%; background: var(--rc, #9ca3af); }
.stage-bar a.st-done { background: var(--c-bg, #d1f5d3); }
.stage-bar a.st-other, .stage-list i.st-other { background: var(--amber); }
.stage-list { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.stage-list a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.stage-list a:hover { text-decoration: underline; }
.stage-list a.warn { color: var(--t-warn); } .stage-list a.muted { color: var(--ink3); }
.stage-list i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--rc, #9ca3af); }
@media (max-width: 640px) { .stage-bar a { pointer-events: none; } }

/* global search + data check */
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 14px; align-items: start; }
.gs-sec h3, .ck-sec h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs-row { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; padding: 8px 6px; border-top: 1px solid var(--line2); color: var(--ink); text-decoration: none; border-radius: 6px; }
.gs-row:hover { background: var(--row-hover); }
.gs-row b { color: var(--link); } .gs-row span { color: var(--ink2); } .gs-row em { font-style: normal; color: var(--ink3); font-size: 12.5px; margin-left: auto; }
.ck-sec { margin-bottom: 12px; } .ck-sec h3 a { color: var(--link); text-decoration: none; }
.ck-n { font-size: 12px; background: var(--panel2); border-radius: 999px; padding: 1px 8px; color: var(--ink2); }
.ck-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line2); }
.ck-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ck-main span { color: var(--ink2); font-size: 13px; } .ck-main a { color: var(--link); text-decoration: none; }
.ck-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ck-form { display: inline; margin: 0; }
.btn-link.ck-ign { background: none; border: 0; color: var(--ink3); font-size: 12.5px; cursor: pointer; padding: 4px 6px; }
.btn-link.ck-ign:hover { color: var(--ink); text-decoration: underline; }
.ck-warn { color: var(--t-warn); }
.ck-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; } .ck-links a { color: var(--t-warn); text-decoration: none; font-weight: 600; }
.ck-all { margin-left: auto; font-size: 12.5px; }
.offsite-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (max-width: 640px) { .ck-row { flex-direction: column; align-items: stretch; } .ck-acts { justify-content: flex-end; } }
.note-x { margin-left: auto; border: 0; background: transparent; color: var(--ink3); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.note-x:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.inline-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-info { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 10px; border: 0; background: none; color: var(--ink3); font-size: 12.5px; cursor: pointer; padding: 2px 0; }
.note-info:hover { color: var(--link); text-decoration: underline; }
.note-info[hidden] { display: none; }
.update-problem { position: relative; padding-right: 36px; }
.update-problem .note-x { position: absolute; right: 8px; top: 8px; }
@media (max-width: 760px) { .sm-entry { margin-left: -10px; margin-right: -10px; } }

/* sales mail review */
.sm-tools { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sm-tools form { margin: 0; }
.sm-upload label.btn { cursor: pointer; }
.sm-err { color: var(--danger, #b42318); font-weight: 600; }
.sm-list td { vertical-align: top; }
.sm-form .sm-note { margin: 0 0 10px; }
.sm-prop { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 12px; min-width: 0; }
.sm-prop legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; }
.sm-why { margin: 2px 0 8px; padding-left: 18px; font-size: 13px; color: var(--warn-ink, #8a5a00); }
.sm-why li.ok { color: var(--ink3); }
.sm-acts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; }
.sm-acts .check { margin: 0; }
.sm-new { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.sm-new .field.wide { grid-column: 1 / -1; }
.sm-new textarea { width: 100%; resize: vertical; }
.sm-com select, .sm-prop select { width: 100%; }
.sm-done { margin: 6px 0 10px; padding-left: 18px; line-height: 1.7; }
.sm-pull { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sm-pull input[type=number] { width: 70px; }
.plain-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
@media (max-width: 640px) { .sm-new { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .sm-review { display: flex; flex-direction: column; } .sm-review .review-form { order: -1; } .sm-review .mail-body { max-height: 50vh; overflow: auto; } }

.cert-link { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.cert-card h3 { margin: 18px 0 6px; font-size: 15px; }
.cert-steps { margin: 0; padding-left: 20px; line-height: 1.7; font-size: 14px; }

.doc-date-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.doc-date-form label { color: var(--ink2); }
.doc-date-form input[type=date] { width: auto; padding: 4px 8px; }
/* a divider only between two menu groups: never first, last, or twice in a row (e.g. installer: just 일정표) */
.menubar > .sep:first-child, .menubar > .sep + .sep, .menubar > .sep:last-child { display: none; }
.bd-donebar { flex-wrap: wrap; gap: 6px; }
.bd-donebar > .muted.small { flex-basis: 100%; text-align: right; }

.bd-lab.own { background: #ede9fe; color: #6d28d9; }
.bd-or { display: flex; align-items: center; gap: 8px; color: var(--ink3); font-size: 12px; margin: 10px 0 8px; }
.bd-or::before, .bd-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.bd-ownbtn { width: 100%; }
.bd-ownnote { flex-basis: 100%; margin: 0; }
.bd-del { color: var(--danger, #b42318); font-size: 13px; }
.bd-edit input[type=time] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--panel); color: var(--ink); min-height: 36px; box-sizing: border-box; }
/* the menu still scrolls sideways on a phone, but without a visible scroll bar */
.menubar { scrollbar-width: none; -ms-overflow-style: none; }
.menubar::-webkit-scrollbar { display: none; height: 0; }

.pdf-check { border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.pdf-check.ok { background: var(--ok-bg); color: var(--t-ok); }
.pdf-check.bad { background: var(--warn-bg); color: var(--t-warn); }
.ai-check .aic-list { margin: 4px 0 0; padding-left: 18px; }
.ai-check .ai-tag, .aic-intent .ai-tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 18px; background: var(--panel2); border: 1px solid var(--line); }
.ai-check .aic-intent { margin: 4px 0; }
.ai-check .aic-tbl { font-size: 12px; margin-top: 4px; }
.ai-check .aic-tbl td, .ai-check .aic-tbl th { padding: 2px 6px; }
.ai-check:not(.ok):not(.bad) { background: var(--panel2); border: 1px solid var(--line); }

.health-bar { background: var(--err-bg); color: var(--t-red); border-left: 4px solid var(--t-red); border-radius: 6px; padding: 8px 12px; margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.health-bar a { color: var(--t-red); font-weight: 600; margin-left: 6px; text-decoration: underline; }
.health-log { margin: 4px 0 10px; font-size: 13px; }
.health-log summary { cursor: pointer; color: var(--ink3, #666); }
.health-log ul { margin: 6px 0 0; padding-left: 18px; }
@media (prefers-color-scheme: dark) { .health-bar { background: var(--err-bg); color: var(--t-red); } .health-bar a { color: var(--t-red); } }

.bd-phn { font-size: 11px; margin-left: 4px; padding: 0 5px; border-radius: 8px; background: rgba(0,0,0,.08); }
.bd-photos { margin-top: 12px; border-top: 1px solid var(--line, #e5e5e5); padding-top: 10px; }
.bd-photos .ph-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-kinds { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.ph-kinds label { border: 1px solid var(--line, #ddd); border-radius: 16px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.ph-kinds input { display: none; }
.ph-kinds label:has(input:checked) { background: var(--accent-solid); border-color: var(--link); color: #fff; }
.ph-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-btns label.btn { cursor: pointer; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 8px; }
.ph-th { position: relative; display: block; aspect-ratio: 1; background: var(--page); border-radius: 6px; overflow: hidden; }
.ph-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-k { position: absolute; left: 4px; bottom: 4px; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; }
.ph-k.k-problem { background: #c0392b; }
.ph-x { position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 22px; padding: 0; cursor: pointer; }
.ph-msg { font-size: 13px; margin-top: 6px; }
.ph-order { margin-bottom: 12px; }
.ph-order summary { cursor: pointer; }
.ph-prob { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line, #eee); }
.ph-prob:last-child { border-bottom: 0; }

.ro-pick { width: 28px; text-align: center; }
input.ro-qty { width: 76px; text-align: right; }
.ro-po .form-actions { align-items: center; gap: 10px; }
.po-card .form-actions { align-items: center; gap: 10px; flex-wrap: wrap; }

.bd-route { margin-left: 8px; vertical-align: 1px; }
.sch-day > .bd-route { margin: 2px 0 4px; }
.rt-from { display: block; margin: 8px 0; font-size: 13px; }
.rt-from input { display: block; width: 100%; margin-top: 4px; }
.rt-list { list-style: none; counter-reset: rt; margin: 6px 0 10px; padding: 0; }
.rt-list li { counter-increment: rt; display: grid; grid-template-columns: 22px 20px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line, #eee); }
.rt-list li::before { content: counter(rt); font-weight: 700; color: var(--link); text-align: right; padding-top: 2px; }
.rt-list li.off { opacity: .45; }
.rt-list li.off::before { content: '–'; }
.rt-list li > input { margin-top: 3px; }
.rt-mv { display: flex; gap: 4px; }

.pu-checks { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
.pu-checks li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line, #eee); }
.pu-checks li.ok b { color: var(--t-ok); }
.pu-checks li.bad b { color: var(--t-red); }
.pu-msg { font-size: 14px; min-height: 1.4em; }
.pu-msg.ok { color: var(--t-ok); }
.admin-link.pu-link { margin-right: 6px; }

.pu-dev { display: block; font-size: 14px; margin: 4px 0 12px; }
.pu-dev input { display: block; width: 100%; margin-top: 6px; }
.pu-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pu-btns .btn { flex: 1 1 180px; }
.pu-checks li.opt b { color: var(--ink3, #888); }
@media (max-width: 640px) { .pu-btns .btn { flex-basis: 100%; } }

.my-h { font-size: 17px; margin: 18px 0 6px; }

.pu-card .pu-state { font-weight: 650; margin-bottom: 8px; }
.pu-card .pu-state.on { color: var(--t-ok); }
.pu-card .pu-state.off { color: var(--ink2, #555); }
.pu-sec { border-top: 1px solid var(--line, #eee); padding: 8px 0; }
.pu-sec > summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.pu-sec .pu-checks { margin: 6px 0 0; }
.pu-sec ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.pu-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; margin-top: 8px; }
.pu-card .pu-dev { margin-top: 10px; }
.pu-msg:empty { display: none; }

.td-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.td-side { display: flex; flex-direction: column; gap: 14px; }
.td-side .card { margin: 0; }
@media (max-width: 900px) { .td-grid { grid-template-columns: 1fr; } }
.td-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line, #eee); margin: 6px 0 8px; }
.td-o { background: #9cc3e0; } .td-p { background: #2f6496; } .td-x { background: #e0a23c; } .td-d { background: #5aa36a; }
.td-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-bottom: 10px; }
.td-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.td-legend a { color: inherit; text-decoration: none; }
.td-ship { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 8px; }
.td-ship th, .td-ship td { padding: 5px 6px; text-align: center; border-bottom: 1px solid var(--line, #eee); }
.td-ship tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.td-ship thead th { font-size: 12px; color: var(--ink3, #777); font-weight: 600; }
.td-flags { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin: 4px 0 10px; }
.td-sub { font-size: 13px; font-weight: 650; color: var(--ink2, #555); margin: 10px 0 4px; }
.td-list { list-style: none; padding: 0; margin: 0 0 4px; font-size: 14px; line-height: 1.7; }
.td-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.td-chips a { border: 1px solid var(--line, #ddd); border-radius: 14px; padding: 3px 10px; font-size: 13px; text-decoration: none; color: inherit; }
.td-todo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.pl-add summary { cursor: pointer; }
.pl-add .pl-form { margin-top: 10px; }
.pl-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line, #e5e5e5); border-left: 1px solid var(--line, #e5e5e5); }
.pl-wd { font-size: 12px; font-weight: 650; color: var(--ink3, #777); padding: 4px 6px; border-right: 1px solid var(--line, #e5e5e5); border-bottom: 1px solid var(--line, #e5e5e5); }
.pl-wd.sun { color: #c0392b; }
.pl-cell { min-height: 92px; padding: 3px 4px 6px; border-right: 1px solid var(--line, #e5e5e5); border-bottom: 1px solid var(--line, #e5e5e5); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-cell.other { background: var(--page); }
.pl-cell.other .pl-dn { color: var(--ink3, #aaa); }
.pl-cell.today .pl-dn { background: var(--brand, #2f6496); color: #fff; border-radius: 10px; padding: 0 7px; }
.pl-dn { align-self: flex-start; font-size: 13px; font-weight: 600; color: inherit; text-decoration: none; }
.pl-ev { display: block; font-size: 12px; line-height: 1.35; padding: 1px 5px; border-radius: 4px; text-decoration: none; color: #1d3c5a;
         background: #e3eef8; border-left: 3px solid #2f6496; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-ev.multi { border-radius: 2px; }
.pl-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 2px 12px; padding: 8px 4px 8px 10px; border-left: 3px solid #2f6496;
          border-bottom: 1px solid var(--line, #eee); text-decoration: none; color: inherit; align-items: baseline; }
.pl-when { font-weight: 600; font-size: 14px; white-space: nowrap; }
.pl-who { grid-column: 3; grid-row: 1; }
.pl-memo { grid-column: 2 / 4; white-space: pre-line; }
@media (max-width: 640px) {
  .pl-cell { min-height: 58px; padding: 2px; }
  .pl-ev { font-size: 10.5px; padding: 0 3px; border-left-width: 2px; }
  .pl-ev b { display: none; }
  .pl-row { grid-template-columns: 1fr auto; }
  .pl-when { grid-column: 1; grid-row: 1; }
  .pl-who { grid-column: 2; grid-row: 1; }
  .pl-t, .pl-memo { grid-column: 1 / -1; }
}

/* sales grid: summary bar + group subtotals */
.sb-grid tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--panel2); height: 30px; border-top: 1px solid var(--line); font-size: 12px; }
.sb-grid tfoot td.rn { z-index: 3; }
.sb-grid tfoot td.prim { z-index: 3; }
.sb-grid tfoot td[data-sum] { cursor: pointer; }
.sb-grid tfoot td[data-sum]:hover { background: var(--page); }
.sb-grid tfoot .sm-ph { color: var(--ink3); visibility: hidden; }
.sb-grid tfoot td:hover .sm-ph, .sb-grid tfoot tr:hover .sm-ph { visibility: visible; }
.sb-grid .sm-l { color: var(--ink3); font-size: 11px; }
.sb-grid .sm-v { font-weight: 650; font-variant-numeric: tabular-nums; }
.sb-grid td.sm.t-number, .sb-grid td.sm.t-currency, .sb-grid td.sm.t-percent, .sb-grid td.sm.t-rollup, .sb-grid td.sm.t-count, .sb-grid td.sm.t-duration,
.sb-grid td.gsm.t-number, .sb-grid td.gsm.t-currency, .sb-grid td.gsm.t-percent, .sb-grid td.gsm.t-rollup, .sb-grid td.gsm.t-count, .sb-grid td.gsm.t-duration { text-align: right; }
.sb .sb-grid tr.grps td.gsm { position: static; font-size: 12px; font-weight: 400; }
.sb .sb-grid tr.grps td.glab { position: sticky; left: 0; z-index: 2; }
.sm-menu { display: flex; flex-direction: column; max-height: 320px; overflow: auto; min-width: 170px; }
.sm-menu .fl-i.on { font-weight: 650; }

form .field.pl-f { align-items: flex-start; }
form .field.pl-f > label { padding-top: 8px; }
.pl-in { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
form .field .pl-in > input { width: 100%; flex: none; }
form .field .pl-in > .pl-half { width: 50%; min-width: 130px; flex: none; }
.pl-hint { font-size: 12px; color: var(--ink3, #777); line-height: 1.35; }
.pl-grid { align-items: start; }

/* 스케쥴 colors by type */
.pl-ev.k-meeting  { background: #e3eef8; border-left-color: #2f6496; color: #1d3c5a; }
.pl-ev.k-trip     { background: #efe7f8; border-left-color: #7b4bb3; color: #46296b; }
.pl-ev.k-off      { background: #e3f2e6; border-left-color: #3d8b4f; color: #1f4d29; }
.pl-ev.k-appt     { background: #f6ebdf; border-left-color: #c47a2c; color: #5b3712; }
.pl-ev.k-personal { background: #f8e6ef; border-left-color: #b8487a; color: #6b2445; }
.pl-ev.k-other    { background: #eceef1; border-left-color: #6b7280; color: #374151; }
.pl-row.k-meeting { border-left-color: #2f6496; } .pl-row.k-trip { border-left-color: #7b4bb3; } .pl-row.k-off { border-left-color: #3d8b4f; }
.pl-row.k-appt { border-left-color: #c47a2c; } .pl-row.k-personal { border-left-color: #b8487a; } .pl-row.k-other { border-left-color: #6b7280; }
@media (prefers-color-scheme: dark) {             /* the plan chips on a dark screen */
  .pl-ev.k-meeting  { background: #1c3347; color: #b9d6f0; }
  .pl-ev.k-trip     { background: #2e2342; color: #d4c1ee; }
  .pl-ev.k-off      { background: #1d3524; color: #a9dcb5; }
  .pl-ev.k-appt     { background: #3a2c1b; color: #f0cb9f; }
  .pl-ev.k-personal { background: #3a1f2c; color: #f0b6cf; }
  .pl-ev.k-other    { background: #2a2f36; color: #c9ced6; }
}
.pl-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; margin-left: 14px; font-size: 12px; font-weight: 500; color: var(--ink2, #555); vertical-align: middle; }
.pl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.pl-legend .k-meeting i { background: #2f6496; } .pl-legend .k-trip i { background: #7b4bb3; } .pl-legend .k-off i { background: #3d8b4f; }
.pl-legend .k-appt i { background: #c47a2c; } .pl-legend .k-personal i { background: #b8487a; } .pl-legend .k-other i { background: #6b7280; }

/* home: top items — name | times | qty, each on one line */
.hbars .hb-top.hb-3 { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.4em; gap: 8px; align-items: baseline; }
.hbars .hb-3 .hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hbars .hb-3 .hb-n { white-space: nowrap; text-align: right; }
.hbars .hb-3 .hb-q { white-space: nowrap; text-align: right; }

/* card heads: title on the left, a small link at the top-right corner, notices as a pill under the title */
.ch { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.ch > .card-title, .ch > .b-label { margin: 0; min-width: 0; }
.ch-link { flex: none; font-size: 12.5px; font-weight: 400; white-space: nowrap; color: var(--link); text-decoration: none; }
.ch-link:hover { text-decoration: underline; }
.ch-alert { display: inline-block; margin: -4px 0 10px; padding: 2px 10px; border-radius: 999px; background: var(--err-bg); color: var(--t-red);
            font-size: 12.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.ch-alert:hover { background: var(--err-bg); }
.top-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: -4px 0 8px; }
.top-sub .top-cat { max-width: 100%; }

/* sales: rows found in the other tables while searching */
.sx { margin: 0 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel2); padding: 8px 12px; }
.sx-h { font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.sx-g { padding: 4px 0 6px; border-top: 1px solid var(--line2); }
.sx-g:first-of-type { border-top: none; }
.sx-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; font-weight: 650; margin: 2px 0 2px; }
.sx-open, .sx-more { border: none; background: none; color: var(--link, #2563eb); font-size: 12px; cursor: pointer; padding: 2px 0; white-space: nowrap; }
.sx-r { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: none; background: none; padding: 4px 6px; border-radius: 6px;
        cursor: pointer; font: inherit; font-size: 13px; color: inherit; overflow: hidden; white-space: nowrap; }
.sx-r:hover { background: var(--page); }
.sx-r b { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.sx-hit { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.sx mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
@media (max-width: 760px) { .sx-r { flex-direction: column; gap: 0; white-space: normal; } .sx-r b { max-width: 100%; } }

/* 영업: 테이블 고르는 줄(모바일 선택칸 · PC 탭)이 다크 모드에서 흰 바탕+흐린 글씨로 보이던 것 (10/11) */
@media (prefers-color-scheme: dark) {
  .sb .sb-tabs { background: var(--panel2) !important; border-bottom-color: var(--line) !important; }
  .sb #sb-tsel, .sb #sb-vsel { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
  .sb .sb-tab { color: var(--ink2) !important; }
  .sb .sb-tab:not(.on):not(.add):not(.more)::after { background: var(--line) !important; }
  .sb .sb-tab:hover:not(.on) { background: rgba(255,255,255,.06) !important; }
  .sb .sb-tab.on { background: var(--panel) !important; color: var(--brand-ink) !important; box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line) !important; }
  .sb .sb-tab.on .caret { color: var(--brand-ink); }
  .sb .sb-tab.add, .sb .sb-tab.more { color: var(--ink2) !important; }
}

/* 영업: 줄을 고르면 나오는 '선택됨 · 복제 · 삭제' 막대가 표 아래(화면 밖)에 숨어 있던 것 → 화면 아래 가운데에 늘 보이게 (10/11) */
.sb .sb-bulk { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 60; max-width: calc(100vw - 32px); flex-wrap: wrap; }
/* 다크 모드: 고른 줄이 하얗게 보이던 것 */
@media (prefers-color-scheme: dark) {
  .sb .sb-grid tr.rw.picked td { background: var(--accent-soft); }
  .sb .sb-grid tr.rw.rdragging td { background: var(--accent-soft); }
  .sb .sb-grid tr.gadd:hover td { background: var(--row-hover); }
  .sb .sb-bulk { background: var(--nav); border: 1px solid var(--accent-line); }
}
.sb .sb-bulk button.danger { color: #fff !important; }

/* ---- schedule board, wide screens: week rows; a job over several days = one bar across its days ---- */
.sch-cal { display: none; }
.bd-ev .bd-rng { font-size: 11px; color: var(--ink3); margin-left: 2px; }
@media (min-width: 901px) {
  .sch-narrow { display: none !important; }
  .sch-cal { display: flex; flex-direction: column; gap: 6px; }
  .sch-cal-head, .sch-wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 6px; }
  .sch-bg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 90px; }
  .sch-cal.week .sch-bg { min-height: 360px; }
  .sch-bg.weekend { background: var(--panel2); }
  .sch-bg.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
  .sch-bg.other-month, .sch-dh.other-month, .sch-cell.other-month { opacity: .45; }
  .sch-dh { padding: 6px 7px 2px; min-width: 0; z-index: 1; }
  .sch-dh > .bd-route { margin: 4px 0 0; }
  .sch-cell { padding: 2px 7px 7px; min-width: 0; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
  .sch-cell .bd-ev, .sch-cell .bd-evw { margin-bottom: 0; }
  .sch-span { margin: 2px 7px; min-width: 0; z-index: 1; display: flex; }
  .sch-span.cl { margin-left: 0; } .sch-span.cr { margin-right: 0; }
  .sch-span .bd-evw { display: flex; flex: 1; min-width: 0; margin: 0; }
  .sch-span .bd-ev { margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: color-mix(in srgb, var(--kc, #a3a3a3) 14%, var(--panel)); }
  .sch-span .bd-ev .bd-title { display: inline; margin-left: 4px; }
  .sch-span .bd-ev .bd-src { margin-left: 6px; }
  .sch-span.cl .bd-ev { border-left-color: transparent; border-top-left-radius: 0; border-bottom-left-radius: 0; }
  .sch-span.cr .bd-ev { border-top-right-radius: 0; border-bottom-right-radius: 0; }
}

/* order screen: pick up / installation day ~ last day + time (wraps on phones, never wider than the field) */
.ful-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; width: 100%; min-width: 0; }
.field .ful-range input { min-width: 0; width: 0; }
.field .ful-range input[type=date] { flex: 1 1 0; }
.field .ful-range input[type=time] { flex: 0 0 120px; width: 120px; }
.ful-range .ful-tilde { color: var(--ink3); flex: 0 0 auto; }
.field .ful-range input.empty:not(:focus) { color: var(--ink3); }
@media (max-width: 640px) {   /* phone: start / ~ last day / time, one per row */
  .field .ful-range input[name=fulfill_date] { flex: 1 1 100%; }
  .ful-range .ful-tilde { flex: 0 0 14px; text-align: center; }
  .field .ful-range input[name=fulfill_end] { flex: 1 1 0; }
  .field .ful-range input[type=time] { flex: 1 1 100%; width: auto; }
}

/* more days of the same order (+ 시공일 추가) */
.ful-wrap { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; width: 100%; min-width: 0; }
.ful-row { position: relative; }
.ful-x { flex: 0 0 26px; height: 26px; border: 0; background: transparent; color: var(--ink3); cursor: pointer; font-size: 14px; border-radius: 6px; }
.ful-x:hover { background: var(--panel2); color: var(--red, #c0392b); }
.field .ful-row input[type=time] { flex-basis: 88px; width: 88px; }
button.linklike.ful-add { align-self: flex-start; font-size: 12.5px; color: var(--link); padding: 0; }
@media (max-width: 640px) {
  .field .ful-row input[name=fulfill_more_d] { flex: 1 1 100%; }
  .field .ful-row input[name=fulfill_more_e] { flex: 1 1 0; }
  .field .ful-row input[type=time] { flex: 1 1 0; width: auto; }
  .ful-row { padding-top: 8px; border-top: 1px dashed var(--line2); }
}

/* 10/26 Aaron: the label sits by the first row (it looked like the label of the 2nd row when the dates wrapped),
   '~ last day' moves as one piece, so the rows read: day / ~ last day / time */
form .field.ful-field { align-items: flex-start; }
form .field.ful-field > label:first-child { padding-top: 8px; }
.ful-range .ful-end { display: flex; align-items: center; gap: 6px; flex: 1 1 150px; min-width: 0; }
.field .ful-range > input[type=date] { flex: 1 1 130px; }
.field .ful-range .ful-end input[type=date] { flex: 1 1 0; }
.field .ful-range > input[type=time] { flex: 0 1 120px; min-width: 104px; }
@media (max-width: 640px) {
  .field .ful-range > input[type=date], .ful-range .ful-end, .field .ful-range > input[type=time] { flex: 1 1 100%; }
  .field .ful-row .ful-end { flex: 1 1 0; }
  .field .ful-row > input[type=time] { flex: 1 1 0; }
}

/* no pill shapes (Aaron 10/12): badges, tags, chips and the small header buttons are slightly rounded boxes */
.status, .kind, .badge, .pill, .check-tag, .status-chips a, .hero-chips span, .b-hero .b-chips span, .bp-type, .period-select,
.cb-tag, .who-badge, .chip, .bd-ev .bd-st, .bd-ev .bd-chg, .bd-lab, .ro-mark, .bcat, .viewas-bar a, .ck-n, .ph-kinds label,
.td-chips a, .ch-alert, .admin-link, select.status-pick, .segmented { border-radius: 5px !important; }

/* Hub order number (#615): small and quiet, but always there */
.o-num { color: var(--ink3); font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
h1 .o-num { font-size: .62em; vertical-align: middle; margin-right: 4px; }
th.o-num-h { width: 44px; }
a.o-num-link { font-weight: 600; white-space: nowrap; }

/* 앱(홈 화면 아이콘)으로 열 때 맨 아래·위 빈 곳도 화면 색으로 (10/17) */
html { background: var(--page); }

/* 일정표·주문 스케줄: 주말 좁게 + 연회색, 토 파랑 · 일 빨강, 미국 공휴일 = 일요일처럼 + 이름 (10/18) */
:root { --wk-bg: #ECEFF3; --wk-sat: #1D5FC9; --wk-sun: #D32F2F; }
@media (prefers-color-scheme: dark) { :root { --wk-bg: #2A3238; --wk-sat: #7FB0FF; --wk-sun: #FF7B7B; } }
.sch-grid.month, .sch-grid:not(.week) { grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr)); }
@media (min-width: 901px) {
  .sch-grid.week { grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr)); }
  .sch-cal-head, .sch-wk { grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr)); }
}
.sch-grid .sch-day.weekend, .sch-grid.week .sch-day.weekend, .sch-grid .sch-day.hol, .sch-grid.week .sch-day.hol,
.sch-bg.weekend, .sch-bg.hol, .bd-day.weekend, .bd-day.hol { background: var(--wk-bg); }
.sch-head.sat, .sch-day.sat .sch-date, .sch-dh.sat .sch-date, .bd-day.sat .bd-dayhead,
.sch-grid.week .sch-day.sat .sch-date { color: var(--wk-sat); }
.sch-head.sun, .sch-day.sun .sch-date, .sch-dh.sun .sch-date, .bd-day.sun .bd-dayhead,
.sch-day.hol .sch-date, .sch-dh.hol .sch-date, .bd-day.hol .bd-dayhead,
.sch-grid.week .sch-day.sun .sch-date, .sch-grid.week .sch-day.hol .sch-date { color: var(--wk-sun); }
.sch-hol { font-size: 11px; font-weight: 600; color: var(--wk-sun); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-date .sch-hol { display: block; }
.bd-dayhead .sch-hol { font-size: 12px; margin-left: 4px; }
@media (max-width: 640px) { .sch-grid.month .sch-hol { display: none; } .sch-grid.month { grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .8fr)); } }
.sch-cal-head .sch-head.sat, .sch-grid .sch-head.sat { color: var(--wk-sat); font-weight: 700; }
.sch-cal-head .sch-head.sun, .sch-grid .sch-head.sun { color: var(--wk-sun); font-weight: 700; }
.pl-month { grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr)); }
.pl-cell.weekend, .pl-cell.hol { background: var(--wk-bg); }
.pl-wd.sat, .pl-cell.sat .pl-dn { color: var(--wk-sat); }
.pl-wd.sun, .pl-cell.sun .pl-dn, .pl-cell.hol .pl-dn { color: var(--wk-sun); }
.pl-cell.today .pl-dn { color: #fff; }
.pl-cell .sch-hol { display: block; }
@media (max-width: 640px) { .pl-cell .sch-hol { font-size: 9.5px; } }

/* ---- 10/19: 스케쥴 month = the same card-cell calendar as 일정표; 일정표 phone month = titled chips like 스케쥴 ---- */
.pl-month { gap: 6px; border: 0; }
.pl-wd { border: 0; text-align: center; padding: 2px 0; font-size: 12px; font-weight: 400; }
.pl-wd.sat, .pl-wd.sun { font-weight: 700; }
.pl-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-height: 90px; gap: 3px; overflow: hidden; }
.pl-cell.weekend, .pl-cell.hol { background: var(--wk-bg); }
.pl-cell.other { opacity: .45; }
.pl-cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 111, 168, .18); }
.pl-dn, .pl-cell.today .pl-dn { font-size: 12px; font-weight: 650; color: var(--ink2); background: none; padding: 0; border-radius: 0; }
.pl-cell.other .pl-dn { color: var(--ink2); }
.pl-cell.sat .pl-dn { color: var(--wk-sat); }
.pl-cell.sun .pl-dn, .pl-cell.hol .pl-dn { color: var(--wk-sun); }
@media (max-width: 640px) {
  .pl-month { gap: 3px; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .8fr)); }
  .pl-wd { font-size: 11px; }
  .pl-cell { min-height: 54px; padding: 4px 3px; border-radius: 8px; gap: 2px; }
  .pl-dn { align-self: center; font-size: 11.5px; }
  .pl-cell .sch-hol { display: none; }

  .sch-grid.month .sch-day { flex-direction: column; flex-wrap: nowrap; align-content: stretch; justify-content: flex-start; }
  .sch-grid.month .sch-date { flex: 0 0 auto; margin-bottom: 1px; }
  .sch-grid.month .bd-ev { flex: 0 0 auto; }
  .sch-grid.month .bd-ev { width: 100%; height: auto; min-height: 0; padding: 0 3px !important; margin: 0 0 2px !important;
    border: 0; border-left: 2px solid var(--kc, #a3a3a3); border-radius: 3px;
    background: color-mix(in srgb, var(--kc, #a3a3a3) 14%, var(--panel)); color: var(--ink);
    font-size: 10.5px; line-height: 1.4; overflow: hidden; }
  .sch-grid.month .bd-ev > :not(.bd-title) { display: none; }
  .sch-grid.month .bd-ev .bd-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sch-grid.month .sch-over { display: none; }
  .sch-grid.month .small-link { display: block; font-size: 10px; text-align: center; pointer-events: none; }
}

/* ---- 10/19: requested dates from mail (auto / change request) + SHIP OUT carrier ---- */
.auto-tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--brand-ink); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.ful-auto { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.date-req { border: 1px solid var(--warn-line); background: var(--warn-bg); margin-bottom: 12px; }
.date-req .dr-line { margin: 6px 0 8px; }
.date-req .dr-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.trk-wrap { display: flex; gap: 8px; align-items: center; }
.trk-wrap input { flex: 1; min-width: 0; }
.bd-ev .bd-auto { font-size: 10px; font-weight: 700; color: var(--brand-ink); background: var(--accent-soft); border-radius: 4px; padding: 0 5px; margin-left: 4px; }

/* ---- 10/19: new order from a dropped / pasted order form ---- */
.onr h3 { margin-bottom: 4px; }
.onr textarea { width: 100%; }
.onr-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.onr-row input { flex: 1; min-width: 180px; }
.onr-img { color: var(--t-warn); margin: 8px 0 0; }
/* the pick-up / install date boxes never shrink to nothing in a narrow column (the new-order check screen) */
.field .ful-range input[type=date] { min-width: 128px; }

/* 10/19: on a phone the menu scrolls sideways and the dividers were squeezed to 0px wide — they never shrink */
.menubar > .sep { flex: 0 0 1px; min-width: 1px; }

/* 영업: 고객사 → 빌딩별 하위 메뉴 (Aaron 10/20) */

/* 영업 — 빌딩 현황 (Aaron 10/20) */
.bs { padding: 0 0 24px; }
.bs-tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.bs-tab { border: 0; background: none; padding: 7px 12px 8px; font: inherit; font-size: 13.5px; color: var(--ink2); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.bs-tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent, #2d7ff9); }
.bs-tabs { align-items: flex-end; flex-wrap: wrap; }
.bs-crumb { display: inline-flex; align-items: center; gap: 6px; padding: 7px 4px 9px; font-size: 13.5px; }
.bs-crumb .sep { color: var(--ink3); }
.bs-x { border: 0; background: none; color: var(--ink3); font-size: 14px; cursor: pointer; padding: 0 4px; line-height: 1; }
.bs-x:hover { color: var(--ink); }
.bs-csum { margin-left: auto; padding: 0 2px 9px; }
.bs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); border-bottom: 1px solid var(--line); }
.bs-card { padding: 12px 16px; border-right: 1px solid var(--line); }
.bs-card:last-child { border-right: 0; }
.bs-card .l { font-size: 12px; color: var(--ink3); }
.bs-card .v { font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bs-tri { display: inline-grid; grid-template-columns: 1fr auto 1fr auto 1fr; column-gap: 6px; align-items: baseline; justify-items: center; }   /* equal columns: dots fixed, same gap to every number */
.bs-tri .l { font-size: 12px; color: var(--ink3); }
.bs-tri .v { font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bs-tri .s.l { color: var(--ink3); }
.bs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.bs-sorts { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bs-sort { height: 28px; padding: 0 10px; border-radius: 7px; font: inherit; font-size: 12.5px; cursor: pointer; border: 1px solid var(--line2); background: var(--panel); color: var(--ink2); }
.bs-sort.on { border-color: var(--accent, #2d7ff9); background: var(--accent-soft, #e8f0fb); color: var(--ink); font-weight: 600; }
.bs-wrap { overflow-x: auto; }
.bs-t { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13.5px; }
.bs-t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink3); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bs-t td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bs-t th:first-child, .bs-t td:first-child { padding-left: 16px; }
.bs-t tr:hover td { background: var(--row-hover); }
.bs-t td.u { font-weight: 700; }
.bs-t td.ok { color: var(--t-ok, #1f6b3a); }
.bs-t td.warn { color: var(--t-warn, #9a4a00); }
.bs-t th.p { width: 230px; }
.bs-name { font-weight: 600; color: var(--link); text-decoration: none; }
.bs-name:hover { text-decoration: underline; }
.bs-name.none { color: var(--ink3); font-weight: 400; font-style: italic; }
.bs-barw { display: flex; align-items: center; gap: 8px; }
.bs-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; display: flex; min-width: 90px; }
.bs-bar i { display: block; height: 100%; }
.bs-bar i.d { background: #3f8f5c; } .bs-bar i.o { background: #e3a23b; } .bs-bar i.z { background: #b9c0c9; }
.bs-split { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.bs-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.bs-cur b { font-size: 15px; }
.bs-cur .bs-back { height: 30px; padding: 0 12px; }
@media (max-width: 760px) { .bs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bs-card:nth-child(2n) { border-right: 0; } .bs-sorts { margin-left: auto; justify-content: flex-end; } }
/* 빌딩 현황 10/24 (Aaron): 이름 칸 고정 · 합계 줄 · 건수 줄 */
.bs-card { border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.bs-card .v .vs { display: block; font-size: 12px; font-weight: 500; color: var(--ink3); margin-top: 1px; }
.bs-tri .l { white-space: nowrap; font-size: 11.5px; }
.bs-card.warn .v { color: var(--t-warn, #9a4a00); }
.bs-t { min-width: 960px; }
.bs-t.co { min-width: 1140px; }
.bs-t th:first-child, .bs-t td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel, #fff); box-shadow: 1px 0 0 var(--line); max-width: 190px; white-space: normal; }
.bs-t thead th:first-child { z-index: 2; }
.bs-t tr:hover td:first-child { background: var(--row-hover); }
.bs-t th, .bs-t td, .bs-t th.n, .bs-t td.n { text-align: center; }   /* Aaron 10/25: 숫자·제목 가운데 */
.bs-t th:first-child, .bs-t td:first-child { text-align: left; }
.bs-t td.p .bs-barw { justify-content: center; }
.bs-t td .sub { font-size: 11.5px; color: var(--ink3); font-weight: 400; margin-top: 1px; }
.bs-t td.warn .sub { color: var(--t-warn, #9a4a00); opacity: .8; }
.bs-t td.b { font-weight: 700; }
.bs-t tfoot td { font-weight: 700; background: var(--panel2, #f5f7fa); border-top: 2px solid var(--line, #cfd6df); border-bottom: 0; }
.bs-t tfoot td:first-child { background: var(--panel2, #f5f7fa); }
.bs-t tfoot tr:hover td { background: var(--panel2, #f5f7fa); }
@media (max-width: 760px) {
  .bs-t th:first-child, .bs-t td:first-child { max-width: 128px; min-width: 104px; padding-left: 10px; font-size: 13px; }
  .bs-t .bs-bar { display: none; } .bs-t th.p { width: auto; } .bs-t { min-width: 760px; } .bs-t.co { min-width: 920px; }
  .bs-tri .l { white-space: nowrap; font-size: 11px; } }

/* ===== 입고 · 출고 · 창고간이동 · 재고조정 redesign (Aaron 10/21) =====
   small colored icon + light status pill next to the title, white cards, save button on the right of the bottom bar.
   Each task keeps its color (in green, out pink, move blue, adj purple) on the icon, pill and save button only. */
.doc2 { --act-soft: color-mix(in srgb, var(--act) 13%, var(--panel, #fff)); --act-ink: color-mix(in srgb, var(--act) 78%, #000); }
.doc2 .page-head { align-items: center; margin-bottom: 12px; }
.d2-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.d2-head h1 { margin: 0; font-size: 22px; }
.d2-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--act-soft); color: var(--act); display: grid; place-items: center; flex-shrink: 0; }
.d2-icon svg { width: 20px; height: 20px; }
.d2-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--act-soft); color: var(--act-ink); border: 1px solid color-mix(in srgb, var(--act) 28%, transparent); }
.d2-pill.no-loc { font-weight: 500; opacity: .85; }
.d2-pill.to-supplier { border-style: dashed; border-color: var(--act); }
.doc2 .card { border-radius: 12px; }
.doc2 .doc-head { margin-bottom: 12px; }
.d2-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.d2-grid .d2-wide1 { grid-column: span 1; } .d2-grid .d2-wide2 { grid-column: span 2; }
.d2-hint { margin: 10px 0 0; font-size: 12.5px; }
.d2-lines { padding-top: 12px; }
.d2-tabs { margin: 0 0 12px; border-bottom: 1px solid var(--line); gap: 2px; }
.d2-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; border-radius: 0; padding: 6px 12px; margin-bottom: -1px; }
.d2-tabs button.active { border-bottom-color: var(--act); background: none; color: var(--ink); font-weight: 600; }
.d2-tabs button b { color: var(--act); }
.doc2 .doc-pane { border: 0; padding: 0; margin: 0; }
.doc2 .doc-lines th, .doc2 .doc-lines td { text-align: center; }
.doc2 .doc-lines td.num .mini-step { justify-content: center; }
.d2-diff { font-weight: 700; } .d2-diff.up { color: var(--green, #1a7f37); } .d2-diff.down { color: var(--red, #b42318); }
.d2-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -2px 10px rgba(0,0,0,.04); }
.d2-sum { color: var(--ink2); font-size: 14px; } .d2-sum strong { color: var(--ink); font-size: 17px; margin-left: 6px; }
.d2-save { margin-left: auto; background: var(--act) !important; border-color: var(--act) !important; color: #fff !important; height: 38px; padding: 0 22px; font-weight: 600; }
.d2-save:hover { filter: brightness(1.08); }
.doc2 ~ .bulk, .doc2 .bulk { margin-top: 14px; }
@media (max-width: 900px) { .d2-grid { grid-template-columns: 1fr 1fr; } .d2-grid .d2-wide2 { grid-column: 1 / -1; } }
@media (max-width: 600px) { .d2-grid { grid-template-columns: 1fr; } .d2-bar { padding: 10px 12px; } .d2-save { flex: 1; } .d2-pill { font-size: 12.5px; } }

/* ===== no pill shapes anywhere in the Hub (Aaron 10/21): tags, chips, filter chips, badges -> small rounded rectangles.
   Kept round on purpose: the toggle switch track (.tgs), progress bars (.b-split), round icons and count dots. ===== */
.status, .kind, .badge, .pill, .check-tag, .status-chips a, .hero-chips span, .b-hero .b-chips span, .bp-type, .period-select,
.cb-tag, .who-badge, .chip, .bd-ev .bd-st, .bd-ev .bd-chg, .bd-lab, .ro-mark, .bcat, .viewas-bar a, .ck-n, .ch-alert, .d2-pill,
.ph-kinds label, .td-chips a { border-radius: 6px !important; }

/* order form: the tracking number box fills its field like the others (Aaron 10/21) */
.trk-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.trk-wrap input[name=ship_tracking] { flex: 1; min-width: 0; width: 100%; }

/* customer invoice flag on the tracker (Aaron 10/21) */
.ci-flag { font-size: 12px; cursor: default; } .ci-flag.none { opacity: .55; filter: grayscale(1); }

/* Lucide line icons for the tracker marks (mail / invoice / memo) - Aaron 10/21 */
svg.lu { width: 14px; height: 14px; vertical-align: -2px; }
.tracker svg.lu { color: var(--ink3, #8a94a0); } .tracker a:hover svg.lu { color: var(--link); }
.ci-flag svg.lu, .ci-flag.none svg.lu { color: var(--ink3, #8a94a0); }   /* no colour: same grey as the mail / memo marks (Aaron 10/21) */
.ci-flag.none { opacity: 1; filter: none; }

/* 주문 트래커 위 칩: 묶음(보기 · 상태 · 할 일)으로 정렬 (Aaron 10/21) — 묶음은 같이 줄바꿈, 휴대폰은 묶음마다 한 줄에 같은 너비.
   10/22: 주문 트래커(.sc-groups)에만 — 다른 화면의 칩까지 세로로 늘어서던 것 고침 */
.status-chips.sc-groups { align-items: center; column-gap: 10px; }
.status-chips .sc-g { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.status-chips .sc-g a { white-space: nowrap; }
.status-chips.sc-groups .sc-g + .sc-g { border-left: 1px solid var(--line2, #d5d9e0); padding-left: 10px; }   /* 11/15 Aaron: a thin line between the chip groups */
@media (max-width: 720px) {
  .status-chips.sc-groups { display: grid; grid-template-columns: 1fr; row-gap: 8px; }
  .status-chips.sc-groups .chip-sep { display: none; }
  .status-chips.sc-groups .period-select { width: 100%; justify-self: stretch; }
  .status-chips.sc-groups .sc-g + .sc-g { border-left: 0; padding-left: 0; }
  .status-chips .sc-g { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
  .status-chips .sc-g a { text-align: center; padding-left: 4px; padding-right: 4px; overflow: hidden; text-overflow: ellipsis; }
  /* 입출고내역: 기간 버튼 3개씩 같은 너비, 전표별/줄 단위는 그 아래 한 줄 (10/22) */
  .moves-top { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .moves-top .period-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .moves-top .period-chips a { text-align: center; padding-left: 4px; padding-right: 4px; }
  .moves-top .view-toggle { display: grid; grid-template-columns: 1fr 1fr; }
  .moves-top .view-toggle a { text-align: center; }
}

/* 로고 · 소유 문구 (Aaron 10/22) */
.brand .brand-mark { width: 22px; height: 22px; flex: none; display: block; }
.brand b { line-height: 1; } .brand span { line-height: 1; }
.site-foot { text-align: center; font-size: 11.5px; color: var(--ink3, #9aa1a9); opacity: .8; padding: 22px 12px 26px; }
@media (prefers-color-scheme: dark) { .brand .brand-mark { filter: invert(1); } }
@media print { .site-foot { display: none; } }

/* 10/22 Aaron: 설정 칸 정렬 (휴대폰) — 첫 화면은 이름 칸 폭을 맞추고, 비밀번호는 2칸씩 + 버튼 한 줄 */
@media (max-width: 700px) {
  .perm-first { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; align-items: center; }
  .perm-first label { display: contents; }
  .perm-first select { width: 100%; min-width: 0; }
  .pw-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pw-form > * { width: 100%; min-width: 0; margin: 0; }
  .pw-form > .btn { grid-column: 1 / -1; }
}

/* 빌딩 현황 10/25 (Aaron B+D): 숫자 막대 · 완료율 원 */
.bs-seg { display: flex; height: 20px; border-radius: 5px; overflow: hidden; background: var(--line); min-width: 110px; max-width: 240px; margin: 0 auto; }
.bs-seg i { flex-basis: 0; min-width: 30px; padding: 0 3px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11.5px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.bs-seg i.d { background: #3f8f5c; } .bs-seg i.o { background: #e3a23b; } .bs-seg i.z { background: #8f99a6; } .bs-seg i.q { background: #5b8fd6; }
.bs-seg.empty { opacity: .5; }
.bs-lg { display: inline-flex; gap: 8px; white-space: nowrap; }
.bs-lg span:before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.bs-lg .d:before { background: #3f8f5c; } .bs-lg .o:before { background: #e3a23b; } .bs-lg .z:before { background: #8f99a6; } .bs-lg .q:before { background: #5b8fd6; }
.bs-ringw { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.bs-ring { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative; }
.bs-ring:after { content: ""; position: absolute; inset: 7px; background: var(--panel, #fff); border-radius: 50%; }
.bs-ring b { position: relative; z-index: 1; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bs-rt { font-size: 12px; color: var(--ink2); line-height: 1.45; min-width: 0; }
.bs-ringc { overflow: hidden; }
.bs-rt b { color: var(--ink); }
@media (max-width: 760px) { .bs-seg { min-width: 90px; max-width: 120px; } }
/* 설정 정리 10/25 (Aaron): 상태 줄 · 묶음 제목 · 끝난 일 */
.set-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-width: 900px; margin: 4px 0 8px; }
.set-status .st { display: block; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.set-status .st:hover { border-color: var(--accent, #2d7ff9); }
.set-status .st span { display: block; font-size: 12px; color: var(--ink3); }
.set-status .st b { display: block; font-size: 14px; margin-top: 2px; }
.set-status .st b:before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: #b9c0c9; }
.set-status .st.ok b:before { background: #3f8f5c; } .set-status .st.ok b { color: #2f6e46; }
.set-status .st.warn b:before { background: #e3a23b; } .set-status .st.warn b { color: #a5670b; }
.set-status .st.bad b:before { background: #d64545; } .set-status .st.bad b { color: #b42318; }
.set-status .st.off b { color: var(--ink3); font-weight: 600; }
.set-else { margin: 0 0 4px; }
.set-group { margin: 22px 0 8px; font-size: 13px; color: var(--ink3); font-weight: 600; max-width: 900px; border-top: 1px dashed var(--line); padding-top: 12px; }
.set-card.set-done > summary { color: var(--ink2); }
.set-card.set-done { opacity: .85; }
.set-sub { margin: 10px 0 6px; font-size: 14px; }
@media (max-width: 760px) { .set-status { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 10/27: header name in capitals, one word mark 'SPRINGBLINDS HUB' */
@font-face { font-family: "Quantico"; font-style: normal; font-weight: 700; font-display: block; src: url("fonts/quantico-700.woff2") format("woff2"); }   /* SIL OFL, fonts/Quantico-OFL.txt — 10/29: block + preload (base.html); swap drew the name in the phone font first, then it jumped */
.brand b.brand-name { font-family: "Quantico", var(--font, system-ui), sans-serif; font-size: 21px; font-weight: 700; letter-spacing: -1.5px; }
.brand:has(.brand-name) { gap: 6px; }   /* the SB mark sits a little closer to the name (10/27) */

/* 스케쥴 반복 일정 (10/27) */
.pl-rep select[name=rep] { margin-bottom: 2px; }
.pl-rep-wd { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-chip { display: inline-flex; cursor: pointer; }
.pl-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pl-chip span { min-width: 34px; text-align: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink2); background: var(--panel); }
.pl-chip input:checked + span { background: var(--nav, #1f4e79); border-color: var(--nav, #1f4e79); color: #fff; font-weight: 650; }
.pl-chip input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 1px; }
.pl-rep-mo { display: flex; flex-direction: column; gap: 4px; }
.pl-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.pl-rep-end { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.pl-rep-endrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
form .field .pl-rep-endrow select { width: auto; min-width: 130px; flex: none; }
.pl-rp { font-weight: 700; margin-right: 3px; opacity: .75; }
.pl-reponday { color: var(--brand-ink, #1f4e79); font-weight: 600; }
.pl-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* drag & drop onto upload fields (dnd.js, 10/28) */
.dnd-zone { border-radius: 8px; transition: outline-color .15s, background .15s; outline: 2px dashed transparent; outline-offset: 3px; }
body.dnd-dragging .dnd-zone { outline-color: #9fb7d9; }
.dnd-zone.dnd-over { outline-color: var(--accent, #2f6fde) !important; background: rgba(47, 111, 222, .08); }
.dnd-msg { font-size: 12px; color: var(--muted, #667); margin-left: 6px; }

.pill.bad { background: #fde3e3; color: #b42318; }

/* 10/28 Aaron: filter checkboxes — less space between the box and its words, so each one stays apart from the next */
.filter-bar > .check { gap: 4px; }
.filter-bar > .check > input[type=checkbox] { margin: 0; }

/* 10/28 Aaron: status cards in the order of the tabs — 4 a row: 메일·주문 받기 / 연동 / 생산 기준 + 백업 */
@media (min-width: 700px) { .set-status { grid-template-columns: repeat(4, minmax(150px, 1fr)); max-width: 760px; } }

/* 10/28 Aaron: ring legend — numbers right-aligned, words left-aligned, a little gap between */
.bs-rt { display: grid; grid-template-columns: auto auto; column-gap: 6px; justify-content: start; align-items: baseline; }
.bs-rt b { text-align: right; font-variant-numeric: tabular-nums; }
.bs-rt span { text-align: left; white-space: nowrap; }

.c1s-note { margin: 2px 0 10px; font-size: 13.5px; color: var(--ink2); } .c1s-note .small-link { margin-left: 8px; }

/* 11/04 Aaron: tracking row on a phone — number box + links stay in one column next to the label; links never break per letter */
form .field > .trk-box { flex: 1 1 auto; min-width: 0; }
.trk-box .trk-wrap { width: 100%; }
.trk-box .small-link, .trk-box .small { white-space: nowrap; }
.trk-box .trk-wrap input[name=ship_tracking] { flex: 1 1 auto; min-width: 9em; }
/* 11/04 mobile check: "merge with another order" box stays inside its card on a phone */
@media (max-width: 600px) {
  .merge-form select { min-width: 0; width: 100%; }
  .merge-find { display: block; width: 100%; }
  .merge-results { min-width: 0; width: calc(100vw - 48px); max-width: 100%; }
}
/* 11/04 Aaron: building page — client / management company as two labelled boxes under the name (no more selects inside the title) */
.page-head > .bld-cls { order: 2; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.page-head > .bld-cls ~ .toolbar { order: 1; }
.bld-cls-row { display: flex; align-items: center; gap: 8px; margin: 0; }
.bld-cls-row label { font-size: 13px; color: var(--ink2); white-space: nowrap; }
.bld-cls-row select { min-width: 200px; }
@media (max-width: 600px) {
  .page-head > .bld-cls { flex-direction: column; gap: 8px; }
  .bld-cls-row label { width: 64px; flex-shrink: 0; }
  .bld-cls-row select { flex: 1; min-width: 0; width: 100%; }
  .page-head > .bld-cls ~ .toolbar { order: 3; width: 100%; }
}

/* 11/05 memo box: change logs folded */
.memo-log { margin-top: 8px; }
.memo-log .memo-log-list li { opacity: .8; }

/* ---- 11/06 Aaron '드래그드랍 … 업로드 되는 종류들의 칸 모양과 정렬 통일' (나): one upload box everywhere ----
   [icon] title / file types ......... [파일 선택]   + file chips + one result line under it.
   Built by dnd.js for <input type=file data-up="title">; the pages with their own drop code use the same classes. */
.up { position: relative; min-width: 0; }
.up-zone { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink2); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; position: relative; }
.up-zone:hover, .up-zone.over, .up-zone.on, .up-zone.dnd-over { border-color: var(--accent-solid); background: var(--accent-soft); }
body.dnd-dragging .up-zone { border-color: var(--accent-line); }
.up-zone.has { border-style: solid; border-color: var(--accent-line); }
.up-zone.is-bad { border-color: var(--danger) !important; background: var(--err-bg); }
.up-zone:focus-visible { outline: none; box-shadow: var(--focus); }
.up-zone input[type=file] { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.up-ic { width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--accent-soft); color: var(--accent-solid);
  display: inline-flex; align-items: center; justify-content: center; }
.up-ic svg { width: 18px; height: 18px; }
.up-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.up-t b { font-size: 14px; font-weight: 650; color: var(--ink); }
.up-t span { font-size: 12px; color: var(--ink3); line-height: 1.4; }
.up-t b, .up-t span { word-break: keep-all; overflow-wrap: anywhere; }   /* 11/14: no '끌 / 어다' breaks inside a word */
.up-pick { margin-left: auto; height: 34px; display: inline-flex; align-items: center; white-space: nowrap; flex: none; pointer-events: none; }
.up-s .up-zone, .up-zone.up-s { min-height: 52px; padding: 8px 12px; }
.up-s .up-ic, .up-zone.up-s .up-ic { width: 30px; height: 30px; }
.up-s .up-ic svg { width: 16px; height: 16px; }
.up-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.up-files:empty { display: none; }
.up-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel2); font-size: 12.5px; color: var(--ink); }
.up-chip svg { width: 14px; height: 14px; flex: none; color: var(--ink2); }
.up-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-chip i { font-style: normal; color: var(--ink3); white-space: nowrap; }
.up-chip button { width: 22px; height: 22px; border: 0; background: none; color: var(--ink3); padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 4px; }
.up-chip button:hover { color: var(--danger); background: var(--err-bg); }
.up-msg { font-size: 12.5px; margin-top: 6px; color: var(--ink2); }
.up-msg:empty { display: none; }
.up-msg.ok { color: var(--t-ok); } .up-msg.err { color: var(--t-red); }
/* a box with its button beside it (the Excel imports: [box] [가져오기]) */
.upload-row:has(> .up), form:has(> .up) { align-items: flex-start; }
.upload-row > .up, form > .up { flex: 1 1 320px; }
.upload-row > .btn, form:has(> .up) > .btn { margin-top: 9px; }
@media (max-width: 600px) {
  .up-zone { flex-wrap: wrap; row-gap: 10px; }
  .up-t { flex: 1 1 calc(100% - 48px); }               /* 11/14: the words take the whole line, the button goes under them */
  .up-pick { margin-left: 48px; }
  .up-s .up-pick { margin-left: 42px; }
}


/* 11/14: Korean lines break between words, never inside one ('끌 / 어다', '수량입 / 니다'); a very long token (a file path, a URL)
   still wraps so nothing runs off the screen. Rules that ask for break-all (codes, part numbers) keep it. */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: break-word; }

/* 11/18 Aaron: dropdown lists readable in the dark theme everywhere (light text on the white native list before) */
select option { background: var(--panel); color: var(--ink); }

/* 11/23 Aaron '칸 안에 글자들 정렬' (r516): in two columns a field next to a taller one (배송 추적 번호 + ShipStation lines,
   픽업/출고/시공일 + 시공일 추가) stayed in the middle of the tall row, so the boxes of the two columns did not line up.
   Each field sits at the top of its row and its label is on the line of its first box. One column (phone): unchanged. */
@media (min-width: 901px) {
  .grid-fields { align-items: start; }
  .grid-fields .field > label:first-child, form .grid-fields .field.ful-field > label:first-child { align-self: flex-start; line-height: 34px; min-height: 34px; padding-top: 0; }
}
