:root {
  --manna-burgundy: #390517;
  --manna-gold: #A38560;
  --manna-green: #16302B;
  --manna-ink: #03110D;
  --manna-light: #E0E0E0;
  --manna-rust: #A44529;
  --bg: #e7e7e4;
  --surface: #ffffff;
  --surface-muted: #eeeeeb;
  --line: #d6d2cc;
  --ink: #1b211f;
  --muted: #6c746f;
  --teal: var(--manna-green);
  --teal-dark: var(--manna-ink);
  --client-accent: var(--manna-gold);
  --client-soft: #eee6d9;
  --ink-panel: var(--manna-green);
  --amber: var(--manna-gold);
  --rose: var(--manna-rust);
  --green: var(--manna-green);
  --shadow: 0 14px 38px rgba(3, 17, 13, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(163, 133, 96, 0.18), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(22, 48, 43, 0.16), transparent 24%),
    linear-gradient(135deg, #e0e0e0 0%, #f7f7f5 48%, #e7e2dc 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.4;
  overflow-x: hidden;
}

body[data-theme="dark"] {
  --bg: var(--manna-ink);
  --surface: #0b1f1a;
  --surface-muted: #102821;
  --line: rgba(224, 224, 224, 0.15);
  --ink: #f3f1ed;
  --muted: #b4b1aa;
  --shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at 12% 0%, rgba(164, 69, 41, 0.16), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(163, 133, 96, 0.18), transparent 24%),
    linear-gradient(135deg, #03110d 0%, #16302b 52%, #390517 100%);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] output.readonly-value,
body[data-theme="dark"] button.secondary,
body[data-theme="dark"] .nav-tabs,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .section-head,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .setup-check-item,
body[data-theme="dark"] .payment-summary-item,
body[data-theme="dark"] .ai-status-card,
body[data-theme="dark"] .install-step,
body[data-theme="dark"] .device-card,
body[data-theme="dark"] .team-row,
body[data-theme="dark"] .module-card,
body[data-theme="dark"] .brand-preview-card,
body[data-theme="dark"] .portal-login-card,
body[data-theme="dark"] .void-sale-summary > div,
body[data-theme="dark"] .receipt-meta > div,
body[data-theme="dark"] .receipt-customer,
body[data-theme="dark"] .receipt-totals > div,
body[data-theme="dark"] .helper-note,
body[data-theme="dark"] .qa-card {
  background: rgba(19, 35, 38, 0.94);
  color: var(--ink);
}

body[data-theme="dark"] .portal-identity-panel {
  background:
    linear-gradient(135deg, rgba(19, 35, 38, 0.96), rgba(13, 31, 34, 0.92)),
    radial-gradient(circle at 92% 10%, rgba(215, 164, 73, 0.16), transparent 28%);
}

body[data-theme="dark"] .portal-login-card {
  border-color: rgba(221, 235, 236, 0.14);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] th,
body[data-theme="dark"] td,
body[data-theme="dark"] label,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .status-pill span,
body[data-theme="dark"] .team-row span,
body[data-theme="dark"] .module-card span,
body[data-theme="dark"] .module-card small,
body[data-theme="dark"] .brand-preview-card span,
body[data-theme="dark"] .brand-preview-card small,
body[data-theme="dark"] .payment-summary-item span,
body[data-theme="dark"] .payment-summary-item small,
body[data-theme="dark"] .metric span,
body[data-theme="dark"] .metric small,
body[data-theme="dark"] .setup-check-item span,
body[data-theme="dark"] .setup-progress-summary span,
body[data-theme="dark"] .setup-progress-summary small,
body[data-theme="dark"] .ai-status-card span,
body[data-theme="dark"] .ai-status-card small {
  color: var(--muted);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select {
  border-color: rgba(221, 235, 236, 0.18);
  background: #0d1b1d;
  color: var(--ink);
}

body[data-theme="dark"] table,
body[data-theme="dark"] .table-wrap {
  color: var(--ink);
}

body[data-theme="dark"] th,
body[data-theme="dark"] td {
  border-bottom-color: rgba(221, 235, 236, 0.12);
}

body[data-theme="dark"] .eyebrow {
  color: #d7a449;
}

body[data-theme="dark"] .dashboard-board > .metric-grid .metric:nth-child(1),
body[data-theme="dark"] .dashboard-board > .metric-grid .metric:nth-child(3),
body[data-theme="dark"] .dashboard-board > .metric-grid .metric:nth-child(6),
body[data-theme="dark"] .reports-board > .metric-grid .metric:nth-child(1),
body[data-theme="dark"] .reports-board > .metric-grid .metric:nth-child(4),
body[data-theme="dark"] .module-card,
body[data-theme="dark"] .brand-preview-card {
  background: linear-gradient(180deg, rgba(19, 35, 38, 0.96), rgba(13, 27, 29, 0.96));
}

body[data-theme="dark"] .badge.good {
  background: rgba(34, 197, 94, 0.16);
  color: #8ef0b2;
}

body[data-theme="dark"] .badge.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #ffd37a;
}

body[data-theme="dark"] .badge.bad {
  background: rgba(248, 113, 113, 0.16);
  color: #ffaaa5;
}

body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
  border-color: #62d16c;
  background: #155d2b;
  color: #ffffff;
}

/* Final 20260616 app-quality override. This sits last so mobile/tablet stay app-like. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body[data-theme="light"] {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-muted: #eee8de;
  --line: #d8d0c4;
  --ink: #18211e;
  --muted: #5f6a64;
  background:
    radial-gradient(circle at 12% 0%, rgba(163, 133, 96, 0.16), transparent 28%),
    linear-gradient(135deg, #f4f2ed 0%, #ffffff 58%, #ebe4d9 100%);
  color: var(--ink);
}

body[data-theme="dark"] {
  --bg: #202120;
  --surface: #2c2d2c;
  --surface-muted: #343635;
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f7f4ef;
  --muted: #d4ccc0;
  background:
    radial-gradient(circle at 14% 0%, rgba(163, 133, 96, 0.14), transparent 28%),
    linear-gradient(135deg, #242524 0%, #171f1d 48%, #2a161b 100%);
  color: var(--ink);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .section-head,
body[data-theme="dark"] .workspace-board,
body[data-theme="dark"] .workspace-subnav,
body[data-theme="dark"] .workspace-subtab,
body[data-theme="dark"] .pos-subtab,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .status-row,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .team-row,
body[data-theme="dark"] .module-card,
body[data-theme="dark"] .brand-preview-card,
body[data-theme="dark"] .setup-check-item,
body[data-theme="dark"] .install-step,
body[data-theme="dark"] .device-card,
body[data-theme="dark"] .payment-summary-item,
body[data-theme="dark"] .receipt-card,
body[data-theme="dark"] .mobile-folder-card,
body[data-theme="dark"] .mobile-panel-back {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] strong,
body[data-theme="dark"] label,
body[data-theme="dark"] .metric strong,
body[data-theme="dark"] .status-row strong,
body[data-theme="dark"] .mobile-folder-card strong {
  color: var(--ink);
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] small,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .metric span,
body[data-theme="dark"] .metric small,
body[data-theme="dark"] .status-row span,
body[data-theme="dark"] .mobile-folder-card small,
body[data-theme="dark"] .table-wrap td::before {
  color: var(--muted);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] output.readonly-value {
  background: #191b1a;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body[data-theme="dark"] .workspace-subtab.active,
body[data-theme="dark"] .pos-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
  background: linear-gradient(135deg, #16302b, #2f6b4d);
  border-color: #77d88b;
  color: #ffffff;
}

.portal-visual-panel {
  isolation: isolate;
  padding: 0;
  background: #03110d;
}

.portal-visual-panel:before,
.portal-visual-panel:after,
body[data-authenticated="false"] .portal-visual-panel:before,
body[data-authenticated="false"] .portal-visual-panel:after {
  display: none;
}

.portal-motion-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portal-motion-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(3, 17, 13, 0.08), rgba(3, 17, 13, 0.52));
  pointer-events: none;
}

.motion-pill {
  position: absolute;
  z-index: 2;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(3, 17, 13, 0.62);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  animation: motionFloat 6.5s ease-in-out infinite;
}

.motion-pill-one { top: 14%; left: 10%; }
.motion-pill-two { right: 8%; top: 42%; animation-delay: -1.8s; }
.motion-pill-three { left: 16%; bottom: 16%; animation-delay: -3.4s; }

@keyframes motionFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

.app-splash,
.app-tour {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(163, 133, 96, 0.28), transparent 28%),
    linear-gradient(135deg, #03110d 0%, #16302b 54%, #390517 100%);
  color: #ffffff;
}

.app-splash.hidden,
.app-tour.hidden {
  display: none !important;
}

.splash-brand,
.app-tour-card {
  width: min(92vw, 430px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 28px;
  background: rgba(3, 17, 13, 0.72);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
  text-align: center;
}

.splash-brand img,
.app-tour-card img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  margin-bottom: 16px;
  animation: splashLogo 1.15s ease both;
}

.splash-brand strong,
.app-tour h2 {
  display: block;
  margin: 0;
  color: #ffffff;
  font-size: 1.8rem;
  letter-spacing: 0;
}

.splash-brand small,
.app-tour p,
.app-tour span {
  color: rgba(255, 255, 255, 0.78);
}

.splash-progress {
  position: absolute;
  bottom: 13vh;
  width: min(64vw, 320px);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.splash-progress span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a38560, #ffffff, #a44529);
  animation: loaderRun 1.1s ease-in-out infinite;
}

@keyframes splashLogo {
  from { transform: translateY(8px) scale(0.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes loaderRun {
  from { transform: translateX(-110%); }
  to { transform: translateX(230%); }
}

.metric-action {
  appearance: none;
  text-align: left;
  cursor: pointer;
}

.metric-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: 0 16px 32px rgba(3, 17, 13, 0.12);
}

.mobile-workspace-index,
.mobile-panel-back {
  display: none;
}

@media (max-width: 980px) {
  body[data-authenticated="true"] main,
  body[data-authenticated="true"] .view.active,
  body[data-authenticated="true"] .workspace-board,
  body[data-authenticated="true"] .pos-workspace {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] .view.active {
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr);
    height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .section-head {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 58px;
    padding: 0 8px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  body[data-authenticated="true"] .section-head > div:first-child {
    grid-column: 2;
    text-align: center;
    min-width: 0;
  }

  body[data-authenticated="true"] .section-head .eyebrow,
  body[data-authenticated="true"] .section-head p:not(.eyebrow) {
    display: none;
  }

  body[data-authenticated="true"] .section-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.18rem;
    line-height: 1.1;
    text-align: center;
  }

  body[data-authenticated="true"] .section-head .toolbar {
    grid-column: 3;
    justify-self: end;
    width: 38px;
    min-width: 38px;
    overflow: hidden;
  }

  body[data-authenticated="true"] .section-head .toolbar label,
  body[data-authenticated="true"] .section-head .toolbar button,
  body[data-authenticated="true"] .section-head > button,
  body[data-authenticated="true"] .role-control {
    display: none !important;
  }

  body[data-authenticated="true"] .workspace-board {
    height: calc(100dvh - 58px);
    min-height: 0;
    border-radius: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .mobile-folder-board {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    background: var(--bg);
  }

  body[data-authenticated="true"] .mobile-folder-board > .workspace-subnav {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-folder-board:not(.mobile-panel-open) > :not(.workspace-subnav):not(.mobile-workspace-index) {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-workspace-index {
    display: grid;
    align-content: start;
    gap: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] .mobile-folder-card {
    appearance: none;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 84px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 18px;
    text-align: left;
    box-shadow: none;
  }

  body[data-authenticated="true"] .mobile-folder-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(163, 133, 96, 0.18);
    color: var(--teal);
    font-size: 0.72rem;
    font-weight: 950;
  }

  body[data-authenticated="true"] .mobile-folder-card strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.2;
  }

  body[data-authenticated="true"] .mobile-folder-card small {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open {
    grid-template-rows: 46px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open .mobile-workspace-index {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-panel-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 0 16px;
    color: var(--ink);
    font-weight: 850;
    box-shadow: none;
  }

  body[data-authenticated="true"] .mobile-panel-back::before {
    content: "<";
    font-size: 1rem;
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open > :not(.workspace-subnav):not(.mobile-workspace-index):not(.mobile-panel-back):not([hidden]) {
    display: grid;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
  }

  body[data-authenticated="true"] .content-grid,
  body[data-authenticated="true"] .content-grid.two,
  body[data-authenticated="true"] .content-grid.analytics-layout,
  body[data-authenticated="true"] .setup-layout,
  body[data-authenticated="true"] .settings-layout {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  body[data-authenticated="true"] .panel {
    min-width: 0;
    border-radius: 10px;
    padding: 12px;
  }

  body[data-authenticated="true"] #dashboard .workspace-subnav {
    display: none !important;
  }

  body[data-authenticated="true"] #dashboard .workspace-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] #today-metrics,
  body[data-authenticated="true"] #month-metrics,
  body[data-authenticated="true"] #expense-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric,
  body[data-authenticated="true"] #expense-metrics .metric {
    width: auto;
    min-width: 0;
    min-height: 68px;
    padding: 9px;
    border-radius: 10px;
  }

  body[data-authenticated="true"] .metric strong {
    font-size: 1rem;
    line-height: 1.12;
  }

  body[data-authenticated="true"] .metric span,
  body[data-authenticated="true"] .metric small {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  body[data-authenticated="true"] #dashboard .closeout-grid,
  body[data-authenticated="true"] .device-qa-panel,
  body[data-authenticated="true"] .prospect-panel {
    display: none !important;
  }

  body[data-authenticated="true"] .table-wrap {
    overflow-x: hidden !important;
  }
}

@media (max-width: 720px) {
  body[data-authenticated="false"] .portal-login-layout {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    min-height: 150px;
    order: -1;
    border-radius: 16px;
  }

  body[data-authenticated="true"] .view.active {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .section-head {
    min-height: 54px;
  }

  body[data-authenticated="true"] .workspace-board {
    height: calc(100dvh - 54px);
  }
}

/* True EOF contrast hardening. */
body[data-theme="dark"][data-authenticated="true"] .mobile-folder-mark {
  background: rgba(163, 133, 96, 0.34);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"][data-authenticated="true"] button:not(.secondary):not(.link-button):not(.menu-toggle):not(.screen-prompt-close) {
  background: linear-gradient(135deg, #16302b, #2f6b4d);
  color: #ffffff;
}

.splash-orbit {
  position: absolute;
  width: min(70vw, 330px);
  aspect-ratio: 1;
  border: 1px solid rgba(224, 224, 224, 0.14);
  border-radius: 50%;
  animation: splashOrbitSpin 5.5s linear infinite;
}

.splash-orbit::before,
.splash-orbit::after,
.splash-orbit span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.splash-orbit::before {
  inset: 13%;
  border: 1px solid rgba(163, 133, 96, 0.28);
}

.splash-orbit::after {
  inset: 29%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.splash-orbit span {
  width: 10px;
  height: 10px;
  background: #e0e0e0;
  box-shadow: 0 0 20px rgba(224, 224, 224, 0.48);
}

.splash-orbit span:nth-child(1) {
  top: 4%;
  left: 48%;
}

.splash-orbit span:nth-child(2) {
  right: 8%;
  top: 64%;
  background: #a38560;
}

.splash-orbit span:nth-child(3) {
  left: 11%;
  bottom: 18%;
  background: #a44529;
}

.splash-brand {
  position: relative;
  z-index: 2;
  transform-origin: center;
  animation: splashBrandArrive 900ms ease both, splashBrandGlow 2.8s ease-in-out infinite;
}

.splash-brand img {
  animation: splashLogoPop 1.1s cubic-bezier(.2,.9,.2,1) both, splashLogoBreathe 2.8s ease-in-out infinite 1.1s;
}

@keyframes splashOrbitSpin {
  to { transform: rotate(360deg); }
}

@keyframes splashBrandArrive {
  from { transform: translateY(14px) scale(.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes splashBrandGlow {
  0%, 100% { box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36); }
  50% { box-shadow: 0 30px 90px rgba(163, 133, 96, 0.28); }
}

@keyframes splashLogoPop {
  from { transform: scale(.82) rotate(-4deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes splashLogoBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

body[data-theme="dark"][data-authenticated="true"] .mobile-folder-mark {
  background: rgba(163, 133, 96, 0.34);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"][data-authenticated="true"] button:not(.secondary):not(.link-button):not(.menu-toggle):not(.screen-prompt-close) {
  background: linear-gradient(135deg, #16302b, #2f6b4d);
  color: #ffffff;
}

/* 20260616 release polish: video login, app-like mobile workspaces, readable themes. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body[data-theme="light"] {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-muted: #eee8de;
  --line: #d8d0c4;
  --ink: #18211e;
  --muted: #5f6a64;
  --shadow: 0 14px 38px rgba(3, 17, 13, 0.09);
  background:
    radial-gradient(circle at 12% 0%, rgba(163, 133, 96, 0.16), transparent 28%),
    radial-gradient(circle at 92% 4%, rgba(164, 69, 41, 0.08), transparent 22%),
    linear-gradient(135deg, #f4f2ed 0%, #ffffff 52%, #ebe4d9 100%);
  color: var(--ink);
}

body[data-theme="dark"] {
  --bg: #202120;
  --surface: #2c2d2c;
  --surface-muted: #343635;
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f7f4ef;
  --muted: #d4ccc0;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
  background:
    radial-gradient(circle at 14% 0%, rgba(163, 133, 96, 0.14), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(164, 69, 41, 0.16), transparent 24%),
    linear-gradient(135deg, #242524 0%, #171f1d 48%, #2a161b 100%);
  color: var(--ink);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .section-head,
body[data-theme="dark"] .workspace-board,
body[data-theme="dark"] .workspace-subnav,
body[data-theme="dark"] .workspace-subtab,
body[data-theme="dark"] .pos-subtab,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .status-row,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .team-row,
body[data-theme="dark"] .module-card,
body[data-theme="dark"] .brand-preview-card,
body[data-theme="dark"] .setup-check-item,
body[data-theme="dark"] .install-step,
body[data-theme="dark"] .device-card,
body[data-theme="dark"] .payment-summary-item,
body[data-theme="dark"] .receipt-card,
body[data-theme="dark"] .mobile-folder-card,
body[data-theme="dark"] .mobile-panel-back,
body[data-theme="dark"] .screen-prompt-card,
body[data-theme="dark"] .app-tour-card {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] strong,
body[data-theme="dark"] label,
body[data-theme="dark"] .metric strong,
body[data-theme="dark"] .panel-head strong,
body[data-theme="dark"] .status-row strong,
body[data-theme="dark"] .mobile-folder-card strong,
body[data-theme="dark"] .portal-login-card h3,
body[data-theme="dark"] .portal-wordmark strong {
  color: var(--ink);
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] small,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .metric span,
body[data-theme="dark"] .metric small,
body[data-theme="dark"] .status-row span,
body[data-theme="dark"] .mobile-folder-card small,
body[data-theme="dark"] .table-wrap td::before {
  color: var(--muted);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] output.readonly-value {
  background: #191b1a;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td {
  color: var(--ink);
}

body[data-theme="dark"] .workspace-subtab.active,
body[data-theme="dark"] .pos-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
  background: linear-gradient(135deg, #16302b, #2f6b4d);
  border-color: #77d88b;
  color: #ffffff;
}

body[data-theme="light"] .panel,
body[data-theme="light"] .metric,
body[data-theme="light"] .topbar,
body[data-theme="light"] .section-head,
body[data-theme="light"] .workspace-board,
body[data-theme="light"] .workspace-subtab,
body[data-theme="light"] .pos-subtab,
body[data-theme="light"] .status-row,
body[data-theme="light"] .team-row,
body[data-theme="light"] .module-card,
body[data-theme="light"] .brand-preview-card,
body[data-theme="light"] .mobile-folder-card,
body[data-theme="light"] .mobile-panel-back {
  background: var(--surface);
  color: var(--ink);
}

.portal-visual-panel {
  isolation: isolate;
  padding: 0;
  background: #03110d;
}

.portal-visual-panel:before,
.portal-visual-panel:after,
body[data-authenticated="false"] .portal-visual-panel:before,
body[data-authenticated="false"] .portal-visual-panel:after {
  display: none;
}

.portal-motion-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.04);
}

.portal-motion-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(3, 17, 13, 0.1), rgba(3, 17, 13, 0.52)),
    linear-gradient(180deg, rgba(3, 17, 13, 0.02), rgba(3, 17, 13, 0.42));
  pointer-events: none;
}

.motion-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(3, 17, 13, 0.62);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  animation: motionFloat 6.5s ease-in-out infinite;
}

.motion-pill-one {
  top: 14%;
  left: 10%;
}

.motion-pill-two {
  right: 8%;
  top: 42%;
  animation-delay: -1.8s;
}

.motion-pill-three {
  left: 16%;
  bottom: 16%;
  animation-delay: -3.4s;
}

@keyframes motionFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

.app-splash,
.app-tour {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(163, 133, 96, 0.28), transparent 28%),
    linear-gradient(135deg, #03110d 0%, #16302b 54%, #390517 100%);
  color: #ffffff;
}

.app-splash.hidden,
.app-tour.hidden {
  display: none !important;
}

.app-splash-card,
.app-tour-card {
  width: min(92vw, 430px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 28px;
  background: rgba(3, 17, 13, 0.72);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
  text-align: center;
}

.app-splash-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  margin-bottom: 16px;
  animation: splashLogo 1.15s ease both;
}

.app-splash h1,
.app-tour h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.8rem;
  letter-spacing: 0;
}

.app-splash p,
.app-tour p,
.app-tour small {
  color: rgba(255, 255, 255, 0.78);
}

.app-splash-loader {
  width: 100%;
  height: 5px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.app-splash-loader::before {
  content: "";
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a38560, #ffffff, #a44529);
  animation: loaderRun 1.1s ease-in-out infinite;
}

.app-tour-steps {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  text-align: left;
}

.app-tour-steps span {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-weight: 750;
}

.app-tour-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

@keyframes splashLogo {
  from {
    transform: translateY(8px) scale(0.94);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes loaderRun {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(230%);
  }
}

.metric-action {
  appearance: none;
  text-align: left;
  cursor: pointer;
}

.metric-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: 0 16px 32px rgba(3, 17, 13, 0.12);
}

.mobile-workspace-index,
.mobile-panel-back {
  display: none;
}

@media (max-width: 980px) {
  body[data-authenticated="true"] {
    min-height: 100dvh;
    background: var(--bg);
  }

  body[data-authenticated="true"] main,
  body[data-authenticated="true"] .view.active,
  body[data-authenticated="true"] .workspace-board,
  body[data-authenticated="true"] .pos-workspace {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] .view.active {
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr);
    height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .section-head {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 58px;
    padding: 0 8px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  body[data-authenticated="true"] .section-head > div:first-child {
    grid-column: 2;
    min-width: 0;
    text-align: center;
  }

  body[data-authenticated="true"] .section-head .eyebrow,
  body[data-authenticated="true"] .section-head p:not(.eyebrow) {
    display: none;
  }

  body[data-authenticated="true"] .section-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.18rem;
    line-height: 1.1;
    text-align: center;
  }

  body[data-authenticated="true"] .section-head .toolbar {
    grid-column: 3;
    justify-self: end;
    width: 38px;
    min-width: 38px;
    overflow: hidden;
  }

  body[data-authenticated="true"] .section-head .toolbar label {
    display: none;
  }

  body[data-authenticated="true"] .workspace-board {
    height: calc(100dvh - 58px);
    min-height: 0;
    border-radius: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .workspace-board > :not(.workspace-subnav):not(.mobile-panel-back):not(.mobile-workspace-index):not([hidden]) {
    min-width: 0;
  }

  body[data-authenticated="true"] .mobile-folder-board {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    background: var(--bg);
  }

  body[data-authenticated="true"] .mobile-folder-board > .workspace-subnav {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-folder-board:not(.mobile-panel-open) > :not(.workspace-subnav):not(.mobile-workspace-index) {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-folder-board .mobile-workspace-index {
    display: grid;
    align-content: start;
    gap: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
  }

  body[data-authenticated="true"] .mobile-folder-card {
    appearance: none;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 84px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 18px;
    text-align: left;
    box-shadow: none;
  }

  body[data-authenticated="true"] .mobile-folder-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(163, 133, 96, 0.18);
    color: var(--teal);
    font-size: 0.72rem;
    font-weight: 950;
  }

  body[data-authenticated="true"] .mobile-folder-card strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.2;
  }

  body[data-authenticated="true"] .mobile-folder-card small {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open {
    grid-template-rows: 46px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open .mobile-workspace-index {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-panel-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 0 16px;
    color: var(--ink);
    font-weight: 850;
    box-shadow: none;
  }

  body[data-authenticated="true"] .mobile-panel-back::before {
    content: "<";
    font-size: 1rem;
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open > :not(.workspace-subnav):not(.mobile-workspace-index):not(.mobile-panel-back):not([hidden]) {
    display: grid;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
  }

  body[data-authenticated="true"] .content-grid,
  body[data-authenticated="true"] .content-grid.two,
  body[data-authenticated="true"] .content-grid.analytics-layout,
  body[data-authenticated="true"] .setup-layout,
  body[data-authenticated="true"] .settings-layout {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  body[data-authenticated="true"] .panel {
    min-width: 0;
    border-radius: 10px;
    padding: 12px;
  }

  body[data-authenticated="true"] .panel-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  body[data-authenticated="true"] .panel-head h3 {
    font-size: 0.98rem;
    line-height: 1.15;
  }

  body[data-authenticated="true"] .panel-head p,
  body[data-authenticated="true"] .panel-head .muted {
    font-size: 0.72rem;
    line-height: 1.28;
  }

  body[data-authenticated="true"] #dashboard .workspace-subnav {
    display: none !important;
  }

  body[data-authenticated="true"] #dashboard .workspace-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] #today-metrics,
  body[data-authenticated="true"] #month-metrics,
  body[data-authenticated="true"] #expense-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric,
  body[data-authenticated="true"] #expense-metrics .metric {
    min-height: 68px;
    padding: 9px;
    border-radius: 10px;
  }

  body[data-authenticated="true"] .metric strong {
    font-size: 1rem;
    line-height: 1.12;
  }

  body[data-authenticated="true"] .metric span,
  body[data-authenticated="true"] .metric small {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] > .panel,
  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] .panel {
    min-height: auto;
  }

  body[data-authenticated="true"] #dashboard .closeout-grid,
  body[data-authenticated="true"] .device-qa-panel,
  body[data-authenticated="true"] .prospect-panel {
    display: none !important;
  }

  body[data-authenticated="true"] .table-wrap {
    overflow-x: hidden !important;
  }

  body[data-authenticated="true"] .toast,
  body[data-authenticated="true"] .screen-prompt-card {
    width: min(92vw, 420px);
    border-radius: 14px;
  }

  body[data-authenticated="true"] .screen-prompt-card {
    padding: 18px;
  }

  body[data-authenticated="true"] .role-control {
    display: none !important;
  }
}

@media (max-width: 720px) {
  body[data-authenticated="false"] .portal-login-layout {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    min-height: 150px;
    order: -1;
    border-radius: 16px;
  }

  body[data-authenticated="false"] .motion-pill {
    min-height: 28px;
    padding: 6px 9px;
    font-size: 0.64rem;
  }

  body[data-authenticated="false"] .portal-login-card {
    border-radius: 16px;
  }

  body[data-authenticated="true"] .view.active {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .section-head {
    min-height: 54px;
  }

  body[data-authenticated="true"] .section-head h2 {
    font-size: 1.08rem;
  }

  body[data-authenticated="true"] .workspace-board {
    height: calc(100dvh - 54px);
  }

  body[data-authenticated="true"] .panel {
    padding: 10px;
  }
}

body[data-theme="dark"][data-authenticated="true"] .daily-closeout-summary strong.good,
body[data-theme="dark"][data-authenticated="true"] .reorder-summary strong.good,
body[data-theme="dark"][data-authenticated="true"] .setup-progress-summary strong.good,
body[data-theme="dark"][data-authenticated="true"] .shift-z-metrics strong.good {
  color: #a5f3c2;
}

body[data-theme="dark"][data-authenticated="true"] .daily-closeout-summary strong.warn,
body[data-theme="dark"][data-authenticated="true"] .reorder-summary strong.warn,
body[data-theme="dark"][data-authenticated="true"] .setup-progress-summary strong.warn,
body[data-theme="dark"][data-authenticated="true"] .shift-z-metrics strong.warn {
  color: #ffd37a;
}

body[data-theme="dark"][data-authenticated="true"] .daily-closeout-summary strong.bad,
body[data-theme="dark"][data-authenticated="true"] .reorder-summary strong.bad,
body[data-theme="dark"][data-authenticated="true"] .setup-progress-summary strong.bad,
body[data-theme="dark"][data-authenticated="true"] .shift-z-metrics strong.bad {
  color: #ffb4ac;
}

body[data-theme="dark"] .pos-subtab {
  border-color: rgba(221, 235, 236, 0.16);
  background: rgba(13, 27, 29, 0.92);
  color: var(--ink);
}

body[data-theme="dark"] .workspace-subnav,
body[data-theme="dark"] .workspace-subtab,
body[data-theme="dark"] .report-filter-strip,
body[data-theme="dark"] .checkout-drawer-head,
body[data-theme="dark"] .engineering-card {
  border-color: rgba(221, 235, 236, 0.16);
  background: rgba(19, 35, 38, 0.94);
  color: var(--ink);
}

body[data-theme="dark"] .workspace-subtab.active {
  border-color: color-mix(in srgb, var(--teal) 70%, #ffffff 8%);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #ffffff;
}

body[data-theme="dark"] .checkout-drawer-head span,
body[data-theme="dark"] .engineering-card span,
body[data-theme="dark"] .engineering-card small {
  color: var(--muted);
}

body[data-theme="dark"] .pos-subtab.active {
  border-color: color-mix(in srgb, var(--teal) 70%, #ffffff 8%);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #ffffff;
}

body[data-theme="dark"] .pos-item-tile,
body[data-theme="dark"] .ticket-item {
  border-color: rgba(221, 235, 236, 0.15);
  background: linear-gradient(180deg, rgba(19, 35, 38, 0.98), rgba(13, 27, 29, 0.98));
  color: var(--ink);
}

body[data-theme="dark"] .pos-item-tile:hover {
  border-color: color-mix(in srgb, var(--teal) 72%, #ffffff 8%);
  background: linear-gradient(180deg, rgba(20, 61, 62, 0.98), rgba(15, 45, 47, 0.98));
  color: var(--ink);
}

body[data-theme="dark"] .pos-item-tile span,
body[data-theme="dark"] .pos-item-tile small,
body[data-theme="dark"] .ticket-item span,
body[data-theme="dark"] .ticket-total span,
body[data-theme="dark"] .ticket-hint,
body[data-theme="dark"] .checkout-notice span {
  color: var(--muted);
}

body[data-theme="dark"] .checkout-notice {
  border-color: rgba(34, 197, 94, 0.26);
  background: rgba(20, 83, 45, 0.24);
  color: #8ef0b2;
}

body[data-theme="dark"] .daily-closeout-summary > div,
body[data-theme="dark"] .reorder-summary > div,
body[data-theme="dark"] .setup-progress-summary > div,
body[data-theme="dark"] .expense-metrics > div,
body[data-theme="dark"] .shift-z-metrics > div,
body[data-theme="dark"] .shift-z-head > div,
body[data-theme="dark"] .shift-z-ledger > div {
  border-color: rgba(221, 235, 236, 0.15);
  background: linear-gradient(180deg, rgba(19, 35, 38, 0.98), rgba(13, 27, 29, 0.98));
  color: var(--ink);
}

body[data-theme="dark"] .daily-closeout-summary span,
body[data-theme="dark"] .daily-closeout-summary small,
body[data-theme="dark"] .reorder-summary span,
body[data-theme="dark"] .reorder-summary small,
body[data-theme="dark"] .setup-progress-summary span,
body[data-theme="dark"] .setup-progress-summary small,
body[data-theme="dark"] .shift-z-metrics span,
body[data-theme="dark"] .shift-z-metrics small,
body[data-theme="dark"] .shift-z-head span,
body[data-theme="dark"] .shift-z-head small,
body[data-theme="dark"] .shift-z-ledger span,
body[data-theme="dark"] .shift-z-ledger small {
  color: var(--muted);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes promptIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), #0c8a80);
  color: #ffffff;
  cursor: pointer;
  padding: 0 16px;
  font-weight: 700;
}

button:hover {
  background: linear-gradient(135deg, var(--teal-dark), #08766d);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:disabled:hover {
  background: var(--teal);
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

button.secondary:hover {
  background: var(--surface-muted);
}

button.secondary:disabled:hover,
.nav-tab:disabled:hover {
  background: var(--surface);
}

button.danger {
  background: var(--rose);
}

button.danger:hover {
  background: #8f1d14;
}

input,
select,
output.readonly-value {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
}

output.readonly-value {
  display: flex;
  align-items: center;
  background: var(--surface-muted);
  color: var(--ink);
}

output.total-due {
  min-height: 54px;
  font-size: 1.15rem;
  font-weight: 800;
}

output.readonly-value.warn {
  border-color: #efd69d;
  background: #fff8e8;
  color: var(--amber);
}

output.readonly-value.bad {
  border-color: #efbeb9;
  background: #fff0ee;
  color: var(--rose);
}

.checkline {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkline input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.94rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-authenticated="false"] {
  background:
    radial-gradient(circle at 78% 18%, rgba(0, 199, 160, 0.24), transparent 28%),
    radial-gradient(circle at 28% 78%, rgba(215, 164, 73, 0.18), transparent 24%),
    linear-gradient(180deg, #07110f 0%, #0a1628 58%, #07110f 100%);
}

body[data-authenticated="false"] .topbar {
  display: none;
}

body[data-authenticated="false"] .app-shell {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
}

body[data-authenticated="false"] main {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 24px;
}

body[data-authenticated="false"] .app-shell {
  grid-template-columns: 1fr;
}

body[data-authenticated="false"] #portal.view.active {
  width: min(100%, 1180px);
  min-height: auto;
  gap: 0;
}

body[data-authenticated="false"] .portal-section-head {
  display: none;
}

body[data-authenticated="false"] .portal-board {
  gap: 0;
  width: 100%;
  height: auto;
  overflow: visible;
  padding: 0;
}

body[data-authenticated="false"] .portal-identity-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-authenticated="false"] .portal-login-card {
  width: min(100%, 386px);
}

body[data-authenticated="false"] .portal-login-layout {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 17, 15, 0.72);
  box-shadow: 0 32px 95px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.screen-prompt {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 11px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(22, 48, 43, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 244, 235, 0.96)),
    var(--surface);
  box-shadow: 0 18px 46px rgba(3, 17, 13, 0.18);
  color: var(--ink);
  padding: 12px;
  animation: promptIn 0.2s ease both;
  backdrop-filter: blur(18px);
}

.screen-prompt::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-left: 4px solid var(--green);
  pointer-events: none;
}

.screen-prompt[data-tone="warn"]::before {
  border-left-color: var(--amber);
}

.screen-prompt[data-tone="bad"]::before {
  border-left-color: var(--rose);
}

.screen-prompt[data-tone="info"]::before {
  border-left-color: var(--teal);
}

.screen-prompt-mark {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 12%, transparent);
}

.screen-prompt[data-tone="warn"] .screen-prompt-mark {
  background: var(--amber);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 16%, transparent);
}

.screen-prompt[data-tone="bad"] .screen-prompt-mark {
  background: var(--rose);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--rose) 12%, transparent);
}

.screen-prompt[data-tone="info"] .screen-prompt-mark {
  background: var(--teal);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--teal) 12%, transparent);
}

.screen-prompt strong,
.screen-prompt span,
.screen-prompt small {
  display: block;
}

.screen-prompt strong {
  font-size: 0.88rem;
  line-height: 1.18;
}

.screen-prompt span {
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.screen-prompt small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.screen-prompt-close {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
}

.screen-prompt-close:hover {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink);
}

body[data-theme="dark"] .screen-prompt {
  border-color: rgba(224, 224, 224, 0.14);
  background:
    linear-gradient(180deg, rgba(11, 31, 26, 0.98), rgba(7, 21, 17, 0.98)),
    var(--surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
}

body[data-theme="dark"] .screen-prompt span {
  color: var(--ink);
}

body[data-theme="dark"] .screen-prompt-close {
  color: var(--muted);
}

body[data-theme="dark"] .screen-prompt-close:hover {
  background: rgba(224, 224, 224, 0.08);
  color: var(--ink);
}

@media (max-width: 620px) {
  .screen-prompt {
    top: auto;
    right: 10px;
    bottom: 12px;
    left: 10px;
    width: auto;
    grid-template-columns: 9px minmax(0, 1fr) 26px;
    gap: 9px;
    padding: 10px;
  }

  .screen-prompt strong {
    font-size: 0.84rem;
  }

  .screen-prompt span {
    font-size: 0.78rem;
  }

  .screen-prompt small {
    display: none;
  }

  .screen-prompt-close {
    width: 26px;
    min-height: 26px;
    height: 26px;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(29, 37, 40, 0.38);
  padding: 18px;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(29, 37, 40, 0.24);
  padding: 18px;
}

.password-card {
  width: min(560px, 100%);
}

.pin-card {
  width: min(430px, 100%);
}

.pin-input {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pin-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.pin-summary strong,
.pin-summary span,
.pin-summary small {
  display: block;
}

.pin-summary span,
.pin-summary small {
  color: var(--muted);
}

.device-pin-panel {
  align-self: stretch;
}

.device-pin-form {
  display: grid;
  gap: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.offline-queue-status {
  margin-top: 14px;
}

body[data-theme="dark"] .pin-summary,
body[data-theme="dark"] .toggle-line {
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .pin-summary span,
body[data-theme="dark"] .pin-summary small {
  color: var(--muted);
}

.portal-auth-panel.hidden {
  display: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.icon-close {
  min-height: 34px;
  padding: 0 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.receipt-content {
  display: grid;
  gap: 14px;
  padding: 16px 0;
}

.receipt-brand {
  display: grid;
  gap: 2px;
  text-align: center;
}

.receipt-brand strong {
  font-size: 1.25rem;
}

.receipt-brand span,
.receipt-brand small,
.receipt-meta span,
.receipt-customer span,
.receipt-totals span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.receipt-meta > div,
.receipt-customer > div,
.receipt-totals > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.receipt-meta strong,
.receipt-customer strong,
.receipt-totals strong {
  display: block;
  margin-top: 3px;
}

.receipt-table-wrap {
  margin: 0;
}

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

.receipt-totals > div:nth-child(3) {
  border-color: #b9e1de;
  background: #eff9f7;
}

.receipt-note {
  margin: 0;
  border: 1px solid #efd69d;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--amber);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px;
}

.void-sale-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
}

.void-sale-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.void-sale-summary span,
.void-sale-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.void-sale-summary strong {
  display: block;
  margin: 5px 0;
}

.void-audit {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.void-audit small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(217, 225, 228, 0.76);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  padding: 14px clamp(16px, 3vw, 28px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1,
.section-head h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}

.topbar > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.app-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  box-shadow: 0 14px 32px rgba(3, 17, 13, 0.16);
}

.brand-owner {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.brand-owner::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--client-accent);
  vertical-align: 1px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  border: 1px solid rgba(217, 225, 228, 0.86);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 5px;
}

.role-control {
  display: flex;
  align-items: end;
  gap: 10px;
  padding-left: 8px;
}

.role-control label {
  min-width: 132px;
}

.role-control label[hidden] {
  display: none !important;
}

.role-control select {
  min-height: 38px;
}

.session-action {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(255, 255, 255, 0.78);
  color: var(--teal-dark);
}

.session-action:hover {
  background: var(--teal);
  color: #ffffff;
}

.session-action[hidden] {
  display: none !important;
}

.compact-action {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.compact-action[hidden],
.device-actions button[hidden] {
  display: none !important;
}

.device-status-badge {
  white-space: nowrap;
}

.nav-tab {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-tab[hidden] {
  display: none !important;
}

.nav-tab.active {
  border-color: rgba(15, 118, 110, 0.16);
  background: linear-gradient(135deg, var(--ink-panel), var(--teal));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.nav-tab:not(:disabled):hover {
  transform: translateY(-1px);
}

.workspace-subnav {
  position: static;
  z-index: 3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  border: 1px solid rgba(217, 225, 228, 0.86);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  padding: 8px;
  backdrop-filter: blur(14px);
}

.workspace-subtab {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.workspace-subtab.active {
  border-color: color-mix(in srgb, var(--teal) 74%, #ffffff 12%);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.workspace-subtab:not(.active):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
}

[data-workspace-panel][hidden] {
  display: none !important;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2.4vw, 24px);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 12px;
  min-height: 0;
  animation: viewIn 0.22s ease both;
}

.workspace-board {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.workspace-board > *,
.content-grid > *,
.panel {
  min-width: 0;
}

.section-head,
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.panel-head h3 {
  font-size: 1rem;
}

.panel-head.compact {
  align-items: center;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.toolbar label {
  min-width: 180px;
}

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

.metric-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 13px;
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1.16rem, 2.4vw, 1.72rem);
}

.metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.daily-closeout-panel {
  display: grid;
  gap: 14px;
}

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

.daily-closeout-summary > div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.daily-closeout-summary span,
.daily-closeout-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.daily-closeout-summary strong {
  display: block;
  margin: 5px 0;
  font-size: 1.05rem;
}

.daily-closeout-summary strong.good {
  color: var(--green);
}

.daily-closeout-summary strong.warn {
  color: var(--amber);
}

.daily-closeout-summary strong.bad {
  color: var(--rose);
}

.reorder-panel {
  display: grid;
  gap: 14px;
}

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

.reorder-summary > div {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.reorder-summary span,
.reorder-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.reorder-summary strong {
  display: block;
  margin: 5px 0;
  font-size: 1.05rem;
}

.reorder-summary strong.good {
  color: var(--green);
}

.reorder-summary strong.warn {
  color: var(--amber);
}

.reorder-summary strong.bad {
  color: var(--rose);
}

.closeout-grid {
  align-items: start;
}

.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.content-grid.menu-layout {
  grid-template-columns: minmax(330px, 0.72fr) minmax(0, 1.28fr);
}

.content-grid.expense-layout {
  grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
}

.profile-panel,
.prospect-panel {
  display: grid;
  gap: 14px;
}

.device-qa-panel {
  display: none;
}

.profile-form,
.prospect-form {
  display: grid;
  gap: 12px;
}

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

.qa-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.qa-card strong,
.qa-card span {
  display: block;
}

.qa-card > div > span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.shift-gate {
  min-height: min(620px, calc(100vh - 220px));
  display: grid;
  align-content: center;
  justify-content: center;
  gap: 22px;
  padding: clamp(22px, 6vw, 64px);
  text-align: center;
}

.shift-gate h3 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}

.shift-gate p {
  max-width: 560px;
  margin: 8px auto 0;
  color: var(--muted);
}

.shift-gate .shift-controls {
  width: min(620px, 100%);
  margin: 0 auto;
  text-align: left;
}

.pos-workspace {
  display: grid;
  gap: 16px;
}

.pos-appbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.pos-subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pos-subtab {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.pos-subtab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.pos-panel {
  display: none;
}

.pos-panel.active {
  display: block;
}

.pos-register-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: start;
}

.register-left-stack {
  display: grid;
  gap: 16px;
}

.pos-tiles-panel {
  display: grid;
  gap: 12px;
}

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

.pos-item-tile {
  min-height: 122px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 5px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.pos-item-tile:hover {
  border-color: var(--teal);
  background: #eff9f7;
  color: var(--ink);
}

.pos-item-tile:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.pos-item-tile strong,
.pos-item-tile span,
.pos-item-tile small {
  display: block;
}

.pos-item-tile span,
.pos-item-tile small {
  color: var(--muted);
  font-size: 0.8rem;
}

.pos-item-tile em {
  margin-top: 4px;
  font-style: normal;
}

.ticket-panel {
  position: sticky;
  top: 120px;
  display: grid;
  gap: 16px;
}

.checkout-notice {
  display: grid;
  gap: 4px;
  border: 1px solid #b9e6ca;
  border-radius: 8px;
  background: #effbf4;
  color: var(--green);
  padding: 12px;
}

.checkout-notice strong,
.checkout-notice span {
  display: block;
}

.checkout-notice span {
  font-size: 0.86rem;
  font-weight: 700;
}

.ticket-total {
  display: grid;
  gap: 8px;
}

.ticket-total span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.ticket-grid {
  display: grid;
  gap: 12px;
}

.ticket-checkout {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.checkout-toggle {
  width: 100%;
}

.ticket-checkout.collapsed {
  display: none;
}

.checkout-drawer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, var(--line));
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(215, 164, 73, 0.08));
  padding: 12px;
}

.checkout-drawer-head strong,
.checkout-drawer-head span {
  display: block;
}

.checkout-drawer-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.ticket-items {
  display: grid;
  gap: 8px;
  min-height: 74px;
}

.ticket-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.ticket-item strong,
.ticket-item span {
  display: block;
}

.ticket-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.ticket-item .row-actions {
  justify-content: flex-end;
}

.ticket-hint {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding-top: 12px;
}

.ticket-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.report-filter-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

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

.engineering-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.engineering-card strong,
.engineering-card span,
.engineering-card small {
  display: block;
}

.engineering-card span,
.engineering-card small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.engineering-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.shift-controls {
  display: grid;
  align-content: start;
  gap: 16px;
}

.shift-summary {
  display: grid;
  gap: 10px;
}

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

.shift-report-item {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.shift-report-item span,
.shift-report-item small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.shift-report-item strong {
  display: block;
  margin: 5px 0;
  font-size: 1.05rem;
}

.shift-z-report {
  display: grid;
  gap: 14px;
}

.shift-z-head,
.shift-z-metrics,
.shift-z-ledger {
  display: grid;
  gap: 10px;
}

.shift-z-head {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shift-z-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.shift-z-ledger {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.shift-z-head > div,
.shift-z-metrics > div,
.shift-z-ledger > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.shift-z-head span,
.shift-z-metrics span,
.shift-z-ledger span,
.shift-z-metrics small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.shift-z-head strong,
.shift-z-metrics strong,
.shift-z-ledger strong {
  display: block;
  margin-top: 5px;
  font-size: 1.02rem;
}

.shift-z-metrics strong.good {
  color: var(--green);
}

.shift-z-metrics strong.warn {
  color: var(--amber);
}

.shift-z-metrics strong.bad {
  color: var(--rose);
}

.shift-z-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.cash-log {
  display: grid;
  gap: 8px;
}

.cash-log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.cash-log-item strong,
.cash-log-item span {
  display: block;
}

.cash-log-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.daily-sales-panel {
  margin-top: 16px;
}

.order-history-panel {
  margin-top: 16px;
}

.history-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 150px 150px;
  gap: 10px;
  margin-top: 12px;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.payment-summary-item {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.payment-summary-item.total {
  border-color: #b9e1de;
  background: #eff9f7;
}

.payment-summary-item span,
.payment-summary-item small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.payment-summary-item strong {
  display: block;
  margin: 5px 0;
  font-size: 1.05rem;
}

.setup-progress-panel {
  display: grid;
  gap: 14px;
}

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

.setup-progress-summary > div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.setup-progress-summary span,
.setup-progress-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.setup-progress-summary strong {
  display: block;
  margin: 5px 0;
  font-size: 1.05rem;
}

.setup-progress-summary strong.good {
  color: var(--green);
}

.setup-progress-summary strong.warn {
  color: var(--amber);
}

.setup-progress-summary strong.bad {
  color: var(--rose);
}

.setup-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.setup-checklist {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.setup-check-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.setup-check-item.done {
  border-color: #ccebd8;
  background: #f0fbf5;
}

.setup-check-item.pending {
  border-color: #efd69d;
  background: #fff8e8;
}

.setup-check-item strong,
.setup-check-item span {
  display: block;
}

.setup-check-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.portal-board {
  display: grid;
  gap: 16px;
}

.portal-identity-panel {
  display: grid;
  gap: 14px;
}

.portal-login-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  align-items: stretch;
}

.portal-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.portal-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 7px;
  object-fit: contain;
}

.portal-login-card,
.portal-admin-form {
  display: grid;
  gap: 12px;
}

.portal-login-card {
  width: min(100%, 386px);
  justify-self: stretch;
  align-content: center;
  min-height: 560px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(7, 17, 15, 0.78);
  box-shadow: none;
  color: #ffffff;
  padding: clamp(30px, 5vw, 62px);
  backdrop-filter: blur(10px);
}

.portal-login-card-head {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
}

.portal-login-card-head h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 500;
}

.portal-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: 0;
}

.portal-login-card label {
  color: #c9a84c;
  font-size: 0.78rem;
  font-weight: 900;
}

.portal-login-card input {
  min-height: 50px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.portal-login-card input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.portal-login-card input:focus {
  border-color: rgba(121, 255, 224, 0.62);
  box-shadow: 0 0 0 4px rgba(0, 199, 160, 0.14);
}

.portal-login-card button[type="submit"] {
  min-height: 50px;
  border-radius: 0;
  background: var(--client-accent);
  color: #07110f;
}

.portal-login-card button[type="submit"]:hover {
  background: #f0d580;
  color: #07110f;
}

.portal-byline {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  text-align: center;
}

.link-button {
  min-height: auto;
  justify-self: start;
  border: 0;
  background: transparent;
  color: #79ffe0;
  padding: 0;
  box-shadow: none;
}

.link-button:hover {
  color: #ffffff;
  background: transparent;
}

.portal-session-card {
  display: none;
}

.portal-visual-panel {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 560px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7, 17, 15, 0.2), rgba(7, 17, 15, 0.84)),
    radial-gradient(circle at 72% 42%, rgba(0, 199, 160, 0.32), transparent 28%),
    radial-gradient(circle at 46% 78%, rgba(202, 168, 90, 0.24), transparent 24%),
    linear-gradient(135deg, #07110f, #102b24 58%, #07110f);
  color: #ffffff;
  padding: clamp(34px, 6vw, 76px);
}

.portal-visual-panel:before {
  content: "";
  position: absolute;
  inset: 18% 6% auto 6%;
  height: 240px;
  border-radius: 999px;
  border: 1px solid rgba(121, 255, 224, 0.38);
  transform: rotate(-6deg);
}

.portal-visual-panel:after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: -82px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(0, 199, 160, 0.13);
}

.portal-visual-mark,
.portal-visual-panel strong,
.portal-visual-panel span,
.portal-visual-bars {
  position: relative;
  z-index: 1;
}

.portal-visual-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--client-accent), #f6df8b);
  color: #07110f;
  font-weight: 950;
}

.portal-visual-panel strong {
  display: block;
  color: #ffffff;
  font-size: clamp(2.6rem, 5vw, 5.2rem);
  font-weight: 500;
  line-height: 0.98;
}

.portal-visual-panel span {
  display: block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.portal-visual-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  width: min(360px, 100%);
  height: 92px;
  margin-top: 42px;
}

.portal-visual-bars i {
  flex: 1;
  min-height: 16px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(to top, var(--teal), #79ffe0);
}

.portal-visual-bars i:nth-child(1) { height: 42%; }
.portal-visual-bars i:nth-child(2) { height: 76%; background: linear-gradient(to top, var(--client-accent), #f6df8b); }
.portal-visual-bars i:nth-child(3) { height: 58%; }
.portal-visual-bars i:nth-child(4) { height: 92%; background: linear-gradient(to top, var(--client-accent), #f6df8b); }
.portal-visual-bars i:nth-child(5) { height: 68%; }

#portal-admin-grid[hidden],
#portal-service-grid[hidden] {
  display: none !important;
}

.portal-brand-card {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.portal-brand-card h3 {
  margin: 0 0 6px;
  color: #ffffff;
}

.portal-brand-card .eyebrow {
  color: #efd287;
}

.portal-brand-card span {
  color: #b9d7d9;
  font-weight: 700;
}

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

.portal-session-grid > div,
.ai-status-card,
.install-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.portal-session-grid > div {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.portal-session-grid span,
.portal-session-grid small,
.portal-install-flow small,
.ai-status-card span,
.ai-status-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-session-grid span,
.portal-session-grid small {
  color: #b9d7d9;
}

.portal-session-grid strong,
.ai-status-card strong {
  display: block;
  margin: 5px 0;
  font-size: 1.02rem;
}

.portal-session-grid strong {
  color: #ffffff;
}

.portal-account-table {
  margin-top: 14px;
}

.ai-status-summary {
  margin-bottom: 12px;
}

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

.device-setup-panel {
  overflow: hidden;
}

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

.device-card {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 244, 0.96)),
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--client-accent) 22%, transparent), transparent 32%);
  padding: 14px;
}

.device-card span,
.device-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.device-card strong {
  display: block;
  margin: 8px 0 7px;
  color: var(--ink);
  font-size: 1.08rem;
}

.device-actions {
  margin: 14px 0;
}

.settings-layout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.brand-form,
.team-invite-form {
  display: grid;
  gap: 12px;
}

.brand-preview {
  margin-top: 14px;
}

.brand-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 246, 244, 0.92)),
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--client-accent) 28%, transparent), transparent 28%);
  padding: 14px;
}

.brand-preview-card span,
.brand-preview-card small,
.module-card span,
.module-card small,
.team-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.brand-preview-card strong {
  display: block;
  margin: 5px 0;
  font-size: 1.18rem;
}

.brand-swatches {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.brand-swatches i {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.team-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.team-row,
.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.module-card {
  min-height: 112px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 244, 0.96));
}

.module-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 1rem;
}

.install-step strong {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #e7f4f3;
  color: var(--teal);
}

.dashboard-board > .metric-grid .metric:nth-child(1),
.dashboard-board > .metric-grid .metric:nth-child(3),
.reports-board > .metric-grid .metric:nth-child(1) {
  border-color: rgba(15, 118, 110, 0.2);
  background: linear-gradient(180deg, #ffffff, #edf8f5);
}

.dashboard-board > .metric-grid .metric:nth-child(6),
.reports-board > .metric-grid .metric:nth-child(4) {
  border-color: rgba(215, 164, 73, 0.32);
  background: linear-gradient(180deg, #ffffff, var(--client-soft));
}

.install-step span {
  display: block;
  margin: 8px 0 4px;
  font-weight: 800;
}

.table-section-head {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.content-grid.inventory-layout,
.content-grid.analytics-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.panel:hover {
  border-color: rgba(15, 118, 110, 0.2);
  box-shadow: 0 16px 42px rgba(29, 37, 40, 0.13);
}

.metric,
.payment-summary-item,
.setup-progress-summary > div,
.portal-session-grid > div,
.ai-status-card,
.install-step,
.status-pill,
.setup-check-item {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.metric:hover,
.payment-summary-item:hover,
.setup-progress-summary > div:hover,
.portal-session-grid > div:hover,
.ai-status-card:hover,
.install-step:hover,
.status-pill:hover,
.setup-check-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.22);
}

.form-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.helper-note {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 10px;
}

.helper-note.good {
  border-color: #ccebd8;
  background: #f0fbf5;
  color: var(--green);
}

.helper-note.warn {
  border-color: #efd69d;
  background: #fff8e8;
  color: var(--amber);
}

.helper-note.bad {
  border-color: #efbeb9;
  background: #fff0ee;
  color: var(--rose);
}

.hidden {
  display: none !important;
}

.table-wrap {
  margin: 12px -6px -6px;
  overflow-x: auto;
}

.menu-board .table-wrap {
  overflow-x: hidden;
}

.menu-board table {
  table-layout: fixed;
}

.menu-board th,
.menu-board td {
  overflow-wrap: anywhere;
}

.data-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(3, 17, 13, 0.08);
}

.thumb-empty {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 46px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.status-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.status-pill strong {
  display: block;
}

.status-pill span {
  color: var(--muted);
  font-size: 0.86rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.good {
  background: #e8f6ef;
  color: var(--green);
}

.badge.warn {
  background: #fff5df;
  color: var(--amber);
}

.badge.bad {
  background: #fdeceb;
  color: var(--rose);
}

.recipe-builder {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

#recipe-rows {
  display: grid;
  gap: 10px;
}

.recipe-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 88px;
  gap: 8px;
  align-items: end;
}

.recipe-row button {
  padding: 0;
}

.summary-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: var(--ink);
}

.summary-box p {
  margin: 0;
}

.summary-box ul {
  margin: 0;
  padding-left: 20px;
}

.empty-state {
  color: var(--muted);
  padding: 12px 10px;
}

.money {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

@media (min-width: 981px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    overflow: hidden;
  }

  .topbar {
    position: static;
    height: 100vh;
    align-items: stretch;
    align-self: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 22px 18px;
    overflow: auto;
  }

  .topbar > div:first-child {
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
  }

  .topbar h1 {
    font-size: 1.35rem;
  }

  .nav-tabs {
    display: grid;
    justify-content: stretch;
    gap: 8px;
  }

  .nav-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
    text-align: left;
  }

  .role-control {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    padding-left: 0;
  }

  .role-control label {
    min-width: 0;
  }

  main {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 18px;
    overflow: hidden;
  }

  .view.active {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    overflow: hidden;
  }

  .section-head {
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 14px 16px;
  }

  .workspace-board {
    height: 100%;
    overflow: auto;
    padding: 2px 8px 20px 2px;
  }

  .workspace-board::-webkit-scrollbar,
  .pos-panel::-webkit-scrollbar,
  .ticket-panel::-webkit-scrollbar,
  .table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  .workspace-board::-webkit-scrollbar-thumb,
  .pos-panel::-webkit-scrollbar-thumb,
  .ticket-panel::-webkit-scrollbar-thumb,
  .table-wrap::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #b9c7cb;
    background-clip: padding-box;
  }

  .dashboard-board {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
    align-items: start;
  }

  .dashboard-board > .metric-grid,
  .dashboard-board > .daily-closeout-panel,
  .dashboard-board > .device-qa-panel,
  .dashboard-board > .content-grid,
  .dashboard-board > article:last-child {
    grid-column: 1 / -1;
  }

  .pos-board {
    align-content: stretch;
    overflow: hidden;
    padding-right: 0;
  }

  .pos-workspace {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .pos-panel.active {
    min-height: 0;
    overflow: auto;
    padding-right: 8px;
  }

  .pos-register-layout {
    min-height: 0;
  }

  .register-left-stack,
  .ticket-panel {
    min-height: 0;
    max-height: calc(100vh - 178px);
    overflow: auto;
  }

  .ticket-panel {
    position: static;
  }

  .inventory-board,
  .reports-board {
    grid-auto-rows: min-content;
  }

  .table-wrap {
    max-height: min(46vh, 520px);
    overflow: auto;
  }

  .pos-panel .table-wrap,
  .inventory-board .table-wrap,
  .reports-board .table-wrap {
    max-height: min(42vh, 470px);
  }

  .menu-board .content-grid.menu-layout,
  .expenses-board .content-grid.expense-layout,
  .inventory-board .content-grid.inventory-layout {
    align-items: start;
  }
}

@media print {
  body.receipt-printing {
    background: #ffffff;
  }

  body.receipt-printing .app-shell,
  body.receipt-printing .screen-prompt,
  body.receipt-printing .modal-actions,
  body.receipt-printing .icon-close {
    display: none !important;
  }

  body.receipt-printing .modal {
    position: static;
    display: block !important;
    padding: 0;
    background: #ffffff;
  }

  body.receipt-printing .modal-card {
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .topbar,
  .toolbar,
  #dashboard,
  #pos,
  #inventory,
  #expenses,
  #menu {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  main {
    padding: 0;
  }

  .panel,
  .metric {
    box-shadow: none;
  }

  #reports.view {
    display: grid !important;
  }
}

body[data-authenticated="false"] main {
  width: 100%;
  max-width: none;
}

body[data-authenticated="false"] #portal.view.active {
  width: min(100%, 430px);
}

body[data-authenticated="false"] .portal-board,
body[data-authenticated="false"] .portal-identity-panel,
body[data-authenticated="false"] .portal-login-layout {
  width: 100%;
}

body[data-authenticated="false"] .portal-login-card {
  width: min(100%, 386px);
}

@media (max-width: 980px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    overflow: hidden;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    position: static;
  }

  .nav-tabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .metric-grid,
  .daily-closeout-summary,
  .reorder-summary,
  .device-qa-grid,
  .content-grid.two,
  .content-grid.menu-layout,
  .content-grid.expense-layout,
  .content-grid.inventory-layout,
  .content-grid.analytics-layout {
    grid-template-columns: 1fr;
  }

  main {
    height: calc(100vh - 190px);
    overflow: hidden;
    padding: 12px;
  }

  .view.active {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
  }

  .section-head {
    min-height: auto;
    padding: 12px;
  }

  .workspace-board {
    height: 100%;
    overflow: auto;
    padding: 1px 4px 16px 1px;
  }

  .toolbar {
    gap: 8px;
  }

  .toolbar button,
  .toolbar label {
    min-width: auto;
  }

  .payment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-subnav {
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .workspace-subnav::-webkit-scrollbar {
    display: none;
  }

  .workspace-subtab {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .setup-progress-summary,
  .device-setup-summary,
  .setup-layout,
  .portal-login-layout,
  .portal-layout,
  .portal-session-grid,
  .portal-install-flow,
  .settings-layout,
  .module-map {
    grid-template-columns: 1fr;
  }

  .shift-z-head,
  .shift-z-metrics,
  .shift-z-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-appbar,
  .pos-register-layout,
  .report-filter-strip,
  .menu-engineering-grid {
    grid-template-columns: 1fr;
  }

  .pos-item-tiles,
  .history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-subnav {
    justify-content: flex-start;
  }

  .ticket-panel {
    position: static;
  }

  .table-wrap {
    max-height: min(34vh, 360px);
    overflow: auto;
  }

  .pos-item-tiles {
    max-height: min(32vh, 360px);
    overflow: auto;
    padding-right: 2px;
  }

  .ticket-items {
    max-height: min(26vh, 280px);
    overflow: auto;
  }

  .ticket-checkout {
    max-height: min(44vh, 460px);
    overflow: auto;
    padding-right: 2px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    max-height: 196px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }

  .topbar > div:first-child {
    min-width: 0;
    padding-left: 10px;
  }

  .topbar h1 {
    max-width: 100%;
    overflow: hidden;
    font-size: 1.12rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-owner {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  main {
    height: calc(100vh - 196px);
    padding: 10px;
  }

  .role-control {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-left: 10px;
  }

  .role-control .badge,
  .role-control .compact-action,
  .role-control .session-action {
    flex: 0 0 auto;
  }

  .section-head,
  .panel-head,
  .panel-actions,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    gap: 8px;
  }

  .section-head h2 {
    font-size: 1.22rem;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar label {
    grid-column: 1 / -1;
  }

  .toolbar button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .panel {
    padding: 12px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    min-height: 84px;
    padding: 11px;
  }

  .metric span,
  .metric small {
    font-size: 0.72rem;
  }

  .metric strong {
    font-size: 1.12rem;
  }

  .shift-gate {
    min-height: calc(100vh - 210px);
    padding: 22px 14px;
  }

  .shift-gate h3 {
    font-size: 1.55rem;
  }

  .pos-appbar {
    padding: 10px;
  }

  .screen-prompt {
    top: auto;
    right: 10px;
    bottom: 12px;
    left: 10px;
    grid-template-columns: 9px minmax(0, 1fr) 26px;
  }

  .modal {
    align-items: stretch;
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .modal-head,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .receipt-meta,
  .receipt-customer,
  .receipt-totals,
  .void-sale-summary,
  .shift-z-head,
  .shift-z-metrics,
  .shift-z-ledger {
    grid-template-columns: 1fr;
  }

  .pos-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-subtab {
    padding: 0 8px;
  }

  .form-row,
  .recipe-row,
  .shift-report-grid,
  .payment-summary,
  .setup-progress-summary,
  .device-setup-summary,
  .setup-layout,
  .pos-item-tiles,
  .history-filters,
  .ticket-actions,
  .module-map {
    grid-template-columns: 1fr;
  }

  .portal-session-grid,
  .portal-install-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-board {
    gap: 10px;
  }

  .table-wrap {
    max-height: 280px;
  }

  .pos-item-tiles {
    max-height: 300px;
  }

  .setup-check-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .recipe-row button {
    width: 100%;
  }

  th,
  td {
    padding: 10px 8px;
  }
}

@media (min-width: 760px) and (max-width: 980px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 218px minmax(0, 1fr);
    overflow: hidden;
  }

  .topbar {
    position: static;
    height: 100vh;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 18px 14px;
    overflow: auto;
  }

  .topbar > div:first-child {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  .nav-tabs {
    display: grid;
    justify-content: stretch;
    gap: 8px;
  }

  .nav-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
    text-align: left;
  }

  .role-control {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    padding-left: 0;
  }

  .role-control label {
    min-width: 0;
  }

  main {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 14px;
    overflow: hidden;
  }

  .view.active {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
  }

  .section-head {
    min-height: 68px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px 14px;
  }

  .workspace-board {
    height: 100%;
    overflow: auto;
    padding: 2px 6px 18px 2px;
  }

  .pos-board {
    align-content: stretch;
    overflow: hidden;
    padding-right: 0;
  }

  .pos-workspace {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .pos-panel.active {
    min-height: 0;
    overflow: auto;
    padding-right: 6px;
  }

  .ticket-panel {
    position: static;
  }

  .table-wrap {
    max-height: min(44vh, 480px);
    overflow: auto;
  }
}

body[data-authenticated="false"] {
  min-height: 100vh;
  overflow: hidden;
  background-color: #07110f;
  background-image:
    linear-gradient(115deg, rgba(215, 164, 73, 0.18), transparent 28%, rgba(0, 199, 160, 0.14) 66%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 74px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 74px),
    linear-gradient(180deg, #07110f 0%, #0c1724 56%, #061714 100%);
  color: #ffffff;
}

body[data-authenticated="false"] main {
  display: grid;
  place-items: start center;
  align-content: start;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(16px, 3vw, 32px);
}

body[data-authenticated="false"] .app-shell {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
}

body[data-authenticated="false"] #portal.view.active {
  width: min(1180px, 100%);
  height: auto;
  min-height: 0;
  grid-template-rows: none;
  overflow: visible;
}

body[data-authenticated="false"] .portal-board,
body[data-authenticated="false"] .portal-identity-panel,
body[data-authenticated="false"] .portal-login-layout {
  width: 100%;
}

body[data-authenticated="false"] .portal-board,
body[data-authenticated="false"] .portal-identity-panel {
  height: auto;
  overflow: visible;
}

body[data-authenticated="false"] .portal-login-layout {
  position: relative;
  grid-template-columns: minmax(350px, 430px) minmax(0, 1fr);
  min-height: min(720px, calc(100vh - 48px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    linear-gradient(180deg, rgba(8, 18, 16, 0.98), rgba(8, 18, 26, 0.94));
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

body[data-authenticated="false"] .portal-login-layout:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 26%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 22px);
  opacity: 0.34;
}

body[data-authenticated="false"] .portal-login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  align-content: center;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    rgba(6, 16, 15, 0.86);
  box-shadow: none;
  color: #ffffff;
  padding: clamp(34px, 5vw, 62px);
  backdrop-filter: blur(16px);
}

body[data-authenticated="false"][data-admin-mode="true"] .portal-login-card {
  align-content: start;
}

body[data-authenticated="false"] .portal-login-card-head {
  gap: 24px;
  margin-bottom: 18px;
}

body[data-authenticated="false"] .portal-wordmark {
  color: #ffffff;
}

body[data-authenticated="false"] .portal-login-card-head h3 {
  color: #ffffff;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.05;
}

body[data-authenticated="false"] .portal-login-card label {
  color: rgba(239, 210, 135, 0.95);
  letter-spacing: 0;
}

body[data-authenticated="false"] .portal-login-card input {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.085);
  color: #ffffff;
  font-size: 0.96rem;
}

body[data-authenticated="false"] .portal-login-card input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

body[data-authenticated="false"] .portal-login-card button[type="submit"] {
  min-height: 54px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d7a449, #f4d884);
  color: #06100f;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(215, 164, 73, 0.22);
}

body[data-authenticated="false"] .portal-login-card button[type="submit"]:hover {
  transform: translateY(-1px);
}

body[data-authenticated="false"] .link-button {
  justify-self: center;
  color: rgba(121, 255, 224, 0.86);
}

body[data-authenticated="false"] .portal-byline {
  color: rgba(255, 255, 255, 0.62);
}

body[data-authenticated="false"] .portal-visual-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  background:
    linear-gradient(160deg, rgba(0, 199, 160, 0.18), transparent 36%),
    linear-gradient(30deg, rgba(215, 164, 73, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(9, 28, 32, 0.94), rgba(6, 16, 15, 0.9));
  color: #ffffff;
  padding: clamp(28px, 5vw, 68px);
  overflow: hidden;
}

body[data-authenticated="false"] .portal-visual-panel:before,
body[data-authenticated="false"] .portal-visual-panel:after {
  content: "";
  position: absolute;
  pointer-events: none;
}

body[data-authenticated="false"] .portal-visual-panel:before {
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
}

body[data-authenticated="false"] .portal-visual-panel:after {
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 56px);
  opacity: 0.46;
}

.portal-preview-shell {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(7, 17, 15, 0.74);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.28);
  padding: clamp(18px, 3vw, 28px);
}

.portal-preview-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: #ffffff;
}

.portal-preview-top strong {
  font-size: 1.05rem;
}

.portal-preview-top i {
  width: 72px;
  height: 10px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(121, 255, 224, 0.38);
  box-shadow: 0 0 28px rgba(121, 255, 224, 0.28);
}

.portal-preview-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d7a449, #f6df8b);
  color: #07110f;
  font-weight: 950;
}

.portal-preview-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.portal-preview-card,
.portal-preview-list {
  min-height: 122px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  padding: 16px;
}

.portal-preview-card-wide {
  grid-row: span 2;
  min-height: 256px;
}

.portal-preview-card span,
.portal-preview-card small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-preview-card strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.portal-preview-card small {
  margin-top: 10px;
}

.portal-preview-chart {
  display: flex;
  align-items: end;
  gap: 9px;
  height: 116px;
  margin-top: 34px;
}

.portal-preview-chart i {
  flex: 1;
  min-height: 18px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #79ffe0, #0f766e);
  animation: previewBars 3s ease-in-out infinite alternate;
}

.portal-preview-chart i:nth-child(1) { height: 38%; }
.portal-preview-chart i:nth-child(2) { height: 62%; animation-delay: 0.1s; }
.portal-preview-chart i:nth-child(3) { height: 48%; animation-delay: 0.2s; }
.portal-preview-chart i:nth-child(4) { height: 86%; background: linear-gradient(180deg, #f6df8b, #d7a449); animation-delay: 0.3s; }
.portal-preview-chart i:nth-child(5) { height: 58%; animation-delay: 0.4s; }
.portal-preview-chart i:nth-child(6) { height: 74%; background: linear-gradient(180deg, #f6df8b, #d7a449); animation-delay: 0.5s; }

.portal-preview-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-height: 96px;
}

.portal-preview-list span {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.08));
}

.portal-preview-list span:nth-child(2) {
  width: 76%;
}

.portal-preview-list span:nth-child(3) {
  width: 58%;
}

.product-preview-shell {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(6, 15, 20, 0.82);
  box-shadow: 0 28px 78px rgba(0, 0, 0, 0.34);
  padding: clamp(18px, 3vw, 28px);
}

.product-preview-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: #ffffff;
}

.product-preview-top strong {
  color: #ffffff;
  font-size: 1.04rem;
  letter-spacing: 0;
}

.product-preview-top i {
  width: 74px;
  height: 10px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(121, 255, 224, 0.34);
  box-shadow: 0 0 28px rgba(121, 255, 224, 0.22);
}

.product-preview-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d7a449, #f6df8b);
  color: #07110f;
  font-weight: 950;
}

.product-preview-body {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
}

.product-preview-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 13px;
}

.product-preview-rail span {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
}

.product-preview-rail span:first-child {
  background: linear-gradient(135deg, rgba(121, 255, 224, 0.85), rgba(15, 118, 110, 0.78));
}

.product-preview-workspace {
  display: grid;
  gap: 12px;
}

.product-preview-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
}

.product-preview-kpi,
.product-preview-chart,
.product-preview-list {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
}

.product-preview-kpi {
  min-height: 112px;
  padding: 16px;
}

.product-preview-kpi span,
.product-preview-kpi small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
}

.product-preview-kpi strong {
  display: block;
  margin-top: 9px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

.product-preview-chart {
  display: flex;
  align-items: end;
  gap: 9px;
  height: 134px;
  padding: 18px;
}

.product-preview-chart i {
  flex: 1;
  min-height: 20px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #79ffe0, #0f766e);
  animation: previewBars 3s ease-in-out infinite alternate;
}

.product-preview-chart i:nth-child(1) { height: 42%; }
.product-preview-chart i:nth-child(2) { height: 68%; animation-delay: 0.1s; }
.product-preview-chart i:nth-child(3) { height: 54%; animation-delay: 0.2s; }
.product-preview-chart i:nth-child(4) { height: 92%; background: linear-gradient(180deg, #f6df8b, #d7a449); animation-delay: 0.3s; }
.product-preview-chart i:nth-child(5) { height: 64%; animation-delay: 0.4s; }
.product-preview-chart i:nth-child(6) { height: 78%; background: linear-gradient(180deg, #f6df8b, #d7a449); animation-delay: 0.5s; }

.product-preview-list {
  display: grid;
  gap: 10px;
  min-height: 84px;
  padding: 16px;
}

.product-preview-list span {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08));
}

.product-preview-list span:nth-child(2) {
  width: 78%;
}

.product-preview-list span:nth-child(3) {
  width: 56%;
}

.manna-orbit-visual {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(224, 224, 224, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 45%, rgba(163, 133, 96, 0.26), transparent 18%),
    radial-gradient(circle at 24% 24%, rgba(224, 224, 224, 0.13), transparent 18%),
    linear-gradient(135deg, rgba(3, 17, 13, 0.96), rgba(22, 48, 43, 0.86));
  box-shadow:
    0 32px 88px rgba(3, 17, 13, 0.44),
    inset 0 0 0 1px rgba(224, 224, 224, 0.06);
  overflow: hidden;
}

.manna-orbit-visual::before,
.manna-orbit-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.manna-orbit-visual::before {
  background:
    repeating-linear-gradient(90deg, rgba(224, 224, 224, 0.04) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(224, 224, 224, 0.035) 0 1px, transparent 1px 42px);
}

.manna-orbit-visual::after {
  background: radial-gradient(circle at 74% 72%, rgba(164, 69, 41, 0.2), transparent 22%);
}

.orbit-ring,
.orbit-node,
.orbit-line,
.orbit-core,
.orbit-bars {
  position: absolute;
  z-index: 1;
}

.orbit-ring {
  border: 1px solid rgba(224, 224, 224, 0.15);
  border-radius: 50%;
  animation: orbitSpin 16s linear infinite;
}

.orbit-ring-one {
  inset: 18% 26%;
}

.orbit-ring-two {
  inset: 28% 16%;
  animation-duration: 22s;
  animation-direction: reverse;
}

.orbit-core {
  left: 50%;
  top: 48%;
  display: grid;
  place-items: center;
  width: clamp(70px, 11vw, 104px);
  height: clamp(70px, 11vw, 104px);
  border: 1px solid rgba(224, 224, 224, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(224, 224, 224, 0.13), rgba(224, 224, 224, 0.05)),
    rgba(3, 17, 13, 0.8);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.orbit-core img {
  width: 62%;
  height: 62%;
}

.orbit-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--manna-light);
  box-shadow: 0 0 28px rgba(224, 224, 224, 0.4);
  animation: nodePulse 2.4s ease-in-out infinite alternate;
}

.orbit-node-one {
  left: 28%;
  top: 31%;
}

.orbit-node-two {
  right: 24%;
  top: 35%;
  animation-delay: 0.4s;
}

.orbit-node-three {
  left: 58%;
  bottom: 23%;
  animation-delay: 0.8s;
}

.orbit-line {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(163, 133, 96, 0.78), transparent);
  transform-origin: center;
  animation: lineSweep 3.6s ease-in-out infinite alternate;
}

.orbit-line-one {
  left: 18%;
  top: 38%;
  width: 34%;
  transform: rotate(-12deg);
}

.orbit-line-two {
  right: 16%;
  bottom: 36%;
  width: 32%;
  transform: rotate(-24deg);
  animation-delay: 0.45s;
}

.orbit-bars {
  left: 13%;
  right: 13%;
  bottom: 10%;
  display: flex;
  align-items: end;
  gap: 10px;
  height: 68px;
}

.orbit-bars i {
  flex: 1;
  min-height: 14px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--manna-gold), var(--manna-rust));
  animation: previewBars 2.8s ease-in-out infinite alternate;
}

.orbit-bars i:nth-child(1) { height: 36%; }
.orbit-bars i:nth-child(2) { height: 58%; animation-delay: 0.1s; }
.orbit-bars i:nth-child(3) { height: 82%; background: linear-gradient(180deg, var(--manna-light), var(--manna-gold)); animation-delay: 0.2s; }
.orbit-bars i:nth-child(4) { height: 52%; animation-delay: 0.3s; }
.orbit-bars i:nth-child(5) { height: 72%; background: linear-gradient(180deg, var(--manna-light), var(--manna-gold)); animation-delay: 0.4s; }

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nodePulse {
  from {
    transform: scale(0.84);
    opacity: 0.62;
  }
  to {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes lineSweep {
  from {
    opacity: 0.38;
    filter: blur(0);
  }
  to {
    opacity: 0.82;
    filter: blur(0.4px);
  }
}

body[data-authenticated="false"] .portal-login-layout {
  background:
    radial-gradient(circle at 18% 12%, rgba(163, 133, 96, 0.14), transparent 28%),
    radial-gradient(circle at 78% 84%, rgba(164, 69, 41, 0.18), transparent 30%),
    linear-gradient(135deg, var(--manna-ink), var(--manna-green) 54%, var(--manna-burgundy));
}

body[data-authenticated="false"] .portal-mark {
  box-shadow: 0 16px 34px rgba(164, 69, 41, 0.24);
}

body[data-authenticated="false"] .portal-login-card {
  border-right: 1px solid rgba(224, 224, 224, 0.12);
  background:
    linear-gradient(180deg, rgba(3, 17, 13, 0.92), rgba(3, 17, 13, 0.82)),
    radial-gradient(circle at 22% 14%, rgba(163, 133, 96, 0.2), transparent 30%);
}

body[data-authenticated="false"] .portal-login-card label {
  color: rgba(224, 224, 224, 0.78);
}

body[data-authenticated="false"] .portal-login-card input {
  border-color: rgba(224, 224, 224, 0.18);
  background: rgba(224, 224, 224, 0.08);
}

body[data-authenticated="false"] .portal-login-card input:focus {
  border-color: rgba(163, 133, 96, 0.82);
  box-shadow: 0 0 0 4px rgba(163, 133, 96, 0.18);
}

body[data-authenticated="false"] .portal-login-card button[type="submit"] {
  background: linear-gradient(135deg, var(--manna-gold), var(--manna-rust));
  color: var(--manna-light);
  box-shadow: 0 20px 44px rgba(164, 69, 41, 0.22);
}

body[data-authenticated="false"] .portal-login-card button[type="submit"]:hover {
  background: linear-gradient(135deg, #b59a73, var(--manna-rust));
  color: #ffffff;
}

body[data-authenticated="false"] .link-button {
  color: rgba(224, 224, 224, 0.76);
}

body[data-authenticated="false"] .link-button:hover {
  color: #ffffff;
}

body[data-authenticated="false"] .portal-visual-panel {
  background:
    radial-gradient(circle at 28% 22%, rgba(163, 133, 96, 0.22), transparent 24%),
    radial-gradient(circle at 76% 70%, rgba(164, 69, 41, 0.2), transparent 26%),
    linear-gradient(150deg, rgba(22, 48, 43, 0.96), rgba(3, 17, 13, 0.96) 52%, rgba(57, 5, 23, 0.92));
}

body[data-authenticated="false"] .portal-visual-panel:before {
  inset: 30px;
  border-color: rgba(224, 224, 224, 0.12);
}

body[data-authenticated="false"] .portal-visual-panel:after {
  background:
    repeating-linear-gradient(90deg, rgba(224, 224, 224, 0.04) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(224, 224, 224, 0.035) 0 1px, transparent 1px 56px);
}

@keyframes previewBars {
  from {
    transform: scaleY(0.84);
    transform-origin: bottom;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

@media (max-width: 900px) {
  body[data-authenticated="false"] main {
    padding: 18px;
  }

  body[data-authenticated="false"] .portal-login-layout {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 36px);
  }

  body[data-authenticated="false"] .portal-login-card {
    min-height: auto;
    border-right: 0;
    padding: clamp(26px, 8vw, 50px);
  }

  body[data-authenticated="false"] .portal-visual-panel {
    min-height: 250px;
    padding: 22px;
  }

  .portal-preview-shell {
    width: min(100%, 520px);
  }
}

@media (max-width: 560px) {
  body[data-authenticated="false"] {
    overflow: auto;
  }

  body[data-authenticated="false"] main {
    min-height: 100vh;
    overflow: visible;
    padding: 14px;
  }

  body[data-authenticated="false"] #portal.view.active {
    width: 100%;
  }

  body[data-authenticated="false"] .portal-login-layout {
    min-height: auto;
  }

  body[data-authenticated="false"] .portal-login-card {
    min-height: calc(100vh - 28px);
  }

  body[data-authenticated="false"] .portal-visual-panel {
    display: none;
  }
}

/* Client app shell: Loyverse-style drawer navigation and focused work area. */
.menu-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(3, 17, 13, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(3, 17, 13, 0.14);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--manna-ink);
}

.menu-toggle span + span {
  margin-top: 4px;
}

.menu-toggle[hidden],
body[data-authenticated="false"] .menu-toggle,
body[data-authenticated="false"] .nav-backdrop {
  display: none !important;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(3, 17, 13, 0.48);
  backdrop-filter: blur(4px);
}

.app-shell {
  transition: grid-template-columns 0.22s ease;
}

.topbar {
  transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}

.app-shell.nav-collapsed .topbar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-104%);
}

body[data-authenticated="true"] .topbar .app-brand-lockup {
  padding-left: 42px;
}

body[data-authenticated="true"] .role-control {
  align-items: stretch;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  padding-left: 0;
}

body[data-authenticated="true"] .session-action {
  width: 100%;
}

body[data-authenticated="true"] .workspace-subnav {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

body[data-authenticated="true"] .workspace-subnav::-webkit-scrollbar {
  display: none;
}

body[data-authenticated="true"] .workspace-subtab {
  flex: 0 0 auto;
}

@media (min-width: 981px) {
  body[data-authenticated="true"] .app-shell {
    grid-template-columns: 268px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .app-shell.nav-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  body[data-authenticated="true"] .app-shell.nav-collapsed main {
    padding-left: 76px;
  }
}

@media (max-width: 980px) {
  body[data-authenticated="true"] html,
  body[data-authenticated="true"] {
    overflow: hidden;
  }

  body[data-authenticated="true"] .app-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body[data-authenticated="true"] .topbar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 24;
    width: min(82vw, 304px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 24px 0 80px rgba(3, 17, 13, 0.18);
    padding: 18px 14px;
    overflow: auto;
    transform: translateX(-104%);
  }

  body[data-authenticated="true"].nav-open .topbar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  body[data-authenticated="true"] .topbar > div:first-child {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  body[data-authenticated="true"] .nav-tabs {
    display: grid;
    justify-content: stretch;
    gap: 8px;
    overflow: visible;
  }

  body[data-authenticated="true"] .nav-tab {
    width: 100%;
    justify-content: flex-start;
    min-width: 0;
    padding: 0 12px;
    text-align: left;
  }

  body[data-authenticated="true"] main {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 64px 12px 12px;
    overflow: hidden;
  }

  body[data-authenticated="true"] .view.active {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
  }

  body[data-authenticated="true"] .workspace-board {
    height: 100%;
    overflow: auto;
    padding: 1px 4px 18px 1px;
  }
}

@media (max-width: 620px) {
  body[data-authenticated="true"] .menu-toggle {
    top: 10px;
    left: 10px;
    width: 42px;
    height: 42px;
  }

  body[data-authenticated="true"] main {
    padding: 58px 10px 10px;
  }

  body[data-authenticated="true"] .section-head {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
  }

  body[data-authenticated="true"] .section-head h2 {
    font-size: 1.2rem;
  }

  body[data-authenticated="true"] .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-authenticated="true"] .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-authenticated="true"] .content-grid.two {
    grid-template-columns: 1fr;
  }
}

/* Final client app polish: compact POS-style shell across phone and tablet. */
body[data-authenticated="true"] .menu-toggle {
  border-color: color-mix(in srgb, var(--manna-gold) 34%, rgba(255, 255, 255, 0.42));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 244, 235, 0.94)),
    var(--surface);
}

body[data-authenticated="true"] .menu-toggle:hover {
  transform: translateY(-1px);
}

body[data-authenticated="true"] .topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 247, 240, 0.94)),
    var(--surface);
}

body[data-authenticated="true"] .nav-tabs {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body[data-authenticated="true"] .nav-tab {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 800;
}

body[data-authenticated="true"] .nav-tab::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--client-accent) 70%, var(--manna-gold));
  opacity: 0.68;
}

