/* ═══ Design Tokens ═══ */
:root {
  --bg: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.06);
  --line-strong: rgba(15, 23, 42, 0.1);
  --line-focus: hsla(354, 76%, 50%, 0.4);
  --ink: #0f172a;
  --ink2: #475569;
  --ink3: #94a3b8;
  --accent: hsl(354, 76%, 50%);
  --accent-hover: hsl(354, 76%, 42%);
  --accent-soft: hsla(354, 76%, 50%, 0.06);
  --accent-ring: hsla(354, 76%, 50%, 0.15);
  --cyan: hsl(182, 70%, 42%);
  --cyan-soft: hsla(182, 70%, 42%, 0.08);
  --green: hsl(142, 70%, 45%);
  --green-soft: hsla(142, 70%, 45%, 0.08);
  --red: hsl(354, 76%, 50%);
  --red-soft: hsla(354, 76%, 50%, 0.06);
  --amber: hsl(38, 92%, 50%);
  --amber-soft: hsla(38, 92%, 50%, 0.08);
  --blue: hsl(217, 91%, 56%);
  --blue-soft: hsla(217, 91%, 56%, 0.06);
  --r: 16px;
  --r-sm: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.03), 0 2px 8px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  --tr: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══ Base ═══ */
*,*::before,*::after{box-sizing:border-box}
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: .92rem;
  line-height: 1.6;
}
h1,h2,h3,h4,h5,h6 {
  letter-spacing: 0;
  color: var(--ink);
}
.htmx-indicator {
  position: fixed; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), #ff5f6d, var(--accent));
  background-size: 200% 100%;
  opacity: 0; transition: opacity 0.3s ease; z-index: 10000;
  pointer-events: none;
}
.htmx-indicator.htmx-request {
  opacity: .85; animation: loading-bar 1.2s infinite linear;
  transition-delay: .2s;
}
@keyframes loading-bar { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* ═══ Navbar ═══ */
.app-navbar {
  background: rgba(255,255,255,.9) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.72), 0 12px 34px rgba(15,23,42,.045);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  padding: .45rem 0;
}
.app-navbar .container, .app-main { max-width: 1168px; }
.navbar-brand {
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  color: var(--accent) !important;
  letter-spacing: 0;
}
.brand-lockup { display: inline-flex; align-items: center; gap: .55rem; }
.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  background-image: url("/static/brand/fianit-lombard.jpg");
  background-repeat: no-repeat;
  background-size: 220px auto;
  background-position: -16px -37px;
  background-color: #fff;
  border: 1px solid rgba(226,28,42,.18);
  box-shadow: 0 8px 18px rgba(226,28,42,.14);
}
.navbar-nav { gap: .1rem; }
.navbar-nav .nav-link {
  color: var(--ink2) !important;
  font-weight: 700;
  font-size: .85rem;
  border-radius: var(--r-sm);
  padding: .45rem .72rem !important;
  transition: all var(--tr);
}
.navbar-nav .nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent) !important;
}
.app-nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: .45rem;
}
.app-nav-link.is-active {
  background: #fff;
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px rgba(226,28,42,.18), 0 5px 14px rgba(226,28,42,.08);
}
.nav-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 5px;
  background: var(--accent-soft);
}
.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  opacity: .82;
}
.nav-icon::before { top: 5px; }
.nav-icon::after { top: 9px; }
.nav-icon-driver {
  background: var(--green-soft);
  border-radius: 4px;
}
.nav-icon-driver::before {
  left: 3px;
  right: 3px;
  top: 5px;
}
.nav-icon-driver::after {
  left: 4px;
  right: auto;
  top: 10px;
  width: 8px;
}
.nav-icon-admin {
  background: var(--amber-soft);
  border-radius: 99px;
}
.nav-icon-admin::before {
  left: 7px;
  right: auto;
  top: 3px;
  width: 2px;
  height: 10px;
}
.nav-icon-admin::after {
  left: 3px;
  right: auto;
  top: 7px;
  width: 10px;
  height: 2px;
}
.navbar-toggler { border-color: var(--line); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23475569' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ═══ Cards & Surfaces ═══ */
.glass, .hero-panel, .section-block, .toolbar, .request-form,
.role-card, .branch-card, .demand-card, .delivery-line,
.admin-panel, .admin-sidebar, .metric-card, .visit-status, .soft-panel, .role-guide {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(130%) blur(12px);
  transition: box-shadow var(--tr), border-color var(--tr), transform var(--tr);
}

/* ═══ Buttons ═══ */
.btn {
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: .85rem;
  padding: .48rem .9rem;
  transition: all var(--tr);
  border: 1px solid transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary, .btn-primary:hover, .btn-primary:focus {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(226,28,42,.16);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline-primary { color: var(--accent); border-color: rgba(226,28,42,.24); background: rgba(255,255,255,.72); }
.btn-outline-primary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-outline-secondary { color: var(--ink2); border-color: var(--line-strong); background: rgba(255,255,255,.72); }
.btn-outline-secondary:hover { background: rgba(100,116,139,.05); color: var(--ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #0f172a; transform: translateY(-1px); }
.btn-outline-danger { color: var(--red); border-color: rgba(239,68,68,.25); }
.btn-outline-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-outline-success { color: #16a34a; border-color: rgba(34,197,94,.25); }
.btn-outline-success:hover { background: var(--green-soft); border-color: var(--green); }
.btn-lg { padding: .55rem 1.15rem; font-size: .92rem; border-radius: var(--r); }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
  outline: 3px solid rgba(226, 28, 42, .28);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(226, 28, 42, .08) !important;
}

/* ═══ Forms ═══ */
.form-control, .form-select {
  border-radius: var(--r-sm);
  border: 1px solid rgba(31,41,55,.14);
  background: rgba(255,255,255,.96);
  color: var(--ink);
  font-size: .88rem;
  padding: .5rem .7rem;
  transition: all var(--tr);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.form-control:focus, .form-select:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: #fff;
}
.form-label { font-weight: 700; font-size: .78rem; color: var(--ink2); margin-bottom: .25rem; }
.form-control-lg, .form-select-lg { padding: .55rem .85rem; font-size: .92rem; border-radius: var(--r); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

.mobile-role-nav {
  display: none;
}

/* ═══ Alerts ═══ */
.alert { border-radius: var(--r); border: 1px solid transparent; font-weight: 600; font-size: .88rem; padding: .7rem 1rem; box-shadow: var(--shadow); }
.alert-success { background: var(--green-soft); color: #15803d; }
.alert-danger { background: var(--red-soft); color: #b91c1c; }
.alert-warning { background: var(--amber-soft); color: #92400e; }
.alert a { color: inherit; font-weight: 700; }
.app-toast-container {
  z-index: 1055;
  width: min(360px, calc(100vw - 1rem));
}
.app-toast {
  overflow: hidden;
  margin-bottom: .55rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .04);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.app-toast-row {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem .8rem;
}
.app-toast-marker {
  width: 6px;
  height: 38px;
  border-radius: 99px;
  background: var(--accent);
}
.app-toast-success .app-toast-marker { background: var(--green); }
.app-toast-warning .app-toast-marker { background: var(--amber); }
.app-toast-danger .app-toast-marker { background: var(--red); }
.app-toast-info .app-toast-marker,
.app-toast-primary .app-toast-marker { background: var(--blue); }
.app-toast-body {
  min-width: 0;
}
.app-toast-title {
  display: block;
  margin-bottom: .12rem;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.2;
}
.app-toast-message {
  color: var(--ink2);
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.28;
}
.app-toast-close {
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
  background-color: rgba(15, 23, 42, .05);
  opacity: .72;
}
.app-toast-close:hover {
  opacity: 1;
  background-color: rgba(15, 23, 42, .08);
}
.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.app-confirm-dialog {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25), 0 4px 12px rgba(15, 23, 42, .08);
}
.app-confirm-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(226, 28, 42, .1);
  position: relative;
}
.app-confirm-icon::before,
.app-confirm-icon::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 9px;
  width: 3px;
  height: 14px;
  border-radius: 99px;
  background: var(--accent);
}
.app-confirm-icon::after {
  top: 26px;
  height: 3px;
}
.app-confirm-content h2 {
  margin: 0 0 .2rem;
  font-size: 1rem;
  font-weight: 900;
}
.app-confirm-content p {
  margin: 0;
  color: var(--ink2);
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.35;
}
.app-confirm-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .2rem;
}
.app-confirm-actions .btn {
  min-height: 44px;
}

/* ═══ Page Header ═══ */
.page-header {
  display: flex; flex-direction: column; gap: .75rem;
  margin-bottom: 1rem;
}
@media(min-width:992px) {
  .page-header { flex-direction: row; justify-content: space-between; align-items: end; }
}

/* ═══ Role Guidance ═══ */
.role-guide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr);
  gap: .85rem;
  align-items: start;
  padding: .95rem 5.25rem .95rem 1rem;
  margin-bottom: 1rem;
  border-color: rgba(226,28,42,.12);
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(226,28,42,.035) 48%, rgba(21,159,164,.045));
}
.role-guide-toggle {
  position: absolute;
  top: .7rem;
  right: .75rem;
  min-width: 64px;
  min-height: 30px;
  border: 1px solid rgba(100,116,139,.14);
  border-radius: 7px;
  background: rgba(255,255,255,.78);
  color: var(--ink2);
  font-size: .76rem;
  font-weight: 700;
  transition: all var(--tr);
}
.role-guide-toggle:hover {
  background: #fff;
  color: var(--accent);
  border-color: rgba(239,35,42,.22);
}
.role-guide.is-collapsed {
  grid-template-columns: 1fr;
  padding-block: .65rem;
}
.role-guide.is-collapsed .role-guide-title span,
.role-guide.is-collapsed .role-guide-steps {
  display: none;
}
.role-guide-title {
  display: grid;
  gap: .2rem;
}
.role-guide-title strong {
  font-size: .92rem;
}
.role-guide-title span,
.role-guide-step span {
  color: var(--ink3);
  font-size: .78rem;
}
.role-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}
.role-guide-step {
  min-width: 0;
  padding: .62rem .72rem;
  border: 1px solid rgba(31,41,55,.08);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.82);
  box-shadow: 0 1px 0 rgba(255,255,255,.76);
}
.role-guide-step strong {
  display: block;
  font-size: .82rem;
  margin-bottom: .15rem;
}

/* ═══ Hero (home) ═══ */
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  gap: 1.25rem;
  align-items: center;
  padding: 1.3rem;
  background:
    linear-gradient(135deg, rgba(226,28,42,.08) 0%, rgba(255,255,255,.96) 52%, rgba(21,159,164,.1) 100%);
  border-color: rgba(226,28,42,.13);
  overflow: hidden;
}
.hero-panel h1 { font-size: 1.65rem; line-height: 1.2; color: var(--accent); }
.hero-panel .lead { color: var(--ink2); font-size: .9rem; max-width: 600px; }
.hero-panel .eyebrow-label {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .55rem;
  border-radius: 5px;
  margin-bottom: .5rem;
}
.hero-copy { min-width: 0; }
.hero-brand-card {
  min-height: 176px;
  border-radius: var(--r);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(239,35,42,.12);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
.hero-brand-card img {
  width: 100%;
  height: 100%;
  min-height: 176px;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ═══ Role Cards ═══ */
.role-card {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
}
.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  opacity: 0.8;
  transform: scaleY(0);
  transition: transform var(--tr);
  transform-origin: bottom;
  border-radius: 0 4px 4px 0;
}
.role-card:hover {
  border-color: hsla(354, 76%, 50%, 0.25);
  box-shadow: var(--shadow-lg), 0 10px 30px hsla(354, 76%, 50%, 0.04);
  transform: translateY(-4px);
  color: inherit;
  text-decoration: none;
}
.role-card:hover::before {
  transform: scaleY(1);
}
.role-card.driver::before {
  background: var(--green);
}
.role-card.driver:hover {
  border-color: hsla(142, 70%, 45%, 0.25);
  box-shadow: var(--shadow-lg), 0 10px 30px hsla(142, 70%, 45%, 0.04);
}
.role-card.admin::before {
  background: var(--amber);
}
.role-card.admin:hover {
  border-color: hsla(38, 92%, 50%, 0.25);
  box-shadow: var(--shadow-lg), 0 10px 30px hsla(38, 92%, 50%, 0.04);
}
.role-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--tr);
}
.role-card:hover .role-icon {
  transform: scale(1.08);
}
.role-icon::before,
.role-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
}
.role-icon::before { top: 12px; }
.role-icon::after { top: 19px; }
.role-icon-driver {
  background: var(--green-soft);
  color: #16a34a;
}
.role-icon-driver::before { left: 8px; right: 8px; top: 12px; }
.role-icon-driver::after { left: 10px; right: auto; top: 20px; width: 14px; }
.role-icon-admin {
  background: var(--amber-soft);
  color: #d97706;
  border-radius: 99px;
}
.role-icon-admin::before {
  left: 15px;
  right: auto;
  top: 8px;
  width: 3px;
  height: 18px;
}
.role-icon-admin::after {
  left: 8px;
  right: auto;
  top: 15px;
  width: 18px;
  height: 3px;
}
.role-title { font-size: 1rem; font-weight: 700; }
.role-text { color: var(--ink2); font-size: .84rem; line-height: 1.45; }

