:root {
  --bg: #f3ece3;
  --bg-2: #e8ddd0;
  --surface: #fffaf3;
  --ink: #1c1712;
  --muted: #6a6258;
  --line: #e2d6c6;
  --forest: #2a4538;
  --forest-2: #385a48;
  --amber: #c17a3a;
  --amber-soft: #f4e4d0;
  --honey: #d9a35a;
  --sage: #5a7a60;
  --rose: #a45b56;
  --sky: #3c6874;
  --shadow: 0 20px 44px rgba(42, 28, 14, 0.08);
  --radius: 20px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --paw:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140' fill='none'%3E%3Ccircle cx='42' cy='38' r='8' fill='%232a4538' fill-opacity='.045'/%3E%3Ccircle cx='68' cy='28' r='7' fill='%232a4538' fill-opacity='.045'/%3E%3Ccircle cx='92' cy='38' r='8' fill='%232a4538' fill-opacity='.045'/%3E%3Cellipse cx='68' cy='68' rx='16' ry='14' fill='%232a4538' fill-opacity='.045'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { margin: 0; padding: 0; }
body.san-body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--paw);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}
body.san-nav-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: var(--forest); }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 .4rem;
}
p { margin: 0 0 .8rem; }

:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 3px;
}

.san-kicker {
  margin: 0 0 .35rem;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}

.san-pill {
  display: inline-block;
  margin: 0 0 .7rem;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: rgba(255, 248, 236, .18);
  border: 1px solid rgba(255, 248, 236, .28);
  color: #fff6ea;
  font-size: .75rem;
  letter-spacing: .04em;
}

.san-btn,
.san-link { font: inherit; cursor: pointer; }
.san-skip {
  position: absolute;
  left: .8rem;
  top: -3.2rem;
  z-index: 40;
  background: var(--forest);
  color: #fff8ef;
  padding: .55rem .9rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}
.san-skip:focus { top: .8rem; }

.san-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .72rem 1.15rem;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  transition: transform .2s var(--ease), background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.san-btn:hover {
  border-color: var(--forest);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(42, 28, 14, .08);
}
.san-btn:active { transform: translateY(0) scale(.98); }
.san-btn-primary {
  background: var(--forest);
  color: #fff8ef;
  border-color: var(--forest);
}
.san-btn-primary:hover { background: var(--forest-2); }
.san-btn-danger { background: #fff4f2; color: var(--rose); border-color: #ead0cc; }
.san-btn-ghost { background: transparent; }
.san-btn-block { width: 100%; }
.san-link { background: none; border: 0; color: var(--forest); text-decoration: none; padding: 0; font-weight: 600; }
.san-link:hover { text-decoration: underline; }

.san-field { display: grid; gap: .38rem; margin-bottom: 1rem; }
.san-field span { font-size: .84rem; color: var(--muted); font-weight: 600; }
.san-field input,
.san-field select,
.san-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: .78rem .9rem;
  min-height: 48px;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.san-field input:focus,
.san-field select:focus,
.san-field textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(42, 69, 56, .12);
}

.san-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: inherit;
}
.san-brand strong { display: block; font-family: var(--display); font-size: 1.08rem; }
.san-brand small { display: block; color: var(--muted); font-size: .75rem; }
.san-logo {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(42, 28, 14, .14));
}
.san-logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff8ef;
  padding: 3px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
  overflow: hidden;
  flex: 0 0 52px;
}
.san-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.san-brand-lg {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .45rem;
  margin-bottom: 1.15rem;
}
.san-brand-lg h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}
.san-brand-lg small { color: var(--muted); }
.san-role-pill {
  display: inline-block;
  padding: .22rem .6rem;
  border-radius: 999px;
  background: rgba(217, 163, 90, .18);
  color: #f0d3a6;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
}

