/* =========================================================================
   KOA Console stylesheet
   Sections:
     1. Base & body
     2. App header + page topbar
     3. Typography & form elements
     4. Cards, pills, actions
     5. Shift table (month grid)
     6. Dashboard & home
     7. Driver portal & driver admin
     8. Tables (data-table, month-index-table)
     9. Forms (form-section, grid)
    10. Misc utility (legend, swatch, alert, mobile)
    11. Responsive
   ========================================================================= */

/* --- 1. Base & body --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 20px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.98) 0%, rgba(236, 246, 242, 0.85) 28%, transparent 58%),
    linear-gradient(180deg, #e7f1ee 0%, #f3f8f6 210px, #f7fcfa 100%);
}

/* --- 12. Modern workspace refresh --- */
body {
  background:
    linear-gradient(90deg, rgba(255,255,255,.58) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255,255,255,.64) 0 1px, transparent 1px 100%),
    var(--surface);
  background-size: 28px 28px;
}

button,
form[action="/generate-invoices"] button,
form[action="/generate-team-invoices"] button,
form[action="/month/apply"] button,
button[form="month-form"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  border-radius: var(--control-radius);
  box-shadow: none;
  font-weight: 780;
}

button:hover,
form[action="/generate-invoices"] button:hover,
form[action="/generate-team-invoices"] button:hover,
form[action="/month/apply"] button:hover,
button[form="month-form"]:hover {
  filter: none;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  box-shadow: none;
}

.actions a,
.home-back,
.quick-links a,
.feature-links a,
.dashboard-header-actions a,
.toolbar-actions a {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: none;
  font-weight: 740;
}

.actions a:hover,
.home-back:hover,
.quick-links a:hover,
.feature-links a:hover,
.dashboard-header-actions a:hover,
.toolbar-actions a:hover {
  background: #f8f8f2;
  border-color: #acb6ad;
  box-shadow: none;
}

form[action="/month/discard"] button,
form[action="/home-layout/reset"] button {
  background: #fff9f7;
  border-color: #dcc4bd;
  color: var(--danger-ink);
}

form[action="/admin/logout"] button,
form[action="/driver/logout"] button {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--text);
}

.card,
.section-block,
.status-card,
.feature-card,
.dashboard-panel,
.driver-section-card,
.form-section,
.notice-card {
  background: rgba(255,254,250,.9);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.card::before {
  background: transparent;
  opacity: 0;
}

.status-pill {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 720;
}

.status-pill.info {
  background: #e7ecef;
  color: #3f5f6b;
  border-color: #cad4d8;
}

.status-pill.success {
  background: #e5eee7;
  color: #37664b;
  border-color: #c5d7c8;
}

.status-pill.warn {
  background: #f6eddd;
  color: #76562f;
  border-color: #dfcfb2;
}

.status-pill.danger {
  background: #f4e5e0;
  color: #814338;
  border-color: #d9c0ba;
}

.koa-modern-shell {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 34px;
  display: grid;
  grid-template-columns: 234px minmax(0, 1fr);
  gap: 18px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 12px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(42, 48, 44, .14);
  background: rgba(255, 253, 248, .96);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 820;
  box-shadow: 0 18px 42px rgba(24, 28, 25, .18);
  transform: translateY(-140%);
  opacity: 0;
  transition: transform .16s ease, opacity .16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  opacity: 1;
  outline: 3px solid rgba(49, 95, 119, .24);
  outline-offset: 2px;
}

.modern-main:focus,
.driver-content:focus {
  outline: none;
}

.modern-sidebar {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 52px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 254, 250, .82);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.modern-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 2px 0;
}

.modern-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--text);
  font-size: 12px;
  font-weight: 780;
}

.modern-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 780;
  line-height: 1.1;
  white-space: nowrap;
}

.modern-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.modern-side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.modern-side-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 720;
}

.modern-side-nav a.active,
.modern-side-nav a[aria-current="page"] {
  color: var(--text);
  background: #f8f8f2;
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: .38;
  flex: 0 0 auto;
}

.modern-side-foot {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f8f2;
}

.modern-side-foot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.modern-side-foot strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 760;
}

.modern-main,
.modern-dashboard,
.modern-invoice-page {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
}

.modern-main > *,
.modern-dashboard > *,
.modern-invoice-page > * {
  min-width: 0;
}

.modern-topline {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modern-topline-title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.modern-topline-title strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-weight: 780;
}

.modern-topline-actions,
.modern-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.modern-topline-actions form,
.modern-hero-actions form,
.inline-delete-form {
  margin: 0;
}

.inline-delete-form {
  display: inline-flex;
}

.modern-btn,
button.modern-btn,
a.modern-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-weight: 740;
  line-height: 1.1;
  box-shadow: none;
  cursor: pointer;
}

.modern-btn.primary,
button.modern-btn.primary,
a.modern-btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.modern-btn.danger,
button.modern-btn.danger {
  color: var(--danger-ink);
  border-color: #dcc4bd;
  background: #fff9f7;
}

.modern-btn.is-current,
button.modern-btn.is-current,
a.modern-btn.is-current {
  cursor: default;
  border-color: var(--brand);
  background: #eef7f4;
  color: var(--brand-strong);
}

.modern-btn.disabled,
.modern-btn[aria-disabled="true"],
button.modern-btn:disabled,
a.modern-btn[aria-disabled="true"] {
  cursor: not-allowed;
  pointer-events: none;
  opacity: .58;
  filter: grayscale(.12);
  background: #f5f4ef;
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}

.modern-btn:hover,
button.modern-btn:hover,
a.modern-btn:hover {
  background: #f8f8f2;
  border-color: #acb6ad;
  filter: none;
  transform: none;
}

.modern-btn.primary:hover,
button.modern-btn.primary:hover,
a.modern-btn.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.modern-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,254,250,.9);
  box-shadow: var(--shadow-sm);
}

.modern-panel.dark {
  background: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.print-only {
  display: none;
}

.modern-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modern-section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 780;
}

.modern-section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.modern-section-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height-compact);
  padding: 0 var(--control-px);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
}

.modern-panel.dark .modern-section-head span {
  color: rgba(255,255,255,.72);
}

.modern-worktop,
.modern-shift-top,
.modern-invoice-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.modern-hero,
.modern-month-hero,
.modern-invoice-hero {
  min-height: 250px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,254,250,.95), rgba(248,248,242,.84)),
    linear-gradient(135deg, rgba(45,81,72,.08), rgba(236,232,220,.62));
  box-shadow: var(--shadow-md);
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.modern-month-hero,
.modern-invoice-hero {
  min-height: 210px;
}

.modern-hero::after,
.modern-month-hero::after,
.modern-invoice-hero::after {
  content: "";
  position: absolute;
  right: -76px;
  bottom: -102px;
  width: 330px;
  height: 330px;
  border: 44px solid rgba(45, 81, 72, .07);
  border-radius: 50%;
  z-index: -1;
}

.modern-eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.modern-hero h1,
.modern-month-hero h1,
.modern-invoice-hero h1 {
  margin: 8px 0 0;
  font-size: 54px;
  line-height: 1.04;
  font-weight: 780;
  letter-spacing: 0;
  color: var(--text);
}

.modern-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
}

.modern-status-line strong {
  font-size: 17px;
  font-weight: 760;
  color: var(--text);
}

.modern-money-panel,
.modern-audit-panel {
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.modern-money-panel h2 {
  margin: 0;
  font-size: 16px;
  color: rgba(255,255,255,.78);
}

.modern-big-money {
  margin-top: 4px;
  font-size: 38px;
  line-height: 1;
  font-weight: 780;
}

.modern-money-row,
.modern-audit-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.72);
  font-weight: 650;
}

.modern-money-link {
  margin-inline: -8px;
  padding-inline: 8px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color .16s ease, transform .16s ease;
}

.modern-money-link:hover {
  background: rgba(255,255,255,.08);
  transform: translateX(2px);
}

.modern-money-row:last-child,
.modern-audit-row:last-child {
  border-bottom: 0;
}

.modern-money-row strong,
.modern-audit-row strong {
  color: #fff;
  font-weight: 780;
  text-align: right;
}

.modern-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.public-period-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  margin-top: -2px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(247,252,250,.9)),
    linear-gradient(135deg, rgba(45,81,72,.07), rgba(125,212,192,.10));
}

.public-period-main {
  display: grid;
  gap: 7px;
}

.public-period-main > span,
.public-period-dates span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
}

.public-period-main > strong {
  color: var(--text);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 820;
  line-height: 1.04;
}

.public-period-meta,
.public-period-actions,
.public-period-dates {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.public-period-meta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.public-period-dates {
  justify-content: flex-end;
  min-width: 250px;
}

.public-period-dates > div {
  min-width: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.68);
}

.public-period-dates strong {
  display: block;
  margin-top: 6px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 820;
}

.public-period-actions {
  justify-content: flex-end;
}

.dashboard-notice-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dashboard-notice-card {
  min-height: 78px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,254,250,.86);
  color: var(--text);
  text-decoration: none;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dashboard-notice-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--warn);
}

.dashboard-notice-card.danger::before {
  background: var(--danger);
}

.dashboard-notice-card:hover {
  transform: translateY(-1px);
  border-color: #b7c4bd;
  box-shadow: 0 14px 28px rgba(24, 28, 25, .08);
}

.dashboard-notice-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.dashboard-notice-card strong {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
  font-weight: 840;
}

.dashboard-notice-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.modern-stat {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255,254,250,.88);
  box-shadow: var(--shadow-sm);
  display: grid;
  align-content: space-between;
}

.modern-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.modern-stat strong {
  margin-top: 12px;
  font-size: 31px;
  line-height: 1;
  font-weight: 780;
}

.modern-stat small {
  margin-top: 8px;
  color: #919b95;
  font-size: 12px;
  font-weight: 650;
}

.modern-lower,
.modern-invoice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.modern-lower {
  align-items: start;
}

.modern-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.modern-action-card {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.modern-action-card:hover {
  transform: translateY(-1px);
  border-color: #b5bfb7;
  box-shadow: 0 14px 32px rgba(27, 38, 33, .065);
}

.modern-action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255,255,255,0) 0%, rgba(230,236,232,.64) 100%);
  z-index: -2;
}

.modern-action-visual {
  position: absolute;
  right: -28px;
  top: -22px;
  width: 142px;
  height: 142px;
  color: var(--brand);
  opacity: .12;
  transform: rotate(-8deg);
  z-index: -1;
  transition: opacity .16s ease, transform .16s ease;
}

.modern-action-card:hover .modern-action-visual {
  opacity: .18;
  transform: rotate(-4deg) scale(1.02);
}

.modern-action-copy {
  position: relative;
  z-index: 1;
  max-width: 76%;
}

.modern-action-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 16px;
  font-weight: 780;
}

.modern-action-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 640;
}

.modern-checks,
.modern-approval-list {
  display: grid;
  gap: 0;
}

.modern-check-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.modern-check-row:last-child {
  border-bottom: 0;
}

.modern-check-row:hover {
  margin-inline: -10px;
  padding-inline: 10px;
  border-radius: 14px;
  background: rgba(247,252,250,.82);
  transform: translateX(2px);
}

.modern-check-row strong {
  font-weight: 760;
}

.modern-check-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  font-weight: 620;
}

.modern-count {
  font-size: 21px;
  font-weight: 780;
  color: var(--brand);
}

.modern-count.warn { color: var(--warn-ink); }
.modern-count.danger { color: var(--danger-ink); }

.modern-board-card {
  padding: 18px;
}

.modern-board-card .toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.board-toolbar-title strong,
.board-toolbar-title span {
  display: block;
}

.board-toolbar-title strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 820;
  line-height: 1.25;
}

.board-toolbar-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.modern-zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modern-zoom-control > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
}

.modern-zoom-control .zoom-select-form select {
  min-width: 92px;
  background: var(--panel);
}

.print-shift-header {
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #111;
  font-weight: 800;
}

.print-shift-header strong {
  font-size: 14px;
}

.print-shift-header span {
  font-size: 10px;
  color: #555;
}

.koa-modern-shell .shift-wrap,
.koa-modern-shell .table-shell {
  border-color: var(--line);
  box-shadow: none;
  border-radius: 16px;
}

.koa-modern-shell .shift-table .meta,
.koa-modern-shell .shift-table .meta2,
.koa-modern-shell .shift-table .meta3,
.koa-modern-shell .shift-table .meta4,
.koa-modern-shell .shift-table .meta5,
.koa-modern-shell th {
  background: #f8f8f2;
  color: var(--muted);
}

.koa-modern-shell .shift-table .sticky-row .headcell {
  color: var(--text);
}

.koa-modern-shell .month-board-footnote {
  display: none;
}

.modern-invoice-list {
  display: grid;
  gap: 10px;
}

.modern-invoice-list.is-filtered .modern-invoice-card.header {
  opacity: .72;
}

.modern-invoice-card {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) repeat(4, minmax(66px, auto)) minmax(120px, auto) minmax(250px, 1fr);
  gap: 9px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  scroll-margin-top: 86px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.modern-invoice-card:target {
  border-color: rgba(49, 95, 119, .42);
  background: rgba(227, 237, 241, .34);
  box-shadow: 0 0 0 3px rgba(49, 95, 119, .12);
}

.modern-invoice-card.header {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f8f8f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.driver-cell strong {
  display: block;
  font-weight: 780;
}

.driver-cell span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.invoice-preview-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid rgba(49, 95, 119, .24);
  border-radius: 8px;
  color: #234c5d;
  background: rgba(232, 241, 244, .72);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.invoice-preview-link:hover {
  border-color: rgba(49, 95, 119, .42);
  background: rgba(214, 231, 236, .92);
}

.invoice-preview-page {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(232, 241, 244, .92), rgba(247, 244, 231, .86)),
    #f5f7f4;
}

.invoice-preview-toolbar {
  position: sticky;
  top: 14px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: min(1080px, 100%);
  margin: 0 auto 18px;
  padding: 10px;
  border: 1px solid rgba(27, 50, 56, .16);
  border-radius: 14px;
  background: rgba(255, 254, 249, .94);
  box-shadow: 0 14px 36px rgba(34, 45, 48, .16);
  backdrop-filter: blur(10px);
}

.invoice-preview-toolbar .modern-btn {
  min-height: 42px;
  border-color: rgba(27, 50, 56, .24);
  box-shadow: 0 6px 14px rgba(34, 45, 48, .08);
}

.invoice-preview-sheet {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 42px;
  border: 1px solid rgba(27, 50, 56, .14);
  border-radius: 12px;
  background: #fffef9;
  box-shadow: 0 24px 70px rgba(34, 45, 48, .14);
  color: #182629;
}

.invoice-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid #203b42;
}

.invoice-preview-header span {
  display: block;
  color: #4b6870;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .08em;
}

.invoice-preview-header h1 {
  margin: 6px 0 8px;
  color: #152a30;
  font-size: 34px;
  font-weight: 840;
}

.invoice-preview-header p {
  margin: 0;
  color: #5c6b6f;
  font-size: 14px;
  font-weight: 700;
}

.invoice-preview-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 180px;
}

.invoice-preview-flags {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.invoice-preview-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 26px;
}

.invoice-preview-meta dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.invoice-preview-meta div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(27, 50, 56, .12);
}

.invoice-preview-meta dt {
  color: #67777b;
  font-size: 12px;
  font-weight: 760;
}

.invoice-preview-meta dd {
  margin: 0;
  color: #1b2d32;
  font-size: 14px;
  font-weight: 720;
}

.invoice-preview-total-band {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin: 28px 0;
  padding: 24px 28px;
  border-radius: 10px;
  background: #17343a;
  color: #fffdf4;
}

.invoice-preview-total-band span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 253, 244, .72);
  font-size: 12px;
  font-weight: 760;
}

.invoice-preview-total-band strong {
  font-size: 32px;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

.invoice-preview-total-band p {
  max-width: 360px;
  margin: 0;
  color: rgba(255, 253, 244, .72);
  font-size: 13px;
  line-height: 1.7;
}

.invoice-preview-section {
  margin-top: 26px;
}

.invoice-preview-section h2 {
  margin: 0 0 12px;
  color: #1d3136;
  font-size: 18px;
  font-weight: 820;
}

.invoice-preview-split-grid,
.invoice-preview-edit-grid {
  display: grid;
  gap: 20px;
}

.invoice-preview-subsection {
  padding-top: 14px;
  border-top: 3px solid rgba(27, 50, 56, .16);
}

.invoice-preview-subsection.support {
  border-top-color: #11806c;
}

.invoice-preview-subsection.offset {
  border-top-color: #b75f4b;
}

.invoice-preview-subsection h3 {
  margin: 0 0 10px;
  color: #1d3136;
  font-size: 15px;
  font-weight: 820;
}

.invoice-preview-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(27, 50, 56, .14);
  border-radius: 10px;
}

.invoice-preview-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.invoice-preview-table th,
.invoice-preview-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(27, 50, 56, .1);
  text-align: left;
  vertical-align: top;
}

.invoice-preview-table th {
  background: #f1f5f2;
  color: #4c5f63;
  font-size: 12px;
  font-weight: 780;
}

.invoice-preview-table tr:last-child td {
  border-bottom: 0;
}

.invoice-preview-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.invoice-preview-table .center {
  text-align: center;
}

.invoice-preview-table .muted {
  color: #718286;
}

.invoice-preview-read-table {
  min-width: 900px;
}

.invoice-draft-editor-shell .inline-note {
  margin-bottom: 12px;
}

.invoice-draft-editor-table {
  min-width: 900px;
}

.invoice-draft-editor-table input,
.invoice-draft-editor-table select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(27, 50, 56, .16);
  border-radius: 8px;
  background: #fff;
  color: #182629;
  font: inherit;
  font-size: 12px;
}

.invoice-draft-editor-table input.num {
  text-align: right;
}

.invoice-draft-editor-table input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.driver-invoice-list {
  gap: 12px;
}

.driver-invoice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.driver-pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #17343a;
  color: #fffdf4;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.driver-pdf-link:hover {
  background: #22515a;
}

.invoice-preview-empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(27, 50, 56, .18);
  border-radius: 10px;
  color: #6d7d80;
  background: #fafbf7;
  font-size: 13px;
  font-weight: 680;
}

