:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-alt: #eceeef;
  --primary: #000000;
  --primary-dark: #000000;
  --accent: #333333;
  --text: #000000;
  --muted: #5a5a5a;
  --line: #e2e4e6;
  --success: #247965;
  --danger: #bd5c4b;
  --warning: #a67532;
  --sidebar: #ffffff;
  --shadow: 0 8px 24px rgba(35, 39, 43, 0.07);
}

* {
  box-sizing: border-box;
}

/* Some components set `display` unconditionally (flex/grid layouts), which
   otherwise beats the browser's default [hidden] rule on source order. This
   guarantees el.hidden = true always actually hides the element. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Lucida Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.sidebar {
  background: var(--sidebar);
  color: #000000;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 16px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

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

.brand small,
.nav-label {
  color: #4a4d50;
  font-size: 0.72rem;
}

.nav-label {
  margin: 0 8px 10px;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.workspace {
  min-width: 0;
  padding: 0 38px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: 1.8rem;
  color: var(--primary-dark);
}

.topbar-actions { color: var(--muted); font-size: 0.84rem; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #dde0e2;
  margin-top: auto;
  padding: 18px 8px 0;
}

.user-badge {
  min-width: 0;
  flex: 1;
  color: #2a2d2f;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #c9ccce;
  border-radius: 6px;
  color: #000;
  background: transparent;
  cursor: pointer;
}

.icon-btn:hover { background: #e8eaeb; }
.icon-btn svg, .tab-btn svg { width: 18px; height: 18px; }
.sidebar-toggle { display: none; }
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-shell {
  width: min(560px, 90vw);
}

.auth-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.auth-branding {
  margin-bottom: 24px;
}

.auth-branding h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
  color: var(--primary-dark);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-btn {
  width: 100%;
}

.demo-accounts {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.demo-accounts h3 {
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.demo-accounts ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.module-tabs {
  display: grid;
  gap: 5px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: #26292c;
  padding: 11px 12px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.dashboard {
  display: block;
}

.tab-panel {
  display: none;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.metrics-panel {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px;
}

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

.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 18px;
}

.report-controls .field-group {
  min-width: 220px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.chart-row.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pos-main {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 22px;
  align-items: start;
  flex: 1;
  min-height: 0;
  padding: 22px 26px;
  overflow: hidden;
}

.pos-catalog {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 16px;
}

.pos-catalog-toolbar #pos-search {
  width: 100%;
  max-width: 360px;
  border-radius: 999px;
  padding: 10px 18px;
}

.pos-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-category-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.pos-category-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pos-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
  overflow-y: auto;
  padding: 4px 6px 20px 2px;
}

.pos-tile {
  background: #fff;
  border: 1px solid #e2e4e6;
  border-radius: 14px;
  padding: 0 0 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(35, 39, 43, 0.05);
}

.pos-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.pos-tile-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.08);
}

.pos-tile-image-placeholder {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary);
}

.pos-tile-image-placeholder svg {
  width: 32px;
  height: 32px;
}

.pos-tile-body {
  padding: 14px 16px 0;
}

.pos-tile strong {
  display: block;
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.pos-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.pos-tile .pos-tile-price {
  margin-top: 8px;
  color: var(--primary-dark, #000000);
  font-weight: 700;
  font-size: 1.05rem;
}

.pos-tile-recipe-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}

.pos-client-row {
  display: flex;
  gap: 8px;
}

.pos-client-row select {
  flex: 1;
}

.pos-cart {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.pos-cart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pos-cart h3 {
  margin: 0;
}

.pos-order-meta {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.pos-section-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.pos-cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.pos-cart-line {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.pos-cart-line-voucher {
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.pos-cart-line-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pos-cart-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.pos-cart-thumb-empty {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary);
}

.pos-cart-thumb-empty svg {
  width: 16px;
  height: 16px;
}

.pos-cart-line-name {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-remove {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.pos-cart-remove svg {
  width: 16px;
  height: 16px;
}

.pos-cart-line-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.pos-mini-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-mini-field span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  color: var(--muted);
}

.pos-mini-field input,
.pos-mini-field select {
  padding: 6px 8px;
  font-size: 0.86rem;
}

.pos-mini-field-wide {
  grid-column: 1 / -1;
}

.pos-line-staff-missing {
  border-color: var(--danger);
}

.pos-qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pos-qty-controls button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.pos-qty-controls input {
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 6px 2px;
  font-size: 0.86rem;
}

.pos-cart-line-total {
  text-align: right;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary-dark, #000000);
}

.pos-bill-discount {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-bottom: 4px;
}

.pos-bill-discount label {
  display: block;
  margin-bottom: 6px;
}

.pos-bill-discount-row {
  display: flex;
  gap: 8px;
}

.pos-bill-discount-row input {
  flex: 1;
  min-width: 0;
}

.pos-bill-discount-row select {
  width: 72px;
  flex-shrink: 0;
}

.pos-cart-summary {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--muted);
  padding: 3px 0;
}

.pos-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  margin-bottom: 12px;
}

@media (max-width: 1100px) {
  .pos-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .pos-cart {
    overflow-y: visible;
  }
}

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

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--primary-dark, #000000);
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap canvas {
  max-width: 100%;
}

.metric-card {
  background: var(--panel-alt);
  border: 1px solid #e2e4e6;
  border-radius: 7px;
  padding: 17px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}

.metric-card strong {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  color: var(--primary-dark);
}

.revenue-card strong {
  color: var(--success);
}

.warning-card strong {
  color: var(--warning);
}

.booking-panel {
  width: 100%;
}

.schedule-panel {
  width: 100%;
}

.section-title-row {
  margin-bottom: 18px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-dark);
}

.section-title-row { display: flex; align-items: center; justify-content: space-between; }

.booking-form,
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-panel {
  background: var(--panel-alt);
  border: 1px solid #e2e4e6;
  border-radius: 7px;
  padding: 18px;
  margin-bottom: 20px;
}

.add-toggle-btn {
  padding: 10px 16px;
  font-size: 0.86rem;
}

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

.secondary-btn {
  border: 1px solid #d7dadd;
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark);
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-field {
  justify-content: flex-end;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: inherit;
}

.checkbox-field input[type="checkbox"] {
  width: auto;
}

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

label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid #d7dadd;
  border-radius: 6px;
  background: #fff;
  padding: 12px 14px;
  color: var(--text);
}

.primary-btn {
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.form-message {
  min-height: 1.4rem;
  margin: 0;
  font-size: 0.9rem;
}

.form-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted, #5a5a5a);
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.global-message {
  min-height: 0;
  padding: 0 1.5rem;
  font-weight: 600;
}

.global-message:empty {
  padding: 0;
}

.global-message.success {
  background: rgba(46, 125, 50, 0.12);
  padding-block: 0.6rem;
}

.global-message.error {
  background: rgba(198, 40, 40, 0.12);
  padding-block: 0.6rem;
}

.appointment-list,
.data-list {
  display: grid;
  gap: 14px;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
}

.table-toolbar input {
  width: min(100%, 300px);
}

.toolbar-date-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.toolbar-date-field input {
  width: auto;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.9rem;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: #f7f8f9;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #f7f8f9; }
.data-table .table-warning td { background: #fff8ed; }
.table-actions { display: flex; gap: 6px; }

.table-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.table-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary);
}

.recipe-list {
  margin: 0;
  padding-left: 18px;
}

.recipe-list li {
  margin-bottom: 6px;
}
.table-action { border: 1px solid #d7dadd; border-radius: 5px; background: #fff; color: var(--primary-dark); padding: 6px 9px; font-size: 0.76rem; font-weight: 700; cursor: pointer; }
.danger-action { color: var(--danger); }
.empty-table { color: var(--muted); text-align: center !important; padding: 28px !important; }

.sales-bill-toggle {
  border-color: transparent;
  background: none;
  padding: 6px 4px;
  white-space: nowrap;
}

.sales-bill-detail-row td {
  padding: 0 14px 14px !important;
  background: #f7f8f9;
  white-space: normal;
}

.sales-bill-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.sales-bill-detail-table th,
.sales-bill-detail-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.sales-bill-detail-table th {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  background: #f7f8f9;
}

.sales-bill-detail-table tr:last-child td {
  border-bottom: 0;
}

.appointment-card,
.data-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 15px 16px;
}

.data-card.warning {
  border-color: rgba(183, 127, 57, 0.45);
  background: linear-gradient(135deg, #fffaf2, #fdf3e1);
}

.appointment-details h3,
.data-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.appointment-meta,
.data-card p,
.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.appointment-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mini-actions,
.data-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.data-metrics span {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  color: var(--primary-dark);
}

.action-btn {
  border: none;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: white;
  font-weight: 700;
}

.confirm-btn {
  background: var(--success);
}

.cancel-btn {
  background: #b78b4f;
}

.delete-btn {
  background: var(--danger);
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  font-weight: 700;
}

.status-confirmed {
  background: rgba(46, 125, 103, 0.12);
  color: var(--success);
}

.status-pending {
  background: rgba(212, 155, 132, 0.2);
  color: var(--primary);
}

.status-cancelled {
  background: rgba(198, 40, 40, 0.12);
  color: var(--danger);
}

@media (max-width: 1100px) {
  .metrics-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart-row.two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 254px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 32px rgba(24, 18, 16, 0.2);
  }

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

  .workspace {
    padding: 0 18px 24px;
  }

  .sidebar-toggle {
    display: inline-grid;
    margin-right: 14px;
    color: var(--primary-dark);
    border-color: #d7dadd;
  }

  .topbar {
    min-height: 76px;
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .metrics-panel,
  .report-grid,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .appointment-card,
  .data-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .appointment-actions,
  .data-metrics,
  .mini-actions {
    justify-content: flex-start;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    margin-bottom: 18px;
  }

  .today-label {
    display: none;
  }

  .panel {
    padding: 16px;
  }
}

/* ---------- Full-screen Point of Sale ---------- */