/* ═══ Toolbar ═══ */
.toolbar { padding: 1rem; margin-bottom: 1rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.search-hint { margin-top: .5rem; color: var(--ink2); font-size: .85rem; }
.filter-check { min-height: 40px; display: flex; align-items: center; gap: .4rem; }
.branch-pill {
  margin-top: .6rem; padding: .5rem .7rem;
  background: #fff; border: 1px solid rgba(226,28,42,.14); border-radius: var(--r-sm);
  color: var(--accent-hover); font-weight: 500; font-size: .85rem;
}

/* ═══ Section Block ═══ */
.section-block { padding: 1rem; margin-bottom: 1rem; }
.section-heading {
  display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; margin-bottom: .75rem;
}
.section-filter {
  width: min(100%, 260px);
  flex: 0 1 260px;
}
.section-filter .form-control {
  min-height: 34px;
  font-size: .82rem;
}
.client-filter-empty {
  margin-top: .5rem;
}

/* ═══ Demand Cards ═══ */
.demand-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: .85rem; box-shadow: var(--shadow);
  height: 100%; transition: all var(--tr);
}
.demand-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.demand-grid, .driver-stats, .delivery-metrics {
  display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem;
}
.demand-grid div, .driver-stats div {
  background: rgba(245,247,251,.84); border: 1px solid rgba(31,41,55,.06); border-radius: 6px; padding: .45rem .55rem;
}
.demand-grid span, .driver-stats span {
  display: block; color: var(--ink3); font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.demand-grid strong, .driver-stats strong { display: block; font-size: 1.15rem; margin-top: .1rem; }

/* ═══ List & History ═══ */
.list-group-item {
  border: 1px solid var(--line); border-radius: var(--r) !important;
  margin-bottom: .4rem; padding: .75rem; background: var(--surface); transition: all var(--tr);
}
.list-group-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.line-chip {
  display: inline-block; background: rgba(226,28,42,.07); color: var(--accent-hover);
  border: 1px solid rgba(226,28,42,.1);
  border-radius: 5px; padding: .15rem .45rem; margin: .1rem; font-weight: 600; font-size: .78rem;
}
.empty-state {
  background: rgba(245,247,251,.82); border: 1px dashed rgba(82,96,114,.24);
  border-radius: var(--r); padding: 1.15rem; color: var(--ink3);
  text-align: center; font-weight: 500; font-size: .88rem;
}

/* ═══ Request Form ═══ */
.request-form { padding: 1.15rem; }
.request-line {
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) minmax(160px, .42fr) minmax(200px, .95fr) 44px;
  gap: 1.25rem;
  align-items: start;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: .78rem; background: rgba(255,255,255,.72); transition: all var(--tr);
  position: relative;
  z-index: 1;
}
.request-line.is-suggestions-open {
  z-index: 100;
}
.request-line:hover { border-color: rgba(226,28,42,.16); box-shadow: 0 8px 22px rgba(15,23,42,.045); }
.request-line.has-duplicate { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.04); }
.request-line-field { display: grid; gap: .35rem; min-width: 0; }
.request-line-field .form-label { margin-bottom: 0; min-height: 19px; }
.request-line-field .form-control,
.request-line-field .form-select { min-height: 42px; }
.request-qty-stepper {
  display: grid;
  grid-template-columns: 42px minmax(72px, 1fr) 42px;
  gap: .35rem;
}
.request-qty-stepper .btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
  border-radius: var(--r-sm);
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--line);
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
}
.request-qty-stepper .btn:hover {
  background: rgba(15, 23, 42, 0.06);
  border-color: var(--line-strong);
  color: var(--ink);
}
.request-qty-stepper .btn:active {
  transform: scale(0.92);
}
.request-qty-stepper .form-control {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  height: 42px;
}
.request-qty-stepper input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.request-qty-stepper input[type="number"]::-webkit-outer-spin-button,
.request-qty-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.request-qty-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .3rem;
  margin-top: .4rem;
}
.request-qty-presets button {
  min-height: 28px;
  border: 1px solid rgba(226, 28, 42, 0.08);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: .78rem;
  transition: all var(--tr);
}
.request-qty-presets button:hover {
  background: rgba(226, 28, 42, 0.12);
  border-color: rgba(226, 28, 42, 0.24);
  transform: translateY(-1px);
}
.request-qty-presets button:active {
  transform: translateY(0) scale(0.95);
}
.request-line-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
}
.request-line-remove .btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(226,28,42,.15);
  color: var(--red);
  box-shadow: 0 4px 12px rgba(226,28,42,.08);
  transition: all var(--tr);
}
.request-line-remove .btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: scale(1.05) rotate(90deg);
  box-shadow: 0 8px 20px rgba(226,28,42,.2);
}
.request-line-remove .btn:active {
  transform: scale(0.95);
}
.selected-item-preview {
  min-height: 18px;
  line-height: 1.25;
}
.duplicate-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(245,158,11,.24);
  border-radius: var(--r-sm);
  background: var(--amber-soft);
  color: hsl(38, 92%, 35%);
  font-size: .84rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(245,158,11,.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: slide-down-fade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes slide-down-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.duplicate-warning .btn {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: hsl(38, 92%, 35%);
  border-radius: 8px;
  font-weight: 700;
  padding: .35rem .75rem;
  font-size: .78rem;
  box-shadow: 0 2px 6px rgba(245,158,11,.08);
}
.duplicate-warning .btn:hover {
  background: hsl(38, 92%, 50%);
  color: #fff;
  border-color: hsl(38, 92%, 50%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,.2);
}
.duplicate-warning .btn:active {
  transform: translateY(0) scale(0.97);
}
.item-picker {
  position: relative;
  min-width: 0;
}
.item-search {
  min-height: 42px;
}
.item-suggestions {
  position: absolute;
  z-index: 200;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 45vh;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);
  padding: .3rem;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  animation: pop-suggestion var(--tr);
}
@keyframes pop-suggestion {
  from { opacity: 0; transform: translateY(4px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.item-suggestion {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .15rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: .55rem .7rem;
  text-align: left;
  transition: background-color var(--tr), transform var(--tr);
  cursor: pointer;
}
.item-suggestion:not(:last-child) {
  margin-bottom: 2px;
}
.item-suggestion:hover,
.item-suggestion.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.item-suggestion:active {
  transform: scale(0.995);
}
.item-suggestion-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: .88rem;
}
.item-suggestion-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink3);
  font-size: .76rem;
  transition: color var(--tr);
}
.item-suggestion:hover .item-suggestion-meta,
.item-suggestion.is-active .item-suggestion-meta {
  color: hsla(354, 76%, 50%, 0.85);
}
.item-search-empty {
  min-height: 18px;
}
.history-actions {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.request-submit-bar { display: flex; }

/* ═══ Branch Cards (Driver) ═══ */
.branch-card {
  height: 100%; padding: 1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.branch-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.branch-card .badge { align-self: flex-start; }
.branch-card-active { border-color: rgba(226,28,42,.18); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.driver-compact-header {
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: .65rem;
}
.driver-compact-header h1 {
  font-size: 1.55rem;
}
.driver-print-shortcut {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.driver-route-controls {
  padding: .85rem;
  margin-bottom: .75rem;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.driver-control-grid {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(240px, 1.4fr) minmax(130px, auto) minmax(110px, auto);
  gap: .55rem;
  align-items: end;
}
.driver-control-toggle {
  min-height: 39px;
  display: flex;
  align-items: center;
}
.driver-control-toggle .form-check {
  margin: 0;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.driver-control-toggle .form-check-label {
  color: var(--ink2);
  font-size: .84rem;
  font-weight: 700;
}
.driver-summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin-bottom: .75rem;
}
.driver-summary-strip div {
  min-height: 64px;
  padding: .6rem .7rem;
}
.driver-summary-strip span {
  font-size: .66rem;
}
.driver-summary-strip strong {
  font-size: 1.15rem;
  line-height: 1.15;
}

/* ═══ Route Summary ═══ */
.route-summary {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: .6rem; margin-bottom: 1rem;
}
.route-summary div {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: .75rem; box-shadow: var(--shadow);
}
.route-summary span {
  display: block; color: var(--ink3); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.route-summary strong { display: block; font-size: 1.3rem; margin-top: .15rem; }

/* ═══ Visit / Delivery ═══ */
.visit-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(130%) blur(12px);
  -webkit-backdrop-filter: saturate(130%) blur(12px);
  transition: all var(--tr);
}
.visit-status .badge {
  font-weight: 700;
  padding: .35rem .65rem;
  border-radius: 8px;
}
.visit-workflow {
  display: grid;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow);
}
.visit-workflow-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: start;
}
.visit-workflow-head strong {
  display: block;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 900;
}
.visit-workflow-head span {
  display: block;
  color: var(--ink2);
  font-size: .82rem;
  line-height: 1.35;
}
.visit-workflow-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}
.visit-workflow-counts span {
  padding: .35rem .55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .04);
  color: var(--ink2);
  font-size: .78rem;
  font-weight: 750;
}
.visit-workflow-counts strong {
  display: inline;
  font-size: inherit;
}
.visit-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
}
.visit-step {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  padding: .55rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .06);
  background: rgba(248, 250, 252, .9);
  color: #64748b;
}
.visit-step span {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(100, 116, 139, .12);
  font-size: .74rem;
  font-weight: 900;
}
.visit-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 850;
}
.visit-step.is-active {
  border-color: rgba(226, 28, 42, .22);
  background: rgba(226, 28, 42, .06);
  color: #991b1b;
}
.visit-step.is-active span {
  background: #e21c2a;
  color: #fff;
}
.visit-step.is-done {
  border-color: rgba(34, 197, 94, .22);
  background: rgba(34, 197, 94, .07);
  color: #166534;
}
.visit-step.is-done span {
  background: #22c55e;
  color: #fff;
}
.visit-step.is-muted {
  opacity: .72;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink3);
  display: inline-block;
}
.status-dot-active {
  background: var(--green) !important;
  box-shadow: 0 0 10px var(--green);
  animation: status-pulse 2s infinite ease-in-out;
}
@keyframes status-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.delivery-line {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 380px);
  gap: .75rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: all var(--tr);
}
.delivery-line:hover {
  border-color: hsla(182, 70%, 42%, 0.25);
  box-shadow: var(--shadow-lg), 0 10px 30px hsla(182, 70%, 42%, 0.03);
  transform: translateY(-1px);
}
.delivery-line-saved {
  border-color: rgba(34, 197, 94, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(34, 197, 94, 0.02) 100%);
}
.delivery-mobile-quick {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  margin-bottom: .55rem;
}
.delivery-mobile-quick .btn {
  min-height: 46px;
  font-size: .88rem;
  font-weight: 850;
}
.delivery-metrics {
  margin-top: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.delivery-metrics span {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 8px;
  padding: .35rem .6rem;
  font-size: .82rem;
  color: var(--ink2);
}
.delivery-metrics span strong {
  color: var(--ink);
}
.saved-delivery {
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  color: hsl(142, 70%, 30%);
  font-weight: 500;
  font-size: .88rem;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.04);
}
.saved-delivery-reason {
  margin-top: .35rem;
  color: var(--ink2);
  font-size: .78rem;
  font-weight: 600;
  border-top: 1px dashed rgba(34, 197, 94, 0.2);
  padding-top: .35rem;
}
.visit-close-panel {
  border-color: rgba(239, 68, 68, .22) !important;
  background: rgba(239, 68, 68, .04) !important;
}
.visit-close-label {
  width: fit-content;
  margin-bottom: .25rem;
  padding: .18rem .45rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, .1);
  color: #991b1b;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.visit-close-panel h3 {
  color: #991b1b;
  font-weight: 900;
}
.visit-close-button {
  min-height: 46px;
  font-weight: 850;
}
.delivery-reason {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  gap: .25rem;
  margin: 0;
  display: grid;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease-out,
              transform 0.25s ease-out,
              margin 0.3s ease;
}
.delivery-reason.is-visible {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
  margin-top: .6rem;
}
.delivery-reason span {
  color: var(--ink3);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.driver-actions {
  position: sticky;
  bottom: 1.25rem;
  z-index: 4;
  display: grid;
  gap: .65rem;
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  animation: slide-up-actions 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes slide-up-actions {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.driver-action-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem .75rem;
  color: var(--ink2);
  font-size: .82rem;
  font-weight: 600;
}
.driver-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.driver-action-buttons .btn {
  min-height: 44px;
}
.driver-primary-action {
  flex: 1 1 220px;
  font-weight: 900 !important;
}
.driver-secondary-action {
  flex: 0 1 170px;
}
.delivery-live-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
}
.delivery-live-summary span {
  min-width: 0;
  padding: .5rem .65rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink2);
  font-size: .8rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.delivery-live-summary strong {
  color: var(--ink);
}

/* ═══ Printable Route Sheet ═══ */
.route-print-toolbar {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .85rem;
}
.route-print-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.route-sheet {
  display: grid;
  gap: .85rem;
}
.route-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.route-sheet-stamp {
  flex: 0 0 auto;
  padding: .25rem .55rem;
  border: 1px solid rgba(226,28,42,.2);
  border-radius: var(--r-sm);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
}
.route-stop-list {
  display: grid;
  gap: .7rem;
}
.route-stop {
  break-inside: avoid;
  padding: .85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.route-stop-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .6rem;
}
.route-stop-head h3 {
  margin: 0;
  font-size: 1rem;
}
.route-stop-head p {
  margin: .15rem 0 0;
  color: var(--ink2);
  font-size: .82rem;
}
.route-stop-meta {
  flex: 0 0 auto;
  min-width: 86px;
  text-align: right;
}
.route-stop-meta strong,
.route-stop-meta span {
  display: block;
}
.route-stop-meta span {
  color: var(--ink3);
  font-size: .76rem;
  font-weight: 700;
}
.route-stop-actions {
  margin-top: .6rem;
}
.route-sheet-table {
  font-size: .84rem;
}
.route-print-note {
  width: 28%;
}
.route-summary-print div {
  min-height: 70px;
  padding: .65rem .75rem;
}
.route-summary-print strong {
  font-size: 1.15rem;
}

/* ═══ Auth ═══ */
.login-shell {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
}
.login-glow-orb {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}
.login-glow-orb-1 {
  background: var(--accent);
  top: 15%;
  left: 20%;
  animation: orb-float-1 12s infinite alternate ease-in-out;
}
.login-glow-orb-2 {
  background: var(--cyan);
  bottom: 15%;
  right: 20%;
  animation: orb-float-2 15s infinite alternate ease-in-out;
}
@keyframes orb-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.15); }
}
@keyframes orb-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, -45px) scale(0.9); }
}
.login-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  border-radius: var(--r);
  padding: 2rem 1.75rem;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12), 0 2px 10px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  z-index: 1;
  position: relative;
  animation: card-intro 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes card-intro {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card .form-control {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 23, 42, 0.08);
}
.login-card .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.login-card .input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-color: rgba(15, 23, 42, 0.08);
  border-left: 0;
}
.login-card .input-group .form-control:focus + .btn {
  border-color: var(--line-focus);
}
.profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}
.profile-summary-card {
  min-width: 0;
  padding: .58rem .62rem;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: rgba(248,250,252,.85);
}
.profile-summary-card span {
  display: block;
  color: var(--ink3);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.profile-summary-card strong {
  display: block;
  margin-top: .18rem;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.22;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.profile-access-note {
  padding: .65rem .75rem;
  border: 1px solid rgba(59,130,246,.16);
  border-left: 3px solid #3b82f6;
  border-radius: 12px;
  background: rgba(59,130,246,.06);
  color: #334155;
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.35;
}
.profile-access-note strong,
.profile-access-note span {
  display: block;
}
.profile-access-note span {
  margin-top: .25rem;
  color: #64748b;
}
.is-protected-user {
  border-color: rgba(59,130,246,.2) !important;
  background: rgba(59,130,246,.035) !important;
}
.protected-user-note {
  padding: .55rem .65rem;
  border: 1px solid rgba(59,130,246,.16);
  border-left: 3px solid #3b82f6;
  border-radius: 10px;
  background: rgba(59,130,246,.07);
  color: #1e3a8a;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.3;
}

/* ═══ Admin ═══ */
.admin-hero { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; margin-bottom: .85rem; }
.admin-workspace { display: grid; grid-template-columns: 204px minmax(0,1fr); gap: .85rem; align-items: start; }
.admin-sidebar { position: sticky; top: 72px; display: grid; gap: .25rem; padding: .45rem; }
.admin-nav-button {
  display: block;
  border: 1px solid transparent; background: transparent; border-radius: var(--r-sm);
  padding: .55rem .68rem; text-align: left; color: var(--ink2);
  font-weight: 600; font-size: .84rem; transition: all var(--tr); cursor: pointer;
  text-decoration: none;
}
.admin-nav-button:hover { background: var(--accent-soft); color: var(--ink); }
.admin-nav-button.is-active { background: #fff; border-color: rgba(226,28,42,.16); color: var(--accent); box-shadow: 0 6px 18px rgba(226,28,42,.07); }
.admin-panels { min-width: 0; }
.admin-panel { display: none; padding: 1.05rem; }
.admin-panel.is-active { display: block; }
.panel-title { display: flex; justify-content: space-between; gap: .75rem; align-items: start; margin-bottom: .75rem; }
.panel-title.compact { margin-bottom: .5rem; }
.soft-panel { padding: .85rem; }
.admin-filter-form {
  display: grid;
  grid-template-columns: minmax(190px, 260px) auto auto;
  gap: .35rem;
  align-items: center;
}
.admin-history-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(130px, .55fr) minmax(130px, .55fr) auto;
  gap: .45rem;
  align-items: end;
  margin-bottom: .75rem;
}
.admin-history-filter label {
  display: grid;
  gap: .15rem;
  margin: 0;
}
.admin-history-filter label span {
  color: var(--ink3);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-inline-form { display: grid; grid-template-columns: minmax(140px,1.4fr) minmax(90px,.7fr) minmax(100px,.8fr) auto; gap: .4rem; margin-bottom: .6rem; }
.admin-inline-form.compact-form { grid-template-columns: minmax(110px,.8fr) minmax(150px,1.2fr); }
.admin-inline-form.user-form { grid-template-columns: minmax(160px,1.2fr) minmax(110px,.75fr) minmax(120px,.8fr) minmax(130px,.8fr) minmax(180px,1.1fr) auto; }
.admin-inline-form.compact-form .btn { grid-column: 1/-1; }
.scroll-pane { overflow: auto; background: rgba(245,247,251,.72); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem; }
.directory-pane { height: 420px; }
.item-pane { height: 420px; display: grid; grid-template-columns: 1fr; gap: .4rem; align-content: start; }
.history-pane { height: 400px; }
.table-pane { max-height: 540px; }
.admin-row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; min-height: 44px; padding: .5rem .25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: 0; }
.item-row {
  min-height: 44px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .55rem .75rem;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between;
}
.item-row .item-edit-form {
  flex: 1 1 auto;
  grid-template-columns: minmax(110px, 1fr) minmax(64px, .45fr) minmax(82px, .55fr) auto;
}
.item-row .row-actions {
  flex: 0 0 auto;
}
.admin-tabs {
  position: sticky; top: .5rem; z-index: 2; display: flex; gap: .25rem; overflow-x: auto;
  width: fit-content; max-width: 100%; margin-bottom: .75rem; padding: .2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow);
}
.admin-tabs a { flex: 0 0 auto; color: var(--ink); text-decoration: none; border-radius: 6px; padding: .35rem .6rem; font-weight: 600; font-size: .84rem; transition: all var(--tr); }
.admin-tabs a:hover { background: var(--accent-soft); }
#analytics,#catalog,#directories,#demand,#history { scroll-margin-top: 76px; }

/* ═══ Analytics ═══ */
.analytics-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: .5rem; margin-bottom: .75rem; }
.metric-card { min-height: 88px; padding: .72rem .78rem; }
.metric-card span, .metric-card small { display: block; color: var(--ink3); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.metric-card strong { display: block; font-size: 1.3rem; line-height: 1.1; margin-top: .25rem; }
.metric-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.metric-money { background: linear-gradient(135deg, rgba(226,28,42,.065), rgba(255,255,255,.96)); }
.bar-row { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.bar-row:last-child { border-bottom: 0; }
.bar-row-head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; font-size: .88rem; }
.bar-row-head span { color: var(--ink2); white-space: nowrap; font-size: .82rem; }
.bar-track { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: .35rem; }
.bar-fill { height: 100%; min-width: 3px; background: var(--accent); border-radius: 99px; transition: width .5s ease; }
.bar-fill-green { background: var(--green); }
.admin-compact-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}
.insight-card {
  min-width: 0;
  padding: .72rem .78rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.insight-head {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: baseline;
}
.insight-head span,
.insight-card small {
  color: var(--ink3);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.insight-head strong {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1;
}
.insight-card small {
  display: block;
  margin-top: .38rem;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.25;
}
.insight-track {
  height: 7px;
  margin-top: .55rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(15,23,42,.07);
}
.insight-track span {
  display: block;
  min-width: 3px;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.insight-track.is-blue span { background: var(--blue); }
.insight-track.is-amber span { background: var(--amber); }
.insight-mini-bars {
  height: 28px;
  display: flex;
  align-items: end;
  gap: 4px;
  margin-top: .45rem;
}
.insight-mini-bars span {
  flex: 1;
  min-width: 0;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, rgba(226,28,42,.65), rgba(226,28,42,.18));
}
.admin-focus-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
.focus-card {
  min-width: 0;
  padding: .78rem .85rem;
  border: 1px solid rgba(226,28,42,.12);
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(226,28,42,.055), rgba(255,255,255,.92));
  box-shadow: var(--shadow);
}
.focus-card span,
.focus-card small {
  display: block;
  color: var(--ink3);
  font-size: .7rem;
  font-weight: 750;
}
.focus-card span {
  margin-bottom: .2rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.focus-card strong {
  display: block;
  color: var(--ink);
  font-size: .98rem;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.focus-card small {
  margin-top: .22rem;
}

/* ═══ Directory ═══ */
.directory-tools { margin-bottom: .5rem; }
.directory-window { max-height: 260px; overflow: auto; padding: .2rem .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.catalog-window { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .4rem; max-height: 240px; padding: .5rem; }
.admin-list-row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; min-height: 44px; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.admin-list-row:last-child { border-bottom: 0; }
.row-title { font-weight: 700; font-size: .88rem; }
.row-actions { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; flex-wrap: wrap; }
.directory-edit-form { display: grid; gap: .35rem; align-items: center; min-width: 0; flex: 1 1 auto; }
.branch-edit-form { grid-template-columns: minmax(120px,.7fr) minmax(180px,1.2fr) auto; }
.item-edit-form { grid-template-columns: minmax(100px,1fr) minmax(60px,.4fr) minmax(70px,.5fr) auto; }
.user-admin-row {
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
  padding: .75rem;
  margin-bottom: .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
@media(min-width:1100px) {
  .user-admin-row { flex-direction: row; }
}
.user-edit-card { display: grid; gap: .6rem; min-width: 0; flex: 1 1 auto; }
.user-edit-head { display: flex; justify-content: space-between; gap: .75rem; align-items: start; flex-wrap: wrap; }
.user-edit-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .45rem; }
.user-edit-fields label { display: grid; gap: .2rem; min-width: 0; margin: 0; }
.user-edit-fields label span {
  color: var(--ink3);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.user-edit-card > .btn { justify-self: start; min-width: 150px; }
.user-action-card {
  width: 100%;
  display: grid;
  align-content: start;
  gap: .45rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}
@media(min-width:1100px) {
  .user-action-card {
    width: 250px;
    padding-top: 0;
    padding-left: .75rem;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}
.password-reset-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .35rem; }
.status-pill {
  flex: 0 0 auto;
  border-radius: 99px;
  padding: .16rem .45rem;
  background: rgba(100,116,139,.08);
  color: var(--ink2);
  font-size: .7rem;
  font-weight: 700;
}
.status-pill.is-active { background: var(--green-soft); color: #15803d; }
.status-dot { width: 7px; height: 7px; border-radius: 99px; background: #cbd5e1; }
.status-dot.is-active { background: var(--green); }
.cost-row { align-items: center; min-height: 64px; }
.cost-form { display: grid; grid-template-columns: minmax(72px,1fr) auto; gap: .3rem; align-items: center; }
.compact-table { font-size: .84rem; }
.table { --bs-table-bg: transparent; }
.table thead th {
  color: var(--ink3);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom-color: var(--line-strong);
}
.table tbody td {
  border-color: rgba(31,41,55,.075);
}
.table tbody tr:hover {
  background: rgba(255,255,255,.62);
}
.export-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.export-actions .btn { min-height: 34px; padding-inline: .65rem; background: #fff; border-color: rgba(226,28,42,.2); font-size: .82rem; }
.export-actions .btn:hover { background: var(--accent-soft); }
.eyebrow { color: var(--ink3); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.history-row, .mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .35rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .65rem .75rem; font-size: .86rem;
}
.history-row:hover, .mini-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.history-filter-panel {
  margin-bottom: .55rem;
  padding: .62rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.72);
}
.history-search-field {
  min-width: 0;
}
.history-filter-actions {
  display: flex;
  gap: .35rem;
  align-items: center;
  flex-wrap: wrap;
}
.history-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin: -.25rem 0 .75rem;
  color: var(--ink2);
  font-size: .78rem;
}
.history-filter-summary strong,
.history-filter-summary span {
  padding: .22rem .5rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
}
.history-filter-summary strong {
  color: var(--accent);
  border-color: rgba(226,28,42,.2);
  background: var(--accent-soft);
}
.history-panel-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .75rem;
}
.history-count {
  flex: 0 0 auto;
  padding: .18rem .48rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  color: var(--ink2);
  font-size: .72rem;
  font-weight: 800;
}
.history-record {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-end;
  margin-bottom: .55rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.history-record:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.history-record-main {
  flex: 1 1 260px;
  min-width: 0;
}
.history-record-delete {
  flex: 0 0 auto;
  align-self: flex-end;
  margin: 0;
}
.history-record-head {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  align-items: flex-start;
  min-width: 0;
}
.history-record-head > div:first-child {
  flex: 1 1 160px;
  min-width: 0;
}
.history-record-title {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: wrap;
}
.history-record-title strong {
  font-size: .94rem;
}
.history-record-branch {
  margin-top: .08rem;
  color: var(--ink2);
  font-size: .84rem;
  overflow-wrap: break-word;
  word-break: normal;
}
.history-record-meta {
  flex: 0 1 auto;
  display: flex;
  justify-content: flex-end;
  gap: .25rem;
  flex-wrap: wrap;
}
.history-record-meta span {
  padding: .16rem .4rem;
  border-radius: 99px;
  background: rgba(100,116,139,.08);
  color: var(--ink2);
  font-size: .7rem;
  font-weight: 700;
}
.request-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .55rem;
  align-items: start;
  min-width: 0;
}
.request-edit-form > .btn {
  justify-self: end;
}
.delivery-edit-form { grid-template-columns: minmax(0, 1fr); }
.request-comment-field { min-width: 0; }
.history-field {
  display: grid;
  gap: .16rem;
  min-width: 0;
  margin: 0;
}
.request-comment-field span,
.history-field span {
  display: block;
  color: var(--ink3);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: .04rem;
  text-transform: uppercase;
}
.request-lines-editor { display: grid; gap: .35rem; min-width: 0; }
.history-lines-editor { gap: .45rem; }
.request-line-editor {
  display: grid; grid-template-columns: minmax(120px,1fr) minmax(90px, 108px);
  gap: .35rem; align-items: center;
  min-width: 0;
}
.request-line-editor input[name="line_comment"] {
  grid-column: 1 / -1;
}
.delivery-line-editor {
  display: grid; grid-template-columns: minmax(120px,1fr) minmax(80px, 108px) minmax(76px,.42fr);
  gap: .35rem; align-items: center;
  min-width: 0;
}
.history-line-editor {
  padding: .48rem;
  border: 1px solid rgba(31,41,55,.075);
  border-radius: var(--r-sm);
  background: rgba(245,247,251,.74);
}
.history-line-name {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.history-line-name strong,
.history-line-name span {
  display: block;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}
.history-line-name strong {
  color: var(--ink);
  font-size: .84rem;
}
.history-line-name span {
  color: var(--ink2);
  font-size: .74rem;
}
.history-comment-inline,
.history-delivery-reason {
  grid-column: 1 / -1;
}
.history-result-pill {
  justify-self: start;
  padding: .22rem .45rem;
  border-radius: 99px;
  background: #fff;
  color: var(--ink2);
  border: 1px solid var(--line);
  font-size: .7rem;
  font-weight: 800;
}
.delivery-reason-admin {
  grid-column: 1 / -1;
}
.history-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
}
.request-line-editor .form-control,
.delivery-line-editor .form-control {
  min-width: 0;
  width: 100%;
}
.request-line-editor .small,
.delivery-line-editor .small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.empty-state-rich {
  display: grid;
  gap: .2rem;
  text-align: left;
}
.empty-state-rich strong {
  color: var(--ink);
  font-size: .9rem;
}
.empty-state-rich span {
  color: var(--ink2);
  font-size: .82rem;
}
.super-actions, .deleted-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.cleanup-form {
  display: grid; grid-template-columns: minmax(120px,1fr) minmax(120px,1fr) auto;
  gap: .45rem; align-items: end;
}
.cleanup-form span { display: block; color: var(--ink3); font-size: .7rem; font-weight: 600; margin-bottom: .15rem; }
.audit-pane { max-height: 360px; }
.audit-row, .deleted-row {
  display: grid; gap: .25rem; margin-bottom: .35rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .65rem .75rem; font-size: .84rem;
}
.deleted-row {
  grid-template-columns: minmax(0,1fr) auto; align-items: center;
}

/* ═══ Badges ═══ */
.badge { font-weight: 700; font-size: .72rem; padding: .28rem .5rem; border-radius: 5px; }

/* ═══ Modern Finish Layer ═══ */
.app-main {
  padding-bottom: 2rem;
}
.page-header h1,
.admin-hero h1 {
  font-weight: 800;
}
.page-header p,
.admin-hero p:not(.eyebrow),
.panel-title p,
.history-panel-head .small {
  color: var(--ink2) !important;
}
.toolbar,
.section-block,
.request-form,
.admin-panel,
.soft-panel,
.login-card {
  background: rgba(255,255,255,.94);
}
.toolbar:hover,
.section-block:hover,
.admin-panel:hover,
.soft-panel:hover {
  border-color: rgba(31,41,55,.14);
}
.btn-danger {
  background: var(--red);
  border-color: var(--red);
  font-weight: 700;
}
.btn-danger:hover {
  background: #c92e2e;
  border-color: #c92e2e;
}
.text-bg-danger {
  background-color: var(--accent) !important;
}
.text-bg-warning {
  background-color: rgba(217,138,18,.16) !important;
  color: #8b520b !important;
}
.text-bg-success {
  background-color: var(--green) !important;
}
.text-bg-secondary {
  background-color: #6b7280 !important;
}
.text-bg-light {
  background-color: #f3f6fa !important;
  color: var(--ink2) !important;
  border: 1px solid var(--line);
}
.form-check-input {
  border-color: rgba(31,41,55,.22);
}
.form-check-input:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.status-dot {
  box-shadow: 0 0 0 3px rgba(148,163,184,.13);
}
.status-dot.is-active {
  box-shadow: 0 0 0 3px rgba(25,164,91,.13);
}
.bar-fill {
  background: linear-gradient(90deg, var(--accent), #f05c66);
}
.bar-fill-green {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ═══ Responsive ═══ */
@media(max-width:768px) {
  html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
  }
  body { font-size: 16px; } /* Base font 16px for mobile */
  
  /* Prevent iOS zoom on focus */
  input, select, textarea, .form-control, .form-select {
    font-size: 16px !important;
  }
  .app-main { padding-top: .65rem !important; }
  .navbar-brand { font-size: 1rem !important; }
  .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    background-size: 196px auto;
    background-position: -14px -33px;
  }
  .driver-compact-header {
    gap: .5rem;
    margin-bottom: .5rem;
  }
  .driver-compact-header h1 {
    font-size: 1.3rem;
    line-height: 1.1;
  }
  .driver-compact-header p {
    display: none;
  }
  .driver-print-shortcut {
    min-height: 38px;
    padding-inline: .7rem;
    white-space: nowrap;
  }
  .driver-route-controls {
    padding: .7rem;
    margin-bottom: .6rem;
    border-radius: 14px;
  }
  .driver-control-grid {
    grid-template-columns: 1fr auto;
    gap: .5rem;
  }
  .driver-control-driver,
  .driver-control-search {
    grid-column: 1 / -1;
  }
  .driver-control-driver .form-label {
    display: none;
  }
  .driver-control-driver .form-control,
  .driver-control-driver .form-select {
    min-height: 40px;
    font-weight: 800;
  }
  .driver-control-search .form-label {
    display: none;
  }
  .driver-control-search .form-control {
    min-height: 48px;
  }
  .driver-control-toggle {
    min-height: 38px;
  }
  .driver-control-toggle .form-check-label {
    font-size: .82rem;
  }
  .driver-control-submit .btn {
    min-height: 38px;
    min-width: 96px;
  }
  .driver-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .35rem;
  }
  .driver-summary-strip div {
    min-height: 58px;
    padding: .5rem .45rem;
    border-radius: 12px;
  }
  .driver-summary-strip span {
    font-size: .58rem;
    line-height: 1.1;
  }
  .driver-summary-strip strong {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
  .branch-card {
    padding: .8rem;
    gap: .5rem;
    border-radius: 14px;
  }
  .branch-card h2 {
    font-size: 1rem;
  }
  .branch-card-address {
    font-size: .86rem;
    line-height: 1.35;
  }
  .branch-card-count {
    min-width: 72px;
    padding: .5rem .45rem;
  }
  .driver-card-action {
    min-height: 44px;
  }
  .admin-hero { grid-template-columns: 1fr; }
  .admin-hero h1 { font-size: 1.25rem; }
  .role-guide { grid-template-columns: 1fr; padding: 3rem .75rem .75rem; }
  .role-guide.is-collapsed { padding: .65rem 5.25rem .65rem .75rem; }
  .role-guide-toggle { top: .65rem; right: .65rem; }
  .role-guide-steps { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-filter { width: 100%; flex-basis: auto; }
  .export-actions { display: grid; grid-template-columns: repeat(2,1fr); }
  .admin-workspace { grid-template-columns: 1fr; }
  .admin-sidebar { position: sticky; top: .4rem; z-index: 5; display: flex; overflow-x: auto; gap: .25rem; padding: .3rem; }
  .admin-nav-button { flex: 0 0 auto; white-space: nowrap; padding: .45rem .6rem; font-size: .82rem; }
  .admin-panel { padding: .7rem; }
  .panel-title { flex-direction: column; align-items: stretch; }
  .admin-filter-form, .admin-history-filter { grid-template-columns: 1fr; }
  .admin-inline-form, .admin-inline-form.compact-form, .admin-inline-form.user-form { grid-template-columns: 1fr; }
  .history-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-panel-head { flex-direction: column; gap: .35rem; }
  .history-count { align-self: flex-start; }
  .history-record-delete .btn,
  .history-record-actions .btn {
    width: 100%;
  }
  .history-record-meta {
    justify-content: flex-start;
  }
  .request-edit-form, .delivery-edit-form, .cleanup-form, .deleted-row { grid-template-columns: 1fr; }
  .request-line-editor, .delivery-line-editor { grid-template-columns: minmax(0,1fr) minmax(80px, 108px); }
  .item-pane { grid-template-columns: 1fr !important; }
  .request-line, .delivery-line { 
    grid-template-columns: 1fr; 
    padding-top: 3.5rem; /* Room for 44px delete button */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(15,23,42,.06);
    margin-bottom: 0.5rem;
  }
  .request-line-remove {
    padding-top: 0;
  }
  .request-line-field { gap: .25rem; }
  
  .request-submit-bar-wrapper {
    position: sticky;
    bottom: 0;
    background: linear-gradient(0deg, rgba(255,255,255,1) 85%, rgba(255,255,255,0) 100%);
    padding: 1rem 0;
    margin-top: 1rem;
    z-index: 1000;
  }
  .request-submit-bar { margin-top: 0 !important; }
  .duplicate-warning { align-items: stretch; flex-direction: column; }
  .duplicate-warning .btn { width: 100%; }
  .demand-grid, .driver-stats, .delivery-metrics, .route-summary { grid-template-columns: 1fr; }
  .route-print-toolbar {
    align-items: stretch;
    margin-bottom: .55rem;
  }
  .route-print-toolbar h1 {
    font-size: 1.25rem;
  }
  .route-print-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .route-print-actions .btn {
    min-height: 40px;
  }
  .route-print-filter {
    padding: .7rem;
    margin-bottom: .6rem !important;
  }
  .route-sheet-head {
    padding: .7rem;
    border-radius: 14px;
  }
  .route-sheet-stamp {
    display: none;
  }
  .route-summary-print {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .35rem;
  }
  .route-summary-print div {
    min-height: 56px;
    padding: .45rem;
    border-radius: 12px;
  }
  .route-summary-print span {
    font-size: .58rem;
  }
  .route-summary-print strong {
    font-size: .98rem;
  }
  .route-stop {
    padding: .7rem;
    border-radius: 14px;
  }
  .route-stop-head h3 {
    font-size: .96rem;
  }
  .route-stop-head p {
    font-size: .8rem;
    line-height: 1.35;
  }
  .route-stop-meta {
    min-width: 72px;
  }
  .route-sheet-table {
    font-size: .8rem;
  }
  .delivery-live-summary { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2,1fr); gap: .4rem; }
  .admin-compact-insights { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .admin-focus-strip { grid-template-columns: 1fr; gap: .4rem; }
  .insight-card { padding: .62rem; }
  .insight-head { align-items: start; flex-direction: column; gap: .2rem; }
  .profile-summary { grid-template-columns: 1fr; }
  .metric-card { min-height: 76px; padding: .55rem; }
  .metric-card strong { font-size: 1.15rem; }
  .bar-row-head, .admin-list-row, .cost-row, .admin-row { align-items: stretch; flex-direction: column; }
  .branch-edit-form, .item-edit-form, .user-edit-fields { grid-template-columns: 1fr; }
  .user-admin-row { flex-direction: column; }
  .user-action-card { width: 100%; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: .65rem; }
  .password-reset-form { grid-template-columns: 1fr; }
  .item-row { flex-direction: column; align-items: stretch; }
  .row-actions { flex-wrap: wrap; }
  .request-submit-bar {
    position: sticky;
    bottom: .5rem;
    z-index: 4;
    padding: .5rem;
    margin-inline: -.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
  }
  .request-submit-bar .btn { width: 100%; }
  .catalog-window { grid-template-columns: 1fr; }
  .admin-tabs { position: static; width: 100%; }
  .btn-lg, .form-select-lg, .input-group-lg>.form-control, .input-group-lg>.btn { min-height: 42px; }
  .driver-actions {
    bottom: 0;
    margin-inline: -.5rem;
    border-radius: var(--r) var(--r) 0 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .driver-action-buttons { display: grid; grid-template-columns: 1fr; }
  .driver-primary-action { order: -1; min-height: 52px !important; }
  .delivery-mobile-quick { display: grid; }
  .delivery-line .input-group .btn { display: none; }
  .visit-workflow-head {
    display: grid;
  }
  .visit-workflow-counts {
    justify-content: flex-start;
  }
  .visit-steps {
    grid-template-columns: 1fr 1fr;
  }
  .visit-step {
    padding: .62rem;
  }
  .visit-step strong {
    white-space: normal;
    line-height: 1.15;
  }
  .visit-close-button {
    width: 100%;
    min-height: 50px;
  }
  .branch-card {
    padding: 1rem !important;
    border-radius: 16px !important;
  }
  .branch-card h2 { font-size: 1.05rem !important; }
  .branch-card-address { font-size: .92rem; }
  .branch-card-count { min-width: 82px; }
  .driver-card-action { min-height: 50px; font-size: .98rem !important; }
  .hero-panel { grid-template-columns: 1fr; padding: 1.15rem; }
  .hero-panel h1 { font-size: 1.2rem; }
  .hero-brand-card, .hero-brand-card img { min-height: 132px; }
}

@media print {
  body {
    background: #fff !important;
    color: #111827;
    font-size: 11px;
  }
  .app-navbar,
  .alert,
  .route-print-toolbar,
  .route-print-filter,
  .route-stop-actions {
    display: none !important;
  }
  .app-main,
  .app-navbar .container {
    max-width: none !important;
  }
  .app-main {
    padding: 0 !important;
  }
  .route-sheet-head,
  .route-summary div,
  .route-stop {
    box-shadow: none !important;
    background: #fff !important;
    border-color: #cbd5e1 !important;
  }
  .route-sheet-head,
  .route-stop {
    border-radius: 0;
  }
  .route-summary {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .route-stop {
    page-break-inside: avoid;
    margin-bottom: 8px;
  }
  .route-sheet-table th,
  .route-sheet-table td {
    border-color: #d1d5db !important;
    padding: 4px 6px;
  }
  .route-print-note {
    width: 34%;
  }
}

/* ═══ Skeleton Loader ═══ */
.skeleton {
  position: relative;
  overflow: hidden;
  background-color: #e2e8f0;
  border-radius: var(--r-sm);
  min-height: 1em;
  display: block;
  width: 100%;
}
.skeleton::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.2) 20%, rgba(255,255,255,0.5) 60%, rgba(255,255,255,0));
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.skeleton-text { height: .85rem; margin-bottom: .5rem; }
.skeleton-title { height: 1.25rem; margin-bottom: .75rem; width: 60%; }
.skeleton-rect { height: 40px; }

/* ═══ PWA Install Button ═══ */
#pwa-install-banner {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  left: 1rem;
  right: 1rem;
  z-index: 1060;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid rgba(226,28,42,.2);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.04);
  transform: translateY(calc(100% + 2rem));
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
@media (min-width: 576px) {
  #pwa-install-banner {
    left: auto;
    right: 1.5rem;
    width: 320px;
  }
}
#pwa-install-banner.is-visible {
  transform: translateY(0);
}
.pwa-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: .9rem;
  box-shadow: 0 4px 10px rgba(226,28,42,.25);
}

/* ═══ Search Highlighting ═══ */
mark.highlight {
  background-color: #fde047;
  color: #854d0e;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: inherit;
}

/* ════════════════════════════════════════════════ */
/* ═══ 3D CYBER ZIRCONIA LOGISTICS PORTAL THEME ═══ */
/* ════════════════════════════════════════════════ */

body.td-home-active {
  background: #f4f6fb !important;
  color: #0f172a !important;
  font-family: 'Outfit', 'Inter', sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* 3D WebGL Background container */
.td-viewport-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -10;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #edf3fc 60%, #dbe4f3 100%);
  overflow: hidden;
}

.td-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Cyber Navbar Overrides for Light Mode */
body.td-home-active .app-navbar {
  background: rgba(255, 255, 255, 0.65) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(18px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
  box-shadow: 0 10px 40px rgba(100, 116, 139, 0.08) !important;
  transition: all 0.4s ease;
}

body.td-home-active .navbar-brand {
  color: #0f172a !important;
  text-shadow: 0 0 12px rgba(226, 28, 42, 0.15);
}

body.td-home-active .brand-mark {
  border-color: rgba(226, 28, 42, 0.15);
  box-shadow: 0 0 15px rgba(226, 28, 42, 0.15);
}

body.td-home-active .navbar-nav .nav-link {
  color: #475569 !important;
}

body.td-home-active .navbar-nav .nav-link:hover {
  background: rgba(226, 28, 42, 0.05) !important;
  color: #e21c2a !important;
}

body.td-home-active .app-nav-link.is-active {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #e21c2a !important;
  box-shadow: inset 0 0 0 1px rgba(226, 28, 42, 0.2), 0 4px 12px rgba(226, 28, 42, 0.08) !important;
}

/* Frosted Glassmorphism Panel - Pristine Light Mode */
.td-glass-panel {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  box-shadow: 
    0 20px 50px rgba(15, 23, 42, 0.04), 
    0 4px 20px rgba(100, 116, 139, 0.02),
    inset 0 0 30px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  padding: 2.5rem;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.td-glass-panel:hover {
  border-color: rgba(226, 28, 42, 0.22);
  box-shadow: 
    0 30px 60px rgba(226, 28, 42, 0.03), 
    0 20px 40px rgba(15, 23, 42, 0.06), 
    inset 0 0 40px rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

/* Main hero adjustments */
.td-hero-section {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
  padding-top: 4rem;
}

.td-hero-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #e21c2a 50%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 0 80px rgba(226, 28, 42, 0.08);
}

.td-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #e21c2a;
  font-weight: 800;
  background: rgba(226, 28, 42, 0.05);
  padding: 0.35rem 0.8rem;
  border-radius: 99px;
  border: 1px solid rgba(226, 28, 42, 0.12);
  box-shadow: 0 0 15px rgba(226, 28, 42, 0.05);
  margin-bottom: 1.25rem;
}

/* Glow ring under text */
.td-glow-accent {
  position: relative;
  display: inline-block;
}

.td-glow-accent::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e21c2a, transparent);
  box-shadow: 0 0 10px rgba(226, 28, 42, 0.4);
}

/* Cybernetic Role & Catalog Card - Elegant Light Glass */
.td-cyber-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.2rem 2rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(190%);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  text-decoration: none !important;
  color: inherit !important;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(100, 116, 139, 0.04), inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.td-cyber-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.0) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Custom interactive glowing overlay in light mode */
