/* ==========================================================================
   Organization ERP stylesheet: redesign from the approved mockups (blue header
   band with figures strip, light side menu, pill buttons, card dashboard).
   Colours are defined ONCE as tokens; components use tokens only.
   Brand: dark blue + cream. Light and dark themes. Owned by the ui-ux agent.
   ========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

:root {
  /* brand */
  --navy: #0B2A4A;
  --cream: #F4E9CF;
  --on-cream: #0B2A4A;

  /* header band */
  --band: #1269B2;
  --strip: #0F4E86;
  --strip-label: #A8D6FB;
  --band-text: #FFFFFF;
  --band-caption: #E3F1FD;
  --band-contact: #DDEFFD;
  --band-btn: rgba(255, 255, 255, .08);
  --band-btn-hover: rgba(255, 255, 255, .22);

  /* surfaces and text (light) */
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-2: #EEF3F9;
  --text: #0B2A4A;
  --text-muted: #52667E;
  --label: #1269B2;
  --link: #0F5DA0;
  --border: #D5E0ED;
  --border-strong: #9FB3CB;
  --focus: #1D5FB0;

  /* buttons */
  --primary: #1269B2;
  --primary-hover: #0E5794;
  --on-primary: #FFFFFF;
  --outline: #41A2F3;
  --outline-text: #0F5DA0;
  --slate: #50678A;
  --on-slate: #FFFFFF;
  --disabled: #D3DCE7;
  --on-disabled: #4B5C71;
  --danger: #A61B1B;

  /* side menu */
  --sidebar-bg: #E8EFF8;
  --sidebar-text: #0F4E86;
  --sidebar-muted: #50637A;
  --sidebar-hover: #DCE6F2;
  --sidebar-active: #F4E9CF;
  --sidebar-active-text: #0B2A4A;

  /* status */
  --success-bg: #E1F2E7; --success-text: #1A6436;
  --warning-bg: #FCEFD0; --warning-text: #774700;
  --danger-bg: #FBE2DF;  --danger-text: #961B1B;
  --info-bg: #DDEBF9;    --info-text: #0F4E86;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 42, 74, .05), 0 6px 18px rgba(11, 42, 74, .06);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --band-org-w: 280px;
}

[data-theme="dark"] {
  --band: #0C2E55;
  --strip: #081D37;
  --strip-label: #8FC7F7;
  --band-caption: #C4E3FC;
  --band-contact: #C4E3FC;

  --bg: #06152A;
  --surface: #0E2644;
  --surface-2: #12305A;
  --text: #EAF1FA;
  --text-muted: #A8BBD2;
  --label: #8FC7F7;
  --link: #9CCBF6;
  --border: #23466F;
  --border-strong: #4C73A1;
  --focus: #F2C66D;

  --primary: #F4E9CF;
  --primary-hover: #FFF6E3;
  --on-primary: #0B2A4A;
  --outline: #5DAEF2;
  --outline-text: #9CCBF6;
  --slate: #3C5A82;
  --disabled: #2A4468;
  --on-disabled: #B6C6DA;
  --danger: #D9534F;

  --sidebar-bg: #071A31;
  --sidebar-text: #D5E3F3;
  --sidebar-muted: #8EA4BE;
  --sidebar-hover: #0F2A4B;
  --sidebar-active: #F4E9CF;
  --sidebar-active-text: #0B2A4A;

  --success-bg: #123D26; --success-text: #A6E4BC;
  --warning-bg: #3F2F0A; --warning-text: #F6D38A;
  --danger-bg: #4A1717;  --danger-text: #F6B3AE;
  --info-bg: #11365E;    --info-text: #B3D3F5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
}

