:root {
  --tenant-primary: #334155;
  --tenant-accent: #0f766e;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #697386;
  --line: #dde3ea;
  --good: #168a5b;
  --warn: #b7791f;
  --bad: #c2410c;
  --radius: 8px;
  --shadow: 0 18px 40px rgba(22, 32, 51, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: #111827;
  color: #f8fafc;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--tenant-primary), var(--tenant-accent));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 2px;
  color: #aab5c5;
}

.company-switch {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius);
}

.company-switch label,
.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-switch label {
  color: #b8c2d0;
}

.company-switch select {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  background: #0f172a;
  color: #f8fafc;
  padding: 0 10px;
}

.nav {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.nav-link {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: #d8e0eb;
  border: 1px solid transparent;
}

.nav-link span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  font-size: 11px;
  font-weight: 900;
}

.nav-link strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .10);
  color: #fff;
}

.nav-link.active span {
  background: var(--tenant-accent);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 3px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  color: #aab5c5;
  font-size: 13px;
}

.sidebar-footer strong {
  color: #fff;
  overflow-wrap: anywhere;
}

.sidebar-footer a {
  width: max-content;
  margin-top: 6px;
  color: #d9f99d;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--tenant-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.button.primary {
  border-color: transparent;
  background: var(--tenant-primary);
  color: #fff;
}

.button.accent {
  border-color: transparent;
  background: var(--tenant-accent);
  color: #fff;
}

.button.subtle {
  background: #eef2f7;
}

.icon-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  place-items: center;
  padding: 10px;
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px 0;
  background: var(--ink);
  border-radius: 2px;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #14532d;
  font-weight: 700;
}

.notice.error {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.metric,
.table-card,
.state-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel,
.state-panel {
  padding: 18px;
}

.state-panel {
  max-width: 680px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel h2,
.state-panel h1,
.login-form h1 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.panel p,
.state-panel p {
  color: var(--muted);
}

.metric {
  min-height: 128px;
  padding: 16px;
  border-top: 4px solid var(--tenant-primary);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 14px;
  align-items: start;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.module-row,
.timeline-row,
.integration-row,
.product-row,
.report-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.module-row:first-child,
.timeline-row:first-child,
.integration-row:first-child,
.product-row:first-child,
.report-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.module-row {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.module-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tenant-accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: max-content;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.badge.good {
  background: #dcfce7;
  color: #166534;
}

.badge.warn {
  background: #fef3c7;
  color: #92400e;
}

.badge.bad {
  background: #fee2e2;
  color: #991b1b;
}

.table-card {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td small {
  display: block;
  color: var(--muted);
}

.bar-list {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tenant-primary), var(--tenant-accent));
}

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

.field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #7b8798;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.check-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.check-option strong,
.check-option small {
  display: block;
}

.check-option small {
  margin-top: 3px;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(17, 24, 39, .94), rgba(15, 23, 42, .86)),
    linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.login-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .22);
}

.login-story {
  padding: 34px;
  background: #111827;
  color: #f8fafc;
}

.login-story h1 {
  max-width: 520px;
  margin: 12px 0;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-story p {
  max-width: 560px;
  color: #cbd5e1;
}

.login-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.login-proof div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
}

.login-proof strong,
.login-proof span {
  display: block;
}

.login-proof span {
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 12px;
}

.login-form {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 34px;
}

.login-form .button {
  width: 100%;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.company-select-page {
  min-height: 100vh;
  background: var(--bg);
}

.tenant-select-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 40px 24px;
}

.tenant-select-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.tenant-select-head > *,
.tenant-card > * {
  min-width: 0;
}

.tenant-select-head h1 {
  margin: 8px 0;
  font-size: 32px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tenant-select-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tenant-select-head .eyebrow {
  color: #187568;
  font-size: 11px;
}

.tenant-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.tenant-user-info {
  min-width: 0;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

.tenant-user-card span,
.tenant-user-card small {
  color: var(--muted);
  font-size: 12px;
}

.tenant-user-card strong {
  font-size: 14px;
  line-height: 1.4;
}

.tenant-user-card .button {
  background: var(--surface);
  font-size: 13px;
}

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

.tenant-card {
  display: grid;
  grid-template-rows: auto minmax(64px, auto) auto 1fr auto;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--tenant-accent);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 6px rgba(22, 32, 51, .04);
}

.tenant-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.tenant-card-top .brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--tenant-primary);
}