.td-card-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--card-glow-rgb, 226, 28, 42), 0.12) 0%, transparent 70%);
  top: var(--glow-y, 0px);
  left: var(--glow-x, 0px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease, top 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94), left 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 2;
}

.td-cyber-card:hover .td-card-glow {
  opacity: 1;
}

.td-cyber-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(var(--card-glow-rgb, 226, 28, 42), 0.3);
  box-shadow: 
    0 25px 50px rgba(100, 116, 139, 0.12),
    0 0 25px rgba(var(--card-glow-rgb, 226, 28, 42), 0.08);
}

.td-cyber-card .role-icon {
  background: rgba(var(--card-glow-rgb, 226, 28, 42), 0.05);
  color: rgb(var(--card-glow-rgb, 226, 28, 42));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(var(--card-glow-rgb, 226, 28, 42), 0.12);
  box-shadow: 0 0 15px rgba(var(--card-glow-rgb, 226, 28, 42), 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
  margin-bottom: 1.25rem;
}

.td-cyber-card:hover .role-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(var(--card-glow-rgb, 226, 28, 42), 0.12);
  box-shadow: 0 0 20px rgba(var(--card-glow-rgb, 226, 28, 42), 0.18);
}

.td-cyber-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.td-cyber-card-desc {
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Sound controller widget */
.td-sound-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.1);
}

