/* SA Maintenance theme — gold #F9BD01, black #000000, white #FFFFFF.
   Rule of thumb: gold always carries black text, never white. */

:root {
  --gold: #F9BD01;
  --gold-soft: #FFF4CC;
  --black: #000000;
  --white: #FFFFFF;
  --ink: #111111;
  --ink-2: #4a4a4a;
  --line: #dcdcd6;
  --surface: #f6f6f3;
  --error: #b42318;
  --radius: 10px;
  --tap: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface);
}
a { color: var(--black); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Top bar ------------------------------------------------------------ */
.topbar {
  background: var(--black);
  color: var(--white);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 16px;
  min-height: 56px;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--gold); color: var(--black);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
}
.topnav { display: flex; gap: .25rem; margin-left: 1rem; }
.topnav a {
  white-space: nowrap;
  color: var(--white); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
}
.topnav a:hover { background: #222; }
.topnav a.active { background: var(--gold); color: var(--black); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.user-menu .who { color: #cfcfcf; white-space: nowrap; }
.brand { flex: none; }
.brand-name { white-space: nowrap; }
.brand-logo { height: 38px; width: 38px; object-fit: contain; display: block; background: var(--white); border-radius: 8px; }
.auth-card .brand-logo { height: 48px; width: 48px; border: 1px solid var(--line); }
.link-button { white-space: nowrap; }
.user-menu .who { display: none; }
@media (max-width: 1180px) and (min-width: 1001px) { .topnav { margin-left: .25rem; gap: 0; } .topnav a { padding: .45rem .55rem; font-size: .88rem; } }

.user-menu form { margin: 0; }
.link-button {
  background: none; border: 1px solid #444; color: var(--white);
  padding: .35rem .7rem; border-radius: 999px; font: inherit; cursor: pointer;
}
.link-button:hover { border-color: var(--gold); color: var(--gold); }

/* --- Bottom tab bar (phones) ------------------------------------------- */
.tabbar { display: none; }
@media (max-width: 1000px) {
  .topnav, .user-menu .who { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--black); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; color: #d0d0d0; text-decoration: none; font-size: .72rem; font-weight: 600;
  }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--gold); }
  .tabbar a.active svg { stroke: var(--gold); }
  main.page { padding-bottom: 96px; }
}

/* --- Layout ------------------------------------------------------------ */
main.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.narrow { max-width: 680px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 2fr 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 1rem; }
.section-title { display: flex; align-items: center; gap: .5rem; margin: 1.5rem 0 .6rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.section-title .count { background: var(--black); color: var(--white); border-radius: 999px; padding: 0 .55rem; font-size: .8rem; }
.empty { padding: 1.25rem; text-align: center; color: var(--ink-2); background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); }

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: 0 1.1rem;
  border-radius: var(--radius); border: 2px solid var(--black);
  background: var(--white); color: var(--black);
  font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn-primary:hover { background: #e8b000; border-color: #e8b000; }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: #222; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 .75rem; font-size: .9rem; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-row .btn { flex: 1 1 140px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}

/* --- Forms ------------------------------------------------------------- */
label, .label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field { margin-bottom: 1.1rem; }
.help { font-size: .875rem; color: var(--ink-2); margin-top: .3rem; }
input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .75rem;
  border: 1.5px solid #b9b9b2; border-radius: var(--radius); background: var(--white);
  font: inherit; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--black) 50%), linear-gradient(135deg, var(--black) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.2rem; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--black); flex: none; }
.check-emergency { background: var(--gold-soft); border: 1.5px solid var(--gold); padding: .8rem; border-radius: var(--radius); }
.errorlist { list-style: none; margin: .35rem 0 0; padding: 0; color: var(--error); font-size: .9rem; font-weight: 600; }
.form-errors { border: 2px solid var(--error); color: var(--error); background: #fff5f4; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.form-errors ul { margin: 0; padding-left: 1.1rem; }

/* --- Messages ---------------------------------------------------------- */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: .5rem; font-weight: 600; border: 1.5px solid var(--black); background: var(--white); }
.messages li.success { border-left: 8px solid var(--gold); }
.messages li.error { border-color: var(--error); color: var(--error); }