.pos-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.pos-topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: #26292c;
  color: #fff;
  flex-wrap: wrap;
}

.pos-topbar .icon-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.pos-topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-topbar-title h1 {
  font-size: 1.15rem;
  margin: 0;
}

.pos-topbar-stats {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.pos-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pos-stat span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  color: rgba(255, 255, 255, 0.6);
}

.pos-stat strong {
  font-size: 1.05rem;
}

.pos-topbar-actions {
  display: flex;
  gap: 10px;
}

.pos-topbar-actions .secondary-btn {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.pos-register-closed {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pos-register-closed-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 32px;
  width: min(360px, 100%);
  text-align: center;
}

.pos-register-closed-card h2 {
  margin: 0 0 8px;
}

.pos-register-closed-card p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 0.9rem;
}

.pos-register-closed-card .field-group {
  text-align: left;
  margin-bottom: 16px;
}

/* ---------- Generic modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 14, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 24px;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-box:has(.report-print) {
  width: min(920px, 96vw);
}

.report-print {
  font-family: inherit;
}

.report-print-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.report-print-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0;
}

.report-print-kpis div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 140px;
}

.report-print-kpis span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  color: var(--muted);
}

.report-print-kpis strong {
  font-size: 1.05rem;
}

.report-print .data-table {
  min-width: 0;
  font-size: 0.8rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--muted);
  border-color: var(--line);
}

.modal-close:hover {
  background: var(--panel-alt);
}

.modal-content h2 {
  margin: 0 0 14px;
  padding-right: 30px;
}

/* ---------- Receipt ---------- */