.td-sound-toggle:hover {
  background: rgba(226, 28, 42, 0.06);
  border-color: rgba(226, 28, 42, 0.25);
  color: #e21c2a;
  transform: scale(1.1);
}

.td-sound-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.td-sound-wave {
  width: 2px;
  background-color: currentColor;
  border-radius: 99px;
  animation: td-wave-pulse 1s ease infinite alternate;
  animation-play-state: paused;
}

.td-sound-toggle.is-playing .td-sound-wave {
  animation-play-state: running;
}

.td-sound-wave:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.td-sound-wave:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.td-sound-wave:nth-child(3) { height: 10px; animation-delay: 0.2s; }
.td-sound-wave:nth-child(4) { height: 4px; animation-delay: 0.4s; }

@keyframes td-wave-pulse {
  from { height: 4px; }
  to { height: 14px; }
}

/* Micro-charts & widgets for 3D stats panel */
.td-sparkline-svg {
  width: 100%;
  height: 40px;
  stroke: #e21c2a;
  stroke-width: 2px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.td-sparkline-cyan {
  stroke: #0284c7;
}

.td-sparkline-purple {
  stroke: #6366f1;
}

.td-grid-stat {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.02);
}

.td-grid-stat:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 20px rgba(100, 116, 139, 0.05);
}