body[data-authenticated="true"] .nav-tab.active::before {
  background: #ffffff;
  opacity: 1;
}

body[data-authenticated="true"] .section-head {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--manna-gold) 8%), var(--surface)),
    var(--surface);
}

body[data-authenticated="true"] .workspace-subnav {
  box-shadow: none;
}

body[data-authenticated="true"] .panel,
body[data-authenticated="true"] .metric {
  box-shadow: 0 12px 30px rgba(3, 17, 13, 0.08);
}

body[data-theme="dark"][data-authenticated="true"] .menu-toggle {
  border-color: rgba(163, 133, 96, 0.42);
  background: linear-gradient(180deg, #0b211c, #071511);
}

body[data-theme="dark"][data-authenticated="true"] .menu-toggle span {
  background: var(--manna-light);
}

body[data-theme="dark"][data-authenticated="true"] .topbar,
body[data-theme="dark"][data-authenticated="true"] .section-head {
  background:
    linear-gradient(180deg, rgba(10, 31, 27, 0.98), rgba(7, 21, 17, 0.96)),
    var(--surface);
}

@media (max-width: 980px) {
  body[data-authenticated="true"] {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body[data-authenticated="true"] .menu-toggle {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(3, 17, 13, 0.16);
  }

  body[data-authenticated="true"] .topbar {
    width: min(76vw, 282px);
    gap: 12px;
    padding: 14px 12px;
  }

  body[data-authenticated="true"] .topbar .app-brand-lockup {
    padding-left: 38px;
    gap: 10px;
  }

  body[data-authenticated="true"] .app-brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  body[data-authenticated="true"] .topbar h1 {
    font-size: 1.06rem;
    line-height: 1.15;
  }

  body[data-authenticated="true"] .brand-owner {
    font-size: 0.74rem;
  }

  body[data-authenticated="true"] .nav-tabs {
    gap: 6px;
  }

  body[data-authenticated="true"] .nav-tab {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  body[data-authenticated="true"] .role-control {
    padding-top: 10px;
  }

  body[data-authenticated="true"] main {
    padding: 58px 10px 10px;
    background:
      linear-gradient(180deg, rgba(163, 133, 96, 0.08), transparent 180px),
      var(--bg);
  }

  body[data-authenticated="true"] .view.active {
    gap: 8px;
  }

  body[data-authenticated="true"] .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 46px;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 10px;
  }

  body[data-authenticated="true"] .section-head .eyebrow {
    display: none;
  }

  body[data-authenticated="true"] .section-head h2 {
    font-size: 1.08rem;
    line-height: 1.1;
  }

  body[data-authenticated="true"] .toolbar {
    justify-content: end;
    gap: 6px;
  }

  body[data-authenticated="true"] .toolbar label {
    min-width: 0;
    font-size: 0.68rem;
  }

  body[data-authenticated="true"] .toolbar input,
  body[data-authenticated="true"] .toolbar select,
  body[data-authenticated="true"] .toolbar button {
    min-height: 32px;
    font-size: 0.82rem;
  }

  body[data-authenticated="true"] .workspace-board {
    gap: 8px;
    padding: 0 3px 12px 0;
  }

  body[data-authenticated="true"] .workspace-subnav {
    min-height: 42px;
    gap: 6px;
    border-radius: 8px;
    padding: 5px;
  }

  body[data-authenticated="true"] .workspace-subtab {
    min-height: 31px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  body[data-authenticated="true"] .panel {
    padding: 11px;
  }

  body[data-authenticated="true"] .panel-head {
    gap: 8px;
  }

  body[data-authenticated="true"] .panel-head h3 {
    font-size: 0.93rem;
  }

  body[data-authenticated="true"] .panel-head .muted {
    font-size: 0.78rem;
  }

  body[data-authenticated="true"] .form-row {
    gap: 8px;
  }

  body[data-authenticated="true"] input,
  body[data-authenticated="true"] select,
  body[data-authenticated="true"] textarea {
    min-height: 34px;
    font-size: 0.88rem;
  }

  body[data-authenticated="true"] button {
    min-height: 34px;
  }

  body[data-authenticated="true"] .metric-grid {
    gap: 8px;
  }

  body[data-authenticated="true"] .metric {
    min-height: 76px;
    padding: 10px;
  }

  body[data-authenticated="true"] .metric span {
    font-size: 0.68rem;
  }

  body[data-authenticated="true"] .metric strong {
    font-size: 1.22rem;
    line-height: 1.12;
  }

  body[data-authenticated="true"] .metric small {
    font-size: 0.68rem;
  }

  body[data-authenticated="true"] .content-grid {
    gap: 8px;
  }

  body[data-authenticated="true"] .table-wrap {
    max-height: min(42vh, 420px);
  }

  body[data-authenticated="true"] table {
    font-size: 0.82rem;
  }

  body[data-authenticated="true"] th,
  body[data-authenticated="true"] td {
    padding: 8px;
  }
}

@media (min-width: 621px) and (max-width: 980px) {
  body[data-authenticated="true"] main {
    padding: 64px 14px 14px;
  }

  body[data-authenticated="true"] .menu-toggle {
    top: 14px;
    left: 14px;
  }

  body[data-authenticated="true"] .section-head {
    min-height: 52px;
  }

  body[data-authenticated="true"] .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-authenticated="true"] .content-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-authenticated="true"] .dashboard-board > .content-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body[data-authenticated="true"] .menu-toggle {
    top: 9px;
    left: 9px;
    width: 38px;
    height: 38px;
  }

  body[data-authenticated="true"] .menu-toggle span {
    width: 16px;
  }

  body[data-authenticated="true"] main {
    padding: 52px 8px 8px;
  }

  body[data-authenticated="true"] .section-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-height: 0;
    padding: 7px 9px;
  }

  body[data-authenticated="true"] .section-head h2 {
    font-size: 1rem;
  }

  body[data-authenticated="true"] .toolbar {
    display: flex;
    justify-content: stretch;
  }

  body[data-authenticated="true"] .toolbar label {
    flex: 1 1 auto;
  }

  body[data-authenticated="true"] .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-authenticated="true"] .metric {
    min-height: 70px;
    padding: 9px;
  }

  body[data-authenticated="true"] .metric strong {
    font-size: 1.06rem;
  }

  body[data-authenticated="true"] .panel {
    padding: 10px;
  }

  body[data-authenticated="true"] .panel-head {
    align-items: start;
  }

  body[data-authenticated="true"] .panel-actions {
    justify-content: flex-start;
  }

  body[data-authenticated="true"] .payment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-authenticated="true"] .topbar {
    width: min(80vw, 270px);
  }
}