/* --- Chips and badges -------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  border: 1.5px solid var(--black); background: var(--white); color: var(--black); white-space: nowrap;
}
.chip-new { border-color: var(--gold); background: var(--gold-soft); }
.chip-assigned { border-style: solid; }
.chip-in_progress { background: var(--black); color: var(--white); }
.chip-on_hold { border-style: dashed; }
.chip-completed, .chip-cancelled { border-color: var(--line); color: var(--ink-2); }
.badge-priority { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 6px; border: 1.5px solid var(--black); }
.badge-p1 { background: var(--gold); border-color: var(--gold); }
.badge-p2 { background: var(--black); color: var(--white); }
.badge-p3, .badge-p4 { background: var(--white); }
.flag-overdue { display: inline-flex; align-items: center; gap: .25rem; background: var(--gold); color: var(--black); font-weight: 800; font-size: .75rem; padding: .15rem .5rem; border-radius: 6px; text-transform: uppercase; }

/* --- Work order cards --------------------------------------------------- */
.wo-list { display: grid; gap: .65rem; }
.wo-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; border-left: 6px solid var(--line);
}
.wo-card:hover { border-color: var(--black); }
.wo-card.p1 { border-left-color: var(--gold); }
.wo-card.p2 { border-left-color: var(--black); }
.wo-card.attention { box-shadow: inset 0 0 0 2px var(--gold); }
.wo-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .35rem; }
.wo-num { font-weight: 800; font-size: .85rem; letter-spacing: .02em; }
.wo-title { font-weight: 700; font-size: 1.05rem; }
.wo-loc { color: var(--ink-2); font-size: .9rem; }
.wo-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin-top: .35rem; }

/* --- Detail ------------------------------------------------------------ */
.detail-head { background: var(--black); color: var(--white); border-radius: var(--radius); padding: 18px; }
.detail-head .chip { border-color: var(--white); }
.detail-head .chip-in_progress { background: var(--gold); color: var(--black); border-color: var(--gold); }
.detail-head .wo-loc { color: #d6d6d6; }
.detail-head .badge-p2, .detail-head .badge-p3, .detail-head .badge-p4 { background: transparent; color: var(--white); border-color: var(--white); }
.detail-head h1 { margin: .4rem 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
dl.facts dt { font-weight: 700; color: var(--ink-2); }
dl.facts dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--black); }
.timeline li.kind-status::before, .timeline li.kind-created::before { background: var(--gold); border-color: var(--gold); }
.timeline .when { font-size: .8rem; color: var(--ink-2); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.photo-grid a { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--surface); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .tag { position: absolute; left: 6px; bottom: 6px; background: var(--black); color: var(--white); font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; }
details.action { border: 1.5px solid var(--black); border-radius: var(--radius); background: var(--white); }
details.action + details.action { margin-top: .6rem; }
details.action summary { cursor: pointer; padding: .8rem 1rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
details.action summary::-webkit-details-marker { display: none; }
details.action summary::after { content: "+"; font-size: 1.2rem; }
details.action[open] summary::after { content: "–"; }
details.action .body { padding: 0 1rem 1rem; }

/* --- Photo picker ------------------------------------------------------- */
.photo-picker .btn-row { margin-bottom: .6rem; }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.photo-previews .thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface); }
.photo-previews .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews .thumb button {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--black); color: var(--white); font-size: 1rem; cursor: pointer;
}
.photo-note { font-size: .85rem; color: var(--ink-2); display: flex; gap: .4rem; align-items: center; }