.td-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
}

.td-stat-value {
  font-size: 1.45rem;
  font-weight: 900;
  color: #0f172a;
}

/* Interactive click shockwave ripple element */
.td-click-shockwave {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 28, 42, 0.08) 0%, rgba(226, 28, 42, 0) 70%);
  border: 1px solid rgba(226, 28, 42, 0.2);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%) scale(0);
  animation: td-shockwave-expand 0.65s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes td-shockwave-expand {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    width: 250px;
    height: 250px;
  }
}

/* Flowchart connector visual glowing pulse dot */
.td-flow-pulse {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: #e21c2a;
  border-radius: 50%;
  box-shadow: 0 0 10px #e21c2a, 0 0 20px #e21c2a;
  pointer-events: none;
  animation: td-flow-travel 4s linear infinite;
  display: none;
}

@media(min-width: 992px) {
  .td-flow-pulse {
    display: block;
  }
}

@keyframes td-flow-travel {
  0% { left: 24%; top: 50%; opacity: 0; }
  10% { opacity: 1; }
  24% { left: 26%; top: 50%; }
  25% { left: 49%; top: 50%; }
  49% { left: 51%; top: 50%; }
  50% { left: 74%; top: 50%; }
  74% { left: 76%; top: 50%; }
  75% { left: 99%; top: 50%; opacity: 1; }
  85%, 100% { left: 99%; top: 50%; opacity: 0; }
}