/* Polished app drawer control. */
body[data-authenticated="true"] .menu-toggle {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(163, 133, 96, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(3, 17, 13, 0.98), rgba(22, 48, 43, 0.96)),
    var(--manna-ink);
  box-shadow: 0 14px 34px rgba(3, 17, 13, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

body[data-authenticated="true"] .menu-toggle::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 7px;
  background:
    radial-gradient(circle at 28% 22%, rgba(163, 133, 96, 0.34), transparent 36%),
    linear-gradient(180deg, rgba(224, 224, 224, 0.07), transparent);
  pointer-events: none;
}

body[data-authenticated="true"] .menu-toggle span {
  position: absolute;
  left: 50%;
  display: block;
  width: 18px;
  height: 2px;
  margin: 0;
  border-radius: 999px;
  background: var(--manna-light);
  box-shadow: 0 0 12px rgba(224, 224, 224, 0.18);
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, opacity 0.14s ease, width 0.18s ease;
}

body[data-authenticated="true"] .menu-toggle span:nth-child(1) {
  top: calc(50% - 6px);
}

body[data-authenticated="true"] .menu-toggle span:nth-child(2) {
  top: 50%;
  width: 14px;
}

body[data-authenticated="true"] .menu-toggle span:nth-child(3) {
  top: calc(50% + 6px);
}

body[data-authenticated="true"] .menu-toggle:hover {
  border-color: rgba(224, 224, 224, 0.38);
  box-shadow: 0 16px 38px rgba(3, 17, 13, 0.26);
  transform: translateY(-1px);
}

body[data-authenticated="true"] .menu-toggle:active {
  transform: translateY(0) scale(0.98);
}

body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] {
  border-color: rgba(164, 69, 41, 0.48);
  background:
    linear-gradient(135deg, rgba(57, 5, 23, 0.98), rgba(22, 48, 43, 0.96)),
    var(--manna-burgundy);
}

