:root {
  color-scheme: light;
  --ink: #2e3346;
  --muted: #8a94aa;
  --line: #edf0f5;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --blue: #2f8bc1;
  --blue-dark: #277aab;
  --teal: #0f766e;
  --teal-dark: #0b534e;
  --tomato: #d94f2b;
  --mustard: #f5c542;
  --mint: #d9eee7;
  --shadow: 0 18px 50px rgba(32, 33, 36, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Aptos, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-width: 1280px;
  overflow-x: auto;
}

.is-hidden {
  display: none !important;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e8f3fa, #ffffff);
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(46, 51, 70, 0.16);
  padding: 30px;
}

.login-card img {
  width: 58px;
  height: 58px;
}

.login-card h1 {
  font-size: 30px;
}

.login-error {
  min-height: 20px;
  color: #d94f2b;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-width: 1280px;
  background: var(--paper);
}

.app-shell.sidebar-open {
  grid-template-columns: 210px 1fr;
}

.posify-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr) auto;
  align-items: center;
  min-height: 64px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
}

.posify-left, .posify-center, .posify-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  height: 100%;
}

.posify-left {
  padding-left: 12px;
  border-right: 1px solid rgba(255,255,255,0.25);
}

.posify-left strong {
  font-size: 19px;
  letter-spacing: 0;
  font-weight: 800;
}

.header-icon, .help-desk, .user-chip {
  background: transparent;
  color: #fff;
}

.online-pill {
  background: #fff;
  color: #4f9948;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  font-weight: 800;
  white-space: nowrap;
}

.help-desk {
  border: 1px solid rgba(255,255,255,0.65);
  min-height: 24px;
  padding: 0 13px;
  border-radius: 2px;
  font-weight: 700;
}

.posify-right {
  padding: 0 14px;
  gap: 18px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-chip {
  min-height: 34px;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding: 0 0 0 12px;
  font-weight: 800;
  white-space: nowrap;
}

.header-contact {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.25;
}

.header-stat {
  white-space: nowrap;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  background: #ffffff;
  color: #9ba5b7;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--line);
}

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

.brand img {
  width: 48px;
  height: 48px;
}

.brand strong, .brand span {
  display: block;
}

.brand span, .eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .brand span {
  color: #bcd6d2;
}

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

.nav-tab {
  width: 44px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: #9ba5b7;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border-left: 2px solid transparent;
  font-size: 12px;
}

.nav-icon {
  width: 24px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.nav-label {
  display: none;
  font-weight: 800;
  white-space: nowrap;
}

.sidebar-open .nav-tab {
  width: 100%;
  justify-content: flex-start;
  padding-left: 10px;
}

.sidebar-open .nav-label {
  display: inline;
}

.nav-tab.active, .nav-tab:hover {
  background: #f5f9fd;
  color: var(--blue);
  border-left-color: var(--blue);
}

.shift-panel {
  display: none;
  margin-top: auto;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px;
  border-radius: 8px;
}

label {
  color: inherit;
  font-size: 13px;
}

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

.workspace {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px 10px;
  border-bottom: 0;
  background: var(--paper);
}

.app-shell.compact-topbar .topbar {
  display: none;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 3vw, 30px);
}

h2 {
  font-size: 22px;
}

.status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-strip span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px 12px;
  box-shadow: 0 3px 16px rgba(32, 33, 36, 0.05);
}

.view {
  display: none;
  padding: 14px 16px 28px;
}

.view.active {
  display: block;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 22px;
  align-items: start;
  min-height: calc(100vh - 170px);
}

.menu-panel, .ticket-panel, .reports-grid article, .history-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.daily-card, .comparison-card, .weekly-panel, .outlet-card, .dashboard-blank, .monthly-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.daily-card {
  min-height: 320px;
  padding: 18px;
  box-shadow: 4px 0 0 #e7ebf2;
}

