/* ============================================================
   css/styles.css — SmartPOS v3 Production Stylesheet
   ============================================================ */

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: #131313; }
::-webkit-scrollbar-thumb        { background: #353534; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: #5b4137; }
.scrollbar-hide                  { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ─── Material Symbols ──────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none; line-height: 1; vertical-align: middle;
}
.ms-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ─── Number input no-spin ──────────────────────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

/* ─── Toast ─────────────────────────────────────────────────── */
.toast-notification {
  position: fixed; bottom: 22px; right: 22px;
  background: #ff5c00; color: #000;
  padding: 11px 18px; border-radius: 10px;
  font-weight: 700; font-size: 13px; font-family: 'Plus Jakarta Sans', sans-serif;
  z-index: 9999; transform: translateY(60px); opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
  pointer-events: none; max-width: 340px;
}
.toast-notification.show    { transform: translateY(0); opacity: 1; }
.toast-notification.success { background: #00a958; color: #fff; }
.toast-notification.error   { background: #93000a; color: #ffdad6; }

/* ─── Modal overlay ─────────────────────────────────────────── */
.modal-overlay { display: none; }
.modal-overlay.open {
  display: flex !important;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.80);
  z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(3px); padding: 16px;
}

/* ─── Section visibility ────────────────────────────────────── */
.pos-section            { display: none !important; }
.pos-section.section-active { display: flex !important; }

/* ─── Nav link ──────────────────────────────────────────────── */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 8px;
  cursor: pointer; font-weight: 700; font-size: 13px;
  color: #ab897d; border-left: 3px solid transparent;
  transition: background .13s, color .13s;
  text-decoration: none; white-space: nowrap;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.nav-link:hover  { background: #201f1f; color: #e5e2e1; }
.nav-active      { background: #201f1f !important; color: #ffb59a !important; border-left-color: #ff5c00 !important; }

/* ─── Product card ──────────────────────────────────────────── */
.product-card {
  background: #1c1b1b; border: 1.5px solid #2a2a2a;
  border-radius: 12px; cursor: pointer;
  transition: border-color .13s, transform .1s;
  overflow: hidden; display: flex; flex-direction: column;
}
.product-card:hover  { border-color: #ff5c00; transform: translateY(-2px); }
.product-card:active { transform: scale(.97); }
.product-card.unavailable { opacity: .35; pointer-events: none; }

/* ─── Cart item ─────────────────────────────────────────────── */
.cart-item {
  background: #201f1f; border: 1px solid #2a2a2a;
  border-radius: 10px; padding: 10px 11px; margin-bottom: 7px;
}

/* ─── Qty buttons ───────────────────────────────────────────── */
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #2a2a2a; border: none; color: #e5e2e1;
  cursor: pointer; font-size: 16px; font-weight: 700;
  transition: background .1s; flex-shrink: 0; font-family: inherit;
}
.qty-btn:hover { background: #353534; }

/* ─── Pay / Status toggle buttons ───────────────────────────── */
.pay-btn {
  flex: 1; height: 38px; border-radius: 8px;
  font-weight: 700; font-size: 12px; cursor: pointer;
  border: 1.5px solid #5b4137; background: #201f1f; color: #ab897d;
  transition: all .13s; display: flex; align-items: center;
  justify-content: center; gap: 5px; font-family: 'Plus Jakarta Sans', sans-serif;
}
.pay-btn:hover         { border-color: #ab897d; color: #e5e2e1; }
.pay-btn.active        { background: #ff5c00; border-color: #ff5c00; color: #000; }
.pay-btn.active-red    { background: #a40213; border-color: #a40213; color: #ffdad6; }

/* ─── Category tab buttons ──────────────────────────────────── */
.cat-tab {
  padding: 7px 16px; border-radius: 100px;
  font-weight: 700; font-size: 12px; cursor: pointer;
  border: 1.5px solid #5b4137; color: #ab897d; background: #1c1b1b;
  white-space: nowrap; transition: all .13s; height: 36px;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.cat-tab:hover  { border-color: #ab897d; color: #e5e2e1; }
.cat-tab.active { background: #a40213; border-color: #a40213; color: #fff; }

/* ─── Status badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 100px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-paid   { background: #003419; color: #4ae183; }
.badge-unpaid { background: #93000a40; color: #ffdad6; border: 1px solid #93000a; }

/* ─── Table cards ───────────────────────────────────────────── */
.table-card {
  background: #1c1b1b; border: 2px solid #2a2a2a;
  border-radius: 14px; cursor: pointer;
  transition: border-color .18s, transform .14s;
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; min-height: 120px;
}
.table-card:hover      { border-color: #ff5c00; transform: scale(1.02); }
.table-card.available  { border-color: #00a958; }
.table-card.occupied   { border-color: #a40213; }

/* ─── Data table ────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  background: #201f1f; color: #ab897d;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; padding: 9px 13px;
  text-align: left; border-bottom: 1px solid #2a2a2a; white-space: nowrap;
}
.data-table td           { padding: 10px 13px; border-bottom: 1px solid #1c1b1b; color: #e5e2e1; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #201f1f; }
.data-table .num         { text-align: right; font-family: 'Archivo Narrow', sans-serif; font-weight: 700; }

/* ─── Card ──────────────────────────────────────────────────── */
.card          { background: #1c1b1b; border: 1px solid #2a2a2a; border-radius: 14px; overflow: hidden; }
.card-hdr      { padding: 13px 17px; border-bottom: 1px solid #2a2a2a; display: flex; justify-content: space-between; align-items: center; }
.card-title    { font-family: 'Archivo Narrow', sans-serif; font-weight: 700; font-size: 15px; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  background: #ff5c00; color: #000; font-weight: 700; font-size: 14px;
  border: none; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: opacity .13s; font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 3px 14px rgba(255,92,0,.35);
}
.btn-primary:hover  { opacity: .88; }
.btn-primary:active { opacity: .76; transform: scale(.98); }

.btn-secondary {
  background: #2a2a2a; border: 1px solid #353534; border-radius: 8px;
  color: #e5e2e1; font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .13s; font-family: 'Plus Jakarta Sans', sans-serif; padding: 0 14px;
}
.btn-secondary:hover { border-color: #5b4137; }

.btn-danger {
  background: #93000a20; border: 1px solid #93000a; border-radius: 8px;
  color: #ffb4ab; font-weight: 700; cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif; transition: background .13s;
}
.btn-danger:hover { background: #93000a40; }

/* ─── Form inputs ───────────────────────────────────────────── */
.form-input {
  width: 100%; background: #2a2a2a; border: 1.5px solid #353534;
  border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #e5e2e1;
  outline: none; transition: border-color .13s; font-family: 'Plus Jakarta Sans', sans-serif;
}
.form-input:focus       { border-color: #ff5c00; }
.form-input::placeholder { color: #5b4137; }
.form-input option       { background: #2a2a2a; }
.form-label {
  display: block; font-size: 10px; font-weight: 700; color: #ab897d;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px;
}

/* ─── Stat card ─────────────────────────────────────────────── */
.stat-card {
  background: #2a2a2a; border-radius: 12px; padding: 18px;
  border-top: 4px solid #ff5c00; position: relative; overflow: hidden;
  transition: background .13s;
}
.stat-card:hover    { background: #353534; }
.stat-card.green    { border-top-color: #4ae183; }
.stat-card.red      { border-top-color: #a40213; }
.stat-card.teal     { border-top-color: #00a958; }
.stat-label { font-size: 10px; font-weight: 700; color: #ab897d; text-transform: uppercase; letter-spacing: .07em; }
.stat-value { font-family: 'Archivo Narrow', sans-serif; font-weight: 700; font-size: 28px; color: #e5e2e1; line-height: 1.1; margin-top: 6px; }
.stat-sub   { font-size: 12px; color: #5b4137; margin-top: 4px; }

/* ─── Size picker ───────────────────────────────────────────── */
.size-option {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 13px 15px; background: #201f1f; border: 1.5px solid #2a2a2a;
  border-radius: 10px; cursor: pointer; color: #e5e2e1;
  font-family: 'Plus Jakarta Sans', sans-serif; transition: border-color .13s;
}
.size-option:hover { border-color: #ff5c00; }

/* ─── Shift pulse ───────────────────────────────────────────── */
.shift-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ae183; flex-shrink: 0;
  animation: pulse-shift 2s infinite;
}
@keyframes pulse-shift { 0%,100%{ opacity:1; } 50%{ opacity:.3; } }

/* ─── Spin animation ────────────────────────────────────────── */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Status dot ────────────────────────────────────────────── */
.dot-green { background: #4ae183; }
.dot-red   { background: #ffb4ab; }
.pulse     { animation: dot-pulse 2.5s infinite; }
@keyframes dot-pulse { 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: #353534; }
.empty-state .material-symbols-outlined { font-size: 52px; display: block; margin-bottom: 10px; }
.empty-state p { font-size: 13px; font-weight: 700; }

/* ─── Preset chip ───────────────────────────────────────────── */
.preset-chip {
  background: #2a2a2a; border: 1px solid #353534; border-radius: 6px;
  padding: 4px 10px; color: #e5e2e1; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; transition: all .12s;
}
.preset-chip:hover { border-color: #ff5c00; color: #ff5c00; }

/* ─── Invoice styles ────────────────────────────────────────── */
#invoice-paper { background: white; color: #1a1a1a; }
.inv-divider   { border: none; border-top: 1px dashed #ccc; margin: 8px 0; }

/* ─── Print ─────────────────────────────────────────────────── */
@media print {
  body > *                     { visibility: hidden; }
  #print-area, #print-area *   { visibility: visible; }
  #print-area {
    position: fixed; inset: 0; background: white; color: black;
    display: block; padding: 12px; z-index: 99999; font-family: 'Courier New', monospace;
  }
  .no-print { display: none !important; }
}

/* ─── Loading page ──────────────────────────────────────────── */
.page-loader {
  position: fixed; inset: 0; background: #0e0e0e;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; z-index: 9998;
  transition: opacity .4s ease;
}
.page-loader.done { opacity: 0; pointer-events: none; }