body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  width: 6px;
}

body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 620px) {
  body[data-authenticated="true"] .menu-toggle {
    top: 8px;
    left: 8px;
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 981px) {
  body[data-authenticated="true"] .menu-toggle {
    top: 18px;
    left: 18px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-color: rgba(163, 133, 96, 0.34);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 230, 217, 0.92)),
      var(--surface);
    box-shadow: 0 10px 26px rgba(3, 17, 13, 0.12);
  }

  body[data-authenticated="true"] .menu-toggle::before {
    inset: 5px;
    background:
      radial-gradient(circle at 28% 22%, rgba(163, 133, 96, 0.2), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  }

  body[data-authenticated="true"] .menu-toggle span {
    width: 16px;
    background: var(--manna-ink);
    box-shadow: none;
  }

  body[data-authenticated="true"] .menu-toggle span:nth-child(2) {
    width: 12px;
  }

  body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] {
    border-color: rgba(3, 17, 13, 0.18);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 230, 217, 0.94)),
      var(--surface);
  }

  body[data-authenticated="true"] .app-shell.nav-collapsed main {
    padding-left: 70px;
  }

  body[data-theme="dark"][data-authenticated="true"] .menu-toggle,
  body[data-theme="dark"][data-authenticated="true"] .menu-toggle[aria-expanded="true"] {
    border-color: rgba(224, 224, 224, 0.16);
    background:
      linear-gradient(180deg, rgba(11, 31, 26, 0.98), rgba(7, 21, 17, 0.98)),
      var(--surface);
  }

  body[data-theme="dark"][data-authenticated="true"] .menu-toggle span {
    background: var(--manna-light);
  }
}