.invoice-preview-summary {
  display: grid;
  gap: 10px;
  width: min(440px, 100%);
  margin: 30px 0 0 auto;
  padding-top: 18px;
  border-top: 2px solid #203b42;
}

.invoice-preview-summary div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #4f5e62;
  font-size: 13px;
  font-weight: 720;
}

.invoice-preview-summary strong {
  color: #1a2d32;
  font-variant-numeric: tabular-nums;
}

.invoice-preview-summary .is-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(27, 50, 56, .16);
  color: #182629;
  font-size: 16px;
}

.invoice-preview-summary .is-total strong {
  font-size: 22px;
}

.invoice-preview-summary .is-negative,
.invoice-preview-table .is-negative {
  color: #9b3f3f;
}

.modern-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.modern-value {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.modern-status-cell,
.modern-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.modern-approval-cell .invoice-approval-form {
  min-width: 0;
  grid-template-columns: 88px minmax(90px, 1fr) auto;
}

.modern-approval-cell .invoice-approval-form button {
  min-height: var(--control-height-compact);
}

.modern-approval-cell .invoice-approval-form.is-dirty {
  padding: 6px;
  border: 1px solid rgba(49, 95, 119, .26);
  border-radius: 12px;
  background: rgba(227, 237, 241, .38);
}

.invoice-approval-locked {
  min-height: var(--control-height-compact);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 244, 237, .74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.modern-invoice-layout > aside.modern-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.modern-approve-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  display: grid;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.modern-approve-card strong {
  font-size: 15px;
  font-weight: 780;
}

.modern-approve-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.approval-summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.approval-summary-card > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247,252,250,.74);
}

.approval-summary-card span,
.approval-summary-card strong,
.approval-task-label,
.approval-task-meta span {
  display: block;
}

.approval-summary-card span,
.approval-task-label,
.approval-task-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.approval-summary-card strong {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1;
}

.approval-task-label {
  color: var(--warn-ink);
}

.approval-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.invoice-flow-page {
  display: grid;
  gap: 16px;
}

.invoice-flow-progress,
.invoice-flow-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.invoice-flow-progress > div,
.invoice-flow-total-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
}

.invoice-flow-progress span,
.invoice-flow-total-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.invoice-flow-progress strong,
.invoice-flow-total-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.invoice-flow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: start;
}

.invoice-flow-main,
.invoice-flow-side {
  min-width: 0;
}

.invoice-flow-side {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.invoice-flow-driver-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.invoice-flow-driver-head h1 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.invoice-flow-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}

.invoice-flow-action-form {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.invoice-flow-action-form input {
  min-width: 0;
  min-height: var(--control-height);
}

.invoice-flow-section {
  margin-top: 18px;
}

.invoice-adjustment-editor {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(49,95,119,.2);
  border-radius: 16px;
  background: rgba(247,250,250,.78);
}

.invoice-flow-note {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.invoice-flow-note textarea {
  min-height: 68px;
  resize: vertical;
}

.invoice-adjustment-grid {
  display: grid;
  gap: 6px;
}

.invoice-adjustment-row {
  display: grid;
  grid-template-columns: 108px minmax(150px, 1fr) 86px 86px 110px 112px minmax(130px, 1fr);
  gap: 6px;
  align-items: center;
}

.invoice-adjustment-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.invoice-adjustment-row input,
.invoice-adjustment-row select {
  min-width: 0;
  min-height: var(--control-height-compact);
}

.invoice-adjustment-row output {
  min-height: var(--control-height-compact);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.invoice-adjustment-live-total {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.invoice-adjustment-live-total span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.invoice-adjustment-live-total strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.invoice-flow-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.invoice-flow-complete {
  display: grid;
  gap: 14px;
}

.modern-approve-card.is-current {
  border-color: rgba(49, 95, 119, .42);
  background: rgba(227, 237, 241, .38);
}

.modern-invoice-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.koa-modern-shell .invoice-action-card {
  min-width: 0;
  border-radius: 14px;
  background: var(--panel);
}

.koa-modern-shell .invoice-action-card strong {
  color: var(--text);
}

.koa-modern-shell .invoice-action-card button {
  width: 100%;
}

.invoice-history-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 10px;
  margin-bottom: 12px;
}

.invoice-history-strip > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247,244,237,.62);
}

.invoice-history-strip span,
.invoice-history-strip strong {
  display: block;
}

.invoice-history-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.invoice-history-strip strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.koa-modern-shell #dashboard-settings {
  margin-top: 0;
}

.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-panel > * {
  min-width: 0;
}

.settings-panel > h2 {
  margin: 0;
  font-size: 17px;
}

.settings-panel .grid {
  max-width: none;
  width: 100%;
  min-width: 0;
}

.settings-public-days-control {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-public-days-control select {
  min-width: 112px;
  flex: 0 0 auto;
}

.settings-public-days-end {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.25;
  white-space: nowrap;
}

.backup-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.backup-summary-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.backup-summary-grid strong {
  display: block;
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.backup-summary-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.backup-path-line {
  overflow-wrap: anywhere;
}

.settings-disclosure {
  display: block;
  padding: 0;
  overflow: hidden;
}

.settings-disclosure > * {
  min-width: 0;
}

.settings-summary {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  font-size: 18px;
  font-weight: 720;
  line-height: 1;
}

.settings-disclosure[open] .settings-summary {
  border-bottom: 1px solid var(--line);
}

.settings-disclosure[open] .settings-summary::after {
  content: "-";
}

.settings-summary-copy {
  display: grid;
  gap: 3px;
}

.settings-summary-copy strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 820;
  line-height: 1.25;
}

.settings-summary-copy small,
.settings-summary-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.settings-summary-meta {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  white-space: nowrap;
}

.settings-panel-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.settings-panel-body > h2 {
  margin: 0;
  font-size: 17px;
}

@media (max-width: 1120px) {
  .modern-invoice-card {
    grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(70px, auto));
  }
  .modern-invoice-card.header {
    display: none;
  }
  .modern-approval-cell {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .koa-modern-shell {
    grid-template-columns: 1fr;
  }
  .modern-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    min-height: auto;
    grid-template-rows: auto auto;
  }
  .modern-side-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .modern-side-foot {
    display: none;
  }
  .modern-worktop,
  .modern-shift-top,
  .modern-invoice-top,
  .modern-lower,
  .modern-invoice-layout,
  .public-period-card {
    grid-template-columns: 1fr;
  }
  .public-period-dates,
  .public-period-actions {
    justify-content: flex-start;
  }
  .public-period-dates {
    min-width: 0;
  }
  .modern-invoice-layout > aside.modern-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .modern-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modern-invoice-action-grid {
    grid-template-columns: 1fr;
  }
  .invoice-history-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .koa-modern-shell {
    width: min(100% - 26px, 1220px);
    padding-top: 12px;
    gap: 12px;
  }
  .modern-sidebar {
    padding: 12px;
    gap: 12px;
    border-radius: 18px;
  }
  .modern-side-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  .modern-side-nav a {
    min-height: 38px;
    justify-content: center;
    gap: 0;
    padding: 0 4px;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }
  .modern-side-nav .nav-dot {
    display: none;
  }
  .modern-topline {
    align-items: flex-start;
    flex-direction: column;
  }
  .modern-topline-actions,
  .modern-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .modern-btn,
  button.modern-btn,
  a.modern-btn {
    flex: 1 1 140px;
  }
  .modern-stats,
  .modern-action-grid {
    grid-template-columns: 1fr;
  }
  .driver-form-checks {
    grid-template-columns: 1fr;
  }
  .modern-hero,
  .modern-month-hero,
  .modern-invoice-hero {
    padding: 22px;
  }
  .modern-hero h1,
  .modern-month-hero h1,
  .modern-invoice-hero h1 {
    font-size: 38px;
    line-height: 1.08;
  }
  .modern-invoice-card {
    grid-template-columns: 1fr 1fr;
  }
  .modern-action-copy {
    max-width: 78%;
  }
}

/* --- 2. App header + page topbar --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 250, 247, 0.98) 100%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}
.app-header-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.app-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.app-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
  color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: 0 12px 24px rgba(12, 56, 48, 0.22);
}
.app-brand-copy { display: grid; gap: 2px; min-width: 0; }
.app-brand-copy strong { font-size: 18px; letter-spacing: 0; color: var(--accent-strong); }
.app-brand-copy small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.app-header-context { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.app-header-page { font-size: 14px; font-weight: 800; color: var(--accent-strong); }
.app-header-divider { width: 1px; height: 16px; background: var(--line-strong); }
.app-header-date { color: var(--muted); font-size: 13px; font-weight: 700; }
.app-header-side { display: flex; align-items: center; gap: 8px; }
.app-header-chip {
  display: inline;
  min-height: 0; padding: 0; border-radius: 0;
  background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 800;
  border: 0; white-space: nowrap;
}

.page-topbar {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  margin: 0 0 14px 0; padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.page-topbar-title { color: #e3f5ef; font-size: 13px; font-weight: 700; }
.home-back {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px-wide); border-radius: var(--control-radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  color: var(--brand-strong); text-decoration: none; font-weight: 800;
  line-height: 1.15;
  box-shadow: 0 8px 16px rgba(12, 56, 48, 0.06);
}
.home-back:hover { background: var(--accent-soft); border-color: var(--brand); }

/* --- 3. Typography & form elements --- */
h1 { margin: 0 0 16px 0; font-size: 31px; letter-spacing: 0; color: var(--accent-strong); }
h2 { margin: 0 0 10px 0; font-size: 18px; letter-spacing: 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 12px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(12, 56, 48, 0.05);
  border-radius: 18px;
  overflow: hidden;
}
th, td { border: 1px solid var(--line); padding: 8px; vertical-align: top; }
th {
  background: linear-gradient(180deg, #eef7f4 0%, var(--header) 100%);
  color: var(--accent-strong);
}

input, select, button, textarea { font: inherit; }
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%; box-sizing: border-box; padding: 9px 10px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--text);
}
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
select:focus,
textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 92, 0.18);
}
input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--brand); }

.scroll-select-control,
.scroll-native-date {
  cursor: pointer;
}

.scroll-select-control {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 247, 0.96));
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 0 var(--control-px-wide); cursor: pointer;
  border: 1px solid var(--brand-strong);
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff; border-radius: var(--control-radius); font-weight: 850;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 10px 20px rgba(14, 122, 102, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  touch-action: manipulation;
}
button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(14, 122, 102, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
button:active {
  transform: translateY(0);
  box-shadow: 0 7px 14px rgba(14, 122, 102, 0.18), inset 0 1px 1px rgba(0, 0, 0, 0.08);
}
button:focus-visible,
.actions a:focus-visible,
.action-link:focus-visible,
.month-primary-link:focus-visible,
.toolbar-actions a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 107, 92, 0.18), 0 0 0 1px var(--brand);
}
button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

button.is-submitting {
  pointer-events: none;
  gap: 8px;
  cursor: progress;
}

button.is-submitting::after {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  opacity: .82;
  animation: koa-button-spin .72s linear infinite;
}

form.is-submitting {
  cursor: progress;
}

@keyframes koa-button-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  button.is-submitting::after {
    animation: none;
  }
}

body.has-confirm-modal {
  overflow: hidden;
}

.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 28, 25, .34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.confirm-modal-backdrop[hidden] {
  display: none;
}

.confirm-modal-card {
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(42, 48, 44, .14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,253,248,.96), rgba(247,244,237,.9));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.76),
    0 28px 80px rgba(24, 28, 25, .22);
}

.confirm-modal-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #fff8ea;
  color: var(--warn-ink);
  border: 1px solid var(--warn-line);
  font-weight: 900;
}

.confirm-modal-copy {
  min-width: 0;
}

.confirm-modal-copy p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.confirm-modal-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
}

.confirm-modal-message {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.confirm-modal-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.confirm-modal-actions button {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
}

.confirm-modal-actions [data-confirm-cancel] {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--text);
}