.tenant-card-top .badge {
  min-width: 0;
  max-width: 100%;
  width: auto;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: right;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.tenant-card h2 {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tenant-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tenant-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.tenant-stat {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  align-content: start;
}

.tenant-stat dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tenant-stat dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.tenant-stat-sales {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tenant-stat-sales dd {
  font-size: 26px;
  white-space: nowrap;
}

.tenant-card-stats:empty {
  display: none;
}

.tenant-modules,
.access-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tenant-modules span,
.access-summary span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.tenant-card .button {
  align-self: end;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.tenant-modules {
  align-content: start;
}

.tenant-modules span {
  max-width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tenant-card .button:hover {
  filter: brightness(.94);
}

.tenant-select-shell .button:focus-visible {
  outline: 3px solid var(--tenant-accent);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .tenant-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .tenant-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .tenant-card {
    padding: 18px;
    grid-template-rows: auto auto auto 1fr auto;
  }
}

.users-admin-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.access-grid {
  display: grid;
  gap: 10px;
}

.access-option {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--tenant-accent);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.access-company {
  display: grid;
  grid-template-columns: auto 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.access-company .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

.access-company strong,
.access-company small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-company small {
  margin-top: 2px;
  color: var(--muted);
}

.access-manage,
.inline-check {
  align-items: start;
}

.access-manage {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.role-list {
  display: grid;
}

.user-cell-avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--tenant-primary), var(--tenant-accent));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.pos-total {
  min-width: 128px;
  display: inline-flex;
  justify-content: flex-end;
  color: var(--tenant-primary);
  font-size: 22px;
}

.pos-lines {
  display: grid;
  gap: 8px;
}

.sales-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

[data-pos-form] {
  container-type: inline-size;
}

.sales-workspace > *,
.pos-line > * {
  min-width: 0;
}

.pos-line {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr) minmax(0, 1.2fr) 68px minmax(80px, .65fr);
  gap: 8px;
  align-items: center;
}

.pos-line-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pos-field { display: grid; min-width: 0; gap: 6px; }
.pos-field > span { display: none; color: var(--muted); font-size: 11px; font-weight: 700; }

.pos-line select,
.pos-line input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

@container (max-width: 660px) {
  .pos-lines .pos-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }
  .pos-lines .pos-line-head { display: none; }
  .pos-line .pos-detail-field { grid-column: 1 / -1; }
  .pos-field > span { display: block; }
}

@media (max-width: 1250px) {
  .sales-workspace { grid-template-columns: minmax(0, 1fr); }
}

.playroom-board {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.playroom-open-panel {
  border-top: 4px solid var(--tenant-accent);
}

.playroom-open-form {
  display: grid;
  gap: 12px;
}

.playroom-open-form .button {
  width: 100%;
}

.playroom-sessions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
  min-width: 0;
}

.play-session-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--tenant-primary);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .98)),
    #fff;
  box-shadow: var(--shadow);
}

.play-session-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.play-session-head h3 {
  min-width: 0;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  line-height: 1.18;
}

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

