:root {
  color-scheme: light;
  --green: #225f45;
  --green-2: #34795b;
  --ink: #1e3028;
  --muted: #64736b;
  --line: #dfe7e2;
  --line-strong: #ccd9d1;
  --paper: #f7faf8;
  --surface: #ffffff;
  --surface-soft: #f4f8f6;
  --cream: #f8efd8;
  --red: #b64b4b;
  --amber: #b7791f;
  --blue: #286a91;
  --white: #fff;
  --shadow-soft: 0 1px 2px rgba(30, 48, 40, 0.04), 0 10px 30px rgba(30, 48, 40, 0.06);
  --shadow-lift: 0 10px 28px rgba(30, 48, 40, 0.12);
  --tap-highlight: rgba(34, 95, 69, 0.12);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --control-height: 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(52, 121, 91, 0.08), transparent 34vw),
    linear-gradient(180deg, #f7faf8 0%, #eef4f0 100%);
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
}

body.is-busy {
  cursor: progress;
}

.legal-page {
  padding: 32px 18px 64px;
}

.legal-document {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.legal-document header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.legal-document h1 {
  margin: 6px 0 10px;
  font-size: clamp(32px, 6vw, 48px);
}

.legal-document h2 {
  margin: 30px 0 10px;
  font-size: 21px;
}

.legal-document p,
.legal-document li {
  color: #374b42;
  line-height: 1.85;
}

.legal-document ul {
  padding-left: 1.4em;
}

.legal-document a {
  color: var(--green);
}

.legal-kicker {
  margin: 0;
  color: var(--green) !important;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.legal-back {
  display: inline-block;
  margin-bottom: 22px;
  font-weight: 800;
  text-decoration: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #edf3ef 0%, #f7efd9 100%);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(20px);
}

.login-copy h2 {
  margin: 6px 0 8px;
  font-size: 30px;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.role-card {
  height: auto;
  display: grid;
  gap: 6px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
}

.role-card.active {
  color: white;
  background: var(--green);
}

.role-card span {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.82;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0;
}

.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.login-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.login-actions button {
  background: var(--green);
  color: white;
}

.login-actions span {
  color: var(--muted);
  font-size: 13px;
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.legal-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
}

.legal-links a {
  color: var(--green);
  text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  text-decoration: underline;
}

.account-legal-links {
  justify-content: center;
  padding-top: 4px;
}

.site-compliance-footer {
  align-items: center;
  background: #f4f7f5;
  border-top: 1px solid #d7e3dc;
  color: #5d7067;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px 16px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  position: relative;
  text-align: center;
  z-index: 2;
}

.site-compliance-footer a {
  color: #245f46;
  font-weight: 700;
  text-decoration: none;
}

.site-compliance-footer a:hover,
.site-compliance-footer a:focus-visible {
  text-decoration: underline;
}

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

button {
  border: 0;
  border-radius: 7px;
  min-height: var(--control-height);
  padding: 0 14px;
  color: var(--ink);
  background: #e8f0eb;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition:
    transform 0.14s var(--ease-out),
    box-shadow 0.14s var(--ease-out),
    background-color 0.14s var(--ease-out),
    border-color 0.14s var(--ease-out),
    filter 0.14s var(--ease-out),
    opacity 0.14s var(--ease-out);
}

button:hover {
  filter: brightness(0.98);
  box-shadow: 0 1px 0 rgba(30, 48, 40, 0.04);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--tap-highlight), 0 0 0 1px var(--green-2);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
  transform: none;
}

button.is-pressing {
  transform: translateY(1px) scale(0.985);
  filter: brightness(0.94);
  opacity: 0.82;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  backdrop-filter: blur(24px);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(34, 95, 69, 0.2);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: var(--green);
  font-weight: 900;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.brand p,
.view-head p,
.kpi small {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.account-card span,
.account-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-card strong {
  font-size: 20px;
}

.account-card button {
  min-height: 32px;
  margin-top: 4px;
}

.account-card .install-help-entry {
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(35, 101, 75, 0.18);
}

.account-card .install-help-entry:hover {
  background: #1e5d43;
}

.account-card .install-help-entry + button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.runtime-source-warning {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(183, 121, 31, 0.36);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fff8e8;
}

.runtime-source-warning strong {
  color: var(--amber);
  font-size: 14px;
}

.runtime-source-warning small {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.runtime-source-warning a {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.store-switcher {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.store-switcher label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.store-switcher select {
  width: 100%;
  min-height: 38px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.store-switcher button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #f7fbf8;
  color: var(--green);
  font-weight: 900;
}

.qr {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  background: white;
}

.qr span {
  background: #dfe8e2;
}

.qr span:nth-child(1),
.qr span:nth-child(2),
.qr span:nth-child(3),
.qr span:nth-child(6),
.qr span:nth-child(8),
.qr span:nth-child(11),
.qr span:nth-child(12),
.qr span:nth-child(13),
.qr span:nth-child(15),
.qr span:nth-child(17),
.qr span:nth-child(19),
.qr span:nth-child(21),
.qr span:nth-child(22),
.qr span:nth-child(24),
.qr span:nth-child(25) {
  background: var(--green);
}

.nav-tabs {
  display: grid;
  gap: 7px;
}

.nav-tab {
  text-align: left;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.nav-tab:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav-tab.active {
  background: var(--green);
  color: white;
  box-shadow: 0 8px 20px rgba(34, 95, 69, 0.18);
}

.main {
  min-width: 0;
  padding: 24px;
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-enter 0.18s var(--ease-out);
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.view-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.secondary-action {
  color: var(--green);
  background: #e8f0eb;
}

.toolbar,
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar button:first-child,
#goStaff,
#resolveVisible,
#copyReport,
.form-actions button[type="submit"] {
  background: var(--green);
  color: white;
}

.link-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--green);
  background: transparent;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #e2d4a9;
  background: var(--cream);
  color: #725a1c;
  font-weight: 900;
}

.integration-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
}

.status-dot.is-on {
  background: var(--green);
}

.status-dot.is-warn {
  background: var(--amber);
}

.copy-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

.kpi-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi,
.report-card,
.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.kpi,
.report-card {
  padding: 16px;
  border-left: 5px solid var(--green);
}

.kpi.warn {
  border-left-color: var(--amber);
}

.kpi.danger {
  border-left-color: var(--red);
}

.kpi span,
.report-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi strong,
.report-card strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
}

.dashboard-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h3 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.manager-todo-panel {
  margin-bottom: 14px;
}

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

.manager-todo {
  min-height: 76px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 7px;
  background: #fffaf0;
}

.manager-todo.high {
  border-left-color: var(--red);
  background: #fff5f5;
}

.manager-todo.ok,
.manager-todo.low {
  border-left-color: var(--green);
  background: var(--paper);
}

.manager-todo > span {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.manager-todo.high > span {
  background: var(--red);
}

.manager-todo.medium > span {
  background: var(--amber);
}

.manager-todo strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.manager-todo p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.today-finance-panel {
  margin-bottom: 14px;
}

.finance-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.finance-range label {
  font-size: 12px;
}

.finance-range input {
  min-height: 36px;
  padding: 0 10px;
}

.today-finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

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

.finance-column.expense {
  background: #fffafa;
}

.finance-column-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.finance-column-head h4 {
  margin: 0;
  font-size: 16px;
}

.finance-column-head strong {
  color: var(--green);
  font-size: 22px;
}

.finance-column.expense .finance-column-head strong {
  color: var(--red);
}

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

.finance-line {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 6px;
  background: white;
  border: 1px solid #edf3ef;
}

.finance-line span {
  color: var(--muted);
  font-weight: 900;
}

.finance-line strong {
  color: var(--ink);
  font-size: 15px;
}

.finance-line small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.compact-expense {
  grid-template-columns: minmax(118px, 1fr) auto;
  gap: 4px 8px;
  padding: 6px 8px;
}

.compact-expense span,
.compact-expense small {
  font-size: 12px;
}

.compact-expense strong {
  font-size: 13px;
}

.finance-empty {
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
  background: white;
  border-radius: 6px;
}

.finance-sales-panel {
  margin-bottom: 14px;
}

.sales-head-tools {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.sales-time-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 8px;
}

.sales-time-filter label {
  font-size: 12px;
}

.sales-time-filter input {
  min-height: 34px;
  padding: 0 9px;
}

.compact-table {
  font-size: 12px;
}

.compact-table th,
.compact-table td {
  padding: 8px 7px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  transition:
    border-color 0.14s var(--ease-out),
    box-shadow 0.14s var(--ease-out),
    background-color 0.14s var(--ease-out);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(61, 123, 96, 0.14);
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attendance-panel {
  margin-bottom: 16px;
}

.attendance-code-board {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(48, 104, 78, 0.18);
  border-radius: 8px;
  background: #f5fbf7;
}

.attendance-code-board span,
.attendance-code-board small {
  display: block;
  color: var(--muted);
}

.attendance-code-board strong {
  display: block;
  margin: 4px 0;
  font-size: 34px;
  letter-spacing: 4px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.attendance-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.4fr 1.5fr auto auto auto;
  gap: 10px;
  align-items: end;
}

.attendance-grid button {
  min-height: 44px;
}

.attendance-check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.attendance-check input {
  width: auto;
}

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

.trust-score {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.trust-score.ok {
  color: #276a46;
  background: #e4f4ea;
}

.trust-score.warn {
  color: #8a5a16;
  background: #fff1d6;
}

.trust-score.bad {
  color: #9f3b3b;
  background: #fae4e4;
}

.wide {
  grid-column: span 3;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-self: end;
}

.ai-box {
  margin-top: 14px;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alerts {
  display: grid;
  gap: 10px;
}

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

.alert {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 7px;
  background: #fffaf0;
}

.alert.high {
  border-left-color: var(--red);
  background: #fff3f3;
}

.alert.ok {
  border-left-color: var(--green);
  background: var(--paper);
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

.alert p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.purchase-success-receipt li {
  margin: 7px 0;
}

.purchase-success-receipt [data-purchase-product-id] {
  min-height: 30px;
  margin-left: 8px;
  padding: 4px 9px;
}

#productRows tr.purchase-product-highlight td {
  background: #fff2b8;
  transition: background 0.3s ease;
}

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

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

.bar-list.large .bar-row {
  grid-template-columns: 128px minmax(0, 1fr) 110px;
}

.bar-track {
  height: 13px;
  border-radius: 3px;
  overflow: hidden;
  background: #edf3ef;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
}

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

.cash-trend-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.cash-trend-card-spend {
  background: #fffaf7;
}

.cash-trend-card[hidden] {
  display: none;
}

.mini-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.mini-panel-head h4 {
  margin: 0;
  font-size: 15px;
}

.mini-panel-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.daily-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  height: 190px;
  align-items: end;
}

.daily-bar {
  display: grid;
  gap: 6px;
  align-items: end;
  min-width: 0;
}

.daily-col {
  display: flex;
  align-items: end;
  height: 132px;
  background: #edf3ef;
  border-radius: 4px;
  overflow: hidden;
}

.daily-fill {
  width: 100%;
  min-height: 4px;
  background: var(--green-2);
}

.daily-fill.income {
  background: var(--green-2);
}

.daily-fill.spend {
  background: var(--amber);
}

.daily-bar span,
.daily-bar strong {
  text-align: center;
  font-size: 12px;
}

.daily-bar strong {
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

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

.product-table {
  min-width: 760px;
  table-layout: fixed;
}

.product-table-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.product-table-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-table-tools input,
.product-table-tools select {
  min-height: 40px;
}

#productFilterSummary {
  align-self: end;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: #f4faf6;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
  width: 30%;
}

.product-table th:nth-child(2),
.product-table td:nth-child(2),
.product-table th:nth-child(3),
.product-table td:nth-child(3),
.product-table th:nth-child(4),
.product-table td:nth-child(4),
.product-table th:nth-child(5),
.product-table td:nth-child(5) {
  width: 12%;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
  width: 22%;
}

.product-table input[type="number"] {
  max-width: 92px;
}

.product-health-panel {
  margin-bottom: 14px;
}

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

.product-health-card {
  min-height: 106px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 7px;
  background: #fbfcfb;
}

.product-health-card.warn {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.product-health-card.bad {
  border-left-color: var(--red);
  background: #fff5f5;
}

.product-health-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-health-card strong {
  font-size: 24px;
}

.product-health-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.margin-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 68px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #e8f0eb;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.margin-pill.good {
  background: #e8f5ed;
  color: var(--green);
}

.margin-pill.warn {
  background: #fff1cf;
  color: var(--amber);
}

.margin-pill.bad {
  background: #ffe1e1;
  color: var(--red);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

th {
  color: white;
  background: var(--green);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 900;
}

tbody tr {
  transition: background-color 0.14s var(--ease-out);
}

tbody tr:hover td {
  background: #f8fbf9;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  background: #edf3ef;
  color: var(--green);
  font-weight: 900;
}

.badge.warn {
  background: #fff1c8;
  color: #8a5a08;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions.compact {
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  color: white;
  background: var(--green-2);
}

.row-actions button.delete {
  background: var(--red);
}

.member-actions {
  display: grid;
  min-width: 240px;
  gap: 8px;
}

.member-recharge-box {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(108px, 0.75fr) auto;
  gap: 8px;
  align-items: center;
}

.member-refund-box {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(108px, 0.8fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.member-recharge-box input,
.member-recharge-box select,
.member-refund-box input,
.member-refund-box select {
  min-width: 0;
}

.member-recharge-box button {
  color: white;
  background: var(--amber);
}

.member-recharge-box button.success-button {
  background: var(--green);
  box-shadow: 0 10px 18px rgba(31, 105, 73, 0.18);
}

.member-refund-box button {
  color: white;
  background: var(--red);
}

.member-refund-box button.success-button {
  background: var(--green);
}

.member-recharge-hint {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.recharge-success {
  padding: 8px 10px;
  border: 1px solid #bdd8cb;
  border-radius: 7px;
  background: #edf8f2;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.recharge-success.is-visible {
  animation: successFlash 0.5s ease;
}

@keyframes successFlash {
  0% {
    transform: translateY(-2px);
    background: #d8f5e4;
  }
  100% {
    transform: translateY(0);
    background: #edf8f2;
  }
}

.member-balance-display,
.member-points-display {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  color: var(--green);
  font-size: 17px;
  font-weight: 900;
}

.member-points-display {
  color: #b7791f;
}

.member-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.member-toolbar label {
  max-width: 360px;
  flex: 1;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.member-ledger-row td {
  background: #fbfdfb;
}

.member-ledger {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.member-ledger-title {
  color: var(--green);
  font-weight: 900;
}

.member-ledger-empty {
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.report-text {
  min-height: 150px;
  margin: 0;
  padding: 14px;
  border-radius: 6px;
  background: #f8faf8;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: inherit;
}

.ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ai-model-panel {
  margin-bottom: 14px;
}

.ai-model-status {
  display: grid;
  grid-template-columns: auto minmax(180px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.ai-model-status strong {
  font-size: 16px;
}

.ai-model-status small {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.ai-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.ai-briefing-panel {
  margin-bottom: 14px;
}

.ai-patrol-panel {
  margin-bottom: 14px;
}

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

.ai-patrol-card {
  min-height: 148px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 7px;
  background: #f9fbfa;
}

.ai-patrol-card.high {
  border-color: #efb9b9;
  border-left-color: var(--red);
  background: #fff6f6;
}

.ai-patrol-card.medium {
  border-color: #ead28a;
  border-left-color: #d19a28;
  background: #fffaf0;
}

.ai-patrol-card.low {
  border-color: #cfe2d8;
  border-left-color: #4b86c5;
  background: #f7fbff;
}

.ai-patrol-card.ok {
  border-color: #cfe2d8;
  background: #f4fbf7;
}

.ai-patrol-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-patrol-card-head span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.ai-patrol-card.high .ai-patrol-card-head span {
  background: var(--red);
}

.ai-patrol-card.medium .ai-patrol-card-head span {
  background: #d19a28;
}

.ai-patrol-card.low .ai-patrol-card-head span {
  background: #4b86c5;
}

.ai-patrol-card-head strong {
  min-width: 0;
  font-size: 17px;
}

.ai-patrol-card p {
  min-height: 44px;
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.55;
}

.ai-patrol-card div:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.ai-briefing-panel .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ai-briefing-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 7px;
  border: 1px solid #cfe2d8;
  background: linear-gradient(135deg, #eef8f3, #fffaf0);
}

.ai-score-ring {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 8px solid #2f7b5a;
  background: white;
  box-shadow: inset 0 0 0 1px #e3eee8;
}

.ai-score-ring span {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.ai-score-ring small {
  font-size: 11px;
  color: var(--muted);
}

.ai-briefing-hero strong {
  display: block;
  font-size: 22px;
  line-height: 1.25;
}

.ai-briefing-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.ai-briefing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(280px, 1.2fr);
  gap: 12px;
}

.ai-briefing-grid h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.ai-card-list,
.ai-question-list {
  display: grid;
  gap: 8px;
}

.ai-mini-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfa;
  line-height: 1.55;
}

.ai-mini-card strong {
  display: block;
}

.ai-mini-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.ai-mini-card span {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.ai-mini-card.action span:first-child {
  background: var(--red);
}

.ai-mini-card.risk.high {
  border-color: #efb9b9;
  background: #fff5f5;
}

.ai-mini-card.risk.medium {
  border-color: #ead28a;
  background: #fff9e8;
}

.ai-question-list button {
  justify-content: flex-start;
  min-height: 38px;
  text-align: left;
  color: var(--green);
  background: white;
  border: 1px solid var(--line);
}

.ai-inline-question {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.ai-workbench-single {
  grid-template-columns: 1fr;
}

.ai-result,
.ai-answer {
  min-height: 120px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf8;
  white-space: pre-wrap;
  line-height: 1.7;
}

.ai-result {
  padding: 0;
  border: 0;
  background: transparent;
}

.ai-question-answer {
  min-height: 96px;
  margin-top: 10px;
}

.ai-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffaf0;
}

.ai-summary button {
  color: white;
  background: var(--green);
}

.shift-audit-panel {
  margin-top: 14px;
}

.shift-audit-form {
  display: grid;
  gap: 12px;
}

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

.shift-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.shift-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.shift-checklist input {
  width: auto;
  min-height: auto;
}

.shift-stock-check {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7c391;
  border-radius: 8px;
  background: #fffaf0;
}

.shift-stock-head,
.shift-stock-empty {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.shift-stock-head strong,
.shift-stock-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.shift-stock-head span,
.shift-stock-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shift-stock-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.shift-stock-list span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 12px;
  font-weight: 900;
}

.shift-stock-list span.low {
  border-color: #e2b0b0;
  background: #fff3f3;
  color: var(--red);
}

.shift-audit-result,
.shift-audit-owner {
  margin-top: 12px;
}

.shift-audit-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.shift-audit-card.high {
  border-color: #e19a9a;
  background: #fff4f4;
}

.shift-audit-card.medium {
  border-color: #e0c273;
  background: #fffaf0;
}

.shift-audit-card.low {
  border-color: #a5c8b0;
  background: #f5fbf7;
}

.shift-audit-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.shift-audit-card-head div {
  display: grid;
  gap: 4px;
}

.shift-audit-card-head strong {
  font-size: 16px;
}

.shift-audit-card-head span,
.shift-audit-card-head small {
  color: var(--muted);
  font-weight: 800;
}

.shift-audit-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shift-ai-insight {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bdd8cb;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef8f3, #fffaf0);
}

.shift-ai-insight.loading {
  background: #f8faf8;
}

.shift-ai-insight > strong {
  color: var(--green);
  font-size: 17px;
}

.shift-ai-insight p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.6;
}

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

.shift-ai-columns div {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
}

.shift-ai-columns span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shift-ai-columns em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
  line-height: 1.55;
}

.shift-audit-metrics div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.shift-audit-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shift-audit-metrics strong {
  color: var(--green);
  font-size: 18px;
}

.shift-audit-reasons {
  display: grid;
  gap: 6px;
}

.shift-audit-reasons div {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 800;
}

.shift-audit-history {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.shift-audit-history div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

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

.settings-grid .room-settings-panel {
  grid-column: 1 / -1;
}

.panel-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.bulk-billing-tool {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(120px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.bulk-billing-tool button {
  color: white;
  background: var(--green);
}

.rule-summary {
  padding: 10px 12px;
  border: 1px solid #cfe1d5;
  border-radius: 8px;
  background: #eef7f1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.ai-stock-panel {
  margin-bottom: 14px;
}

.ai-stock-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.ai-stock-grid button,
.ai-stock-result .form-actions button:first-child {
  color: white;
  background: var(--green);
}

.ai-stock-result {
  display: grid;
  gap: 12px;
}

.ai-stock-result table {
  min-width: 980px;
}

.room-settings-table {
  min-width: 1380px;
}

.room-settings-table th:nth-child(1),
.room-settings-table th:nth-child(2) {
  width: 18%;
}

.room-settings-table th:nth-child(3) {
  width: 12%;
}

.room-settings-table th:nth-child(n + 4):nth-child(-n + 8) {
  width: 10%;
}

.room-settings-table th:nth-child(9),
.room-settings-table td:nth-child(9) {
  width: 10%;
}

.room-settings-table th:nth-child(10),
.room-settings-table td:nth-child(10) {
  width: 18%;
  min-width: 260px;
}

.room-settings-table .room-switch-channel-input {
  min-width: 240px;
  width: 100%;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background: #fff;
  caret-color: var(--green);
  font-weight: 800;
  text-align: left;
  opacity: 1;
}

.switch-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 76px;
  font-weight: 800;
  color: var(--green);
}

.room-settings-table tr.row-highlight td {
  background: #fff7d9;
  transition: background 0.25s ease;
}

.room-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.room-type-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.room-type-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.room-type-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.room-type-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.room-card-shell {
  position: relative;
  min-width: 0;
}

.standalone-sale-panel {
  margin-bottom: 14px;
}

.standalone-sale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  align-items: end;
}

.standalone-sale-grid button {
  color: white;
  background: var(--green-2);
}

.standalone-sale-cart {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.standalone-sale-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  font-size: 14px;
}

.standalone-sale-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.standalone-sale-item button {
  min-height: 30px;
  padding: 0 10px;
}

.standalone-sale-item button.danger {
  color: var(--red);
  background: #fff1f1;
}

.coupon-panel {
  margin-bottom: 14px;
}

.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.coupon-grid button {
  color: white;
  background: var(--green);
}

.coupon-ai-result {
  margin-top: 10px;
}

.coupon-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.coupon-list-head,
.coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.coupon-list-head {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #eef6f1;
  font-weight: 900;
}

.coupon-row strong,
.coupon-row small {
  display: block;
}

.coupon-row small,
.coupon-list-head small {
  color: var(--muted);
}

.coupon-row > span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: #e6f2eb;
  font-size: 13px;
  font-weight: 900;
}

.coupon-row.void {
  opacity: 0.6;
  background: #fafafa;
}

.room-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 104px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.14s var(--ease-out),
    box-shadow 0.14s var(--ease-out),
    border-color 0.14s var(--ease-out);
}

button.room-card {
  min-height: 104px;
  background: rgba(255, 255, 255, 0.98);
}

.room-quick-checkout {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 10px 20px rgba(23, 98, 63, 0.18);
  cursor: pointer;
}

.room-quick-checkout:hover {
  transform: translateY(-1px);
}

.room-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
  filter: none;
}

.room-card.busy {
  background: #fffaf0;
}

.room-card.cleaning {
  background: #fff3f3;
}

.room-card.reserved {
  background: #f1f7ff;
}

.room-card.selected {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.reservation-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #bfd7ef;
  border-radius: 8px;
  background: #eaf4ff;
  color: #23496d;
}

.reservation-note strong {
  font-size: 14px;
}

.reservation-note span {
  font-size: 13px;
}

.room-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--green);
  color: white;
}

.room-card-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.room-card-head .badge {
  flex-shrink: 0;
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card.busy .room-card-head {
  background: var(--amber);
}

.room-card.cleaning .room-card-head {
  background: var(--red);
}

.room-card.reserved .room-card-head {
  background: #2f7fbf;
}

.room-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.room-summary {
  display: grid;
  gap: 6px;
  padding: 2px 10px 10px;
  font-size: 12px;
  color: var(--muted);
}

.room-summary span {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
}

.room-summary em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.room-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-summary-reservation {
  display: block !important;
  color: #24557e;
  line-height: 1.45;
}

.danger-text {
  color: var(--red) !important;
  font-weight: 900;
}

.room-detail-panel {
  margin-bottom: 14px;
}

.room-detail-panel:empty {
  display: none;
}

.room-detail-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfb;
}

.room-detail-card {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
}

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

.room-detail-head h3 {
  margin: 0;
}

.room-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.room-detail-stats div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.room-detail-stats span {
  color: var(--muted);
  font-size: 12px;
}

.room-detail-stats strong {
  font-size: 20px;
}

.room-detail-top-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  margin-top: 10px;
}

.room-detail-top-actions .checkout-action {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, #17623f, #2f7d59);
  box-shadow: 0 12px 24px rgba(23, 98, 63, 0.16);
}

.room-detail-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.room-detail-section h4 {
  margin: 0;
}

.room-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 30, 24, 0.42);
  overflow: hidden;
}

.room-detail-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: min(860px, calc(100dvh - 36px));
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 90px rgba(18, 30, 24, 0.28);
}

.room-detail-modal-head {
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.room-detail-modal-head h2 {
  margin: 0 0 4px;
}

.room-detail-modal-head p {
  margin: 0;
  color: var(--muted);
}

.room-detail-modal-head button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 26px;
  color: var(--green);
  background: #f1f5f2;
}

.room-detail-modal-body {
  min-height: 0;
  padding: 18px 20px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.room-detail-modal-body .room-detail-card {
  margin: 0;
  min-width: 0;
  box-shadow: none;
}

.detail-meta {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.smart-switch-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: #edf5f0;
  color: var(--muted);
}

.smart-switch-status.on,
.room-summary-switch.on {
  color: #12613c;
  background: #e2f4ea;
}

.smart-switch-status.off,
.room-summary-switch.off {
  color: #5e6c66;
  background: #eef2f0;
}

.smart-switch-status.error,
.room-summary-switch.error {
  color: #9b2f2f;
  background: #fdecec;
}

.smart-switch-status.pending,
.room-summary-switch.pending {
  color: #9a6500;
  background: #fff4d9;
}

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

.smart-switch-panel > div:first-child {
  display: grid;
  gap: 3px;
}

.smart-switch-panel span,
.smart-switch-panel small {
  color: var(--muted);
  font-size: 13px;
}

.smart-switch-actions {
  display: inline-flex;
  gap: 8px;
}

.smart-switch-actions button:first-child {
  color: white;
  background: var(--green);
}

.smart-switch-actions button:last-child {
  color: var(--green);
  background: #e8f1ec;
}

.smart-switch-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.smart-switch-guide {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
  color: var(--ink);
}

.smart-switch-guide strong {
  font-size: 15px;
}

.smart-switch-guide ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.smart-switch-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.smart-switch-controls button:first-child,
.room-settings-panel [data-action="bind-room-switch"],
.room-settings-panel [data-action="test-room-switch-on"] {
  color: #fff;
  background: var(--green);
}

.smart-switch-config-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #d6e4dc;
  border-radius: 8px;
  background: #f2f8f4;
  color: #284339;
  line-height: 1.5;
}

.muted-list {
  color: var(--muted);
}

.single-action {
  grid-template-columns: minmax(0, 220px);
}

.transfer-room-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.transfer-room-form button {
  color: white;
  background: var(--blue);
}

.transfer-room-form button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.overview-revenue-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  margin: 14px 0;
}

.revenue-kpi {
  max-width: none;
}

.expected-revenue-kpi {
  border-left-color: var(--amber);
}

.expected-revenue-kpi strong {
  color: var(--amber);
}

.sync-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.sync-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-status strong {
  color: var(--green);
  font-size: 13px;
  line-height: 1.25;
}

.sync-status strong[data-state="busy"] {
  color: var(--amber);
}

.sync-status strong[data-state="warn"],
.sync-status strong[data-state="offline"] {
  color: var(--red);
}

.audit-log-panel {
  margin: 14px 0;
}

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

.audit-log-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.audit-log-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.audit-log-row strong {
  color: var(--text);
  font-size: 14px;
}

.audit-log-row span,
.audit-log-row small {
  color: var(--muted);
  font-size: 12px;
}

.pause-room-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.pause-room-form .pause-status {
  color: var(--muted);
  font-size: 13px;
}

.pause-duration-select {
  min-width: 132px;
  min-height: 40px;
}

.pause-room-form button {
  color: white;
  background: var(--blue);
}

.pause-room-form.is-paused button {
  background: var(--green);
}

.package-reminder-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.package-reminder-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.package-reminder-form button {
  color: white;
  background: var(--green-2);
}

.package-reminder-form.is-due {
  border-color: rgba(179, 72, 72, 0.35);
  background: #fff4f4;
}

.package-reminder-form.is-due span {
  color: var(--red);
}

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

.room-actions button.primary {
  color: white;
  background: var(--green);
}

.room-actions button.warn {
  color: white;
  background: var(--amber);
}

.room-actions button.checkout-action {
  color: white;
  background: var(--amber);
}

.room-order-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #f0dfb7;
  border-radius: 8px;
  background: #fffdf7;
}

.room-order-list strong {
  font-size: 13px;
}

.room-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.room-order-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.room-order-item button,
.room-order-item-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.room-order-item button.danger,
.room-order-item-actions button.danger {
  color: var(--red);
  background: #fff1f1;
}

.room-order-item .order-cancel-confirm {
  grid-column: 1 / -1;
}

.room-service-form {
  grid-template-columns: minmax(110px, 0.9fr) minmax(90px, 0.7fr) 74px minmax(140px, 1.2fr) auto auto;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.ledger-total {
  display: grid;
  gap: 2px;
}

.ledger-total small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.room-product-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.72fr);
  gap: 12px;
  min-height: 0;
  max-height: min(420px, 46vh);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.room-product-left,
.room-product-right {
  min-width: 0;
  display: grid;
  min-height: 0;
  align-content: start;
}

.room-product-left {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
}

.room-product-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 10px 0;
}

.room-product-tabs button {
  min-height: 32px;
  padding: 0 10px;
  color: white;
  background: var(--green);
}

.room-product-tabs button.ghost {
  color: var(--muted);
  background: #eef4f0;
}

.room-product-filters {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.room-product-summary {
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.room-product-list {
  display: grid;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.room-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

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

.room-product-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.room-product-row-actions {
  display: grid;
  grid-template-columns: 58px auto;
  gap: 6px;
  align-items: center;
}

.room-product-row-actions input {
  min-height: 32px;
  padding: 4px 6px;
}

.room-product-row-actions button {
  min-height: 32px;
  color: white;
  background: var(--green-2);
}

.room-product-right {
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px;
  background: #fffdf7;
}

.room-product-right-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.room-product-selected {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  margin-top: 10px;
}

.room-product-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.room-product-selected-row strong,
.room-product-selected-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-product-selected-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.room-product-selected-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.room-product-selected-controls label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.room-product-selected-controls input {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 13px;
}

.room-product-selected-controls button {
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.order-cancel-confirm {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid #f0d0d0;
  border-radius: 8px;
  background: #fff7f7;
}

.order-cancel-confirm input {
  min-height: 30px;
  padding: 4px 6px;
}

.order-cancel-confirm button {
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
}

.selected-empty {
  display: grid;
  min-height: 140px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.room-product-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-weight: 800;
}

.mini-form button {
  color: white;
  background: var(--green-2);
}

.mini-form button.reserve {
  background: #3f7fbf;
}

.billing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.cash-topup-box {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cash-topup-box h4 {
  margin: 0;
}

.cash-topup-form {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: 8px;
}

.cash-topup-form button {
  color: white;
  background: var(--green-2);
}

.cash-topup-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}

.cash-topup-head span {
  color: var(--green);
  font-weight: 900;
}

.data-safety-panel {
  align-content: start;
}

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

.data-safety-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.data-safety-card span,
.data-safety-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.data-safety-card strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 21px;
}

.data-safety-card.ok {
  border-left: 5px solid var(--green);
}

.data-safety-card.warn {
  border-left: 5px solid var(--amber);
}

.data-safety-card.danger {
  border-left: 5px solid var(--red);
}

.data-safety-actions {
  display: flex;
  gap: 10px;
}

.data-safety-actions button,
.data-safety-panel .panel-head button {
  color: white;
  background: var(--green-2);
}

.data-backup-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.data-backup-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 70px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  font-size: 13px;
}

.data-backup-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-backup-row span,
.data-backup-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.data-safety-error,
.empty-state {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 800;
}

.data-safety-error {
  border-color: rgba(184, 77, 77, 0.25);
  background: #fff2f1;
  color: var(--red);
}

.data-safety-error strong,
.data-safety-error span {
  display: block;
}

.data-safety-error span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.compact-table table {
  min-width: 620px;
}

.price-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.price-card.active {
  border-color: var(--green);
  box-shadow: inset 0 4px 0 var(--green);
}

.price-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.price-card h3 {
  margin: 10px 0;
  font-size: 28px;
}

.price-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.billing-settings {
  margin-bottom: 0;
}

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

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

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

.mini-empty {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf8;
  color: var(--muted);
}

.reservation-message-panel {
  display: grid;
  gap: 10px;
}

body.staff-mode .owner-only,
body.staff-mode .nav-tab:not([data-target="staff-view"]) {
  display: none;
}

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

body.staff-mode .sidebar {
  position: static;
  height: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 30, 24, 0.42);
  overflow: hidden;
}

.checkout-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: min(860px, calc(100dvh - 36px));
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 90px rgba(18, 30, 24, 0.28);
}

.checkout-head {
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.checkout-head h2 {
  margin: 0 0 4px;
}

.checkout-head p {
  margin: 0;
  color: var(--muted);
}

.checkout-head button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 26px;
  background: #f1f5f2;
}

.checkout-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  min-height: 0;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.checkout-left,
.checkout-right {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.checkout-total {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid #e5d6b2;
  border-radius: 8px;
  background: #fff9e9;
}

.checkout-total span {
  color: var(--muted);
  font-weight: 800;
}

.checkout-total strong {
  color: var(--red);
  font-size: 34px;
}

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

.checkout-lines div,
.member-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.checkout-estimate {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe1d7;
  border-radius: 8px;
  background: #f5fbf7;
}

.checkout-estimate .section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkout-estimate h3 {
  margin: 0;
  font-size: 16px;
}

.checkout-estimate small {
  color: var(--muted);
  font-weight: 800;
}

.estimate-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.estimate-inputs label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.estimate-result div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.estimate-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.estimate-result strong {
  color: var(--ink);
  font-size: 17px;
}

.checkout-payment-tool {
  display: grid;
  gap: 8px;
}

.hidden-control {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.member-suggestions {
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.member-suggestion {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: white;
  text-align: left;
}

.member-suggestion.selected {
  border-color: var(--green);
  background: #eaf6ef;
}

.member-suggestion span {
  font-weight: 900;
}

.member-suggestion small,
.member-suggestion-empty {
  color: var(--muted);
  font-size: 12px;
}

.member-suggestion-empty {
  padding: 10px;
}

#checkoutPaymentRows {
  display: grid;
  gap: 8px;
}

.checkout-payment-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
}

.checkout-payment-row button {
  min-height: 38px;
  padding: 0 10px;
}

#addCheckoutPayment {
  color: white;
  background: var(--green-2);
}

.receipt-print-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe1d7;
  border-radius: 8px;
  background: #f4fbf7;
}

.receipt-print-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.receipt-print-head > div {
  display: grid;
  gap: 3px;
}

.receipt-print-head strong {
  color: var(--ink);
  font-size: 15px;
}

.receipt-print-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receipt-print-head button {
  min-height: 38px;
  padding: 0 12px;
  color: white;
  background: var(--green);
  white-space: nowrap;
}

.receipt-toggle {
  min-height: 32px;
  color: var(--ink);
}

.inline-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: auto;
  font-weight: 900;
}

.inline-toggle input {
  width: auto;
}

.recharge-rules-panel button {
  margin-top: 10px;
}

.checkout-recharge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.55fr) minmax(110px, 0.6fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5d6b2;
  border-radius: 8px;
  background: #fff9e9;
}

.checkout-recharge div {
  display: grid;
  gap: 2px;
}

.checkout-recharge span {
  color: var(--muted);
  font-size: 12px;
}

.checkout-recharge button {
  color: white;
  background: var(--amber);
}

.recharge-gift-hint {
  grid-column: 1 / -1;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.checkout-products {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
}

.checkout-products h3 {
  margin: 0;
}

.checkout-products table {
  width: 100%;
  min-width: 0;
}

.checkout-reversal-note {
  padding: 12px;
  border: 1px solid rgba(185, 117, 18, 0.24);
  border-radius: 10px;
  color: #71470b;
  background: #fff7e6;
  font-size: 13px;
  line-height: 1.6;
}

.checkout-right .form-actions button:first-child {
  color: white;
  background: var(--green);
}

.checkout-right .form-actions button.checkout-action {
  color: white;
  background: var(--amber);
}

.checkout-warn {
  min-height: 20px;
  color: var(--red);
  font-weight: 800;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
}

.pager span {
  color: var(--muted);
  font-size: 13px;
}

.pager button {
  min-height: 32px;
  padding: 0 12px;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.package-alarm-panel {
  position: fixed;
  right: 20px;
  bottom: 78px;
  z-index: 60;
  width: min(430px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid rgba(185, 117, 18, 0.26);
  border-left: 5px solid var(--amber);
  border-radius: 10px;
  background: #fffaf1;
  box-shadow: 0 18px 50px rgba(31, 48, 40, 0.2);
}

.package-alarm-panel.hidden {
  display: none;
}

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

.package-alarm-head strong,
.package-alarm-head span {
  display: block;
}

.package-alarm-head strong {
  color: #7a4b08;
  font-size: 16px;
}

.package-alarm-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.package-alarm-head button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  color: #7a4b08;
  background: rgba(185, 117, 18, 0.12);
}

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

.package-alarm-item {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(185, 117, 18, 0.16);
  border-radius: 8px;
  background: white;
}

.package-alarm-item b,
.package-alarm-item small {
  display: block;
}

.package-alarm-item b {
  color: var(--ink);
  font-size: 15px;
}

.package-alarm-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.package-alarm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.package-alarm-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.package-alarm-actions button:first-child {
  color: white;
  background: var(--green);
}

.install-banner {
  position: fixed;
  left: auto;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  max-width: 360px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: white;
  background: #1f3028;
  box-shadow: 0 18px 50px rgba(31, 48, 40, 0.26);
  pointer-events: none;
}

.install-banner strong,
.install-banner span {
  display: block;
}

.install-banner span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.install-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  pointer-events: auto;
}

.install-actions button:first-child {
  color: var(--ink);
  background: white;
}

.install-actions button:last-child {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.update-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  width: min(620px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  color: white;
  background: #173d2d;
  box-shadow: 0 20px 60px rgba(20, 32, 27, 0.28);
  transform: translateX(-50%);
}

.update-banner strong,
.update-banner span {
  display: block;
}

.update-banner span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.update-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.update-actions button:first-child {
  color: var(--ink);
  background: white;
}

.update-actions button:last-child {
  color: white;
  background: rgba(255, 255, 255, 0.14);
}

.install-help-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 32, 27, 0.38);
}

.install-help-card {
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(20, 32, 27, 0.22);
}

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

.install-help-head strong {
  display: block;
  font-size: 22px;
}

.install-help-head span,
.install-help-tip {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.install-help-head button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-soft);
}

.install-help-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
  font-weight: 800;
  line-height: 1.6;
}