/* Signed-out pages follow the device setting. */
@media (prefers-color-scheme: dark) {
  [data-theme-auto="1"] {
    --band: #0C2E55; --strip: #081D37; --strip-label: #8FC7F7; --band-caption: #C4E3FC; --band-contact: #C4E3FC;
    --bg: #06152A; --surface: #0E2644; --surface-2: #12305A; --text: #EAF1FA; --text-muted: #A8BBD2; --label: #8FC7F7;
    --link: #9CCBF6; --border: #23466F; --border-strong: #4C73A1; --focus: #F2C66D;
    --primary: #F4E9CF; --primary-hover: #FFF6E3; --on-primary: #0B2A4A; --outline: #5DAEF2; --outline-text: #9CCBF6;
    --success-bg: #123D26; --success-text: #A6E4BC; --warning-bg: #3F2F0A; --warning-text: #F6D38A;
    --danger-bg: #4A1717; --danger-text: #F6B3AE; --info-bg: #11365E; --info-text: #B3D3F5;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 800; }
h3 { font-size: .95rem; font-weight: 800; }
p { margin: 0 0 .75rem; }
a { color: var(--link); text-underline-offset: 3px; font-weight: 600; }
a:hover { text-decoration-thickness: 2px; }
code { font-size: .85em; background: var(--surface-2); padding: .05rem .35rem; border-radius: 4px; }
img { max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: .5rem 1rem; z-index: 100; border-radius: 999px; }
.skip-link:focus { left: 1rem; top: .5rem; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 1rem; } .mb-1 { margin-bottom: 1rem; }
.text-right { text-align: right; }
[hidden] { display: none !important; }

/* ---------- header band ---------- */
.band {
  display: grid; grid-template-columns: var(--band-org-w) minmax(0, 1fr) auto; grid-template-rows: 64px minmax(118px, auto);
  grid-template-areas: "org caption actions" "org strip strip";
  background: var(--band); color: var(--band-text);
}
.band-toggle { grid-area: toggle; display: none; }
.band-org { grid-area: org; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 18px 26px; color: var(--band-text); text-decoration: none; min-width: 0; }
.band-org:hover .org-name { text-decoration: underline; text-underline-offset: 4px; }
.org-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.org-mark {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: var(--cream); color: var(--on-cream);
  display: grid; place-items: center; font-size: 1.45rem; font-weight: 800; border: 2px solid rgba(255, 255, 255, .35);
}
.org-logo { height: 52px; width: auto; max-width: 110px; object-fit: contain; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.org-text { display: flex; flex-direction: column; min-width: 0; }
.org-name { font-size: 1rem; line-height: 1.2; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.org-tag { font-size: .68rem; font-weight: 700; letter-spacing: .16em; color: var(--band-caption); text-transform: uppercase; margin-top: 3px; }
.org-contact { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: .8rem; font-weight: 600; color: var(--band-contact); }
.org-contact span { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-contact svg { width: 13px; height: 13px; }
.band-caption { grid-area: caption; align-self: center; margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--band-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band-actions { grid-area: actions; display: flex; align-items: center; gap: 6px; padding-right: 32px; }
.band-strip {
  grid-area: strip; display: flex; align-items: stretch; margin: 0 32px 0 0; padding: 22px 0; background: var(--strip);
}
.strip-item { flex: 1 1 0; min-width: 0; padding: 4px 28px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.strip-item + .strip-item { border-left: 1px solid rgba(255, 255, 255, .18); }
.strip-item dt { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--strip-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-item dd { margin: 0; font-size: 1.35rem; font-weight: 700; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 0; background: var(--band-btn); color: var(--band-text); cursor: pointer;
}
.icon-btn:hover { background: var(--band-btn-hover); }
.icon-btn svg { width: 20px; height: 20px; }
.badge-count {
  position: absolute; top: 4px; right: 3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #C62828; color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center;
}
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.user-menu { position: relative; }
.user-menu summary {
  list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; height: 44px; padding: 0 12px 0 4px;
  border-radius: 999px; background: var(--band-btn); color: var(--band-text);
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--band-btn-hover); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cream); color: var(--on-cream); font-weight: 800; font-size: .8rem; }
.user-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-size: .82rem; font-weight: 700; }
.user-role { font-size: .7rem; color: var(--band-text); }
.user-menu .chev { width: 16px; height: 16px; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: .75rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: .2rem; z-index: 30;
}
.user-menu-panel a, .link-btn { display: block; padding: .55rem .75rem; border-radius: 999px; color: var(--text); text-decoration: none; text-align: left; width: 100%; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.user-menu-panel a:hover, .link-btn:hover { background: var(--surface-2); }

/* ---------- shell and side menu ---------- */
.shell { display: grid; grid-template-columns: var(--band-org-w) minmax(0, 1fr); min-height: calc(100vh - 182px); }
.sidebar { background: var(--sidebar-bg); padding: 28px 22px 40px; display: flex; flex-direction: column; gap: 18px; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-heading {
  display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 6px; cursor: pointer;
  font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sidebar-muted);
}
.nav-heading .chev { width: 14px; height: 14px; transition: transform .15s; }
.nav-group:not([open]) .nav-heading .chev { transform: rotate(-90deg); }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 16px; border-radius: 999px;
  color: var(--sidebar-text); text-decoration: none; font-size: .95rem; font-weight: 600;
}
.sidebar a svg { width: 17px; height: 17px; opacity: .85; }
.sidebar a:hover { background: var(--sidebar-hover); }
.sidebar a[aria-current="page"] { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 800; }

.content { padding: 34px clamp(1rem, 3.2vw, 44px) 56px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.content > * { margin-top: 0; margin-bottom: 0; }
.content:focus { outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; }
.page-head h1 { margin: 0; }
.page-sub { color: var(--text-muted); margin: .35rem 0 0; font-weight: 600; font-size: 1rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.breadcrumb { margin: 0 0 .35rem; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb svg { width: 15px; height: 15px; }
.site-footer { padding: 1rem clamp(1rem, 3.2vw, 44px); border-top: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: .82rem; }
.site-footer p { margin: 0; }
/* Developer credit: in the footer bar on screen; .print-credit is the copy that shows only on paper. */
.dev-credit { margin: .25rem 0 0; color: var(--text-muted); font-size: .78rem; }
/* Footer always at the bottom of the window: the page is a column and the middle part takes the free space. */
body.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.app > .shell { flex: 1 0 auto; min-height: 0; }
body.app > .site-footer { flex-shrink: 0; }
/* Sign-in page: the card stays centred and the credit sits at the very bottom of the right-hand side. */
.bare-main { grid-template-rows: 1fr auto; }
.bare-main > .dev-credit { align-self: end; text-align: center; margin: 1rem 0 0; }
.print-credit { display: none; }
.print-foot { margin-top: 2rem; padding-top: .5rem; border-top: 1px solid #999; text-align: center; color: #444; }
@media print { .print-credit { display: block; margin-top: 2rem; padding-top: .5rem; border-top: 1px solid #999; text-align: center; color: #444 !important; } }

/* ---------- cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 16px; flex-wrap: wrap; }
.card h2, .card-head h2 { font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; color: var(--label); }
.card-head h2 { margin: 0; }
.card-head a { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.card h3 { color: var(--text); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.quick-links { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); list-style: none; padding: 0; margin: 0; }
.quick-links a { display: flex; align-items: center; min-height: 52px; padding: .8rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 700; }
.quick-links a:hover { border-color: var(--outline); }
dl.details { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: .55rem 1rem; margin: 0; }
dl.details dt { color: var(--text-muted); font-weight: 600; }
dl.details dd { margin: 0; font-weight: 600; }
.card-narrow { max-width: 580px; width: 100%; }
.card-medium { max-width: 860px; width: 100%; }

/* ---------- pill buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: .5rem 1.5rem;
  border-radius: 999px; border: 2px solid transparent; font: inherit; font-size: .82rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: transparent; color: var(--outline-text); border-color: var(--outline); }
.btn-secondary:hover { background: var(--info-bg); }
.btn-slate { background: var(--slate); border-color: var(--slate); color: var(--on-slate); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { min-height: 36px; padding: .3rem 1rem; font-size: .74rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--disabled); border-color: var(--disabled); color: var(--on-disabled); cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1.1rem; }
.form-grid { display: grid; gap: 1.1rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.field { display: grid; gap: .35rem; align-content: start; }
.field label, .field .label { font-weight: 800; font-size: .88rem; }
.field .req { color: var(--danger-text); }
.hint { color: var(--text-muted); font-size: .82rem; margin: 0; font-weight: 500; }
.field-error { color: var(--danger-text); font-size: .85rem; font-weight: 700; margin: 0; }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select {
  width: 100%; min-height: 48px; padding: .55rem 1.1rem; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
}
select { padding-right: 2.2rem; }
input[type="file"] { width: 100%; padding: .6rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; }
textarea { width: 100%; min-height: 120px; padding: .75rem 1rem; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger-text); border-width: 2px; }
.check { display: flex; align-items: flex-start; gap: .6rem; min-height: 32px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; margin-top: .1rem; accent-color: #1269B2; flex-shrink: 0; }
[data-theme="dark"] .check input { accent-color: #F4E9CF; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 1.25rem 1.25rem; margin: 0; }
legend { font-weight: 800; padding: 0 .4rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--label); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .85rem; align-items: flex-end; }
.filter-bar .field { min-width: 160px; flex: 1 1 170px; }
.filter-bar .field:first-child { flex: 2 1 240px; }
.filter-bar .check { min-height: 48px; align-items: center; }
.filter-bar .actions { flex: 0 0 auto; }

/* ---------- alerts, badges ---------- */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-error, .alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }
.alert code { background: transparent; font-weight: 800; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 .65rem; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; vertical-align: middle; }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }
.badge-cream { background: var(--cream); color: var(--on-cream); }

/* ---------- tables (become cards on phones) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .85rem 1.1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table thead th { background: var(--surface-2); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--label); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td a strong { color: var(--text); }
.table details summary { cursor: pointer; color: var(--link); font-weight: 700; }
.table pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; margin: .5rem 0 0; background: var(--surface-2); padding: .6rem; border-radius: 8px; max-width: 520px; }
.person { display: flex; align-items: center; gap: .75rem; }
.initials { width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; background: var(--surface-2); color: var(--label); display: grid; place-items: center; font-size: .78rem; font-weight: 800; }

.empty-state { text-align: center; padding: 2.75rem 1rem; color: var(--text-muted); }
.empty-state h2 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1.15rem; }
.error-state { max-width: 560px; margin: 1rem auto; }
.error-code { font-size: 3.6rem; font-weight: 800; color: var(--muted); margin: 0; }
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* permission matrix */
.js .js-hide { display: none; }
.perm-picker { margin-bottom: 1rem; }
.perm-picker .field { max-width: 460px; }
.perm-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: start; }
.perm-grid.perm-grid-one { grid-template-columns: 1fr; }
.perm-grid-one > fieldset:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: 1.5rem; align-items: start; }
.perm-grid-one > fieldset > legend { grid-column: 1 / -1; }
.perm-grid-one > section.card:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); column-gap: 2rem; }
.perm-grid-one > section.card > h2 { grid-column: 1 / -1; }
.perm-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.perm-row:last-child { border-bottom: 0; }
.perm-row select { min-height: 38px; padding: .2rem 2rem .2rem .9rem; width: auto; font-size: .85rem; }
.perm-code { font-family: ui-monospace, Consolas, monospace; font-size: .76rem; color: var(--text-muted); display: block; font-weight: 500; }

/* lists and notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { padding: .9rem 0; border-top: 1px solid var(--border); display: flex; gap: .75rem; }
.notif-list li:first-child { border-top: 0; padding-top: 0; }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; border: 2px solid var(--border-strong); flex-shrink: 0; }
.notif-unread .notif-dot { background: var(--label); border-color: var(--label); }
.notif-list a { text-decoration: none; }
.notif-list a:hover { text-decoration: underline; }

.logo-preview { display: flex; gap: 1rem; flex-wrap: wrap; }
.logo-preview figure { margin: 0; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; }
.logo-preview img { height: 64px; width: auto; display: block; margin: 0 auto .35rem; }
.logo-on-dark { background: #0C2E55; color: #F4E9CF; }

/* ---------- signed-out pages ---------- */
body.bare { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 560px) 1fr; background: var(--bg); }
.bare-panel { background: var(--band); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; }
.bare-panel .org-mark { width: 56px; height: 56px; font-size: 1.7rem; }
.bare-panel .org-name { font-size: 1.15rem; }
.bare-headline { font-size: 2.4rem; line-height: 1.15; font-weight: 800; margin: 0 0 1rem; }
.bare-lede { color: var(--band-caption); font-size: 1.05rem; margin: 0; }
.bare-strip { margin: 0; border-radius: var(--radius-sm); padding: 18px 0; }
.bare-strip .strip-item { padding: 2px 20px; }
.bare-strip .strip-item dd { font-size: .95rem; }
.bare-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.bare-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 44px; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.bare-card h1 { font-size: 1.9rem; margin: 0; }
.bare-card .alert { margin: 0; }

/* ---------- print ---------- */
.print-header { display: flex; align-items: center; gap: 1rem; border-bottom: 3px solid #1269B2; padding-bottom: .75rem; margin-bottom: 1.25rem; }
.print-logo { height: 64px; width: auto; }
.print-org { font-size: 1.3rem; font-weight: 800; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.print-header p { margin: 0; }
body.print-page { background: #fff; color: #000; padding: 1.5rem; max-width: 900px; margin: 0 auto; }
@media print {
  .band, .sidebar, .site-footer, .page-actions, .no-print, .skip-link { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; border-color: #999; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --band-org-w: 240px; }
  .strip-item { padding: 4px 18px; }
  .strip-item dd { font-size: 1.15rem; }
}
@media (max-width: 900px) {
  .band {
    grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-rows: auto auto;
    grid-template-areas: "toggle org actions" "strip strip strip"; align-items: center;
  }
  .band-toggle { display: inline-grid; margin-left: 8px; }
  .band-org { padding: 10px 8px; gap: 0; }
  .org-contact, .org-tag, .band-caption { display: none; }
  .org-mark { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; }
  .org-logo { height: 38px; }
  .org-name { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .band-actions { padding-right: 10px; gap: 4px; }
  .user-text, .user-menu .chev { display: none; }
  .user-menu summary { padding: 0 4px; }
  .band-strip { margin: 0; padding: 12px 0; overflow-x: auto; scroll-snap-type: x mandatory; }
  .strip-item { flex: 0 0 auto; min-width: 46%; padding: 2px 16px; scroll-snap-align: start; gap: 4px; }
  .strip-item dd { font-size: 1.05rem; }
  .shell { grid-template-columns: 1fr; min-height: 0; }
  .sidebar { padding: 14px 12px 18px; gap: 10px; }
  .js .sidebar { display: none; }
  .js.nav-open .sidebar { display: flex; }
  body.bare { grid-template-columns: 1fr; }
  .bare-panel { padding: 28px 22px; gap: 1.25rem; }
  .bare-headline { font-size: 1.5rem; }
  .bare-strip { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .content { padding: 20px 14px 40px; gap: 16px; }
  h1 { font-size: 1.55rem; }
  .card { padding: 18px 16px; }
  .bare-card { padding: 26px 20px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  dl.details { grid-template-columns: 1fr; gap: .1rem; }
  dl.details dd { margin-bottom: .6rem; }
  .table-wrap { border: 0; background: transparent; box-shadow: none; }
  table.table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; padding: .4rem .25rem; box-shadow: var(--shadow); }
  .table.stack td { border: 0; padding: .35rem .8rem; display: grid; grid-template-columns: 38% 1fr; gap: .5rem; align-items: start; }
  .table.stack td::before { content: attr(data-label); font-weight: 800; color: var(--label); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding-top: .15rem; }
  .table.stack td.num { text-align: left; }
  .table.stack td .badge { width: fit-content; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .grid-3 .stat-value { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .sidebar a, .quick-links a { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
}

/* fixes from the redesign screenshot check */
.band .band-toggle { display: none; }
.strip-item dt { white-space: normal; line-height: 1.3; letter-spacing: .1em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 900px) {
  .band .band-toggle { display: inline-grid; }
  .strip-item dt { -webkit-line-clamp: 1; white-space: nowrap; display: block; }
}

/* ==========================================================================
   Patterns from the mockups (canvas "ERP UI Redesign Mockups")
   ========================================================================== */
:root { --series1: #1269B2; --series2: #7CC0F7; --series3: #E0A93B; --series4: #50678A; }
[data-theme="dark"] { --series1: #5DAEF2; --series2: #F4E9CF; --series3: #E7B75A; --series4: #A8BBD2; }

/* figure cards (mockup: dashboard top row) */
.kpi-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.kpi { padding: 22px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-head h2 { margin: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.kpi-head a { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.kpi-value { margin: 14px 0 0; font-size: 2.35rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.kpi-unit { font-size: 1.05rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0; }
.kpi-note { margin: 8px 0 0; font-size: .85rem; font-weight: 600; color: var(--text-muted); }

/* chart cards */
.dash-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
@media (min-width: 1101px) { .dash-row { grid-template-columns: 2fr 1fr; } .dash-row:has(> :nth-child(3)) { grid-template-columns: 1.4fr 1fr 1fr; } }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.chart-label { fill: var(--text); font-size: 14px; font-weight: 700; }
.chart-value { fill: var(--text); font-size: 14px; font-weight: 800; }
.chart-track { fill: var(--surface-2); }
.chart-track-stroke { stroke: var(--surface-2); }
.s1 { fill: var(--series1); } .s2 { fill: var(--series2); } .s3 { fill: var(--series3); } .s4 { fill: var(--series4); }
.s1-stroke { stroke: var(--series1); } .s2-stroke { stroke: var(--series2); } .s3-stroke { stroke: var(--series3); } .s4-stroke { stroke: var(--series4); }
.s1-bg { background: var(--series1); } .s2-bg { background: var(--series2); } .s3-bg { background: var(--series3); } .s4-bg { background: var(--series4); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 170px; height: 170px; flex-shrink: 0; }
.donut svg { width: 170px; height: 170px; }
.donut-center { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.donut-center span { font-size: 2.2rem; letter-spacing: 0; color: var(--text); line-height: 1.1; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-weight: 700; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend strong { color: var(--text-muted); }
.key { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.activity li:first-child { border-top: 0; padding-top: 0; }
.activity li > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.activity a { text-decoration: none; }
.activity-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.ending-date { font-weight: 800; color: var(--warning-text); white-space: nowrap; }

/* settings pattern (mockup: "Users & access", from the configuration reference) */
.settings { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 36px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.settings-title { margin: 14px 0 0; font-size: 1.1rem; font-weight: 700; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.settings-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.settings-box.has-error { border-color: var(--danger-text); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.field .value { min-height: 48px; display: flex; align-items: center; font-weight: 600; color: var(--text-muted); }
.info-lines { line-height: 2; color: var(--text-muted); }
.info-lines strong { color: var(--text); }
.text-link { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; align-self: center; }
.text-link:hover { text-decoration: underline; }
@media (max-width: 640px) { .settings { padding: 18px 16px; } .settings-box { padding: 16px; } }

/* role tiles */
.tile-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tile { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.tile:hover { border-color: var(--outline); }
.tile:has(input:checked), .tile-on { border: 2px solid var(--outline); background: var(--info-bg); padding: 13px 15px; }
.tile input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #1269B2; flex-shrink: 0; }
[data-theme="dark"] .tile input { accent-color: #F4E9CF; }
.tile strong { display: block; color: var(--text); }
.tile-sub { display: block; font-size: .82rem; color: var(--text-muted); font-weight: 600; }

/* Inherit / Allow / Deny switch */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; gap: 2px; flex-shrink: 0; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 6px 14px; border-radius: 999px; font-size: .78rem; font-weight: 800; color: var(--text-muted); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-opt input:checked + span { background: var(--primary); color: var(--on-primary); }
.seg-deny input:checked + span { background: var(--danger); color: #FFFFFF; }
@media (max-width: 640px) { .perm-row { grid-template-columns: 1fr; } }

/* search box with icon (mockup: staff register) */
input[type="search"] {
  padding-left: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2352667E' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 1rem 50%;
}
/* charts: do not inherit the icon stroke */
.chart, .donut svg { stroke: none; stroke-width: 0; width: 100%; }
.donut svg { width: 170px; }
.donut svg circle { stroke-width: 22; stroke-linecap: butt; }
.chart text { stroke: none; }
.kpi-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.card-head h2 { flex: 1 1 auto; }

/* ---------- Phase 3: workflow (mockups: Memo inbox, Compose memo, Memo view, My approvals) ---------- */
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
.row-unread td:first-child a strong { font-weight: 800; }
.row-unread td:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--primary); margin-right: 8px; vertical-align: middle; }
.ref { font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--label); }
/* memo "paper" */
.memo-paper { padding: 32px 36px; }
.memo-meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 20px; padding-bottom: 18px; border-bottom: 2px solid var(--border); }
.memo-meta dt { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--label); padding-top: 3px; }
.memo-meta dd { margin: 0; font-weight: 600; }
.memo-subject { font-size: 1.35rem; margin: 0 0 14px; }
.memo-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; font-weight: 700; }
.chip small { font-weight: 600; color: var(--text-muted); }
/* trail (append-only; read-only on screen too) */
.trail { list-style: none; margin: 0; padding: 0; position: relative; }
.trail li { position: relative; padding: 0 0 18px 30px; }
.trail li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.trail li:last-child { padding-bottom: 0; }
.trail li:last-child::before { display: none; }
.trail-dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 99px; background: var(--surface); border: 3px solid var(--outline); }
.trail-dot.t-approve { border-color: var(--success-text); background: var(--success-bg); }
.trail-dot.t-reject, .trail-dot.t-cancel { border-color: var(--danger-text); background: var(--danger-bg); }
.trail-dot.t-return { border-color: var(--warning-text); background: var(--warning-bg); }
.trail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.trail-note { margin: 6px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
/* people picker (None / To / CC) */
.people { display: flex; flex-direction: column; max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.people-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); }
.people-row:first-child { border-top: 0; }
.people-row.is-picked { background: var(--info-bg); }
.people-row[hidden] { display: none; }
.people-dept { padding: 8px 14px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--label); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.seg-to input:checked + span { background: var(--primary); color: var(--on-primary); }
.seg-cc input:checked + span { background: var(--slate); color: var(--on-slate); }
.action-panel textarea { min-height: 110px; }
.action-panel .actions { flex-wrap: wrap; }
.stack-gap { display: flex; flex-direction: column; gap: 20px; }
.flow-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.flow-steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; }
.flow-steps li::before { content: counter(step); flex-shrink: 0; width: 30px; height: 30px; border-radius: 999px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
@media (max-width: 640px) { .memo-paper { padding: 20px 16px; } .memo-meta { grid-template-columns: 1fr; gap: 2px; } .memo-meta dd { margin-bottom: 8px; } .people-row { flex-wrap: wrap; } }
@media print { .memo-paper { padding: 0; border: 0; } .action-panel { display: none !important; } }
.seg-none input:checked + span { background: var(--surface-2); color: var(--text-muted); }
.activity li { flex-wrap: wrap; } .activity li > div:first-child { flex: 1 1 180px; }

/* ---------- Phase 4: operations ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted); font-weight: 700; text-decoration: none; background: var(--surface); }
.tabs a:hover { border-color: var(--outline); }
.tabs a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.req-line { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; padding: 4px 2px; }
.check-list > * { flex-shrink: 0; } /* long lists scroll inside the box instead of squeezing the rows on top of each other */
.check-list label.check[hidden] { display: none; }
.filter-box { margin: 0 0 .5rem; }
.filter-box input[type="search"] { width: 100%; }
.filter-box .hint { margin-top: .25rem; }
.plain-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.delivery { padding: 14px 0; border-top: 1px solid var(--border); }
.delivery:first-of-type { border-top: 0; padding-top: 0; }
.legend-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.table input[type="text"], .table select, .inline input[type="text"], .inline select { min-height: 40px; padding: 0 12px; border-radius: 999px; width: auto; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.table input[type="date"] { min-height: 40px; }
@media (max-width: 640px) { .req-line { grid-template-columns: 1fr 110px; } }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-label { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.bar { width: 100%; height: 10px; display: block; }

/* ---------- Phase 5: money ---------- */
.figure-list { margin: 0; display: grid; gap: 0; }
.figure-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.figure-list > div:first-child { border-top: 0; padding-top: 0; }
.figure-list dt { color: var(--text-muted); font-weight: 600; }
.figure-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.figure-strong dt, .figure-strong dd { color: var(--text); font-weight: 800; font-size: 1.05rem; }
.field-wide { flex: 3 1 320px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 800; border-top: 2px solid var(--border-strong); }
.neg { color: var(--danger-text); }
.payslip { max-width: 820px; }
.payslip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.payslip-net { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-radius: 12px; background: var(--cream, #F4E9CF); color: #0B2A4A; font-weight: 800; }
.payslip-net strong { font-size: 1.6rem; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.check-row:first-child { border-top: 0; padding-top: 0; }
.staff-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; max-height: 460px; overflow: auto; padding: 2px; }
.staff-picks .tile { padding: 10px 12px; }
@media (max-width: 640px) { .payslip-grid { grid-template-columns: 1fr; } }
@media print { .payslip-net { border: 2px solid #000; } }
.seg-link { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: var(--text-muted); text-decoration: none; }
.seg-link.is-on { background: var(--primary); color: var(--on-primary); }
/* Long-form text (privacy notice). */
.prose h2 { margin: 1.4rem 0 .4rem; }
.prose h2:first-of-type { margin-top: .4rem; }
.prose ul { padding-left: 1.2rem; margin: .4rem 0; }
.prose li { margin-bottom: .35rem; }

/* ---------- Buildings module ---------- */
.cal { table-layout: fixed; }
.cal th { text-align: center; }
.cal td { vertical-align: top; height: 84px; padding: 6px; }
.cal-day { display: block; font-weight: 800; color: var(--text-muted); font-size: .8rem; margin-bottom: 4px; }
.cal-today { background: var(--info-bg); }
.cal-item { display: block; margin-top: 3px; white-space: normal; text-decoration: none; font-size: .72rem; }
@media (max-width: 640px) { .cal td { height: 56px; padding: 3px; } .cal-item { font-size: .62rem; } }
.cover-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cover-row > span { flex: 1 1 220px; }
.cover-sum { width: 170px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.activity li.is-today { background: var(--info-bg); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.activity li > div:first-child .small .badge { margin-right: 4px; }
.table tr.has-error td { background: var(--danger-bg, rgba(200, 40, 40, .06)); }
.checklist-items .settings-row { padding: 6px 0; border-top: 1px solid var(--border); }
.checklist-items .settings-row:first-child { border-top: 0; }
.table textarea { width: 100%; min-width: 240px; }
@media (max-width: 640px) { .table textarea { min-width: 0; } }
