:root {
  color-scheme: light;
  --bg: #eee9e1;
  --surface: #fbf8f3;
  --solid: #fffdf9;
  --ink: #221d29;
  --muted: #625865;
  --line: #ddd2d9;
  --accent: #703653;
  --soft: #f0e4ec;
  --rose: #f4e1cd;
  --danger: #982d48;
  --shadow: 0 12px 32px #31223910;
  --night: #171021;
  --night-ink: #fff7ee;
  --night-muted: #e1cbd8;
  --dusk: linear-gradient(158deg, #f2ba9b 0%, #a9617c 25%, #3b223e 53%, #171021 83%);
  --panel-radius: 24px;
  --serif: Georgia, "Times New Roman", serif;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17131f;
  --surface: #231c2b;
  --solid: #2a2233;
  --ink: #f7edf3;
  --muted: #c9b7c7;
  --line: #4b3a50;
  --accent: #f4b9c7;
  --soft: #3a2a40;
  --rose: #4c3139;
  --danger: #ffc1cd;
  --shadow: 0 12px 32px #0003;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  background-image:
    radial-gradient(ellipse at 88% 0%, #c07d9922, transparent 56%),
    radial-gradient(ellipse at 0% 33%, #b493c323, transparent 54%);
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  background: var(--solid);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  min-height: 44px;
}
button:hover,
.button:hover {
  border-color: var(--accent);
}
button.primary,
.button.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.small {
  font-size: 12px;
  padding: 7px 10px;
  min-height: 36px;
}
button.danger {
  color: var(--danger);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  letter-spacing: -0.045em;
  line-height: 1.08;
  font: 400 clamp(32px, 4vw, 48px) / 1.08 var(--serif);
}
h2 {
  font: 400 26px / 1.15 var(--serif);
  letter-spacing: -0.035em;
}
h3 {
  font-size: 16px;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}
.badge {
  display: inline-flex;
  border-radius: 30px;
  background: var(--soft);
  padding: 5px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.badge.warn {
  background: var(--rose);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.brandmark {
  height: 38px;
  width: 38px;
  flex: 0 0 38px;
  object-fit: contain;
}
.delivery-contact {
  margin-block: 14px;
}
.delivery-contact dt {
  font-weight: 700;
}
.delivery-contact dd {
  margin: 0 0 9px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.stat .number {
  font: 400 clamp(25px, 3vw, 38px) / 1.05 var(--serif);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  margin: 14px 0 0;
}
.stat small {
  font-size: 12px;
}
.stat.featured {
  background: linear-gradient(145deg, #553451, #21152e 65%);
  color: var(--night-ink);
  border-color: #664460;
}
.stat.featured small {
  color: var(--night-muted);
}
.page-head {
  margin-bottom: 24px;
  padding: clamp(20px, 3vw, 32px);
  background: linear-gradient(118deg, #24172e 25%, #3b2340 70%, #6a3b59);
  color: var(--night-ink);
  border: 1px solid #795069;
  border-radius: var(--panel-radius);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.page-head h1 {
  margin: 7px 0 8px;
}
.page-head p {
  margin: 0;
  color: var(--night-muted);
}
.page-head .eyebrow {
  color: var(--night-muted);
}
.page-head button {
  background: var(--night-ink);
  color: #342238;
  border-color: transparent;
}
.page-head button:hover {
  border-color: #e7afc2;
}
.app-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  padding: 30px 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar nav a {
  text-decoration: none;
  color: var(--muted);
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 14px;
}
.sidebar nav a.active {
  background: var(--soft);
  color: var(--ink);
  font-weight: 650;
}
.nav-icon {
  display: inline-block;
  width: 25px;
  font-size: 16px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  background: var(--soft);
  border-radius: 14px;
  font-size: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 84px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar .actions {
  display: flex;
  gap: 10px;
}
.main {
  max-width: 1500px;
  padding: 34px 36px 60px;
  margin: auto;
}
.status {
  font-size: 12px;
  color: var(--muted);
  min-height: 19px;
}
.notice {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  margin-bottom: 20px;
  font-size: 13px;
}
.notice.error {
  color: var(--danger);
  background: var(--surface);
  border-color: var(--danger);
}
.table-card {
  padding: 0;
  overflow: hidden;
}
.table-top {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 650;
  background: var(--soft);
  padding: 13px 20px;
  white-space: nowrap;
}
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td .sub {
  font-size: 11px;
  display: block;
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
.table-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.empty {
  text-align: center;
  padding: 50px 24px;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
  font-size: 17px;
}
.filters {
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
#history-range {
  align-items: end;
}
.filters input {
  max-width: 320px;
}
.filters select {
  max-width: 200px;
}
input,
select,
textarea {
  width: 100%;
  background: var(--solid);
  color: var(--ink);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
}
textarea {
  resize: vertical;
  min-height: 85px;
}
label {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
label small {
  font-weight: 400;
}
.field {
  margin-bottom: 17px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.field-grid .wide {
  grid-column: 1/-1;
}
.assignment-row {
  min-inline-size: 0;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.assignment-row legend {
  padding-inline: 6px;
  font-weight: 700;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
dialog {
  background: var(--solid);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  max-width: 640px;
  width: calc(100% - 32px);
  max-height: 90vh;
  box-shadow: 0 30px 100px #0003;
}
dialog::backdrop {
  background: #170f24ad;
  backdrop-filter: blur(5px);
}
dialog h2 {
  margin-bottom: 6px;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
dialog .dialog-close {
  float: right;
  padding: 6px 12px;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px;
  padding: 15px 20px;
  max-width: 400px;
  z-index: 99;
}
.split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
.activity {
  list-style: none;
  margin: 0;
  padding: 0;
}
.activity li {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  font-size: 13px;
}
.activity li:last-child {
  border: 0;
}
.activity time {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.home-container {
  max-width: 1200px;
  margin: auto;
  padding: 26px 32px;
}
.home-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 30px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(300px, auto) auto;
  gap: 14px;
}
.lens-panel,
.dusk-panel {
  color: var(--night-ink);
  border: 1px solid #75516d;
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
}
.lens-panel {
  background:
    radial-gradient(ellipse at 50% 58%, #483169, transparent 65%),
    linear-gradient(170deg, #170f22 30%, #311b3e 73%, #82516b);
}
.hero-lens {
  grid-row: span 2;
  padding: 25px;
  display: grid;
  align-content: space-between;
  gap: 20px;
}
.lens-panel .eyebrow,
.lens-panel p,
.dusk-panel p {
  color: var(--night-muted);
}
.hero-lens p {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
}
.glass-lens {
  position: relative;
  width: min(100%, 285px);
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  isolation: isolate;
  overflow: hidden;
  background: #423067;
  box-shadow: 0 24px 40px #0906107a, 0 0 36px #a98bfd3d;
}
.glass-lens img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(0.9);
  border-radius: 50%;
  filter: saturate(0.8) contrast(0.95);
}
.glass-lens::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 31% 23%, #fff7e84d, transparent 35%),
    radial-gradient(circle, transparent 51%, #39245f7d 68%, #1a102c 100%);
  box-shadow: inset 1px 5px 8px #c6adfa80, inset -8px -14px 35px #150b2e9c;
}
.hero-copy {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(22px, 4vw, 46px);
  background: var(--dusk);
}
.hero-copy h1 {
  font-size: clamp(36px, 5vw, 68px);
  margin: 0 0 12px;
}
.hero-copy p {
  max-width: 48ch;
  margin-bottom: 18px;
}
.hero-copy .primary {
  background: var(--night-ink);
  color: #342238;
  border-color: transparent;
}
.hero-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  text-decoration: none;
}
.hero-tile:hover {
  border-color: var(--accent);
}
.hero-tile strong,
.hero-tile small {
  display: block;
}
.tile-pearl {
  flex: 0 0 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 22%, #f7e9e9, #a18da8 41%, #49365b 79%);
  box-shadow: 0 5px 11px #39274242;
}
.tile-pearl-warm {
  background: radial-gradient(circle at 33% 22%, #ffecd9, #c4869b 42%, #694053 79%);
}
@media (prefers-reduced-motion: no-preference) {
  .hero > *,
  .login-art,
  .login-card {
    animation: card-arrival 430ms ease-out both;
  }
  .hero-copy, .login-card { animation-delay: 55ms; }
  .hero-tile { animation-delay: 115ms; }
  .hero-tile:last-child { animation-delay: 155ms; }
}
@keyframes card-arrival {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.service-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin-bottom: 18px;
}
section {
  scroll-margin-top: 25px;
}
.section-head {
  margin: 55px 0 25px;
}
.public-page h1 {
  margin-top: 0;
}
.home-footer {
  padding: 35px 0 15px;
  margin-top: 50px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-content: center;
  max-width: 1060px;
  margin: auto;
  padding: 35px;
}
.login-art {
  padding: 30px;
  display: grid;
  align-content: space-between;
  gap: 24px;
}
.login-art-copy h2 {
  font-size: clamp(38px, 4vw, 56px);
  margin-bottom: 10px;
}
.login-art p {
  margin-bottom: 0;
}
.login-card {
  padding: clamp(24px, 5vw, 48px);
  align-self: stretch;
}
.login-card h1 {
  margin: 22px 0 8px;
}
.login-card .primary {
  width: 100%;
}
.login-footer {
  font-size: 12px;
  text-align: center;
  margin-top: 22px;
  color: var(--muted);
}
.loading {
  padding: 80px;
  text-align: center;
}
.assistant-output {
  white-space: pre-wrap;
  line-height: 1.8;
  padding: 20px;
  background: var(--soft);
  border-radius: 12px;
  margin-top: 20px;
}
.receipt {
  padding: 20px;
  border: 1px solid var(--line);
  margin: 20px 0;
}
.receipt p {
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 15px;
  top: 15px;
  z-index: 100;
  background: var(--solid);
  padding: 10px;
}
.mobile-menu {
  display: none;
}
@media (max-width: 1050px) {
  .app-layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .sidebar {
    padding: 25px 12px;
  }
  .main {
    padding: 28px 22px;
  }
  .topbar {
    padding: 20px 22px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .app-layout {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    padding: 18px;
  }
  .sidebar nav {
    display: none;
    grid-template-columns: 1fr 1fr;
  }
  .sidebar.open nav {
    display: grid;
  }
  .sidebar-footer {
    display: none;
  }
  .mobile-menu {
    display: inline-flex;
    margin-left: auto;
  }
  .sidebar > .row {
    flex-wrap: nowrap;
  }
  .topbar {
    height: auto;
    min-height: 78px;
    padding: 14px 18px;
  }
  .main {
    padding: 25px 16px;
  }
  .topbar .user-name {
    display: none;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .card {
    padding: 20px;
  }
  .table-card {
    padding: 0;
  }
  .stats {
    gap: 12px;
  }
  .stat .number {
    font-size: 27px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 10px;
  }
  .hero-lens {
    grid-column: span 2;
    grid-row: auto;
    order: 1;
    padding: 20px;
  }
  .hero-copy {
    background:
      radial-gradient(ellipse 75% 65% at 100% 0%, #cb8e9b, transparent 78%),
      linear-gradient(145deg, #5d3957, #171021 80%);
  }
  .hero-lens .glass-lens {
    max-width: 205px;
  }
  .hero-tile {
    order: 2;
    flex-direction: column;
    align-items: start;
    gap: 8px;
    padding: 14px;
  }
  .tile-pearl {
    flex-basis: auto;
    width: 30px;
  }
  .home-container {
    padding: 20px;
  }
  .home-nav {
    align-items: center;
    gap: 10px;
  }
  .home-nav nav {
    justify-content: flex-end;
    gap: 8px;
  }
  .home-nav [data-theme-toggle] {
    width: 44px;
    padding: 0;
    font-size: 0;
  }
  .home-nav [data-theme-toggle]::before {
    content: "◐";
    font-size: 16px;
  }
  html[data-theme="dark"] .home-nav [data-theme-toggle]::before {
    content: "☀";
  }
  .home-nav .optional {
    display: none;
  }
  .home-footer {
    flex-direction: column;
  }
  .login-layout {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 12px;
  }
  .login-art {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
  }
  .login-art .glass-lens {
    width: 54px;
    margin: 0;
  }
  .login-art-copy {
    display: none;
  }
  .login-card {
    padding: 22px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .field-grid .wide {
    grid-column: auto;
  }
  .filters input,
  .filters select {
    max-width: none;
  }
  .toast {
    left: 16px;
    right: 16px;
  }
  .topbar .actions button {
    padding: 8px 10px;
  }
  .table-top {
    padding: 18px;
  }
  .table-footer {
    padding: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .sidebar,
  .topbar,
  .main,
  .toast,
  .home-container,
  dialog button,
  dialog form {
    display: none !important;
  }
  dialog[open] {
    --ink: #000;
    --muted: #333;
    --accent: #333;
    --line: #ccc;
    --surface: #fff;
    --soft: #eee;
    --shadow: none;
    display: block;
    position: static;
    max-width: none;
    max-height: none;
    width: 100%;
    border: 0;
    box-shadow: none;
    color: #000;
    background: #fff;
  }
  dialog::backdrop {
    background: none;
  }
  .receipt {
    border-color: #ddd;
  }
  .receipt p {
    color: #000;
  }
}

/* Keep explicit refresh available on small screens without pushing the page sideways. */
.topbar {
  height: auto;
  min-height: 84px;
  flex-wrap: wrap;
}
.topbar .actions {
  flex-wrap: wrap;
}