/* Login — centered like wp-login */
.san-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.san-login-card {
  width: min(360px, 100%);
  background: var(--surface);
  border: 1px solid rgba(226, 214, 198, .9);
  border-radius: 8px;
  padding: 1.6rem 1.5rem 1.35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.san-alert {
  background: #fdecea;
  color: #8a3a34;
  border-radius: 12px;
  padding: .7rem .9rem;
  animation: san-fade-up .3s var(--ease);
}
.san-check {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin: 0 0 1rem;
  color: var(--muted);
  width: auto;
  height: auto;
  min-height: 44px;
  border: 0;
  position: relative;
}
.san-check span { line-height: 1.3; }
.san-help { color: var(--muted); font-size: .86rem; margin-top: .85rem; }
.san-fallback {
  min-height: 70vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: .4rem;
  padding: 2rem 1rem;
}

/* App shell */
.san-shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.san-sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 28%),
    #22362d;
  color: #efe7dc;
  padding: 1.4rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.san-sidebar .san-brand { color: #fff7ec; }
.san-sidebar .san-logo-mark {
  background: #fff8ef;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
}
.san-nav { display: grid; gap: .22rem; }
.san-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #d5cbc0;
  text-decoration: none;
  padding: .7rem .72rem;
  min-height: 44px;
  border-radius: 12px;
  transition: background .2s ease, color .2s ease, transform .2s var(--ease);
}
.san-nav a:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  transform: translateX(2px);
}
.san-nav a.is-active {
  background: rgba(217, 163, 90, .18);
  color: #fff8ee;
}
.san-nav-ico { flex: 0 0 18px; opacity: .88; }
.san-sidebar-foot { margin-top: auto; display: grid; gap: .65rem; }
.san-logout {
  color: #f0d2b0;
  font-size: .9rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color .2s ease;
}
.san-logout:hover { color: #fff; }

.san-main { min-width: 0; }
.san-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.7rem .2rem;
}
.san-topbar > div:nth-child(2) { min-width: 0; flex: 1; }
.san-topbar h1 { font-size: 1.85rem; }
.san-userchip {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-align: left;
}
.san-userchip strong,
.san-userchip-meta { display: block; }
.san-userchip small { display: block; color: var(--muted); font-size: .78rem; }
.san-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: #7a4a1d;
  font-weight: 700;
}
.san-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #fff;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--forest);
  box-shadow: 0 1px 0 rgba(42, 28, 14, .04);
}
.san-nav-backdrop {
  display: none;
}
.san-content {
  padding: 1.2rem 1.7rem 2.6rem;
  display: grid;
  gap: 1.1rem;
}
.san-content > * {
  animation: san-fade-up .45s var(--ease) both;
}
.san-content > *:nth-child(2) { animation-delay: .05s; }
.san-content > *:nth-child(3) { animation-delay: .1s; }
.san-content > *:nth-child(4) { animation-delay: .15s; }

.san-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: 0 10px 28px rgba(42, 28, 14, .04);
  transition: transform .25s var(--ease), box-shadow .25s ease;
}
.san-card:hover { box-shadow: 0 16px 34px rgba(42, 28, 14, .06); }
.san-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.san-card-narrow { max-width: 560px; }