/* --- Location picker ----------------------------------------------------- */
.loc-picker { border: 1.5px solid #b9b9b2; border-radius: var(--radius); background: var(--white); overflow: hidden; }
.loc-selected { padding: .75rem; background: var(--gold-soft); border-bottom: 1.5px solid var(--gold); display: none; }
.loc-selected.show { display: block; }
.loc-selected strong { display: block; }
.loc-search { padding: .6rem; border-bottom: 1px solid var(--line); }
.loc-search input { min-height: 44px; }
.loc-crumbs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .5rem .75rem; font-size: .85rem; border-bottom: 1px solid var(--line); }
.loc-crumbs button { background: none; border: none; padding: .15rem .25rem; font: inherit; text-decoration: underline; cursor: pointer; color: var(--black); }
.loc-crumbs span.sep { color: var(--ink-2); }
.loc-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.loc-list li + li { border-top: 1px solid var(--line); }
.loc-list button {
  width: 100%; min-height: 52px; text-align: left; background: var(--white); border: none; padding: .6rem .75rem;
  font: inherit; display: flex; align-items: center; gap: .6rem; cursor: pointer;
}
.loc-list button:hover { background: var(--surface); }
.loc-list .kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); padding: 0 .35rem; border-radius: 4px; }
.loc-list .path { display: block; font-size: .8rem; color: var(--ink-2); }
.loc-list .chev { margin-left: auto; font-size: 1.2rem; }
.loc-actions { padding: .6rem; border-top: 1px solid var(--line); background: var(--surface); }

/* --- Category picker ----------------------------------------------------- */
.cat-group { margin-bottom: .75rem; }
.cat-group-name { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: .35rem; }
.cat-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.cat-options label { margin: 0; font-weight: 600; }
.cat-options input { position: absolute; opacity: 0; pointer-events: none; }
.cat-options span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 .9rem;
  border: 1.5px solid var(--black); border-radius: 999px; background: var(--white); cursor: pointer;
}
.cat-options input:checked + span { background: var(--gold); border-color: var(--gold); }
.cat-options input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.cat-options label.hidden { display: none; }

/* --- Dispatch ----------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: inherit; }
.tile .n { font-size: 2rem; font-weight: 800; line-height: 1; }
.tile .l { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.tile.hot { background: var(--gold); border-color: var(--gold); }
.tile.hot .l { color: var(--black); }
.filters { display: grid; gap: .5rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1rem; align-items: end; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr repeat(5, 1fr) auto; } }
.filters .field { margin: 0; }
.filters label { font-size: .8rem; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; background: var(--black); color: var(--white); padding: .6rem .7rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
table.data td { padding: .6rem .7rem; border-top: 1px solid var(--line); vertical-align: top; }
table.data tr.attention td:first-child { box-shadow: inset 5px 0 0 var(--gold); }
table.data .assign-form { display: flex; gap: .35rem; min-width: 220px; }
table.data .assign-form select { min-height: 36px; padding: .3rem 2rem .3rem .5rem; font-size: .88rem; }

/* --- Location tree ------------------------------------------------------- */
.tree, .tree ul { list-style: none; margin: 0; padding-left: 1.1rem; }
.tree { padding-left: 0; }
.tree li { margin: .2rem 0; }
.tree .node { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem 0; flex-wrap: wrap; }
.tree .t { font-size: .68rem; font-weight: 800; text-transform: uppercase; padding: .05rem .4rem; border-radius: 4px; border: 1px solid var(--black); }
.tree .t-site { background: var(--black); color: var(--white); }
.tree .t-building { background: var(--gold); border-color: var(--gold); }
.tree .t-room { border-color: var(--line); color: var(--ink-2); }
.tree .edit { font-size: .8rem; }
.tree .inactive { opacity: .5; }