.daily-head {
  display: flex;
  justify-content: space-between;
}

.daily-head h2 {
  font-size: 22px;
}

.trend-mark {
  color: #3d94c6;
  font-size: 54px;
  line-height: 1;
  font-weight: 800;
}

.daily-card > strong {
  display: block;
  font-size: 28px;
  margin-top: 22px;
}

.daily-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

.daily-metrics div {
  min-height: 54px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
}

.daily-metrics div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.daily-metrics span {
  color: #9aa4b9;
  font-size: 12px;
  font-weight: 800;
}

.daily-metrics strong {
  font-size: 16px;
}

.comparison-card {
  min-height: 320px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.comparison-head h2 {
  font-size: 24px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.comparison-grid div {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  background: #f7fbff;
  border: 1px solid #e4eef8;
  border-radius: 6px;
}

.comparison-grid span, .weekly-stats-grid span, .monthly-grid span {
  color: #8a94aa;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.comparison-grid strong {
  font-size: 24px;
}

.delta-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.delta-strip span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf7ff;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 12px;
}

.weekly-panel {
  margin-top: 22px;
  padding: 0 14px 14px;
}

.weekly-panel summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
}

.weekly-stats-grid, .monthly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.weekly-stats-grid article, .monthly-grid article {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.weekly-stats-grid strong, .monthly-grid strong {
  font-size: 24px;
}

.monthly-grid {
  margin-top: 16px;
}

.monthly-grid article {
  border-radius: 2px;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.outlet-card {
  width: min(420px, 100%);
  min-height: 110px;
  margin-top: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: start;
}

.outlet-card h2 {
  font-size: 15px;
}

.outlet-card p {
  font-size: 12px;
}

.outlet-toggle input {
  display: none;
}

.outlet-toggle span {
  width: 38px;
  height: 20px;
  display: block;
  background: #66a84f;
  border-radius: 999px;
  position: relative;
}

.outlet-toggle span::after {
  content: "✓";
  position: absolute;
  right: 4px;
  top: 2px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #66a84f;
  border-radius: 50%;
  font-size: 10px;
}

.kebab {
  background: transparent;
  font-size: 22px;
}

.outlet-footer {
  grid-column: 1 / -1;
  min-height: 36px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.outlet-footer button {
  min-height: 24px;
  padding: 0 14px;
  border: 1px solid #b9d5eb;
  background: #eef7ff;
  color: #347eb4;
  font-weight: 800;
  font-size: 11px;
}

.dashboard-blank {
  min-height: 36px;
  margin-top: 20px;
}

.menu-panel {
  padding: 16px;
}

.toolbar {
  display: grid;
  gap: 12px;
}

.segmented {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.segmented button {
  flex: 0 0 auto;
  background: #f2eee6;
  color: var(--ink);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 13px;
}

.segmented button.active {
  background: var(--teal);
  color: #fff;
}

.menu-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.menu-item {
  min-height: 142px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.menu-item:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.menu-item strong {
  font-size: 17px;
}

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

.menu-item .price {
  color: var(--teal-dark);
  font-weight: 800;
}

.ticket-panel {
  position: sticky;
  top: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
}

.ticket-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 14px;
}

.ticket-head, .board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-size: 24px;
}

.order-meta, .payment-row, .action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 88px;
  gap: 8px;
}

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

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

.print-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 320px;
  max-height: none;
  overflow: auto;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 12px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-line small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.qty {
  display: grid;
  grid-template-columns: 34px 34px 34px;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.qty button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f2eee6;
}

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

.check-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--ink);
}

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

.totals {
  display: grid;
  gap: 4px;
  margin: 6px 0 8px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.totals dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.18;
}

.totals dd {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.18;
}