/* Loyverse-inspired mobile/tablet app shell. Desktop keeps its own workspace layout. */
@media (max-width: 980px) {
  body[data-authenticated="true"] {
    --bg: #2d2d2d;
    --surface: #303030;
    --surface-muted: #383838;
    --line: #464646;
    --ink: #f7f7f7;
    --muted: #c9c9c9;
    --shadow: none;
    background: #2d2d2d;
    color: #f7f7f7;
  }

  body[data-authenticated="true"] main {
    padding: 0;
    background: #2d2d2d;
  }

  body[data-authenticated="true"] .view.active {
    gap: 0;
    grid-template-rows: 74px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .section-head {
    position: relative;
    z-index: 12;
    min-height: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid #242424;
    border-radius: 0;
    background: #303030;
    box-shadow: none;
    padding: 0 16px 0 74px;
  }

  body[data-authenticated="true"] .section-head h2 {
    color: #ffffff;
    font-size: clamp(1.55rem, 4vw, 2rem);
    font-weight: 850;
    line-height: 1;
  }

  body[data-authenticated="true"] .section-head .eyebrow {
    display: none;
  }

  body[data-authenticated="true"] .section-head .toolbar,
  body[data-authenticated="true"] .section-head > .badge {
    max-width: 44%;
    justify-content: flex-end;
  }

  body[data-authenticated="true"] .section-head .toolbar label {
    color: #c9c9c9;
    font-size: 0.68rem;
  }

  body[data-authenticated="true"] .section-head input,
  body[data-authenticated="true"] .section-head select {
    min-height: 34px;
    border-color: #4a4a4a;
    background: #242424;
    color: #ffffff;
  }

  body[data-authenticated="true"] .workspace-board {
    height: 100%;
    gap: 0;
    padding: 0;
    overflow: auto;
    background: #2d2d2d;
  }

  body[data-authenticated="true"] .workspace-subnav,
  body[data-authenticated="true"] .pos-appbar {
    min-height: 56px;
    border: 0;
    border-bottom: 1px solid #464646;
    border-radius: 0;
    background: #303030;
    box-shadow: none;
    padding: 8px 12px;
  }

  body[data-authenticated="true"] .workspace-subtab,
  body[data-authenticated="true"] .pos-subtab {
    min-height: 38px;
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    color: #d8d8d8;
    font-weight: 800;
  }

  body[data-authenticated="true"] .workspace-subtab.active,
  body[data-authenticated="true"] .pos-subtab.active {
    border-color: #44a84f;
    background: rgba(68, 168, 79, 0.14);
    color: #5ac564;
  }

  body[data-authenticated="true"] .panel,
  body[data-authenticated="true"] .metric,
  body[data-authenticated="true"] .status-pill,
  body[data-authenticated="true"] .setup-check-item,
  body[data-authenticated="true"] .device-card,
  body[data-authenticated="true"] .payment-summary-item,
  body[data-authenticated="true"] .team-row,
  body[data-authenticated="true"] .module-card,
  body[data-authenticated="true"] .brand-preview-card,
  body[data-authenticated="true"] .ai-status-card,
  body[data-authenticated="true"] .install-step,
  body[data-authenticated="true"] .helper-note,
  body[data-authenticated="true"] .ticket-item,
  body[data-authenticated="true"] .pos-item-tile,
  body[data-authenticated="true"] .checkout-drawer-head,
  body[data-authenticated="true"] .report-filter-strip {
    border-color: #464646;
    background: #303030;
    color: #f7f7f7;
    box-shadow: none;
  }

  body[data-authenticated="true"] .panel {
    border-radius: 0;
    border-width: 0 0 1px;
  }

  body[data-authenticated="true"] .metric {
    border-radius: 0;
  }

  body[data-authenticated="true"] input,
  body[data-authenticated="true"] select,
  body[data-authenticated="true"] textarea,
  body[data-authenticated="true"] output.readonly-value {
    border-color: #4a4a4a;
    background: #242424;
    color: #ffffff;
  }

  body[data-authenticated="true"] label,
  body[data-authenticated="true"] .muted,
  body[data-authenticated="true"] .empty-state,
  body[data-authenticated="true"] .metric span,
  body[data-authenticated="true"] .metric small,
  body[data-authenticated="true"] .status-pill span,
  body[data-authenticated="true"] .setup-check-item span,
  body[data-authenticated="true"] .team-row span,
  body[data-authenticated="true"] .module-card span,
  body[data-authenticated="true"] .module-card small,
  body[data-authenticated="true"] .brand-preview-card span,
  body[data-authenticated="true"] .brand-preview-card small,
  body[data-authenticated="true"] .payment-summary-item span,
  body[data-authenticated="true"] .payment-summary-item small,
  body[data-authenticated="true"] .ticket-item span,
  body[data-authenticated="true"] .ticket-total span,
  body[data-authenticated="true"] .checkout-notice span {
    color: #c9c9c9;
  }

  body[data-authenticated="true"] table {
    color: #f7f7f7;
  }

  body[data-authenticated="true"] th,
  body[data-authenticated="true"] td {
    border-bottom-color: #464646;
  }

  body[data-authenticated="true"] th {
    color: #b9b9b9;
  }

  body[data-authenticated="true"] .menu-toggle {
    top: 10px;
    left: 16px;
    z-index: 70;
    width: 44px;
    height: 54px;
    min-height: 54px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-authenticated="true"] .menu-toggle::before {
    display: none;
  }

  body[data-authenticated="true"] .menu-toggle span,
  body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span {
    width: 28px;
    height: 3px;
    background: #ffffff;
    box-shadow: none;
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  body[data-authenticated="true"] .menu-toggle span:nth-child(1),
  body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    top: calc(50% - 8px);
  }

  body[data-authenticated="true"] .menu-toggle span:nth-child(2),
  body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    top: 50%;
    width: 28px;
  }

  body[data-authenticated="true"] .menu-toggle span:nth-child(3),
  body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    top: calc(50% + 8px);
  }

  body[data-authenticated="true"] .menu-toggle:hover,
  body[data-authenticated="true"] .menu-toggle:active {
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  body[data-authenticated="true"] .menu-toggle[aria-expanded="true"] {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-authenticated="true"] .topbar {
    width: min(78vw, 320px);
    height: 100dvh;
    max-height: none;
    gap: 0;
    border: 0;
    border-right: 1px solid #252525;
    background: #303030;
    box-shadow: 16px 0 42px rgba(0, 0, 0, 0.46);
    padding: 0;
    overflow: auto;
  }

  body[data-authenticated="true"] .topbar .app-brand-lockup {
    display: grid;
    align-items: end;
    min-height: 200px;
    gap: 0;
    border-bottom: 1px solid #3c3c3c;
    padding: 84px 32px 24px;
  }

  body[data-authenticated="true"] .topbar .app-brand-logo {
    display: none;
  }

  body[data-authenticated="true"] .topbar .eyebrow {
    color: #b8b8b8;
    font-size: 0.86rem;
    text-transform: none;
  }

  body[data-authenticated="true"] .topbar h1 {
    color: #ffffff;
    font-size: clamp(1.42rem, 5vw, 1.85rem);
    font-weight: 850;
    line-height: 1.12;
    white-space: normal;
  }

  body[data-authenticated="true"] .topbar .brand-owner {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 650;
  }

  body[data-authenticated="true"] .topbar .brand-owner::before {
    display: none;
  }

  body[data-authenticated="true"] .nav-tabs {
    display: grid;
    gap: 0;
    border: 0;
    background: transparent;
    padding: 0;
  }

  body[data-authenticated="true"] .nav-tab {
    --nav-icon: none;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    min-height: 66px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #3f3f3f;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 850;
    text-align: left;
    padding: 0 30px 0 34px;
  }

  body[data-authenticated="true"] .nav-tab::before {
    content: "";
    width: 30px;
    height: 30px;
    margin: 0;
    border-radius: 0;
    background: currentColor;
    opacity: 0.96;
    -webkit-mask: var(--nav-icon) center / contain no-repeat;
    mask: var(--nav-icon) center / contain no-repeat;
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="dashboard"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='8'/%3E%3Crect x='14' y='3' width='7' height='5'/%3E%3Crect x='14' y='12' width='7' height='9'/%3E%3Crect x='3' y='15' width='7' height='6'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="pos"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h15l-2 9H7L5 3H2'/%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="inventory"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8l9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="expenses"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h12v20l-3-2-3 2-3-2-3 2V2Z'/%3E%3Cpath d='M9 7h6M9 11h6M9 15h4'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="menu"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3Ccircle cx='4' cy='6' r='.8'/%3E%3Ccircle cx='4' cy='12' r='.8'/%3E%3Ccircle cx='4' cy='18' r='.8'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="setup"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5A3.5 3.5 0 1 0 12 8a3.5 3.5 0 0 0 0 7.5Z'/%3E%3Cpath d='M19.4 15a1.8 1.8 0 0 0 .3 2l.1.1-2 3.4-.2-.1a1.8 1.8 0 0 0-2 .3 1.8 1.8 0 0 0-.6 1.8H9a1.8 1.8 0 0 0-.6-1.8 1.8 1.8 0 0 0-2-.3l-.2.1-2-3.4.1-.1a1.8 1.8 0 0 0 .3-2 1.8 1.8 0 0 0-1.6-1.1V10a1.8 1.8 0 0 0 1.6-1.1 1.8 1.8 0 0 0-.3-2l-.1-.1 2-3.4.2.1a1.8 1.8 0 0 0 2-.3A1.8 1.8 0 0 0 9 1.5h6a1.8 1.8 0 0 0 .6 1.8 1.8 1.8 0 0 0 2 .3l.2-.1 2 3.4-.1.1a1.8 1.8 0 0 0-.3 2A1.8 1.8 0 0 0 21 10v3.9a1.8 1.8 0 0 0-1.6 1.1Z'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="reports"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5M4 19h17'/%3E%3Cpath d='M8 16v-5M13 16V8M18 16v-9'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab[data-view-target="settings"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5A3.5 3.5 0 1 0 12 8a3.5 3.5 0 0 0 0 7.5Z'/%3E%3Cpath d='M19 12a7 7 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a7 7 0 0 0-1.7-1L14.5 3h-5l-.3 3.1a7 7 0 0 0-1.7 1l-2.4-1-2 3.4 2 1.5a7 7 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a7 7 0 0 0 1.7 1l.3 3.1h5l.3-3.1a7 7 0 0 0 1.7-1l2.4 1 2-3.4-2-1.5a7 7 0 0 0 .1-1Z'/%3E%3C/svg%3E");
  }

  body[data-authenticated="true"] .nav-tab.active {
    background: #3c3c3c;
    color: #5ac564;
    box-shadow: none;
  }

  body[data-authenticated="true"] .nav-tab:hover {
    background: #363636;
    transform: none;
  }

  body[data-authenticated="true"] .role-control {
    margin-top: auto;
    border-top: 1px solid #4a4a4a;
    padding: 22px 32px 28px;
  }

  body[data-authenticated="true"] .session-action {
    min-height: 52px;
    border: 1px solid #5a5a5a;
    border-radius: 4px;
    background: transparent;
    color: #ffffff;
    font-size: 0.98rem;
    text-transform: uppercase;
  }

  body[data-authenticated="true"] .nav-backdrop {
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: none;
  }
}

/* Mobile/tablet density pass: one screen, one job. Long lists scroll; sections do not sprawl. */
@media (max-width: 980px) {
  body[data-authenticated="true"] .view.active {
    grid-template-rows: 74px minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
  }

  body[data-authenticated="true"] .workspace-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body[data-authenticated="true"] .workspace-board > :not(.workspace-subnav):not([hidden]) {
    min-height: 0;
  }

  body[data-authenticated="true"] .workspace-subnav {
    position: sticky;
    top: 0;
    z-index: 7;
  }

  body[data-authenticated="true"] .content-grid,
  body[data-authenticated="true"] .content-grid.two,
  body[data-authenticated="true"] .content-grid.menu-layout,
  body[data-authenticated="true"] .content-grid.expense-layout,
  body[data-authenticated="true"] .content-grid.inventory-layout,
  body[data-authenticated="true"] .content-grid.analytics-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  body[data-authenticated="true"] .panel-head .muted,
  body[data-authenticated="true"] .panel-head .badge,
  body[data-authenticated="true"] .panel-head .panel-actions {
    display: none;
  }

  body[data-authenticated="true"] .panel-head {
    align-items: center;
    min-height: 42px;
  }

  body[data-authenticated="true"] .form-actions,
  body[data-authenticated="true"] .ticket-actions,
  body[data-authenticated="true"] .device-actions {
    gap: 8px;
  }

  body[data-authenticated="true"] .form-actions button,
  body[data-authenticated="true"] .ticket-actions button,
  body[data-authenticated="true"] .device-actions button {
    flex: 1 1 auto;
  }

  body[data-authenticated="true"] .table-wrap {
    max-height: none;
    min-height: 0;
    overflow: auto;
  }

  body[data-authenticated="true"] .dashboard-board {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  body[data-authenticated="true"] #today-metrics,
  body[data-authenticated="true"] #month-metrics {
    display: flex;
    gap: 8px;
    min-height: 96px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    flex-wrap: nowrap;
    max-height: 104px;
  }

  body[data-authenticated="true"] #today-metrics::-webkit-scrollbar,
  body[data-authenticated="true"] #month-metrics::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric {
    flex: 0 0 min(42vw, 178px);
    height: 78px;
    min-height: 76px;
    overflow: hidden;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] {
    display: flex;
    gap: 10px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 12px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"]::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] > .panel {
    flex: 0 0 min(86vw, 420px);
    max-height: calc(100dvh - 246px);
    border: 1px solid #464646;
    overflow: auto;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] #dashboard .panel:has(#recent-sales) {
    display: none;
  }

  body[data-authenticated="true"] .daily-closeout-panel,
  body[data-authenticated="true"] .profile-panel,
  body[data-authenticated="true"] .device-setup-panel,
  body[data-authenticated="true"] .setup-progress-panel,
  body[data-authenticated="true"] .brand-settings-panel,
  body[data-authenticated="true"] .team-settings-panel,
  body[data-authenticated="true"] .device-pin-panel,
  body[data-authenticated="true"] .pos-config-panel,
  body[data-authenticated="true"] .module-map-panel,
  body[data-authenticated="true"] .integration-readiness-panel {
    max-height: calc(100dvh - 130px);
    overflow: auto;
  }

  body[data-authenticated="true"] .inventory-board > .content-grid.inventory-layout,
  body[data-authenticated="true"] .menu-board > .content-grid.menu-layout,
  body[data-authenticated="true"] .expenses-board > .content-grid.expense-layout,
  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout,
  body[data-authenticated="true"] .setup-board > .content-grid.setup-layout,
  body[data-authenticated="true"] .reports-board > .content-grid.analytics-layout,
  body[data-authenticated="true"] .reports-board > .content-grid.two {
    min-height: 0;
    overflow: auto;
  }

  body[data-authenticated="true"] .settings-board {
    grid-template-rows: minmax(0, 1fr);
  }

  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout {
    display: flex;
    gap: 10px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout > .panel {
    flex: 0 0 min(86vw, 420px);
    max-height: calc(100dvh - 110px);
    border: 1px solid #464646;
    overflow: auto;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] #inventory-form[data-workspace-panel~="inventory:stock"],
  body[data-authenticated="true"] #dashboard .device-qa-panel,
  body[data-authenticated="true"] #setup .integration-readiness-panel,
  body[data-authenticated="true"] #settings .integration-readiness-panel,
  body[data-authenticated="true"] #settings .module-map-panel,
  body[data-authenticated="true"] #reports .panel:has(#report-export-readiness) {
    display: none;
  }

  body[data-authenticated="true"] #inventory .reorder-panel {
    max-height: 34dvh;
    overflow: auto;
  }

  body[data-authenticated="true"] #inventory article[data-workspace-panel~="inventory:stock"]:not(.reorder-panel),
  body[data-authenticated="true"] #menu article[data-workspace-panel~="menu:catalog"],
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:summary"],
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:sales"],
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:receipts"] {
    min-height: 0;
    max-height: calc(100dvh - 188px);
    overflow: auto;
  }

  body[data-authenticated="true"] .report-filter-strip {
    display: none;
  }

  body[data-authenticated="true"] #reports .content-grid.two:not([data-workspace-panel]) {
    display: flex;
    gap: 10px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 12px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] #reports .content-grid.two:not([data-workspace-panel]) > .panel {
    flex: 0 0 min(86vw, 420px);
    border: 1px solid #464646;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] .setup-progress-summary,
  body[data-authenticated="true"] .daily-closeout-summary,
  body[data-authenticated="true"] .reorder-summary,
  body[data-authenticated="true"] .payment-summary,
  body[data-authenticated="true"] .portal-session-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-authenticated="true"] .status-list,
  body[data-authenticated="true"] .team-list,
  body[data-authenticated="true"] .setup-checklist,
  body[data-authenticated="true"] .menu-engineering-grid,
  body[data-authenticated="true"] .device-setup-summary {
    gap: 8px;
  }

  body[data-authenticated="true"] .status-pill,
  body[data-authenticated="true"] .setup-check-item,
  body[data-authenticated="true"] .team-row,
  body[data-authenticated="true"] .device-card,
  body[data-authenticated="true"] .module-card {
    padding: 10px 12px;
  }

  body[data-authenticated="true"] #pos .section-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-authenticated="true"] .pos-board {
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
  }

  body[data-authenticated="true"] .shift-gate {
    min-height: 100%;
    align-content: start;
    justify-content: stretch;
    gap: 18px;
    border: 0;
    background: #2d2d2d;
    padding: 26px 16px;
    text-align: left;
  }

  body[data-authenticated="true"] .shift-gate h3 {
    color: #ffffff;
    font-size: 1.7rem;
  }

  body[data-authenticated="true"] .shift-gate p {
    max-width: none;
    margin: 6px 0 0;
    color: #c9c9c9;
  }

  body[data-authenticated="true"] .shift-gate .shift-controls {
    width: 100%;
    margin: 0;
  }

  body[data-authenticated="true"] #open-shift {
    min-height: 58px;
    width: 100%;
    border: 1px solid #44a84f;
    background: #44a84f;
    color: #ffffff;
    font-size: 0.98rem;
    text-transform: uppercase;
  }

  body[data-authenticated="true"] .pos-workspace {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  body[data-authenticated="true"] .pos-appbar {
    position: sticky;
    top: 0;
    z-index: 7;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 56px;
    padding: 0;
  }

  body[data-authenticated="true"] #active-shift-summary {
    display: none;
  }

  body[data-authenticated="true"] .pos-subnav {
    display: grid;
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    gap: 0;
    min-height: 56px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] .pos-subnav::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] .pos-subtab {
    min-height: 56px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #dcdcdc;
    font-size: 0.76rem;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  body[data-authenticated="true"] .pos-subtab.active {
    border-bottom-color: #44a84f;
    background: #343434;
    color: #61c66b;
  }

  body[data-authenticated="true"] .pos-panel.active {
    height: 100%;
    overflow: hidden;
    padding: 0;
  }

  body[data-authenticated="true"] .pos-register-layout {
    height: 100%;
    grid-template-rows: minmax(0, 1fr) minmax(168px, 36dvh);
    gap: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .register-left-stack {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    max-height: none;
    height: 100%;
    overflow: hidden;
  }

  body[data-authenticated="true"] .ticket-panel {
    max-height: none;
    height: 100%;
    overflow: hidden;
  }

  body[data-authenticated="true"] .pos-tiles-panel {
    min-height: 0;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  body[data-authenticated="true"] .pos-item-tiles {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0;
    max-height: none;
    min-height: 0;
    overflow: auto;
    padding: 0;
  }

  body[data-authenticated="true"] .pos-item-tile {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 12px;
    border-width: 0 0 1px;
    border-radius: 0;
    padding: 12px 16px;
  }

  body[data-authenticated="true"] .pos-item-tile strong,
  body[data-authenticated="true"] .pos-item-tile span,
  body[data-authenticated="true"] .pos-item-tile small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-authenticated="true"] .pos-item-tile em {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    justify-self: end;
  }

  body[data-authenticated="true"] .register-form {
    max-height: 30dvh;
    border-top: 1px solid #464646;
    overflow: auto;
  }

  body[data-authenticated="true"] .ticket-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    border-top: 1px solid #464646;
  }

  body[data-authenticated="true"] .ticket-items {
    min-height: 0;
    max-height: none;
    overflow: auto;
  }

  body[data-authenticated="true"] .ticket-checkout {
    max-height: 42dvh;
    overflow: auto;
  }

  body[data-authenticated="true"] #pos-drawer-panel.pos-panel.active,
  body[data-authenticated="true"] #pos-sales-panel.pos-panel.active,
  body[data-authenticated="true"] #pos-history-panel.pos-panel.active {
    overflow: auto;
  }

  body[data-authenticated="true"] #pos-sales-panel.pos-panel.active {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] #pos-sales-panel.pos-panel.active::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] #pos-drawer-panel .panel,
  body[data-authenticated="true"] #pos-sales-panel .panel,
  body[data-authenticated="true"] #pos-history-panel .panel {
    min-height: 0;
  }

  body[data-authenticated="true"] #pos-sales-panel .panel {
    flex: 0 0 min(86vw, 420px);
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid #464646;
    overflow: hidden;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] #pos-sales-panel .history-filters {
    display: none;
  }

  body[data-authenticated="true"] #pos-drawer-panel .panel {
    height: 100%;
    overflow: hidden;
  }

  body[data-authenticated="true"] #pos-drawer-panel .shift-controls {
    height: 100%;
    min-height: 0;
    gap: 12px;
    overflow: auto;
    padding-bottom: 12px;
  }

  body[data-authenticated="true"] #shift-current-report {
    gap: 10px;
  }

  body[data-authenticated="true"] #shift-current-report .shift-z-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-authenticated="true"] #shift-current-report .shift-z-head > div:nth-child(3) {
    display: none;
  }

  body[data-authenticated="true"] #shift-current-report .shift-z-metrics {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] #shift-current-report .shift-z-metrics::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] #shift-current-report .shift-z-metrics > div {
    flex: 0 0 min(46vw, 180px);
    min-height: 84px;
    padding: 10px;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] #shift-current-report .shift-z-section {
    display: none;
  }

  body[data-authenticated="true"] #shift-cash-log {
    max-height: 104px;
    overflow: auto;
  }

  body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
  body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
    border-color: #44a84f;
    background: rgba(68, 168, 79, 0.22);
    color: #ffffff;
  }

  body[data-theme="dark"][data-authenticated="true"] .section-head > .badge.good,
  body[data-theme="dark"][data-authenticated="true"] .badge.good {
    background: rgba(34, 197, 94, 0.18);
    color: #f6fff8;
  }

  body[data-theme="dark"][data-authenticated="true"] .badge.warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fff7d6;
  }

  body[data-theme="dark"][data-authenticated="true"] .badge.bad {
    background: rgba(248, 113, 113, 0.2);
    color: #fff1ef;
  }

  body[data-theme="dark"][data-authenticated="true"] .daily-closeout-summary strong.good,
  body[data-theme="dark"][data-authenticated="true"] .reorder-summary strong.good,
  body[data-theme="dark"][data-authenticated="true"] .setup-progress-summary strong.good,
  body[data-theme="dark"][data-authenticated="true"] .shift-z-metrics strong.good {
    color: #8ef0b2;
  }

  body[data-theme="dark"][data-authenticated="true"] .daily-closeout-summary strong.warn,
  body[data-theme="dark"][data-authenticated="true"] .reorder-summary strong.warn,
  body[data-theme="dark"][data-authenticated="true"] .setup-progress-summary strong.warn,
  body[data-theme="dark"][data-authenticated="true"] .shift-z-metrics strong.warn {
    color: #ffd37a;
  }

  body[data-theme="dark"][data-authenticated="true"] .daily-closeout-summary strong.bad,
  body[data-theme="dark"][data-authenticated="true"] .reorder-summary strong.bad,
  body[data-theme="dark"][data-authenticated="true"] .setup-progress-summary strong.bad,
  body[data-theme="dark"][data-authenticated="true"] .shift-z-metrics strong.bad {
    color: #ffaaa5;
  }

  body[data-theme="dark"][data-authenticated="true"] .pin-summary,
  body[data-theme="dark"][data-authenticated="true"] .toggle-line {
    border-color: #464646;
    background: #303030;
    color: #f7f7f7;
  }

  body[data-theme="dark"][data-authenticated="true"] .pin-summary span,
  body[data-theme="dark"][data-authenticated="true"] .pin-summary small,
  body[data-theme="dark"][data-authenticated="true"] .toggle-line {
    color: #d8d8d8;
  }

  /* Final mobile/tablet app polish: keep each module as a contained workspace. */
  body[data-authenticated="true"] .workspace-subnav {
    min-height: 56px;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] .workspace-subtab {
    min-height: 48px;
    padding: 0 14px;
    white-space: nowrap;
  }

  body[data-authenticated="true"] #today-metrics,
  body[data-authenticated="true"] #month-metrics {
    min-height: 112px;
    max-height: 116px;
    padding: 10px 12px;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric {
    flex: 0 0 min(46vw, 190px);
    height: 92px;
    min-height: 92px;
    padding: 10px;
    overflow: hidden;
  }

  body[data-authenticated="true"] #today-metrics .metric span,
  body[data-authenticated="true"] #month-metrics .metric span,
  body[data-authenticated="true"] #today-metrics .metric small,
  body[data-authenticated="true"] #month-metrics .metric small {
    line-height: 1.18;
  }

  body[data-authenticated="true"] #today-metrics .metric small,
  body[data-authenticated="true"] #month-metrics .metric small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body[data-authenticated="true"] #inventory .content-grid.inventory-layout:has(#inventory-form:not([hidden])) {
    display: none;
  }

  body[data-authenticated="true"] #inventory .content-grid.inventory-layout:has(#stock-form:not([hidden])),
  body[data-authenticated="true"] #inventory .content-grid.inventory-layout:has(#count-form:not([hidden])) {
    display: grid;
    height: 100%;
    overflow: auto;
  }

  body[data-authenticated="true"] #inventory article[data-workspace-panel~="inventory:stock"]:not(.reorder-panel) {
    max-height: min(48dvh, 420px);
  }

  body[data-authenticated="true"] #inventory .reorder-panel {
    max-height: min(34dvh, 300px);
  }

  body[data-authenticated="true"] #inventory .content-grid.two[data-workspace-panel~="inventory:audit"],
  body[data-authenticated="true"] #reports .content-grid.analytics-layout[data-workspace-panel~="reports:traffic"],
  body[data-authenticated="true"] #setup .content-grid.setup-layout {
    display: flex;
    gap: 10px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body[data-authenticated="true"] #inventory .content-grid.two[data-workspace-panel~="inventory:audit"]::-webkit-scrollbar,
  body[data-authenticated="true"] #reports .content-grid.analytics-layout[data-workspace-panel~="reports:traffic"]::-webkit-scrollbar,
  body[data-authenticated="true"] #setup .content-grid.setup-layout::-webkit-scrollbar {
    display: none;
  }

  body[data-authenticated="true"] #inventory .content-grid.two[data-workspace-panel~="inventory:audit"] > .panel,
  body[data-authenticated="true"] #reports .content-grid.analytics-layout[data-workspace-panel~="reports:traffic"] > .panel,
  body[data-authenticated="true"] #setup .content-grid.setup-layout > .panel {
    flex: 0 0 min(86vw, 420px);
    max-height: calc(100dvh - 150px);
    border: 1px solid #464646;
    overflow: auto;
    scroll-snap-align: start;
  }

  body[data-authenticated="true"] #menu .content-grid.menu-layout {
    height: 100%;
    overflow: hidden;
  }

  body[data-authenticated="true"] #menu article[data-workspace-panel~="menu:catalog"],
  body[data-authenticated="true"] #menu article[data-workspace-panel~="menu:costing"],
  body[data-authenticated="true"] #menu #menu-form {
    height: 100%;
    max-height: calc(100dvh - 130px);
    overflow: auto;
  }

  body[data-authenticated="true"] #reports .content-grid.two:not([data-workspace-panel]) > .panel,
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:summary"],
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:sales"],
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:receipts"],
  body[data-authenticated="true"] #reports article[data-workspace-panel~="reports:exports"] {
    max-height: calc(100dvh - 206px);
    overflow: auto;
  }

  body[data-authenticated="true"] #reports .content-grid.two[data-workspace-panel~="reports:receipts"] {
    height: 100%;
  }

  body[data-authenticated="true"] #setup .setup-progress-panel,
  body[data-authenticated="true"] #setup .device-setup-panel,
  body[data-authenticated="true"] #setup article[data-workspace-panel~="setup:security"] {
    height: 100%;
    max-height: calc(100dvh - 130px);
    overflow: auto;
  }

  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout > .panel {
    height: calc(100dvh - 110px);
    max-height: calc(100dvh - 110px);
  }
}