.san-hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  padding: 1.55rem 1.6rem;
  border-radius: 24px;
  background:
    linear-gradient(115deg, rgba(26, 42, 34, .88), rgba(42, 69, 56, .62)),
    url("../images/puppy.jpg") center/cover;
  color: #fff8ef;
  overflow: hidden;
  position: relative;
}
.role-admin .san-hero-panel {
  background:
    linear-gradient(115deg, rgba(26, 42, 34, .88), rgba(42, 69, 56, .58)),
    url("../images/dog-portrait.jpg") center/cover;
}
.role-gudang .san-hero-panel {
  background:
    linear-gradient(115deg, rgba(26, 42, 34, .88), rgba(42, 69, 56, .58)),
    url("../images/warehouse.jpg") center/cover;
}
.san-hero-panel h2 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); max-width: 18ch; }
.san-hero-panel p { color: #f2e6d6; max-width: 46ch; }
.san-hero-panel .san-btn-primary {
  background: var(--honey);
  color: #2a1d10;
  border-color: var(--honey);
  flex-shrink: 0;
}
.san-hero-panel-plain {
  justify-content: flex-end;
  min-height: 92px;
}

.san-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.san-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.05rem 1.1rem 1rem;
  position: relative;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s ease;
}
.san-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--amber);
}
.san-stat.status-proses::before { background: #c17a3a; }
.san-stat.status-siap_dikirim::before,
.san-stat.status-selesai::before { background: var(--sage); }
.san-stat.status-dikirim::before { background: var(--sky); }
.san-stat.status-dibatalkan::before { background: var(--rose); }
.san-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.san-stat span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.san-stat strong { font-family: var(--display); font-size: 2.05rem; }

.san-table-wrap { overflow-x: auto; }
.san-table { width: 100%; border-collapse: collapse; }
.san-table th,
.san-table td {
  text-align: left;
  padding: .78rem .45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.san-table th {
  color: var(--muted);
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.san-table tbody tr { transition: background .18s ease; }
.san-table tbody tr:hover { background: #faf3ea; }

.san-badge {
  display: inline-block;
  padding: .22rem .58rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--bg-2);
}
.san-badge-lg { font-size: .84rem; padding: .42rem .82rem; }
.status-baru,
.status-proses { background: #f6e6d3; color: #8a4e18; }
.status-diproses,
.status-siap_dikirim { background: #dce8e2; color: #24513a; }
.status-dikirim { background: #d7e5ea; color: #21505c; }
.status-selesai { background: #dce8d4; color: #3d5b32; }
.status-dibatalkan { background: #f3ddd9; color: #8a3d38; }

.san-action-widget {
  display: grid;
  gap: .5rem;
}
.san-action-widget .san-btn { width: 100%; justify-content: flex-start; }
.san-action-widget .is-current {
  background: var(--forest);
  color: #fff8ef;
  border-color: var(--forest);
}
.san-action-widget .san-btn:disabled:not(.is-current) { opacity: .45; cursor: not-allowed; }

body.san-print-page {
  background: #d8d4cc;
  background-image: none;
  color: #111;
}
.san-print {
  width: 105mm;
  min-height: 148mm;
  margin: 1rem auto 1.4rem;
  padding: 6mm;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  box-shadow: 0 10px 28px rgba(40, 28, 18, .12);
  font-size: 9px;
  line-height: 1.35;
}
.san-print-size {
  text-align: center;
  margin: 1rem 0 0;
  font-size: .78rem;
  color: #5c534a;
}
.san-print-head { margin-bottom: 3mm; }
.san-print-brand {
  margin: 0;
  font-family: var(--sans, inherit);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.san-print-doctype {
  margin: 1mm 0 0;
  font-family: var(--sans, inherit);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.san-print-meta {
  display: grid;
  gap: .6mm;
  margin: 3mm 0;
}
.san-print-meta p { margin: 0; font-size: 9px; }
.san-print-meta b {
  display: inline-block;
  min-width: 18mm;
  font-weight: 700;
}
.san-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8px;
}
.san-print-table th,
.san-print-table td {
  border: 1px solid #222;
  padding: 1.2mm 1.4mm;
  text-align: left;
  vertical-align: middle;
  word-wrap: break-word;
}
.san-print-table thead th {
  background: #ececec;
  font-weight: 700;
}
.san-print-table .col-check {
  width: 7mm;
  text-align: center;
}
.san-print-table .col-num {
  text-align: right;
  white-space: nowrap;
}
.mode-sales .san-print-table { font-size: 7px; }
.san-print-total {
  margin: 2.5mm 0 0;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}
.san-print-check {
  display: inline-block;
  width: 2.6mm;
  height: 2.6mm;
  border: 1px solid #222;
  vertical-align: middle;
}
.san-print-note { margin: 3mm 0 0; font-size: 8.5px; }
.san-print-actions {
  margin: 8mm auto 0;
  display: flex;
  justify-content: center;
  gap: .7rem;
}
.san-print-actions .san-btn {
  min-width: 110px;
  background: #e9e9e9;
  border: 1px solid #9a9a9a;
  color: #222;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media print {
  @page {
    size: A6 portrait;
    margin: 6mm;
  }
  html,
  body.san-print-page {
    width: 105mm;
    background: #fff !important;
    background-image: none !important;
  }
  .san-print-actions,
  .san-print-size,
  .san-local-flag,
  .san-sidebar,
  .san-topbar { display: none !important; }
  .san-print {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
}

.san-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.san-filter { display: flex; gap: .5rem; flex-wrap: wrap; }
.san-filter input,
.san-filter select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .75rem;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
}

.san-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.san-steps {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.san-steps li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .8rem .4rem .45rem;
  font-size: .82rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.san-steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: #7a4a1d;
  font-size: .68rem;
  font-weight: 700;
}
.san-item-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) 72px 120px 100px 100px 44px;
  gap: .5rem;
  align-items: end;
  margin-bottom: .55rem;
  animation: san-fade-up .25s var(--ease);
}
.san-combo {
  position: relative;
}
.san-combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: .3rem;
  list-style: none;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(40, 28, 18, .08);
}
.san-combo-list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: .55rem .65rem;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.san-combo-list button:hover,
.san-combo-list button.is-active {
  background: #f4efe8;
}
.san-combo-empty {
  padding: .55rem .65rem;
  color: var(--muted);
  font-size: .9rem;
}
.san-mini {
  display: grid;
  gap: .22rem;
  margin: 0;
}
.san-mini span {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.san-item-row select,
.san-item-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
}
.san-total-box {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1rem 0;
  padding: .95rem 0 0;
  border-top: 1px dashed var(--line);
}
.san-total-box strong { font-family: var(--display); font-size: 1.7rem; }
.san-icon-btn {
  border: 0;
  background: #f3ece3;
  border-radius: 8px;
  height: 44px;
  width: 44px;
  cursor: pointer;
  transition: background .2s ease;
}
.san-icon-btn:hover { background: #eadfd2; }

.san-order-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.san-item-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.san-item-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .8rem;
  padding: .62rem 0;
  border-bottom: 1px solid var(--line);
}
.san-item-list em { color: var(--muted); font-style: normal; }
.san-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.san-opsi {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  align-items: center;
}
.san-opsi .san-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.san-history { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.san-history span { color: var(--muted); font-size: .82rem; margin-left: .4rem; }
.san-history p { margin: .15rem 0 0; }

.san-wh-steps { display: grid; gap: .45rem; margin-bottom: 1rem; }
.san-wh-step {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
}
.san-wh-step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  font-size: .75rem;
  font-weight: 700;
}
.san-wh-step.is-done { color: var(--forest); font-weight: 600; }
.san-wh-step.is-done span {
  background: var(--forest);
  color: #fff;
  animation: san-pop .28s var(--ease);
}

.san-wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.san-wh-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.05rem 1.1rem;
  transition: transform .25s var(--ease), box-shadow .25s ease;
}
.san-wh-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.san-wh-card header { display: flex; justify-content: space-between; align-items: center; }
.san-wh-customer { font-family: var(--display); font-size: 1.22rem; margin: .4rem 0 .7rem; }
.san-wh-card ul { padding-left: 1.1rem; margin: 0 0 .8rem; }
.san-mini-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 .8rem;
  display: grid;
  gap: .28rem;
  font-size: .8rem;
  color: var(--muted);
}
.san-mini-steps .is-done { color: var(--forest); font-weight: 600; }

.san-modal {
  border: 0;
  border-radius: 20px;
  padding: 1.3rem;
  width: min(480px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  box-shadow: var(--shadow);
  animation: san-fade-up .28s var(--ease);
}
.san-modal::backdrop { background: rgba(24, 18, 12, .45); }

.san-toast {
  position: fixed;
  right: max(1.2rem, env(safe-area-inset-right));
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  left: auto;
  max-width: min(360px, calc(100vw - 2rem));
  background: var(--forest);
  color: #fff;
  padding: .78rem 1.05rem;
  border-radius: 14px;
  z-index: 20;
  box-shadow: var(--shadow);
  animation: san-toast-in .32s var(--ease);
}
.san-toast[hidden] { display: none; }

@keyframes san-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes san-kenburns {
  from { transform: scale(1.04) translateY(0); }
  to { transform: scale(1.1) translateY(-12px); }
}
@keyframes san-pop {
  from { transform: scale(.7); }
  to { transform: scale(1); }
}
@keyframes san-toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  .san-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .san-shell,
  .san-grid-2 { grid-template-columns: 1fr; }
  .san-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-110%);
    transition: transform .28s var(--ease);
    z-index: 9;
    padding-top: max(1.2rem, env(safe-area-inset-top));
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  }
  .san-sidebar.is-open { transform: none; }
  .san-menu-btn { display: inline-flex; }
  .san-nav-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(20, 14, 10, .45);
    z-index: 8;
    cursor: pointer;
  }
  .san-item-row { grid-template-columns: 1fr 1fr 1fr 44px; }
  .san-item-row .san-combo { grid-column: 1 / -1; }
  .san-item-row [data-sub] { grid-column: 1 / 4; text-align: right; }
  .san-hero-panel { flex-direction: column; align-items: flex-start; }
  .san-hero-panel .san-btn { width: 100%; }
  .san-topbar { padding: 1rem 1.1rem .15rem; }
  .san-content { padding: 1rem 1.1rem 2.4rem; }
  .san-filter { width: 100%; }
  .san-toolbar .san-btn-primary { width: 100%; }
  .san-order-hero { flex-direction: column; }
  .san-item-list li { grid-template-columns: 1fr auto; }
  .san-item-list em { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .san-table-wrap { overflow: visible; }
  .san-table thead { display: none; }
  .san-table,
  .san-table tbody,
  .san-table tr,
  .san-table td { display: block; width: 100%; }
  .san-table tbody tr {
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .san-table tbody tr:last-child { border-bottom: 0; }
  .san-table th,
  .san-table td {
    padding: .28rem 0;
    border-bottom: 0;
  }
  .san-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .san-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    flex: 0 0 34%;
    padding-top: .15rem;
  }
  .san-table td:not([data-label]) { justify-content: flex-end; }
  .san-table td:not([data-label])::before { content: none; }
  .san-table-empty td,
  .san-table-empty td::before {
    display: block;
    content: none;
    text-align: center;
    color: var(--muted);
  }
  .san-filter {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .san-filter input,
  .san-filter select,
  .san-filter .san-btn { width: 100%; }
  .san-steps li { width: 100%; border-radius: 14px; }
  .san-check { min-height: 44px; }
}

@media (max-width: 520px) {
  .san-login-card { padding: 1.3rem 1.1rem 1.15rem; }
  .san-logo { width: 120px; height: 120px; }
  .san-topbar h1 { font-size: 1.35rem; }
  .san-userchip-meta { display: none; }
  .san-stat strong { font-size: 1.55rem; }
  .san-toast { left: 1rem; right: 1rem; max-width: none; }
  .san-table td {
    flex-direction: column;
    gap: .12rem;
  }
  .san-table td::before { flex: none; }
  .san-table td:not([data-label]) { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .san-kenburns { transform: none; }
}