.totals .grand {
  font-size: 18px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.primary, .secondary, .ghost {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary {
  background: var(--tomato);
  color: #fff;
}

.secondary {
  background: var(--teal);
  color: #fff;
}

.danger {
  background: #b42318;
}

.ghost {
  width: 100%;
  margin-top: 8px;
  background: #f2eee6;
  color: var(--ink);
}

.kitchen-board, .table-map, .inventory-list, .history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.kds-card, .table-card, .stock-card, .history-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 28px rgba(32, 33, 36, 0.08);
}

.kds-card strong, .table-card strong, .stock-card strong, .history-card strong {
  display: block;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 12px;
}

.table-card.occupied {
  border-color: var(--tomato);
}

.stock-bar {
  height: 10px;
  background: #eee7dc;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
}

.stock-bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.stock-card.low .stock-bar span {
  background: var(--tomato);
}

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

.report-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

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

.report-actions .secondary {
  min-height: 38px;
}

.filter-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.reports-grid article {
  padding: 18px;
}

.reports-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.history-wrap {
  margin-top: 0;
  padding: 18px;
}

.history-wrap-inline {
  margin-top: 18px;
}

.history-header {
  margin-bottom: 16px;
}

.history-header h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.history-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.page-indicator {
  color: var(--muted);
  font-weight: 700;
}

.receipt {
  display: none;
}

.receipt-card {
  color: #111827;
  background: #fff;
  width: 100%;
}

.receipt pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.28;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #111827;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-header h1 {
  font-size: 22px;
  line-height: 1.1;
  margin: 4px 0;
}

.receipt-header p,
.receipt-footer p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.4;
}

.receipt-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.receipt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.receipt-meta div,
.receipt-totals div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.receipt-meta span,
.receipt-totals span,
.receipt-note {
  color: #374151;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.receipt-table th,
.receipt-table td {
  font-size: 13px;
  padding: 6px 0;
  text-align: left;
  vertical-align: top;
}

.receipt-table th:nth-child(2),
.receipt-table th:nth-child(3),
.receipt-table th:nth-child(4),
.receipt-table td:nth-child(2),
.receipt-table td:nth-child(3),
.receipt-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.receipt-table thead th {
  border-top: 1px dashed #111827;
  border-bottom: 1px dashed #111827;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.receipt-totals {
  border-top: 1px dashed #111827;
  padding-top: 10px;
}

.receipt-grand {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #111827;
  font-size: 16px;
  font-weight: 800;
}

.receipt-footer {
  margin-top: 12px;
  border-top: 1px dashed #111827;
  padding-top: 8px;
  text-align: center;
}

.kot-card {
  font-size: 14px;
}

.kot-header {
  border-bottom: none;
  margin-bottom: 6px;
}

.kot-token {
  font-size: 64px;
  line-height: 1;
  margin: 6px 0 10px;
}

.kot-meta {
  margin-bottom: 12px;
}

.kot-meta p {
  margin: 2px 0;
  font-size: 14px;
}

.kot-table-line {
  font-size: 24px;
  margin-top: 6px;
}

.kot-table thead th:first-child,
.kot-table tbody td:first-child {
  width: 72%;
}

.kot-table thead th:last-child,
.kot-table tbody td:last-child {
  width: 28%;
  text-align: right;
}

.kot-table th,
.kot-table td {
  font-size: 15px;
  padding: 7px 0;
}

.kot-footer {
  text-align: left;
}

.bill-card .receipt-header {
  padding-bottom: 10px;
}

.bill-card .receipt-note {
  font-size: 12px;
}

.bill-card .receipt-table {
  table-layout: fixed;
}

.bill-card .receipt-table th:first-child,
.bill-card .receipt-table td:first-child {
  width: 46%;
  padding-right: 8px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.bill-card .receipt-table th:nth-child(2),
.bill-card .receipt-table td:nth-child(2) {
  width: 10%;
}

.bill-card .receipt-table th:nth-child(3),
.bill-card .receipt-table td:nth-child(3) {
  width: 18%;
}

.bill-card .receipt-table th:nth-child(4),
.bill-card .receipt-table td:nth-child(4) {
  width: 26%;
}

.bill-card .receipt-table th:nth-child(2),
.bill-card .receipt-table th:nth-child(3),
.bill-card .receipt-table th:nth-child(4),
.bill-card .receipt-table td:nth-child(2),
.bill-card .receipt-table td:nth-child(3),
.bill-card .receipt-table td:nth-child(4) {
  font-size: 11px;
  letter-spacing: 0;
}

.bill-card .receipt-table td strong {
  display: inline-block;
  font-size: 12px;
  line-height: 1.25;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(16, 24, 40, 0.42);
  padding: 18px;
}

.modal-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
}

.modal-card h2 {
  margin-bottom: 8px;
}

.history-detail-modal {
  width: min(920px, 100%);
}

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

.history-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 16px;
}