@media (max-width: 620px) {
  body[data-authenticated="true"] .section-head .toolbar,
  body[data-authenticated="true"] .section-head > .badge {
    max-width: 42%;
  }

  body[data-authenticated="true"] .section-head .toolbar label {
    max-width: 144px;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric {
    flex-basis: 48vw;
  }

  body[data-authenticated="true"] .payment-summary,
  body[data-authenticated="true"] .setup-progress-summary,
  body[data-authenticated="true"] .daily-closeout-summary,
  body[data-authenticated="true"] .reorder-summary,
  body[data-authenticated="true"] .portal-session-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile/tablet release fix: no sideways module workspaces; tables become readable rows. */
@media (max-width: 980px) {
  html,
  body,
  body[data-authenticated="true"] .app-shell,
  body[data-authenticated="true"] main,
  body[data-authenticated="true"] .view.active,
  body[data-authenticated="true"] .workspace-board {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] .workspace-subnav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 6px;
    min-height: auto;
    padding: 6px;
    overflow: visible;
    scroll-snap-type: none;
  }

  body[data-authenticated="true"] .workspace-subtab {
    min-width: 0;
    min-height: 40px;
    padding: 0 8px;
    white-space: normal;
  }

  body[data-authenticated="true"] #today-metrics,
  body[data-authenticated="true"] #month-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    max-height: none;
    overflow: visible;
    scroll-snap-type: none;
    padding: 8px;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric {
    width: auto;
    min-width: 0;
    min-height: 84px;
    height: auto;
    flex: none;
    scroll-snap-align: none;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"],
  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout,
  body[data-authenticated="true"] #reports .content-grid.two:not([data-workspace-panel]),
  body[data-authenticated="true"] #inventory .content-grid.two[data-workspace-panel~="inventory:audit"],
  body[data-authenticated="true"] #reports .content-grid.analytics-layout[data-workspace-panel~="reports:traffic"],
  body[data-authenticated="true"] #setup .content-grid.setup-layout,
  body[data-authenticated="true"] #pos-sales-panel.pos-panel.active,
  body[data-authenticated="true"] #shift-current-report .shift-z-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    padding: 8px;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] > .panel,
  body[data-authenticated="true"] .settings-board > .content-grid.settings-layout > .panel,
  body[data-authenticated="true"] #reports .content-grid.two:not([data-workspace-panel]) > .panel,
  body[data-authenticated="true"] #inventory .content-grid.two[data-workspace-panel~="inventory:audit"] > .panel,
  body[data-authenticated="true"] #reports .content-grid.analytics-layout[data-workspace-panel~="reports:traffic"] > .panel,
  body[data-authenticated="true"] #setup .content-grid.setup-layout > .panel,
  body[data-authenticated="true"] #pos-sales-panel .panel,
  body[data-authenticated="true"] #shift-current-report .shift-z-metrics > div {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    flex: none;
    scroll-snap-align: none;
  }

  body[data-authenticated="true"] .table-wrap {
    width: 100%;
    max-width: 100%;
    margin: 8px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-authenticated="true"] .table-wrap table,
  body[data-authenticated="true"] .table-wrap thead,
  body[data-authenticated="true"] .table-wrap tbody,
  body[data-authenticated="true"] .table-wrap tr,
  body[data-authenticated="true"] .table-wrap th,
  body[data-authenticated="true"] .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body[data-authenticated="true"] .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  body[data-authenticated="true"] .table-wrap tbody {
    display: grid;
    gap: 8px;
  }

  body[data-authenticated="true"] .table-wrap tr {
    border: 1px solid #464646;
    border-radius: 8px;
    background: #303030;
    overflow: hidden;
  }

  body[data-authenticated="true"] .table-wrap td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid #464646;
    color: #f7f7f7;
    line-height: 1.28;
    overflow-wrap: anywhere;
  }

  body[data-authenticated="true"] .table-wrap td:last-child {
    border-bottom: 0;
  }

  body[data-authenticated="true"] .table-wrap td::before {
    content: attr(data-label);
    color: #c9c9c9;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  body[data-authenticated="true"] .table-wrap td.empty-state {
    display: block;
    padding: 16px;
  }

  body[data-authenticated="true"] .table-wrap td.empty-state::before {
    content: "";
  }

  body[data-authenticated="true"] .table-wrap td.money {
    text-align: left;
  }

  body[data-authenticated="true"] .table-wrap .row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body[data-theme="light"][data-authenticated="true"] .table-wrap tr {
    border-color: var(--line);
    background: #ffffff;
  }

  body[data-theme="light"][data-authenticated="true"] .table-wrap td {
    border-bottom-color: var(--line);
    color: var(--ink);
  }

  body[data-theme="light"][data-authenticated="true"] .table-wrap td::before {
    color: var(--muted);
  }
}