.confirm-modal-actions [data-confirm-accept] {
  border-color: var(--warn-line);
  background: #fff8ea;
  color: var(--warn-ink);
}
form[action="/generate-invoices"] button,
form[action="/generate-team-invoices"] button,
form[action="/month/apply"] button,
button[form="month-form"] {
  background: linear-gradient(180deg, #1fb191 0%, var(--brand) 100%);
  border-color: var(--brand-strong);
  box-shadow: 0 14px 28px rgba(8, 74, 63, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
form[action="/month/discard"] button,
form[action="/home-layout/reset"] button {
  background: linear-gradient(180deg, #fff8ed 0%, #f8e4bf 100%);
  border-color: var(--warn-line);
  color: var(--warn-ink);
  box-shadow: none;
}
form[action="/admin/logout"] button,
form[action="/driver/logout"] button {
  background: linear-gradient(180deg, #ffffff 0%, #eef7f4 100%);
  border-color: rgba(255, 255, 255, 0.52);
  color: var(--brand-strong);
  box-shadow: none;
}

/* --- 4. Cards, pills, actions --- */
.grid { display: grid; grid-template-columns: 180px 1fr; gap: 10px 12px; max-width: 980px; }
.actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.actions a {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px-wide); border-radius: var(--control-radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  color: var(--accent-strong); text-decoration: none; font-weight: 800;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 8px 16px rgba(12, 56, 48, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.actions a:hover {
  background: var(--accent-soft);
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(12, 56, 48, 0.09);
}
.actions a:active { transform: translateY(0); box-shadow: 0 6px 12px rgba(12, 56, 48, 0.06); }

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line);
  padding: 20px; border-radius: 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--cta) 0%, #7dd4c0 100%);
  opacity: 0.95;
}
.small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.pill {
  display: inline-flex; align-items: center;
  padding: 4px 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong); font-size: 12px; font-weight: 800;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.hero-card { padding: 22px 22px 18px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 16px; align-items: start; }
.hero-title { font-size: 16px; color: var(--accent-strong); font-weight: 800; margin-bottom: 8px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero-kicker {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 800;
  border: 0;
}
.hero-panel {
  background: linear-gradient(180deg, #f7fcfa 0%, #eef7f4 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.hero-panel dl { margin: 0; display: grid; grid-template-columns: 88px 1fr; gap: 8px 10px; }
.hero-panel dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.hero-panel dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--accent-strong); }

/* --- 5. Shift table (month grid) --- */
.shift-wrap {
  overflow: auto; border: 1px solid var(--line-strong); border-radius: 18px;
  background: #fff; box-shadow: 0 16px 28px rgba(12, 56, 48, 0.07);
}
.shift-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.shift-table th, .shift-table td {
  width: var(--day-cell-width); min-width: var(--day-cell-width); max-width: var(--day-cell-width);
  padding: 0;
}
.shift-table .headcell { padding: 8px 5px; text-align: center; font-weight: 700; line-height: 1.2; }
.shift-table .meta {
  min-width: 96px;
  background: linear-gradient(180deg, #f7fcfa 0%, #eef7f4 100%);
  position: sticky; left: 0; z-index: 4; border-right: 1px solid var(--line-strong);
}
.shift-table .meta2 {
  min-width: 92px;
  background: linear-gradient(180deg, #f7fcfa 0%, #e7f1ee 100%);
  position: sticky; left: 96px; z-index: 4; border-right: 1px solid var(--line-strong);
  box-shadow: 6px 0 12px rgba(12, 56, 48, 0.04);
}
.month-table .name-col { white-space: nowrap; overflow: visible; text-overflow: clip; }
.month-table .name-col.is-long { font-size: 12px; letter-spacing: 0; }
.month-table .team-color-cell { box-shadow: inset 6px 0 0 var(--team-color, transparent), 6px 0 12px rgba(12, 56, 48, 0.04); }
.shift-table .meta3 { min-width: 96px; background: #fbfefc; position: sticky; left: 188px; z-index: 4; border-right: 1px solid var(--line-strong); }
.shift-table .meta4 { min-width: 96px; background: #fbfefc; position: sticky; left: 284px; z-index: 4; border-right: 1px solid var(--line-strong); }
.shift-table .meta5 { min-width: 86px; background: #fbfefc; position: sticky; left: 380px; z-index: 4; border-right: 1px solid var(--line-strong); }
.shift-table .sticky-row th { position: sticky; top: 0; z-index: 5; box-shadow: inset 0 -1px 0 rgba(12, 56, 48, 0.06); }
.month-table .sticky-row-2 th { position: sticky; top: 42px; z-index: 5; }
.month-table .sticky-row-3 th { position: sticky; top: 84px; z-index: 5; }
.month-table .sticky-row-4 th { position: sticky; top: 126px; z-index: 5; }
.month-table .sticky-row-5 th { position: sticky; top: 168px; z-index: 5; }
.month-table .sticky-row-6 th { position: sticky; top: 210px; z-index: 5; }
.month-table .summary-row th .headcell { padding: 8px 5px; min-height: 18px; }
.month-table .sticky-row .headcell { font-size: 13px; color: var(--accent-strong); }
.month-table .sticky-row .headcell .small { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: #3a5a53; }
.shift-cell { padding: 3px; position: relative; }
.special-shift-cell {
  min-width: 88px;
  vertical-align: top;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 252, 250, 0.84));
}
.special-shift-cell.has-special-shift {
  box-shadow: inset 0 0 0 2px rgba(14, 108, 94, 0.32);
}
.special-main-badge {
  display: block;
  min-height: 16px;
  margin: 1px 1px 4px;
  padding: 2px 5px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  color: #4d665f;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.special-shift-input {
  min-height: 34px;
  font-weight: 860;
}
.special-shift-board .toolbar-title span {
  max-width: none;
}
.driver-order-table .driver-order-input {
  width: 76px;
  min-height: 34px;
  text-align: center;
  font-weight: 860;
}
.driver-order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mini-icon-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--brand-strong);
  font-weight: 850;
  cursor: pointer;
}
.mini-icon-btn:hover {
  border-color: var(--brand);
  background: var(--accent-soft);
}
.shift-table .day-col-odd {
  background-color: #fffefa;
}
.shift-table .day-col-even {
  background-color: #f4f5f1;
}
.shift-cell.preview-changed {
  box-shadow: inset 0 0 0 2px #d68b00;
}
.shift-cell.preview-added { background-image: linear-gradient(180deg, rgba(220, 244, 236, 0.92), rgba(220, 244, 236, 0.92)); }
.shift-cell.preview-removed { background-image: linear-gradient(180deg, rgba(255, 230, 223, 0.95), rgba(255, 230, 223, 0.95)); }
.shift-cell.preview-request-cleared { background-image: linear-gradient(180deg, rgba(255, 243, 205, 0.96), rgba(255, 243, 205, 0.96)); }
.month-table tr.is-active-row > td {
  background-image: linear-gradient(180deg, rgba(233, 246, 241, 0.62), rgba(233, 246, 241, 0.62));
}
.month-table .shift-cell.is-active-day:not(.is-active-cell) {
  outline: 1px solid rgba(20, 105, 91, 0.18);
  outline-offset: -2px;
}
.month-table .shift-cell.is-active-cell {
  outline: 2px solid rgba(20, 105, 91, 0.72);
  outline-offset: -2px;
}
.month-table .shift-cell.is-late-edited {
  outline: 2px solid rgba(213, 145, 0, 0.64);
  outline-offset: -3px;
}
.month-table .shift-cell.is-late-edited::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 0;
  height: 0;
  border-top: 12px solid #d68b00;
  border-right: 12px solid transparent;
  filter: drop-shadow(0 1px 1px rgba(82, 49, 0, 0.18));
  pointer-events: none;
  z-index: 2;
}
.late-edit-chip {
  background: linear-gradient(135deg, #d68b00 0 45%, #fff3c4 45% 100%);
  box-shadow: inset 0 0 0 1px rgba(143, 88, 0, 0.24);
}
.month-table .day-click-target.is-active-day .headcell {
  background: rgba(233, 246, 241, 0.96);
  border-radius: 8px;
}
.month-table .shift-cell.is-manual-edited::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(20, 105, 91, 0.68);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
  pointer-events: none;
}
.shift-cell.is-jump-highlight, .day-click-target.is-jump-highlight, .meta2.is-jump-highlight {
  animation: koaJumpPulse 1.4s ease-out;
}
@keyframes koaJumpPulse {
  0% { box-shadow: inset 0 0 0 3px #0f6b5c, 0 0 0 0 rgba(15, 107, 92, 0.35); }
  60% { box-shadow: inset 0 0 0 3px #0f6b5c, 0 0 0 12px rgba(15, 107, 92, 0); }
  100% { box-shadow: none; }
}
.shift-input {
  width: 100%; min-width: var(--day-cell-width); max-width: var(--day-cell-width);
  border: none; padding: 7px 5px; text-align: center; background: transparent;
  white-space: nowrap; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis;
  border-radius: 8px;
}
.shift-input:focus {
  outline: none; background: #eaf5f1;
  box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 2px rgba(15, 107, 92, 0.14);
}
.shift-preview { display: block; font-size: 10px; line-height: 1.25; padding: 2px 3px 4px; color: #0f5573; background: var(--info-soft); border-radius: 0 0 8px 8px; white-space: normal; }
.day-click-target { cursor: pointer; }
.day-click-target:hover .headcell { text-decoration: underline; text-underline-offset: 3px; }
.cell-sat { background: var(--sat); }
.cell-sun { background: var(--sun); }
.cell-holiday { background: var(--sun); }

.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.chip { width: 18px; height: 18px; border-radius: 4px; border: 1px solid #bbb; display: inline-block; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.swatch { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; }

.legend-panel {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, .78);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.76),
    0 8px 24px rgba(24, 28, 25, .04);
}

.legend-panel h2,
.color-chart-panel h2 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 15px;
}

.legend-panel .legend {
  margin: 0;
}

.legend-panel.compact-legend {
  padding: 0;
  overflow: hidden;
}

.compact-legend summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  list-style: none;
}

.compact-legend summary::-webkit-details-marker {
  display: none;
}

.compact-legend summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.compact-legend[open] summary::after {
  content: "-";
}

.compact-legend .legend {
  padding: 0 14px 14px;
  gap: 8px 12px;
}

.color-chart-panel {
  padding: 16px;
}

.alert {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #fff8e8 0%, #fff2d7 100%);
  border: 1px solid var(--warn-line);
  padding: 13px 14px;
  border-radius: 16px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.55;
  box-shadow: 0 10px 20px rgba(166, 125, 39, 0.08);
}

.alert::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warn-ink);
  box-shadow: 0 0 0 4px rgba(184, 125, 42, .1);
}

.alert.success {
  background: linear-gradient(180deg, #f2fbf6 0%, #e4f4ea 100%);
  border-color: var(--success-line);
  box-shadow: 0 10px 20px rgba(50, 117, 75, 0.08);
}

.alert.success::before {
  background: var(--success-ink);
  box-shadow: 0 0 0 4px rgba(55, 128, 84, .1);
}

.alert.danger {
  background: linear-gradient(180deg, #fff1f0 0%, #fde2de 100%);
  border-color: var(--danger-line);
  box-shadow: 0 10px 20px rgba(150, 74, 60, 0.08);
}

.alert.danger::before {
  background: var(--danger-ink);
  box-shadow: 0 0 0 4px rgba(150, 74, 60, .11);
}

.alert.info {
  background: linear-gradient(180deg, #f4f8f7 0%, #e8f0ef 100%);
  border-color: var(--line);
  box-shadow: 0 10px 20px rgba(43, 74, 70, 0.06);
}

.alert.info::before {
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(43, 74, 70, .08);
}

.month-undo-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.month-undo-form {
  margin: 0;
  flex: 0 0 auto;
}

.month-undo-form .modern-btn {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  border-color: rgba(28, 92, 82, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
  box-shadow: none;
}

@media (max-width: 640px) {
  .month-undo-message {
    align-items: flex-start;
    flex-direction: column;
  }
}

.shift-worklist-card { padding-bottom: 16px; }
.shift-worklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.shift-worklist-head strong {
  color: var(--accent-strong);
  font-size: 15px;
}
.shift-worklist-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}
.worklist-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.worklist-item {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px;
  width: 100%; min-height: 58px; padding: 10px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; color: var(--text); box-shadow: none; text-align: left;
}
.worklist-item:hover { filter: none; transform: translateY(-1px); border-color: var(--brand); background: var(--accent-soft); }
.worklist-tone {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 28px; padding: 0 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 900;
}
.worklist-tone.tone-danger { background: var(--danger-soft); color: var(--danger-ink); }
.worklist-tone.tone-warn { background: #fff0cf; color: #805600; }
.worklist-main { display: grid; gap: 3px; min-width: 0; }
.worklist-main strong { font-size: 13px; color: var(--accent-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.worklist-main small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.worklist-more {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.shift-audit-card { padding: 12px; }
.shift-audit-strip {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(82px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.shift-audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}
.shift-audit-item span { color: var(--muted); font-size: 12px; font-weight: 850; }
.shift-audit-item strong { color: var(--accent-strong); font-size: 20px; line-height: 1; }
.shift-audit-item.is-summary { justify-content: flex-start; }
.shift-audit-details {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.shift-audit-details summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 820;
}
.shift-audit-details summary::-webkit-details-marker {
  display: none;
}
.shift-audit-details summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
}
.shift-audit-details[open] summary::after {
  content: "-";
}
.shift-audit-details summary span,
.shift-audit-details summary strong {
  display: inline-flex;
  align-items: center;
}
.shift-audit-details summary strong {
  margin-left: auto;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
}
.shift-audit-card .table-shell { margin-top: 10px; box-shadow: none; }

.day-detail-panel {
  position: fixed; right: 24px; bottom: 16px; z-index: 24;
  width: min(480px, calc(100vw - 40px)); margin: 0;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
  box-shadow: 0 18px 38px rgba(12, 56, 48, 0.16);
  padding: 12px;
}
.day-panel-title, .day-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--accent-strong);
}
.day-panel-title strong { font-size: 14px; }
.day-panel-close {
  width: var(--control-height-compact);
  min-width: var(--control-height-compact);
  min-height: var(--control-height-compact);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}
.day-panel-close:hover,
.day-panel-close:focus-visible {
  color: var(--accent-strong);
  border-color: var(--line-strong);
  background: #fff;
}
.day-panel-head { margin-top: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.day-panel-head span { color: var(--danger-ink); font-size: 12px; font-weight: 800; }
.day-panel-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0;
}
.day-panel-metrics span {
  display: grid; gap: 2px; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #f7fcfa;
  color: var(--muted); font-size: 11px; font-weight: 800;
}
.day-panel-metrics strong { color: var(--accent-strong); font-size: 15px; }
.day-panel-metrics .is-short { background: var(--danger-soft); color: var(--danger-ink); border-color: #efb8b8; }
.day-panel-metrics .is-surplus { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--line-strong); }
.day-panel-section { margin-top: 10px; }
.day-panel-section h3 { margin: 0 0 6px 0; font-size: 13px; color: var(--accent-strong); }
.day-panel-section ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 6px;
}
.day-panel-section li { margin: 0; }
.day-panel-section button {
  width: 100%; min-height: var(--control-height-compact); padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--control-radius); background: #fff;
  color: var(--text); box-shadow: none; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.day-panel-section button:hover { filter: none; border-color: var(--brand); background: var(--accent-soft); transform: none; }
.day-panel-section small { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.day-panel-empty {
  padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 10px;
  color: var(--muted); font-size: 12px; background: #fbfefc;
}
.inline-ack-form { margin: 0; }
.inline-ack-form button {
  min-height: var(--control-height-compact); padding: 0 10px; border-radius: var(--control-radius);
  background: linear-gradient(180deg, #e9f5ff 0%, #cfe8fb 100%);
  color: #0f5573; border-color: var(--info-line);
  box-shadow: none;
}
.inline-ack-form button:hover { filter: none; background: #d9ecf5; }

.invoice-flag-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.invoice-late-edit-panel {
  border-color: rgba(213, 145, 0, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 246, 219, 0.92), rgba(255, 255, 255, 0.98) 42%),
    var(--panel);
}
.invoice-late-edit-panel .data-table th {
  background: rgba(255, 246, 219, 0.9);
}
.invoice-late-edit-panel .data-table td:first-child {
  font-weight: 800;
  color: #7b4d00;
}
.invoice-approval-form {
  display: grid; grid-template-columns: 96px minmax(140px, 1fr) auto;
  gap: 8px; align-items: center; min-width: 330px;
}
.invoice-approval-form select,
.invoice-approval-form input {
  min-height: var(--control-height-compact); padding: 0 9px; border-radius: var(--control-radius);
}
.invoice-approval-form button {
  min-height: var(--control-height-compact); padding: 0 10px; border-radius: var(--control-radius);
  background: linear-gradient(180deg, #eef7f4 0%, #d7ede7 100%);
  color: var(--brand-strong);
  border-color: var(--line-strong);
  box-shadow: none;
}
.invoice-actions-card { padding: 14px; }
.invoice-actions-card h2 { margin: 0 0 10px; font-size: 16px; color: var(--accent-strong); }
.invoice-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.invoice-action-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}
.invoice-action-card strong { color: var(--accent-strong); font-size: 14px; }
.invoice-action-card label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.invoice-action-card input,
.invoice-action-card select { min-height: var(--control-height); }
.invoice-action-card button { width: 100%; margin-top: 2px; }
.invoice-inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mobile-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.day-card {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  padding: 12px; box-shadow: 0 10px 24px rgba(12, 56, 48, 0.04);
}
.day-card strong { display: block; margin-bottom: 2px; }

.toggle-grid-btn { width: 100%; min-width: var(--day-cell-width); border: none; background: transparent; padding: 8px 5px; text-align: center; cursor: pointer; border-radius: 8px; color: var(--muted); }
.toggle-grid-btn.is-on { background: #FCE4D6; color: #9a1e1e; font-weight: 700; }

.mobile-form .grid { max-width: none; }
.mobile-form .actions a, .mobile-form .actions button, .mobile-form .actions form { width: 100%; }
.mobile-form .actions { align-items: stretch; }

/* --- 6. Dashboard & home --- */
.home-section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.home-link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.home-link-list a {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px); border-radius: var(--control-radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  color: var(--accent-strong); text-decoration: none; font-weight: 700;
  line-height: 1.15;
  text-align: center;
}
.home-link-list a:hover {
  background: linear-gradient(180deg, #eef7f4 0%, #d7ede7 100%);
  border-color: var(--line-strong);
}

.dashboard-shell { display: grid; gap: 16px; }
.dashboard-stack { display: grid; gap: 16px; }
.dashboard-header { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
.section-block {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.section-block > h2 { margin-bottom: 14px; }
.dashboard-title-card {
  padding: 30px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}
.dashboard-title-card::before {
  background: linear-gradient(90deg, #3dbfa4 0%, #aeded2 100%);
  opacity: 1;
}
.dashboard-brand {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  border: 0;
}
.dashboard-title-card .dashboard-brand {
  background: transparent;
  color: var(--muted);
  border: 0;
}
.dashboard-main-title { margin: 16px 0 8px; font-size: 32px; font-weight: 900; letter-spacing: 0; line-height: 1.25; color: var(--accent-strong); word-break: keep-all; }
.dashboard-subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 760px; }
.dashboard-target-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 800;
}
.dashboard-target-line strong { color: var(--accent-strong); font-size: 16px; }
.dashboard-target-line span + span::before {
  content: none;
}
.dashboard-header-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dashboard-header-actions a {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px-wide); border-radius: var(--control-radius);
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--accent-strong); text-decoration: none; font-weight: 800;
  line-height: 1.15;
  text-align: center;
}
.dashboard-header-actions a.primary {
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff; border-color: var(--brand-strong);
  box-shadow: 0 12px 22px rgba(12, 56, 48, 0.16);
}
.dashboard-header-actions a:hover { background: var(--accent-soft); }
.dashboard-header-actions a.primary:hover { filter: brightness(1.04); }
.dashboard-header-actions form { margin: 0; }
.dashboard-header-actions form button {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  color: var(--accent-strong);
  border-color: var(--line-strong);
  box-shadow: none;
}
.dashboard-header-side { display: grid; gap: 12px; }
.dashboard-side-card { padding: 20px; }
.dashboard-side-list { display: grid; gap: 10px; }
.dashboard-side-item {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border-radius: 16px; padding: 13px 15px;
}
.dashboard-side-item strong { display: block; color: var(--accent-strong); font-size: 14px; }
.dashboard-side-item span { color: var(--muted); font-size: 12px; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.status-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  box-shadow: var(--shadow-sm);
}
.status-card h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 800; }
.status-value { font-size: 24px; font-weight: 900; color: var(--accent-strong); letter-spacing: 0; }
.status-sub { margin-top: 6px; color: var(--muted); font-size: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}
.status-pill.info    { background: var(--info-soft);    color: var(--info-ink);    border-color: var(--info-line); }
.status-pill.success { background: var(--success-soft); color: var(--success-ink); border-color: var(--success-line); }
.status-pill.warn    { background: var(--warn-soft);    color: var(--warn-ink);    border-color: var(--warn-line); }
.status-pill.danger  { background: var(--danger-soft);  color: var(--danger-ink);  border-color: var(--danger-line); }

.cta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cta-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  box-shadow: 0 16px 30px rgba(12, 56, 48, 0.08);
}
.cta-card.primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--cta) 100%);
  color: #fff; border-color: var(--brand-strong);
}
.cta-card .eyebrow { font-size: 12px; font-weight: 800; opacity: 0.85; }
.cta-card .title { margin-top: 10px; font-size: 24px; font-weight: 900; letter-spacing: 0; }
.cta-card .desc { margin-top: 8px; font-size: 13px; line-height: 1.6; opacity: 0.9; }
.cta-card .action { margin-top: 16px; font-size: 13px; font-weight: 800; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feature-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow-sm);
}
.feature-card h3 { margin: 0 0 6px; font-size: 18px; color: var(--accent-strong); }
.feature-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.feature-links a {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px); border-radius: var(--control-radius);
  border: 1px solid var(--line); background: #f7fcfa;
  color: var(--accent-strong); text-decoration: none; font-weight: 800; font-size: 13px;
  line-height: 1.15;
  text-align: center;
}
.feature-links a:hover { background: var(--brand-soft); }

.helper-card-ok   { background: linear-gradient(180deg, #f2fbf6 0%, #e0f5e9 100%); border-color: var(--success-line); }
.helper-card-warn { background: linear-gradient(180deg, #fffaf0 0%, #fff3de 100%); border-color: var(--warn-line); }
.helper-list { margin: 10px 0 0; padding-left: 18px; color: var(--accent-strong); }

.dashboard-focus-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; }
.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}
.task-list { display: grid; gap: 10px; }
.task-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  padding: 16px 18px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.task-item { text-decoration: none; }
a.task-item:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(12, 56, 48, 0.12); border-color: var(--line-strong); }
.task-item strong { display: block; color: var(--accent-strong); font-size: 14px; }
.task-item .small { margin-top: 2px; }
.task-arrow { color: var(--muted); font-size: 24px; line-height: 1; font-weight: 700; }

.task-count { min-width: 42px; text-align: right; padding: 0; border-radius: 0; font-weight: 900; background: transparent; color: var(--accent-strong); }
.task-count.success { background: transparent; color: var(--success-ink); }
.task-count.warn    { background: transparent; color: var(--warn-ink); }
.task-count.danger  { background: transparent; color: var(--danger-ink); }

.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.driver-links-spaced { margin-top: 14px; }
.quick-links a {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px-wide); border-radius: var(--control-radius);
  background: #fff; border: 1px solid var(--line-strong);
  text-decoration: none; color: var(--accent-strong); font-weight: 800;
  line-height: 1.15;
  text-align: center;
}
.quick-links a.primary {
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff; border-color: var(--brand-strong);
}
.quick-links a.strong {
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
  color: #fff; border-color: var(--brand-strong);
  box-shadow: 0 12px 24px rgba(12, 56, 48, 0.22);
}

.settings-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.settings-head h2 { margin: 0; }
.settings-head .actions { margin-top: 0; }
.settings-divider { border-top: 1px solid var(--line); margin: 20px 0; }
.dashboard-panel-title { margin: 0 0 12px; }
.home-reset-form { margin-top: 10px; }

.admin-toolbar { position: sticky; top: 10px; z-index: 20; display: grid; gap: 12px; margin-bottom: 14px; }
.toolbar-card { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 18px; }
.month-hero-card {
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 38%, var(--cta-strong) 100%);
  border-color: var(--brand-strong);
  box-shadow: 0 24px 44px rgba(12, 56, 48, 0.26);
}
.month-hero-card::before {
  background: linear-gradient(90deg, #3dbfa4 0%, #aeded2 100%);
  opacity: 1;
}
.month-hero-card .toolbar-title h2, .month-hero-card .toolbar-title strong { color: #fff; }
.month-hero-card .toolbar-note { color: #d7ede7; }
.month-hero-card .status-pill.info {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}
.month-ops-card {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(12, 56, 48, 0.08);
}
.month-primary-link {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px-wide); border-radius: var(--control-radius);
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff !important; border: 1px solid var(--brand-strong);
  text-decoration: none; font-weight: 800;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 12px 24px rgba(14, 122, 102, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.month-primary-link:hover { filter: brightness(1.04); transform: translateY(-1px); }
.month-actions { width: 100%; align-items: center; gap: 6px; }
.month-actions form { display: inline-flex; }
.month-actions a,
.month-actions button {
  min-height: var(--control-height);
  min-width: 76px;
  padding: 0 10px;
  border-radius: var(--control-radius);
  font-size: 14px;
}
.zoom-select-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.zoom-select-form select {
  width: auto;
  min-width: 78px;
  min-height: var(--control-height);
  padding: 0 28px 0 10px;
  border-radius: var(--control-radius);
  font-size: 14px;
  font-weight: 850;
  color: var(--accent-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
}
.focus-toolbar .zoom-select-form {
  width: 100%;
  margin-bottom: 8px;
}
.focus-toolbar .zoom-select-form select { width: 100%; }
.month-actions .legend {
  margin: 0;
  padding: 4px;
  gap: 4px;
  background: #f7fcfa;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.month-actions .legend a {
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.month-public-link {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px); border-radius: var(--control-radius);
  border: 1px solid #9fc5eb;
  background: linear-gradient(180deg, #f7fbff 0%, #e9f3ff 100%);
  color: #245a8d !important;
  text-decoration: none; font-weight: 850;
  line-height: 1.15;
  text-align: center;
  box-shadow: none;
}
.month-public-link:hover {
  border-color: #6fa7df;
  background: #e8f3ff;
}
.month-board-card { padding: 14px; background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%); }
.month-board-card::before { background: linear-gradient(90deg, #7dd4c0 0%, #cceae2 100%); }
.month-board-footnote { margin-top: 12px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-actions form { margin: 0; }
.toolbar-actions a, .toolbar-actions button { min-height: var(--control-height); }
.toolbar-note { color: var(--muted); font-size: 12px; }
.toolbar-title { display: grid; gap: 4px; }
.toolbar-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- 9. Forms (form-section, grid) --- */
.section-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  box-shadow: var(--shadow-sm);
}
.form-section h2 { margin-bottom: 12px; font-size: 17px; }
.section-copy { margin: -4px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.form-section .grid { max-width: none; }
.form-section-wide { grid-column: 1 / -1; }

.list-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.list-status.ok     { background: var(--success-soft); color: var(--success-ink); }
.list-status.warn   { background: var(--warn-soft);    color: var(--warn-ink); }
.list-status.danger { background: var(--danger-soft);  color: var(--danger-ink); }

/* --- 7. Driver portal & driver admin --- */
.driver-public-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
}
.driver-shell,
.driver-content {
  display: grid;
  gap: 14px;
}

.driver-content {
  min-width: 0;
}
.driver-hero {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,254,250,.9), rgba(255,253,248,.76));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 10px 30px rgba(24, 28, 25, .052);
}
.driver-hero-title { margin: 6px 0 4px; }
.driver-hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.driver-hero-top form[action="/driver/logout"] {
  flex: 0 0 auto;
  margin: 0;
}
.driver-hero-top form[action="/driver/logout"] button {
  min-width: 94px;
  white-space: nowrap;
  padding: 0 12px;
}
.driver-app-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.driver-app-nav a {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height-large);
  text-align: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--control-radius); padding: 0 8px;
  font-weight: 800; color: var(--accent-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  box-shadow: 0 10px 20px rgba(12, 56, 48, 0.06);
}
.driver-app-nav a.active {
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff; border-color: var(--brand-strong);
}
.driver-app-nav a small { display: block; margin-top: 3px; font-size: 10px; font-weight: 700; opacity: 0.8; }
.driver-home-grid { display: grid; gap: 14px; grid-template-columns: 1.1fr 0.9fr; }
.notice-stack { display: grid; gap: 10px; }
.notice-card {
  border-radius: 18px; padding: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
}
.notice-card.warn   { background: linear-gradient(180deg, #fffaf0 0%, #fff3de 100%); border-color: var(--warn-line); }
.notice-card.danger { background: linear-gradient(180deg, #fff1f0 0%, #fde0dc 100%); border-color: var(--danger-line); }
.notice-card.info   { background: linear-gradient(180deg, #f2fbf7 0%, #e7f1ee 100%); border-color: var(--line); }
.driver-kpi { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.driver-kpi .status-card { padding: 14px; }
.driver-kpi-card {
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease;
}
.driver-kpi-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 28px rgba(12, 56, 48, .08);
}
.driver-check-stack {
  align-content: start;
}
.driver-check-card {
  display: grid;
  gap: 12px;
}
.driver-check-card .driver-section-head h2 {
  margin: 0;
}
.driver-check-items {
  display: grid;
  gap: 9px;
}
.driver-check-item {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 10px 12px 10px 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.driver-check-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
}
.driver-check-item strong {
  color: var(--accent-strong);
  font-size: 14px;
}
.driver-check-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}
.driver-check-item.warn::before { background: var(--warn-ink); }
.driver-check-item.danger::before { background: var(--danger-ink); }
.driver-check-item.info::before { background: var(--info-ink); }
.inline-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.driver-tab-panel { display: grid; gap: 14px; }
.driver-summary-line {
  display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px;
  color: var(--muted); font-size: 12px; font-weight: 800;
}
.driver-summary-line span + span::before {
  content: ""; display: inline-block; width: 4px; height: 4px;
  margin: 0 10px 2px 0; border-radius: 999px; background: var(--line-strong);
}
.driver-section-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 22px; padding: 18px;
  box-shadow: var(--shadow-sm);
}
.driver-section-card h2 { margin: 0 0 10px; font-size: 18px; color: var(--accent-strong); }
.driver-section-card.featured {
  background: linear-gradient(180deg, #fff 0%, var(--brand-soft) 100%);
  border-color: var(--line-strong); box-shadow: 0 18px 32px rgba(12, 56, 48, 0.1);
}
.driver-mini-meta { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.driver-mini-meta .meta-block { border: 1px solid var(--line); background: #f7fcfa; border-radius: 14px; padding: 12px; }
.driver-mini-meta strong { display: block; font-size: 13px; color: var(--accent-strong); }
.driver-mini-meta span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.driver-list-card { display: grid; gap: 10px; }
.driver-list-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  padding: 14px 16px;
}
.driver-list-row strong { color: var(--accent-strong); }
.driver-list-row .small { margin-top: 2px; }
.driver-amount-pill { justify-self: flex-end; }
.driver-account-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.driver-account-grid .driver-info-tile {
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, #f7fcfa 0%, #eef7f4 100%);
  padding: 15px;
}
.driver-account-grid .driver-info-tile strong { display: block; font-size: 13px; color: var(--accent-strong); }
.driver-account-grid .driver-info-tile span { display: block; margin-top: 6px; color: var(--text); word-break: break-word; }
.driver-ops-card { border: 1px dashed var(--line); border-radius: 14px; background: #f7fcfa; padding: 14px; }
.driver-ops-card strong { display: block; color: var(--accent-strong); margin-bottom: 6px; }
.driver-actions-stack { display: grid; gap: 10px; }
.driver-primary-card {
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 58%, var(--cta-strong) 100%);
  color: #fff; border: 1px solid var(--brand-strong); border-radius: 24px; padding: 22px;
  box-shadow: 0 24px 42px rgba(12, 56, 48, 0.28);
}
.driver-primary-card h2 { margin: 0 0 10px; color: #fff; font-size: 22px; }
.driver-primary-card .small { color: #d7ede7; }
.driver-primary-actions { display: grid; gap: 10px; margin-top: 16px; }
.driver-primary-actions a {
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box;
  min-height: var(--control-height-large); padding: 0 16px; border-radius: var(--control-radius);
  text-decoration: none; font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12); color: #fff;
}
.driver-primary-actions a > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.driver-primary-actions a strong { color: #fff; font-size: 15px; }
.driver-primary-actions a span { display: block; color: #d7ede7; font-size: 12px; font-weight: 700; line-height: 1.35; }
.driver-primary-actions a.primary { background: #fff; color: var(--brand-strong); border-color: #fff; }
.driver-primary-actions a.primary strong { color: var(--brand-strong); }
.driver-primary-actions a.primary span { color: var(--muted); }
.driver-primary-actions .driver-action-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}
.driver-primary-actions a.primary .driver-action-mark {
  background: rgba(45,81,72,.08);
  border-color: rgba(45,81,72,.13);
  color: var(--brand-strong);
}
.driver-primary-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.driver-primary-meta .meta-block { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 14px; padding: 12px; }
.driver-primary-meta strong { display: block; color: #d7ede7; font-size: 12px; }
.driver-primary-meta span { display: block; margin-top: 6px; color: #fff; font-size: 15px; font-weight: 800; }
.driver-shell .quick-links a { flex: 1 1 180px; }

.driver-public-shell .mobile-form > .actions {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  padding: 10px;
  border: 1px solid var(--driver-line, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,254,250,.92), rgba(247,244,237,.8));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 14px 34px rgba(24, 28, 25, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.driver-public-shell .mobile-form > .actions button,
.driver-public-shell .mobile-form > .actions a {
  min-width: 132px;
}

.driver-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.driver-section-head h2 { margin-bottom: 4px; }
.driver-section-sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}
.driver-count-badge {
  min-width: 104px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  text-align: right;
}
.driver-count-badge span,
.driver-count-badge small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.3;
}
.driver-count-badge strong {
  display: block;
  margin: 2px 0;
  color: var(--accent-strong);
  font-size: 19px;
  font-weight: 920;
  line-height: 1.1;
}
.driver-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.driver-schedule-card {
  position: relative;
  overflow: hidden;
  align-items: center;
  min-height: 74px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.58)),
    var(--day-bg, #fff);
}
.driver-schedule-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--day-accent, var(--line-strong));
}
.driver-schedule-card.is-work {
  border-color: #b7c8bf;
}
.driver-schedule-card.is-empty {
  color: var(--muted);
}
.driver-date-badge {
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(12, 56, 48, 0.06);
}
.driver-date-badge strong {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1.05;
}
.driver-date-badge span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.driver-schedule-copy {
  min-width: 0;
}
.driver-schedule-copy strong {
  display: block;
  margin: 0;
  color: var(--accent-strong);
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.driver-schedule-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}
.driver-special-shift-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 0 0 100%;
  width: 100%;
  padding-left: 62px;
}
.driver-special-shift-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff0cf;
  color: #6f4d00;
  border: 1px solid rgba(214, 139, 0, 0.24);
  font-size: 11px;
  font-weight: 860;
  line-height: 1.1;
}
.request-day-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.driver-request-control-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin: 12px 0 14px;
}
.driver-request-live {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}
.driver-request-live span,
.driver-request-live small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}
.driver-request-live strong {
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 860;
  line-height: 1;
}
.driver-secondary-tool {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  color: var(--accent-strong);
  font-weight: 820;
  cursor: pointer;
}
.driver-secondary-tool:disabled {
  cursor: not-allowed;
  opacity: .52;
}
.request-day-card {
  position: relative;
  align-items: center;
  min-height: 70px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.62)),
    var(--day-bg, #fff);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.request-day-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.request-day-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.request-checkmark {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: transparent;
  font-size: 12px;
  font-weight: 900;
}
.request-day-card.is-selected {
  border-color: #a8cee0;
  background:
    linear-gradient(180deg, rgba(235,247,253,.9), rgba(223,238,245,.72)),
    var(--day-bg, #fff);
  box-shadow: 0 12px 24px rgba(15, 85, 115, .08), inset 0 1px 0 rgba(255,255,255,.72);
}
.request-day-card.is-selected .request-checkmark {
  border-color: #7fb6d0;
  background: #d9ecf5;
  color: #0f5573;
}
.request-day-card.is-selected .request-checkmark::after {
  content: "休";
}
.request-day-card:has(.request-day-checkbox:focus-visible) {
  outline: 3px solid rgba(15, 85, 115, .22);
  outline-offset: 2px;
}
.request-day-copy {
  min-width: 0;
}
.request-day-copy strong {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1.2;
}

.driver-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.overview-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow-sm);
}
.overview-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.overview-value { display: block; margin-top: 8px; color: var(--accent-strong); font-size: 26px; font-weight: 900; letter-spacing: 0; line-height: 1.15; word-break: keep-all; }
.overview-sub { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* --- 8. Tables (data-table, month-index-table) --- */
.month-index-shell { display: grid; gap: 16px; }
.month-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.month-summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  box-shadow: var(--shadow-sm);
}
.month-summary-card strong { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.month-summary-card span { display: block; margin-top: 8px; color: var(--accent-strong); font-size: 24px; font-weight: 900; letter-spacing: 0; }
.month-summary-card .small { margin-top: 6px; display: block; }

.month-index-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.month-index-table th, .month-index-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.month-index-table tr:last-child td { border-bottom: none; }
.month-index-table th {
  text-align: left; font-size: 12px; letter-spacing: 0.02em; text-transform: none;
  color: var(--muted);
  background: linear-gradient(180deg, #f7fcfa 0%, #eef7f4 100%);
}

.table-sort-button {
  appearance: none;
  width: 100%;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.table-sort-button::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: auto;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .26;
}

th[aria-sort="ascending"] .table-sort-button::after {
  border-top: 0;
  border-bottom: 5px solid currentColor;
  opacity: .82;
}

th[aria-sort="descending"] .table-sort-button::after {
  opacity: .82;
}

.table-sort-button:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  filter: none;
  transform: none;
}

.table-sort-button:focus-visible {
  outline: 3px solid rgba(49, 95, 119, .2);
  outline-offset: 3px;
}

.month-row-current { background: linear-gradient(90deg, rgba(15, 107, 92, 0.06) 0%, rgba(15, 107, 92, 0.02) 100%); }
.month-row-next    { background: linear-gradient(90deg, rgba(21, 160, 133, 0.05) 0%, rgba(21, 160, 133, 0.01) 100%); }
.month-cell-main { display: grid; gap: 6px; }
.month-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.month-title-line strong { font-size: 17px; color: var(--accent-strong); }
.month-meta-line { display: flex; flex-wrap: wrap; gap: 8px; }
.month-meta-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.month-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--line-strong); display: inline-block; }

.action-cluster { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.action-cluster a {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px); border-radius: var(--control-radius);
  text-decoration: none; font-weight: 800;
  border: 1px solid var(--line); background: #fff; color: var(--accent-strong);
}
.action-cluster a.primary {
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff; border-color: var(--brand-strong);
}
.action-cluster a.ghost { background: #f7fcfa; }

.action-link {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px); border-radius: var(--control-radius);
  text-decoration: none; font-weight: 800;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  color: var(--accent-strong);
  box-shadow: 0 6px 12px rgba(12, 56, 48, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}
.action-link.primary {
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%);
  color: #fff; border-color: var(--brand-strong);
  box-shadow: 0 12px 24px rgba(14, 122, 102, 0.18);
}
.action-link.ghost { background: #f7fcfa; }
.action-link:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 9px 16px rgba(12, 56, 48, 0.08);
}

.amount-stack {
  display: grid; gap: 4px; min-width: 130px;
}
.amount-stack span {
  display: flex; justify-content: space-between; gap: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text); font-weight: 700; font-size: 13px;
}
.amount-stack em {
  font-style: normal; color: var(--muted); font-weight: 600; font-size: 11px;
  letter-spacing: 0.04em;
}
.status-stack {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.status-stack > div { width: 100%; }
.status-stack form { margin: 0; width: 100%; }
.status-stack form button { width: 100%; min-height: var(--control-height-compact); padding: 0 10px; font-size: 12px; }
.attention-flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn-ink);
  border: 1px solid var(--warn-line);
  font-size: 12px; font-weight: 800;
}

.section-shell { position: relative; }
.section-edit-badge { display: none; }
.edit-mode .section-shell { outline: 1px dashed var(--line-strong); outline-offset: 6px; border-radius: 18px; }
.edit-mode .section-edit-badge {
  display: inline-flex; position: absolute; top: 8px; right: 8px; z-index: 3;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px; font-weight: 800; border: 0;
}
.home-edit-panel {
  background: linear-gradient(180deg, #fff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  box-shadow: 0 14px 28px rgba(12, 56, 48, 0.08);
}
.home-edit-list { display: grid; gap: 10px; margin-top: 14px; }
.home-edit-row {
  display: grid; grid-template-columns: 1.6fr auto auto auto auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px;
}
.home-edit-row-title { font-weight: 800; color: var(--accent-strong); }
.home-edit-row small { display: block; color: var(--muted); margin-top: 4px; }
.home-edit-row .mini-actions { display: flex; gap: 6px; }
.home-edit-row .mini-actions button { min-width: var(--control-height); padding: 0 10px; }
.home-edit-row .toggle-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.home-edit-footer { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.subtle-link {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-height); padding: 0 var(--control-px-wide); border-radius: var(--control-radius);
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--brand); text-decoration: none; font-weight: 700;
}

.page-shell { display: grid; gap: 16px; align-content: start; }
.page-intro { display: grid; gap: 12px; }
.page-intro h2 { margin: 0; font-size: 24px; letter-spacing: 0; color: var(--accent-strong); }
.page-intro p { margin: 0; }
.page-kicker {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 800;
  border: 0;
  width: auto;
}
.page-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.page-toolbar .actions { margin-top: 0; }

.public-shift-page {
  gap: 14px;
}
.public-shift-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.public-summary-card {
  min-height: 70px;
  align-content: start;
}
.public-summary-card span,
.public-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.35;
}
.public-summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.public-shift-page .legend-panel {
  padding: 13px 16px;
}
.public-shift-wrap {
  border-radius: 16px;
}
.public-shift-table .headcell {
  padding: 7px 5px;
}
.public-shift-table .sticky-row th {
  position: sticky;
  top: 0;
  z-index: 6;
}
.public-shift-table .sticky-row-2 th {
  position: sticky;
  top: 36px;
  z-index: 6;
}
.public-shift-table .sticky-row-3 th {
  position: sticky;
  top: 72px;
  z-index: 6;
}
.public-shift-table .sticky-row-4 th {
  position: sticky;
  top: 108px;
  z-index: 6;
}
.public-shift-table .sticky-row th.meta,
.public-shift-table .sticky-row th.meta2,
.public-shift-table .sticky-row th.meta3,
.public-shift-table .sticky-row th.meta4,
.public-shift-table .sticky-row th.meta5,
.public-shift-table .sticky-row-2 th.meta,
.public-shift-table .sticky-row-2 th.meta2,
.public-shift-table .sticky-row-2 th.meta3,
.public-shift-table .sticky-row-2 th.meta4,
.public-shift-table .sticky-row-2 th.meta5,
.public-shift-table .sticky-row-3 th.meta,
.public-shift-table .sticky-row-3 th.meta2,
.public-shift-table .sticky-row-3 th.meta3,
.public-shift-table .sticky-row-3 th.meta4,
.public-shift-table .sticky-row-3 th.meta5,
.public-shift-table .sticky-row-4 th.meta,
.public-shift-table .sticky-row-4 th.meta2,
.public-shift-table .sticky-row-4 th.meta3,
.public-shift-table .sticky-row-4 th.meta4,
.public-shift-table .sticky-row-4 th.meta5 {
  z-index: 8;
}
.public-count-row th .headcell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.public-shift-table .meta2 .headcell,
.public-shift-table .meta3 .headcell,
.public-shift-table .meta4 .headcell,
.public-shift-table .meta5 .headcell {
  text-align: left;
  padding-left: 9px;
}

.rolling-date-range {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.rolling-shift-summary .modern-stat small a {
  color: inherit;
  font-weight: 820;
  text-decoration: none;
}

.rolling-shift-summary .modern-stat small a + a::before {
  content: " / ";
  color: var(--muted);
  font-weight: 700;
}

.rolling-shift-table .meta2 .headcell,
.rolling-shift-table .meta3 .headcell {
  text-align: left;
  padding-left: 9px;
}

.rolling-shift-table .rolling-shortage-row th.shortage .headcell {
  color: var(--danger-ink);
}

.rolling-shift-table .rolling-shortage-row th.surplus .headcell {
  color: var(--accent-strong);
}

.table-shell {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  border: 1px solid var(--line); border-radius: 20px; padding: 0;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 0;
  border: none; box-shadow: none; border-radius: 0;
}
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table th {
  text-align: left; font-size: 12px; color: var(--muted);
  background: linear-gradient(180deg, #f7fcfa 0%, #eef7f4 100%);
}
.data-table td,
.data-table th {
  overflow-wrap: anywhere;
}
.data-table td strong { color: var(--accent-strong); }
.table-note { padding: 14px 16px; border-top: 1px solid var(--line); background: #f7fcfa; color: var(--muted); font-size: 12px; }
.data-table .empty-row td {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 760;
  background:
    linear-gradient(180deg, rgba(255,254,250,.86), rgba(247,244,237,.72));
}

.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.card-actions a, .card-actions button { min-height: var(--control-height); }
.muted-block { color: var(--muted); font-size: 13px; line-height: 1.65; }

/* --- 11. Responsive --- */
@media (max-width: 720px) {
  body { margin: 12px; }
  .driver-public-shell {
    width: min(100% - 2px, 1160px);
    padding: 0 0 24px;
  }
  .app-header { align-items: flex-start; gap: 10px; padding: 12px; border-radius: 18px; }
  .app-header-main { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
  .app-brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .app-brand-copy strong { font-size: 17px; }
  .app-brand-copy small { display: none; }
  .app-header-context { align-items: center; gap: 8px; }
  .app-header-divider { display: none; }
  .page-topbar { align-items: flex-start; flex-direction: column; }
  .hero-grid { grid-template-columns: 1fr; }
  .dashboard-header { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .task-list.compact { grid-template-columns: 1fr; }
  .shift-audit-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-audit-item.is-summary { grid-column: 1 / -1; }
  .invoice-action-grid { grid-template-columns: 1fr; }
  .driver-readiness-strip,
  .line-filter-strip,
  .master-health-strip,
  .requirements-health-strip,
  .work-code-link-strip,
  .work-code-check-strip { grid-template-columns: 1fr; }
  .work-code-preview-grid { grid-template-columns: 1fr; }
  .driver-form-checks,
  .master-form-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modern-zoom-control {
    width: 100%;
    justify-content: space-between;
  }
  .modern-zoom-control .zoom-select-form,
  .modern-zoom-control .zoom-select-form select {
    width: 100%;
  }
  .backup-summary-grid { grid-template-columns: 1fr; }
  .settings-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .settings-summary-meta {
    margin-left: 0;
  }
  .settings-summary::after {
    margin-left: auto;
  }
  .cta-grid { grid-template-columns: 1fr; }
  .dashboard-focus-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .driver-home-grid { grid-template-columns: 1fr; }
  .driver-app-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  .driver-app-nav a {
    min-height: 44px;
    padding: 0 4px;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .driver-public-shell .mobile-form > .actions {
    bottom: 8px;
    align-items: stretch;
  }
  .driver-public-shell .mobile-form > .actions button,
  .driver-public-shell .mobile-form > .actions a {
    flex: 1 1 100%;
    width: 100%;
  }
  .driver-kpi { grid-template-columns: 1fr; }
  .driver-primary-meta { grid-template-columns: 1fr; }
  .driver-mini-meta { grid-template-columns: 1fr; }
  .driver-account-grid { grid-template-columns: 1fr; }
  .driver-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-value { font-size: 22px; }
  .month-summary-grid { grid-template-columns: 1fr; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .month-index-table, .month-index-table tbody, .month-index-table tr, .month-index-table td { display: block; width: 100%; box-sizing: border-box; }
  .month-index-table thead { display: none; }
  .month-index-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .month-index-table tr:last-child {
    border-bottom: 0;
  }
  .month-index-table td {
    display: grid;
    grid-template-columns: minmax(84px, .42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: none;
    padding: 9px 14px;
  }
  .month-index-table td::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
  }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; box-sizing: border-box; }
  .data-table thead { display: none; }
  .data-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .data-table tr:last-child {
    border-bottom: 0;
  }
  .data-table td {
    display: grid;
    grid-template-columns: minmax(84px, .42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: none;
    padding: 9px 14px;
  }
  .data-table td::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
  }
  .data-table .empty-row {
    padding: 0;
  }
  .data-table .empty-row td {
    display: block;
  }
  .data-table .empty-row td::before {
    content: none;
  }
  .backup-table tbody {
    display: grid;
    gap: 8px;
  }
  .backup-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }
  .backup-table td {
    padding: 0;
    border-bottom: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }
  .backup-table td:first-child {
    grid-column: 1 / -1;
    color: var(--text);
    font-size: 13px;
    font-weight: 760;
  }
  .backup-table td:last-child {
    justify-self: end;
    white-space: nowrap;
  }
  .action-cluster { justify-content: flex-start; }
  .home-edit-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions a, .actions button, .actions form { width: 100%; box-sizing: border-box; }
  .actions a {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--control-height); padding: 0 var(--control-px);
    text-align: center; border: 1px solid var(--line); border-radius: var(--control-radius);
    background: #fff; text-decoration: none; color: var(--brand-strong);
  }
  .card { padding: 12px; border-radius: 10px; }
  .swatch-grid { grid-template-columns: 1fr; }
  .mobile-days { grid-template-columns: 1fr; }
  .day-card { padding: 12px; }
  .modern-design-b .invoice-action-card {
    min-height: 190px;
  }
}

/* Final modern invoice fit overrides */
.modern-invoice-card {
  grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(66px, .72fr));
}

.modern-invoice-card.header {
  grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(66px, .72fr));
}

.modern-status-cell {
  grid-column: 1 / 3;
}

.modern-approval-cell {
  grid-column: 3 / -1;
}

@media (max-width: 1120px) {
  .modern-invoice-card {
    grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(74px, auto));
  }
  .modern-invoice-card.header {
    display: none;
  }
  .modern-status-cell,
  .modern-approval-cell {
    grid-column: 1 / -1;
  }
}

/* Modern management screens and compact tooltips */
.modern-management-page {
  display: grid;
  gap: 16px;
}

.modern-management-page > * {
  min-width: 0;
}

.modern-page-worktop {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,254,250,.96), rgba(248,248,242,.88)),
    linear-gradient(135deg, rgba(45,81,72,.07), rgba(236,232,220,.54));
  box-shadow: var(--shadow-sm);
}

.driver-readiness-strip,
.line-filter-strip,
.master-health-strip,
.requirements-health-strip,
.work-code-link-strip,
.work-code-check-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.work-code-link-strip,
.work-code-check-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.driver-readiness-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.line-filter-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.requirements-health-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.driver-readiness-card,
.line-filter-card,
.master-health-card,
.requirements-health-card,
.work-code-link-card,
.work-code-check-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 254, 250, .82);
  color: inherit;
  text-decoration: none;
  scroll-margin-top: 86px;
}

.driver-readiness-card span,
.driver-readiness-card small,
.line-filter-card span,
.line-filter-card small,
.master-health-card span,
.master-health-card small,
.requirements-health-card span,
.requirements-health-card small,
.work-code-link-card span,
.work-code-link-card small,
.work-code-check-card span,
.work-code-check-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.driver-readiness-card strong,
.line-filter-card strong,
.master-health-card strong,
.requirements-health-card strong,
.work-code-link-card strong,
.work-code-check-card strong {
  color: var(--accent-strong);
  font-size: 21px;
  font-weight: 820;
  line-height: 1.05;
}

.driver-readiness-card.warn strong,
.line-filter-card.warn strong,
.master-health-card.warn strong,
.requirements-health-card.warn strong,
.work-code-check-card.warn strong {
  color: var(--warn-ink);
}

.driver-readiness-card.ok strong,
.line-filter-card.ok strong,
.master-health-card.ok strong,
.requirements-health-card.ok strong,
.work-code-check-card.ok strong {
  color: var(--success-ink);
}

.master-health-card.info strong,
.line-filter-card.active strong,
.requirements-health-card.info strong,
.work-code-check-card.info strong {
  color: var(--accent-strong);
}

.line-filter-card.active {
  border-color: var(--line-strong);
  background: rgba(232, 243, 239, .92);
  box-shadow: 0 12px 24px rgba(12, 56, 48, .08);
}

.work-code-usage-cell,
.work-code-linkage-cell {
  display: grid;
  gap: 3px;
  min-width: 120px;
}

.work-code-usage-cell strong,
.work-code-linkage-cell strong,
.work-code-linkage-cell a {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.work-code-linkage-cell a {
  text-decoration: none;
}

.work-code-linkage-cell.warn a {
  color: var(--warn-ink);
}

.work-code-usage-cell span,
.work-code-usage-cell small,
.work-code-linkage-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.35;
}

.work-code-usage-cell.muted strong {
  color: var(--muted);
}

.work-code-billing-preview {
  margin: 12px 0;
  padding: 14px;
}

.work-code-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.work-code-preview-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 250, .78);
}