.play-timer div {
  min-width: 0;
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.play-timer span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.play-timer strong {
  min-width: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.08;
}

.play-timer div:last-child {
  border-color: var(--tenant-accent);
  background: #fffaf0;
  border-color: color-mix(in srgb, var(--tenant-accent) 38%, var(--line));
  background: color-mix(in srgb, var(--tenant-accent) 9%, #fff);
}

.play-timer div:last-child strong {
  color: var(--tenant-primary);
  font-size: 20px;
}

.play-consumption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.play-consumption span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.play-consumption.muted {
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.play-consume-form,
.play-close-form {
  display: grid;
  gap: 8px;
}

.play-consume-form {
  grid-template-columns: minmax(0, 1fr) 82px auto;
}

.play-close-form {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.play-consume-form select,
.play-consume-form input,
.play-close-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.closed-session-list {
  display: grid;
}

.closed-session-list .report-row {
  grid-template-columns: minmax(0, 1fr) minmax(180px, .6fr) auto;
  align-items: center;
}

.closed-session-list strong,
.closed-session-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.closed-session-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.receipt-page {
  min-height: 100vh;
  background: #eef2f7;
}

.receipt-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.receipt-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--tenant-primary);
}

.receipt-number {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.receipt-number span,
.receipt-meta span,
.receipt-foot span,
.receipt-totals span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-number strong {
  font-size: 28px;
  color: var(--tenant-primary);
}

.receipt-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.receipt-meta div,
.receipt-foot div {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.receipt-meta strong,
.receipt-foot strong {
  overflow-wrap: anywhere;
}

.receipt-table {
  min-width: 0;
}

.receipt-table th:last-child,
.receipt-table td:last-child {
  text-align: right;
}

.receipt-totals {
  width: min(360px, 100%);
  display: grid;
  gap: 8px;
  margin: 18px 0 0 auto;
}

.receipt-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-total {
  color: var(--tenant-primary);
  font-size: 20px;
}

.receipt-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.agenda-page {
  display: grid;
  gap: 14px;
}

.agenda-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.agenda-command h2 {
  margin: 4px 0 5px;
  font-size: 26px;
  line-height: 1.1;
}

.agenda-command span {
  color: var(--muted);
  font-size: 14px;
}

.agenda-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.metric.compact {
  min-height: 96px;
  padding: 14px;
  border-top-width: 3px;
  box-shadow: none;
}

.metric.compact strong {
  margin-top: 8px;
  font-size: 24px;
}

.metric.compact small {
  margin-top: 7px;
}

.agenda-layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.agenda-side {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
}

.agenda-filters {
  display: grid;
  gap: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented a {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.segmented a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(22, 32, 51, .08);
}

.agenda-side-block {
  display: grid;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.mini-stats {
  display: grid;
  gap: 8px;
}

.mini-stats span,
.legend-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mini-stats strong {
  color: var(--ink);
}

.legend-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4b6f8f;
}

.legend-dot.confirmed {
  background: #2f6f73;
}

.legend-dot.paid {
  background: var(--good);
}

.legend-dot.cancelled {
  background: var(--bad);
}

.agenda-board {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.agenda-head {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.agenda-time-head {
  min-height: 68px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.agenda-col-heads {
  display: grid;
  min-width: 0;
}

.agenda-col-head {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 10px;
  align-content: center;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.agenda-col-head:last-child {
  border-right: 0;
}

.agenda-col-head strong,
.agenda-col-head small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-col-head strong {
  align-self: end;
  font-size: 14px;
}

.agenda-col-head small {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.agenda-scroll {
  display: grid;
  grid-template-columns: 74px minmax(760px, 1fr);
  max-height: min(72vh, calc(var(--agenda-height) + 10px));
  overflow: auto;
  background:
    linear-gradient(#eef2f7 1px, transparent 1px) 74px 0 / calc(100% - 74px) 69px no-repeat,
    #fff;
}

.agenda-times {
  position: relative;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.agenda-times span {
  position: absolute;
  right: 10px;
  transform: translateY(-7px);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.agenda-grid {
  position: relative;
  display: grid;
  min-width: 0;
  background:
    repeating-linear-gradient(to bottom, #fff 0, #fff 33px, #f1f4f8 34px, #fff 35px);
}

.agenda-column {
  position: relative;
  min-width: 150px;
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(to bottom, rgba(47, 111, 115, .025) 0, rgba(47, 111, 115, .025) 68px, transparent 69px, transparent 138px);
}

.agenda-column:last-child {
  border-right: 0;
}

.slot-button {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.slot-button:hover,
.slot-button:focus-visible {
  outline: 2px solid rgba(184, 134, 47, .38);
  outline-offset: -2px;
  background: rgba(184, 134, 47, .08);
}

.appointment-card {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 3px;
  overflow: hidden;
  padding: 9px 10px 8px 12px;
  border: 1px solid rgba(22, 32, 51, .11);
  border-left: 4px solid var(--status-color);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 32, 51, .12);
  cursor: pointer;
}

.appointment-card:hover,
.appointment-card:focus-visible {
  outline: 2px solid rgba(47, 111, 115, .25);
  outline-offset: 1px;
  transform: translateY(-1px);
}

.appointment-card strong,
.appointment-card span,
.appointment-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-card strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.12;
}

.appointment-card span {
  color: var(--status-color);
  font-size: 12px;
  font-weight: 900;
}

.appointment-card small {
  color: var(--muted);
  font-size: 12px;
}

.appointment-card b {
  position: absolute;
  right: 7px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  line-height: 1.2;
}

.appointment-card.confirmed {
  background: #f8fffd;
}

.appointment-card.paid {
  background: #f7fff9;
}

.appointment-card.cancelled {
  opacity: .72;
  background: #fff7ed;
  text-decoration: line-through;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, .50);
}

.modal-backdrop[hidden] {
  display: none;
}

.agenda-modal {
  width: min(780px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 70px rgba(17, 24, 39, .30);
}

.agenda-modal.small {
  width: min(560px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.icon-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.modal-actions,
.status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 38px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.button.danger,
.button.subtle.danger {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

@media (max-width: 1120px) {
  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .playroom-board,
  .cols-3,
  .agenda-layout {
    grid-template-columns: 1fr;
  }

  .pos-line {
    grid-template-columns: minmax(180px, 1fr) 110px minmax(180px, 1fr);
  }

  .pos-line input[data-pos-quantity],
  .pos-line input[data-pos-price] {
    grid-column: span 1;
  }

  .agenda-side {
    position: static;
  }

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

@media (max-width: 780px) {
  .tenant-select-shell {
    padding: 24px 16px;
  }

  .tenant-select-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tenant-select-head h1 {
    font-size: 28px;
  }

  .tenant-user-card {
    padding-left: 0;
    border-left: 0;
    gap: 12px;
  }

  .pos-line,
  .playroom-sessions,
  .pos-line-head,
  .receipt-meta,
  .receipt-foot {
    grid-template-columns: 1fr;
  }

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

  .play-consume-form,
  .play-close-form,
  .closed-session-list .report-row {
    grid-template-columns: 1fr;
  }

  .pos-line-head {
    display: none;
  }

  .receipt-head {
    display: grid;
  }

  .receipt-number {
    justify-items: start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main {
    padding: 16px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .agenda-command {
    grid-template-columns: 1fr;
  }

  .agenda-toolbar {
    justify-content: flex-start;
  }

  .agenda-kpis {
    grid-template-columns: 1fr;
  }

  .agenda-head {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .agenda-time-head {
    min-height: 58px;
  }

  .agenda-col-head {
    min-height: 58px;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 8px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .agenda-scroll {
    grid-template-columns: 62px minmax(640px, 1fr);
    background:
      linear-gradient(#eef2f7 1px, transparent 1px) 62px 0 / calc(100% - 62px) 69px no-repeat,
      #fff;
  }

  .agenda-times span {
    right: 7px;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .icon-button {
    display: grid;
  }

  .cols-2,
  .cols-4,
  .form-grid,
  .login-shell,
  .login-proof {
    grid-template-columns: 1fr;
  }

  .login-story h1 {
    font-size: 32px;
  }

  .bar-row {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .bar-row strong:last-child {
    grid-column: 2;
  }
}

@media print {
  body,
  .receipt-page {
    background: #fff;
  }

  .receipt-shell {
    width: 100%;
    padding: 0;
  }

  .receipt-actions {
    display: none;
  }

  .receipt-card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .receipt-meta,
  .receipt-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-table {
    min-width: 0;
  }
}