.install-copy-link {
  width: 100%;
  margin-top: 18px;
  color: white;
  background: var(--green);
}

.install-help-card > button:last-child {
  width: 100%;
  margin-top: 10px;
  color: var(--green);
  background: var(--surface-soft);
}

.renew-license-entry {
  min-height: 38px;
  border: 1px solid rgba(34, 95, 69, 0.18);
  border-radius: 7px;
  background: #e8f2ed;
  color: var(--green);
  font-weight: 900;
}

body.license-expired .renew-license-entry,
.license-panel .primary-action {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.license-panel {
  border-left: 4px solid var(--green);
}

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

.license-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fbfdfb;
}

.license-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.license-metric strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.license-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8f2ed;
  color: var(--green);
  font-weight: 900;
}

.license-status-pill.expired {
  background: #fff1f1;
  color: var(--red);
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.license-actions button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 900;
}

.renew-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 35, 27, 0.42);
}

.renew-modal.hidden {
  display: none;
}

.renew-card {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(18, 35, 27, 0.22);
}

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

.renew-head h3 {
  margin: 0 0 4px;
}

.renew-head p {
  margin: 0;
  color: var(--muted);
}

.renew-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 22px;
  line-height: 1;
}

.renew-body {
  padding: 18px 20px 20px;
}