.work-code-preview-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
}

.work-code-preview-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.work-code-invoice-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.invoice-code-summary .work-code-usage-cell {
  min-width: 150px;
}

.driver-form-checks,
.master-form-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.driver-form-check,
.master-form-check {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 254, 250, .82);
}

.driver-form-check span,
.driver-form-check small,
.master-form-check span,
.master-form-check small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.driver-form-check strong,
.master-form-check strong {
  color: var(--accent-strong);
  font-size: 19px;
  font-weight: 820;
  line-height: 1.05;
}

.driver-form-check.warn strong,
.master-form-check.warn strong {
  color: var(--warn-ink);
}

.driver-form-check.ok strong,
.master-form-check.ok strong {
  color: var(--success-ink);
}

.modern-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.modern-page-worktop h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 780;
}

.modern-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modern-page-actions form {
  margin: 0;
}

.modern-page-actions .modern-btn,
.modern-page-actions button.modern-btn,
.modern-page-actions a.modern-btn {
  min-width: 112px;
}

.modern-page-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-filter-bar {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,254,250,.9), rgba(247,244,237,.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 8px 22px rgba(24, 28, 25, .04);
}

.modern-panel > .table-filter-bar {
  margin-bottom: 12px;
}

.table-filter-bar label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.table-filter-bar label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.table-filter-bar input[type="search"] {
  min-height: var(--control-height);
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
}

