/* Shared WMS interface. Loaded after legacy page styles so all modules use the
   same typography, controls and spacing while keeping their existing flows. */
:root {
  --brand: #188b97;
  --brand-2: #22c1c8;
  --brand-3: #14b8a6;
  --accent: #84cc16;
  --bg-1: #eef6f7;
  --bg-2: #e2f1f3;
  --bg-3: #fff8e8;
  --surface: rgba(255,255,255,0.68);
  --surface-solid: #fff;
  --surface-2: rgba(255,255,255,0.46);
  --border: rgba(15,28,36,0.09);
  --border-strong: rgba(15,28,36,0.15);
  --text-1: #0c1f25;
  --text-2: #4d6068;
  --text-3: #8696a0;
  --green: #16a34a;
  --green-soft: rgba(22,163,74,0.12);
  --red: #e11d48;
  --red-soft: rgba(225,29,72,0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251,191,36,0.18);
  --blue: #3b82f6;
  --blue-soft: rgba(59,130,246,0.14);
  --shadow-sm: 0 1px 3px rgb(22 44 30 / 4%);
  --shadow-md: 0 2px 8px rgb(22 44 30 / 5%);
  --shadow-lg: 0 12px 36px rgb(22 44 30 / 16%);
  --shadow-glow: 0 0 #0000;
  --radius: 12px;
  --radius-sm: 8px;
  --wms-sidebar-width: 232px;
  --wms-control-height: 42px;
  --wms-field-height: 48px;
  --wms-field-font-size: 15px;
  --wms-field-border: color-mix(in srgb, var(--brand) 38%, var(--border-strong));
  --wms-section-gap: 24px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg-1: #050c12;
  --bg-2: #0a141c;
  --bg-3: #0a1925;
  --surface: rgba(20,32,42,0.58);
  --surface-solid: #131e29;
  --surface-2: rgba(20,32,42,0.36);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text-1: #eaf2f6;
  --text-2: #a3b1bc;
  --text-3: #6c7c88;
  --wms-field-border: color-mix(in srgb, var(--brand-2) 58%, var(--border-strong));
  color-scheme: dark;
}
html body[data-page] {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg-1);
}
body[data-page] :is(button, input, select, textarea) { font-family: inherit; }
body[data-page] :is(p, small, label, dt, dd, th, td, summary, .status, .badge, .form-message, .empty-state) {
  font-size: 14px;
  line-height: 1.55;
}
body[data-page] :is(h1, h2, h3, h4, p) { overflow-wrap: anywhere; }
body[data-page] :is(.main, .auth-dialog) h2 { font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
body[data-page] :is(.main, .auth-dialog) h3 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
body[data-page] :is(.main, .auth-dialog) h4 { font-size: 16px; font-weight: 600; }
body[data-page] :is(.glass, .sidebar-inner) {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html body[data-page] .sidebar {
  width: var(--wms-sidebar-width);
  height: 100dvh;
  padding: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
html body[data-page] .sidebar-inner { padding: 22px 12px 14px; border-radius: 0; overflow: hidden; }
body[data-page] .brand { padding: 2px 12px 22px; margin-bottom: 6px; border: 0; }
body[data-page] .brand-logo { width: 155px; }
html body[data-page] .sidebar .nav { gap: 3px; min-height: 0; overflow-y: auto; padding-bottom: 12px; scrollbar-width: thin; }
/* First sign-in or expired navigation cookie: reveal only a complete, checked menu. */
html[data-navigation-pending] .sidebar .nav { visibility: hidden; }
body[data-page] .nav-section {
  padding: 16px 12px 5px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
body[data-page] .nav-section:first-child { padding-top: 0; }
html body[data-page] .nav-link {
  min-height: 42px;
  padding: 9px 12px;
  margin-left: 0;
  gap: 11px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  flex-shrink: 0;
  color: var(--text-2);
}
body[data-page] .nav-link-sub::before { display: none; }
body[data-page] .nav-link i { font-size: 18px; width: 19px; flex: 0 0 19px; }
html body[data-page] .nav-link.active {
  color: var(--brand);
  background: linear-gradient(135deg, rgba(24,139,151,0.18), rgba(34,193,200,0.10));
  box-shadow: inset 3px 0 var(--brand);
  font-weight: 600;
}
body[data-page] .nav-link:hover { background: var(--surface-2); }
body[data-page] .sidebar-footer { padding-top: 12px; flex-shrink: 0; }
body[data-page] .user-avatar { background: linear-gradient(135deg, var(--accent), var(--brand)); color: #fff; border-radius: 50%; font-weight: 600; }
body[data-page] .user-name { font-size: 14px; font-weight: 600; }
body[data-page] .user-role { font-size: 12px; }
html body[data-page] .main {
  min-width: 0;
  width: calc(100% - var(--wms-sidebar-width));
  max-width: 1568px;
  margin: 0 auto;
  padding: 28px 32px;
}
/* Owner-authorized demo context stays visible independently of the sidebar. */
html body[data-page] .company-demo-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-width: 0; flex: 0 0 auto; margin: 0 0 18px;
}
html body[data-page] .company-demo-notice--demo {
  position: sticky; top: 0; z-index: 45; padding: 10px 14px;
  border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 8px;
  background: var(--surface-solid); box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
}
html body[data-page] .company-demo-notice--live { justify-content: flex-end; margin-bottom: 12px; }
html body[data-page] .company-demo-copy { display: grid; gap: 2px; min-width: 0; }
html body[data-page] .company-demo-copy strong { color: var(--text-1); font-size: 14px; line-height: 1.4; font-weight: 600; }
html body[data-page] .company-demo-copy span { color: var(--text-2); font-size: 13px; line-height: 1.4; font-weight: 400; }
html body[data-page] .company-demo-switch {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-solid); color: var(--brand); font-size: 14px; font-weight: 500;
  line-height: 1.4; text-decoration: none;
}
html body[data-page] .company-demo-switch:hover { background: var(--surface-2); border-color: var(--brand); }
html body[data-page] .company-demo-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (max-width: 600px) {
  html body[data-page] .company-demo-notice--demo { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  html body[data-page] .company-demo-notice--demo .company-demo-copy { flex: 1 1 100%; }
  html body[data-page] .company-demo-switch { min-height: 44px; }
}
@media (max-width: 820px) {
  /* Clip horizontal document overflow without creating a non-scrolling sticky
     ancestor; the demo context must remain visible while the page scrolls. */
  html body[data-page="documentDetail"] .main:has(> .company-demo-notice--demo) { overflow-x: clip; overflow-y: visible; }
}
@media print {
  html body[data-page] .company-demo-notice--demo { position: static; box-shadow: none; break-inside: avoid; }
  html body[data-page] .company-demo-notice--live,
  html body[data-page] .company-demo-switch { display: none; }
}
/* Keep the document icon rail compact after the shared navigation styles. */
@media screen and (min-width: 901px) {
  body[data-page="documentDetail"] { --wms-sidebar-width: 64px; }
  html body[data-page="documentDetail"] .sidebar-inner { padding: 18px 10px 14px; }
  html body[data-page="documentDetail"] .nav-link { padding: 0; gap: 0; }
  html body[data-page="documentDetail"] .main { max-width: none; }
}
html body[data-page] .topbar {
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0;
  margin: 0 0 var(--wms-section-gap);
}
html body[data-page] .topbar > div:first-child { min-width: 0; }
html body[data-page] .page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.035em;
}
html body[data-page] .page-sub { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
html body[data-page] .topbar-right { gap: 10px; flex-wrap: wrap; min-width: 0; flex-shrink: 1; }
body[data-page] :is(.btn-primary, .btn-secondary, .btn-danger, .btn-ghost) {
  min-height: var(--wms-control-height);
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
html body[data-page] .btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-3)); border: 1px solid var(--brand); box-shadow: none; }
html body[data-page] .btn-primary:hover { background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); border-color: var(--brand-2); transform: none; }
body[data-page] :is(.btn-secondary, .btn-ghost) { color: var(--text-1); background: var(--surface); border: 1px solid var(--border-strong); }
body[data-page] :is(.btn-secondary, .btn-ghost):hover { background: var(--surface-2); border-color: var(--brand); transform: none; }
body[data-page] .btn-danger { background: var(--red); color: var(--surface); border: 1px solid var(--red); }
body[data-page] :is(button, a, summary, input[type="checkbox"], input[type="radio"], input[type="range"]):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
body[data-page] button:disabled { opacity: .55; cursor: not-allowed; }
body[data-page] :is(.btn-primary, .btn-secondary, .btn-danger, .btn-ghost) > i { font-size: 17px; flex-shrink: 0; }
html body[data-page] .icon-btn {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 8px; background: var(--surface); border-color: var(--border);
  font-size: 18px; box-shadow: none; flex-shrink: 0;
}
body[data-page] .icon-btn:hover { transform: none; }
body[data-page] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), select, textarea) {
  min-width: 0;
  min-height: var(--wms-control-height);
  padding: 9px 12px;
  font-size: var(--wms-field-font-size) !important;
  font-weight: 400;
  line-height: 1.45;
  border-radius: 8px;
  border-color: var(--wms-field-border);
  color: var(--text-1);
  background-color: var(--surface);
  box-shadow: none;
}
html body[data-page] select:not([multiple]) {
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  padding: 0 44px 0 14px;
  border-color: var(--wms-field-border);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L9 3L13 7' stroke='%2364758B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 11L9 15L13 11' stroke='%2364758B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  font-size: var(--wms-field-font-size) !important;
}
html[data-theme="dark"] body[data-page] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L9 3L13 7' stroke='%23E5EDF4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 11L9 15L13 11' stroke='%23E5EDF4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body[data-page] textarea { resize: vertical; }
body[data-page] input::placeholder, body[data-page] textarea::placeholder { color: var(--text-3); opacity: 1; }
body[data-page] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), select, textarea):is(:focus, :focus-visible) {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent);
}
body[data-page] :is(.form-grid, .stack-form) label > span { font-size: 14px; color: var(--text-2); font-weight: 500; letter-spacing: 0; text-transform: none; }
body[data-page] .form-grid { gap: 18px; }
body[data-page] .stack-form { gap: 18px; }
html body[data-page] .search {
  width: clamp(240px, 25vw, 360px);
  max-width: 100%; min-width: 0; height: var(--wms-field-height); min-height: var(--wms-field-height);
  padding: 0 14px; gap: 10px;
  border-radius: 8px; border-color: var(--wms-field-border); background: var(--surface);
}
html body[data-page] .search input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: calc(var(--wms-field-height) - 2px);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-overflow: ellipsis;
}
html body[data-page] .search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent);
}
html body[data-page] .search input:is(:focus, :focus-visible) { outline: none; border: 0; box-shadow: none; background: transparent; }
body[data-page] .search i { font-size: 17px; color: var(--text-3); }
body[data-page] .dashboard-filter { height: var(--wms-field-height); min-height: var(--wms-field-height); border-radius: 8px; border-color: var(--wms-field-border); background: var(--surface); padding: 0 10px; }
body[data-page] .dashboard-filter span { font-size: 14px; font-weight: 500; }
html body[data-page] .dashboard-filter select { height: calc(var(--wms-field-height) - 2px); min-height: 0; padding-block: 0; border: 0; background-color: transparent; box-shadow: none; }
html body[data-page] .dashboard-filter:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent); }
html body[data-page] .dashboard-filter select:is(:focus, :focus-visible) { outline: none; border: 0; box-shadow: none; }
html body[data-page] .dashboard-allocation-filter { width: 420px; max-width: 100%; }
html body[data-page] .dashboard-allocation-filter select { flex: 1 1 230px; width: auto; min-width: 0; }
html body[data-page] .dashboard-filter:not(.dashboard-allocation-filter) select { width: 104px; min-width: 104px; }
html body[data-page] .ecolix-date-trigger {
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  gap: 10px;
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  padding: 0 14px;
  border-color: var(--wms-field-border);
  border-radius: 8px;
  background: var(--surface);
  font-size: var(--wms-field-font-size) !important;
  font-weight: 400;
}
html body[data-page] .ecolix-date-trigger > svg:first-child { width: 18px; height: 18px; }
html body[data-page] .ecolix-date-trigger > svg:last-child { width: 16px; height: 16px; }
html body[data-page] .ecolix-date-trigger.is-empty .ecolix-date-trigger-value { font-weight: 400; }
html body[data-page] .ecolix-date-trigger:focus-visible,
html body[data-page] .ecolix-date-field.is-open .ecolix-date-trigger {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent);
}
html body[data-page] .ecolix-date-toolbar {
  grid-template-columns: 40px minmax(116px, 1fr) minmax(82px, .66fr) 40px;
  gap: 8px;
}
html body[data-page] .ecolix-date-select-wrap .ecolix-date-month-select {
  width: 100%;
  padding: 0 30px 0 10px;
  background-position: right 8px center;
  background-size: 16px 16px;
}
html body[data-page] .ecolix-date-year-trigger {
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  border-color: var(--wms-field-border);
  border-radius: 8px;
  font-size: var(--wms-field-font-size);
  font-weight: 400;
}
html body[data-page] .ecolix-date-year-trigger:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent);
}
html body[data-page] .sa-inline-search {
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  padding: 0 14px;
  border-color: var(--wms-field-border);
  border-radius: 8px;
  background: var(--surface);
}
html body[data-page] .sa-inline-search input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: calc(var(--wms-field-height) - 2px);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: var(--wms-field-font-size) !important;
}
html body[data-page] .sa-inline-search:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent);
}
html body[data-page] .sa-inline-search input:is(:focus, :focus-visible) { outline: none; border: 0; box-shadow: none; background: transparent; }
html body[data-page] :is(.admin-access-search, .admin-company-search) input {
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  padding: 0 14px 0 38px;
  font-size: var(--wms-field-font-size);
}
html body[data-page] .avv-public-search-input {
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  padding: 0 14px 0 48px;
  font-size: var(--wms-field-font-size);
}
html body[data-page] .avv-public-search-field > i { left: 16px; font-size: 18px; }
html body[data-page] .construction-search input {
  height: var(--wms-field-height);
  min-height: var(--wms-field-height);
  padding-left: 38px;
}
html body[data-page] input:not([type="search"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="color"]):is(:focus, :focus-visible),
html body[data-page] select:not([multiple]):is(:focus, :focus-visible),
html body[data-page] textarea:is(:focus, :focus-visible),
html body[data-page] :is(.avv-public-search-input, .construction-search input, .admin-access-search input, .admin-company-search input):is(:focus, :focus-visible) {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 58%, transparent);
}
html body[data-page] .dashboard-filter select:is(:focus, :focus-visible) { outline: none; border: 0; box-shadow: none; }
body[data-page] :is(.table-wrap, .construction-table-wrap) { max-width: 100%; overflow-x: auto; }
body[data-page] :is(.data-table, .construction-table) { font-size: 14px; }
body[data-page] :is(.data-table, .construction-table) th { padding: 12px 16px; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; background: var(--surface-2); }
body[data-page] :is(.data-table, .construction-table) td { padding: 14px 16px; font-size: 14px; line-height: 1.5; }
body[data-page] :is(.data-table, .construction-table) td small { display: block; font-size: 13px; color: var(--text-2); }
body[data-page] :is(.kpi, .dashboard-kpi, .gewabfv-kpi, .construction-kpi) { padding: 20px; border-color: var(--border); background: var(--surface); box-shadow: none; }
body[data-page] :is(.kpi, .dashboard-kpi, .gewabfv-kpi, .construction-kpi)::before,
body[data-page] :is(.kpi, .dashboard-kpi, .gewabfv-kpi, .construction-kpi)::after { display: none; }
body[data-page] :is(.kpi-icon, .dashboard-kpi-icon) { border-radius: 8px; width: 36px; height: 36px; box-shadow: none; font-size: 18px; }
body[data-page] :is(.dashboard-kpi-label, .kpi-label) { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
body[data-page] :is(.dashboard-kpi-value, .kpi-value) { font-size: 30px; line-height: 1.2; font-weight: 600; }
body[data-page] :is(.dashboard-kpi-trend, .dashboard-ranking, .kpi-foot, .meta-line) { font-size: 14px; }
body[data-page] :is(.dashboard-panel, .chart-card, .panel, .content-card) { padding: 22px; }
body[data-page] :is(.dashboard-panel-head, .panel-head) { gap: 16px; margin-bottom: 20px; }
body[data-page] .footer { color: var(--text-3); font-size: 12px; margin-top: 28px; }

/* Documentation pages: useful data first, supporting explanations on demand. */
body[data-page] :is(.gewabfv-main, .construction-main) { gap: 0; --gewabfv-ink: var(--text-1); --construction-ink: var(--text-1); }
body[data-page] .wms-guidance { margin: 0 0 24px; color: var(--text-2); }
body[data-page] .wms-guidance > summary { display: flex; gap: 9px; align-items: center; padding: 8px 0; font-size: 14px; cursor: pointer; list-style: none; }
body[data-page] .wms-guidance > summary::after { content: "+"; margin-left: auto; font-size: 20px; }
body[data-page] .wms-guidance[open] > summary::after { content: "−"; }
body[data-page] .wms-guidance[open] { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
body[data-page] :is(.gewabfv-scope-note, .construction-scope-note) { background: transparent; padding: 12px 0 0; margin: 0; border: 0; }
body[data-page] .wms-guidance-scope { grid-column: 1 / -1; margin: 0; color: var(--text-1); }
body[data-page] :is(.gewabfv-scope-note, .construction-scope-note) :is(strong,p,a) { font-size: 14px; font-weight: 400; }
body[data-page] :is(.gewabfv-scope-note, .construction-scope-note) strong { font-weight: 600; }
body[data-page] :is(.gewabfv-filter-rail, .construction-filter-rail) { gap: 16px; padding: 18px; margin-bottom: 12px; background: var(--surface); border-radius: 10px; }
body[data-page] .gewabfv-filter-rail { grid-template-columns: minmax(150px,.65fr) minmax(230px,1.25fr) minmax(170px,.8fr) auto; }
body[data-page] .construction-filter-rail { grid-template-columns: minmax(250px,1.4fr) repeat(3,minmax(135px,.7fr)) auto; }
body[data-page] :is(.gewabfv-filter-rail, .construction-filter-rail) label > span { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-2); }
body[data-page] .gewabfv-filter-scope > span { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
body[data-page] .gewabfv-filter-scope strong { min-height: 42px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 400; padding: 0; }
body[data-page] .construction-search input { padding-left: 38px; }
body[data-page] .construction-search > i { top: auto; bottom: 12px; left: 12px; font-size: 17px; }
body[data-page] :is(.gewabfv-kpis, .construction-kpis) { gap: 16px; margin-bottom: 24px; }
body[data-page] :is(.gewabfv-kpi, .construction-kpi) { min-height: 126px; border-radius: 10px; }
body[data-page] :is(.gewabfv-kpi, .construction-kpi) span { color: var(--text-2); font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; max-width: 100%; white-space: normal; hyphens: auto; overflow-wrap: anywhere; }
body[data-page] :is(.gewabfv-kpi, .construction-kpi) strong { margin: 9px 0 4px; color: var(--text-1); font-size: 28px; font-weight: 600; line-height: 1.2; }
body[data-page] :is(.gewabfv-kpi, .construction-kpi) small { font-size: 13px; }
body[data-page] .gewabfv-kpi > i { display: none; }
body[data-page] .construction-kpi > i { width: 28px; height: 28px; background: transparent; color: var(--text-3); font-size: 20px; border-radius: 0; }
body[data-page] :is(.gewabfv-panel, .construction-detail, .construction-project-rail) { margin-bottom: 24px; border-radius: 10px; }
body[data-page] .gewabfv-panel { padding: 22px; }
body[data-page] :is(.gewabfv-panel-head, .construction-section-head) { gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
body[data-page] :is(.gewabfv-section-kicker, .construction-section-kicker) { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; text-transform: none; }
body[data-page] .gewabfv-panel-head .gewabfv-section-kicker { display: none; }
body[data-page] .gewabfv-panel-head h2 { margin: 0; }
body[data-page] .gewabfv-panel-head p { margin: 5px 0 0; font-size: 14px; }
body[data-page] :is(.gewabfv-row-count, .gewabfv-threshold) { padding: 5px 9px; font-size: 13px; font-weight: 500; border-radius: 6px; }
body[data-page] .wms-disclosure { margin-bottom: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
body[data-page] .wms-disclosure > summary { padding: 18px 22px; cursor: pointer; font-size: 16px; font-weight: 600; }
body[data-page] .wms-disclosure > summary span { display: block; margin: 4px 0 0 17px; color: var(--text-2); font-size: 14px; font-weight: 400; }
body[data-page] .wms-disclosure .gewabfv-overview-grid { padding: 0 20px 20px; margin: 0; gap: 20px; }
body[data-page] .wms-disclosure .gewabfv-panel { padding: 18px; margin: 0; background: var(--surface-2); }
body[data-page] :is(.gewabfv-main, .gewabfv-profile-dialog) :is(.gewabfv-proof-row, .gewabfv-formula, .gewabfv-container-copy, .gewabfv-exclusion-note, .gewabfv-legal-note) :is(span, strong, small) { font-size: 14px; }
body[data-page] :is(.gewabfv-legal-note, .construction-legal-note) { font-size: 14px; line-height: 1.6; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
body[data-page] :is(.gewabfv-legal-note, .construction-legal-note) > span { flex: 1 1 260px; }
body[data-page] .construction-workspace { grid-template-columns: minmax(245px, .3fr) minmax(0, 1fr); gap: 20px; }
body[data-page] .construction-detail { padding: 22px; min-width: 0; }
body[data-page] .construction-project-rail { padding: 16px; }
body[data-page] .construction-rail-head { flex-wrap: wrap; gap: 12px; }
body[data-page] .construction-rail-head select { width: 100%; max-width: none; }
html body[data-page] :is(#documentPageSize, #containerHistoryPageSize) { width: 108px; min-width: 108px; }
body[data-page] :is(.construction-main, .construction-dialog) :is(span, small, strong, b, button, legend, time) { font-size: 14px; line-height: 1.5; letter-spacing: 0; }
body[data-page] .construction-kpi strong { font-size: 28px; }
body[data-page] .construction-project-card { padding: 16px 12px; border-radius: 8px; background: var(--surface); box-shadow: none; }
body[data-page] .construction-project-card.active { background: linear-gradient(135deg, var(--construction-cyan-soft), transparent 68%), var(--surface-2); border-color: var(--construction-cyan); }
body[data-page] .construction-project-card strong { font-size: 15px; }
body[data-page] .construction-project-card > i { background: transparent; box-shadow: none; color: var(--brand); }
body[data-page] .construction-detail-head { flex-wrap: wrap; gap: 16px; padding-bottom: 18px; }
body[data-page] .construction-detail-head h2 { font-size: 22px; }
body[data-page] .construction-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 12px; margin-bottom: 22px; background: transparent; border-radius: 0; border-bottom: 1px solid var(--border); }
body[data-page] .construction-tab { min-height: 42px; padding: 9px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
body[data-page] .construction-tab.active { color: var(--construction-lime); background: var(--construction-lime-soft); box-shadow: none; }
body[data-page] .construction-section-block { padding: 0; margin: 24px 0; background: transparent; border: 0; box-shadow: none; }
body[data-page] .construction-section-head > div > span { display: none; }
body[data-page] .construction-section-head h3 { margin: 0; }
body[data-page] .construction-status { font-size: 13px; font-weight: 500; padding: 4px 7px; border-radius: 5px; }
body[data-page] :is(.construction-empty, .empty-state) { min-height: 140px; padding: 28px 20px; }
body[data-page] .construction-empty strong { font-size: 16px; font-weight: 600; }
body[data-page] .construction-empty > i { color: var(--text-3); background: transparent; box-shadow: none; }
body[data-page] .construction-dialog legend { text-transform: none; font-size: 15px; font-weight: 600; }
body[data-page] .construction-dialog fieldset { padding: 20px; margin-bottom: 22px; }
body[data-page] .construction-table :is(th, td) { max-width: 280px; white-space: normal; }
body[data-page] .construction-detail :is(.construction-stats, .construction-summary-grid, .construction-overview-grid) { gap: 18px; }
body[data-page] .message:empty { display: none; }

/* Readable supporting text also covers dynamically rendered table rows and
   the administration module, rather than only the initial HTML. */
html body[data-page] :is(.main, .sidebar, .auth-dialog) :is(label > span, small, th, td, .pill, [role="columnheader"], [class$="-label"], [class$="-note"], [class$="-row-count"], [class$="-result-count"]) {
  font-size: 14px; line-height: 1.5; letter-spacing: 0; text-transform: none;
}
html body[data-page] :is(.main, .auth-dialog) :is(.waste-report-kpi, .waste-report-note, .dashboard-donut-center, .gewabfv-quote-gauge, .pickup-board-head, .collection-calendar-summary, .document-amount-summary) > span { font-size: 14px; }
html body[data-page] :is(.main, .auth-dialog) :is(.btn-linklike, .btn-link, .document-linked-documents) { font-size: 14px; }
html body[data-page] :is(.location-detail-tabs, .container-detail-tabs) a { font-size: 14px; min-height: 42px; }
html body[data-page] .search input { font-size: var(--wms-field-font-size); min-height: 0; padding: 0; }
html body[data-page] .construction-search input { padding-left: 38px; }
html body[data-page] .search { height: var(--wms-field-height); padding-block: 0; }
html body[data-page] .document-bulk-toggle { min-height: 42px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text-1); }
html body[data-page] .document-bulk-toggle span { font-size: 14px; }
html body[data-page] :is(.document-table-shell, .location-table-card, .pickup-table-wrap, .sa-table-wrap) { min-width: 0; max-width: 100%; overflow-x: auto; }
html body[data-page] :is(.document-table-heading, .location-table-heading) { color: var(--text-2); background: var(--surface-2); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
html body[data-page] :is(.document-table-cell, .location-table-cell) { font-size: 14px; }
/* Empty directories share the contact page's full-width table treatment. */
body[data-page] .overview-empty-panel {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}
body[data-page] .overview-empty-panel .card-head { margin-bottom: 18px; }
body[data-page] .overview-empty-panel .data-table { width: 100%; min-width: 0; }
body[data-page] .overview-empty-panel td { color: var(--text-1); font-weight: 400; white-space: normal; }
body[data-page="locations"] .location-page-shell { gap: 18px; }
body[data-page="locations"] :is(#locationEmptyOverview, #locationTableCard)[hidden] { display: none; }
@media (max-width: 700px) {
  body[data-page] .overview-empty-panel thead { display: none; }
  body[data-page] .overview-empty-panel td { padding: 16px 0; border-top: 1px solid var(--border); }
}
html body[data-page] :is(.dashboard-collection-filter, .collection-calendar-scope-filter) { flex-wrap: wrap; }
html body[data-page] :is(.dashboard-collection-filter, .collection-calendar-scope-filter) button { min-height: 38px; padding: 8px 10px; font-size: 14px; border-radius: 7px; box-shadow: none; }
html body[data-page] :is(.dashboard-collection-filter, .collection-calendar-scope-filter) button.active { border-color: var(--brand-2); background: rgba(34,193,200,0.12); color: var(--brand-2); box-shadow: none; }
html body[data-page] :is(.dashboard-panel, .card, .location-detail-secondary-card, .container-detail-metric-grid) { min-width: 0; }
html body[data-page] .dashboard-chart-click-hint { font-size: 13px; font-weight: 500; }
html body[data-page="admin"] {
  --sa-navy: var(--text-1); --sa-ink: var(--text-1); --sa-muted: var(--text-2);
  --sa-line: var(--border); --sa-line-strong: var(--border-strong);
  --sa-panel: var(--surface); --sa-panel-solid: var(--surface-solid);
  --sa-aqua: #1697a5; --sa-aqua-dark: #0c7885; --sa-aqua-soft: #e5f6f7;
  --sa-shadow: none; --sa-radius: 12px;
}
html body[data-page="admin"] :is(.sa-sidebar .sidebar-inner, .sa-panel, .sa-kpi) { background: var(--surface); border: 1px solid var(--border); box-shadow: none; backdrop-filter: none; }
html body[data-page="admin"] .sa-sidebar .sidebar-inner { border: 0; border-radius: 0; }
html body[data-page="admin"] :is(.main, .sidebar) :is(p, span, small, button, label, th, td, b) { font-size: 14px; }
html body[data-page="admin"] :is(.sa-health-list, .sa-status-list) strong { font-size: 14px; }
html body[data-page="admin"] .user-name { font-size: 14px; }
html body[data-page="admin"] .user-role { font-size: 12px; }
html body[data-page="admin"] .sa-sidebar :is(.user-name, .user-role, .user-avatar, .nav-section) { font-size: 14px !important; font-weight: 500; }
html body[data-page="admin"] .sa-system-rail :is(strong, b) { font-size: 14px !important; font-weight: 500; }
html body[data-page="admin"] .sa-sidebar .nav-link { font-weight: 500; }
html body[data-page="admin"] .sa-kpi > i { background: var(--surface-2); color: var(--brand); }
html body[data-page] #constructionSearch { padding-left: 38px; }
html body[data-page="wasteAnalysis"] .topbar { margin-bottom: 0; }
html body[data-page] .construction-project-card header { flex-direction: column; gap: 8px; }
html body[data-page] .construction-project-meta { grid-template-columns: minmax(0,1fr); gap: 8px; }
html body[data-page] .construction-project-meta span { justify-content: flex-start; text-align: left; overflow-wrap: anywhere; }
html body[data-page] .construction-detail-meta { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 24px; margin-top: 18px; }
html body[data-page] .construction-detail-meta > div { padding: 0; border: 0; }
html body[data-page] .construction-detail-meta span { text-transform: none; color: var(--text-2); font-weight: 500; }
html body[data-page] .construction-detail-meta strong { white-space: normal; overflow: visible; font-weight: 500; overflow-wrap: anywhere; }
html body[data-page] .construction-role-band { margin: 2px 0 14px; }
html body[data-page] .construction-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
html body[data-page] .construction-mini-panel { padding: 20px; background: var(--surface); }
html body[data-page] .construction-mini-panel > p { margin: 8px 0 0; color: var(--text-2); }
html body[data-page] .construction-decision-list { margin-top: 18px; gap: 16px; }
html body[data-page] .construction-decision-row { grid-template-columns: 16px minmax(0,1fr); gap: 3px 8px; align-items: start; }
html body[data-page] .construction-decision-row b { grid-column: 2; font-weight: 400; color: var(--text-2); }
html body[data-page] .construction-mass-view { display: flex; flex-direction: column; align-items: stretch; gap: 18px; margin-top: 18px; }
html body[data-page] .construction-mass-legend { gap: 12px; }
html body[data-page] .construction-project-gauge { width: 100%; aspect-ratio: auto; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding-top: 14px; background: transparent; box-shadow: none; }
html body[data-page] .construction-project-gauge div { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; }
html body[data-page] .construction-project-gauge strong { font-size: 24px; font-weight: 600; }
html body[data-page] .construction-project-gauge span { font-size: 14px; font-weight: 400; text-transform: none; }
html body[data-page] .construction-fractions-panel { grid-column: 1 / -1; padding: 16px 20px; }
html body[data-page] .construction-fractions-panel > summary { cursor: pointer; color: var(--text-1); font-size: 16px; font-weight: 600; }
html body[data-page] .construction-fractions { gap: 14px 24px; margin-top: 18px; }
html body[data-page] .construction-fraction > span { white-space: normal; overflow: visible; }
html body[data-page] .construction-fraction > i { font-size: 15px; }
html body[data-page] .construction-evidence-strip { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
html body[data-page] .construction-evidence-callout { grid-column: 1 / -1; width: auto; min-width: 0; justify-self: stretch; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--surface-2); padding: 16px; }
html body[data-page] .construction-evidence-callout span { flex: 1 1 240px; }
html body[data-page] .construction-container-card figure > div { font-size: 14px; }
html body[data-page] .gewabfv-table td strong,
html body[data-page] .gewabfv-status,
html body[data-page] .gewabfv-evidence-chips span,
html body[data-page] .gewabfv-inline-edit,
html body[data-page] .gewabfv-container-placeholder span,
html body[data-page] .gewabfv-container-location,
html body[data-page] .gewabfv-table td::before,
html body[data-page] .gewabfv-profile-dialog .gewabfv-section-kicker,
html body[data-page] .gewabfv-profile-context div > span,
html body[data-page] .gewabfv-profile-context div > strong,
html body[data-page] .gewabfv-confirm-check strong { font-size: 14px; line-height: 1.5; letter-spacing: 0; text-transform: none; }
html body[data-page] .gewabfv-evidence-chips { gap: 6px; flex-wrap: wrap; }
html body[data-page] .gewabfv-inline-edit { min-height: 38px; padding: 8px 12px; }
html body[data-page] .gewabfv-container-placeholder { background: var(--surface-2); color: var(--text-2); }
html body[data-page] .gewabfv-container-placeholder i { background: transparent; color: var(--brand); box-shadow: none; }
html body[data-page] .gewabfv-container-placeholder .container-visual { background: transparent; box-shadow: none; }
html body[data-page] .gewabfv-container-copy dl > div { grid-template-columns: minmax(0,1fr); gap: 3px; }
html body[data-page] .gewabfv-container-copy dt { text-transform: none; letter-spacing: 0; white-space: normal; overflow-wrap: anywhere; }
html body[data-page] .gewabfv-container-location { white-space: normal; overflow-wrap: anywhere; }
html body[data-page] #gewabfvThreshold,
html body[data-page] #gewabfvQuoteGauge > div > span { font-size: 14px; line-height: 1.5; }

@media (max-width: 1650px) {
  body[data-page="pickups"] .pickup-filter-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  body[data-page="pickups"] .pickup-filter-grid .pickup-search { grid-column: span 2; width: 100%; max-width: none; }
  body[data-page="documents"] .document-gallery-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1240px) {
  html body[data-page] .main { padding: 24px; }
  body[data-page="pickups"] .pickup-filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body[data-page="pickups"] .pickup-filter-grid .pickup-search { grid-column: span 2; }
  body[data-page="documents"] .document-gallery-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-page] .construction-filter-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-page] .construction-filter-rail > :is(label,button) { grid-column: auto; }
  body[data-page] .construction-search { grid-column: span 2; }
  body[data-page] .gewabfv-filter-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-page] :is(.gewabfv-kpis, .construction-kpis) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-page] .construction-workspace { grid-template-columns: minmax(0,1fr); }
  body[data-page] .construction-project-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 300px; overflow: auto; gap: 10px; }
  body[data-page] .gewabfv-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  html body[data-page] .document-create-layout { grid-template-columns: minmax(0,1fr); }
  body[data-page] .construction-workspace { grid-template-columns: 1fr; }
  body[data-page] .construction-project-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 300px; overflow: auto; gap: 10px; }
  body[data-page] .construction-project-rail { margin-bottom: 0; }
  body[data-page] .construction-rail-head select { width: auto; }
  body[data-page] .dashboard-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  html body[data-page] .layout { display: flex; flex-direction: column; }
  html body[data-page] .sidebar { display: block; position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  html body[data-page] .sidebar-inner { display: block; padding: 14px 16px 10px; }
  body[data-page] .brand { padding: 0 4px 12px; margin: 0; }
  body[data-page] .brand-logo { width: 132px; }
  html body[data-page] .sidebar .nav { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 0 4px; }
  body[data-page] .nav-section { display: none; }
  html body[data-page] .nav-link { min-height: 42px; white-space: nowrap; padding: 9px 12px; }
  html body[data-page] .nav-link.active { box-shadow: inset 0 -2px var(--brand); }
  body[data-page] .sidebar-footer { display: none; }
  html body[data-page] .main { width: 100%; max-width: 100%; min-height: calc(100dvh - 112px); margin: 0; padding: 22px; }
  html body[data-page] .page-title { font-size: 26px; }
  body[data-page="pickups"] .pickup-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-page="pickups"] .pickup-filter-grid .pickup-search { grid-column: span 2; }
}
@media (max-width: 600px) {
  html body[data-page] { --wms-field-font-size: 16px; }
  html body[data-page] .main { padding: 20px 16px; }
  html body[data-page] .topbar { align-items: flex-start; gap: 18px; }
  html body[data-page] .topbar-right { width: 100%; justify-content: flex-start; }
  html body[data-page] .search { width: 100%; flex: 0 1 auto; }
  html body[data-page] .dashboard-allocation-filter { width: 100%; min-width: 0; }
  html body[data-page] .dashboard-allocation-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    padding-block: 7px;
    gap: 2px;
  }
  html body[data-page] .dashboard-allocation-filter select { width: 100%; min-width: 0; height: var(--wms-field-height); }
  body[data-page="pickups"] .pickup-filter-grid { grid-template-columns: 1fr; }
  body[data-page="pickups"] .pickup-filter-grid .pickup-search { grid-column: auto; }
  body[data-page="documents"] .document-gallery-filters { grid-template-columns: 1fr; }
  body[data-page] :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px; }
  body[data-page] :is(.gewabfv-filter-rail, .construction-filter-rail) { grid-template-columns: 1fr; padding: 16px; }
  body[data-page] .construction-search { grid-column: auto; }
  body[data-page] :is(.gewabfv-kpis, .construction-kpis) { gap: 12px; }
  body[data-page] :is(.gewabfv-kpi, .construction-kpi) { padding: 16px; min-height: 130px; }
  body[data-page] .construction-kpi > i { display: none; }
  body[data-page] :is(.gewabfv-kpi, .construction-kpi) strong { font-size: 25px; }
  body[data-page] :is(.gewabfv-panel, .construction-detail) { padding: 16px; }
  body[data-page] .construction-project-list { grid-template-columns: 1fr; }
  body[data-page] .gewabfv-actions { display: flex; }
  html body[data-page] .gewabfv-actions .icon-btn:last-child { display: grid; }
  body[data-page] .wms-disclosure > summary { padding: 16px; }
  body[data-page] .wms-disclosure .gewabfv-overview-grid { padding: 0 12px 12px; }
  body[data-page] .gewabfv-container-grid { grid-template-columns: 1fr; }
  body[data-page] :is(.gewabfv-scope-note, .construction-scope-note) { grid-template-columns: 1fr; }
  body[data-page] :is(.gewabfv-source-links, .construction-source-links) { justify-items: start; }
  body[data-page] .construction-dialog fieldset { padding: 14px; }
  body[data-page] .form-grid { grid-template-columns: 1fr; }
  html body[data-page] :is(.dashboard-bottom-grid, .dashboard-chart-grid, .location-detail-secondary-grid, .document-upload-grid, .document-review-grid, .container-detail-metric-grid) { grid-template-columns: minmax(0,1fr); }
  html body[data-page] .document-preview-card { width: 100%; max-width: 100%; }
  html body[data-page] :is(.location-detail-tabs, .container-detail-tabs) { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
  html body[data-page] .container-detail-showcase-grid { grid-template-columns: minmax(0,1fr); }
  html body[data-page] :is(.document-preview-toolbar, .card-head, .dashboard-panel-head) { flex-wrap: wrap; }
  html body[data-page] .collection-calendar-grid,
  html body[data-page] .collection-calendar-weekdays { grid-template-columns: repeat(7,minmax(0,1fr)); min-width: 0; }
  html body[data-page] .construction-actions .icon-btn:last-child { display: grid; }
  html body[data-page] .construction-export-popover { right: 0; left: auto; width: min(280px,calc(100vw - 32px)); }
  html body[data-page] .construction-detail-grid,
  html body[data-page] .construction-role-band,
  html body[data-page] .construction-detail-meta,
  html body[data-page] .construction-evidence-strip { grid-template-columns: minmax(0,1fr); }
  html body[data-page] .construction-mini-panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  html body[data-page] .sidebar { display: none; }
  html body[data-page] .main { width: 100%; max-width: none; padding: 0; }
  body[data-page] :is(.wms-guidance, .wms-disclosure) { break-inside: avoid; }
}