/* --- Sign in --------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--black); }
.auth-card { width: 100%; max-width: 400px; background: var(--white); border-radius: 14px; padding: 28px 24px; }
.auth-card .brand { color: var(--black); margin-bottom: 1.25rem; font-size: 1.15rem; }
.auth-stripe { height: 6px; background: var(--gold); border-radius: 14px 14px 0 0; margin: -28px -24px 24px; }
.sso-note { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-2); }

/* --- Staff work tabs ---------------------------------------------------- */
.tabs { display: flex; gap: .35rem; border-bottom: 2px solid var(--black); margin-bottom: 1rem; overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .65rem 1rem; min-height: var(--tap); text-decoration: none; font-weight: 700; color: var(--ink-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tabs a.active { background: var(--black); color: var(--white); }
.tabs .count { background: var(--line); color: var(--black); border-radius: 999px; padding: 0 .5rem; font-size: .78rem; }
.tabs a.active .count { background: var(--gold); }
.filter-row { display: flex; gap: .4rem; margin-bottom: .8rem; }
.filter-row .chip { text-decoration: none; padding: .35rem .8rem; font-size: .85rem; }
.filter-row .chip-on { background: var(--gold); border-color: var(--gold); }
.wo-card-wrap { position: relative; }
.wo-card-wrap .card-action { position: absolute; right: 12px; bottom: 12px; margin: 0; }
.wo-card-wrap .zone-flag {
  position: absolute; left: 22px; bottom: 18px; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 6px; padding: .1rem .45rem;
}
.wo-card-wrap .wo-card { padding-bottom: 56px; }
@media (max-width: 480px) {
  .tabs { gap: 0; }
  .tabs a { flex: 1; justify-content: center; padding: .6rem .35rem; font-size: .9rem; gap: .3rem; }
}
.photo-prompt { border: 2px solid var(--gold); background: var(--gold-soft); border-radius: var(--radius); padding: .9rem; margin-bottom: .75rem; }
.photo-prompt p { margin: .3rem 0 .7rem; }

/* --- Reports ---------------------------------------------------------------- */
.report-filters { display: grid; gap: .5rem; grid-template-columns: repeat(2, 1fr); align-items: end; margin-bottom: 1rem; }
@media (min-width: 900px) { .report-filters { grid-template-columns: repeat(7, minmax(0, 1fr)) auto; } }
.report-filters .field { margin: 0; }
.report-filters .field[hidden] { display: none; }
.report-filters label { font-size: .8rem; }
.report-filters input[type=date] { width: 100%; min-height: var(--tap); padding: .5rem; border: 1.5px solid #b9b9b2; border-radius: var(--radius); font: inherit; background: var(--white); }
.tiles-6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .tiles-6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .tiles-6 { grid-template-columns: repeat(6, 1fr); } }
.tile .l { margin-bottom: .35rem; }
.tile .n-sm { font-size: 1.5rem; line-height: 1.33; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.chart-card { margin-bottom: 1rem; }
.chart-wrap { position: relative; }
.chart-scroll { overflow-x: auto; padding-top: 4px; }
.chart-scroll svg { min-width: 640px; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap .grid { stroke: #e6e6e1; stroke-width: 1; }
.chart-wrap .tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-wrap .bar { fill: var(--black); }
.chart-wrap .hit { fill: transparent; }
.chart-wrap .col { outline: none; cursor: default; }
.chart-wrap .col.on .hit, .chart-wrap .col:focus-visible .hit { fill: var(--gold-soft); }
.chart-wrap .col.on .bar { fill: #333; }
.chart-tip {
  position: absolute; top: 0; transform: translate(-50%, -100%); pointer-events: none;
  background: var(--black); color: var(--white); border-radius: 8px; padding: .4rem .65rem;
  font-size: .82rem; white-space: nowrap; display: flex; flex-direction: column; line-height: 1.3;
}
.chart-tip[hidden] { display: none; }
.chart-tip span { color: #cfcfcf; }
.table-toggle { margin-top: .75rem; }
.table-toggle summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.table-toggle table { margin-top: .5rem; }
.report-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 900px) { .report-grid { grid-template-columns: 1fr 1fr; } }
.report-grid .card + .card { margin-top: 0; }
.report-grid > .card, .chart-card { min-width: 0; }
.table-scroll { overflow-x: auto; }
table.data.compact th { background: var(--surface); color: var(--ink-2); }
table.data.compact td, table.data.compact th { padding: .45rem .55rem; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inline-bar { height: 6px; background: #ececE7; border-radius: 3px; margin-top: .3rem; max-width: 220px; }
.inline-bar span { display: block; height: 100%; background: var(--black); border-radius: 3px; }

/* --- Inventory -------------------------------------------------------------- */
.stock-list { display: grid; gap: .65rem; }
.stock-list .card + .card { margin-top: 0; }
.stock-item.low { border-left: 6px solid var(--gold); }
.stock-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.stock-qty { text-align: right; white-space: nowrap; }
.stock-qty .n { font-size: 1.6rem; font-weight: 800; }
.stock-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); align-items: center; }
.inline-form { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input[type=number] { width: 90px; min-height: 36px; padding: .3rem .5rem; }
.inline-form select { min-height: 36px; padding: .3rem 2rem .3rem .5rem; width: auto; max-width: 220px; font-size: .9rem; }
.item-settings { flex-basis: 100%; }
.item-settings summary { cursor: pointer; font-weight: 600; }
.item-settings form { margin-top: .5rem; }
.add-item-form { display: grid; gap: .5rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 760px) { .add-item-form { grid-template-columns: 2fr 1fr 1fr auto; } }
.add-item-form .field { margin: 0; }
.type-badge { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: .12rem .45rem; border-radius: 6px; background: var(--gold-soft); border: 1px solid var(--gold); color: var(--black); vertical-align: middle; }
.detail-head .type-badge { background: var(--gold); display: inline-block; margin-top: .4rem; }
.supplies-list { list-style: none; margin: 0 0 .75rem; padding: 0; }
.supplies-list li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.supply-form { display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .supply-form { grid-template-columns: 1fr 110px auto; align-items: end; } }
.supply-form .field { margin: 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist form { margin: 0; }
.checklist button {
  width: 100%; display: flex; gap: .7rem; align-items: center; text-align: left; background: none; border: none;
  padding: .7rem .2rem; font: inherit; cursor: pointer; min-height: var(--tap);
}
.checklist .box { width: 24px; height: 24px; border: 2px solid var(--black); border-radius: 6px; flex: none; display: grid; place-items: center; font-weight: 900; }
.checklist .done .box { background: var(--gold); border-color: var(--gold); }
.checklist .done .text { text-decoration: line-through; color: var(--ink-2); }
.checklist .who { margin-left: auto; font-size: .75rem; color: var(--ink-2); white-space: nowrap; }

.notice { display: block; text-decoration: none; color: var(--black); background: var(--gold-soft); border: 1.5px solid var(--gold); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }

/* --- Schedules -------------------------------------------------------------- */
.form-2, .form-3 { display: grid; gap: 0 .75rem; grid-template-columns: 1fr 1fr; }
.form-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) { .form-3 { grid-template-columns: 1fr 1fr; } }
[hidden] { display: none !important; }
.with-unit { display: flex; align-items: center; gap: .5rem; }
.with-unit input { max-width: 90px; }
.day-picks, .seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.day-picks label, .seg label { margin: 0; font-weight: 600; }
.day-picks input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.day-picks span, .seg span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 42px; padding: 0 .8rem;
  border: 1.5px solid var(--black); border-radius: 999px; background: var(--white); cursor: pointer;
}
.day-picks input:checked + span, .seg input:checked + span { background: var(--gold); border-color: var(--gold); }
.day-picks input:focus-visible + span, .seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
tr.muted td { color: var(--ink-2); }
input[type=date], input[type=time] { width: 100%; min-height: var(--tap); padding: .5rem .6rem; border: 1.5px solid #b9b9b2; border-radius: var(--radius); font: inherit; background: var(--white); }
.new-product-form { display: grid; gap: 0 .75rem; grid-template-columns: 1fr 1fr; align-items: end; }
.new-product-form .field:first-child { grid-column: 1 / -1; }
.new-product-form button { grid-column: 1 / -1; }
.form-2 > *, .form-3 > * { min-width: 0; }
input[type=date], input[type=time] { min-width: 0; max-width: 100%; }
[data-show="monthly yearly"] > .help { margin-bottom: 1rem; }