.table-filter-bar button[data-table-filter-clear] {
  min-height: var(--control-height-compact);
  padding: 0 12px;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .74);
  color: var(--text);
  box-shadow: none;
}

.table-filter-bar strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.table-filter-bar.is-filtering {
  border-color: #bfc8c0;
  background:
    linear-gradient(180deg, rgba(255,254,250,.96), rgba(227,237,241,.52));
}

.table-filter-empty {
  margin: 0;
  padding: 24px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,254,250,.92), rgba(247,244,237,.72));
}

.modern-table-panel {
  padding: 0;
  overflow: auto;
  max-height: min(72vh, 720px);
  overscroll-behavior: contain;
}

.modern-table-panel > .data-table,
.modern-table-panel > .month-index-table,
.modern-table-panel table.data-table,
.modern-table-panel table.month-index-table {
  margin: 0;
  border-radius: 22px;
  box-shadow: none;
}

.modern-table-panel .table-shell {
  box-shadow: none;
  border: 0;
}

.modern-table-panel .data-table th,
.modern-table-panel .month-index-table th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.modern-table-panel .action-link {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9px;
}

#work-code-table {
  overflow: auto;
}

#work-code-table .table-shell {
  min-width: 1320px;
  overflow: visible;
}

#work-code-table .work-code-master-table {
  min-width: 1320px;
}

.work-code-master-table th:last-child,
.work-code-master-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  box-sizing: border-box;
  width: 82px;
  min-width: 82px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
  box-shadow: -10px 0 18px rgba(12, 56, 48, .08);
}

.work-code-master-table th:last-child {
  z-index: 5;
  background: linear-gradient(180deg, #f7fcfa 0%, #eef7f4 100%);
}

.modern-management-page .modern-page-stats .modern-stat {
  min-height: 82px;
  padding: 14px 16px;
  align-content: start;
  gap: 8px;
}

.modern-management-page .modern-page-stats .modern-stat strong {
  margin-top: 2px;
  font-size: 28px;
}

.modern-management-page .modern-page-stats .modern-stat small {
  margin-top: 0;
}

.request-grid-table .toggle-grid-btn {
  min-height: 34px;
  color: transparent;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid transparent;
  box-shadow: none;
}

.request-grid-table .toggle-grid-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 253, 248, 0.86);
  transform: none;
}

.request-grid-table .toggle-grid-btn.is-on {
  background: #fff4f1;
  border-color: #d8c2ba;
  color: #93483d;
  font-size: 15px;
  font-weight: 900;
}

.request-save-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.request-edit-page .request-grid-wrap {
  max-width: 100%;
}

.form-edit-page form {
  display: grid;
  gap: 14px;
}

.form-edit-page .form-section {
  border-radius: 18px;
  padding: 18px;
}

.form-edit-page .form-section h2 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--accent-strong);
}

.form-edit-page .section-grid {
  gap: 14px;
  align-items: start;
}

.form-edit-page .grid {
  grid-template-columns: minmax(128px, 0.34fr) minmax(0, 0.66fr);
  gap: 10px 14px;
}

.form-edit-page label {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.form-edit-page .section-copy {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.form-edit-page .actions {
  justify-content: flex-end;
  position: sticky;
  bottom: 12px;
  z-index: 20;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,254,250,.9), rgba(247,244,237,.78));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 14px 34px rgba(24, 28, 25, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.form-edit-page .actions button,
.form-edit-page .actions a {
  min-width: 112px;
}

.form-edit-page .modern-table-panel input {
  min-width: 96px;
}

.form-edit-page .notice-card {
  align-self: start;
}

.form-edit-page .exception-details {
  padding: 0;
  overflow: hidden;
}

.form-edit-page .exception-details summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.form-edit-page .exception-details summary::-webkit-details-marker {
  display: none;
}

.form-edit-page .exception-details summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  font-size: 18px;
  font-weight: 720;
  line-height: 1;
}

.form-edit-page .exception-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.form-edit-page .exception-details[open] summary::after {
  content: "-";
}

.form-edit-page .exception-details summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.form-edit-page .exception-details summary strong {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 820;
  line-height: 1.25;
}

.form-edit-page .exception-details summary small,
.form-edit-page .exception-details summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.35;
}

.form-edit-page .exception-details summary em {
  margin-left: auto;
  white-space: nowrap;
}

.form-edit-page .exception-details .exception-grid {
  padding: 18px;
}

.form-edit-page form > .small,
.form-edit-page .form-inline-note {
  margin: 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.result-page {
  max-width: 980px;
}

.result-worktop {
  min-height: 112px;
}

.result-panel {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 22px;
  scroll-margin-top: 24px;
}

.result-panel:focus,
.error-state-panel:focus {
  outline: none;
}

.result-panel[role="alert"] {
  border-color: rgba(132, 73, 58, .24);
}

.result-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--b-paper-soft, #f7f4ed);
  color: var(--b-charcoal, #222725);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.result-panel.warn .result-mark {
  color: var(--warn-ink);
  background: var(--warn-soft);
}

.result-mark.warn {
  color: var(--warn-ink);
  background: var(--warn-soft);
}

.result-mark.danger {
  color: var(--danger-ink);
  background: var(--danger-soft);
}

.result-panel.danger .result-mark {
  color: var(--danger-ink);
  background: var(--danger-soft);
}

.result-detail {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.result-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 10px;
  min-width: 0;
}

.result-file-card > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.result-file-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.4;
}

.result-file-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.result-file-card .result-file-folder strong {
  color: var(--muted);
  font-weight: 760;
}

.result-file-card .result-file-folder {
  grid-column: 1 / -1;
}

.copy-path-button {
  grid-column: 1 / -1;
  min-height: 36px;
  justify-self: start;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 780;
}

