/* LGS Ops — neutral palette, colour reserved for status (spec 4.1). One sans serif typeface, body 16px (4.2). */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --border: #d6d9de;
  --border-strong: #b9bec6;
  --text: #1d2125;
  --muted: #555d67;          /* 6.4:1 on white */
  --nav: #262a2f;
  --nav-text: #e9ebee;
  --nav-muted: #a9b0b8;
  --link: #1a5fb4;           /* blue: information and links (6.2:1) */
  --focus: #1a5fb4;
  --green-bg: #e2f3e6; --green: #145a26; --green-solid: #1e7b34;
  --amber-bg: #fff0d4; --amber: #7a4600; --amber-solid: #b86e00;
  --red-bg: #fde3e1; --red: #9f150c; --red-solid: #c62014;
  --yellow-bg: #fff6b3; --yellow: #574900; --yellow-solid: #e8c800;
  --blue-bg: #e2ecfa; --blue: #12468a; --blue-solid: #1a5fb4;
  --grey-bg: #eceef1; --grey: #3b4148;
  --accent: #a3742f;         /* gold from the Lalapanzi mark: brand only, never a status colour */
  --accent-bg: #f7efe1;
  --accent-text: #5c3e0f;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --shadow-pop: 0 6px 24px rgba(0,0,0,.14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