/* ═══ SCROLL-DRIVEN ANIMATION SYSTEM ═══ */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .td-scroll-reveal {
    animation: td-scroll-fade-in linear both;
    animation-timeline: view();
    animation-range: entry 15% cover 35%;
  }

  @keyframes td-scroll-fade-in {
    from {
      opacity: 0;
      transform: translateY(50px) scale(0.96);
      filter: blur(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
      filter: blur(0px);
    }
  }

  .td-scroll-parallax-bg {
    animation: td-bg-parallax linear both;
    animation-timeline: scroll();
  }

  @keyframes td-bg-parallax {
    from { transform: translateY(0); }
    to { transform: translateY(-150px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .td-scroll-reveal {
    animation: none !important;
  }
  body.td-home-active {
    background: #f8fafc !important;
  }
}

/* ════════════════════════════════════════════════ */
/* ═══ PREMIUM DASHBOARDS REDESIGN SYSTEM ════════ */
/* ════════════════════════════════════════════════ */

/* Global Dashboard Adjustments */
body:not(.td-home-active) {
  background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f4f6fb 70%, #eef2f7 100%) !important;
  color: #1e293b !important;
  font-family: 'Outfit', 'Inter', sans-serif;
}

body:not(.td-home-active) .app-navbar {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05) !important;
  box-shadow: 0 10px 40px rgba(100, 116, 139, 0.04) !important;
}

/* Page titles */
.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Elegant minimalist scrollbar for dashboards */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* Premium Pro-Tips / Role Guide Widget */
.role-guide {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-left: 4px solid var(--dash-accent, #6366f1) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px rgba(100, 116, 139, 0.03), inset 0 0 20px rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  padding: 1.25rem 1.5rem !important;
  margin-bottom: 1.5rem !important;
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  overflow: hidden;
}
.role-guide:hover {
  box-shadow: 0 15px 35px rgba(var(--dash-glow-rgb, 99, 102, 241), 0.05), 0 5px 15px rgba(100, 116, 139, 0.05) !important;
  border-color: rgba(var(--dash-glow-rgb, 99, 102, 241), 0.25) !important;
  border-left-color: var(--dash-accent, #6366f1) !important;
  transform: translateY(-2px);
}
.role-guide-title strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a !important;
}
.role-guide-title span {
  font-size: 0.84rem;
  color: #475569 !important;
  font-weight: 500;
}
.role-guide-steps {
  border-top: 1px solid rgba(15, 23, 42, 0.04) !important;
  margin-top: 1rem !important;
  padding-top: 1rem !important;
  gap: 1.5rem !important;
}
.role-guide-step strong {
  font-weight: 700 !important;
  font-size: 0.86rem !important;
  color: var(--dash-accent, #6366f1) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-guide-step span {
  font-size: 0.82rem !important;
  color: #475569 !important;
}
.role-guide-toggle {
  background: rgba(15, 23, 42, 0.03) !important;
  border: 1px solid rgba(15, 23, 42, 0.04) !important;
  color: #475569 !important;
  border-radius: 99px !important;
  padding: 0.25rem 0.75rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
}
.role-guide-toggle:hover {
  background: var(--dash-accent, #6366f1) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* ─── APPRAISER (ТОВАРОВЕД) DASHBOARD ─── */
body[hx-boost="true"] .app-main:has(#appraiser-demand-list),
body:has(#appraiser-demand-list) {
  --dash-accent: #e21c2a;
  --dash-glow-rgb: 226, 28, 42;
}
/* Active Demand Section */
.demand-card {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 30px rgba(100, 116, 139, 0.02), inset 0 0 20px rgba(255, 255, 255, 0.4) !important;
  padding: 1.15rem !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.demand-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(226, 28, 42, 0.2) !important;
  box-shadow: 0 20px 45px rgba(226, 28, 42, 0.04), 0 10px 20px rgba(100, 116, 139, 0.08) !important;
}
.demand-card strong {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  color: #0f172a;
}
.demand-grid div {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(15, 23, 42, 0.04) !important;
  border-radius: 12px !important;
  padding: 0.5rem 0.6rem !important;
  transition: all 0.3s ease;
}
.demand-card:hover .demand-grid div {
  border-color: rgba(226, 28, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.95) !important;
}
.demand-grid span {
  color: #64748b !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
}
.demand-grid strong {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
}
.demand-grid .text-danger {
  color: #e21c2a !important;
}

/* History / List group items */
.list-group-item {
  background: rgba(255, 255, 255, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.01) !important;
  margin-bottom: 0.5rem !important;
  padding: 1rem 1.15rem !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  backdrop-filter: blur(10px);
}
.list-group-item:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 28, 42, 0.18) !important;
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 12px 25px rgba(226, 28, 42, 0.03), 0 5px 15px rgba(100, 116, 139, 0.06) !important;
}
.line-chip {
  background: rgba(226, 28, 42, 0.04) !important;
  color: #e21c2a !important;
  border: 1px solid rgba(226, 28, 42, 0.1) !important;
  border-radius: 8px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  margin: 0.15rem !important;
  display: inline-block;
  transition: all 0.3s ease;
}
.list-group-item:hover .line-chip {
  background: rgba(226, 28, 42, 0.08) !important;
  box-shadow: 0 2px 8px rgba(226, 28, 42, 0.05);
}

/* ─── DRIVER (ВОДИТЕЛЬ) DASHBOARD ─── */
body[hx-boost="true"] .app-main:has(.branch-card),
body:has(.branch-card) {
  --dash-accent: #f59e0b;
  --dash-glow-rgb: 245, 158, 11;
}
.branch-card {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 30px rgba(100, 116, 139, 0.02), inset 0 0 20px rgba(255, 255, 255, 0.4) !important;
  padding: 1.25rem !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.branch-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(245, 158, 11, 0.25) !important;
  box-shadow: 0 20px 45px rgba(245, 158, 11, 0.04), 0 10px 20px rgba(100, 116, 139, 0.08) !important;
}
.branch-card-active {
  border-color: rgba(245, 158, 11, 0.2) !important;
  box-shadow: inset 4px 0 0 #f59e0b, 0 10px 30px rgba(245, 158, 11, 0.03) !important;
}
.branch-card-active:hover {
  box-shadow: inset 4px 0 0 #f59e0b, 0 20px 45px rgba(245, 158, 11, 0.06), 0 10px 20px rgba(100, 116, 139, 0.08) !important;
}
.branch-card-main {
  min-width: 0;
}
.branch-card-kicker {
  color: #b45309;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .2rem;
}
.branch-card h2 {
  font-size: 1rem !important;
  font-weight: 900 !important;
  line-height: 1.2;
}
.branch-card-address {
  display: grid;
  gap: .3rem;
  margin-top: .35rem;
  color: #475569;
  font-size: .84rem;
  line-height: 1.35;
}
.branch-map-link {
  width: fit-content;
  color: #b45309;
  font-weight: 800;
  text-decoration: none;
}
.branch-card-count {
  flex: 0 0 auto;
  display: grid;
  gap: .1rem;
  min-width: 72px;
  padding: .45rem .55rem;
  border-radius: 12px;
  background: rgba(245, 158, 11, .12);
  color: #92400e;
  font-size: .72rem;
  font-weight: 800;
  text-align: right;
}
.branch-card-count strong {
  color: #0f172a;
  font-size: .9rem;
  font-weight: 950;
}
.branch-card-count.is-muted {
  min-width: 38px;
  color: #64748b;
  background: rgba(100, 116, 139, .08);
  text-align: center;
}
.driver-card-action {
  min-height: 46px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: .92rem !important;
  font-weight: 850 !important;
}
.appraiser-work-header,
.admin-work-header {
  align-items: center;
}
.appraiser-create-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}
.appraiser-toolbar .row {
  align-items: end;
}
.appraiser-selected-branch {
  display: grid;
  gap: .16rem;
  width: 100%;
  max-width: 100%;
  line-height: 1.25;
}
.appraiser-selected-branch strong,
.appraiser-selected-branch span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.appraiser-selected-branch span {
  color: #64748b;
  font-size: .78rem;
  font-weight: 650;
}
.appraiser-selected-branch div {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.appraiser-selected-branch a {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 850;
  text-decoration: none;
}
.admin-export-block {
  margin-bottom: .85rem !important;
}
.admin-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .9rem;
  align-items: center;
  margin-bottom: .65rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.admin-title-block {
  min-width: 0;
}
.admin-title-block .eyebrow {
  display: block;
  margin-bottom: .1rem;
}
.admin-title-block h1 {
  margin: 0;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
}
.admin-title-block p {
  margin: .22rem 0 0;
  color: #64748b;
  font-size: .88rem;
  font-weight: 650;
}
.admin-period-label,
.admin-period-export > span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.admin-period-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .32rem;
  align-items: end;
  margin-bottom: .65rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .035);
  overflow: visible;
}
.admin-period-label {
  flex: 0 0 auto;
  max-width: 116px;
  line-height: 1.15;
}
.admin-date-field {
  display: grid;
  gap: .18rem;
  flex: 0 0 136px;
  margin: 0;
}
.admin-date-field span {
  color: #64748b;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-date-field .form-control {
  min-height: 36px;
  padding: .36rem .42rem;
  font-size: .78rem;
  font-weight: 750;
}
.admin-period-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: .22rem;
  align-items: center;
  flex: 0 0 auto;
}
.admin-period-presets .btn {
  min-height: 36px;
  padding: .34rem .42rem;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.admin-period-export {
  display: grid;
  grid-template-columns: auto auto;
  gap: .28rem;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: .48rem;
  border-left: 1px solid rgba(15, 23, 42, .08);
}
.admin-period-export > span {
  line-height: 1;
}
.admin-period-export .export-actions {
  flex-wrap: nowrap;
}
.admin-period-export .export-actions .btn {
  min-height: 36px;
  padding: .34rem .42rem;
  font-size: .72rem;
  font-weight: 850;
  white-space: nowrap;
}
.admin-guide-compact {
  margin-bottom: .65rem !important;
}
.admin-guide-compact.is-collapsed {
  min-height: 48px;
  padding-block: .65rem !important;
}
.route-summary div {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 25px rgba(100, 116, 139, 0.02) !important;
  padding: 0.85rem 1rem !important;
  transition: all 0.3s ease;
}
.route-summary div:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(245, 158, 11, 0.15) !important;
  box-shadow: 0 15px 30px rgba(245, 158, 11, 0.03), 0 8px 20px rgba(100, 116, 139, 0.05) !important;
}
.route-summary span {
  color: #94a3b8 !important;
  font-weight: 700 !important;
}
.route-summary strong {
  color: #0f172a !important;
  font-weight: 900 !important;
}

/* ─── ADMIN (АДМИНИСТРАТОР) DASHBOARD ─── */
body[hx-boost="true"] .app-main:has(.admin-workspace),
body:has(.admin-workspace) {
  --dash-accent: #6366f1;
  --dash-glow-rgb: 99, 102, 241;
}
.admin-hero {
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem !important;
}
.admin-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
}
.admin-workspace {
  gap: 1.25rem !important;
}
.admin-sidebar {
  background: rgba(255, 255, 255, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 30px rgba(100, 116, 139, 0.02) !important;
  padding: 0.6rem !important;
  backdrop-filter: blur(14px);
}
.admin-nav-button {
  border-radius: 12px !important;
  padding: 0.65rem 0.85rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.admin-nav-button:hover {
  background: rgba(99, 102, 241, 0.05) !important;
  color: #6366f1 !important;
  transform: translateX(3px);
}
.admin-nav-button.is-active {
  background: #ffffff !important;
  border-color: rgba(99, 102, 241, 0.16) !important;
  color: #6366f1 !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.06), 0 2px 5px rgba(99, 102, 241, 0.02) !important;
}

/* Metric Cards */
.metric-card {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 25px rgba(100, 116, 139, 0.02), inset 0 0 15px rgba(255, 255, 255, 0.3) !important;
  padding: 1rem 1.15rem !important;
  transition: all 0.4s ease !important;
}
.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.18) !important;
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 16px 35px rgba(99, 102, 241, 0.03), 0 8px 20px rgba(100, 116, 139, 0.06) !important;
}
.metric-card span {
  color: #64748b !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 0.65rem !important;
  letter-spacing: 0.06em;
}
.metric-card strong {
  color: #0f172a !important;
  font-weight: 900 !important;
  font-size: 1.45rem !important;
}
.metric-card small {
  color: #475569 !important;
  font-weight: 600 !important;
}

/* Top items bars */
.bar-row {
  margin-bottom: 0.85rem !important;
}
.bar-row-head strong {
  color: #1e293b !important;
  font-weight: 700 !important;
}
.bar-row-head span {
  font-weight: 700 !important;
  color: #475569 !important;
}
.bar-track {
  background: rgba(15, 23, 42, 0.03) !important;
  border-radius: 99px !important;
  height: 6px !important;
  overflow: hidden;
  margin-top: 0.25rem;
}
.bar-fill {
  background: linear-gradient(90deg, #6366f1, #818cf8) !important;
  border-radius: 99px !important;
  height: 100% !important;
}
.bar-fill-green {
  background: linear-gradient(90deg, #22c55e, #4ade80) !important;
}

/* ─── GENERAL FORM CONTROLS & COMPONENT STYLES ─── */
.toolbar, .admin-panel, .section-block, .soft-panel {
  background: rgba(255, 255, 255, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 30px rgba(100, 116, 139, 0.02) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.form-label {
  font-weight: 700 !important;
  font-size: 0.76rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569 !important;
  margin-bottom: 0.35rem !important;
}
.form-select, .form-control {
  border-radius: 12px !important;
  border: 1.5px solid rgba(15, 23, 42, 0.18) !important;
  background-color: #ffffff !important;
  padding: 0.52rem 0.78rem !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255,255,255,0.85) !important;
}
.form-select:focus, .form-control:focus {
  border-color: var(--accent, #e21c2a) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(226, 28, 42, 0.16), 0 8px 18px rgba(15, 23, 42, 0.08) !important;
}
.form-control::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}
.form-control[readonly], .form-control.bg-light {
  background-color: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  color: #475569 !important;
  font-weight: 600 !important;
}
.smart-search-input {
  padding-left: 2.2rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 0.75rem 50% !important;
}
.empty-state {
  background: rgba(15, 23, 42, 0.01) !important;
  border: 1.5px dashed rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
  color: #64748b !important;
  font-weight: 600 !important;
  padding: 1.5rem !important;
}

/* Guarantee 100% visibility for scroll-reveal sections on mobile viewports */
@media (max-width: 767.98px) {
  .td-scroll-reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ════════════════════════════════════════════════ */
/* ═══ HIGH-FIDELITY SCROLL-DRIVEN ASSEMBLY SYSTEM ══ */
/* ════════════════════════════════════════════════ */

/* --- 1. Word-by-Word Header Reveal System --- */
.td-text-assemble {
  display: inline-block;
}
.td-word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(18px) scale(0.92) translateZ(0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  margin-right: 0.25em;
}
.is-assembled .td-word,
.td-text-assemble.is-assembled .td-word {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0) scale(1) translateZ(0);
}

/* --- 2. Supply Chain Flow Assembly System --- */
@media (min-width: 768px) {
  /* Initial state: cards hidden and displaced */
  #flow .row > div:nth-child(1) .td-grid-stat {
    opacity: 0;
    transform: translateX(-80px) scale(0.88) translateZ(0);
    filter: blur(4px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1s cubic-bezier(0.16, 1, 0.3, 1);
  }
  #flow .row > div:nth-child(2) .td-grid-stat {
    opacity: 0;
    transform: translateY(60px) scale(0.88) translateZ(0);
    filter: blur(4px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.25s;
  }
  #flow .row > div:nth-child(3) .td-grid-stat {
    opacity: 0;
    transform: translateY(60px) scale(0.88) translateZ(0);
    filter: blur(4px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.5s;
  }
  #flow .row > div:nth-child(4) .td-grid-stat {
    opacity: 0;
    transform: translateX(80px) scale(0.88) translateZ(0);
    filter: blur(4px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.75s;
  }

  /* Assembled state */
  #flow.is-assembled .row > div .td-grid-stat {
    opacity: 1;
    transform: translate(0) scale(1) translateZ(0);
    filter: blur(0);
  }

  /* High-Tech Connecting Neon Pipelines */
  .td-flow-pipe {
    position: absolute;
    top: 50%;
    left: 85%;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--pipe-start-color, #e21c2a), var(--pipe-end-color, #4f46e5));
    box-shadow: 0 0 12px 2px var(--pipe-end-color, #4f46e5),
                0 0 4px var(--pipe-start-color, #e21c2a);
    z-index: 5;
    transform: translateY(-50%);
    transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease;
    opacity: 0;
    border-radius: 3px;
  }

  /* Stretch triggers with big stagger */
  #flow.is-assembled .td-flow-pipe-1 {
    width: 30%;
    opacity: 1;
    transition-delay: 0.6s;
    --pipe-start-color: #e21c2a;
    --pipe-end-color: #4f46e5;
  }
  #flow.is-assembled .td-flow-pipe-2 {
    width: 30%;
    opacity: 1;
    transition-delay: 1.0s;
    --pipe-start-color: #4f46e5;
    --pipe-end-color: #22c55e;
  }
  #flow.is-assembled .td-flow-pipe-3 {
    width: 30%;
    opacity: 1;
    transition-delay: 1.4s;
    --pipe-start-color: #22c55e;
    --pipe-end-color: #d97706;
  }
}

/* --- 3. Role Cards 3D Docking System --- */
@media (min-width: 768px) {
  /* 3D Viewport container */
  .td-gateways-container {
    perspective: 1000px;
    perspective-origin: 50% 40%;
  }

  /* Scattered float initial states — very dramatic */
  #gateways .row > div:nth-child(1) .td-cyber-card {
    opacity: 0;
    transform: translate3d(-120px, -40px, -250px) rotateY(-25deg) rotateZ(-6deg);
    filter: blur(5px);
    transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  #gateways .row > div:nth-child(2) .td-cyber-card {
    opacity: 0;
    transform: translate3d(0, 80px, -350px) rotateX(18deg) scale(0.85);
    filter: blur(5px);
    transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.2s;
  }
  #gateways .row > div:nth-child(3) .td-cyber-card {
    opacity: 0;
    transform: translate3d(120px, -40px, -250px) rotateY(25deg) rotateZ(6deg);
    filter: blur(5px);
    transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.4s;
  }

  /* Perfect docking grid snapping */
  #gateways.is-docked .row > div .td-cyber-card {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0) scale(1);
    filter: blur(0);
  }

  /* Secure Dock Neon Flash Overlay */
  #gateways.is-docked .row > div .td-cyber-card {
    animation: td-dock-flash 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation-delay: 1.4s;
  }

  @keyframes td-dock-flash {
    0%, 100% {
      box-shadow: var(--shadow);
    }
    40% {
      box-shadow: 0 0 35px rgba(var(--card-glow-rgb, 226, 28, 42), 0.45),
                  inset 0 0 20px rgba(var(--card-glow-rgb, 226, 28, 42), 0.2);
      border-color: rgba(var(--card-glow-rgb, 226, 28, 42), 0.7) !important;
    }
  }
}