.copy-path-button:hover {
  background: rgba(247, 244, 237, .86);
  border-color: #aaa295;
  box-shadow: none;
  filter: none;
  transform: none;
}

.modern-design-b .result-mark {
  background: rgba(247, 244, 237, .82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
}

.modern-design-b .result-panel.warn .result-mark {
  color: var(--b-warn);
  background: #f6ecdc;
}

.modern-design-b .result-panel.danger .result-mark {
  color: var(--b-danger);
  background: #f8e8e3;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(118deg, transparent 0 10%, rgba(255,253,248,.56) 10% 24%, transparent 24% 100%),
    linear-gradient(140deg, transparent 0 58%, rgba(45,81,72,.05) 58% 70%, transparent 70% 100%),
    var(--b-paper-soft, #f4f1ea);
  color: var(--b-ink, #272b29);
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--b-ink, #272b29);
}

.auth-brand-row strong,
.auth-brand-row span {
  display: block;
}

.auth-brand-row span {
  margin-top: 2px;
  color: var(--b-muted, #6f766f);
  font-size: 12px;
  font-weight: 720;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--b-charcoal, #222725);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.auth-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--b-line, #ded8cc);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,254,250,.92), rgba(255,253,248,.78));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 18px 42px rgba(24, 28, 25, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-head {
  display: grid;
  gap: 6px;
}

.auth-head p {
  margin: 0;
  color: var(--b-faint, #9a9e96);
  font-size: 11px;
  font-weight: 820;
}

.auth-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.auth-head span {
  color: var(--b-muted, #6f766f);
  font-size: 13px;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  color: var(--b-muted, #6f766f);
  font-size: 12px;
  font-weight: 780;
}

.auth-form .actions {
  margin-top: 8px;
  align-items: stretch;
}

.auth-form .actions button,
.auth-form .actions a,
.auth-choice-actions button {
  width: 100%;
}

.error-state-page {
  padding: 24px;
}

.error-state-card {
  width: min(100%, 560px);
  display: grid;
  gap: 14px;
}

.error-state-panel {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(42, 48, 44, 0.12);
  border-radius: 24px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 24px 70px rgba(35, 39, 36, 0.12);
}

.error-state-copy {
  min-width: 0;
}

.error-state-copy p {
  margin: 0 0 7px;
  color: var(--b-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.error-state-copy h1 {
  margin: 0;
  color: var(--b-charcoal);
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.08;
}

.error-state-message {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--warn-line);
  border-radius: 14px;
  background: #fff8ea;
  color: var(--warn-ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.error-state-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.error-state-actions button,
.error-state-actions a {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--control-px);
  border: 1px solid var(--b-line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--b-charcoal);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.error-state-actions button {
  border-color: var(--b-charcoal);
  background: var(--b-charcoal);
  color: #fff;
}

.auth-choice-actions {
  display: grid;
  gap: 10px;
}

.modern-design-b .auth-choice-actions button {
  border-color: var(--b-line-strong);
  background: var(--b-paper);
  color: var(--b-ink);
  box-shadow: none;
}

.modern-design-b .auth-choice-actions button:last-child {
  border-color: var(--b-charcoal);
  background: var(--b-charcoal);
  color: #fff;
}

@media (max-width: 860px) {
  .form-edit-page .grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .form-edit-page .actions {
    bottom: 8px;
    align-items: stretch;
  }

  .form-edit-page .actions button,
  .form-edit-page .actions a {
    flex: 1 1 100%;
    width: 100%;
  }

  .result-panel {
    grid-template-columns: 1fr;
  }

  .result-file-card {
    grid-template-columns: 1fr;
  }

  .result-file-card .result-file-folder {
    grid-column: auto;
  }

  .error-state-panel {
    grid-template-columns: 1fr;
  }

  .error-state-actions {
    grid-template-columns: 1fr;
  }
}

.modern-side-nav a[data-tooltip],
.driver-app-nav a[data-tooltip],
.action-link[data-tooltip] {
  position: relative;
}

.modern-side-nav a[data-tooltip]::after,
.driver-app-nav a[data-tooltip]::after,
.action-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 9px 10px;
  border: 1px solid rgba(37, 55, 49, .12);
  border-radius: 10px;
  background: rgba(31, 43, 38, .94);
  color: #fff;
  box-shadow: 0 14px 28px rgba(20, 28, 24, .18);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.modern-side-nav a[data-tooltip]::after {
  left: calc(100% + 10px);
  top: 50%;
  width: 220px;
  transform: translate(-4px, -50%);
}

.driver-app-nav a[data-tooltip]::after {
  left: 50%;
  top: calc(100% + 9px);
  width: min(220px, 72vw);
  transform: translate(-50%, -5px);
}

.action-link[data-tooltip]::after {
  right: 0;
  top: calc(100% + 8px);
  width: min(230px, 70vw);
  transform: translateY(-5px);
}

.modern-side-nav a[data-tooltip]:hover::after,
.modern-side-nav a[data-tooltip]:focus-visible::after,
.driver-app-nav a[data-tooltip]:hover::after,
.driver-app-nav a[data-tooltip]:focus-visible::after,
.action-link[data-tooltip]:hover::after,
.action-link[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.modern-side-nav a[data-tooltip]:hover::after,
.modern-side-nav a[data-tooltip]:focus-visible::after {
  transform: translate(0, -50%);
}

.driver-app-nav a[data-tooltip]:hover::after,
.driver-app-nav a[data-tooltip]:focus-visible::after {
  transform: translate(-50%, 0);
}

.action-link[data-tooltip]:hover::after,
.action-link[data-tooltip]:focus-visible::after {
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .modern-page-worktop {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .modern-page-actions {
    justify-content: flex-start;
  }

  .modern-page-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .modern-page-worktop {
    padding: 16px;
    border-radius: 18px;
  }

  .modern-table-panel {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .modern-table-panel .data-table th,
  .modern-table-panel .month-index-table th {
    position: static;
  }

  .table-filter-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .table-filter-bar label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .table-filter-bar strong {
    justify-self: flex-start;
  }

  .table-filter-bar button[data-table-filter-clear] {
    width: 100%;
  }

  .modern-page-actions .modern-btn,
  .modern-page-actions button.modern-btn,
  .modern-page-actions a.modern-btn {
    width: 100%;
  }

  .modern-side-nav a[data-tooltip]::after {
    display: none;
  }

  .driver-app-nav a[data-tooltip]::after {
    display: none;
  }
}

/* Design B definitive layer: graphite, quiet controls, non-tag status marks */
.modern-design-b {
  --b-ink: #151716;
  --b-soft-ink: #303632;
  --b-muted: #686e68;
  --b-faint: #969b94;
  --b-paper: #fffdf8;
  --b-paper-soft: #f7f4ed;
  --b-panel: rgba(255,253,248,.92);
  --b-line: #ded8cc;
  --b-line-strong: #c7c0b2;
  --b-charcoal: #222725;
  --b-charcoal-hover: #111412;
  --b-sand: #ede5d6;
  --b-blue: #315f77;
  --b-blue-soft: #e3edf1;
  --b-success: #3e7053;
  --b-warn: #8a6334;
  --b-danger: #93483d;
  --b-shadow: 0 18px 42px rgba(24, 28, 25, .07);
  color: var(--b-ink);
}

.modern-design-b .modern-sidebar,
.modern-design-b .modern-panel,
.modern-design-b .modern-stat,
.modern-design-b .modern-action-card,
.modern-design-b .modern-table-panel,
.modern-design-b .card,
.modern-design-b .form-section,
.modern-design-b .legend-panel,
.modern-design-b .notice-card {
  background: var(--b-panel);
  border-color: var(--b-line);
  box-shadow: 0 8px 24px rgba(24, 28, 25, .045);
}

.modern-design-b .settings-summary {
  color: var(--b-ink);
}

.modern-design-b .settings-summary::after {
  border-color: var(--b-line);
  background: var(--b-charcoal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 28, 25, .08);
}

.modern-design-b .settings-disclosure[open] .settings-summary {
  border-color: var(--b-line);
}

.modern-design-b .settings-summary-copy strong {
  color: var(--b-ink);
}

.modern-design-b .settings-summary-copy small,
.modern-design-b .settings-summary-meta {
  color: var(--b-muted);
}

.modern-design-b .settings-summary-meta {
  background: var(--b-paper-soft);
  border-color: var(--b-line);
}

.modern-design-b .modern-brand-mark {
  background: var(--b-charcoal);
}

.modern-design-b .modern-side-nav a {
  color: var(--b-muted);
  border: 1px solid transparent;
  background: transparent;
}

.modern-design-b .modern-side-nav a.active,
.modern-design-b .modern-side-nav a[aria-current="page"] {
  color: var(--b-ink);
  background: var(--b-paper-soft);
  border-color: var(--b-line);
  box-shadow: none;
}

.modern-design-b .modern-side-nav a:hover {
  color: var(--b-ink);
  background: rgba(247,244,237,.72);
}

.modern-design-b .nav-dot {
  width: 7px;
  height: 7px;
  opacity: .34;
}

.modern-design-b .modern-side-nav a.active .nav-dot,
.modern-design-b .modern-side-nav a[aria-current="page"] .nav-dot {
  opacity: .9;
  background: var(--b-charcoal);
}

.modern-design-b .modern-side-foot {
  background: var(--b-paper-soft);
  border-color: var(--b-line);
}

.modern-design-b .modern-topline,
.modern-design-b .modern-topline-title span,
.modern-design-b .modern-eyebrow,
.modern-design-b .modern-stat span,
.modern-design-b .modern-stat small,
.modern-design-b .modern-action-copy span,
.modern-design-b .modern-section-head a,
.modern-design-b .modern-section-head span,
.modern-design-b .modern-label,
.modern-design-b .small {
  color: var(--b-muted);
}

.modern-design-b .modern-topline {
  min-height: 66px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--b-line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,254,250,.84), rgba(247,244,237,.64));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 8px 22px rgba(24, 28, 25, .045);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modern-design-b .modern-topline-title strong {
  color: var(--b-ink);
}

.modern-design-b .modern-topline-actions .modern-btn,
.modern-design-b .modern-topline-actions button.modern-btn,
.modern-design-b .modern-topline-actions a.modern-btn,
.modern-design-b .modern-hero-actions .modern-btn,
.modern-design-b .modern-hero-actions button.modern-btn,
.modern-design-b .modern-hero-actions a.modern-btn {
  min-width: 116px;
}

.modern-design-b .modern-hero,
.modern-design-b .modern-month-hero,
.modern-design-b .modern-invoice-hero,
.modern-design-b .modern-page-worktop {
  border-color: var(--b-line);
  background:
    linear-gradient(135deg, rgba(255,253,248,.96), rgba(247,244,237,.88)),
    linear-gradient(135deg, rgba(34,39,37,.055), rgba(237,229,214,.64));
  box-shadow: var(--b-shadow);
}

.modern-design-b .modern-hero::after,
.modern-design-b .modern-month-hero::after,
.modern-design-b .modern-invoice-hero::after {
  border-color: rgba(34,39,37,.055);
}

.modern-design-b .modern-kicker {
  color: var(--b-faint);
  font-size: 11px;
  font-weight: 780;
}

.modern-design-b .modern-panel.dark,
.modern-design-b .modern-money-panel,
.modern-design-b .modern-audit-panel {
  background:
    linear-gradient(150deg, #252a28 0%, #171a18 100%);
  color: #fff;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 18px 42px rgba(24, 28, 25, .13);
}

.modern-design-b .modern-btn,
.modern-design-b button.modern-btn,
.modern-design-b a.modern-btn,
.modern-design-b .action-link,
.modern-design-b .actions a,
.modern-design-b .status-stack form button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--b-line-strong);
  background: var(--b-paper);
  color: var(--b-ink);
  box-shadow: none;
  font-weight: 740;
  filter: none;
  transform: none;
}

.modern-design-b .modern-btn:hover,
.modern-design-b button.modern-btn:hover,
.modern-design-b a.modern-btn:hover,
.modern-design-b .action-link:hover,
.modern-design-b .actions a:hover {
  background: var(--b-paper-soft);
  border-color: #aaa295;
  box-shadow: none;
  filter: none;
  transform: none;
}

.modern-design-b .modern-btn.is-current,
.modern-design-b button.modern-btn.is-current,
.modern-design-b a.modern-btn.is-current {
  cursor: default;
  border-color: #a79d8c;
  background: rgba(248, 244, 236, .92);
  color: var(--b-charcoal);
}

.modern-design-b .modern-btn.primary,
.modern-design-b button.modern-btn.primary,
.modern-design-b a.modern-btn.primary,
.modern-design-b .actions button[type="submit"],
.modern-design-b button[form="month-form"],
.modern-design-b form[action="/month/apply"] button,
.modern-design-b form[action="/generate-invoices"] button,
.modern-design-b form[action="/generate-team-invoices"] button,
.modern-design-b form[action="/invoices/approval/save"] button {
  background: var(--b-charcoal);
  border-color: var(--b-charcoal);
  color: #fff;
  box-shadow: 0 10px 22px rgba(24, 28, 25, .12);
}

.modern-design-b .modern-btn.primary:hover,
.modern-design-b button.modern-btn.primary:hover,
.modern-design-b a.modern-btn.primary:hover,
.modern-design-b .actions button[type="submit"]:hover,
.modern-design-b button[form="month-form"]:hover,
.modern-design-b form[action="/month/apply"] button:hover,
.modern-design-b form[action="/generate-invoices"] button:hover,
.modern-design-b form[action="/generate-team-invoices"] button:hover,
.modern-design-b form[action="/invoices/approval/save"] button:hover {
  background: var(--b-charcoal-hover);
  border-color: var(--b-charcoal-hover);
  filter: none;
}

.modern-design-b .modern-btn.disabled,
.modern-design-b .modern-btn[aria-disabled="true"],
.modern-design-b button.modern-btn:disabled,
.modern-design-b a.modern-btn[aria-disabled="true"],
.modern-design-b .actions button[type="submit"]:disabled,
.modern-design-b form[action="/generate-invoices"] button:disabled,
.modern-design-b form[action="/generate-team-invoices"] button:disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: .58;
  background: rgba(247,244,237,.92);
  border-color: var(--b-line);
  color: var(--b-muted);
  box-shadow: none;
  filter: grayscale(.12);
}

.modern-design-b .modern-btn.danger,
.modern-design-b button.modern-btn.danger,
.modern-design-b form[action="/month/discard"] button,
.modern-design-b form[action="/home-layout/reset"] button {
  color: var(--b-danger);
  border-color: #d8c2ba;
  background: #fff8f5;
  box-shadow: none;
}

.modern-design-b .inline-ack-form button {
  background: #e7f1f7;
  border-color: #aac9d8;
  color: #1f5f80;
  box-shadow: none;
}

.modern-design-b .status-stack form button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--b-paper);
  border-color: var(--b-line);
  color: var(--b-soft-ink);
  box-shadow: none;
}

.modern-design-b .status-stack form button:hover {
  background: var(--b-paper-soft);
  border-color: var(--b-line-strong);
  filter: none;
}

.modern-design-b .status-pill,
.modern-design-b .list-status,
.modern-design-b .attention-flag {
  min-height: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--b-muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}

.modern-design-b .status-pill::before,
.modern-design-b .list-status::before,
.modern-design-b .attention-flag::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: .74;
}

.modern-design-b .status-pill.info,
.modern-design-b .list-status.info {
  color: var(--b-blue);
}

.modern-design-b .status-pill.success,
.modern-design-b .list-status.ok,
.modern-design-b .list-status.success {
  color: var(--b-success);
}

.modern-design-b .status-pill.warn,
.modern-design-b .list-status.warn,
.modern-design-b .attention-flag {
  color: var(--b-warn);
}

.modern-design-b .status-pill.danger,
.modern-design-b .list-status.danger {
  color: var(--b-danger);
}

.modern-design-b .modern-status-line {
  gap: 12px 16px;
}

.modern-design-b .shift-audit-item {
  border-color: var(--b-line);
  border-radius: 12px;
  background: rgba(255,253,248,.74);
}

.modern-design-b .shift-audit-item.is-summary {
  background: var(--b-paper-soft);
}

.modern-design-b .shift-audit-card .table-shell {
  max-height: 430px;
  overflow: auto;
}

.modern-design-b .shift-audit-card .data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.modern-design-b .shift-audit-details {
  border-color: var(--b-line);
}

.modern-design-b .shift-audit-details summary {
  color: var(--b-muted);
}

.modern-design-b .shift-audit-details summary::after {
  border-color: var(--b-line);
  background: var(--b-paper-soft);
  color: var(--b-charcoal);
}

.modern-design-b .shift-audit-details summary strong {
  color: var(--b-soft-ink);
}

.modern-design-b .worklist-tone {
  min-width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 780;
}

.modern-design-b .worklist-tone::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
}

.modern-design-b .worklist-tone.tone-danger {
  color: var(--b-danger);
}

.modern-design-b .worklist-tone.tone-warn {
  color: var(--b-warn);
}

.modern-design-b .modern-stat strong,
.modern-design-b .modern-count {
  color: var(--b-charcoal);
}

.modern-design-b .modern-count.warn {
  color: var(--b-warn);
}

.modern-design-b .modern-count.danger {
  color: var(--b-danger);
}

.modern-design-b .modern-action-card {
  background: var(--b-paper);
}

.modern-design-b .modern-action-card::before {
  background:
    linear-gradient(145deg, rgba(255,255,255,0) 0%, rgba(230,236,232,.66) 100%);
}

.modern-design-b .modern-action-visual {
  right: -30px;
  top: -24px;
  width: 150px;
  height: 150px;
  color: #2d5148;
  opacity: .13;
  transform: rotate(-8deg);
}

.modern-design-b .modern-action-card:hover .modern-action-visual {
  opacity: .21;
  transform: rotate(-4deg) scale(1.03);
}

.modern-design-b .modern-dashboard .modern-action-visual {
  width: 156px;
  height: 156px;
  opacity: .15;
}

.modern-design-b .modern-dashboard .modern-action-card:hover .modern-action-visual {
  opacity: .24;
}

.modern-design-b .modern-table-panel .data-table th,
.modern-design-b .modern-table-panel .month-index-table th,
.modern-design-b .modern-invoice-card.header,
.modern-design-b th {
  background: var(--b-paper-soft);
}

.modern-design-b .modern-invoice-card,
.modern-design-b .worklist-item,
.modern-design-b .invoice-action-card,
.modern-design-b .modern-approve-card,
.modern-design-b .approval-summary-card > div {
  border-color: var(--b-line);
  background: var(--b-paper);
  box-shadow: none;
}

.modern-design-b .modern-invoice-card:target {
  border-color: #8da8b3;
  background:
    linear-gradient(180deg, rgba(227,237,241,.74), rgba(247,244,237,.7));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.84),
    0 0 0 3px rgba(49,95,119,.12),
    0 12px 30px rgba(24, 28, 25, .06);
}

.modern-design-b .driver-readiness-card,
.modern-design-b .line-filter-card,
.modern-design-b .master-health-card,
.modern-design-b .requirements-health-card,
.modern-design-b .work-code-link-card,
.modern-design-b .work-code-check-card {
  border-color: var(--b-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.88), rgba(247,244,237,.62));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 8px 22px rgba(24, 28, 25, .04);
}

.modern-design-b .driver-readiness-card:hover,
.modern-design-b .line-filter-card:hover,
.modern-design-b .master-health-card:hover,
.modern-design-b .requirements-health-card:hover,
.modern-design-b .work-code-link-card:hover,
.modern-design-b .work-code-check-card:hover {
  border-color: #bdb5a6;
  background: rgba(247,244,237,.76);
}

.modern-design-b .driver-readiness-card span,
.modern-design-b .driver-readiness-card small,
.modern-design-b .line-filter-card span,
.modern-design-b .line-filter-card small,
.modern-design-b .master-health-card span,
.modern-design-b .master-health-card small,
.modern-design-b .requirements-health-card span,
.modern-design-b .requirements-health-card small,
.modern-design-b .work-code-link-card span,
.modern-design-b .work-code-link-card small,
.modern-design-b .work-code-check-card span,
.modern-design-b .work-code-check-card small {
  color: var(--b-muted);
}

.modern-design-b .driver-readiness-card strong,
.modern-design-b .line-filter-card strong,
.modern-design-b .master-health-card strong,
.modern-design-b .requirements-health-card strong,
.modern-design-b .work-code-link-card strong,
.modern-design-b .work-code-check-card strong {
  color: var(--b-charcoal);
}

.modern-design-b .driver-readiness-card.warn strong,
.modern-design-b .line-filter-card.warn strong,
.modern-design-b .master-health-card.warn strong,
.modern-design-b .requirements-health-card.warn strong,
.modern-design-b .work-code-check-card.warn strong {
  color: var(--b-warn);
}

.modern-design-b .driver-readiness-card.ok strong,
.modern-design-b .line-filter-card.ok strong,
.modern-design-b .master-health-card.ok strong,
.modern-design-b .requirements-health-card.ok strong,
.modern-design-b .work-code-check-card.ok strong {
  color: var(--b-success);
}

.modern-design-b .master-health-card.info strong,
.modern-design-b .line-filter-card.active strong,
.modern-design-b .requirements-health-card.info strong,
.modern-design-b .work-code-check-card.info strong {
  color: var(--b-blue);
}

.modern-design-b .driver-form-check,
.modern-design-b .master-form-check {
  border-color: var(--b-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.88), rgba(247,244,237,.62));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 8px 22px rgba(24, 28, 25, .04);
}

.modern-design-b .driver-form-check span,
.modern-design-b .driver-form-check small,
.modern-design-b .master-form-check span,
.modern-design-b .master-form-check small {
  color: var(--b-muted);
}

.modern-design-b .driver-form-check strong,
.modern-design-b .master-form-check strong {
  color: var(--b-charcoal);
}

.modern-design-b .driver-form-check.warn strong,
.modern-design-b .master-form-check.warn strong {
  color: var(--b-warn);
}

.modern-design-b .driver-form-check.ok strong,
.modern-design-b .master-form-check.ok strong {
  color: var(--b-success);
}

.modern-design-b .form-edit-page .exception-details summary {
  color: var(--b-ink);
}

.modern-design-b .form-edit-page .exception-details summary::after {
  border-color: var(--b-line);
  background: var(--b-paper-soft);
  color: var(--b-charcoal);
}

.modern-design-b .form-edit-page .exception-details[open] summary {
  border-color: var(--b-line);
}

.modern-design-b .form-edit-page .exception-details summary strong {
  color: var(--b-ink);
}

.modern-design-b .form-edit-page .exception-details summary small,
.modern-design-b .form-edit-page .exception-details summary em {
  color: var(--b-muted);
}

.modern-design-b .chip {
  border-radius: 999px;
  border-color: rgba(21,23,22,.2);
}

/* Design B polish: translucent depth without adding noise */
.koa-modern-shell.modern-design-b {
  position: relative;
  isolation: isolate;
}

.koa-modern-shell.modern-design-b::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 10%, rgba(255,253,248,.48) 10% 24%, transparent 24% 100%),
    linear-gradient(140deg, transparent 0 58%, rgba(45,81,72,.045) 58% 70%, transparent 70% 100%),
    linear-gradient(180deg, rgba(255,253,248,.18), rgba(255,253,248,0));
  z-index: 0;
}

.koa-modern-shell.modern-design-b > * {
  position: relative;
  z-index: 1;
}

.modern-design-b .modern-sidebar,
.modern-design-b .modern-panel,
.modern-design-b .modern-stat,
.modern-design-b .modern-action-card,
.modern-design-b .modern-table-panel,
.modern-design-b .card,
.modern-design-b .form-section,
.modern-design-b .legend-panel,
.modern-design-b .notice-card {
  background:
    linear-gradient(180deg, rgba(255,254,250,.9), rgba(255,253,248,.76));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 10px 30px rgba(24, 28, 25, .052);
}

.modern-design-b .modern-sidebar {
  background:
    linear-gradient(180deg, rgba(255,254,250,.88), rgba(247,244,237,.7));
}

.modern-design-b .modern-hero,
.modern-design-b .modern-month-hero,
.modern-design-b .modern-invoice-hero,
.modern-design-b .modern-page-worktop {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,253,248,.93), rgba(247,244,237,.8)),
    linear-gradient(120deg, rgba(255,255,255,.58), rgba(255,255,255,0) 46%),
    linear-gradient(135deg, rgba(34,39,37,.055), rgba(237,229,214,.62));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 18px 42px rgba(24, 28, 25, .068);
}