@media (max-width: 620px) {
  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric {
    flex-basis: auto;
  }
}

body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
  border-color: #62d16c;
  background: #155d2b;
  color: #ffffff;
}
/* EOF anchor for final Project Arise overrides. */

/* Final 20260616 app-quality override. This sits last so mobile/tablet stay app-like. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body[data-theme="light"] {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-muted: #eee8de;
  --line: #d8d0c4;
  --ink: #18211e;
  --muted: #5f6a64;
  background:
    radial-gradient(circle at 12% 0%, rgba(163, 133, 96, 0.16), transparent 28%),
    linear-gradient(135deg, #f4f2ed 0%, #ffffff 58%, #ebe4d9 100%);
  color: var(--ink);
}

body[data-theme="dark"] {
  --bg: #202120;
  --surface: #2c2d2c;
  --surface-muted: #343635;
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f7f4ef;
  --muted: #d4ccc0;
  background:
    radial-gradient(circle at 14% 0%, rgba(163, 133, 96, 0.14), transparent 28%),
    linear-gradient(135deg, #242524 0%, #171f1d 48%, #2a161b 100%);
  color: var(--ink);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .section-head,
body[data-theme="dark"] .workspace-board,
body[data-theme="dark"] .workspace-subnav,
body[data-theme="dark"] .workspace-subtab,
body[data-theme="dark"] .pos-subtab,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .status-row,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .team-row,
body[data-theme="dark"] .module-card,
body[data-theme="dark"] .brand-preview-card,
body[data-theme="dark"] .setup-check-item,
body[data-theme="dark"] .install-step,
body[data-theme="dark"] .device-card,
body[data-theme="dark"] .payment-summary-item,
body[data-theme="dark"] .receipt-card,
body[data-theme="dark"] .mobile-folder-card,
body[data-theme="dark"] .mobile-panel-back,
body[data-theme="dark"] .screen-prompt-card,
body[data-theme="dark"] .app-tour-card {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] strong,
body[data-theme="dark"] label,
body[data-theme="dark"] .metric strong,
body[data-theme="dark"] .status-row strong,
body[data-theme="dark"] .mobile-folder-card strong {
  color: var(--ink);
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] small,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .metric span,
body[data-theme="dark"] .metric small,
body[data-theme="dark"] .status-row span,
body[data-theme="dark"] .mobile-folder-card small,
body[data-theme="dark"] .table-wrap td::before {
  color: var(--muted);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] output.readonly-value {
  background: #191b1a;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body[data-theme="dark"] .workspace-subtab.active,
body[data-theme="dark"] .pos-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
  background: linear-gradient(135deg, #16302b, #2f6b4d);
  border-color: #77d88b;
  color: #ffffff;
}

.portal-visual-panel {
  isolation: isolate;
  padding: 0;
  background: #03110d;
}

.portal-visual-panel:before,
.portal-visual-panel:after,
body[data-authenticated="false"] .portal-visual-panel:before,
body[data-authenticated="false"] .portal-visual-panel:after {
  display: none;
}

.portal-motion-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portal-motion-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(3, 17, 13, 0.08), rgba(3, 17, 13, 0.52));
  pointer-events: none;
}

.motion-pill {
  position: absolute;
  z-index: 2;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(3, 17, 13, 0.62);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  animation: motionFloat 6.5s ease-in-out infinite;
}

.motion-pill-one { top: 14%; left: 10%; }
.motion-pill-two { right: 8%; top: 42%; animation-delay: -1.8s; }
.motion-pill-three { left: 16%; bottom: 16%; animation-delay: -3.4s; }

@keyframes motionFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

.app-splash,
.app-tour {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(163, 133, 96, 0.28), transparent 28%),
    linear-gradient(135deg, #03110d 0%, #16302b 54%, #390517 100%);
  color: #ffffff;
}

.app-splash.hidden,
.app-tour.hidden {
  display: none !important;
}

.splash-brand,
.app-tour-card {
  width: min(92vw, 430px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 28px;
  background: rgba(3, 17, 13, 0.72);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
  text-align: center;
}

.splash-brand img,
.app-tour-card img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  margin-bottom: 16px;
  animation: splashLogo 1.15s ease both;
}

.splash-brand strong,
.app-tour h2 {
  display: block;
  margin: 0;
  color: #ffffff;
  font-size: 1.8rem;
  letter-spacing: 0;
}

.splash-brand small,
.app-tour p,
.app-tour span {
  color: rgba(255, 255, 255, 0.78);
}

.splash-progress {
  position: absolute;
  bottom: 13vh;
  width: min(64vw, 320px);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.splash-progress span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a38560, #ffffff, #a44529);
  animation: loaderRun 1.1s ease-in-out infinite;
}

@keyframes splashLogo {
  from { transform: translateY(8px) scale(0.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes loaderRun {
  from { transform: translateX(-110%); }
  to { transform: translateX(230%); }
}

.metric-action {
  appearance: none;
  text-align: left;
  cursor: pointer;
}

.metric-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: 0 16px 32px rgba(3, 17, 13, 0.12);
}

.mobile-workspace-index,
.mobile-panel-back {
  display: none;
}

@media (max-width: 980px) {
  body[data-authenticated="true"] main,
  body[data-authenticated="true"] .view.active,
  body[data-authenticated="true"] .workspace-board,
  body[data-authenticated="true"] .pos-workspace {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] .view.active {
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr);
    height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .section-head {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 58px;
    padding: 0 8px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  body[data-authenticated="true"] .section-head > div:first-child {
    grid-column: 2;
    text-align: center;
    min-width: 0;
  }

  body[data-authenticated="true"] .section-head .eyebrow,
  body[data-authenticated="true"] .section-head p:not(.eyebrow) {
    display: none;
  }

  body[data-authenticated="true"] .section-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.18rem;
    line-height: 1.1;
    text-align: center;
  }

  body[data-authenticated="true"] .section-head .toolbar {
    grid-column: 3;
    justify-self: end;
    width: 38px;
    min-width: 38px;
    overflow: hidden;
  }

  body[data-authenticated="true"] .section-head .toolbar label,
  body[data-authenticated="true"] .role-control {
    display: none !important;
  }

  body[data-authenticated="true"] .workspace-board {
    height: calc(100dvh - 58px);
    min-height: 0;
    border-radius: 0;
    overflow: hidden;
  }

  body[data-authenticated="true"] .mobile-folder-board {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    background: var(--bg);
  }

  body[data-authenticated="true"] .mobile-folder-board > .workspace-subnav {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-folder-board:not(.mobile-panel-open) > :not(.workspace-subnav):not(.mobile-workspace-index) {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-workspace-index {
    display: grid;
    align-content: start;
    gap: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] .mobile-folder-card {
    appearance: none;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 84px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 18px;
    text-align: left;
    box-shadow: none;
  }

  body[data-authenticated="true"] .mobile-folder-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(163, 133, 96, 0.18);
    color: var(--teal);
    font-size: 0.72rem;
    font-weight: 950;
  }

  body[data-authenticated="true"] .mobile-folder-card strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.2;
  }

  body[data-authenticated="true"] .mobile-folder-card small {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open {
    grid-template-rows: 46px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open .mobile-workspace-index {
    display: none !important;
  }

  body[data-authenticated="true"] .mobile-panel-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 0 16px;
    color: var(--ink);
    font-weight: 850;
    box-shadow: none;
  }

  body[data-authenticated="true"] .mobile-panel-back::before {
    content: "<";
    font-size: 1rem;
  }

  body[data-authenticated="true"] .mobile-folder-board.mobile-panel-open > :not(.workspace-subnav):not(.mobile-workspace-index):not(.mobile-panel-back):not([hidden]) {
    display: grid;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
  }

  body[data-authenticated="true"] .content-grid,
  body[data-authenticated="true"] .content-grid.two,
  body[data-authenticated="true"] .content-grid.analytics-layout,
  body[data-authenticated="true"] .setup-layout,
  body[data-authenticated="true"] .settings-layout {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  body[data-authenticated="true"] .panel {
    min-width: 0;
    border-radius: 10px;
    padding: 12px;
  }

  body[data-authenticated="true"] #dashboard .workspace-subnav {
    display: none !important;
  }

  body[data-authenticated="true"] #dashboard .workspace-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body[data-authenticated="true"] #today-metrics,
  body[data-authenticated="true"] #month-metrics,
  body[data-authenticated="true"] #expense-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  body[data-authenticated="true"] #today-metrics .metric,
  body[data-authenticated="true"] #month-metrics .metric,
  body[data-authenticated="true"] #expense-metrics .metric {
    width: auto;
    min-width: 0;
    min-height: 68px;
    padding: 9px;
    border-radius: 10px;
  }

  body[data-authenticated="true"] .metric strong {
    font-size: 1rem;
    line-height: 1.12;
  }

  body[data-authenticated="true"] .metric span,
  body[data-authenticated="true"] .metric small {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  body[data-authenticated="true"] #dashboard .content-grid[data-workspace-panel~="dashboard:overview"] {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  body[data-authenticated="true"] #dashboard .closeout-grid,
  body[data-authenticated="true"] .device-qa-panel,
  body[data-authenticated="true"] .prospect-panel {
    display: none !important;
  }

  body[data-authenticated="true"] .table-wrap {
    overflow-x: hidden !important;
  }
}

@media (max-width: 720px) {
  body[data-authenticated="false"] .portal-login-layout {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    min-height: 150px;
    order: -1;
    border-radius: 16px;
  }

  body[data-authenticated="true"] .view.active {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  body[data-authenticated="true"] .section-head {
    min-height: 54px;
  }

  body[data-authenticated="true"] .workspace-board {
    height: calc(100dvh - 54px);
  }
}
/* True EOF contrast hardening. */
body[data-theme="dark"][data-authenticated="true"] .mobile-folder-mark {
  background: rgba(163, 133, 96, 0.34);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"][data-authenticated="true"] button:not(.secondary):not(.link-button):not(.menu-toggle):not(.screen-prompt-close) {
  background: linear-gradient(135deg, #16302b, #2f6b4d);
  color: #ffffff;
}

body[data-theme="dark"][data-authenticated="true"] #open-shift {
  border-color: #77d88b;
  background: #1f6846;
  color: #ffffff;
}

