/* Six Side Events — SideBot. Brand from sixsideevents.co.uk: orange, navy, Abril Fatface + Poppins. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url(/static/fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(/static/fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url(/static/fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url(/static/fonts/poppins-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Abril Fatface"; font-weight: 400; font-display: swap; src: url(/static/fonts/abril-fatface-latin-400-normal.woff2) format("woff2"); }
:root {
  --brand: #072538; --accent: #FB8600; --accent-text: #ffffff; --accent-dark: #E8590C; --ink: #0B0C15;
  --bg: #f6f6f7; --card: #ffffff; --text: #3A3940; --muted: #6b6a72; --line: #dedee4;
  --ok: #17803d; --ok-bg: #e5f5ea; --warn: #9a5b00; --warn-bg: #fff4dc; --bad: #b42318; --bad-bg: #fde8e6;
  --info: #1f4fbf; --info-bg: #e7eefc; --radius: 10px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Abril Fatface", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: #b65300; }
h1 { font-family: var(--display); font-weight: 400; font-size: 1.85rem; line-height: 1.15; color: var(--ink); margin: 0 0 .75rem; }
h2 { font-size: 1.08rem; font-weight: 600; color: var(--ink); margin: 1.25rem 0 .6rem; }
h3 { color: var(--ink); }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 500; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

/* top bar */
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 1.25rem; background: #fff; color: var(--ink); padding: .6rem 1.25rem; position: sticky; top: 0; z-index: 20; box-shadow: 0 6px 24px rgba(1, 29, 52, .08); }
.brandmark { display: flex; align-items: center; text-decoration: none; white-space: nowrap; }
.logo { display: inline-flex; align-items: center; }
.logo-full { height: 46px; width: auto; display: block; }
.logo-mark { height: 40px; width: auto; display: none; }
.instance { background: var(--brand); color: #fff; font-weight: 600; font-size: .68rem; padding: .2rem .55rem; border-radius: 999px; letter-spacing: .1em; }
.topsearch { flex: 1; max-width: 520px; position: relative; }
.topsearch kbd { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font: 600 .72rem var(--font); color: var(--muted); border: 1px solid #dcdce2; border-radius: 5px; padding: .05rem .4rem; background: #fff; pointer-events: none; }
.topsearch input:focus + kbd { display: none; }
.topsearch input { width: 100%; padding: .55rem 1rem; border-radius: 999px; border: 1px solid #e3e3e8; background: #f6f6f7; font-size: .92rem; }
:root { --topbar-h: 66px; }
.dropmenu { position: relative; }
.dropmenu > summary { cursor: pointer; list-style: none; }
.dropmenu > summary::-webkit-details-marker { display: none; }
.dropmenu .menu { position: absolute; right: 0; top: calc(100% + .5rem); background: #fff; color: var(--text); border-radius: 10px; box-shadow: 0 12px 34px rgba(1, 29, 52, .18); padding: .4rem; min-width: 180px; z-index: 30; animation: pop .12s ease-out; }
.dropmenu .menu a, .dropmenu .menu button { display: block; padding: .5rem .7rem; color: var(--text); text-decoration: none; width: 100%; text-align: left; border-radius: 6px; font-size: .93rem; }
.dropmenu .menu a:hover, .dropmenu .menu button:hover { background: #f3f3f6; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.newmenu { margin-left: auto; }
.newmenu > summary { display: inline-flex; align-items: center; gap: .3rem; }
.usermenu summary { text-align: right; font-weight: 500; }
.usermenu summary small { color: var(--muted); display: block; font-size: .72rem; font-weight: 400; }
.topbar .newmenu + .usermenu { margin-left: 0; }
.usermenu:first-of-type { margin-left: auto; }

/* side menu: stays in view while the page scrolls */
.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidenav { width: 228px; background: var(--brand); color: #d8e0e8; flex-shrink: 0; position: sticky; top: var(--topbar-h); align-self: flex-start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidenav summary { display: none; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav details > ul:first-of-type { padding-top: .6rem; }
.navsection { color: #8ea3b8; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; padding: .9rem 1.45rem .3rem; }
.sidenav a { display: flex; align-items: center; gap: .7rem; padding: .4rem .8rem; margin: 1px .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d3dce6; text-decoration: none; border-radius: 8px; font-size: .9rem; line-height: 1.3; transition: background .12s, color .12s; }
.sidenav a .icon { opacity: .75; flex-shrink: 0; }
.sidenav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidenav a.active { background: rgba(251,134,0,.18); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav a.active .icon { opacity: 1; color: var(--accent); }
.main { flex: 1; padding: 1.25rem 1.5rem 3rem; min-width: 0; max-width: 1400px; }
.main.solo { max-width: 460px; margin: 6vh auto; }

@media (max-width: 900px) {
  :root { --topbar-h: 58px; }
  .shell { display: block; }
  /* the Menu bar sticks under the top bar; the menu opens over the page */
  .sidenav { width: auto; height: auto; overflow: visible; position: sticky; top: var(--topbar-h); z-index: 15; }
  .sidenav summary { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; cursor: pointer; font-weight: 600; color: #fff; list-style: none; }
  .sidenav summary::-webkit-details-marker { display: none; }
  .sidenav details:not([open]) > :not(summary) { display: none; }
  .sidenav details[open] { position: absolute; left: 0; right: 0; top: 0; background: var(--brand); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; box-shadow: 0 14px 30px rgba(0,0,0,.25); padding-bottom: .5rem; }
  .sidenav ul { display: grid; grid-template-columns: 1fr 1fr; }
  .sidenav::before { content: ''; display: block; height: 42px; }
  .sidenav details { position: absolute; left: 0; right: 0; top: 0; background: var(--brand); }
  .topsearch { display: none; }
  .main { padding: 1rem; }
  .topbar { padding: .5rem 1rem; gap: .75rem; }
  .topbar .logo-full { display: none; }
  .topbar .logo-mark { display: block; }
  .newmenu > summary span { display: none; }
}

/* cards & layout */
.card { background: var(--card); border: 1px solid #ececf0; border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; box-shadow: 0 2px 10px rgba(1, 29, 52, .04); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.narrow { max-width: 560px; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--muted); margin-top: .2rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: inherit; display: block; }
.stat .n { font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.stat-bad { border-left: 4px solid var(--bad); }
.stat.stat-warn { border-left: 4px solid var(--warn); }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .85rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafafb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.muted td { color: var(--muted); }
tr.total td { font-weight: 700; border-top: 2px solid var(--text); }
tr.subtle td { background: #fafafb; }

/* forms */
.field { display: block; margin-bottom: .75rem; }
.field > span { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .25rem; }
.field em { color: var(--bad); font-style: normal; }
.field small { display: block; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid #c9c9d1; border-radius: 7px; font: inherit; background: #fff; color: inherit;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: .45rem; align-items: flex-start; margin-bottom: .6rem; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; }
.formrow { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.inline { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1rem; padding: .75rem 1rem; }
legend { font-weight: 600; padding: 0 .3rem; }

.btn, button.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem 1.05rem; border-radius: 999px; border: 1px solid #d6d6dd;
  background: #fff; color: var(--ink); text-decoration: none; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f1f1f4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.dark { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: #e7b4ae; }
.btn.small { padding: .25rem .55rem; font-size: .85rem; }
.btn.big { padding: .9rem 1.3rem; font-size: 1.1rem; min-height: 54px; }
.linklike { background: none; border: 0; padding: 0; color: #b65300; cursor: pointer; font: inherit; text-decoration: underline; }

/* status & alerts (icons + text, never colour alone) */
.badge { display: inline-flex; gap: .25rem; align-items: center; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: #ececf0; color: #33333b; white-space: nowrap; border: 1px solid transparent; }
.badge-confirmed, .badge-done, .badge-accepted, .badge-approved, .badge-sent, .badge-in_service, .badge-pass, .badge-ok, .badge-complete, .badge-won { background: var(--ok-bg); color: var(--ok); }
.badge-provisional, .badge-in_progress, .badge-issued, .badge-requested, .badge-submitted, .badge-queued, .badge-due_soon, .badge-quote_sent, .badge-follow_up { background: var(--info-bg); color: var(--info); }
.badge-blocked, .badge-cancelled, .badge-failed, .badge-rejected, .badge-quarantine, .badge-missing, .badge-fail, .badge-overdue, .badge-written_off, .badge-lost, .badge-quarantined { background: var(--bad-bg); color: var(--bad); }
.badge-maintenance, .badge-hold, .badge-never_tested, .badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-superseded, .badge-retired, .badge-not_required, .badge-draft { background: #eee; color: #666; border-color: #ddd; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: var(--ok-bg); border-color: #b5e0c2; color: #0f5a2a; }
.flash-error { background: var(--bad-bg); border-color: #f2b8b1; color: #7f1d14; }
.flash-warn { background: var(--warn-bg); border-color: #f1d18e; color: #6b4000; }
.alert { padding: .7rem 1rem; border-radius: 8px; margin: .5rem 0; border-left: 5px solid; }
.alert.bad { background: var(--bad-bg); border-color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn); }
.alert.info { background: var(--info-bg); border-color: var(--info); }
.alert.good { background: var(--ok-bg); border-color: var(--ok); }
.empty { color: var(--muted); font-style: italic; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.checklist .mark { width: 1.6rem; flex-shrink: 0; font-weight: 700; }
.checklist li.ok .mark { color: var(--ok); }
.checklist li.no .mark { color: var(--bad); }
.pill { display: inline-block; padding: .05rem .45rem; border-radius: 4px; background: #eee; font-size: .78rem; }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.board .col { background: #e9e9ee; border-radius: var(--radius); padding: .6rem; }
.board .col h3 { margin: .1rem 0 .6rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.board .item { background: #fff; border-radius: 8px; padding: .55rem .65rem; margin-bottom: .5rem; border: 1px solid var(--line); }
.board .item.overdue { border-left: 4px solid var(--bad); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cal .dow { background: #fafafb; padding: .3rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cal .day { background: #fff; min-height: 105px; padding: .3rem; font-size: .8rem; }
.cal .day.other { background: #f7f7f9; color: #aaa; }
.cal .day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal .ev { display: block; padding: .1rem .3rem; margin-top: .2rem; border-radius: 4px; text-decoration: none; color: #111; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-left: 3px solid; }
.ev-confirmed { background: var(--ok-bg); border-color: var(--ok) !important; }
.ev-provisional { background: var(--info-bg); border-color: var(--info) !important; }
.ev-draft { background: #f0f0f0; border-color: #999 !important; border-left-style: dashed !important; }
.timeline td.cell { text-align: center; font-variant-numeric: tabular-nums; font-size: .82rem; min-width: 34px; padding: .35rem .2rem; }
.timeline td.short { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.timeline td.tight { background: var(--warn-bg); }
.timeline td.free { background: #f3faf5; }

/* worker & scanning screens */
.bigtasks .task { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .75rem; border-left: 6px solid #bbb; }
.bigtasks .task.st-in_progress { border-left-color: var(--info); }
.bigtasks .task.st-blocked, .bigtasks .task.overdue { border-left-color: var(--bad); }
.bigtasks .task.st-done { border-left-color: var(--ok); opacity: .8; }
.bigtasks .task h3 { margin: 0 0 .3rem; font-size: 1.08rem; }
.bigtasks .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.scanbox { background: var(--brand); color: #fff; padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.scanbox input, .scanbox select, .scanbox textarea { color: var(--ink); background: #fff; }
.scanbox input[name=barcode] { font-size: 1.6rem; padding: .7rem; font-family: ui-monospace, monospace; letter-spacing: .05em; }
.scanbox label > span { color: #d3dce6; }
.scanresult { font-size: 1.15rem; padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 600; border: 2px solid; }
.scanresult.ok { background: var(--ok-bg); border-color: var(--ok); color: #0c4a22; }
.scanresult.repeat { background: var(--warn-bg); border-color: var(--warn); color: #5b3500; }
.scanresult.error { background: var(--bad-bg); border-color: var(--bad); color: #6d140c; }
.progress { height: 10px; background: #e3e3e8; border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--ok); }
.camera { margin-top: .75rem; }
.camera video { width: 100%; max-height: 300px; object-fit: cover; background: #000; border-radius: 8px; display: block; margin-bottom: .5rem; }
.camera-hint { color: inherit; opacity: .85; }
.sigpad { border: 2px dashed #aaa; border-radius: 8px; width: 100%; height: 180px; touch-action: none; background: #fff; }

/* public proposal */
.proposal { max-width: 860px; margin: 0 auto; }
.proposal .hero { background: #fff; border-radius: var(--radius); padding: 1.5rem 1.5rem 1.75rem; margin-bottom: 1rem; box-shadow: 0 6px 24px rgba(1, 29, 52, .08); border-top: 6px solid var(--accent); }
.proposal .hero h1 { font-size: 2.4rem; margin-top: .75rem; }
.proposal .hero .accent { color: var(--accent); font-weight: 500; }

@media print {
  .topbar, .sidenav, .noprint, .flash { display: none !important; }
  .main { padding: 0; }
  .card { border: 0; }
}
td form.row { flex-wrap: nowrap; }
@media (min-width: 1200px) { .span-2 { grid-column: span 2; } }
.solo .logo-full, .proposal .logo-full { height: 64px; }
.subform { background: #fff8ef; border: 1px solid #fde1bf; border-radius: var(--radius); padding: .75rem 1rem .25rem; margin-bottom: .75rem; }
.prop-photo { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; float: left; margin: 0 .6rem .2rem 0; border: 1px solid var(--line); }
.extras li { overflow: hidden; margin-bottom: .4rem; }

/* planning timeline */
.gantt { overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(480px, 1fr); align-items: center; min-height: 30px; border-bottom: 1px solid #f0f0f3; }
.gantt-head { min-height: 22px; border-bottom: 1px solid var(--line); }
.gantt-label { padding: .2rem .6rem .2rem 0; font-size: .85rem; line-height: 1.2; }
.gantt-label small { display: block; color: var(--muted); }
.gantt-track { position: relative; height: 100%; min-height: 26px; }
.gantt-tick { position: absolute; top: 2px; font-size: .7rem; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.gantt-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #ececf0; }
.gantt-bar { position: absolute; top: 6px; height: 16px; border-radius: 4px; background: #9aa3ad; }
.gantt-milestone { position: absolute; top: 2px; font-size: 1.05rem; transform: translateX(-50%); color: var(--brand); }
.gantt-bar.st-in_progress, .gantt-key.st-in_progress { background: var(--accent); }
.gantt-bar.st-done, .gantt-key.st-done, .gantt-milestone.st-done { background: var(--ok); color: var(--ok); }
.gantt-milestone.st-done { background: none; }
.gantt-bar.st-blocked, .gantt-key.st-blocked { background: var(--bad); }
.gantt-bar.waiting { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 4px, transparent 4px 8px); }
.gantt-key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: #9aa3ad; margin: 0 .25rem 0 .6rem; }
[hidden] { display: none !important; }

/* Simple task checklist (job plan, customers, enquiries, quotes, dashboard) */
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist > li { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: .2rem .75rem; align-items: center; padding: .5rem .25rem; border-bottom: 1px solid var(--line); }
.tlist > li:last-child { border-bottom: 0; }
.tlist > li.empty { display: block; }
.tlist .tick { margin: 0; }
.tickbox { width: 1.45rem; height: 1.45rem; border: 2px solid #b9bcc6; border-radius: 6px; background: #fff; cursor: pointer; padding: 0; font-weight: 700; color: #fff; line-height: 1; }
.tickbox:hover { border-color: var(--accent); }
.tlist li.done .tickbox { background: var(--ok); border-color: var(--ok); }
.tlist li.done .ttitle { text-decoration: line-through; color: var(--muted); }
.tlist .ttitle { font-weight: 600; color: var(--ink); text-decoration: none; }
.tlist .ttitle:hover { text-decoration: underline; }
.tmeta { display: flex; flex-wrap: wrap; gap: .15rem .6rem; font-size: .8rem; color: var(--muted); }
.tmeta:empty { display: none; }
.tmeta a { color: inherit; }
.twho { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.twhen { font-size: .85rem; white-space: nowrap; text-align: right; }
.tlist li.overdue .twhen { color: var(--bad); font-weight: 600; }
.tsnooze { margin: 0; font-size: .8rem; }
@media (max-width: 640px) {
  .tlist > li { grid-template-columns: auto 1fr auto; align-items: start; }
  .tlist .tick { grid-row: span 2; }
  .twhen { grid-column: 2; grid-row: 2; text-align: left; font-size: .8rem; }
  .twho { grid-column: 3; grid-row: 1; font-size: .8rem; }
  .tsnooze { grid-column: 3; grid-row: 2; text-align: right; }
}
.quickadd { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.quickadd input[type=text] { flex: 1 1 16rem; min-width: 0; }
.quickadd select, .quickadd input[type=date], .quickadd input[type=datetime-local] { flex: 0 1 auto; width: auto; }
.tgroup > summary { display: flex; align-items: baseline; justify-content: space-between; cursor: pointer; list-style: none; }
.tgroup > summary::-webkit-details-marker { display: none; }
.tgroup > summary h2 { margin: 0 0 .25rem; font-size: 1.05rem; }
.tgroup > summary h2::before { content: '▸ '; color: var(--muted); }
.tgroup[open] > summary h2::before { content: '▾ '; }
.moreopts { margin-top: .5rem; }
.moreopts > summary { cursor: pointer; color: var(--muted); font-size: .9rem; }

/* feel: quick feedback and smooth details */
.flash { transition: opacity .4s, transform .4s; }
.flash.fade { opacity: 0; transform: translateY(-6px); }
.btn { transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 1em; height: 1em; border: 2px solid currentColor; border-color: rgba(0,0,0,.25); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }
.btn.primary.is-busy::after { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid rgba(251,134,0,.45); outline-offset: 2px; }
.card { transition: box-shadow .15s; }
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }

/* phone tab bar */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: #fff; border-top: 1px solid #e6e6ec; box-shadow: 0 -6px 20px rgba(1, 29, 52, .07); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem .25rem .45rem; color: var(--muted);
    text-decoration: none; font: 500 .7rem var(--font); background: none; border: 0; cursor: pointer; }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar a.on, .tabbar button.on { color: var(--accent-dark); }
  .tabbar a.on .icon { stroke-width: 2.2; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  /* the full menu becomes a sheet opened from "More" */
  .sidenav::before { display: none; }
  .sidenav { position: static; height: 0; }
  .sidenav details > summary { display: none; }
  .sidenav details { position: fixed; left: 0; right: 0; top: auto; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 24; max-height: calc(100vh - var(--topbar-h) - 70px);
    overflow-y: auto; border-radius: 16px 16px 0 0; padding: .5rem 0 .75rem; box-shadow: 0 -12px 34px rgba(0,0,0,.28); }
  .sidenav details:not([open]) { display: none; }
  .sidenav details[open] { position: fixed; top: auto; animation: sheet .16s ease-out; }
  @keyframes sheet { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* dashboard */
h2.withicon { display: flex; align-items: center; gap: .5rem; }
h2.withicon .icon { color: var(--accent-dark); }
.attn { border-radius: 10px; margin: .4rem 0; border: 1px solid transparent; }
.attn > summary { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; cursor: pointer; list-style: none; }
.attn > summary::-webkit-details-marker { display: none; }
.attn > summary strong { font-size: 1.15rem; min-width: 1.6rem; }
.attn > summary span { flex: 1; }
.attn > summary .icon:last-child { transition: transform .15s; opacity: .6; }
.attn[open] > summary .icon:last-child { transform: rotate(90deg); }
.attn-body { padding: 0 .9rem .7rem 2.9rem; }
.attn-body ul { margin: 0; padding-left: 1rem; }
.attn-bad { background: var(--bad-bg); border-color: #f6cdc8; color: #6d140c; }
.attn-warn { background: var(--warn-bg); border-color: #f3dfae; color: #5b3500; }
.attn-info { background: #eef3f8; border-color: #dbe5ef; color: #20384d; }
.attn a { color: inherit; font-weight: 600; }
.attn .tlist { background: #fff; border-radius: 8px; padding: 0 .5rem; color: var(--text); }
.allclear { display: flex; align-items: center; gap: .5rem; color: var(--ok); font-weight: 600; margin: .25rem 0; }
.today { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.today .card { margin-bottom: 1rem; }
.today h2 { margin-top: 0; font-size: 1rem; }
@media (max-width: 900px) { .today { grid-template-columns: 1fr; gap: 0; } }
.daylist { display: flex; gap: .6rem; align-items: baseline; padding: .25rem 0; }
.daylist .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; min-width: 3rem; }
.jobrow { display: flex; align-items: center; gap: .9rem; padding: .6rem .4rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); border-radius: 8px; }
.jobrow:last-child { border-bottom: 0; }
.jobrow:hover { background: #f7f7f9; }
.jr-main { flex: 1; min-width: 0; }
.jr-main small { display: block; color: var(--muted); }
.datechip { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 10px; background: #fff4e8; color: var(--accent-dark); font-size: .72rem; text-transform: uppercase; font-weight: 600; flex-shrink: 0; }
.datechip b { font-size: 1.15rem; line-height: 1; color: var(--ink); }

.quietday { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.quietday .icon { color: var(--ok); }
.jobrow .badge { flex-shrink: 0; }
@media (max-width: 640px) {
  .attn-body { padding: 0 .6rem .6rem; }
  .attn .tlist { padding: 0 .35rem; }
  .jobrow { align-items: flex-start; flex-wrap: wrap; }
  .jr-main { flex: 1 1 calc(100% - 4.5rem); }
  .jobrow .badge { margin-left: 3.9rem; }
}
.tmain { min-width: 0; overflow-wrap: anywhere; }

/* page tabs */
.pagetabs a { display: inline-flex; align-items: center; gap: .4rem; }
.pagetabs .icon { width: 16px; height: 16px; opacity: .75; }
.pagetabs a.active .icon { opacity: 1; color: var(--accent-dark); }
.pagetabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.pagetabs a { white-space: nowrap; }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; }
.dot.bad { background: var(--bad); } .dot.warn { background: #e0a100; }
@media print { .tabpanel[hidden] { display: block !important; } }
.narrowish { max-width: 820px; }
.count { display: inline-block; min-width: 1.2rem; padding: 0 .35rem; border-radius: 999px; background: #eef0f4; color: var(--ink); font-size: .72rem; text-align: center; font-weight: 600; }

/* fields placed in a row keep their natural width */
.row > input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .row > select { width: auto; flex: 0 1 auto; max-width: 100%; }
.row > input[type=text], .row > input[type=search] { flex: 1 1 12rem; }
.btn .icon { width: 16px; height: 16px; vertical-align: -3px; }
.btn { display: inline-flex; align-items: center; gap: .35rem; }

/* live search & quick jump */
.searchpop { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(1, 29, 52, .2); padding: .35rem; max-height: 70vh; overflow-y: auto; z-index: 40; }
.fgroup { display: flex; align-items: center; gap: .4rem; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: .55rem .6rem .25rem; }
.fgroup .icon { width: 14px; height: 14px; }
.fitem { display: flex; flex-direction: column; padding: .45rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.fitem small { color: var(--muted); font-size: .78rem; }
.fitem.sel, .fitem:hover { background: #fff4e8; }
.fitem.sel span { color: var(--ink); font-weight: 600; }
.fempty { padding: .7rem; color: var(--muted); font-size: .9rem; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid #e3e3e8; background: #fff; color: var(--ink); cursor: pointer; }
.searchbtn { display: none; }
@media (max-width: 900px) { .searchbtn { display: inline-flex; margin-left: auto; } .searchbtn + .newmenu { margin-left: 0; } }
.palette { position: fixed; inset: 0; background: rgba(7, 37, 56, .45); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 1rem 1rem; backdrop-filter: blur(2px); }
.palette[hidden] { display: none; }
.palette-box { background: #fff; width: 100%; max-width: 620px; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; animation: pop .12s ease-out; }
.palette-input { display: flex; align-items: center; gap: .6rem; padding: .3rem 1rem; border-bottom: 1px solid var(--line); }
.palette-input .icon { color: var(--muted); }
.palette-input input { border: 0; padding: .8rem 0; font-size: 1.05rem; outline: none; }
.palette-input input:focus { outline: none; }
.palette-list { max-height: 55vh; overflow-y: auto; padding: .35rem; }
.palette-hint { border-top: 1px solid var(--line); padding: .5rem 1rem; font-size: .75rem; color: var(--muted); }
kbd { font: 600 .72rem var(--font); border: 1px solid #dcdce2; border-bottom-width: 2px; border-radius: 5px; padding: .02rem .35rem; background: #fff; color: var(--muted); }
.resultrow { display: flex; flex-direction: column; padding: .45rem .3rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.resultrow:last-child { border-bottom: 0; }
.resultrow small { color: var(--muted); }
.resultrow:hover strong { color: var(--accent-dark); }
.fitem.withicon { display: grid; grid-template-columns: 22px 1fr; column-gap: .55rem; align-items: center; }
.fitem.withicon .icon { color: var(--muted); grid-row: span 2; }
.fitem.withicon.sel .icon { color: var(--accent-dark); }

/* edit in place */
.inl { background: none; border: 0; padding: .1rem .3rem; margin: -.1rem -.3rem; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; border-bottom: 1px dashed transparent; }
.inl:hover { background: #f3f3f6; border-bottom-color: #b9bcc6; }
.inlfield { width: auto !important; padding: .2rem .4rem !important; font-size: .85rem !important; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .55rem 1rem; border-radius: 999px; font-size: .88rem; z-index: 70; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .4s; animation: pop .15s ease-out; }
.toast.bad { background: var(--bad); border-radius: 12px; max-width: 90vw; }
.toast.fade { opacity: 0; }
@media (max-width: 900px) { .toast { bottom: calc(76px + env(safe-area-inset-bottom)); } }
[data-live].saving { opacity: .75; transition: opacity .15s; }
.livehint { display: none; }
.js .livehint { display: inline; }
.js [data-live] .livesave { display: none; }
@media (hover: none) { .palette-hint, .topsearch kbd { display: none; } }

/* shorter screens (or zoomed-in browsers): keep the whole menu in view */
@media (min-width: 901px) and (max-height: 820px) {
  .sidenav a { padding: .3rem .8rem; font-size: .86rem; }
  .navsection { padding: .6rem 1.45rem .2rem; }
  .sidenav details > ul:first-of-type { padding-top: .4rem; }
}
@media (min-width: 901px) and (max-height: 640px) {
  .sidenav a { padding: .22rem .8rem; }
  .navsection { padding: .4rem 1.45rem .1rem; font-size: .6rem; }
}