.modern-design-b .modern-hero::before,
.modern-design-b .modern-month-hero::before,
.modern-design-b .modern-invoice-hero::before,
.modern-design-b .modern-page-worktop::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 42%, rgba(255,255,255,.46) 42% 50%, transparent 50% 100%),
    linear-gradient(156deg, transparent 0 68%, rgba(45,81,72,.06) 68% 72%, transparent 72% 100%);
  opacity: .82;
  z-index: -1;
}

.modern-design-b .modern-hero > *,
.modern-design-b .modern-month-hero > *,
.modern-design-b .modern-invoice-hero > *,
.modern-design-b .modern-page-worktop > * {
  position: relative;
  z-index: 1;
}

.modern-design-b .modern-panel.dark,
.modern-design-b .modern-money-panel,
.modern-design-b .modern-audit-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(45,53,49,.96), rgba(20,24,22,.98)),
    linear-gradient(120deg, rgba(255,255,255,.12), rgba(255,255,255,0) 42%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 20px 46px rgba(24, 28, 25, .16);
}

.modern-design-b .modern-panel.dark::after,
.modern-design-b .modern-money-panel::after,
.modern-design-b .modern-audit-panel::after {
  content: "";
  position: absolute;
  right: -96px;
  top: -112px;
  width: 260px;
  height: 260px;
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.095), rgba(255,255,255,0) 62%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.055);
  transform: rotate(18deg);
  pointer-events: none;
}

.modern-design-b .modern-btn,
.modern-design-b button.modern-btn,
.modern-design-b a.modern-btn,
.modern-design-b .action-link,
.modern-design-b .actions a,
.modern-design-b .status-stack form button {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.76),
    0 1px 0 rgba(24, 28, 25, .04);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.modern-design-b .modern-btn.primary,
.modern-design-b button.modern-btn.primary,
.modern-design-b a.modern-btn.primary,
.modern-design-b .actions button[type="submit"],
.modern-design-b button[form="month-form"],
.modern-design-b form[action="/month/apply"] button,
.modern-design-b form[action="/generate-invoices"] button,
.modern-design-b form[action="/generate-team-invoices"] button,
.modern-design-b form[action="/invoices/approval/save"] button {
  background:
    linear-gradient(180deg, #29302d 0%, var(--b-charcoal) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 12px 26px rgba(24, 28, 25, .14);
}

.modern-design-b .modern-btn:hover,
.modern-design-b button.modern-btn:hover,
.modern-design-b a.modern-btn:hover,
.modern-design-b .action-link:hover,
.modern-design-b .actions a:hover {
  transform: translateY(-1px);
}

.modern-design-b input:focus-visible,
.modern-design-b select:focus-visible,
.modern-design-b textarea:focus-visible,
.modern-design-b button:focus-visible,
.modern-design-b a:focus-visible {
  outline: 3px solid rgba(49, 95, 119, .24);
  outline-offset: 2px;
}

.modern-design-b .modern-action-card:hover,
.modern-design-b .worklist-item:hover,
.modern-design-b .modern-invoice-card:hover,
.modern-design-b .invoice-action-card:hover {
  border-color: #bdb5a6;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    0 14px 34px rgba(24, 28, 25, .065);
}

.modern-design-b .modern-table-panel .data-table tbody tr:nth-child(even) td,
.modern-design-b .modern-table-panel .month-index-table tbody tr:nth-child(even) td {
  background: rgba(247,244,237,.34);
}

.modern-design-b .modern-table-panel .data-table tbody tr:hover td,
.modern-design-b .modern-table-panel .month-index-table tbody tr:hover td {
  background: rgba(227,237,241,.38);
}

.modern-design-b .modern-invoice-card.header {
  background:
    linear-gradient(180deg, rgba(247,244,237,.96), rgba(239,234,224,.84));
}

.modern-design-b .modern-side-foot {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.modern-design-b .legend-panel.compact-legend,
.modern-design-b .public-shift-page .legend-panel.compact-legend {
  padding: 0;
}

.modern-design-b .compact-legend summary {
  color: var(--b-soft-ink);
}

.modern-design-b .compact-legend summary::after {
  border-color: var(--b-line);
  background: rgba(255,253,248,.62);
  color: var(--b-muted);
}

.modern-design-b .compact-legend .legend span {
  color: var(--b-muted);
}

.modern-design-b .modern-board-card .toolbar {
  padding: 10px;
  border: 1px solid var(--b-line);
  border-radius: 14px;
  background: rgba(247,244,237,.54);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.modern-design-b .board-toolbar-title strong {
  color: var(--b-ink);
}

.modern-design-b .board-toolbar-title span,
.modern-design-b .modern-zoom-control > span {
  color: var(--b-muted);
}

.modern-design-b .modern-zoom-control .zoom-select-form select {
  border-color: var(--b-line);
  background: rgba(255,253,248,.86);
  color: var(--b-soft-ink);
}

/* Screen-specific hero watermarks */
.modern-design-b .modern-hero::after,
.modern-design-b .modern-month-hero::after,
.modern-design-b .modern-invoice-hero::after {
  border: 0;
  z-index: -1;
  pointer-events: none;
}

.modern-design-b .modern-hero::after {
  right: -54px;
  bottom: -84px;
  width: 360px;
  height: 250px;
  border-radius: 38px;
  background:
    radial-gradient(circle at 22% 34%, rgba(45,81,72,.13) 0 15px, transparent 16px),
    radial-gradient(circle at 52% 54%, rgba(45,81,72,.105) 0 19px, transparent 20px),
    radial-gradient(circle at 80% 30%, rgba(45,81,72,.11) 0 14px, transparent 15px),
    linear-gradient(21deg, transparent 0 34%, rgba(45,81,72,.065) 34% 37%, transparent 37% 100%),
    linear-gradient(-20deg, transparent 0 48%, rgba(45,81,72,.055) 48% 51%, transparent 51% 100%),
    linear-gradient(140deg, rgba(45,81,72,.045), rgba(255,255,255,0) 62%);
  transform: rotate(-9deg);
  opacity: .92;
}

.modern-design-b .modern-month-hero::after {
  right: -48px;
  bottom: -74px;
  width: 330px;
  height: 245px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(45,81,72,.115) 0 42px, transparent 42px 100%),
    repeating-linear-gradient(90deg, transparent 0 51px, rgba(45,81,72,.06) 51px 54px),
    repeating-linear-gradient(0deg, transparent 0 40px, rgba(45,81,72,.055) 40px 43px),
    linear-gradient(135deg, rgba(45,81,72,.052), rgba(255,253,248,.08));
  box-shadow:
    inset 0 0 0 2px rgba(45,81,72,.075),
    inset 0 42px 0 rgba(255,255,255,.18);
  transform: rotate(-7deg);
  opacity: .9;
}

.modern-design-b .modern-invoice-hero::after {
  right: -28px;
  bottom: -122px;
  width: 250px;
  height: 318px;
  border-radius: 24px 24px 10px 10px;
  background:
    linear-gradient(180deg, rgba(45,81,72,.11) 0 38px, transparent 38px 100%),
    linear-gradient(90deg, rgba(45,81,72,.09) 24px, transparent 24px 100%) 0 74px / 100% 12px no-repeat,
    linear-gradient(90deg, rgba(45,81,72,.075) 24px, transparent 24px 100%) 0 116px / 78% 12px no-repeat,
    linear-gradient(90deg, rgba(45,81,72,.075) 24px, transparent 24px 100%) 0 158px / 86% 12px no-repeat,
    linear-gradient(90deg, rgba(45,81,72,.105) 24px, transparent 24px 100%) 0 220px / 64% 13px no-repeat,
    linear-gradient(135deg, rgba(45,81,72,.048), rgba(255,253,248,.1));
  box-shadow: inset 0 0 0 2px rgba(45,81,72,.07);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 100%, 84% 88%, 76% 100%, 68% 88%, 60% 100%, 52% 88%, 44% 100%, 36% 88%, 28% 100%, 20% 88%, 12% 100%, 4% 88%, 0 100%);
  transform: rotate(-8deg);
  opacity: .9;
}

.modern-design-b .invoice-approval-form button {
  min-height: var(--control-height-compact);
  background: var(--b-paper);
  border-color: var(--b-line-strong);
  color: var(--b-ink);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 1px 0 rgba(24, 28, 25, .04);
}

.modern-design-b .invoice-approval-form button:hover {
  background: var(--b-paper-soft);
  border-color: #aaa295;
  color: var(--b-ink);
  filter: none;
}

.modern-design-b .invoice-history-strip > div {
  border-color: var(--b-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.82), rgba(247,244,237,.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.modern-design-b .invoice-history-strip span {
  color: var(--b-muted);
}

.modern-design-b .invoice-history-strip strong {
  color: var(--b-ink);
}

.modern-design-b .approval-summary-card > div {
  background:
    linear-gradient(180deg, rgba(255,253,248,.86), rgba(247,244,237,.62));
}

.modern-design-b .approval-summary-card span,
.modern-design-b .approval-task-label,
.modern-design-b .approval-task-meta span {
  color: var(--b-muted);
}

.modern-design-b .approval-summary-card strong,
.modern-design-b .modern-approve-card strong {
  color: var(--b-ink);
}

.modern-design-b .modern-approve-card:hover {
  border-color: #bdb5a6;
  background: rgba(247,244,237,.76);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    0 12px 28px rgba(24, 28, 25, .055);
}

.modern-design-b .modern-check-row:hover {
  background: rgba(247,244,237,.72);
  border-color: transparent;
}

.modern-design-b .modern-money-link:hover {
  background: rgba(255,255,255,.075);
}

.modern-design-b .invoice-action-card {
  position: relative;
  overflow: hidden;
  min-height: 238px;
  padding: 16px;
  border-color: var(--b-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.94), rgba(247,244,237,.7));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.76),
    0 10px 24px rgba(24, 28, 25, .045);
}

.modern-design-b .invoice-action-card > * {
  position: relative;
  z-index: 1;
}

.modern-design-b .invoice-action-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -22px;
  width: 128px;
  height: 128px;
  border-radius: 24px;
  opacity: .5;
  pointer-events: none;
  transform: rotate(-9deg);
}

.modern-design-b .invoice-action-month::after {
  background:
    linear-gradient(180deg, rgba(34,39,37,.1) 0 24px, transparent 24px 100%),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(34,39,37,.07) 31px 33px),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(34,39,37,.06) 28px 30px);
  box-shadow: inset 0 0 0 1px rgba(34,39,37,.08);
}

.modern-design-b .invoice-action-driver::after {
  border-radius: 20px 20px 8px 8px;
  background:
    linear-gradient(180deg, rgba(34,39,37,.1) 0 20px, transparent 20px 100%),
    linear-gradient(90deg, rgba(34,39,37,.085) 14px, transparent 14px 100%) 0 42px / 94px 10px no-repeat,
    linear-gradient(90deg, rgba(34,39,37,.07) 14px, transparent 14px 100%) 0 72px / 82px 10px no-repeat,
    linear-gradient(90deg, rgba(34,39,37,.07) 14px, transparent 14px 100%) 0 102px / 68px 10px no-repeat;
  box-shadow: inset 0 0 0 1px rgba(34,39,37,.08);
}

.modern-design-b .invoice-action-team::after {
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 34%, rgba(34,39,37,.13) 0 15px, transparent 16px),
    radial-gradient(circle at 66% 34%, rgba(34,39,37,.12) 0 15px, transparent 16px),
    radial-gradient(circle at 50% 67%, rgba(34,39,37,.11) 0 18px, transparent 19px),
    linear-gradient(135deg, rgba(34,39,37,.055), transparent 70%);
}

.modern-design-b .invoice-action-card strong {
  color: var(--b-ink);
  font-size: 15px;
}

.modern-design-b .invoice-action-card label {
  color: var(--b-muted);
  font-size: 12px;
  font-weight: 800;
}