body[data-theme="light"][data-authenticated="true"] {
  background: #f4f2ed;
  color: #18211e;
}

body[data-theme="light"][data-authenticated="true"] .app-shell,
body[data-theme="light"][data-authenticated="true"] main,
body[data-theme="light"][data-authenticated="true"] .view.active,
body[data-theme="light"][data-authenticated="true"] .workspace-board,
body[data-theme="light"][data-authenticated="true"] .pos-workspace {
  background: #f4f2ed;
  color: #18211e;
}

body[data-theme="light"][data-authenticated="true"] .section-head,
body[data-theme="light"][data-authenticated="true"] .panel,
body[data-theme="light"][data-authenticated="true"] .metric,
body[data-theme="light"][data-authenticated="true"] .mobile-folder-card,
body[data-theme="light"][data-authenticated="true"] .mobile-panel-back,
body[data-theme="light"][data-authenticated="true"] .table-wrap tr,
body[data-theme="light"][data-authenticated="true"] .status-row,
body[data-theme="light"][data-authenticated="true"] .team-row,
body[data-theme="light"][data-authenticated="true"] .module-card,
body[data-theme="light"][data-authenticated="true"] .brand-preview-card,
body[data-theme="light"][data-authenticated="true"] .setup-check-item,
body[data-theme="light"][data-authenticated="true"] .install-step,
body[data-theme="light"][data-authenticated="true"] .device-card,
body[data-theme="light"][data-authenticated="true"] .payment-summary-item {
  background: #ffffff;
  border-color: #d8d0c4;
  color: #18211e;
}

body[data-theme="light"][data-authenticated="true"] #dashboard .metric,
body[data-theme="light"][data-authenticated="true"] #month-metrics .metric,
body[data-theme="light"][data-authenticated="true"] #expense-metrics .metric {
  background: linear-gradient(135deg, #ffffff, #f1ece3);
  color: #18211e;
}

body[data-theme="light"][data-authenticated="true"] h1,
body[data-theme="light"][data-authenticated="true"] h2,
body[data-theme="light"][data-authenticated="true"] h3,
body[data-theme="light"][data-authenticated="true"] h4,
body[data-theme="light"][data-authenticated="true"] strong,
body[data-theme="light"][data-authenticated="true"] label,
body[data-theme="light"][data-authenticated="true"] .metric strong,
body[data-theme="light"][data-authenticated="true"] .mobile-folder-card strong {
  color: #18211e;
}

body[data-theme="light"][data-authenticated="true"] p,
body[data-theme="light"][data-authenticated="true"] span,
body[data-theme="light"][data-authenticated="true"] small,
body[data-theme="light"][data-authenticated="true"] .muted,
body[data-theme="light"][data-authenticated="true"] .metric span,
body[data-theme="light"][data-authenticated="true"] .metric small,
body[data-theme="light"][data-authenticated="true"] .mobile-folder-card small {
  color: #5f6a64;
}

body[data-theme="light"][data-authenticated="true"] .menu-toggle span {
  background: #18211e;
}

body[data-theme="light"][data-authenticated="true"] th,
body[data-theme="light"][data-authenticated="true"] td,
body[data-theme="light"][data-authenticated="true"] .empty-state,
body[data-theme="light"][data-authenticated="true"] .table-wrap td::before {
  color: #4f5a54;
}

body[data-theme="light"][data-authenticated="true"] th {
  background: #eee8de;
  color: #2c3631;
}

/* True EOF login composition polish: keep the motion video elegant, not oversized. */
body[data-authenticated="false"] .portal-board {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 44px);
}

body[data-authenticated="false"] .portal-login-layout {
  width: min(850px, calc(100vw - 48px));
  min-height: auto;
  max-height: min(620px, calc(100dvh - 64px));
  grid-template-columns: 390px 390px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid rgba(224, 224, 224, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 72% 34%, rgba(163, 133, 96, 0.15), transparent 30%),
    linear-gradient(135deg, rgba(3, 17, 13, 0.94), rgba(22, 48, 43, 0.54));
  box-shadow: 0 28px 90px rgba(3, 17, 13, 0.34);
  overflow: hidden;
}

body[data-authenticated="false"] .portal-login-card {
  min-height: 500px;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

body[data-authenticated="false"] .portal-visual-panel {
  min-height: 0;
  width: 360px;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: none;
  margin: 0 26px 0 0;
  align-self: center;
  border: 1px solid rgba(224, 224, 224, 0.16);
  border-radius: 14px;
  box-shadow:
    0 18px 54px rgba(3, 17, 13, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body[data-authenticated="false"] .portal-motion-video {
  transform: scale(1.01);
  filter: saturate(1.02) contrast(0.98) brightness(0.84);
}

body[data-authenticated="false"] .portal-motion-layer {
  background:
    linear-gradient(90deg, rgba(3, 17, 13, 0.18), rgba(3, 17, 13, 0.42)),
    radial-gradient(circle at 62% 44%, rgba(163, 133, 96, 0.1), transparent 42%);
}

body[data-authenticated="false"] .motion-pill {
  min-height: 30px;
  padding: 7px 10px;
  font-size: 0.66rem;
  background: rgba(3, 17, 13, 0.72);
}

body[data-authenticated="false"] .motion-pill-one {
  top: 16%;
  left: 12%;
}

body[data-authenticated="false"] .motion-pill-two {
  top: auto;
  right: 10%;
  bottom: 28%;
}

body[data-authenticated="false"] .motion-pill-three {
  left: 12%;
  bottom: 13%;
}

body[data-authenticated="false"],
body[data-authenticated="false"] .app-shell,
body[data-authenticated="false"] main,
body[data-authenticated="false"] #portal.view.active,
body[data-authenticated="false"] .portal-board {
  background:
    radial-gradient(circle at 76% 16%, rgba(163, 133, 96, 0.18), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(164, 69, 41, 0.16), transparent 26%),
    linear-gradient(135deg, #03110d 0%, #102a24 52%, #2a0611 100%);
}

body[data-authenticated="false"] {
  overflow-x: hidden;
}

body[data-authenticated="false"] .portal-board::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(224, 224, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 224, 224, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
}

body[data-authenticated="false"] .portal-login-layout {
  position: relative;
  z-index: 1;
}

body[data-authenticated="false"] .portal-login-layout::after {
  content: "";
  position: absolute;
  inset: 108px 18px auto auto;
  width: 384px;
  height: 236px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 52% 28%, rgba(163, 133, 96, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(224, 224, 224, 0.08), rgba(224, 224, 224, 0.02));
  pointer-events: none;
}

body[data-authenticated="false"] .portal-visual-panel {
  z-index: 1;
}

@media (max-width: 980px) {
  body[data-authenticated="false"] .portal-login-layout {
    width: min(760px, calc(100vw - 28px));
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: none;
  }

  body[data-authenticated="false"] .portal-login-card {
    min-height: auto;
    border-radius: 18px;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    width: min(520px, calc(100% - 44px));
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    margin: 0;
    order: -1;
  }
}

@media (max-width: 620px) {
  body[data-authenticated="false"] .portal-board {
    padding: 14px;
  }

  body[data-authenticated="false"] .portal-login-layout {
    width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    width: 100%;
    max-width: 320px;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  body[data-authenticated="false"] .motion-pill {
    display: none;
  }
}

/* Final login reset: stable laptop/tablet presentation with a clean data/AI video frame. */
body[data-authenticated="false"],
body[data-authenticated="false"] .app-shell,
body[data-authenticated="false"] main,
body[data-authenticated="false"] #portal.view.active {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 20%, rgba(163, 133, 96, 0.18), transparent 28%),
    radial-gradient(circle at 12% 84%, rgba(164, 69, 41, 0.14), transparent 30%),
    linear-gradient(135deg, #03110d 0%, #102a24 56%, #300613 100%);
}

body[data-authenticated="false"] .portal-board {
  display: grid;
  place-items: center;
  align-content: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 100dvh;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  background: transparent;
}

body[data-authenticated="false"] .portal-board::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(224, 224, 224, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 224, 224, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.8;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.18));
}

body[data-authenticated="false"] .portal-login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 410px minmax(420px, 1fr);
  width: min(980px, calc(100vw - 72px));
  min-height: 560px;
  max-height: none;
  gap: 0;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(224, 224, 224, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(3, 17, 13, 0.78), rgba(22, 48, 43, 0.44)),
    rgba(3, 17, 13, 0.56);
  box-shadow: 0 32px 100px rgba(3, 17, 13, 0.38);
}

body[data-authenticated="false"] .portal-login-layout::after {
  display: none;
}

body[data-authenticated="false"] .portal-login-card {
  min-height: 560px;
  padding: clamp(36px, 4vw, 48px) clamp(30px, 3vw, 42px);
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #f4f0e8, #e7dfd2);
  box-shadow: none;
}

body[data-authenticated="false"] .portal-login-card,
body[data-authenticated="false"] .portal-login-card h3,
body[data-authenticated="false"] .portal-login-card label,
body[data-authenticated="false"] .portal-login-card .portal-wordmark strong {
  color: #03110d;
}

body[data-authenticated="false"] .portal-login-card .portal-copy,
body[data-authenticated="false"] .portal-login-card small,
body[data-authenticated="false"] .portal-login-card .link-button {
  color: #52615a;
}

body[data-authenticated="false"] .portal-login-card input {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(3, 17, 13, 0.16);
  color: #03110d;
}

body[data-authenticated="false"] .portal-visual-panel {
  position: relative;
  display: block;
  align-self: center;
  justify-self: center;
  width: min(500px, calc(100% - 56px));
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(224, 224, 224, 0.14);
  border-radius: 16px;
  background: #03110d;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

body[data-authenticated="false"] .portal-visual-panel::before,
body[data-authenticated="false"] .portal-visual-panel::after,
body[data-authenticated="false"] .portal-motion-layer {
  display: none !important;
}

body[data-authenticated="false"] .portal-motion-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  filter: saturate(0.95) contrast(0.96) brightness(0.92);
}

@media (min-width: 981px) {
  body[data-authenticated="false"] {
    overflow-y: hidden;
  }
}

@media (min-width: 621px) and (max-width: 980px) {
  body[data-authenticated="false"] .portal-board {
    padding: 28px;
  }

  body[data-authenticated="false"] .portal-login-layout {
    grid-template-columns: 1fr;
    width: min(640px, calc(100vw - 48px));
    min-height: auto;
    border-radius: 22px;
  }

  body[data-authenticated="false"] .portal-login-card {
    min-height: auto;
    padding: 34px 36px 38px;
    order: 1;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    order: 0;
    width: min(520px, calc(100% - 48px));
    margin: 28px auto 0;
  }
}

@media (max-width: 620px) {
  body[data-authenticated="false"],
  body[data-authenticated="false"] .app-shell,
  body[data-authenticated="false"] main,
  body[data-authenticated="false"] #portal.view.active {
    overflow-y: auto;
  }

  body[data-authenticated="false"] .portal-board {
    min-height: 100dvh;
    padding: 16px;
  }

  body[data-authenticated="false"] .portal-login-layout {
    display: block;
    width: 100%;
    min-height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-authenticated="false"] .portal-login-card {
    min-height: auto;
    border-radius: 20px;
    padding: 28px 22px;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    display: none;
  }
}

/* Login responsive correction: tablet and phone should be centered, form-first screens. */
@media (max-width: 980px) {
  body[data-authenticated="false"] {
    overflow-y: auto;
  }

  body[data-authenticated="false"] .app-shell,
  body[data-authenticated="false"] main,
  body[data-authenticated="false"] #portal.view.active,
  body[data-authenticated="false"] .portal-board {
    min-height: 100dvh;
  }

  body[data-authenticated="false"] #portal.view.active,
  body[data-authenticated="false"] .portal-board {
    display: grid;
    place-items: center;
    align-content: center;
    justify-content: center;
  }

  body[data-authenticated="false"] .portal-board {
    width: 100%;
    padding: clamp(20px, 6vw, 44px);
    overflow: hidden;
  }

  body[data-authenticated="false"] .portal-login-layout {
    display: block;
    width: min(410px, calc(100vw - 36px));
    min-height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body[data-authenticated="false"] .portal-login-card {
    width: 100%;
    min-height: auto;
    border-radius: 22px;
    padding: clamp(28px, 6vw, 40px) clamp(22px, 5vw, 34px);
    box-shadow: 0 26px 76px rgba(3, 17, 13, 0.28);
  }

  body[data-authenticated="false"] .portal-visual-panel {
    display: none !important;
  }
}

@media (max-width: 420px) {
  body[data-authenticated="false"] .portal-board {
    padding: 18px;
  }

  body[data-authenticated="false"] .portal-login-layout {
    width: 100%;
  }
}

/* CPB-portal-inspired Manna Hub login: similar structure, distinct product styling. */
@media (min-width: 981px) {
  body[data-authenticated="false"],
  body[data-authenticated="false"] .app-shell,
  body[data-authenticated="false"] main,
  body[data-authenticated="false"] #portal.view.active {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #07110f;
  }

  body[data-authenticated="false"] main {
    display: block;
  }

  body[data-authenticated="false"] .portal-board {
    display: block;
    width: 100vw;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #07110f;
  }

  body[data-authenticated="false"] .portal-identity-panel {
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #07110f;
    box-shadow: none;
  }

  body[data-authenticated="false"] .portal-login-layout {
    display: grid;
    grid-template-columns: minmax(420px, 464px) minmax(0, 1fr);
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #07110f;
    box-shadow: none;
  }

  body[data-authenticated="false"] .portal-login-card {
    width: 100%;
    min-height: 100dvh;
    padding: clamp(82px, 12vh, 116px) 68px 56px;
    border-radius: 0;
    background: linear-gradient(180deg, #fffaf1, #f0e7d8);
    box-shadow: none;
  }

  body[data-authenticated="false"] .portal-login-card-head {
    gap: 34px;
    margin-bottom: 34px;
  }

  body[data-authenticated="false"] .portal-wordmark {
    gap: 12px;
  }

  body[data-authenticated="false"] .portal-mark {
    width: 36px;
    height: 36px;
  }

  body[data-authenticated="false"] .portal-login-card h3 {
    font-size: clamp(2rem, 3vw, 2.65rem);
    line-height: 1;
  }

  body[data-authenticated="false"] .portal-login-card label {
    gap: 8px;
    margin-bottom: 17px;
  }

  body[data-authenticated="false"] .portal-login-card input,
  body[data-authenticated="false"] .portal-login-card button[type="submit"] {
    min-height: 52px;
  }

  body[data-authenticated="false"] .portal-visual-panel {
    position: relative;
    display: grid;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    aspect-ratio: auto;
    margin: 0;
    padding: clamp(64px, 8vw, 112px);
    overflow: hidden;
    place-items: center start;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 18% 18%, rgba(163, 133, 96, 0.18), transparent 28%),
      radial-gradient(circle at 88% 78%, rgba(164, 69, 41, 0.18), transparent 32%),
      linear-gradient(135deg, #07110f 0%, #16302b 60%, #390517 100%);
    box-shadow: none;
  }

  body[data-authenticated="false"] .portal-visual-panel::before,
  body[data-authenticated="false"] .portal-visual-panel::after {
    content: "";
    position: absolute;
    display: block !important;
    pointer-events: none;
  }

  body[data-authenticated="false"] .portal-visual-panel::before {
    inset: 0;
    background-image:
      linear-gradient(rgba(224, 224, 224, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(224, 224, 224, 0.03) 1px, transparent 1px);
    background-size: 58px 58px;
    opacity: 0.72;
  }

  body[data-authenticated="false"] .portal-visual-panel::after {
    right: clamp(60px, 9vw, 140px);
    top: 50%;
    width: min(36vw, 420px);
    height: min(36vw, 420px);
    border: 1px solid rgba(224, 224, 224, 0.12);
    border-radius: 50%;
    transform: translateY(-50%);
    background:
      radial-gradient(circle, rgba(224, 224, 224, 0.12), transparent 36%),
      conic-gradient(from 45deg, rgba(163, 133, 96, 0.42), transparent, rgba(164, 69, 41, 0.34), transparent);
    filter: blur(0.2px);
    opacity: 0.62;
  }

  body[data-authenticated="false"] .portal-motion-video,
  body[data-authenticated="false"] .portal-motion-layer {
    display: none !important;
  }

  body[data-authenticated="false"] .portal-reference-copy {
    display: none !important;
  }

  body[data-authenticated="false"] .portal-reference-mark {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid rgba(224, 224, 224, 0.16);
    border-radius: 16px;
    background: rgba(255, 250, 241, 0.08);
    color: #e0e0e0;
    font-weight: 900;
  }

  body[data-authenticated="false"] .portal-reference-copy p {
    margin: 0;
    color: rgba(224, 224, 224, 0.72);
    font-weight: 800;
  }

  body[data-authenticated="false"] .portal-reference-copy h2 {
    margin: 0;
    max-width: 520px;
    color: #ffffff;
    font-size: clamp(3.1rem, 7vw, 6rem);
    line-height: 0.95;
    font-weight: 850;
  }

  body[data-authenticated="false"] .portal-reference-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
  }

  body[data-authenticated="false"] .portal-reference-points span {
    border: 1px solid rgba(224, 224, 224, 0.14);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(3, 17, 13, 0.34);
    color: rgba(224, 224, 224, 0.76);
    font-size: 0.84rem;
    font-weight: 800;
  }
}

@media (max-width: 980px) {
  body[data-authenticated="false"] .portal-reference-copy {
    display: none !important;
  }
}

@keyframes manna-login-object-drift {
  0%,
  100% {
    transform: translateY(-50%) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(calc(-50% - 10px)) rotate(10deg) scale(1.02);
  }
}

@keyframes manna-login-mark-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes manna-login-grid-shift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 58px 36px, 58px 36px;
  }
}

/* Minimal right-side welcome: CPB portal-inspired, not copied. */
@media (min-width: 981px) {
  body[data-authenticated="false"] .portal-visual-panel::before {
    animation: manna-login-grid-shift 16s linear infinite;
  }

  body[data-authenticated="false"] .portal-visual-panel::after {
    animation: manna-login-object-drift 7s ease-in-out infinite;
  }

  body[data-authenticated="false"] .portal-reference-copy {
    position: relative;
    z-index: 2;
    display: grid !important;
    max-width: 500px;
    gap: 18px;
    color: #e0e0e0;
  }

  body[data-authenticated="false"] .portal-reference-mark {
    animation: manna-login-mark-float 5s ease-in-out infinite;
  }

  body[data-authenticated="false"] .portal-reference-copy p {
    margin: 0;
    color: rgba(224, 224, 224, 0.72);
    font-size: 1rem;
    font-weight: 850;
  }

  body[data-authenticated="false"] .portal-reference-copy h2 {
    max-width: 430px;
    color: #ffffff;
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.98;
    font-weight: 850;
  }

  body[data-authenticated="false"] .portal-reference-points {
    display: none !important;
  }
}

/* Commercial cleanup 20260616: solid contrast fallbacks behind gradient controls. */
body[data-theme="light"][data-authenticated="true"] .nav-tab.active,
body[data-theme="light"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="light"][data-authenticated="true"] .pos-subtab.active {
  background-color: #16302b !important;
  color: #ffffff !important;
}

body[data-theme="light"][data-authenticated="true"] button:not(.secondary):not(.link-button):not(.menu-toggle):not(.nav-tab):not(.workspace-subtab):not(.pos-subtab) {
  background-color: #0f766e;
  color: #ffffff;
}

body[data-theme="dark"][data-authenticated="true"] .nav-tab.active,
body[data-theme="dark"][data-authenticated="true"] .workspace-subtab.active,
body[data-theme="dark"][data-authenticated="true"] .pos-subtab.active {
  background-color: #a38560 !important;
  color: #03110d !important;
}
