﻿
tr:last-child td { border-bottom: 0; }

.settings-tabs {
  display: flex;
  gap: 24px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.settings-tabs button {
  flex: 0 0 auto;
  min-height: 48px;
  background: transparent;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-weight: 700;
}

.settings-tabs button.active {
  color: #0f513f;
  border-bottom-color: #0f513f;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  gap: 18px;
  align-items: start;
}

.settings-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.settings-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: #ecfdf5;
  color: #0f7a5c;
  font-size: 12px;
  font-weight: 800;
}

.settings-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.settings-metrics div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #b7e4d4;
  border-radius: 14px;
  padding: 12px;
  background: #f3fff9;
}

.settings-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-metrics strong {
  color: #0f513f;
  font-size: 22px;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #b7e4d4;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3fff9, #ffffff);
}

.settings-import-panel h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-import-panel p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.settings-import-panel span {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f7a5c;
  font-size: 12px;
  font-weight: 900;
}

.settings-supabase-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #d7e7df;
  border-radius: 14px;
  background: #ffffff;
}

.settings-supabase-panel h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-supabase-panel p {
  margin: 0 0 4px;
  color: #0f513f;
  font-weight: 800;
}

.settings-supabase-panel small {
  color: var(--muted);
}

.settings-supabase-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.settings-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-weight: 700;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #0f7a5c;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-restore {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-restore h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-restore p {
  margin: 0;
  color: var(--muted);
}

.settings-restore textarea {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.receipt-settings-panel {
  position: sticky;
  top: 18px;
}

.receipt-preview-box {
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: 18px;
  background: #f1f5f9;
  overflow: hidden;
}

.receipt-paper {
  width: min(270px, 100%);
  display: grid;
  gap: 5px;
  padding: 20px;
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
  color: #111827;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.receipt-paper i {
  display: block;
  border-top: 1px dashed #94a3b8;
  margin: 5px 0;
}

.receipt-paper span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.receipt-paper .receipt-date-row {
  justify-content: center;
  text-align: center;
}

.receipt-paper > span:nth-child(-n+4),
.receipt-paper small {
  display: block;
}

.receipt-paper strong {
  font-size: 14px;
  font-weight: 600;
}

.receipt-paper b {
  font-weight: 600;
}

.receipt-paper .receipt-store-name {
  font-size: 15px;
  font-weight: 700;
}

.receipt-paper .receipt-address {
  font-size: 12px;
  font-weight: 600;
}

.receipt-paper .receipt-note {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.receipt-paper .receipt-footer-note {
  font-weight: 650;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.receipt-paper em {
  width: calc(min(var(--receipt-logo-chars, 12), 32) * 7px);
  min-height: 34px;
  height: auto;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 0;
  font-style: normal;
  font-size: 10px;
}

.receipt-paper em img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
}

.receipt-paper.receipt-image-b em {
  border: 0;
  padding: 0;
  border-radius: 0;
}

.receipt-after-payment-gap {
  display: block !important;
  height: 1em;
}

.drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9,20,38,.45);
  z-index: 10;
  padding: 20px;
}

.drawer.open {
  display: grid;
  place-items: center;
  z-index: 60;
}

.modal {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.modal-card {
  width: min(900px, 100%);
  max-height: 90vh;
  overflow: auto;
  overscroll-behavior: contain;
  background: white;
  border-radius: 22px;
  padding: 18px;
  align-self: center;
  justify-self: center;
}

.modal-card:has(.kitchen-availability-title) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card:has(.kitchen-availability-title) .kitchen-menu-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.modal-card:has(.app-confirm) {
  width: min(390px, calc(100vw - 32px));
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.app-confirm {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  text-align: center;
  background:
    radial-gradient(circle at 84% 4%, rgba(79, 185, 143, .22), transparent 38%),
    linear-gradient(145deg, #ffffff, #f1fbf7);
  border: 1px solid rgba(117, 205, 171, .45);
}

.app-confirm-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(44, 158, 121, .14);
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.app-confirm-mark.danger {
  background: #ffe7e7;
  color: #be123c;
}

.app-confirm-copy {
  display: grid;
  gap: 4px;
}

.app-confirm-copy span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-confirm-copy h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.3;
}

.app-confirm-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.app-confirm-actions .btn {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  justify-content: center;
  font-size: 14px;
}

.app-confirm-cancel {
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -42%) scale(.96);
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  background: #0f513f;
  color: white;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 28px 70px rgba(15,23,42,.28);
  display: none;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
}

.toast.show {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: toast-pop .18s ease-out;
}

@keyframes toast-pop {
  from { opacity: 0; transform: translate(-50%, -42%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 88px minmax(0, 1fr); }
  .brand h1, .brand p, .nav-label, .sync-card { display: none; }
  .sidebar { padding: 16px 10px; }
  .nav button, .nav a { justify-content: center; padding: 0; }
  .pos-layout {
    grid-template-columns: minmax(0, 1fr) minmax(430px, min(40vw, 700px));
  }
  .cart-panel {
    position: static;
    max-height: none;
  }
  .pos-mode .page {
    padding: 12px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .dashboard-hero {
    padding: 20px;
    gap: 16px;
  }
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
  .report-monitor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .products-control-bar {
    grid-template-columns: 1fr;
  }

  .products-list-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .products-search {
    min-height: 46px;
  }

  .products-select-field select {
    min-height: 44px;
  }
}