/* --- 4. Logistics Dashboard Autoconstruct --- */

/* Stats cards themselves scale up from small */
@media (min-width: 768px) {
  #stats .td-grid-stat {
    opacity: 0;
    transform: translateY(30px) scale(0.9) translateZ(0);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  }
  #stats .col-md-4:nth-child(1) .td-grid-stat { transition-delay: 0s; }
  #stats .col-md-4:nth-child(2) .td-grid-stat { transition-delay: 0.2s; }
  #stats .col-md-4:nth-child(3) .td-grid-stat { transition-delay: 0.4s; }
  
  #stats.is-constructing .td-grid-stat {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
  }
}

/* Sparkline SVG Draw Reveal */
.td-sparkline-svg path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transition: stroke-dashoffset 2.8s cubic-bezier(0.16, 1, 0.3, 1);
}
#stats.is-constructing .td-sparkline-svg path {
  stroke-dashoffset: 0;
}

/* Linear progress indicator bars */
.td-stats-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 12px;
}
.td-stats-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--bar-color, #e21c2a), #f87171);
  border-radius: 99px;
  transition: width 2s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0.5s;
}
#stats.is-constructing .td-stats-bar-fill {
  width: var(--bar-width, 70%);
}

/* ════════════════════════════════════════════════ */
/* ═══ MOBILE-FIRST ACCESS OVERRIDES (DOUBLE GUARD) ══ */
/* ════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  /* Suppress scroll reveals on mobile */
  .td-scroll-reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  
  /* Reset workflow step offsets */
  #flow .row > div .td-grid-stat {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .td-flow-pipe {
    display: none !important;
  }

  /* Reset role card depth docking */
  #gateways .row > div .td-cyber-card {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }

  /* Reset word reveals */
  .td-word {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }

  /* Reset stats cards and metrics */
  #stats .td-grid-stat {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .td-sparkline-svg path {
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
  .td-stats-bar-fill {
    width: var(--bar-width, 70%) !important;
    transition: none !important;
  }
}

/* Work screens: compact mobile overrides after the legacy visual layer. */
@media (max-width: 767.98px) {
  body:not(.td-home-active) .app-main {
    padding-top: .65rem !important;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .app-toast-container {
    left: .5rem !important;
    right: .5rem !important;
    bottom: calc(4.65rem + env(safe-area-inset-bottom, 0px)) !important;
    width: auto;
    padding: 0 !important;
  }
  .app-toast {
    margin-bottom: .45rem;
    border-radius: 14px;
  }
  .app-toast-row {
    padding: .68rem .72rem;
  }
  body:not(.td-home-active) .page-header {
    margin-bottom: .55rem !important;
  }
  body:not(.td-home-active) .role-guide.is-collapsed {
    margin-bottom: .65rem !important;
  }
  body:not(.td-home-active) .role-guide:not(.is-collapsed) {
    padding: 2.75rem .75rem .75rem !important;
  }
  .mobile-role-nav {
    position: fixed;
    left: .75rem;
    right: .75rem;
    bottom: calc(.65rem + env(safe-area-inset-bottom, 0px));
    z-index: 1038;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .25rem;
    padding: .35rem;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .06);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
  }
  .mobile-role-nav a {
    min-width: 0;
    min-height: 52px;
    display: grid;
    place-items: center;
    gap: .12rem;
    padding: .35rem .25rem;
    border-radius: 14px;
    color: var(--ink2);
    font-size: .68rem;
    font-weight: 850;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
  }
  .mobile-role-nav a.is-active {
    color: var(--accent);
    background: rgba(226, 28, 42, .08);
  }
  .mobile-nav-icon {
    position: relative;
    width: 21px;
    height: 21px;
    border-radius: 8px;
    background: rgba(100, 116, 139, .12);
  }
  .mobile-role-nav a.is-active .mobile-nav-icon {
    background: rgba(226, 28, 42, .16);
  }
  .mobile-nav-icon::before,
  .mobile-nav-icon::after {
    content: "";
    position: absolute;
    border-radius: 99px;
    background: currentColor;
  }
  .mobile-nav-appraiser::before {
    left: 5px;
    right: 5px;
    top: 6px;
    height: 2px;
    box-shadow: 0 5px 0 currentColor;
  }
  .mobile-nav-driver::before {
    left: 4px;
    right: 4px;
    top: 7px;
    height: 3px;
  }
  .mobile-nav-driver::after {
    left: 6px;
    right: 6px;
    top: 13px;
    height: 3px;
  }
  .mobile-nav-admin::before {
    left: 9px;
    top: 4px;
    width: 3px;
    height: 13px;
  }
  .mobile-nav-admin::after {
    left: 4px;
    top: 9px;
    width: 13px;
    height: 3px;
  }
  .mobile-nav-user::before {
    left: 7px;
    top: 4px;
    width: 7px;
    height: 7px;
  }
  .mobile-nav-user::after {
    left: 5px;
    top: 13px;
    width: 11px;
    height: 5px;
  }
  body:has(.driver-actions) .mobile-role-nav {
    display: none;
  }
  body:has(.driver-actions) .app-main {
    padding-bottom: 2rem !important;
  }
  .appraiser-work-header,
  .admin-work-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: .55rem;
    margin-bottom: .55rem !important;
  }
  .appraiser-work-header h1,
  .admin-work-header h1 {
    font-size: 1.3rem !important;
    line-height: 1.1;
  }
  .appraiser-work-header p,
  .admin-work-header p,
  .admin-work-header .eyebrow {
    display: none;
  }
  .appraiser-create-button {
    min-height: 40px;
    padding-inline: .75rem;
    white-space: nowrap;
  }
  .appraiser-toolbar {
    padding: .7rem !important;
    margin-bottom: .65rem !important;
  }
  .appraiser-toolbar .form-label {
    font-size: .7rem;
  }
  .branch-pill {
    margin-top: .5rem;
    padding: .45rem .55rem;
    font-size: .78rem;
    line-height: 1.25;
  }
  .admin-export-block {
    padding: .75rem !important;
  }
  .admin-export-block h2 {
    font-size: .95rem;
  }
  .admin-export-block .export-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .driver-route-controls {
    padding: .7rem !important;
    margin-bottom: .6rem !important;
    border-radius: 14px !important;
  }
  .driver-control-grid {
    grid-template-columns: 1fr auto !important;
    gap: .5rem !important;
  }
  .driver-control-driver,
  .driver-control-search {
    grid-column: 1 / -1 !important;
  }
  .driver-control-driver .form-label,
  .driver-control-search .form-label {
    display: none !important;
  }
  .driver-summary-strip,
  .route-summary-print {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .35rem !important;
  }
  .driver-summary-strip div,
  .route-summary-print div {
    min-height: 54px !important;
    padding: .45rem !important;
    border-radius: 12px !important;
  }
  .driver-summary-strip span,
  .route-summary-print span {
    font-size: .58rem !important;
    line-height: 1.1 !important;
  }
  .driver-summary-strip strong,
  .route-summary-print strong {
    font-size: .98rem !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
  }
  .branch-card {
    padding: .78rem !important;
    border-radius: 14px !important;
  }
  .branch-card h2 {
    font-size: 1rem !important;
  }
  .branch-card-address {
    font-size: .84rem !important;
  }
  .branch-card-count {
    min-width: 70px !important;
    padding: .45rem !important;
  }
  .driver-card-action {
    min-height: 44px !important;
    font-size: .92rem !important;
  }
  .route-print-filter,
  .route-sheet-head,
  .route-stop {
    padding: .7rem !important;
    border-radius: 14px !important;
  }
}

