:root {
  --palette-accent: #23752c;
  --ct-forest-950: #032d20;
  --ct-forest-900: #063c29;
  --ct-forest-800: #0a5035;
  --ct-green-700: #23752c;
  --ct-green-800: #185c27;
  --ct-green-600: #2f8f35;
  --ct-green-500: #58a92d;
  --ct-green-050: #f0f7eb;
  --ct-lime-400: #8dc63f;
  --ct-gold-500: #f1b426;
  --ct-gold-100: #fff5d7;
  --ct-ink-950: #10251d;
  --ct-ink-800: #203b31;
  --ct-ink-600: #5c7067;
  --ct-ink-500: #73867d;
  --ct-canvas: #f3f6f3;
  --ct-surface: #ffffff;
  --ct-line: #dce6df;
  --ct-line-soft: #eaf0ec;
  --ct-danger: #b83a3a;
  --ct-sidebar-width: 284px;
  --ct-radius-sm: 10px;
  --ct-radius-md: 16px;
  --ct-radius-lg: 24px;
  --ct-shadow-sm: 0 8px 24px rgba(16, 47, 35, .06);
  --ct-shadow-md: 0 18px 48px rgba(11, 48, 34, .10);
}

html[data-accent="blue"] { --ct-forest-950:#092632; --ct-forest-900:#0d394a; --ct-forest-800:#165268; --ct-green-700:#167190; --ct-green-600:#218bad; --ct-green-500:#43a4bf; --ct-lime-400:#79c6d8; --palette-accent:#167190; }
html[data-accent="plum"] { --ct-forest-950:#2c1c30; --ct-forest-900:#402745; --ct-forest-800:#603967; --ct-green-700:#7a4b84; --ct-green-600:#91609b; --ct-green-500:#ae7fb4; --ct-lime-400:#d8aee0; --palette-accent:#7a4b84; }
html[data-accent="graphite"] { --ct-forest-950:#1d2927; --ct-forest-900:#2c3b38; --ct-forest-800:#425550; --ct-green-700:#526e66; --ct-green-600:#6b897e; --ct-green-500:#86a399; --ct-lime-400:#b2c8bc; --palette-accent:#526e66; }
html[data-accent="custom"] { --custom-accent:#188b4e; --ct-forest-950:color-mix(in srgb,var(--custom-accent) 17%,#071c16); --ct-forest-900:color-mix(in srgb,var(--custom-accent) 24%,#0a241b); --ct-forest-800:color-mix(in srgb,var(--custom-accent) 36%,#0d2b20); --ct-green-700:color-mix(in srgb,var(--custom-accent) 38%,#102418); --ct-green-600:color-mix(in srgb,var(--custom-accent) 48%,#14351e); --ct-green-500:var(--custom-accent); --ct-lime-400:color-mix(in srgb,var(--custom-accent) 55%,#d8e9ba); --palette-accent:var(--ct-green-700); }
html[data-accent]:not([data-accent="green"]) .app-sidebar { background:linear-gradient(180deg,var(--ct-forest-950),var(--ct-forest-900)); }
html[data-accent]:not([data-accent="green"]) .app-nav-link.active,
html[data-accent]:not([data-accent="green"]) .ledger-panel-heading,
html[data-accent]:not([data-accent="green"]) .ledger-account-header { background:var(--palette-accent); }

.palette-menu { position:relative; z-index:20; }
.palette-menu > summary { align-items:center; border:1px solid var(--ct-line); border-radius:9px; cursor:pointer; display:flex; font-size:1rem; height:37px; justify-content:center; list-style:none; width:37px; }
.palette-menu > summary::-webkit-details-marker { display:none; }
.palette-options { background:var(--ct-surface); border:1px solid var(--ct-line); border-radius:11px; box-shadow:0 12px 30px #0003; display:grid; gap:.15rem; min-width:132px; padding:.4rem; position:absolute; right:0; top:calc(100% + 5px); }
.palette-options button { align-items:center; background:transparent; border:0; border-radius:7px; color:var(--ct-ink-950); cursor:pointer; display:flex; gap:.5rem; padding:.45rem .55rem; text-align:left; }
.palette-options button:hover { background:var(--ct-line-soft); }
.palette-options i { border:1px solid #0003; border-radius:50%; height:14px; width:14px; }
.palette-options [data-accent="green"] i { background:#188b4e; }
.palette-options [data-accent="blue"] i { background:#168db1; }
.palette-options [data-accent="plum"] i { background:#945ca1; }
.palette-options [data-accent="graphite"] i { background:#607d72; }
.palette-custom { align-items:center; border-top:1px solid var(--ct-line); color:var(--ct-ink-950); display:flex; font-size:.9rem; gap:.5rem; justify-content:space-between; margin-top:.25rem; padding:.55rem .3rem .15rem; white-space:nowrap; }
.palette-custom input { border:0; cursor:pointer; height:28px; padding:0; width:36px; }

* { box-sizing: border-box; }
html { font-size: 15px; min-height: 100%; max-width: 100%; overflow-x: hidden; --ct-font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; --bs-body-font-family:var(--ct-font-family); }
html[data-font-size="12"] { font-size: 12px; }
html[data-font-size="13"] { font-size: 13px; }
html[data-font-size="14"] { font-size: 14px; }
html[data-font-size="15"] { font-size: 15px; }
html[data-font-size="16"] { font-size: 16px; }
html[data-font-size="17"] { font-size: 17px; }
html[data-font-size="18"] { font-size: 18px; }
html[data-font-size="19"] { font-size: 19px; }
html[data-font-size="20"] { font-size: 20px; }
html[data-font-size="22"] { font-size: 22px; }
html[data-font-family="segoe"] { --ct-font-family: "Segoe UI", Arial, sans-serif; }
html[data-font-family="arial"] { --ct-font-family: Arial, Helvetica, sans-serif; }
html[data-font-family="verdana"] { --ct-font-family: Verdana, Geneva, sans-serif; }
html[data-font-family="tahoma"] { --ct-font-family: Tahoma, Verdana, sans-serif; }
html[data-font-family="trebuchet"] { --ct-font-family: "Trebuchet MS", Arial, sans-serif; }
html[data-font-family="calibri"] { --ct-font-family: Calibri, "Segoe UI", sans-serif; }
html[data-font-family="cambria"] { --ct-font-family: Cambria, Georgia, serif; }
html[data-font-family="candara"] { --ct-font-family: Candara, Calibri, sans-serif; }
html[data-font-family="constantia"] { --ct-font-family: Constantia, Georgia, serif; }
html[data-font-family="corbel"] { --ct-font-family: Corbel, Calibri, sans-serif; }
html[data-font-family="georgia"] { --ct-font-family: Georgia, "Times New Roman", serif; }
html[data-font-family="garamond"] { --ct-font-family: Garamond, Georgia, serif; }
html[data-font-family="palatino"] { --ct-font-family: "Palatino Linotype", Georgia, serif; }
html[data-font-family="times"] { --ct-font-family: "Times New Roman", Georgia, serif; }
html[data-font-family="consolas"] { --ct-font-family: Consolas, "Courier New", monospace; }
html[data-font-family="century"] { --ct-font-family: "Century Gothic", "Trebuchet MS", sans-serif; }
html[data-font-family="bahnschrift"] { --ct-font-family: Bahnschrift, "Segoe UI", sans-serif; }
html[data-font-family="lucida"] { --ct-font-family: "Lucida Sans Unicode", "Segoe UI", sans-serif; }
html[data-font-family="courier"] { --ct-font-family: "Courier New", Consolas, monospace; }
.font-menu { position:relative; z-index:21; }
.font-menu > summary { align-items:center; border:1px solid var(--ct-line); border-radius:7px; cursor:pointer; display:flex; font-size:.7rem; font-weight:800; height:29px; justify-content:center; list-style:none; padding:0; width:29px; }
.font-menu > summary::-webkit-details-marker { display:none; }
.font-options { background:var(--ct-surface); border:1px solid var(--ct-line); border-radius:11px; box-shadow:0 12px 30px #0003; display:grid; gap:.65rem; min-width:210px; padding:.8rem; position:absolute; right:0; top:calc(100% + 5px); }
.font-options label { color:var(--ct-ink-950); display:grid; font-size:.8rem; gap:.2rem; }
.font-options select { background:var(--ct-surface); border:1px solid var(--ct-line); border-radius:7px; color:var(--ct-ink-950); padding:.4rem; }
.ledger-stock-list { overflow-x:auto; }
.ledger-stock-head, .ledger-stock-row { display:grid !important; grid-template-columns:minmax(80px,1.6fr) repeat(3,minmax(50px,1fr)); align-items:center; gap:.35rem; min-width:300px; }
.ledger-stock-head { color:var(--ct-ink-600); font-size:.66rem; font-weight:800; padding:.45rem .65rem; }
.ledger-stock-head span:not(:first-child), .ledger-stock-row span:not(:first-child), .ledger-stock-row strong { text-align:right; }
.ledger-stock-head span, .ledger-stock-row span, .ledger-stock-row strong { overflow:hidden; text-overflow:ellipsis; }
.ledger-stock-row { font-size:.72rem; padding:.5rem .65rem !important; }
.ledger-stock-row small { font-size:.62rem; }
body {
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ct-ink-950);
  font-family: var(--ct-font-family);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body :is(button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, label) { font-family: var(--ct-font-family); }
a { color: var(--ct-green-700); }
a:hover { color: var(--ct-forest-900); }
button, input, select, textarea { font: inherit; }

/* Application shell */
.app-body { background: var(--ct-canvas); }
.app-shell { display: block; min-height: 100vh; width: 100%; }
.app-sidebar {
  --bs-offcanvas-width: var(--ct-sidebar-width);
  background:
    radial-gradient(circle at 12% 10%, rgba(141, 198, 63, .14), transparent 24%),
    linear-gradient(180deg, var(--ct-forest-950), #052f22 56%, #04291e);
  border: 0 !important;
  color: #fff;
  flex: 0 0 var(--ct-sidebar-width);
  width: var(--ct-sidebar-width) !important;
}
.app-sidebar::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  content: "";
  height: 1px;
  left: 22px;
  position: absolute;
  right: 22px;
  top: 100px;
}
.app-sidebar-body {
  display: flex !important;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 0 !important;
  width: 100%;
}
.sidebar-brand {
  align-items: center;
  color: #fff;
  display: flex;
  flex: 0 0 101px;
  gap: .8rem;
  padding: 20px 22px;
  position: relative;
  text-decoration: none;
}
.sidebar-brand:hover { color: #fff; }
.sidebar-logo {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 15px 15px 15px 5px;
  box-shadow: 0 10px 26px rgba(0,0,0,.17);
  display: flex;
  height: 55px;
  overflow: hidden;
  position: relative;
  width: 55px;
}
.sidebar-logo img {
  flex: none;
  height: 80px;
  max-width: none;
  object-fit: contain;
  width: 145px;
}
.sidebar-brand-copy { line-height: 1; min-width: 0; }
.sidebar-brand-copy strong { display: block; font-size: 1.05rem; letter-spacing: .06em; }
.sidebar-brand-copy small { color: rgba(255,255,255,.58); display: block; font-size: .68rem; margin-top: .42rem; white-space: nowrap; }
.sidebar-navigation {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 24px;
  scrollbar-color: rgba(255,255,255,.18) transparent;
  scrollbar-width: thin;
}
.nav-section-title {
  color: rgba(255,255,255,.38);
  display: block;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .13em;
  padding: 20px 12px 7px;
  text-transform: uppercase;
}
.nav-section-title:first-child { padding-top: 4px; }
.app-nav-link {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  color: rgba(255,255,255,.72);
  display: flex;
  font-size: .86rem;
  font-weight: 600;
  gap: .72rem;
  margin: 2px 0;
  padding: .68rem .76rem;
  position: relative;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.app-nav-link:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.app-nav-link.active {
  background: linear-gradient(95deg, color-mix(in srgb, var(--ct-green-500) 24%, transparent), rgba(255,255,255,.07));
  border-color: color-mix(in srgb, var(--ct-green-500) 30%, transparent);
  box-shadow: inset 3px 0 0 var(--ct-lime-400);
  color: #fff;
}
.sidebar-menu-toggle {
  background: transparent;
  text-align: left;
  width: 100%;
}
.nav-chevron {
  color: rgba(255,255,255,.55);
  font-size: 1rem;
  margin-left: auto;
  transition: transform .18s ease;
}
.sidebar-menu-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.sidebar-submenu {
  border-left: 1px solid color-mix(in srgb, var(--ct-green-500) 35%, transparent);
  margin: .2rem 0 .65rem 1.55rem;
  padding: .2rem 0 .2rem .7rem;
}
.admin-more-menu { background: transparent; border: 0; border-radius: 0; min-width: 0; padding: 0; position: relative; }
.admin-more-toggle { background: color-mix(in srgb, var(--ct-green-700) 28%, var(--ct-forest-900)); border-color: var(--ct-forest-800); color: #eef9f0; cursor: pointer; list-style: none; }
.admin-more-menu > .admin-more-toggle:hover, .admin-more-menu[open] > .admin-more-toggle { background: color-mix(in srgb, var(--ct-green-700) 48%, var(--ct-forest-900)); border-color: var(--ct-green-600); color: #fff; }
.admin-more-toggle::-webkit-details-marker { display: none; }
.admin-more-panel { display: grid; gap: 2px; padding: .35rem; }
.admin-more-heading { color: var(--ct-lime-400); font-size: .66rem; font-weight: 800; grid-column: 1 / -1; letter-spacing: .08em; padding: .6rem .5rem .2rem; }
.admin-more-panel .app-nav-link, .admin-more-panel .submenu-link { margin: 0; }
.submenu-link {
  border-radius: 8px;
  color: rgba(255,255,255,.62);
  display: block;
  font-size: .76rem;
  font-weight: 600;
  margin: 1px 0;
  padding: .52rem .65rem;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.submenu-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  transform: translateX(2px);
}
.submenu-link.active {
  background: color-mix(in srgb, var(--ct-green-500) 24%, transparent);
  color: #fff;
}
.nav-icon {
  align-items: center;
  color: var(--ct-lime-400);
  display: inline-flex;
  flex: 0 0 25px;
  font-family: "Segoe UI Symbol", sans-serif;
  font-size: 1.08rem;
  height: 25px;
  justify-content: center;
}
.app-nav-link.active .nav-icon, .app-nav-link:hover .nav-icon { color: #fff; }
.sidebar-support {
  align-items: center;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  display: flex;
  flex: 0 0 auto;
  gap: .65rem;
  margin: 0 16px 16px;
  padding: .78rem;
}
.support-dot { background: #8bd446; border: 4px solid rgba(139,212,70,.15); border-radius: 50%; box-sizing: content-box; height: 7px; width: 7px; }
.sidebar-support strong, .sidebar-support small { display: block; }
.sidebar-support strong { font-size: .72rem; }
.sidebar-support small { color: rgba(255,255,255,.46); font-size: .62rem; margin-top: .18rem; }

.app-workspace { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 100vh; width: 100%; }
.app-topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255,255,255,.91);
  border-bottom: 1px solid rgba(214,226,218,.84);
  display: flex;
  height: 78px;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar-title { align-items: center; display: flex; flex: 1 1 auto; gap: .85rem; min-width: 0; }
.topbar-title > div { min-width: 0; }
.topbar-title small, .topbar-title strong { display: block; }
.topbar-title small { color: var(--ct-ink-500); font-size: .68rem; font-weight: 700; letter-spacing: .07em; margin-bottom: .15rem; text-transform: uppercase; }
.topbar-title strong { font-size: 1.04rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-toggle { background: transparent; border: 0; display: grid; gap: 4px; padding: 7px; }
.sidebar-toggle span { background: var(--ct-ink-800); border-radius: 2px; display: block; height: 2px; width: 21px; }
.topbar-account { align-items: center; display: flex; flex: 0 0 auto; gap: .65rem; }
.topbar-account form { margin: 0; }
.account-avatar {
  align-items: center;
  background: linear-gradient(145deg, var(--ct-forest-900), var(--ct-green-600));
  border-radius: 12px;
  box-shadow: 0 7px 18px rgba(6,60,41,.15);
  color: #fff;
  display: inline-flex;
  font-size: .88rem;
  font-weight: 800;
  height: 39px;
  justify-content: center;
  width: 39px;
}
.account-copy { line-height: 1.1; margin-right: .3rem; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { font-size: .8rem; }
.account-copy small { color: var(--ct-ink-500); font-size: .65rem; margin-top: .25rem; }
.logout-button {
  background: #fff;
  border: 1px solid var(--ct-line);
  border-radius: 10px;
  color: var(--ct-ink-600);
  font-size: .73rem;
  font-weight: 700;
  padding: .58rem .75rem;
  transition: all .18s ease;
}
.logout-button:hover { border-color: #e6b8b8; color: var(--ct-danger); }
.app-content {
  flex: 1;
  margin: 0 auto;
  max-width: 1680px;
  padding: clamp(1.25rem, 2.7vw, 2.5rem);
  width: 100%;
}
.app-content > * { max-width: 100%; }
.app-footer {
  align-items: center;
  color: var(--ct-ink-500);
  display: flex;
  font-size: .7rem;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 2.7vw, 2.5rem) 1.5rem;
}
.app-alert { border: 0; border-radius: 14px; box-shadow: var(--ct-shadow-sm); }

/* Shared interface components */
.btn { border-radius: 10px; font-weight: 700; padding: .58rem .9rem; }
.btn-sm { border-radius: 8px; padding: .38rem .62rem; }
.btn-success {
  --bs-btn-bg: var(--ct-green-600);
  --bs-btn-border-color: var(--ct-green-600);
  --bs-btn-hover-bg: var(--ct-forest-800);
  --bs-btn-hover-border-color: var(--ct-forest-800);
  --bs-btn-active-bg: var(--ct-forest-900);
  --bs-btn-active-border-color: var(--ct-forest-900);
  box-shadow: 0 7px 16px rgba(47,143,53,.15);
}
.btn-outline-success { --bs-btn-color: var(--ct-green-700); --bs-btn-border-color: #8ec393; --bs-btn-hover-bg: var(--ct-green-700); --bs-btn-hover-border-color: var(--ct-green-700); }
.btn-warning { --bs-btn-bg: var(--ct-gold-500); --bs-btn-border-color: var(--ct-gold-500); --bs-btn-hover-bg: #dea113; --bs-btn-hover-border-color: #dea113; color: #30270e; }
.form-label { color: var(--ct-ink-800); font-size: .74rem; font-weight: 750; margin-bottom: .4rem; }
.form-control, .form-select {
  background-color: #fff;
  border-color: #d7e1da;
  border-radius: 10px;
  color: var(--ct-ink-950);
  min-height: 42px;
}
.form-control::placeholder { color: #9aaba2; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--ct-green-500);
  box-shadow: 0 0 0 .22rem rgba(88,169,45,.13);
}
.form-check-input:checked { background-color: var(--ct-green-600); border-color: var(--ct-green-600); }
.form-text, .text-muted, .text-secondary { color: var(--ct-ink-500) !important; }
.text-danger { color: var(--ct-danger) !important; font-size: .75rem; }

.page-heading { align-items: flex-end; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1.5rem; }
.page-heading h1 { color: var(--ct-ink-950); font-size: clamp(1.85rem, 3.6vw, 2.75rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.06; margin: 0; }
.page-heading p { color: var(--ct-ink-600); font-size: .91rem; margin: .55rem 0 0; max-width: 780px; }
.eyebrow { color: var(--ct-green-600); display: block; font-size: .68rem; font-weight: 850; letter-spacing: .14em; margin-bottom: .55rem; text-transform: uppercase; }
.status-pill {
  background: #e8f4e6;
  border: 1px solid #cfe5cb;
  border-radius: 999px;
  color: var(--ct-green-700);
  font-size: .75rem;
  font-weight: 800;
  padding: .57rem .82rem;
  white-space: nowrap;
}
.status-warning { background: var(--ct-gold-100); border-color: #f0d98c; color: #765500; }

.hero-panel {
  align-items: center;
  background:
    radial-gradient(circle at 88% 15%, rgba(141,198,63,.25), transparent 25%),
    linear-gradient(118deg, var(--ct-forest-950), var(--ct-forest-800) 58%, var(--ct-green-700));
  border-radius: 28px;
  box-shadow: 0 22px 54px rgba(6,60,41,.16);
  color: #fff;
  display: grid;
  gap: 3rem;
  grid-template-columns: 1.25fr .75fr;
  overflow: hidden;
  padding: clamp(2.2rem, 5vw, 4.7rem);
  position: relative;
}
.hero-panel::before, .hero-panel::after { border: 1px solid rgba(255,255,255,.10); border-radius: 50%; content: ""; position: absolute; }
.hero-panel::before { height: 360px; right: -130px; top: -180px; width: 360px; }
.hero-panel::after { bottom: -210px; height: 420px; left: 37%; width: 420px; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h1 { font-size: clamp(2.4rem, 4.5vw, 4.4rem); font-weight: 850; letter-spacing: -.055em; line-height: .98; max-width: 850px; }
.hero-panel p { color: rgba(255,255,255,.72); font-size: 1.03rem; line-height: 1.7; margin: 1.5rem 0 2rem; max-width: 720px; }
.hero-panel .eyebrow { color: #a9d878; }
.hero-metrics { display: grid; gap: .85rem; }
.hero-metrics div { backdrop-filter: blur(8px); background: rgba(255,255,255,.085); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; padding: 1.18rem; }
.hero-metrics strong { display: block; font-size: 1.8rem; }
.hero-metrics span { color: rgba(255,255,255,.62); font-size: .76rem; }

.feature-grid, .metric-grid, .action-grid, .delivery-grid { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-card, .metric-card, .delivery-card, .form-card, .table-card, .empty-state {
  background: var(--ct-surface);
  border: 1px solid var(--ct-line-soft);
  border-radius: var(--ct-radius-md);
  box-shadow: var(--ct-shadow-sm);
}
.feature-card { padding: 1.45rem; transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { box-shadow: var(--ct-shadow-md); transform: translateY(-3px); }
.feature-card > span { align-items: center; background: #edf6e9; border-radius: 12px; display: inline-flex; font-size: 1.25rem; height: 43px; justify-content: center; width: 43px; }
.feature-card h2 { font-size: .96rem; font-weight: 800; margin: 1rem 0 .45rem; }
.feature-card p { color: var(--ct-ink-600); font-size: .82rem; line-height: 1.55; margin: 0; }
.metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card {
  border-left: 4px solid var(--ct-green-500);
  color: var(--ct-ink-950);
  min-height: 146px;
  padding: 1.25rem;
  position: relative;
  transition: box-shadow .2s ease, transform .2s ease;
}
.metric-card:hover { box-shadow: var(--ct-shadow-md); color: var(--ct-ink-950); transform: translateY(-3px); }
.metric-card span, .metric-card small { color: var(--ct-ink-600); display: block; font-size: .75rem; }
.metric-card strong { color: var(--ct-forest-900); display: block; font-size: clamp(1.6rem, 2.6vw, 2.15rem); letter-spacing: -.035em; margin: .45rem 0; }
.metric-card::after { color: #aacbb3; content: "→"; font-size: 1.1rem; position: absolute; right: 1.2rem; top: 1.05rem; }
.metric-card.accent-warning { border-left-color: var(--ct-gold-500); }
.action-grid a { background: linear-gradient(135deg, var(--ct-forest-900), var(--ct-forest-800)); border-radius: var(--ct-radius-md); box-shadow: var(--ct-shadow-sm); color: #fff; padding: 1.25rem; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.action-grid a:hover { box-shadow: var(--ct-shadow-md); color: #fff; transform: translateY(-3px); }
.action-grid span, .action-grid strong, .action-grid small { display: block; }
.action-grid span { font-size: 1.4rem; }
.action-grid strong { margin: .75rem 0 .25rem; }
.action-grid small { color: rgba(255,255,255,.62); }

.form-card { margin: 0; max-width: none; padding: clamp(1.15rem, 2.2vw, 1.65rem); width: 100%; }
.form-card h2, .form-card h3 { color: var(--ct-ink-950); font-size: 1rem; font-weight: 800; margin-bottom: 1rem; }
.region-permission-grid { display: grid; gap: .55rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: .45rem; }
.region-permission-option { align-items: center; background: #f7faf7; border: 1px solid var(--ct-line); border-radius: 10px; cursor: pointer; display: flex; font-size: .8rem; font-weight: 700; gap: .6rem; min-height: 44px; padding: .65rem .75rem; }
.region-permission-option:has(.form-check-input:checked) { background: #edf6e9; border-color: #9bc78f; color: var(--ct-forest-900); }
.region-permission-option .form-check-input { flex: 0 0 auto; margin: 0; }
.table-card { overflow: hidden; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ct-ink-800); margin-bottom: 0; }
.table > thead > tr > th {
  background: #f7faf7;
  border-bottom: 1px solid var(--ct-line);
  color: var(--ct-ink-500);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .055em;
  padding: .92rem 1rem;
  text-transform: uppercase;
  white-space: nowrap;
}
.table > tbody > tr > td { border-color: var(--ct-line-soft); font-size: .81rem; padding: .9rem 1rem; vertical-align: middle; }
.table > tbody > tr:hover > td { background: #fbfdfb; }
.table td small { color: var(--ct-ink-500); display: block; font-size: .7rem; margin-top: .22rem; }
.table-responsive { scrollbar-color: #bdcec2 transparent; scrollbar-width: thin; }
.customers-table th:nth-child(1) { min-width: 15rem; width: 22%; }
.customers-table th:nth-child(2) { min-width: 24rem; width: 34%; }
.customers-table th:nth-child(3) { min-width: 7rem; width: 10%; }
.customers-table th:nth-child(4) { min-width: 10rem; width: 14%; }
.customers-table th:nth-child(5) { min-width: 18rem; width: 20%; }
.customer-identity-cell > strong,
.customer-address-copy > strong { color: var(--ct-ink-950); display: block; font-weight: 750; line-height: 1.45; }
.customer-address-list { display: grid; gap: .7rem; }
.customer-address-item { align-items: start; display: grid; gap: .75rem; grid-template-columns: minmax(13rem, 1fr) auto; }
.customer-address-item + .customer-address-item { border-top: 1px dashed var(--ct-line); padding-top: .7rem; }
.customer-address-copy small { line-height: 1.45; }
.customer-address-actions,
.customer-main-actions { align-items: flex-start; display: flex; flex-wrap: wrap; gap: .4rem; }
.customer-address-actions form,
.customer-main-actions form { align-items: center; display: grid !important; gap: .35rem; grid-template-columns: minmax(8.5rem, 1fr) auto; }
.customer-contact-cell span,
.customer-contact-cell a { display: block; }
.customer-branch-cell span { background: var(--ct-green-050); border: 1px solid var(--ct-line); border-radius: 999px; color: var(--ct-green-800); display: inline-flex; font-weight: 800; padding: .3rem .6rem; }
.customer-contact-cell a { color: var(--ct-green-700); font-weight: 700; text-decoration: none; }
.customer-contact-cell a:hover { text-decoration: underline; }
.location-field-panel { align-items: center; background: #f3f8f2; border: 1px solid #dce9d9; border-radius: 12px; display: flex; gap: .8rem; justify-content: space-between; padding: .8rem; }
.location-field-panel.compact { align-items: flex-start; flex-direction: column; }
.location-field-panel strong, .location-field-panel small { display: block; }
.location-field-panel small { color: var(--ct-ink-600); font-size: .7rem; margin-top: .2rem; }
.location-field-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.customer-location-picker-map { background: #e8efe8; border: 1px solid var(--ct-line); border-radius: 14px; height: min(58vh, 540px); min-height: 360px; overflow: hidden; }
.location-picker-readout { background: #f5f8f5; border-radius: 10px; font-size: .8rem; padding: .75rem; }
.customer-account-header { border-left: 4px solid var(--ct-green-500); }
.customer-account-workspace { background: #edf3ee; border: 1px solid var(--ct-line); border-radius: var(--ct-radius-md); padding: 1rem; }
.customer-account-workspace .table-card > h2,
.customer-card-metrics + .table-card > h2,
.customer-card-metrics + .table-card + .table-card > h2 { font-size: .95rem; font-weight: 800; margin: 0; padding: 1rem; }
.empty-state { padding: 4rem 1.5rem; text-align: center; }
.empty-state.compact { border: 0; box-shadow: none; }
.empty-state h1, .empty-state h2 { font-weight: 800; }
.empty-state p { color: var(--ct-ink-600); }
.empty-icon { display: block; font-size: 2.3rem; margin-bottom: 1rem; }
.delivery-card { padding: 1.3rem; }
.delivery-card h2 { font-size: 1.1rem; font-weight: 800; }
.delivery-card p { color: var(--ct-ink-600); min-height: 2.6rem; }
.quantity-callout { align-items: baseline; background: #edf6ea; border-radius: 13px; display: flex; gap: .5rem; margin: 1rem 0; padding: .9rem; }
.quantity-callout strong { color: var(--ct-green-700); font-size: 1.65rem; }
.quantity-callout span { color: var(--ct-ink-600); font-size: .75rem; }

.driver-list-heading { align-items: center; margin-bottom: .8rem; }
.driver-list-heading .eyebrow { margin-bottom: .3rem; }
.driver-city-tabs {
  display: flex;
  gap: .5rem;
  margin: 0 0 .85rem;
  overflow-x: auto;
  padding: .1rem 0 .35rem;
  scrollbar-width: thin;
}
.driver-city-button {
  background: #fff;
  border: 1px solid var(--ct-line);
  border-radius: 999px;
  color: var(--ct-ink-800);
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 800;
  padding: .58rem .9rem;
  text-decoration: none;
}
.driver-city-button:hover,
.driver-city-button.active { background: var(--ct-green-600); border-color: var(--ct-green-600); color: #fff; }
.driver-location-toolbar { align-items: end; background: #fff; border: 1px solid var(--ct-line-soft); border-radius: 13px; box-shadow: var(--ct-shadow-sm); display: flex; flex-wrap: wrap; gap: .7rem; padding: .8rem; }
.driver-location-toolbar > div:first-child { min-width: 210px; }
.driver-location-toolbar .form-label { font-size: .68rem; margin-bottom: .25rem; }
.location-status { color: var(--ct-ink-500); flex: 1 1 220px; font-size: .7rem; padding: .55rem .25rem; }
.location-status.success { color: var(--ct-green-700); font-weight: 750; }
.location-status.error { color: var(--ct-danger); font-weight: 750; }
.driver-view-switch { display: flex; flex-wrap: wrap; gap: .35rem; }
.driver-view-switch .btn.active { background: var(--ct-green-600); color: #fff; }
.driver-order-list { display: grid; gap: .6rem; }
.driver-order-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--ct-line-soft);
  border-left: 4px solid var(--ct-green-500);
  border-radius: 13px;
  box-shadow: var(--ct-shadow-sm);
  display: grid;
  gap: .8rem 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(270px, .42fr);
  padding: .8rem .9rem;
}
.driver-order-card.completed { border-left-color: #a9b8b0; }
.driver-order-card.visited { background: #eaf7ed; border-color: #8bc99a; border-left-color: #218c47; }
.driver-visited-badge { align-items: center; background: #d4efdc; border: 1px solid #9bd0a9; border-radius: 999px; color: #146b35; display: inline-flex; flex: 0 0 auto; font-size: .72rem; font-weight: 850; padding: .35rem .6rem; }
.driver-branch-search { border: 2px solid #b6ddc0; }
.driver-branch-search .form-label { color: var(--ct-green-700); font-weight: 850; }
.route-editor-card { max-height: calc(100vh - 2rem); overflow: auto; }
.route-selected-stops { display: grid; gap: .45rem; max-height: 42vh; overflow: auto; }
.route-selected-stop { align-items: center; background: #f2f7f3; border: 1px solid var(--ct-line-soft); border-radius: 10px; display: grid; gap: .45rem; grid-template-columns: 30px minmax(0, 1fr) auto; padding: .48rem; }
.route-selected-stop > strong { align-items: center; background: #dff0e3; border-radius: 50%; color: var(--ct-green-700); display: inline-flex; height: 28px; justify-content: center; width: 28px; }
.route-selected-stop span { font-size: .74rem; font-weight: 750; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-selected-stop .btn { min-height: 32px; padding: .2rem .4rem; }
.driver-order-summary { min-width: 0; }
.driver-order-title { align-items: center; display: flex; gap: .7rem; justify-content: space-between; }
.driver-order-title h2 { font-size: .98rem; font-weight: 850; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-order-title strong { color: var(--ct-green-700); flex: 0 0 auto; font-size: 1.05rem; }
.driver-order-address { color: var(--ct-ink-600); font-size: .76rem; margin: .22rem 0 .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-order-summary > small { color: var(--ct-ink-500); font-size: .64rem; }
.driver-order-location-row { align-items: center; display: flex; flex-wrap: wrap; gap: .4rem .7rem; margin-top: .15rem; }
.driver-order-location-row small { color: var(--ct-ink-500); font-size: .64rem; }
.driver-order-location-row strong { background: #edf6ea; border-radius: 999px; color: var(--ct-green-700); font-size: .64rem; padding: .22rem .45rem; }
.driver-order-location-row a { color: var(--ct-green-700); font-size: .67rem; font-weight: 800; }
.driver-order-actions { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
.driver-order-actions form { margin: 0; }
.driver-order-actions .btn { font-size: .78rem; min-height: 42px; padding: .45rem .55rem; }
.driver-exception-panel { grid-column: 1 / -1; }
.driver-exception-grid { background: #f7faf7; border-radius: 11px; display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; padding: .75rem; }
.driver-mini-form { display: grid; gap: .45rem; }
.driver-mini-form .form-label { margin: 0; }
.driver-mini-form > small { color: var(--ct-ink-500); font-size: .67rem; }
.driver-undelivered-form { border-top: 1px solid var(--ct-line); grid-column: 1 / -1; padding-top: .7rem; }
.driver-inline-save { display: grid; gap: .5rem; grid-template-columns: minmax(0, 1fr) auto; }
.driver-completed-actions { align-items: center; display: flex; gap: .65rem; justify-content: flex-end; }
.driver-completed-actions details { min-width: 130px; }
.driver-delivered-badge,
.driver-cancelled-badge { border-radius: 999px; display: inline-flex; font-size: .72rem; font-weight: 800; padding: .48rem .7rem; }
.driver-delivered-badge { background: #e8f4e6; color: var(--ct-green-700); }
.driver-cancelled-badge { background: #f5eaea; color: var(--ct-danger); justify-self: end; }
.driver-customer-map { background: #e8efe8; border: 1px solid var(--ct-line); border-radius: 15px; box-shadow: var(--ct-shadow-sm); height: min(58vh, 560px); min-height: 380px; overflow: hidden; }
.driver-map-legend { align-items: center; background: rgba(255,255,255,.96); border: 1px solid var(--ct-line); border-radius: 999px; display: flex; flex-wrap: wrap; gap: .8rem; margin: .6rem 0 0; padding: .45rem .7rem; width: fit-content; }
.driver-map-legend span { align-items: center; display: flex; font-size: .67rem; font-weight: 750; gap: .35rem; }
.driver-map-legend i { background: #8c9b94; border-radius: 50%; display: inline-block; height: 9px; width: 9px; }
.driver-map-legend i.completed { background: #2f913c; }
.driver-map-legend i.pending { background: #eea51d; }
.driver-customer-list { display: grid; gap: .6rem; }
.driver-customer-card { align-items: center; background: #fff; border: 1px solid var(--ct-line-soft); border-radius: 13px; box-shadow: var(--ct-shadow-sm); display: grid; gap: .75rem; grid-template-columns: 10px minmax(250px, 1fr) minmax(120px, auto) minmax(270px, auto); padding: .8rem .9rem; }
.driver-customer-state { border-radius: 999px; height: 42px; width: 6px; }
.driver-customer-state.completed { background: #2f913c; }
.driver-customer-state.pending { background: #eea51d; }
.driver-customer-state.other { background: #a5b1aa; }
.driver-customer-copy { min-width: 0; }
.driver-customer-copy p { color: var(--ct-ink-700); font-size: .76rem; margin: .2rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-customer-copy small { color: var(--ct-ink-500); font-size: .67rem; }
.driver-customer-distance strong { color: var(--ct-green-700); font-size: .75rem; white-space: nowrap; }
.driver-customer-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.driver-customer-actions .btn { font-size: .72rem; min-height: 38px; padding: .4rem .6rem; }
.driver-customer-pin-shell { background: none; border: 0; }
.driver-customer-pin { background: #8c9b94; border: 3px solid #fff; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 8px rgba(0,0,0,.32); display: block; height: 23px; transform: rotate(-45deg); width: 23px; }
.driver-customer-pin.completed { background: #2f913c; }
.driver-customer-pin.pending { background: #eea51d; }
.driver-map-popup { min-width: 210px; }
.driver-map-popup > strong { display: block; font-size: .9rem; }
.driver-map-popup p { color: #526158; font-size: .72rem; margin: .35rem 0; }
.driver-map-popup small { display: block; margin-bottom: .6rem; }
.driver-map-popup-actions { display: flex; gap: .35rem; }

.accordion { --bs-accordion-border-color: var(--ct-line-soft); --bs-accordion-border-radius: var(--ct-radius-md); display: grid; gap: .85rem; }
.accordion-item { border: 1px solid var(--ct-line-soft) !important; border-radius: var(--ct-radius-md) !important; box-shadow: var(--ct-shadow-sm); overflow: hidden; }
.accordion-button { color: var(--ct-ink-950); font-size: .93rem; font-weight: 800; padding: 1.15rem 1.3rem; }
.accordion-button:not(.collapsed) { background: #eff7ed; box-shadow: inset 0 -1px 0 var(--ct-line-soft); color: var(--ct-forest-900); }
.accordion-button:focus { box-shadow: 0 0 0 .22rem rgba(88,169,45,.12); }
.accordion-body { background: #fbfdfb; padding: 1.15rem; }
details { background: #f7faf7; border: 1px solid var(--ct-line-soft); border-radius: 9px; padding: .55rem; }
summary { color: var(--ct-green-700); cursor: pointer; font-size: .75rem; font-weight: 750; }
.pagination, nav { --bs-pagination-color: var(--ct-green-700); }

/* Authentication */
.auth-body { background: #f6f8f6; overflow-x: hidden; }
.auth-main { min-height: 100vh; }
.auth-page { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(460px, .92fr); min-height: 100vh; }
.auth-brand-panel {
  background:
    radial-gradient(circle at 76% 8%, rgba(141,198,63,.25), transparent 24%),
    radial-gradient(circle at 12% 92%, rgba(241,180,38,.12), transparent 25%),
    linear-gradient(145deg, var(--ct-forest-950), var(--ct-forest-800) 64%, var(--ct-green-700));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 4.2vw, 4.6rem);
  position: relative;
}
.auth-brand-panel::before, .auth-brand-panel::after { border: 1px solid rgba(255,255,255,.10); border-radius: 50%; content: ""; position: absolute; }
.auth-brand-panel::before { height: 480px; right: -235px; top: 17%; width: 480px; }
.auth-brand-panel::after { bottom: -255px; height: 520px; left: 18%; width: 520px; }
.auth-brand-content, .auth-brand-footer { position: relative; z-index: 1; }
.auth-logo-frame {
  align-items: center;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 20px 20px 20px 6px;
  box-shadow: 0 22px 50px rgba(0,0,0,.17);
  display: flex;
  height: clamp(92px, 9vw, 122px);
  margin-bottom: clamp(2.7rem, 7vh, 5.5rem);
  overflow: hidden;
  padding: .5rem 1rem;
  width: min(440px, 82%);
}
.auth-logo-frame img { height: 100%; object-fit: contain; width: 100%; }
.auth-kicker { color: #addc79; display: block; font-size: .7rem; font-weight: 850; letter-spacing: .16em; margin-bottom: .9rem; }
.auth-brand-message h1 { font-size: clamp(2.4rem, 4vw, 4.7rem); font-weight: 850; letter-spacing: -.055em; line-height: .97; margin: 0; max-width: 820px; }
.auth-brand-message > p { color: rgba(255,255,255,.67); font-size: clamp(.95rem, 1.25vw, 1.08rem); line-height: 1.72; margin: 1.45rem 0 0; max-width: 680px; }
.auth-feature-list { display: grid; gap: .8rem; grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: clamp(2.1rem, 5vh, 4.2rem); }
.auth-feature-list > div { backdrop-filter: blur(10px); background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.10); border-radius: 15px; min-height: 118px; padding: 1rem; }
.auth-feature-list > div > span { color: #a9d878; display: block; font-size: .63rem; font-weight: 850; letter-spacing: .1em; }
.auth-feature-list p { margin: .7rem 0 0; }
.auth-feature-list strong, .auth-feature-list small { display: block; }
.auth-feature-list strong { font-size: .77rem; }
.auth-feature-list small { color: rgba(255,255,255,.49); font-size: .66rem; line-height: 1.45; margin-top: .32rem; }
.auth-brand-footer { align-items: center; color: rgba(255,255,255,.45); display: flex; font-size: .67rem; gap: .6rem; margin-top: 2.5rem; }
.auth-brand-footer span { background: var(--ct-gold-500); border-radius: 50%; height: 7px; width: 7px; }

.auth-form-panel { align-items: center; background: #fff; display: flex; justify-content: center; padding: clamp(2rem, 5vw, 5.8rem); position: relative; }
.auth-form-panel::before { background: linear-gradient(90deg, rgba(6,60,41,.10), transparent); content: ""; height: 100%; left: 0; position: absolute; top: 0; width: 1px; }
.auth-form-wrap { max-width: 470px; width: 100%; }
.auth-mobile-logo { display: none; }
.auth-form-kicker { align-items: center; color: var(--ct-green-700); display: flex; font-size: .66rem; font-weight: 850; gap: .5rem; letter-spacing: .13em; margin-bottom: 1rem; }
.auth-form-kicker i { background: var(--ct-green-500); border-radius: 50%; box-shadow: 0 0 0 5px rgba(88,169,45,.12); height: 7px; width: 7px; }
.auth-form-wrap h2 { font-size: clamp(2.15rem, 3.2vw, 3.1rem); font-weight: 850; letter-spacing: -.052em; line-height: 1.03; margin: 0; }
.auth-form-intro { color: var(--ct-ink-600); font-size: .9rem; line-height: 1.6; margin: .8rem 0 2rem; }
.auth-form { display: grid; gap: 1.15rem; }
.auth-field .form-label { font-size: .78rem; }
.field-control { position: relative; }
.field-control .form-control { border-radius: 12px; font-size: .9rem; min-height: 56px; padding-left: 3rem; }
.field-control .password-input { padding-right: 4.7rem; }
.field-icon { align-items: center; color: #7f958a; display: flex; height: 100%; justify-content: center; left: 0; pointer-events: none; position: absolute; top: 0; width: 3rem; z-index: 2; }
.field-icon svg { fill: none; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 19px; }
.password-toggle { background: transparent; border: 0; color: var(--ct-green-700); font-size: .69rem; font-weight: 800; height: 100%; padding: 0 .9rem; position: absolute; right: 0; top: 0; }
.secure-caption { color: #8a9a92; font-size: .62rem; }
.auth-options { align-items: center; display: flex; justify-content: space-between; }
.remember-option { align-items: center; color: var(--ct-ink-600); cursor: pointer; display: flex; font-size: .75rem; gap: .5rem; }
.remember-option .form-check-input { margin: 0; }
.auth-submit {
  align-items: center;
  background: linear-gradient(100deg, var(--ct-forest-900), var(--ct-green-600));
  border: 0;
  border-radius: 12px;
  box-shadow: 0 13px 28px rgba(35,117,44,.20);
  color: #fff;
  display: flex;
  font-size: .9rem;
  font-weight: 800;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 1.2rem 0 1.35rem;
  transition: box-shadow .2s ease, transform .2s ease;
}
.auth-submit:hover { box-shadow: 0 17px 34px rgba(35,117,44,.28); transform: translateY(-2px); }
.auth-submit svg { fill: none; height: 21px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 21px; }
.auth-security-note { align-items: center; background: #f4f8f3; border: 1px solid #e1ebe0; border-radius: 13px; display: flex; gap: .75rem; margin-top: 1.7rem; padding: .85rem 1rem; }
.auth-security-note > span { align-items: center; background: #e1f0de; border-radius: 50%; color: var(--ct-green-700); display: flex; flex: 0 0 29px; font-size: .75rem; font-weight: 900; height: 29px; justify-content: center; }
.auth-security-note p { margin: 0; }
.auth-security-note strong, .auth-security-note small { display: block; }
.auth-security-note strong { font-size: .69rem; }
.auth-security-note small { color: var(--ct-ink-500); font-size: .62rem; line-height: 1.4; margin-top: .2rem; }
.validation-summary:empty, .validation-summary-valid { display: none; }

@media (min-width: 992px) {
  .app-shell { display: block; }
  .app-sidebar {
    background:
      radial-gradient(circle at 12% 10%, rgba(141, 198, 63, .14), transparent 24%),
      linear-gradient(180deg, var(--ct-forest-950), #052f22 56%, #04291e) !important;
    bottom: 0 !important;
    height: 100vh !important;
    left: 0 !important;
    min-height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    transform: none !important;
    visibility: visible !important;
    z-index: 1035;
  }
  .app-sidebar-body {
    height: 100vh !important;
    min-height: 0;
    overflow: hidden !important;
  }
  .sidebar-navigation {
    min-height: 0;
    overscroll-behavior: contain;
  }
  .app-workspace {
    margin-left: var(--ct-sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--ct-sidebar-width));
  }
}

@media (max-width: 1199.98px) {
  .auth-page { grid-template-columns: minmax(0, 1fr) minmax(430px, .85fr); }
  .auth-feature-list { grid-template-columns: 1fr; }
  .auth-feature-list > div { align-items: center; display: flex; gap: .75rem; min-height: auto; }
  .auth-feature-list p { margin: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 991.98px) {
  .app-shell, .app-workspace { margin-left: 0; max-width: 100%; width: 100%; }
  .app-sidebar {
    box-shadow: 18px 0 44px rgba(0,0,0,.2);
    flex: none;
    max-width: 86vw;
    position: fixed;
  }
  .app-sidebar::after { top: 101px; }
  .app-sidebar-body { min-height: 100vh; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-metrics { grid-template-columns: repeat(3, 1fr); }
  .feature-grid, .action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .delivery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth-page { display: block; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 2.5rem 1.5rem; }
  .auth-mobile-logo { align-items: center; display: flex; height: 86px; margin-bottom: 2.5rem; overflow: hidden; width: 245px; }
  .auth-mobile-logo img { height: 100%; object-fit: contain; width: 100%; }
}

@media (max-width: 575.98px) {
  html:not([data-font-size]) { font-size: 14px; }
  .app-topbar { gap: .45rem; height: 68px; padding: 0 .85rem; }
  .topbar-title { gap: .45rem; }
  .topbar-title small { font-size: .58rem; letter-spacing: .04em; }
  .topbar-title strong { font-size: .92rem; max-width: 100%; }
  .sidebar-toggle { flex: 0 0 auto; margin-left: -.35rem; }
  .account-avatar { border-radius: 10px; height: 36px; width: 36px; }
  .topbar-account { gap: .35rem; }
  .account-copy { display: none; }
  .logout-button { min-height: 36px; padding: .45rem .55rem; }
  .app-content { padding: .9rem; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: .35rem; padding-left: 1.1rem; }
  .hero-panel { border-radius: 20px; padding: 2.1rem 1.35rem; }
  .hero-panel h1 { font-size: clamp(2.1rem, 11vw, 3.1rem); overflow-wrap: anywhere; }
  .hero-panel p { font-size: .94rem; line-height: 1.58; }
  .hero-metrics, .feature-grid, .metric-grid, .action-grid, .delivery-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }
  .page-heading h1 { font-size: 1.85rem; overflow-wrap: anywhere; }
  .page-heading p { font-size: .84rem; }
  .metric-card { min-height: 128px; }
  .form-card { padding: 1rem; }
  .delivery-card { padding: 1rem; }
  .delivery-card p { min-height: 0; overflow-wrap: anywhere; }
  .driver-body .btn { min-height: 44px; }
  .driver-body .driver-list-heading { align-items: center; flex-direction: row; margin-bottom: .55rem; }
  .driver-body .driver-list-heading .eyebrow { display: none; }
  .driver-body .driver-list-heading h1 { font-size: 1.45rem; }
  .driver-body .driver-list-heading .status-pill { font-size: .68rem; padding: .45rem .65rem; }
  .driver-body .driver-city-tabs { margin-bottom: .55rem; }
  .driver-body .driver-city-button { padding: .5rem .75rem; }
  .driver-body .driver-location-toolbar { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .driver-body .driver-location-toolbar > div:first-child { min-width: 0; }
  .driver-body .driver-view-switch { display: grid; grid-template-columns: repeat(3, 1fr); }
  .driver-body .driver-view-switch .btn { font-size: .65rem; padding-inline: .35rem; }
  .driver-body .driver-order-list { gap: .5rem; }
  .driver-body .driver-order-card { gap: .48rem; grid-template-columns: 1fr; padding: .65rem .7rem; }
  .driver-body .driver-order-title h2 { font-size: .91rem; }
  .driver-body .driver-order-title strong { font-size: .96rem; }
  .driver-body .driver-order-address { font-size: .7rem; margin-top: .15rem; }
  .driver-body .driver-order-summary > small { display: none; }
  .driver-body .driver-order-actions { gap: .45rem; }
  .driver-body .driver-order-actions .btn { font-size: .73rem; min-height: 40px; }
  .driver-body .driver-exception-grid { grid-template-columns: 1fr; padding: .65rem; }
  .driver-body .driver-undelivered-form { grid-column: auto; }
  .driver-body .driver-inline-save { grid-template-columns: 1fr; }
  .driver-body .driver-completed-actions { justify-content: space-between; }
  .driver-body .driver-customer-map { height: 52vh; min-height: 330px; }
  .driver-body .driver-customer-card { align-items: start; grid-template-columns: 7px minmax(0, 1fr); }
  .driver-body .driver-customer-state { grid-row: 1 / span 3; height: 100%; min-height: 70px; width: 5px; }
  .driver-body .driver-customer-distance { grid-column: 2; }
  .driver-body .driver-customer-actions { flex-wrap: wrap; grid-column: 2; justify-content: flex-start; }
  .driver-body .driver-customer-actions .btn { flex: 1 1 auto; }
  .driver-body .driver-filter-actions { display: grid; gap: .55rem; grid-template-columns: 1fr 1fr; }
  .driver-body .driver-filter-actions .btn,
  .driver-body .driver-actions .btn,
  .driver-body .driver-primary-action { margin: 0 !important; width: 100%; }
  .driver-body .driver-actions { display: grid !important; gap: .6rem !important; grid-template-columns: 1fr; }
  .driver-body .driver-pagination { align-items: center; gap: .6rem; }
  .driver-body .driver-pagination > span { font-size: .75rem; text-align: center; }
  .driver-body .table-responsive { -webkit-overflow-scrolling: touch; }
  .driver-body .mobile-card-table thead { display: none; }
  .driver-body .mobile-card-table,
  .driver-body .mobile-card-table tbody,
  .driver-body .mobile-card-table tr,
  .driver-body .mobile-card-table td { display: block; width: 100%; }
  .driver-body .mobile-card-table tr { border-bottom: 1px solid var(--ct-line); padding: .65rem .85rem; }
  .driver-body .mobile-card-table tr:last-child { border-bottom: 0; }
  .driver-body .mobile-card-table td { align-items: flex-start; border: 0; display: flex; gap: .75rem; justify-content: space-between; padding: .35rem 0; text-align: right; }
  .driver-body .mobile-card-table td::before { color: var(--ct-ink-500); content: attr(data-label); flex: 0 0 43%; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
  .driver-body .mobile-card-table td small { margin-left: auto; }
  .customer-address-item { grid-template-columns: 1fr; }
  .location-field-panel { align-items: flex-start; flex-direction: column; }
  .customer-location-picker-map { min-height: 320px; }
  .customer-account-workspace { padding: .65rem; }
  .customer-account-header .btn { width: 100%; }
  .customer-address-actions,
  .customer-main-actions { flex-direction: column; }
  .region-permission-grid { grid-template-columns: 1fr; }
  .auth-form-panel { align-items: flex-start; padding: 1.7rem 1.25rem; }
  .auth-mobile-logo { height: 72px; margin-bottom: 2rem; width: 205px; }
  .auth-form-wrap h2 { font-size: 2.25rem; }
  .field-control .form-control, .auth-submit { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.order-number-heading {
  cursor: pointer;
  list-style: none;
  transition: background-color .18s ease;
  user-select: none;
}
.order-number-heading::-webkit-details-marker { display: none; }
.order-number-heading:hover { background: #edf7ee !important; }
.order-number-group[open] > .order-number-heading { background: #e8f5ea !important; }
.order-tree-chevron {
  color: var(--ct-green-700, #176b3a);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 2rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .18s ease;
  width: 1.25rem;
}
.order-number-group[open] .order-tree-chevron { transform: rotate(90deg); }
.order-number-children {
  border-left: 3px solid rgba(38, 132, 72, .32);
  margin-left: 1.55rem;
  width: calc(100% - 1.55rem);
}

@media (max-width: 575.98px) {
  .order-number-heading { align-items: flex-start !important; padding: .85rem !important; }
  .order-number-heading .status-pill { font-size: .66rem; }
  .order-number-children { margin-left: .8rem; width: calc(100% - .8rem); }
}
.driver-route-map {
    min-height: 430px;
    border: 1px solid var(--border-color, #d9e5df);
    border-radius: 1rem;
    overflow: hidden;
    background: #eef4f1;
    box-shadow: 0 12px 32px rgba(4, 62, 43, .08);
}

@media (max-width: 768px) {
    .driver-route-map { min-height: 340px; }
    .route-branch-card .driver-order-actions { grid-template-columns: 1fr 1fr; }
}

.theme-toggle { background: transparent; border: 1px solid var(--ct-line); border-radius: 9px; color: inherit; cursor: pointer; font-size: 1.1rem; height: 37px; width: 37px; }
.theme-toggle:hover { border-color: var(--ct-green-600); }
@media (min-width: 992px) {
  .app-admin .app-shell { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }
  .app-admin .app-sidebar { bottom: auto !important; flex: 0 0 56px; height: 56px !important; left: auto !important; min-height: 0 !important; position: relative !important; top: auto !important; width: 100% !important; z-index: 1035; }
  .app-admin .app-sidebar::after, .app-admin .sidebar-support, .app-admin .nav-section-title, .app-admin .sidebar-menu-toggle { display: none; }
  .app-admin .app-sidebar-body { align-items: center; display: flex !important; flex-direction: row; height: 56px !important; min-height: 0 !important; overflow: visible !important; }
  .app-admin .sidebar-brand { flex: 0 0 156px; height: 56px; padding: 0 .7rem; }
  .app-admin .sidebar-logo { border-radius: 5px; height: 37px; margin: 0; padding: 0; width: 37px; }
  .app-admin .sidebar-logo img { height: 37px; width: 37px; }
  .app-admin .sidebar-brand-copy strong { font-size: .73rem; letter-spacing: 0; }
  .app-admin .sidebar-brand-copy small { display: none; }
  .app-admin .sidebar-navigation { align-items: center; display: flex; flex: 1; min-height: 0; min-width: 0; overflow: visible; padding: 0 .3rem; white-space: nowrap; }
  .app-admin .app-nav-link, .app-admin .submenu-link { flex: 0 0 auto; font-size: .7rem; margin: 0 1px; padding: .43rem .55rem; white-space: nowrap; }
  .app-admin .admin-more-menu { margin-left: auto; }
  .app-admin .admin-more-panel { background: var(--ct-forest-950); border: 1px solid var(--ct-forest-800); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.25); grid-template-columns: repeat(2,minmax(0,1fr)); max-height: calc(100vh - 125px); min-width: min(510px,calc(100vw - 24px)); overflow: auto; padding: .65rem; position: absolute; right: 0; top: calc(100% + 5px); white-space: normal; z-index: 1100; }
  .app-admin .admin-more-panel .app-nav-link, .app-admin .admin-more-panel .submenu-link { border-radius: 7px; min-width: 0; white-space: normal; }
  .app-admin .app-nav-link:hover, .app-admin .submenu-link:hover { transform: none; }
  .app-admin .app-nav-link.active { box-shadow: inset 0 -2px 0 var(--ct-lime-400); }
  .app-admin .nav-icon { flex-basis: 17px; font-size: .86rem; height: 20px; }
  .app-admin .sidebar-submenu, .app-admin .sidebar-submenu.collapse, .app-admin .sidebar-submenu.collapsing { align-items: center; border: 0; display: flex !important; flex: 0 0 auto; height: auto !important; margin: 0; padding: 0; transition: none; }
  .app-admin .app-workspace { flex: 1; margin-left: 0; min-height: 0; overflow: hidden; width: 100%; }
  .app-admin .app-topbar { flex: 0 0 53px; height: 53px; padding: 0 1rem; }
  .app-admin .app-content { max-width: none; min-height: 0; overflow: auto; }
  .app-admin.ledger-home-body .app-content { max-width: none; overflow: hidden; padding: 0; }
  .app-admin.ledger-home-body .app-footer { display: none; }
}
html[data-theme="dark"] { --ct-canvas: #0e2018; --ct-surface: #142b20; --ct-line: #34513e; --ct-line-soft: #244433; --ct-ink-950: #e2f3e7; --ct-ink-800: #cee5d5; --ct-ink-600: #a4c0ab; --ct-ink-500: #88a996; color-scheme: dark; }
html[data-theme="dark"] .app-topbar, html[data-theme="dark"] .form-card, html[data-theme="dark"] .table-card, html[data-theme="dark"] .modal-content { background: #142b20; color: #e2f3e7; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select, html[data-theme="dark"] .btn-outline-secondary { background: #0d2016; border-color: #3b5b45; color: #e3f3e8; }
html[data-theme="dark"] .form-control::placeholder { color: #91ad98; }
html[data-theme="dark"] .table { --bs-table-bg: #142b20; --bs-table-color: #d9ecde; --bs-table-border-color: #35503d; }
html[data-theme="dark"] .page-heading h1, html[data-theme="dark"] .form-card h2, html[data-theme="dark"] .table-card h2 { color: #e4f5e9; }
html[data-theme="dark"] .feature-card, html[data-theme="dark"] .metric-card, html[data-theme="dark"] .delivery-card, html[data-theme="dark"] .empty-state, html[data-theme="dark"] .customer-account-workspace { background: var(--ct-surface); border-color: var(--ct-line); color: var(--ct-ink-950); }
html[data-theme="dark"] .metric-card strong, html[data-theme="dark"] .delivery-card h2 { color: #adedae; }
html[data-theme="dark"] .feature-card > span { background: #214a2d; }
html[data-theme="dark"] .app-footer { background: #142b20; border-color: var(--ct-line); color: var(--ct-ink-600); }
html[data-theme="dark"] .text-muted, html[data-theme="dark"] .form-text { color: #a4c0ab !important; }
html[data-theme="dark"] .btn-outline-success { background: #123320; border-color: #59a867; color: #c1e7c7; }
html[data-theme="dark"] .btn-outline-success:hover { background: #24683a; color: #fff; }

/* Bootstrap 5.1 gives tables a fixed dark text color; update the actual color as well as its variables. */
html[data-theme="dark"] .app-body .table {
  --bs-table-bg: #142b20;
  --bs-table-striped-bg: #1b3929;
  --bs-table-striped-color: #e4f3e8;
  --bs-table-active-bg: #285139;
  --bs-table-active-color: #fff;
  --bs-table-hover-bg: #21472f;
  --bs-table-hover-color: #fff;
  border-color: #3b5b45;
  color: #e4f3e8;
}
html[data-theme="dark"] .app-body .table > thead > tr > th { background: #1b3a29; border-color: #42664b; color: #c1e1c9; }
html[data-theme="dark"] .app-body .table > tbody > tr:not([class*="table-"]):hover > td { background: #21472f; }
html[data-theme="dark"] .app-body .table > tfoot > tr > td { background: #1b3a29; border-color: #42664b; color: #e4f3e8; }
html[data-theme="dark"] .app-body .table > tbody > tr.table-light,
html[data-theme="dark"] .app-body .table > tbody > tr.table-secondary { --bs-table-bg: #253d2e; color: #e4f3e8; }
html[data-theme="dark"] .app-body .table td a:not(.btn) { color: #a8e2aa; }
html[data-theme="dark"] .app-body .table td a:not(.btn):hover { color: #e4f8de; }

html[data-theme="dark"] .app-body .eyebrow,
html[data-theme="dark"] .app-body .quantity-callout strong,
html[data-theme="dark"] .app-body .customer-contact-cell a,
html[data-theme="dark"] .app-body .location-status.success { color: #9edb91; }
html[data-theme="dark"] .app-body .metric-card strong { color: #bceeb6; }
html[data-theme="dark"] .app-body .feature-card > span { background: #244a30; color: #bceeb6; }
html[data-theme="dark"] .app-body .region-permission-option { background: #193727; border-color: #41674a; color: #e1f0e5; }
html[data-theme="dark"] .app-body .region-permission-option:has(.form-check-input:checked) { background: #28553a; border-color: #74af77; color: #f0ffef; }

html[data-theme="dark"] .app-body details:not(.admin-more-menu) { background: #193727; border-color: #41674a; color: #e3f2e7; }
html[data-theme="dark"] .app-body details:not(.admin-more-menu) > summary:not(.btn) { color: #bceeb6; }
html[data-theme="dark"] .app-body .accordion-item,
html[data-theme="dark"] .app-body .accordion-body,
html[data-theme="dark"] .app-body .accordion-button { background: #193727; border-color: #41674a; color: #e3f2e7; }
html[data-theme="dark"] .app-body .accordion-button:not(.collapsed) { background: #245137; color: #f0ffef; }
html[data-theme="dark"] .app-body .bg-light,
html[data-theme="dark"] .app-body .text-bg-light { background: #244331 !important; color: #e3f2e7 !important; }
html[data-theme="dark"] .app-body .order-number-heading:hover,
html[data-theme="dark"] .app-body .order-number-group[open] > .order-number-heading { background: #2a5038 !important; color: #f0ffef !important; }
html[data-theme="dark"] .app-body .pagination .page-link { background: #193727; border-color: #41674a; color: #c1e7c7; }
html[data-theme="dark"] .app-body .pagination .page-item.active .page-link { background: #2e8050; border-color: #2e8050; color: #fff; }
html[data-theme="dark"] .app-body .order-tree-chevron,
html[data-theme="dark"] .app-body .driver-order-title strong,
html[data-theme="dark"] .app-body .driver-order-location-row a,
html[data-theme="dark"] .app-body .driver-customer-distance strong { color: #a8e2aa; }
html[data-theme="dark"] .app-body .location-field-panel,
html[data-theme="dark"] .app-body .location-picker-readout,
html[data-theme="dark"] .app-body .quantity-callout,
html[data-theme="dark"] .app-body .route-selected-stop,
html[data-theme="dark"] .app-body .driver-exception-grid { background: #1c3c2a; border-color: #41674a; color: #e3f2e7; }
html[data-theme="dark"] .app-body .driver-city-button,
html[data-theme="dark"] .app-body .driver-location-toolbar,
html[data-theme="dark"] .app-body .driver-order-card,
html[data-theme="dark"] .app-body .driver-customer-card,
html[data-theme="dark"] .app-body .driver-map-legend { background: #142b20; border-color: #41674a; color: #e3f2e7; }
html[data-theme="dark"] .app-body .driver-city-button:hover,
html[data-theme="dark"] .app-body .driver-city-button.active { background: #2b8446; border-color: #6bb175; color: #fff; }
html[data-theme="dark"] .app-body .driver-order-card.visited { background: #1e422d; border-color: #4a8d59; }

/* Compact theme controls; generic details styling must not enlarge the picker. */
.app-body details.palette-menu,
.auth-body details.palette-menu { background: transparent !important; border: 0 !important; border-radius: 0; padding: 0 !important; }
.palette-menu > summary,
.theme-toggle { border: 1px solid var(--ct-line); border-radius: 7px; height: 29px; width: 29px; }
.palette-menu > summary { font-size: 0; padding: 0; }
.palette-menu > summary::after { background: conic-gradient(#27965a 0 25%,#3998b4 25% 50%,#9c65a9 50% 75%,#f2bc45 75%); border: 2px solid var(--ct-surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--ct-line); content: ""; height: 15px; width: 15px; }
.theme-toggle { align-items: center; display: inline-flex; font-size: .9rem; justify-content: center; padding: 0; }
.palette-options { max-height: min(315px, 65vh); min-width: 154px; overflow-y: auto; }
.palette-options button[aria-pressed="true"] { background: var(--theme-tint-strong); font-weight: 750; }
.palette-custom input { height: 23px; width: 30px; }
.topbar-account { gap: .4rem; }

/* The selected hue also reaches ordinary pages, controls and Bootstrap tables. */
html[data-theme="dark"] {
  --theme-tint: color-mix(in srgb, var(--ct-forest-900) 55%, #13231f);
  --theme-tint-strong: color-mix(in srgb, var(--ct-forest-800) 52%, #1b2d27);
  --theme-border: color-mix(in srgb, var(--ct-green-600) 33%, #38514b);
}
html[data-theme="light"] {
  --theme-tint: color-mix(in srgb, var(--ct-green-500) 7%, #fff);
  --theme-tint-strong: color-mix(in srgb, var(--ct-green-500) 15%, #fff);
  --theme-border: color-mix(in srgb, var(--ct-green-600) 20%, #dfe8e2);
}
html[data-theme="dark"][data-accent] {
  --ct-canvas: color-mix(in srgb, var(--ct-forest-950) 74%, #101615);
  --ct-surface: color-mix(in srgb, var(--ct-forest-900) 52%, #17211f);
  --ct-line: color-mix(in srgb, var(--ct-green-600) 28%, #3b4d47);
  --ct-line-soft: color-mix(in srgb, var(--ct-green-600) 20%, #2b4037);
}
html[data-theme="light"][data-accent] {
  --ct-canvas: color-mix(in srgb, var(--ct-green-500) 3%, #f7f9f7);
  --ct-line: color-mix(in srgb, var(--ct-green-600) 16%, #e1e8e3);
  --ct-line-soft: color-mix(in srgb, var(--ct-green-600) 9%, #eff2ef);
}
html[data-theme="dark"][data-accent] .app-body .app-topbar,
html[data-theme="dark"][data-accent] .app-body .app-footer { background: var(--ct-surface); border-color: var(--ct-line); color: var(--ct-ink-950); }
html[data-theme="dark"][data-accent] .app-body .form-control,
html[data-theme="dark"][data-accent] .app-body .form-select,
html[data-theme="dark"][data-accent] .app-body .btn-outline-secondary { background: var(--theme-tint); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"][data-accent] .app-body .logout-button,
html[data-theme="dark"][data-accent] .app-body .pagination .page-link,
html[data-theme="dark"][data-accent] .app-body details:not(.admin-more-menu):not(.palette-menu) { background: var(--theme-tint); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"][data-accent] .app-body .driver-city-button,
html[data-theme="dark"][data-accent] .app-body .driver-location-toolbar,
html[data-theme="dark"][data-accent] .app-body .driver-order-card,
html[data-theme="dark"][data-accent] .app-body .driver-customer-card,
html[data-theme="dark"][data-accent] .app-body .driver-map-legend { background: var(--ct-surface); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"][data-accent] .app-body .driver-city-button:hover,
html[data-theme="dark"][data-accent] .app-body .driver-city-button.active,
html[data-theme="dark"][data-accent] .app-body .pagination .page-item.active .page-link { background: var(--ct-green-700); border-color: var(--ct-green-700); color: #fff; }
html[data-theme="dark"][data-accent] .app-body .driver-order-card.visited,
html[data-theme="dark"][data-accent] .app-body .region-permission-option:has(.form-check-input:checked) { background: var(--theme-tint-strong); border-color: var(--ct-green-600); color: var(--ct-ink-950); }
html[data-theme="dark"][data-accent] .app-body .location-field-panel,
html[data-theme="dark"][data-accent] .app-body .location-picker-readout,
html[data-theme="dark"][data-accent] .app-body .route-selected-stop,
html[data-theme="dark"][data-accent] .app-body .driver-exception-grid { background: var(--theme-tint); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"][data-accent] .app-body .driver-order-location-row strong,
html[data-theme="dark"][data-accent] .app-body .route-selected-stop > strong { background: var(--theme-tint-strong); color: var(--ct-lime-400); }
html[data-accent] {
  --ct-green-050: color-mix(in srgb, var(--ct-green-500) 9%, #fff);
  --ct-green-800: color-mix(in srgb, var(--ct-green-700) 75%, #173325);
}
html[data-accent] .app-sidebar { background: linear-gradient(180deg,var(--ct-forest-950),var(--ct-forest-900)) !important; }
@media (min-width: 992px) { html[data-accent] .app-admin .app-sidebar { background: linear-gradient(90deg,var(--ct-forest-950),var(--ct-forest-900)) !important; } }
html[data-accent] .app-body .app-nav-link.active,
html[data-accent] .app-body .btn-success,
html[data-accent] .app-body .bg-success,
html[data-accent] .app-body .page-link.active,
html[data-accent] .app-body .form-check-input:checked { background-color: var(--ct-green-700) !important; border-color: var(--ct-green-700) !important; }
html[data-accent] .app-body .btn-success:hover { background-color: var(--ct-green-800) !important; border-color: var(--ct-green-800) !important; }
html[data-accent] .app-body .btn-outline-success { border-color: var(--ct-green-600); color: var(--ct-green-700); }
html[data-accent] .app-body .btn-outline-success:hover { background: var(--ct-green-700); color: #fff; }
html[data-theme="dark"][data-accent] .app-body .btn-outline-success { background: var(--theme-tint); border-color: var(--ct-green-500); color: var(--ct-lime-400); }
html[data-theme="dark"][data-accent] .app-body .btn-outline-success:hover { background: var(--ct-green-700); border-color: var(--ct-green-700); color: #fff; }
html[data-accent] .app-body .text-success { color: var(--ct-green-700) !important; }
html[data-theme="dark"] .app-body .text-success { color: var(--ct-lime-400) !important; }
html[data-theme="dark"] .app-body .table,
html[data-theme="dark"] .app-body .table > :not(caption) > * > * { background-color: var(--theme-tint); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"] .app-body .table > thead > tr > th,
html[data-theme="dark"] .app-body .table > tfoot > tr > td,
html[data-theme="dark"] .app-body .table > tbody > tr.table-light > td,
html[data-theme="dark"] .app-body .table > tbody > tr.table-secondary > td { background-color: var(--theme-tint-strong); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"] .app-body .table > tbody > tr:hover > td { background-color: var(--theme-tint-strong); }
html[data-theme="dark"] .app-body .table > tbody > tr.table-warning > td { background-color: color-mix(in srgb,#bd852a 25%,var(--theme-tint)); color: #f9eacb; }
html[data-theme="light"] .app-body .table > thead > tr > th,
html[data-theme="light"] .app-body .table > tfoot > tr > td { background-color: var(--theme-tint); border-color: var(--theme-border); color: var(--ct-ink-800); }
html[data-theme="light"] .app-body .table > tbody > tr:hover > td { background-color: var(--theme-tint); }
html[data-theme="light"] .app-body .table > tbody > tr.table-warning > td { background-color: #fff3d6; color: #543b0b; }
html[data-theme="light"] .app-body .status-pill,
html[data-theme="light"] .app-body .feature-card > span,
html[data-theme="light"] .app-body .quantity-callout,
html[data-theme="light"] .app-body .driver-order-location-row strong,
html[data-theme="light"] .app-body .driver-delivered-badge,
html[data-theme="light"] .app-body .route-selected-stop > strong { background: var(--theme-tint-strong); color: var(--ct-green-800); }
html[data-theme="light"] .app-body .customer-account-workspace,
html[data-theme="light"] .app-body .location-field-panel,
html[data-theme="light"] .app-body .location-picker-readout,
html[data-theme="light"] .app-body .route-selected-stop,
html[data-theme="light"] .app-body .driver-exception-grid,
html[data-theme="light"] .app-body .region-permission-option:has(.form-check-input:checked) { background: var(--theme-tint); border-color: var(--theme-border); }
html[data-theme="light"] .app-body .driver-order-card.visited,
html[data-theme="light"] .app-body .accordion-button:not(.collapsed) { background: var(--theme-tint-strong); border-color: var(--theme-border); color: var(--ct-ink-950); }
html[data-theme="dark"] .app-body .status-pill,
html[data-theme="dark"] .app-body .quantity-callout,
html[data-theme="dark"] .app-body .driver-delivered-badge { background: var(--theme-tint-strong); border-color: var(--theme-border); color: var(--ct-lime-400); }
html[data-theme="dark"] .app-body .form-card,
html[data-theme="dark"] .app-body .table-card,
html[data-theme="dark"] .app-body .modal-content,
html[data-theme="dark"] .app-body .accordion-item,
html[data-theme="dark"] .app-body .accordion-body,
html[data-theme="dark"] .app-body .accordion-button,
html[data-theme="dark"] .app-body .bg-light { background: var(--theme-tint) !important; border-color: var(--theme-border) !important; color: var(--ct-ink-950) !important; }
html[data-theme="dark"] .app-body .card-header,
html[data-theme="dark"] .app-body .modal-header,
html[data-theme="dark"] .app-body .accordion-button:not(.collapsed) { background: var(--theme-tint-strong); border-color: var(--theme-border); color: var(--ct-ink-950); }

/* Present the sign-in form immediately, with a clear reading path and focus. */
.auth-form-panel { background: radial-gradient(circle at 82% 12%, color-mix(in srgb,var(--ct-green-500) 9%,#fff),transparent 45%), #f7faf7; }
.auth-appearance { align-items: center; display: flex; gap: .4rem; position: absolute; right: clamp(1rem,2.4vw,2.2rem); top: clamp(1rem,2.4vw,2.2rem); z-index: 5; }
.auth-form-wrap { background: #fff; border: 1px solid #dfebe1; border-radius: 22px; box-shadow: 0 24px 70px rgba(12,55,32,.09); color: #183b28; max-width: 492px; padding: clamp(1.55rem,3vw,2.7rem); }
.auth-form-wrap h2 { color: #183b28; }
.auth-form-wrap .form-label,
.auth-form-wrap .remember-option { color: #274734; }
.auth-form-wrap .auth-form-intro,
.auth-form-wrap .auth-security-note small { color: #5b7163; }
.auth-form .field-control .form-control:focus { border-color: var(--ct-green-600); box-shadow: 0 0 0 .2rem color-mix(in srgb,var(--ct-green-500) 16%,transparent); }
.auth-submit:focus-visible,
.password-toggle:focus-visible { outline: 3px solid var(--ct-lime-400); outline-offset: 3px; }
html[data-theme][data-accent] .auth-form-wrap { border-color: var(--theme-border); }
html[data-theme][data-accent] .auth-form-panel { background: radial-gradient(circle at 80% 12%,color-mix(in srgb,var(--ct-green-500) 12%,transparent),transparent 46%),var(--ct-canvas); }
html[data-theme][data-accent] .auth-form-kicker { color: var(--ct-green-700); }
html[data-theme][data-accent] .auth-kicker,
html[data-theme][data-accent] .auth-feature-list > div > span { color: var(--ct-lime-400); }
html[data-theme][data-accent] .auth-submit { background: linear-gradient(105deg,var(--ct-forest-900),var(--ct-green-700)); }
html[data-theme][data-accent] .auth-security-note { background: var(--theme-tint); border-color: var(--theme-border); }
html[data-theme][data-accent] .auth-security-note > span { background: var(--theme-tint-strong); color: var(--ct-green-700); }
@media (max-width: 575px) {
  .auth-form-panel { padding: 1rem; }
  .auth-form-wrap { border-radius: 17px; margin-top: 2.5rem; padding: 1.5rem; }
}
html[data-theme="dark"] .auth-form-panel { background: var(--ct-canvas); }
html[data-theme="dark"] .auth-form-wrap { background: var(--ct-surface); border-color: var(--theme-border); color: #e5f3e9; }
html[data-theme="dark"] .auth-appearance .theme-toggle { color: var(--ct-ink-950); }
html[data-theme="dark"] .auth-appearance .palette-options { background: var(--ct-surface); color: var(--ct-ink-950); }
html[data-theme="dark"] .auth-form-kicker { color: var(--ct-lime-400) !important; }
html[data-theme="dark"] .auth-form-wrap h2,
html[data-theme="dark"] .auth-form-wrap .form-label,
html[data-theme="dark"] .auth-form-wrap .remember-option,
html[data-theme="dark"] .auth-form-wrap .auth-security-note strong { color: #e5f3e9; }
html[data-theme="dark"] .auth-form-wrap .auth-form-intro,
html[data-theme="dark"] .auth-form-wrap .auth-security-note small { color: #afc9b6; }
html[data-theme="dark"] .auth-form-wrap .form-control { background: var(--theme-tint); border-color: var(--theme-border); color: #f1fff3; }
html[data-theme="dark"] .auth-form-wrap .auth-security-note { background: var(--theme-tint-strong); border-color: var(--theme-border); }
html[data-theme="dark"] .app-body .driver-branch-search .form-label,
html[data-theme="dark"] .app-body .driver-customer-copy p { color: #c3e4cb; }
html[data-theme="dark"] .app-body .driver-order-location-row strong,
html[data-theme="dark"] .app-body .route-selected-stop > strong { background: #28563b; color: #d5f3d4; }
html[data-theme="dark"] .app-body .leaflet-popup-content-wrapper { color: #1c3525; }

/* Font selection must win over Bootstrap and page-specific typography. */
html[data-font-family] body { --bs-body-font-family: var(--ct-font-family); font-family: var(--ct-font-family) !important; }
html[data-font-family] body :is(a, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, label, summary, small, strong, li) {
  font-family: var(--ct-font-family) !important;
}

/* Generic details cards otherwise add padding around the tiny appearance control. */
.app-body details.font-menu, .auth-body details.font-menu,
html[data-theme="dark"] .app-body details.font-menu {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 0 0 29px;
  height: 29px;
  margin: 0 !important;
  padding: 0 !important;
  width: 29px;
}
.app-body .font-menu > summary, .auth-body .font-menu > summary {
  box-sizing: border-box;
  font-size: 11px !important;
  height: 29px !important;
  line-height: 1;
  min-height: 29px;
  min-width: 29px;
  padding: 0 !important;
  width: 29px !important;
}