a { color: var(--link); }
h1 { font-size: 1.4rem; margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
code { background: var(--grey-bg); padding: 0 .3em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ------------------------------------------------------------------ shell */
.booting .boot, .loading { padding: 3rem; text-align: center; color: var(--muted); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--link); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: .5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; height: 56px; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 700; min-width: 0; flex: 0 0 auto; width: calc(224px - 1rem); }
.brand .logo { height: 40px; width: 40px; object-fit: contain; flex-shrink: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02rem; }
.global-search { position: relative; flex: 0 1 520px; min-width: 0; display: flex; align-items: center; gap: .4rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 .8rem; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.global-search .input { border: 0; background: transparent; padding: .5rem 0; min-height: 38px; }
.global-search .input:focus { outline: none; }
.global-search:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: 420px; overflow: auto; z-index: 40; }
.sr { display: grid; grid-template-columns: 80px 1fr; gap: 0 .6rem; padding: .55rem .75rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--grey-bg); }
.sr:hover, .sr:focus { background: var(--blue-bg); }
.sr-type { grid-row: span 2; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; padding-top: 2px; }
.sr-sub { font-size: .85rem; }
.who { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .2rem .6rem .2rem .25rem; border: 1px solid transparent; border-radius: 999px; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; line-height: 1.2; }
.who:hover { background: var(--grey-bg); border-color: var(--border); }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.who-roles { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.who-chev { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); font-weight: 700; font-size: .85rem; letter-spacing: .02em; flex-shrink: 0; }
.topbar .menu-pop { min-width: 260px; }
.menu-head { padding: .5rem .7rem .35rem; }
.menu-note { padding: .2rem .7rem .35rem; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; border-radius: var(--radius); color: var(--text); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--grey-bg); }
.menu-btn { display: none; }
.notice-count { position: absolute; top: 4px; right: 2px; background: var(--red-solid); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 10px; padding: 0 5px; min-width: 18px; line-height: 18px; }
.body { display: flex; flex: 1; min-height: 0; }
/* menu: a light column; groups fold so only the current group's screens are listed */
.sidenav { width: 224px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: .6rem .5rem 2rem; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item, .nav-group-btn { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .7rem; min-height: 42px; border: 0; border-radius: 8px; background: none; color: var(--text); text-decoration: none; font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-group-btn:hover { background: var(--grey-bg); }
.nav-item .icon, .nav-group-btn .icon { color: var(--muted); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }
.nav-item.active .icon { color: var(--accent-text); }
.nav-group { display: grid; }
.nav-group-btn { font-weight: 600; }
.nav-group-btn .nav-chev { margin-left: auto; transition: transform .15s; }
.nav-group.open .nav-group-btn .nav-chev { transform: rotate(90deg); }
.nav-group-items { display: none; padding-left: .5rem; margin: 2px 0 .35rem; border-left: 2px solid var(--grey-bg); margin-left: 1.15rem; }
.nav-group.open .nav-group-items { display: grid; gap: 2px; }
.nav-group-items .nav-item { min-height: 38px; font-size: .92rem; padding-left: .6rem; }
.nav-group-items .nav-item .icon { display: none; }
.nav-foot { padding: 1rem .75rem 0; color: var(--muted); margin-top: auto; }
#main { flex: 1; min-width: 0; padding: 1.1rem 1.4rem 3rem; max-width: 1480px; margin: 0 auto; width: 100%; }
#main:focus { outline: none; }
@media (max-width: 1100px) {
  .menu-btn { display: inline-grid; }
  .sidenav { position: fixed; left: 0; top: 56px; bottom: 0; z-index: 35; transform: translateX(-100%); transition: transform .2s; height: auto; box-shadow: none; }
  body.nav-open .sidenav { transform: none; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .brand { width: auto; }
  .who-text, .who-chev { display: none; }
  .who { padding: .2rem; }
  .topbar { gap: .6rem; }
  #main { padding: .9rem; }
}
@media (max-width: 640px) { .brand-name { display: none; } .global-search { max-width: none; } .topbar { gap: .4rem; padding: 0 .5rem; } .btn { white-space: normal; max-width: 100%; } .page-actions .btn { flex: 1 1 auto; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tab { white-space: nowrap; }
  .list-toolbar > select.input, .list-toolbar .search-box { flex: 1 1 45%; min-width: 0; max-width: none; } }

/* ------------------------------------------------------------------ page parts */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .6rem; margin-bottom: .85rem; }
.page-title h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.head-badges { display: inline-flex; gap: .35rem; flex-wrap: wrap; font-size: .9rem; }
.subtitle { color: var(--muted); margin-top: .2rem; font-size: .95rem; }
.back { display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; font-size: .9rem; margin-bottom: .35rem; min-height: 32px; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .85rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem 1rem; border-bottom: 1px solid var(--grey-bg); flex-wrap: wrap; min-height: 48px; }
.card-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.card-body { padding: .9rem 1rem; }
.card-body > .empty:only-child { padding: .35rem 0; text-align: left; font-size: .92rem; }
/* folding section: the head is a button; closed sections take one line */
.card.fold > .card-head { cursor: pointer; }
.card.fold > .card-head h2 { display: flex; align-items: center; gap: .45rem; }
.card.fold > .card-head .fold-chev { transition: transform .15s; color: var(--muted); }
.card.fold.open > .card-head .fold-chev { transform: rotate(90deg); }
.card.fold:not(.open) > .card-head { border-bottom: 0; }
.card.fold:not(.open) > .card-body { display: none; }
.fold-sum { font-weight: 400; color: var(--muted); font-size: .9rem; }
.grid { display: grid; gap: .85rem; align-items: start; }
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: .85rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.grid > * { min-width: 0; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.kv { display: grid; grid-template-columns: minmax(120px, 32%) 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dt, .kv dd { min-width: 0; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { padding: 1.25rem; text-align: center; color: var(--muted); }
.denied { max-width: 520px; margin: 3rem auto; padding: 2rem; text-align: center; }
.denied h1 { margin: .5rem 0; }
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-err { background: var(--red-bg); color: var(--red); border-color: #f3b9b4; }
.alert-ok { background: var(--green-bg); color: var(--green); border-color: #b4dcbd; }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: #b9cdee; }
.alert-warn { background: var(--amber-bg); color: var(--amber); border-color: #f0cf95; }

/* ------------------------------------------------------------------ badges (DSN-01) */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; }
.badge .glyph { font-size: .7rem; }
.b-green { background: var(--green-bg); color: var(--green); border-color: #b4dcbd; }
.b-amber { background: var(--amber-bg); color: var(--amber); border-color: #f0cf95; }
.b-red { background: var(--red-bg); color: var(--red); border-color: #f3b9b4; }
.b-yellow { background: var(--yellow-bg); color: var(--yellow); border-color: #e6d65e; }
.b-blue { background: var(--blue-bg); color: var(--blue); border-color: #b9cdee; }
.b-grey { background: var(--grey-bg); color: var(--grey); border-color: #d3d7dc; }

/* ------------------------------------------------------------------ buttons & inputs (DSN-03: 44px targets) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .45rem .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: #8f96a0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--nav); border-color: var(--nav); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-danger { background: var(--surface); border-color: var(--red-solid); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-ok { background: var(--green-solid); border-color: var(--green-solid); color: #fff; }
.btn-ok:hover { background: var(--green); }
.btn-sm { min-height: 34px; padding: .2rem .6rem; font-size: .86rem; }
.btn-link { border-color: transparent; background: none; color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { background: var(--blue-bg); border-color: transparent; }
.input { width: 100%; min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff; color: var(--text); font: inherit; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { padding-right: 2rem; }
.form { display: grid; gap: .9rem; }
.form.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form.cols-2 > .form-error, .form.cols-2 > .form-actions, .form.cols-2 > .wide, .form.cols-2 > h3,
.form.cols-3 > .form-error, .form.cols-3 > .form-actions, .form.cols-3 > .wide, .form.cols-3 > h3 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form.cols-2, .form.cols-3 { grid-template-columns: 1fr; } }
.form > .wide { min-width: 0; max-width: 100%; overflow-x: auto; }
.form > .field { min-width: 0; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-label { font-weight: 600; font-size: .92rem; }
.field-help { font-size: .85rem; color: var(--muted); }
.field-error { font-size: .85rem; color: var(--red); font-weight: 600; }
.field-error:empty { display: none; }
.field.has-error .input { border-color: var(--red-solid); box-shadow: 0 0 0 1px var(--red-solid); }
.field-check { flex-direction: row; align-items: center; gap: .6rem; min-height: 44px; flex-wrap: wrap; }
.field-check input { width: 22px; height: 22px; }
.radios { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.radio { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; }
.radio input { width: 20px; height: 20px; }
.static { padding: .5rem 0; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .25rem; }
.form-error { margin: 0; }

/* ------------------------------------------------------------------ lists & tables (CMN-02) */
.list-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.list-toolbar > select.input { width: auto; min-width: 140px; min-height: 40px; }
.list-toolbar > .btn { min-height: 40px; }
.search-box { display: flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 .5rem; color: var(--muted); min-width: 200px; flex: 1; max-width: 360px; }
.search-box .input { border: 0; padding-left: 0; min-height: 40px; }
.search-box:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.search-box .input:focus { outline: none; }
.list-count { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-body .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--grey-bg); vertical-align: top; }
.table th { background: var(--surface-2); font-size: .8rem; color: var(--muted); font-weight: 700; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; }
.table td .nowrap, .table td.nowrap { white-space: nowrap; }
.table.compact th, .table.compact td { padding: .4rem .6rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f6f9fe; }
.table tr.row-muted td { color: var(--muted); }
.table tr.row-total td { font-weight: 700; border-top: 2px solid var(--border); }
.th-btn { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; padding: 0; min-height: 28px; }
.sort-ind { font-size: .7rem; opacity: .7; }
.empty-cell { text-align: center; color: var(--muted); padding: 1.5rem !important; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem .1rem; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: .5rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: .75rem; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: .5rem .8rem; min-height: 42px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { background: var(--grey-bg); color: var(--grey); border-radius: 999px; padding: 0 .45rem; font-size: .8rem; }

/* ------------------------------------------------------------------ stats, charts */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-bottom: .85rem; }
.stat { display: block; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: .65rem .85rem; text-decoration: none; color: var(--text); min-height: 44px; }
a.stat:hover { background: var(--surface-2); }
.stat-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-sub { font-size: .82rem; color: var(--muted); }
.stat-green { border-left-color: var(--green-solid); }
.stat-amber { border-left-color: var(--amber-solid); }
.stat-red { border-left-color: var(--red-solid); }
.stat-yellow { border-left-color: var(--yellow-solid); }
.stat-blue { border-left-color: var(--blue-solid); }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.chart-head h3 { font-size: .9rem; color: var(--muted); font-weight: 600; margin: 0; }
.bars { display: grid; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: .6rem; align-items: center; text-decoration: none; color: var(--text); min-height: 30px; }
a.bar-row:hover .bar-label { text-decoration: underline; }
.bar-label { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--grey-bg); height: 16px; border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #4b535c; border-radius: 4px; min-width: 2px; }
.bar-fill.tone-green { background: var(--green-solid); }
.bar-fill.tone-red { background: var(--red-solid); }
.bar-fill.tone-amber { background: var(--amber-solid); }
.bar-fill.tone-blue { background: var(--blue-solid); }
.bar-fill.tone-yellow { background: #c8ac00; }
.bar-value { font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 600; min-width: 4ch; text-align: right; }

/* ------------------------------------------------------------------ more menu (secondary actions) */
.menu-wrap { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: .3rem; display: grid; }
.menu-pop.hidden { display: none; }
.menu-pop .menu-it { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; white-space: nowrap; min-height: 42px; padding: .45rem .7rem; border: 0; background: none; font: inherit; color: var(--text); border-radius: 6px; cursor: pointer; text-decoration: none; }
.menu-pop .menu-it:hover { background: var(--grey-bg); }
.menu-pop .menu-it.danger { color: var(--red); }
.menu-pop .menu-sep { height: 1px; background: var(--grey-bg); margin: .25rem 0; }

/* ------------------------------------------------------------------ modal, toast */
.modal-back { position: fixed; inset: 0; background: rgba(20,22,25,.5); z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal { background: var(--surface); border-radius: 10px; width: min(560px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-wide { width: min(980px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--grey-bg); }
.modal-body { padding: 1rem; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal-error { color: var(--red); font-weight: 600; margin-top: .5rem; }
.modal-error:empty { display: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--grey-bg); flex-wrap: wrap; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { padding: .8rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--nav); color: #fff; transition: opacity .4s; font-weight: 600; }
.toast-err { background: var(--red-solid); }
.toast-ok { background: var(--green-solid); }
.toast.out { opacity: 0; }
.notices { display: grid; gap: .25rem; }
.notice { display: block; padding: .6rem .75rem; border-radius: 6px; text-decoration: none; color: var(--text); border: 1px solid var(--grey-bg); }
.notice.unread { border-left: 4px solid var(--blue-solid); background: #f7faff; }
.notice:hover { background: var(--blue-bg); }

/* ------------------------------------------------------------------ photos & lightbox */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.photo-tile { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.photo-btn { display: block; width: 100%; padding: 0; border: 0; background: #ddd; cursor: zoom-in; aspect-ratio: 4/3; }
.photo-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile figcaption { padding: .45rem .55rem; font-size: .85rem; display: grid; gap: .2rem; }
.ph-kind { font-weight: 700; }
.ph-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 300; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lb-stage { display: grid; place-items: center; height: 100vh; padding: 3rem 0 2rem; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; }
.lb-cap { color: #fff; margin-top: .5rem; text-align: center; }
.lb-prev, .lb-next, .lb-close { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 56px; height: 56px; display: grid; place-items: center; cursor: pointer; justify-self: center; }
.lb-close { position: absolute; top: 12px; right: 12px; }
.photo-button { display: inline-flex; }

/* ------------------------------------------------------------------ signature pad */
.sig-pad { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: #fff; padding: .4rem; }
.sig-canvas { width: 100%; height: 180px; touch-action: none; display: block; background: #fff; cursor: crosshair; }
.sig-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .3rem; }

/* ------------------------------------------------------------------ production board (PRD-01..08) */
.board-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.step-tile { display: flex; align-items: center; gap: 1rem; min-height: 120px; padding: 1.25rem; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text); font-size: 1.25rem; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.step-tile:hover { border-color: var(--nav); }
.step-tile .tile-count { margin-left: auto; font-size: 2.2rem; font-variant-numeric: tabular-nums; background: var(--nav); color: #fff; border-radius: 12px; min-width: 64px; min-height: 64px; display: grid; place-items: center; }
.job-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.job-card { background: var(--surface); border: 3px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.job-card .jc-photo { aspect-ratio: 4/3; background: #d9dce0; display: grid; place-items: center; color: var(--muted); border: 0; padding: 0; cursor: pointer; }
.job-card .jc-photo img { width: 100%; height: 100%; object-fit: cover; }
.job-card .jc-name { font-size: 1.45rem; font-weight: 800; padding: .6rem .8rem .2rem; }
.job-card .jc-actions { display: flex; gap: .6rem; padding: .6rem .8rem .9rem; align-items: center; margin-top: auto; }
.job-card.rework { border-color: var(--red-solid); background: var(--red-bg); }
.job-card.hold { border-color: var(--yellow-solid); background: var(--yellow-bg); }
.job-card .jc-flag { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; font-weight: 800; font-size: 1.1rem; }
.job-card.rework .jc-flag { color: var(--red); }
.job-card.hold .jc-flag { color: var(--yellow); }
.btn-done { min-height: 64px; min-width: 64px; flex: 1; font-size: 1.4rem; background: var(--green-solid); border-color: var(--green-solid); color: #fff; border-radius: 12px; }
.btn-done:hover { background: var(--green); }
.btn-cam { min-height: 64px; min-width: 64px; border-radius: 12px; }
.big-reason { font-size: 1.6rem; font-weight: 800; color: var(--red); padding: 1rem; }

/* ------------------------------------------------------------------ pipeline (QTE-03) */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.pipe-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 300px; }
.pipe-col.drop-ok { outline: 3px dashed var(--blue-solid); }
.pipe-col.drop-no { outline: 3px dashed var(--red-solid); }
.pipe-head { padding: .6rem .75rem; border-bottom: 1px solid var(--border); display: grid; gap: .2rem; }
.pipe-head .pipe-sum { font-size: .85rem; color: var(--muted); }
.pipe-cards { padding: .5rem; display: grid; gap: .5rem; align-content: start; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .55rem .65rem; cursor: grab; text-decoration: none; color: var(--text); display: grid; gap: .15rem; font-size: .92rem; }
.deal-card:hover { border-color: var(--nav); }
.deal-card .dc-title { font-weight: 700; }

/* ------------------------------------------------------------------ steps / progress */
.steps { display: flex; flex-wrap: wrap; gap: .5rem; }
.step-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: .9rem; }
.step-pill.done { background: var(--green-bg); color: var(--green); border-color: #b4dcbd; }
.step-pill.current { background: var(--blue-bg); color: var(--blue); border-color: #b9cdee; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--grey-bg); font-size: .92rem; }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; gap: .1rem; } }

/* quote builder */
.qline { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; background: var(--surface); }
.qline-head { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.qline-body { padding: .75rem; overflow-x: auto; }
.qrows { width: 100%; border-collapse: collapse; font-size: .92rem; }
.qrows th, .qrows td { padding: .3rem .35rem; text-align: left; vertical-align: middle; }
.qrows th { font-size: .8rem; color: var(--muted); }
.qrows .input { min-height: 40px; padding: .35rem .5rem; }
.qrows td.num, .qrows th.num { text-align: right; white-space: nowrap; }
.totals { margin-left: auto; max-width: 360px; display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; }
.totals .t-strong { font-weight: 800; font-size: 1.1rem; }

/* ------------------------------------------------------------------ auth & install */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(420px, 100%); padding: 1.5rem; }
.auth-brand { text-align: center; margin-bottom: 1rem; }
.auth-brand .logo { height: 96px; width: 96px; object-fit: contain; }
.auth-brand h1 { font-size: 1.3rem; margin-top: .5rem; }
.auth-brand p { margin: .2rem 0 0; }
body.install { padding: 2rem 1rem; }
.install-card { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.install-card h1 small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.install-card .form { max-width: 520px; margin-top: 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; }

@media print {
  .topbar, .sidenav, .page-actions, .list-toolbar, .pager { display: none !important; }
  #main { padding: 0; }
  .card { box-shadow: none; }
}