/* Work UI refinements: compact guides, appraiser demand and history. */
body:not(.td-home-active) .role-guide.work-guide {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: .65rem !important;
  align-items: start !important;
  padding: .8rem .9rem !important;
  margin-bottom: .75rem !important;
  border-left-width: 3px !important;
  border-radius: 14px !important;
  overflow: visible !important;
  transform: none !important;
}
body:not(.td-home-active) .role-guide.work-guide:hover {
  transform: none !important;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-toggle {
  position: static !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 74px !important;
  min-height: 34px !important;
  padding: .25rem .65rem !important;
  white-space: nowrap !important;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-title {
  min-width: 0;
  padding-right: .25rem;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-title strong {
  font-size: .95rem !important;
  line-height: 1.2 !important;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-title span {
  max-width: 760px;
  font-size: .8rem !important;
  line-height: 1.35 !important;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-steps {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: .5rem !important;
  margin-top: .45rem !important;
  padding-top: .55rem !important;
}
body:not(.td-home-active) .role-guide.work-guide.is-collapsed .role-guide-title span,
body:not(.td-home-active) .role-guide.work-guide.is-collapsed .role-guide-steps {
  display: none !important;
}

/* Compact work screens: keep operational data above the fold. */
body:not(.td-home-active) .page-header.appraiser-work-header,
body:not(.td-home-active) .page-header.driver-compact-header {
  margin-bottom: .45rem !important;
  padding-bottom: .35rem !important;
  border-bottom: 1px solid rgba(15, 23, 42, .045);
}
body:not(.td-home-active) .page-header.appraiser-work-header h1,
body:not(.td-home-active) .page-header.driver-compact-header h1 {
  margin: 0 !important;
  font-size: 1.55rem !important;
  line-height: 1.05 !important;
}
body:not(.td-home-active) .page-header.appraiser-work-header p,
body:not(.td-home-active) .page-header.driver-compact-header p {
  margin-top: .16rem !important;
  font-size: .78rem !important;
  line-height: 1.25 !important;
}
body:not(.td-home-active) .role-guide.work-guide {
  padding: .62rem .75rem !important;
  margin-bottom: .55rem !important;
  min-height: 46px;
}
body:not(.td-home-active) .role-guide.work-guide.is-collapsed {
  padding: .58rem .65rem !important;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-title strong {
  font-size: .88rem !important;
}
body:not(.td-home-active) .role-guide.work-guide .role-guide-toggle {
  min-height: 30px !important;
  min-width: 68px !important;
  font-size: .74rem !important;
}
.driver-route-controls,
.appraiser-toolbar {
  margin-bottom: .55rem !important;
  padding: .72rem .8rem !important;
  border-radius: 16px !important;
}
.driver-control-grid {
  gap: .55rem !important;
}
.driver-route-controls .form-label,
.appraiser-toolbar .form-label {
  margin-bottom: .18rem !important;
  font-size: .68rem !important;
  letter-spacing: .04em;
}
.driver-route-controls .form-control,
.driver-route-controls .form-select,
.appraiser-toolbar .form-control,
.appraiser-toolbar .form-select {
  min-height: 38px;
  padding-block: .42rem;
  font-size: .84rem;
}
.driver-control-submit .btn,
.appraiser-toolbar .toolbar-actions .btn {
  min-height: 38px;
}
.driver-summary-strip {
  margin-bottom: .58rem !important;
  gap: .45rem !important;
}
.driver-summary-strip div {
  min-height: 58px !important;
  padding: .55rem .7rem !important;
  border-radius: 14px !important;
}
.driver-summary-strip span {
  font-size: .62rem !important;
}
.driver-summary-strip strong {
  font-size: 1.06rem !important;
}
.appraiser-selected-branch {
  margin-top: .42rem !important;
}
.appraiser-demand-section {
  margin-top: .55rem !important;
}

.appraiser-demand-section,
.appraiser-history-section {
  padding: .9rem !important;
}
.appraiser-demand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .55rem;
}
.appraiser-demand-grid > [data-filter-row] {
  min-width: 0;
}
.appraiser-demand-section .demand-card {
  display: grid;
  gap: .55rem;
  height: 100%;
  padding: .78rem .85rem !important;
  border-radius: 14px !important;
}
.demand-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: start;
}
.demand-card-title {
  min-width: 0;
}
.demand-card-title strong {
  display: block;
  font-size: .9rem !important;
  line-height: 1.25;
}
.demand-card-title span {
  display: block;
  margin-top: .12rem;
  color: var(--ink3);
  font-size: .72rem;
  font-weight: 750;
}
.appraiser-demand-section .badge {
  white-space: nowrap;
}
.appraiser-demand-section .demand-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: .32rem !important;
}
.appraiser-demand-section .demand-grid div {
  min-width: 0;
  padding: .38rem .45rem !important;
  border-radius: 10px !important;
}
.appraiser-demand-section .demand-grid span {
  font-size: .58rem !important;
}
.appraiser-demand-section .demand-grid strong {
  font-size: 1rem !important;
  line-height: 1.1;
}

.appraiser-history-list {
  display: grid;
  gap: .5rem;
}
.appraiser-history-card {
  padding: .78rem .9rem !important;
  border-radius: 14px !important;
}
.appraiser-history-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: start;
}
.appraiser-history-main {
  min-width: 0;
}
.appraiser-history-main strong {
  font-size: .9rem;
}
.appraiser-history-main span {
  color: var(--ink2);
  font-size: .8rem;
}
.appraiser-history-card .history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  flex-wrap: nowrap;
}
.appraiser-history-card .history-actions .badge {
  white-space: nowrap;
}
.appraiser-history-card .line-chip {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.comment-callout {
  padding: .44rem .58rem;
  border: 1px solid rgba(59,130,246,.16);
  border-left: 3px solid #3b82f6;
  border-radius: 10px;
  background: rgba(59,130,246,.07);
  color: #1e3a8a;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.32;
  overflow-wrap: anywhere;
}
.comment-callout strong {
  color: #1d4ed8;
  font-weight: 950;
}
.comment-callout-request {
  margin-top: .35rem;
}
.comment-callout-compact {
  margin-top: .28rem;
  padding: .34rem .46rem;
  font-size: .76rem;
}
.comment-chip {
  display: inline-block;
  max-width: 100%;
  margin: .12rem .15rem .12rem 0;
  padding: .22rem .42rem;
  border: 1px solid rgba(59,130,246,.16);
  border-radius: 999px;
  background: rgba(59,130,246,.07);
  color: #1e3a8a;
  font-size: .76rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.comment-input {
  border-color: rgba(59,130,246,.25) !important;
  background-color: rgba(239,246,255,.92) !important;
  font-weight: 750 !important;
}
.route-comment {
  margin-top: .18rem;
  padding: .2rem .34rem;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  background: rgba(37,99,235,.07);
  color: #1e3a8a;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.25;
}
.route-comment strong {
  color: #1d4ed8;
  font-weight: 950;
}

@media (max-width: 767.98px) {
  .admin-topbar {
    grid-template-columns: 1fr;
    gap: .55rem;
    margin-bottom: .5rem;
    padding-bottom: .5rem;
  }
  .admin-title-block h1 {
    font-size: 1.35rem;
  }
  .admin-title-block p,
  .admin-title-block .eyebrow {
    display: none;
  }
  .admin-period-strip {
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    padding: .6rem;
    margin-bottom: .55rem;
  }
  .admin-period-label,
  .admin-period-presets,
  .admin-period-export {
    grid-column: 1 / -1;
  }
  .admin-period-label {
    display: none;
  }
  .admin-period-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-period-presets .btn {
    min-width: 0;
    padding-inline: .3rem;
    font-size: .72rem;
  }
  .admin-period-export {
    grid-template-columns: 1fr;
    justify-self: stretch;
    padding-left: 0;
    padding-top: .42rem;
    border-left: 0;
    border-top: 1px solid rgba(15, 23, 42, .07);
  }
  .admin-period-export > span {
    display: none;
  }
  .admin-period-export .export-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
  }
  body:not(.td-home-active) .page-header.appraiser-work-header,
  body:not(.td-home-active) .page-header.driver-compact-header {
    margin-bottom: .35rem !important;
    padding-bottom: .25rem !important;
  }
  body:not(.td-home-active) .page-header.appraiser-work-header h1,
  body:not(.td-home-active) .page-header.driver-compact-header h1 {
    font-size: 1.2rem !important;
  }
  body:not(.td-home-active) .page-header.appraiser-work-header p,
  body:not(.td-home-active) .page-header.driver-compact-header p {
    display: none;
  }
  body:not(.td-home-active) .role-guide.work-guide {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: .65rem .7rem !important;
    margin-bottom: .45rem !important;
  }
  body:not(.td-home-active) .role-guide.work-guide .role-guide-title strong {
    font-size: .9rem !important;
  }
  body:not(.td-home-active) .role-guide.work-guide .role-guide-title span {
    font-size: .76rem !important;
  }
  body:not(.td-home-active) .role-guide.work-guide .role-guide-toggle {
    min-width: 68px !important;
    min-height: 32px !important;
    font-size: .72rem !important;
  }
  body:not(.td-home-active) .role-guide.work-guide .role-guide-steps {
    grid-template-columns: 1fr !important;
  }
  .driver-route-controls,
  .appraiser-toolbar {
    padding: .58rem !important;
    margin-bottom: .45rem !important;
    border-radius: 14px !important;
  }
  .appraiser-toolbar .row {
    --bs-gutter-y: .45rem;
  }
  .appraiser-toolbar .toolbar-actions {
    margin-top: .45rem;
  }
  .appraiser-demand-section,
  .appraiser-history-section {
    padding: .7rem !important;
  }
  .appraiser-demand-grid {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  .appraiser-demand-section .demand-card {
    padding: .7rem !important;
  }
  .demand-card-head {
    grid-template-columns: minmax(0, 1fr);
    gap: .35rem;
  }
  .appraiser-demand-section .badge {
    width: fit-content;
  }
  .appraiser-demand-section .demand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .appraiser-demand-section .demand-grid div {
    padding: .36rem .4rem !important;
  }
  .appraiser-demand-section .demand-grid span {
    font-size: .54rem !important;
    letter-spacing: .02em;
  }
  .appraiser-demand-section .demand-grid strong {
    font-size: .96rem !important;
  }
  .appraiser-history-head {
    grid-template-columns: 1fr;
    gap: .45rem;
  }
  .appraiser-history-card .history-actions {
    justify-content: space-between;
  }
  .appraiser-history-card .history-actions .btn {
    min-height: 38px;
    min-width: 118px;
  }
}

@media (max-width: 767.98px) {
  .admin-period-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: .42rem !important;
    align-items: end !important;
    min-height: 0 !important;
    padding: .6rem !important;
  }
  .admin-period-label {
    display: none !important;
  }
  .admin-period-strip .admin-date-field {
    grid-column: auto !important;
  }
  .admin-period-presets {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: .32rem !important;
    width: 100% !important;
  }
  .admin-period-presets .btn {
    min-height: 34px !important;
    padding: .3rem .2rem !important;
    font-size: .68rem !important;
    line-height: 1.1 !important;
  }
  .admin-period-export {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-self: stretch !important;
    width: 100% !important;
    padding: .42rem 0 0 !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(15, 23, 42, .07) !important;
  }
  .admin-period-export > span {
    display: none !important;
  }
  .admin-period-export .export-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .35rem !important;
  }
  .admin-period-export .export-actions .btn {
    min-height: 34px !important;
    padding: .32rem .25rem !important;
    font-size: .72rem !important;
  }
}