.history-detail-summary,
.history-detail-items,
.history-detail-totals,
.history-detail-payment {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.history-detail-items {
  grid-row: span 2;
}

.history-detail-summary p,
.history-detail-payment p,
.history-detail-totals p {
  margin: 0 0 8px;
}

.history-detail-lines {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.history-detail-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.history-detail-line:last-child {
  border-bottom: 0;
}

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

.history-detail-line-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}

.history-detail-totals p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-detail-grand {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.payment-options button {
  min-height: 50px;
  border-radius: 8px;
  background: #eef7ff;
  color: var(--blue-dark);
  font-weight: 800;
  border: 1px solid #b9d5eb;
}

:root {
  --ink: #182234;
  --muted: #69758d;
  --line: rgba(20, 30, 50, 0.08);
  --paper: #f3efe7;
  --panel: rgba(255, 255, 255, 0.88);
  --blue: #0f766e;
  --blue-dark: #0b534e;
  --teal: #0f766e;
  --teal-dark: #083f3b;
  --tomato: #d94f2b;
  --mustard: #f5c542;
  --mint: #d9eee7;
  --shadow: 0 24px 60px rgba(16, 24, 40, 0.12);
}

body {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(245, 197, 66, 0.14), transparent 20%),
    linear-gradient(180deg, #f8f4ec 0%, #eef2f7 100%);
}

.login-screen {
  background:
    radial-gradient(circle at top, rgba(15, 118, 110, 0.18), transparent 24%),
    linear-gradient(135deg, #f8f3ea, #eef3f7);
}

.login-card {
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 24px;
  padding: 34px;
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.18);
}

.login-hint {
  color: var(--muted);
  line-height: 1.5;
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.05), rgba(245, 197, 66, 0.03));
}