/* Driver portal: align with the quieter B-design language */
.driver-public-shell.modern-design-b {
  --driver-panel: rgba(255,253,248,.9);
  --driver-panel-soft: rgba(247,244,237,.86);
  --driver-line: var(--b-line, #ded8cc);
  --driver-line-strong: var(--b-line-strong, #c7c0b2);
  --driver-ink: var(--b-ink, #151716);
  --driver-muted: var(--b-muted, #686e68);
  --driver-charcoal: var(--b-charcoal, #222725);
}

.driver-public-shell.modern-design-b .driver-hero,
.driver-public-shell.modern-design-b .driver-section-card,
.driver-public-shell.modern-design-b .notice-card,
.driver-public-shell.modern-design-b .status-card,
.driver-public-shell.modern-design-b .driver-list-row,
.driver-public-shell.modern-design-b .driver-account-grid .driver-info-tile {
  border-color: var(--driver-line);
  background: var(--driver-panel);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.74),
    0 14px 34px rgba(24, 28, 25, .055);
}

.driver-public-shell.modern-design-b .driver-hero {
  position: relative;
  overflow: hidden;
}

.driver-public-shell.modern-design-b .driver-hero::after {
  content: "";
  position: absolute;
  right: -64px;
  bottom: -92px;
  width: 286px;
  height: 205px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(34,39,37,.075) 0 34px, transparent 34px 100%),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(34,39,37,.038) 44px 47px),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(34,39,37,.036) 34px 37px),
    linear-gradient(135deg, rgba(34,39,37,.035), rgba(255,253,248,0) 62%);
  box-shadow: inset 0 0 0 1px rgba(34,39,37,.055);
  transform: rotate(-8deg);
  pointer-events: none;
}

.driver-public-shell.modern-design-b .driver-hero-top,
.driver-public-shell.modern-design-b .driver-hero .dashboard-brand,
.driver-public-shell.modern-design-b .driver-hero-title,
.driver-public-shell.modern-design-b .driver-hero .small,
.driver-public-shell.modern-design-b .driver-summary-line {
  position: relative;
  z-index: 1;
}

.driver-public-shell.modern-design-b .driver-hero-title,
.driver-public-shell.modern-design-b .driver-section-card h2,
.driver-public-shell.modern-design-b .driver-list-row strong,
.driver-public-shell.modern-design-b .driver-account-grid .driver-info-tile strong,
.driver-public-shell.modern-design-b .driver-count-badge strong,
.driver-public-shell.modern-design-b .driver-schedule-copy strong,
.driver-public-shell.modern-design-b .driver-date-badge strong {
  color: var(--driver-ink);
}

.driver-public-shell.modern-design-b .driver-hero .small,
.driver-public-shell.modern-design-b .driver-summary-line,
.driver-public-shell.modern-design-b .driver-section-sub,
.driver-public-shell.modern-design-b .driver-mini-meta span,
.driver-public-shell.modern-design-b .driver-request-live span,
.driver-public-shell.modern-design-b .driver-request-live small,
.driver-public-shell.modern-design-b .driver-count-badge span,
.driver-public-shell.modern-design-b .driver-count-badge small,
.driver-public-shell.modern-design-b .driver-schedule-copy span,
.driver-public-shell.modern-design-b .driver-date-badge span {
  color: var(--driver-muted);
}

.driver-public-shell.modern-design-b .driver-app-nav a {
  border-color: var(--driver-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.96), rgba(247,244,237,.82));
  color: var(--driver-ink);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 8px 18px rgba(24, 28, 25, .045);
}

.driver-public-shell.modern-design-b .driver-app-nav a.active,
.driver-public-shell.modern-design-b .driver-app-nav a[aria-current="page"] {
  border-color: var(--driver-charcoal);
  background:
    linear-gradient(180deg, #29302d 0%, var(--driver-charcoal) 100%);
  color: #fff;
}

.driver-public-shell.modern-design-b .driver-request-live,
.driver-public-shell.modern-design-b .driver-secondary-tool {
  border-color: var(--driver-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.96), rgba(247,244,237,.78));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.74),
    0 8px 18px rgba(24, 28, 25, .04);
}

.driver-public-shell.modern-design-b .driver-request-live strong,
.driver-public-shell.modern-design-b .driver-secondary-tool {
  color: var(--driver-ink);
}

.driver-public-shell.modern-design-b .driver-section-card.featured {
  background:
    linear-gradient(180deg, rgba(255,253,248,.96), rgba(247,244,237,.86));
  border-color: var(--driver-line-strong);
}

.driver-public-shell.modern-design-b .driver-primary-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(34,39,37,.74);
  background:
    linear-gradient(135deg, #303632 0%, #222725 58%, #191d1b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    0 22px 46px rgba(24, 28, 25, .16);
}

.driver-public-shell.modern-design-b .driver-primary-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -70px;
  width: 238px;
  height: 238px;
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.11) 16px, transparent 16px 100%) 28px 46px / 130px 12px no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.09) 16px, transparent 16px 100%) 28px 88px / 178px 12px no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.08) 16px, transparent 16px 100%) 28px 130px / 148px 12px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.12) 0 30px, transparent 30px 100%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,0) 64%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  transform: rotate(-10deg);
  opacity: .76;
  pointer-events: none;
}

.driver-public-shell.modern-design-b .driver-primary-card > * {
  position: relative;
  z-index: 1;
}

.driver-public-shell.modern-design-b .driver-primary-actions a {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.095);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.driver-public-shell.modern-design-b .driver-primary-actions a.primary {
  border-color: rgba(255,253,248,.92);
  background: rgba(255,253,248,.96);
}

.driver-public-shell.modern-design-b .driver-primary-actions .driver-action-mark {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.18);
}

.driver-public-shell.modern-design-b .driver-primary-actions a.primary .driver-action-mark {
  color: var(--driver-charcoal);
  background: rgba(34,39,37,.065);
  border-color: rgba(34,39,37,.12);
}

.driver-public-shell.modern-design-b .driver-action-mark::before,
.driver-public-shell.modern-design-b .driver-action-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.driver-public-shell.modern-design-b .driver-action-link.schedule .driver-action-mark::before {
  width: 15px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.driver-public-shell.modern-design-b .driver-action-link.schedule .driver-action-mark::after {
  width: 15px;
  height: 2px;
  margin-top: -4px;
  background: currentColor;
  opacity: .72;
}

.driver-public-shell.modern-design-b .driver-action-link.request .driver-action-mark::before {
  width: 15px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -62%) rotate(-45deg);
}

.driver-public-shell.modern-design-b .driver-action-link.advance .driver-action-mark::before {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.driver-public-shell.modern-design-b .driver-action-link.advance .driver-action-mark::after {
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.driver-public-shell.modern-design-b .driver-action-link.special .driver-action-mark::before {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.driver-public-shell.modern-design-b .driver-action-link.special .driver-action-mark::after {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.driver-public-shell.modern-design-b .driver-primary-meta .meta-block,
.driver-public-shell.modern-design-b .driver-mini-meta .meta-block,
.driver-public-shell.modern-design-b .driver-count-badge,
.driver-public-shell.modern-design-b .driver-date-badge {
  border-color: rgba(34,39,37,.1);
  background: rgba(255,253,248,.66);
}

.driver-public-shell.modern-design-b .notice-card.warn {
  background: #fff8ea;
}

.driver-public-shell.modern-design-b .notice-card.danger {
  background: #fff1ef;
}

.driver-public-shell.modern-design-b .notice-card.info {
  background: #f3f6f4;
}

.driver-public-shell.modern-design-b .driver-check-item {
  border-color: var(--driver-line);
  background:
    linear-gradient(180deg, rgba(255,253,248,.88), rgba(247,244,237,.62));
}

.driver-public-shell.modern-design-b .driver-check-item strong {
  color: var(--driver-ink);
}

.driver-public-shell.modern-design-b .driver-check-item span {
  color: var(--driver-muted);
}

.driver-public-shell.modern-design-b .driver-check-item.info::before {
  background: var(--b-blue);
}

.driver-public-shell.modern-design-b .driver-check-item.warn::before {
  background: var(--b-warn);
}

.driver-public-shell.modern-design-b .driver-check-item.danger::before {
  background: var(--b-danger);
}

.driver-public-shell.modern-design-b .driver-kpi-card:hover {
  border-color: var(--driver-line-strong);
  background:
    linear-gradient(180deg, rgba(255,253,248,.96), rgba(247,244,237,.74));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 14px 30px rgba(24, 28, 25, .07);
}

@media (max-width: 980px) {
  .invoice-flow-layout,
  .invoice-flow-progress,
  .invoice-flow-total-grid,
  .invoice-flow-action-row {
    grid-template-columns: 1fr;
  }

  .invoice-flow-side {
    position: static;
    max-height: none;
  }

  .invoice-adjustment-row {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-adjustment-head {
    display: none;
  }
}

@media (max-width: 720px) {
  .public-shift-intro {
    grid-template-columns: 1fr;
  }
  .public-shift-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .public-summary-card {
    min-height: 62px;
    padding: 10px;
  }
  .driver-section-head {
    align-items: stretch;
  }
  .driver-count-badge {
    min-width: 92px;
  }
  .driver-schedule-grid,
  .request-day-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .driver-request-control-strip {
    grid-template-columns: 1fr;
  }
  .driver-schedule-card,
  .request-day-card {
    min-height: 66px;
  }
}

@media (max-width: 380px) {
  .koa-modern-shell {
    width: calc(100% - 20px);
  }

  .modern-sidebar,
  .modern-panel,
  .modern-hero,
  .modern-month-hero,
  .modern-invoice-hero {
    padding: 16px;
  }

  .modern-hero h1,
  .modern-month-hero h1,
  .modern-invoice-hero h1 {
    font-size: 32px;
    line-height: 1.1;
  }

  .modern-topline-actions {
    align-items: stretch;
  }

  .modern-topline-actions .modern-btn,
  .modern-topline-actions form {
    flex: 1 1 100%;
    width: 100%;
  }

  .modern-topline-actions form button {
    width: 100%;
  }

  .modern-design-b .modern-hero::after,
  .modern-design-b .modern-month-hero::after,
  .modern-design-b .modern-invoice-hero::after,
  .modern-design-b .modern-panel.dark::after,
  .modern-design-b .modern-money-panel::after,
  .modern-design-b .modern-audit-panel::after {
    display: none;
  }

  .modern-action-card {
    min-height: 112px;
    padding: 16px;
  }

  .modern-action-visual,
  .modern-design-b .modern-action-visual,
  .modern-design-b .modern-dashboard .modern-action-visual {
    right: 8px;
    top: 8px;
    width: 96px;
    height: 96px;
  }

  .modern-action-copy {
    max-width: 68%;
  }

  .notice-card .small {
    overflow-wrap: anywhere;
  }

  .modern-invoice-list,
  .modern-invoice-layout,
  .modern-invoice-page {
    min-width: 0;
  }

  .modern-invoice-card,
  .modern-invoice-card.header {
    grid-template-columns: 1fr !important;
    width: 100%;
    min-width: 0;
  }

  .modern-invoice-card > * {
    min-width: 0;
  }

  .modern-status-cell,
  .modern-approval-cell {
    grid-column: 1 / -1;
  }

  .modern-approval-cell .invoice-approval-form {
    grid-template-columns: 1fr;
  }

  .modern-money-row,
  .modern-audit-row {
    min-width: 0;
  }
}

body.has-dirty-form button[form="month-form"],
body.has-dirty-form #month-form > .actions button[type="submit"],
body.has-dirty-form .modern-design-b button[form="month-form"],
body.has-dirty-form .modern-design-b #month-form > .actions button[type="submit"],
body.has-dirty-form .modern-design-b form[data-dirty-watch="1"].is-dirty .actions button[type="submit"],
body.has-dirty-form .modern-design-b .form-edit-page .modern-page-actions button[type="submit"],
body.has-dirty-form .modern-design-b .invoice-approval-form.is-dirty button[type="submit"],
body.has-dirty-form .driver-public-shell form[data-dirty-watch="1"].is-dirty .actions button[type="submit"] {
  border-color: rgba(20, 105, 91, 0.62);
  box-shadow:
    0 0 0 3px rgba(20, 105, 91, 0.13),
    0 12px 26px rgba(24, 28, 25, 0.13);
}

/* --- Read-only shift, site detail, and work points --- */
.readonly-shift-page .modern-worktop,
.shift-day-page .modern-worktop,
.work-points-page .modern-worktop {
  overflow: hidden;
}

.readonly-shift-wrap {
  border-radius: 18px;
  border: 1px solid rgba(36, 48, 61, 0.12);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 50px rgba(25, 34, 45, 0.08);
}

.readonly-day-link {
  color: inherit;
  text-decoration: none;
}

.readonly-day-link:hover {
  background: rgba(40, 100, 165, 0.08);
}

.day-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.day-summary-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 18px;
  border: 1px solid rgba(32, 44, 56, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(24, 33, 44, 0.08);
}

.day-summary-card::after,
.site-detail-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.day-summary-card span,
.site-detail-head span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.day-summary-card h3,
.site-detail-head h2 {
  margin: 0;
  font-size: 1.32rem;
}

.day-summary-card p {
  margin: 14px 0 10px;
  font-weight: 700;
  line-height: 1.7;
}

.site-detail-preview {
  max-height: 4.8em;
  overflow: hidden;
}

.site-detail-card {
  position: relative;
  overflow: hidden;
}

.site-detail-head strong {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.site-detail-body {
  position: relative;
  z-index: 1;
  margin: 18px 0;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  line-height: 1.9;
  white-space: normal;
}

.site-detail-coworkers {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(20, 30, 40, 0.06);
}

.site-detail-coworkers p {
  margin: 6px 0 0;
}

.site-detail-edit-block {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.site-detail-edit-block textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.driver-checkbox-control {
  min-height: 40px;
  align-items: center;
}

.work-point-month-form {
  max-width: 520px;
  margin-bottom: 16px;
}

.work-point-editor .alert {
  margin: 0 0 14px;
}

.work-point-driver-list {
  display: grid;
  gap: 10px;
}

.work-point-driver-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 110px minmax(220px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(32, 44, 56, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.work-point-transfer {
  display: grid;
  grid-template-columns: minmax(90px, 0.75fr) minmax(130px, 1fr);
  gap: 8px;
}

.work-point-base {
  display: grid;
  gap: 3px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(32, 44, 56, 0.1);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
}

.work-point-base span,
.work-point-transfer span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.work-point-base strong {
  color: var(--text);
  font-size: 1.05rem;
}

.work-point-base small {
  color: var(--muted);
  font-size: 0.78rem;
}

.work-point-transfer span {
  grid-column: 1 / -1;
}

.work-point-transfer input,
.work-point-transfer select {
  min-height: 42px;
}

.work-point-driver-row strong,
.work-point-driver-row span {
  display: block;
}

.work-point-driver-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 720px) {
  .work-point-driver-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .skip-link,
  .modern-sidebar,
  .modern-topline,
  .modern-shift-top,
  .modern-stats,
  .shift-worklist-card,
  .shift-audit-card,
  .legend,
  .day-detail-panel,
  .month-board-card > .toolbar,
  .month-board-card::before,
  #month-form > .actions,
  .confirm-modal-backdrop,
  .modern-side-foot {
    display: none !important;
  }

  .print-only {
    display: flex !important;
  }

  .koa-modern-shell,
  .modern-main,
  .modern-dashboard,
  .modern-management-page,
  .modern-panel,
  .month-board-card,
  .focus-shell,
  .focus-board {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .focus-toolbar {
    display: none !important;
  }

  .shift-wrap,
  .focus-zoom {
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    zoom: 1 !important;
  }

  .month-table,
  .shift-table.month-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: 5.8px !important;
    line-height: 1.05 !important;
  }

  .month-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .month-table th,
  .month-table td {
    position: static !important;
    z-index: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 11px !important;
    padding: 0 !important;
    border: 1px solid #8f9792 !important;
    box-shadow: none !important;
  }

  .month-table .meta {
    width: 18px !important;
  }

  .month-table .meta2 {
    width: 48px !important;
  }

  .month-table .headcell,
  .month-table .summary-row th .headcell {
    min-height: 0 !important;
    padding: 1px !important;
    border-radius: 0 !important;
    font-size: 5.8px !important;
    line-height: 1.05 !important;
    color: #111 !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  .month-table .sticky-row .headcell .small {
    margin-top: 0 !important;
    font-size: 5px !important;
    color: #333 !important;
  }

  .month-table .name-col,
  .month-table .name-col.is-long {
    font-size: 5.8px !important;
    letter-spacing: 0 !important;
  }

  .shift-cell {
    padding: 0 !important;
  }

  .shift-input {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: 11px !important;
    min-height: 11px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #111 !important;
    font-size: 5.8px !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  .month-table .team-color-cell {
    box-shadow: inset 3px 0 0 var(--team-color, transparent) !important;
  }

  .shift-cell.preview-changed {
    outline: 1px solid #9d6500 !important;
    outline-offset: -1px !important;
    box-shadow: none !important;
  }
}

@media (max-width: 760px) {
  .invoice-preview-page {
    padding: 12px;
  }

  .invoice-preview-toolbar {
    position: static;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .invoice-preview-toolbar .modern-btn {
    flex: 1 1 150px;
    justify-content: center;
  }

  .invoice-preview-sheet {
    padding: 22px;
    border-radius: 10px;
  }

  .invoice-preview-header,
  .invoice-preview-total-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .invoice-preview-status {
    align-items: flex-start;
  }

  .invoice-preview-flags {
    justify-content: flex-start;
  }

  .invoice-preview-meta {
    grid-template-columns: 1fr;
  }

  .invoice-preview-meta div {
    grid-template-columns: 82px 1fr;
  }

  .invoice-preview-header h1 {
    font-size: 28px;
  }

  .invoice-preview-total-band strong {
    font-size: 28px;
  }
}

@media print {
  .invoice-preview-page {
    min-height: auto;
    padding: 0 !important;
    background: #fff !important;
  }

  .invoice-preview-toolbar,
  .confirm-modal-backdrop {
    display: none !important;
  }

  .invoice-preview-sheet {
    width: 100% !important;
    margin: 0 !important;
    padding: 18mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .invoice-preview-table-wrap {
    overflow: visible !important;
  }

  .invoice-preview-table {
    min-width: 0 !important;
  }

  .invoice-preview-section,
  .invoice-preview-summary {
    break-inside: avoid;
  }
}