.renew-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.renew-price {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: #fbfdfb;
}

.renew-price span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.renew-price strong {
  color: var(--green);
  font-size: 26px;
}

.renew-copy-box {
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf8;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}

.renew-body .primary-action {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: white;
  font-weight: 900;
}

body.license-expired .main {
  box-shadow: inset 0 4px 0 rgba(182, 75, 75, 0.18);
}

/* Formal product polish: calmer chrome, clearer hierarchy, and denser operator screens. */
:root {
  --green: #17623f;
  --green-2: #2f7d59;
  --ink: #16261f;
  --muted: #68776f;
  --line: #e3ebe6;
  --line-strong: #c9d8cf;
  --paper: #f3f7f4;
  --surface-soft: #f7faf8;
  --cream: #fff4da;
  --red: #b84b4f;
  --amber: #b97818;
  --blue: #2d6f92;
  --shadow-soft: 0 1px 2px rgba(19, 39, 30, 0.04), 0 14px 36px rgba(19, 39, 30, 0.07);
  --shadow-lift: 0 14px 34px rgba(19, 39, 30, 0.13);
}

body {
  background:
    radial-gradient(circle at 10% -8%, rgba(47, 125, 89, 0.12), transparent 30vw),
    linear-gradient(180deg, #f8fbf9 0%, #eef5f1 100%);
}

button {
  border-radius: 10px;
  letter-spacing: 0;
}

input,
select,
textarea {
  border-color: #d9e5de;
  border-radius: 10px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(23, 98, 63, 0.58);
  box-shadow: 0 0 0 3px rgba(23, 98, 63, 0.1);
}

.app-shell {
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  gap: 14px;
  padding: 18px;
  background: rgba(250, 252, 250, 0.94);
}

.brand-mark {
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(23, 98, 63, 0.2);
}

.brand h1 {
  font-size: 17px;
  line-height: 1.25;
}

.account-card,
.store-switcher {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.nav-tabs {
  gap: 5px;
}

.nav-tab {
  min-height: 42px;
  border-radius: 11px;
  color: #52645a;
  font-size: 14px;
  font-weight: 900;
}

.nav-tab.active {
  background: linear-gradient(135deg, #17623f, #26754f);
  box-shadow: 0 10px 24px rgba(23, 98, 63, 0.18);
}

.main {
  padding: 22px 26px;
}

.view-head {
  padding: 2px 2px 8px;
}

.view-head h2 {
  font-size: 30px;
  line-height: 1.18;
}

.kpi,
.report-card,
.panel,
.room-type-group,
.room-detail-dialog,
.checkout-dialog {
  border-radius: 16px;
}

.panel,
.kpi,
.report-card {
  border-color: rgba(201, 216, 207, 0.88);
}

.panel {
  padding: 18px;
}

.panel-head h3,
.panel h3 {
  letter-spacing: 0;
}

.kpi,
.report-card {
  border-left-width: 4px;
  padding: 15px 16px;
}

.kpi strong,
.report-card strong {
  font-size: 25px;
  line-height: 1.15;
}

.today-finance-grid,
.dashboard-grid,
.settings-grid,
.billing-grid {
  gap: 16px;
}

th {
  background: #1e6a49;
}

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

.room-type-group {
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.room-type-title h3 {
  font-size: 18px;
}

.room-type-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.room-card,
button.room-card {
  min-height: 118px;
  border-radius: 14px;
}

.room-card {
  border: 1px solid rgba(208, 221, 213, 0.9);
  box-shadow: 0 10px 22px rgba(19, 39, 30, 0.06);
}

.room-card:hover {
  transform: translateY(-2px);
}

.room-card-head {
  min-height: 48px;
  padding: 9px 12px;
}

.room-card-head .badge {
  max-width: 82px;
  border-radius: 9px;
  color: #5a3c07;
  background: rgba(255, 250, 226, 0.95);
}

.room-card h3 {
  font-size: 17px;
}

.room-summary {
  gap: 7px;
  padding: 8px 12px 12px;
}

.room-summary span {
  grid-template-columns: 64px minmax(0, 1fr);
}

.room-summary strong {
  font-size: 18px;
}

.room-detail-dialog,
.checkout-dialog {
  overflow: hidden;
  min-width: 0;
}

.room-detail-modal-body,
.checkout-body {
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.room-detail-modal-head,
.checkout-head {
  padding: 16px 18px;
}

.room-actions {
  gap: 10px;
}

.room-actions button.primary,
.checkout-right .form-actions button:first-child,
.checkout-right .form-actions button.checkout-action,
.room-actions button.checkout-action {
  background: linear-gradient(135deg, #17623f, #2f7d59);
  box-shadow: 0 10px 20px rgba(23, 98, 63, 0.16);
}

.room-actions button.warn {
  background: linear-gradient(135deg, #a46612, #c58b27);
}

.room-product-picker {
  border-radius: 14px;
}

.room-product-tabs button {
  border-radius: 9px;
}

.room-product-row,
.room-product-selected-row,
.standalone-sale-item,
.coupon-row,
.audit-log-row,
.checkout-lines div,
.member-info {
  border-radius: 11px;
}

.room-product-row-actions input {
  text-align: center;
}

.checkout-total {
  border-radius: 14px;
}

.checkout-total strong {
  font-size: 36px;
}

.member-suggestion,
.member-suggestions,
.receipt-print-panel,
.checkout-recharge,
.checkout-estimate,
.checkout-reversal-note {
  border-radius: 12px;
}

.product-health-card {
  border-radius: 13px;
}

.margin-pill,
.badge,
.smart-switch-status,
.room-summary-switch {
  border-radius: 999px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .nav-tab {
    text-align: center;
  }

  .kpi-grid,
  .report-grid,
  .kpi-grid.compact,
  .dashboard-grid,
  .today-finance-grid,
  .finance-range,
  .sales-time-filter,
  .settings-grid,
  .billing-grid,
  .ai-kpi-grid,
  .ai-patrol-list,
  .ai-briefing-grid,
  .ai-workbench,
  .shift-audit-grid,
  .shift-checklist,
  .shift-audit-metrics,
  .shift-ai-columns,
  .billing-rule-grid,
  .settings-mini-grid,
  .compact-entry,
  .entry-grid,
  .attendance-grid,
  .alerts-wide {
    grid-template-columns: 1fr;
  }

  .sales-head-tools {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .ai-summary {
    display: grid;
  }

  .ai-briefing-hero {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body {
    background: #f5f8f6;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  button {
    min-height: 44px;
  }

  .login-screen {
    align-items: start;
    padding: max(18px, env(safe-area-inset-top)) 14px 18px;
    overflow: auto;
  }

  .login-card {
    margin-top: 10px;
    padding: 18px;
    gap: 16px;
    box-shadow: 0 14px 40px rgba(31, 48, 40, 0.12);
  }

  .login-copy h2 {
    font-size: 25px;
    line-height: 1.2;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    min-height: 74px;
  }

  .login-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
  }

  .main,
  .sidebar {
    padding: 14px;
  }

  .main {
    padding-bottom: calc(128px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(31, 48, 40, 0.08);
    backdrop-filter: none;
  }

  .sidebar > .brand {
    align-items: center;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    display: none;
  }

  .account-card {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 10px 12px;
  }

  .account-card strong,
  .account-card small {
    display: none;
  }

  .account-card button {
    margin: 0;
    min-height: 34px;
  }

  .view-head {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }

  .view-head h2 {
    font-size: 23px;
  }

  .toolbar,
  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .toolbar button,
  .filters > * {
    width: 100%;
  }

  .nav-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(78px, 96px);
    grid-template-columns: none;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(31, 48, 40, 0.1);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }

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

  .nav-tab {
    min-width: 78px;
    min-height: 48px;
    padding: 0 4px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
  }

  body.staff-mode .nav-tabs {
    display: none;
  }

  body.staff-mode .main {
    padding-bottom: 18px;
  }

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

  .overview-revenue-row {
    grid-template-columns: 1fr;
  }

  .kpi,
  .report-card,
  .panel,
  .room-card,
  .ai-box,
  .entry-grid {
    border-radius: 14px;
  }

  .kpi,
  .report-card {
    padding: 12px;
  }

  .kpi strong,
  .report-card strong {
    font-size: 21px;
  }

  .dashboard-grid,
  .settings-grid,
  .billing-grid,
  .cash-trend-grid,
  .entry-grid,
  .alerts-wide {
    grid-template-columns: 1fr;
  }

  .cash-topup-form {
    grid-template-columns: 1fr;
  }

  .ai-model-status {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .ai-model-status small {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
  }

  .pause-room-form {
    grid-template-columns: 1fr;
  }

  .pause-room-form button {
    grid-column: 1 / -1;
  }

  .daily-bars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: auto;
  }

  .room-grid {
    grid-template-columns: 1fr;
  }

  .room-type-grid {
    grid-template-columns: 1fr;
  }

  .standalone-sale-grid,
  .standalone-sale-item,
  .coupon-grid,
  .coupon-row,
  .coupon-list-head {
    grid-template-columns: 1fr;
  }

  .standalone-sale-item {
    align-items: stretch;
  }

  .room-card {
    padding: 0;
    min-height: 132px;
  }

  .room-card-head {
    min-height: 52px;
    padding: 10px 12px;
  }

  .room-card h3 {
    font-size: 20px;
  }

  .room-card small {
    font-size: 13px;
  }

  .room-summary {
    padding: 10px 14px 14px;
  }

  .room-summary span {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
  }

  .room-summary strong {
    font-size: 22px;
  }

  .room-summary em {
    font-size: 14px;
  }

  .room-actions,
  .mini-form,
  .room-product-picker,
  .room-product-filters,
  .product-table-tools,
  .package-reminder-form {
    grid-template-columns: 1fr;
  }

  .room-product-left {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .room-product-row {
    grid-template-columns: 1fr;
  }

  .checkout-payment-row {
    grid-template-columns: 1fr;
  }

  .receipt-print-head {
    align-items: stretch;
    flex-direction: column;
  }

  .checkout-recharge {
    grid-template-columns: 1fr;
  }

  .estimate-inputs,
  .estimate-result {
    grid-template-columns: 1fr;
  }

  .member-recharge-box,
  .member-refund-box {
    grid-template-columns: 1fr;
  }

  .shift-stock-head,
  .shift-stock-empty {
    align-items: flex-start;
    flex-direction: column;
  }

  .bulk-billing-tool {
    grid-template-columns: 1fr;
  }

  .ai-stock-grid {
    grid-template-columns: 1fr;
  }

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

  .room-detail-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .room-detail-modal-body {
    padding: 14px;
    max-height: none;
  }

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

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

  .checkout-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .checkout-body {
    grid-template-columns: 1fr;
    padding: 14px;
    max-height: none;
  }

  .checkout-total strong {
    font-size: 28px;
  }

  .checkout-lines div,
  .member-info {
    display: grid;
  }

  .mini-form {
    gap: 9px;
  }

  .wide {
    grid-column: auto;
  }

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

  .table-wrap {
    margin: 0 -2px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
  }

  table {
    min-width: 760px;
  }

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

  .toast {
    left: 14px;
    right: 14px;
    bottom: calc(120px + env(safe-area-inset-bottom));
    min-width: 0;
    text-align: center;
  }

  body.staff-mode .toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .package-alarm-panel {
    left: 12px;
    right: 12px;
    bottom: calc(174px + env(safe-area-inset-bottom));
    width: auto;
    padding: 12px;
  }

  .package-alarm-actions {
    grid-template-columns: 1fr;
  }

  body.staff-mode .package-alarm-panel {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .install-banner {
    left: auto;
    right: 12px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: min(360px, calc(100vw - 24px));
    display: grid;
  }

  .install-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .update-banner {
    left: 12px;
    right: 12px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: auto;
    display: grid;
    transform: none;
  }

  .update-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body.staff-mode .install-banner {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }

  body.staff-mode .update-banner {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

@media (pointer: coarse) and (max-width: 1280px) {
  .app-shell {
    display: block;
  }

  .main,
  .sidebar {
    width: 100%;
    max-width: 100%;
    padding: 14px;
  }

  .main {
    padding-bottom: calc(128px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(31, 48, 40, 0.08);
    backdrop-filter: none;
  }

  .sidebar > .brand {
    align-items: center;
  }

  .brand p,
  .account-card strong,
  .account-card small {
    display: none;
  }

  .account-card {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 10px 12px;
  }

  .account-card button {
    margin: 0;
    min-height: 34px;
  }

  .nav-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(78px, 96px);
    grid-template-columns: none;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(31, 48, 40, 0.1);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }

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

  .nav-tab {
    min-width: 78px;
    min-height: 48px;
    padding: 0 4px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
  }

  .ai-model-status {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .ai-model-status small {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 2026-07-15: compact front desk shell */
.app-shell {
  grid-template-columns: 198px minmax(0, 1fr);
  background: #edf1ee;
}

.sidebar {
  gap: 8px;
  padding: 0 10px 14px;
  border-right: 1px solid #2c3b34;
  background: #18251f;
  color: #f4f7f5;
  box-shadow: none;
}

.sidebar > .brand {
  min-height: 62px;
  margin: 0 -10px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #34795b;
  box-shadow: none;
}

.sidebar .brand h1 {
  color: #fff;
  font-size: 14px;
}

.sidebar .brand p,
.sidebar label,
.sidebar .subtle {
  color: #aebdb5;
  font-size: 11px;
}

.sidebar .account-card,
.sidebar .store-switcher {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.sidebar .account-card strong,
.sidebar .account-card small,
.sidebar .store-switcher strong {
  color: #fff;
}

.sidebar .sync-status {
  border-color: #5f7469;
  background: #eef5f1;
  color: #22352c;
}

.sidebar .sync-status span {
  color: #607168;
}

.sidebar .sync-status strong {
  color: #1f6a4c;
}

.sidebar .runtime-source-warning {
  border-color: #c88a22;
  border-left-color: #c88a22;
  background: #fff6dc;
  color: #4d3a14;
}

.sidebar .runtime-source-warning strong {
  color: #6d4a0b;
}

.sidebar .runtime-source-warning small {
  color: #6e5b31;
}

.sidebar .runtime-source-warning a {
  color: #1f6a4c;
}

.sidebar input,
.sidebar select {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar button:not(.nav-tab) {
  min-height: 34px;
  border-radius: 4px;
}

.nav-tabs {
  gap: 2px;
}

.nav-tab {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 4px;
  background: transparent;
  color: #c8d4ce;
  font-size: 13px;
  text-align: left;
  box-shadow: none;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-tab.active {
  background: #34795b;
  color: #fff;
  box-shadow: none;
}

.main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 14px 18px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  margin: 0 -14px 12px;
  padding: 0 16px;
  border-bottom: 1px solid #32423a;
  background: #1e2b25;
  color: #fff;
}

.app-topbar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.app-topbar-context strong {
  font-size: 14px;
}

.app-topbar-context span {
  color: #aebdb5;
  font-size: 12px;
}

.app-topbar-tabs {
  display: flex;
  align-items: stretch;
  height: 54px;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-topbar-tabs::-webkit-scrollbar {
  display: none;
}

.topbar-tab {
  min-width: 86px;
  min-height: 54px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #c8d4ce;
  font-size: 13px;
  box-shadow: none;
}

.topbar-tab:hover,
.topbar-tab.active {
  border-bottom-color: #f0b24b;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.app-topbar-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c8d4ce;
  font-size: 11px;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56c68a;
  box-shadow: 0 0 0 3px rgba(86, 198, 138, 0.13);
}

.view-head {
  padding: 0 0 8px;
}

.view-head h2 {
  font-size: 22px;
}

.view-head p {
  font-size: 12px;
}

.frontdesk-head {
  margin-bottom: 0;
}

#pos-view .kpi-grid.compact {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 1px solid #d7e0db;
  border-radius: 6px;
  background: #d7e0db;
}

#pos-view .kpi-grid.compact .kpi {
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

#pos-view .kpi-grid.compact .kpi span,
#pos-view .kpi-grid.compact .kpi small {
  font-size: 10px;
}

#pos-view .kpi-grid.compact .kpi strong {
  font-size: 20px;
}

.frontdesk-workbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 8px;
  padding: 7px 9px;
  border: 1px solid #d7e0db;
  border-radius: 6px;
  background: #fff;
}

.workbar-label,
.compact-select-label span {
  display: block;
  margin-bottom: 5px;
  color: #6a7871;
  font-size: 10px;
  font-weight: 700;
}

.room-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.room-filter-tab {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe3df;
  border-radius: 4px;
  background: #f3f6f4;
  color: #3e5148;
  font-size: 12px;
  box-shadow: none;
}

.room-filter-tab span {
  margin-left: 3px;
  color: #849189;
  font-size: 10px;
}

.room-filter-tab.active {
  border-color: #34795b;
  background: #34795b;
  color: #fff;
}

.room-filter-tab.active span {
  color: #dbe9e2;
}

.frontdesk-controls {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.compact-select-label select,
#refreshFrontdeskButton {
  min-height: 30px;
  border-radius: 4px;
  font-size: 12px;
}

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

.room-type-group {
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.room-type-title {
  padding: 5px 2px;
  border-bottom: 1px solid #d7e0db;
}

.room-type-title h3 {
  font-size: 15px;
}

.room-type-title span {
  font-size: 10px;
}

.room-type-grid {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 7px;
}

.room-card-shell {
  min-width: 0;
}

.room-card {
  min-height: 94px;
  border-radius: 4px;
  box-shadow: none;
}

.room-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(35, 59, 48, 0.12);
}

.room-card-head {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 3px 3px 0 0;
}

.room-card-head h3 {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card-head small,
.room-card-head span {
  font-size: 10px;
}

.room-summary {
  gap: 3px;
  padding: 6px 8px;
}

.room-summary span,
.room-summary em,
.room-summary-switch {
  font-size: 10px;
}

.room-summary strong {
  font-size: 14px;
}

.room-quick-checkout {
  right: 5px;
  bottom: 5px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
}

.frontdesk-empty {
  padding: 40px 16px;
  border: 1px dashed #cdd8d2;
  border-radius: 6px;
  background: #fff;
  color: #6a7871;
  text-align: center;
}

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

.frontdesk-tool-drawer {
  min-width: 0;
  border: 1px solid #d7e0db;
  border-radius: 6px;
  background: #fff;
}

.frontdesk-tool-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.frontdesk-tool-drawer > summary::-webkit-details-marker {
  display: none;
}

.frontdesk-tool-drawer > summary strong,
.frontdesk-tool-drawer > summary small {
  display: block;
}

.frontdesk-tool-drawer > summary strong {
  font-size: 13px;
}

.frontdesk-tool-drawer > summary small,
.frontdesk-tool-drawer > summary > span:last-child {
  color: #7b8981;
  font-size: 10px;
}

.frontdesk-tool-drawer[open] > summary {
  border-bottom: 1px solid #e2e8e5;
}

.frontdesk-tool-drawer > .panel {
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 1100px) {
  #pos-view .kpi-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .room-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }
}

@media (pointer: coarse) and (max-width: 1280px), (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
    gap: 7px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #2c3b34;
    background: #18251f;
    box-shadow: none;
  }

  .sidebar > .brand {
    min-height: 48px;
    margin: -8px -10px 0;
  }

  .sidebar .account-card {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) repeat(3, auto);
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 5px;
  }

  .sidebar .account-card > strong,
  .sidebar .account-card > small,
  .sidebar .sync-status,
  .sidebar .runtime-source-warning {
    display: none;
  }

  .sidebar .account-card > span {
    min-width: 0;
    overflow: hidden;
    color: #d7e2dc;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar .account-card button {
    min-height: 32px;
    margin: 0;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .sidebar .store-switcher {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6px;
    margin: 0;
    padding: 5px;
  }

  .sidebar .store-switcher label {
    min-width: 0;
  }

  .sidebar .store-switcher label > :first-child {
    margin-bottom: 2px;
  }

  .sidebar .store-switcher select,
  .sidebar .store-switcher button {
    min-height: 32px;
    margin: 0;
    font-size: 12px;
  }

  .main {
    width: 100%;
    max-width: 100%;
    padding: 0 10px calc(96px + env(safe-area-inset-bottom));
  }

  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 46px;
    margin: 0 -10px 10px;
    padding: 0 10px;
  }

  .app-topbar-context {
    display: none;
  }

  .app-topbar-tabs {
    height: 46px;
  }

  .topbar-tab {
    min-width: 76px;
    min-height: 46px;
    padding: 0 10px;
    font-size: 12px;
  }

  .app-topbar-status {
    font-size: 0;
  }

  .view-head h2 {
    font-size: 20px;
  }

  #pos-view .kpi-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #pos-view .kpi-grid.compact .kpi {
    min-height: 66px;
    padding: 7px;
  }

  #pos-view .kpi-grid.compact .kpi strong {
    font-size: 17px;
  }

  .frontdesk-workbar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .frontdesk-controls {
    justify-content: space-between;
  }

  .compact-select-label {
    flex: 1;
  }

  .compact-select-label select {
    width: 100%;
  }

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

  .room-card {
    min-height: 98px;
  }

  .frontdesk-tools {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    background: rgba(255, 255, 255, 0.97);
  }

  .nav-tab {
    min-height: 48px;
    border-radius: 6px;
    color: #405249;
    text-align: center;
  }

  .nav-tab.active {
    background: #34795b;
    color: #fff;
  }
}

@media (max-width: 340px) {
  .room-type-grid {
    grid-template-columns: 1fr;
  }

  #pos-view .kpi-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Per-store device onboarding; wraps to a single column on the shop tablet. */
.settings-grid .device-center { grid-column: 1 / -1; min-width: 0; border: 1px solid #c8d5eb; }
.device-binding-list { display: grid; gap: 12px; margin: 20px 0; }
.device-binding-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(180px, 3fr) minmax(100px, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid #dce2ea; border-radius: 12px; }
.device-binding-row select { width: 100%; min-width: 0; }
.device-live-state { font-size: 13px; color: #4a566c; }
.device-legacy { grid-column: 1 / -1; min-width: 0; margin: 18px 0; }
.device-legacy > summary { cursor: pointer; padding: 14px; color: #56637a; }
#devicePairing { margin-top: 18px; padding: 18px; border-radius: 12px; background: #f0f5fd; }
#devicePairingCode { font: 20px ui-monospace, monospace; letter-spacing: 1px; max-width: 100%; }
@media (max-width: 900px) { .device-binding-row { grid-template-columns: 1fr 1fr 1fr; } .device-binding-row strong, .device-binding-row select, .device-live-state { grid-column: 1 / -1; } }