.posify-header {
  min-height: 72px;
  background: linear-gradient(135deg, #0f766e, #123a52);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  padding-right: 12px;
}

.posify-left {
  padding-left: 16px;
}

.posify-left strong {
  font-size: 20px;
  letter-spacing: 0.04em;
}

.posify-center,
.posify-right {
  gap: 10px;
  flex-wrap: wrap;
}

.help-desk {
  border-radius: 999px;
}

.user-meta {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.sidebar {
  background: linear-gradient(180deg, #0c2235 0%, #11324a 100%);
  color: rgba(255, 255, 255, 0.78);
}

.sidebar .brand {
  display: flex;
  padding: 10px 14px 18px;
}

.sidebar .brand strong {
  color: #fff;
}

.sidebar .brand span {
  color: rgba(255, 255, 255, 0.7);
}

.nav-tab {
  width: 100%;
  color: rgba(255, 255, 255, 0.76);
  border-left: 3px solid transparent;
  min-height: 44px;
}

.nav-group {
  display: grid;
}

.sub-nav {
  display: none;
  gap: 4px;
  padding: 4px 0 10px 22px;
}

.nav-group.active .sub-nav {
  display: grid;
}

.sub-nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: stretch;
  text-align: left;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.sub-nav-tab.active,
.sub-nav-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sub-nav-icon {
  width: 14px;
  flex: 0 0 14px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.sub-nav-label {
  white-space: nowrap;
}

.app-shell:not(.sidebar-open) .sub-nav {
  padding-left: 0;
}

.app-shell:not(.sidebar-open) .sub-nav-tab {
  width: 44px;
  min-height: 28px;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
}

.app-shell:not(.sidebar-open) .sub-nav-label {
  display: none;
}

.nav-tab:hover,
.nav-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-icon {
  font-size: 14px;
}

.workspace {
  background: transparent;
}

.topbar {
  padding: 18px 22px 14px;
}

.status-strip span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.view {
  padding: 14px 22px 34px;
}

.menu-panel,
.ticket-panel,
.reports-grid article,
.history-wrap,
.daily-card,
.comparison-card,
.weekly-panel,
.monthly-grid article,
.table-card,
.stock-card,
.kds-card,
.history-card,
.admin-panel,
.admin-row,
.summary-grid article {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
}

.daily-card,
.comparison-card {
  border-radius: 28px;
  padding: 22px;
}

.comparison-grid div,
.weekly-stats-grid article,
.monthly-grid article {
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.05);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.dashboard-actions button,
.report-actions button,
.action-row button,
.payment-options button,
.admin-actions button,
.admin-form button,
.row-actions button,
.board-head button,
.print-row button {
  border-radius: 999px;
}

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

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

.sync-status {
  min-height: 22px;
  margin: 0 0 14px;
  color: var(--blue-dark);
  font-weight: 700;
}

.debug-status {
  min-height: 22px;
  margin: -6px 0 14px;
  color: #b45309;
  font-weight: 700;
  font-size: 13px;
}

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

.summary-grid article {
  min-height: 100px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
}

.summary-grid strong {
  font-size: 30px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-accordions {
  display: grid;
  gap: 16px;
}

.admin-accordion,
.report-accordion {
  border-radius: 26px;
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
  overflow: hidden;
}

.admin-accordion summary,
.report-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-accordion summary::-webkit-details-marker,
.report-accordion summary::-webkit-details-marker {
  display: none;
}

.admin-accordion summary::after,
.report-accordion summary::after {
  content: "+";
  font-size: 26px;
  line-height: 1;
  color: var(--blue-dark);
}

.admin-accordion[open] summary::after,
.report-accordion[open] summary::after {
  content: "−";
}

.admin-accordion summary strong,
.report-accordion summary strong {
  display: block;
  font-size: 18px;
}

.admin-accordion summary small,
.report-accordion summary small {
  color: var(--muted);
}

.accordion-body {
  padding: 0 18px 18px;
}

.admin-panel {
  border-radius: 28px;
  padding: 18px;
}

.admin-panel-wide {
  grid-column: 1 / -1;
}

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

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

.admin-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-search {
  margin: 0 0 14px;
}

.admin-import {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.admin-import input {
  flex: 1 1 280px;
}

.admin-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}

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

.admin-form textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  resize: vertical;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
}

.admin-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-row p,
.admin-row small {
  color: var(--muted);
}

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

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.ghost {
  background: rgba(15, 118, 110, 0.1);
  color: var(--blue-dark);
}

.ghost.danger,
.secondary.danger {
  background: rgba(217, 79, 43, 0.08);
  color: #b5472b;
}

.primary {
  background: linear-gradient(135deg, #0f766e, #123a52);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}

.secondary {
  background: rgba(15, 118, 110, 0.1);
  color: var(--blue-dark);
}

.icon-btn {
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--blue-dark);
}

.table-card,
.stock-card,
.kds-card,
.history-card {
  border-radius: 24px;
}

.table-card {
  min-height: 180px;
}

.stock-bar {
  background: rgba(15, 118, 110, 0.12);
  border-radius: 999px;
}

.stock-bar span {
  background: linear-gradient(90deg, #0f766e, #f5c542);
}

.ticket-panel {
  border-radius: 30px;
  padding: 20px;
}

.menu-item,
.cart-line,
.kds-card,
.history-card {
  border-radius: 22px;
}

.history-card.clickable {
  cursor: pointer;
}

.history-card.clickable:hover {
  border-color: rgba(15, 118, 110, 0.32);
  transform: translateY(-1px);
}

.menu-item {
  background: rgba(255, 255, 255, 0.9);
}

.menu-item .price {
  color: #0f766e;
}

.modal-card {
  border-radius: 28px;
}

label {
  font-weight: 700;
  color: var(--ink);
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.login-card img {
  width: 68px;
  height: 68px;
}

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

  .app-shell.sidebar-open {
    grid-template-columns: 190px 1fr;
  }

  .posify-header {
    grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
    grid-template-areas:
      "left right"
      "center center";
    align-items: start;
  }

  .posify-left {
    grid-area: left;
  }

  .posify-center {
    grid-area: center;
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
  }

  .posify-right {
    grid-area: right;
  }

  .posify-center span:last-child {
    display: none;
  }

  .sidebar {
    position: static;
    top: 0;
    z-index: 5;
    display: flex;
  }

  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .sub-nav {
    padding-left: 10px;
  }

  .shift-panel {
    display: none;
  }

  .pos-layout {
    grid-template-columns: 1fr;
  }

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

  .summary-grid,
  .admin-form-grid,
  .report-filters {
    grid-template-columns: 1fr;
  }

  .ticket-panel {
    position: static;
    max-height: none;
  }

  .ticket-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 900px) {
  .history-detail-grid {
    grid-template-columns: 1fr;
  }

  .history-detail-items {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .posify-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "center";
    padding: 8px 10px 12px;
  }

  .posify-center {
    display: flex;
    padding: 10px 0 0;
    border-top: 1px solid rgba(255,255,255,0.12);
  }

  .posify-right {
    padding: 8px 0 0;
    justify-content: flex-start;
  }

  .header-stat,
  .header-contact {
    display: none;
  }

  .topbar, .view {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar, .board-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-meta, .payment-row, .action-row, .print-row, .controls-grid, .reports-grid, .daily-metrics, .comparison-grid, .weekly-stats-grid, .monthly-grid, .payment-options, .report-filters {
    grid-template-columns: 1fr;
  }

  .menu-grid, .kitchen-board, .table-map, .inventory-list, .history-list {
    grid-template-columns: 1fr;
  }

  .outlet-card {
    width: 100%;
  }

  .admin-row,
  .board-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  @page {
    size: 80mm 297mm;
    margin: 2mm;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    width: 80mm;
    min-width: auto;
    max-width: none;
    min-height: auto;
    height: auto;
    background: #fff;
    zoom: 1;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    overflow: visible !important;
  }

  body > * {
    display: none !important;
  }

  .receipt {
    display: block !important;
    position: static !important;
    width: 76mm;
    min-width: 76mm;
    max-width: 76mm;
    padding: 0;
    margin: 0;
    font-family: "SF Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #fff;
    transform: none;
  }

  .receipt.print-bill {
    width: 76mm;
    min-width: 76mm;
    max-width: 76mm;
  }

  .receipt.print-kot {
    width: 76mm;
    min-width: 76mm;
    max-width: 76mm;
  }

  .receipt,
  .receipt * {
    visibility: visible !important;
  }

  .receipt pre {
    font-size: 11px;
    line-height: 1.24;
    white-space: pre-wrap;
    width: 100%;
    margin: 0;
  }

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

  .receipt-header h1 {
    font-size: 16px;
  }

  .receipt-table th,
  .receipt-table td,
  .receipt-meta div,
  .receipt-totals div,
  .receipt-header p,
  .receipt-footer p {
    font-size: 10px;
  }
}