.receipt {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  max-width: 340px;
  margin: 0 auto;
  color: #1a1a1a;
}

.receipt-header {
  text-align: center;
  margin-bottom: 2px;
}

.receipt-header strong {
  font-size: 1.15rem;
  display: block;
  font-weight: 700;
}

.receipt-header span {
  display: block;
  font-size: 0.78rem;
  color: #333;
}

.receipt-title {
  text-align: center;
  font-weight: 700;
  text-decoration: underline;
  margin: 8px 0 6px;
}

.receipt-divider {
  border-top: 1px dashed #888;
  margin: 8px 0;
}

.receipt-meta-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

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

.receipt-table th:last-child,
.receipt-table td:last-child {
  padding-right: 0;
}

.receipt-table th {
  border-bottom: 1px dashed #888;
  font-weight: 700;
}

.receipt-table th:not(:first-child),
.receipt-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.15rem;
}

.receipt-summary-line {
  font-size: 0.76rem;
  text-align: center;
}

.receipt-footer {
  text-align: center;
  font-weight: 700;
  margin-top: 4px;
}

.receipt-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.receipt-line-discount {
  color: var(--danger);
  font-size: 0.72rem;
}

.receipt-line-staff {
  color: #555;
  font-size: 0.68rem;
  font-style: italic;
}

.held-bill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.held-bill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.held-bill-item strong {
  display: block;
  margin-bottom: 2px;
}

.held-bill-item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.held-bill-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.payment-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-total-due {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--panel-alt, #eceeef);
}

.payment-total-due strong {
  font-size: 1.3rem;
}

.payment-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.payment-row select,
.payment-row input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.9rem;
}

.payment-row-remove {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.payment-row-spacer {
  width: 28px;
  display: inline-block;
}

.payment-voucher-code-input {
  grid-column: 1 / -1;
  text-transform: uppercase;
}

.payment-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.payment-balance-due,
.payment-balance-change {
  font-weight: 700;
  text-align: right;
}

.payment-balance-due {
  color: var(--danger);
}

.payment-balance-change {
  color: var(--success);
}

@media (max-width: 900px) {
  .pos-main {
    padding: 14px;
  }

  .pos-topbar-stats {
    margin-left: 0;
    order: 3;
    width: 100%;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #modal-overlay,
  #modal-overlay * {
    visibility: visible;
  }

  #modal-overlay {
    position: absolute;
    inset: 0;
    background: #fff;
    padding: 0;
  }

  .modal-close,
  .receipt-actions {
    display: none !important;
  }
}
