/* =========================
   SIDEBAR SLIDE — FINAL OVERRIDE
   ========================= */

/* DESKTOP */
.menu-toggle {
  position: fixed;
  top: 16px;
  left: 16px;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  font-weight: 700;

  background: rgba(15, 23, 42, 0.85); /* darker glass */
  color: #ffffff; /* 🔥 FORCE WHITE */

  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;

  cursor: pointer;
  z-index: 1100;

  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.menu-toggle span {
  position: absolute;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.35s ease;
}

.menu-toggle span:nth-child(1) {
  transform: translateY(-6px);
}
.menu-toggle span:nth-child(2) {
  opacity: 1;
}
.menu-toggle span:nth-child(3) {
  transform: translateY(6px);
}
body.sidebar-open .menu-toggle span:nth-child(1) {
  transform: rotate(45deg);
}

body.sidebar-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

body.sidebar-open .menu-toggle span:nth-child(3) {
  transform: rotate(-45deg);
}
/* =====================================================
   POS UI — FINAL LOCK
   Any change here must be intentional.
   Do NOT tweak spacing without review.
   ===================================================== */
:root {
  /* Surface */
  --bg-main: #0b0f14;
  --bg-surface: #121821;
  --bg-card: #161d29;

  /* Text */
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-accent: var(--accent);

  /* Numbers */
  --number-accent: var(--accent);

  /* Borders */
  --border-soft: rgba(255, 255, 255, 0.06);
}

:root {
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
}

/* Sections */
.dashboard-section {
  margin-bottom: var(--space-xl);
}

/* Grids */
.dashboard-grid {
  gap: var(--space-lg);
  row-gap: 26px;
  column-gap: 26px;
}

/* Cards */
.card {
  padding: 22px;
  margin-bottom: 0; /* prevent stacking collapse */
}

/* Actions */
.dashboard-action {
  margin-top: var(--space-xl);
  gap: 16px;
}

/* =========================
                       GLOBAL RESET
                    ========================= */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(1200px circle at top, #121821, #0b0f14);
  color: var(--text-primary);
}
.hidden {
  display: none;
}

.install-app-btn {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  background: var(--app-accent, #c7a062);
  color: var(--app-button-text, #121212);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}
/* =========================
  HELPERS
========================= */
.view {
  width: 100%;
}

.text-secondary {
  color: var(--text-secondary);
}

/* 🔒 NUMBER LOCK — SINGLE SOURCE */
.number,
.money,
.kpi-value,
.pos-amount,
.receipt-row strong,
.receipt-row.total strong {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--number-accent) !important;
}

/* =========================
                       HEADER
                    ========================= */
header {
  top: 0;
  z-index: 50;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px 22px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );

  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

header strong {
  font-size: 15px;
}

header span {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-logout {
  padding: 8px 14px;
  border-radius: 10px;
  background: #dc2626;
  color: white;
  border: none;
  cursor: pointer;
}

/* =========================
   GRADIENT BACKGROUND
========================= */

.login-gradient-bg {
  inset: -20%;
  z-index: 1;
  pointer-events: none;

  background: radial-gradient(circle at 15% 35%, #bfa45a 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, #3b2f1c 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, #111 0%, transparent 55%),
    linear-gradient(120deg, #1a1a1a, #5a4a2c, #d1b56a);

  filter: blur(80px) saturate(1.05);
  animation: loginGradientMove 18s ease-in-out infinite alternate;
}

/* Motion (THIS is what you liked 👇) */
@keyframes loginGradientMove {
  0% {
    transform: translate(0%, 0%) scale(1);
  }
  50% {
    transform: translate(-6%, 4%) scale(1.06);
  }
  100% {
    transform: translate(6%, -4%) scale(1.04);
  }
}

/* =========================
   CENTER CONTENT
========================= */

.login-content {
  position: relative;
  z-index: 2;

  height: 100vh;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;

  padding: 48px;
  color: #fff;
}

/* Left side */
.login-brand {
  max-width: 420px;
}

.login-brand h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.login-brand .tagline {
  opacity: 0.75;
  margin-bottom: 24px;
}

.login-brand ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.login-brand li {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 6px;
}

/* =========================
   LOGIN CARD
========================= */

.login-card {
  width: 300px;
  padding: 28px;

  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  border-radius: 18px;

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-card h2 {
  margin: 0 0 8px;
}

.text-secondary {
  opacity: 0.7;
  font-size: 14px;
}

.btn-primary {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border-radius: 999px;

  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #d1b56a, #9e7c32);
  color: #1a1a1a;
  font-weight: 600;
}
/* =========================
                       TABS
                    ========================= */
.tabs {
  display: flex;
  gap: 12px;
  padding: 8px;
  margin: 16px 0 24px;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
}

.tabs button {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;

  transition: all 0.15s ease;
}

.tabs button.active {
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    rgba(255, 255, 255, 0.05)
  );
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
  box-shadow: 0 6px 18px var(--accent-glow);
}

/* =========================
                       LAYOUT
                    ========================= */
.dashboard-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 20px;
}

.dashboard-section {
  margin-bottom: 40px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.dashboard-grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}
.top-right-clock {
  position: fixed;
  top: 16px;
  right: 20px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  z-index: 999;
}

.clock-identity {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--app-text, #f8fafc);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-soft);
}

.clock-date {
  font-size: 12px;
  opacity: 0.75;
}

.clock-time {
  font-size: 18px;
  font-weight: 700;
}
.clock-role {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
  background: #222;
  color: #fff;
}

.clock-release {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--app-text, #f8fafc);
  background: rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border-soft);
}

/* Optional role colors */
.clock-role.admin {
  background: #7c3aed; /* purple */
}

.clock-role.receptionist {
  background: #2563eb; /* blue */
}

.clock-role.staff {
  background: #16a34a; /* green */
}

.bridge-status {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.bridge-status-live-gas {
  background: rgba(16, 185, 129, 0.16);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.45);
}

.bridge-status-live-web {
  background: rgba(59, 130, 246, 0.16);
  color: #1e3a8a;
  border-color: rgba(59, 130, 246, 0.45);
}

.bridge-status-fallback {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.5);
}

.bridge-status-error {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.45);
}

.bridge-status-unknown {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.45);
}

.admin-presence-summary {
  display: flex;
  gap: 14px;
  margin: 8px 0 10px;
  font-size: 13px;
}

.admin-presence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-presence-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-presence-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-presence-meta {
  opacity: 0.72;
  font-size: 12px;
}

.admin-presence-right {
  font-size: 12px;
  opacity: 0.86;
  white-space: nowrap;
}

.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.24);
}

.presence-dot.is-online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.24);
}

.presence-dot.is-offline {
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.28);
}
/* Top bar */
.top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 16px;
  font-size: 13px;
  color: #aaa;
}

.role-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #222;
  font-weight: 600;
}

/* Menu items */
.nav-item {
  display: block;
  padding: 14px 18px;
  color: #fff;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
/* =========================
                       CARDS
                    ========================= */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );

  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* =========================
                       KPI
                    ========================= */
.kpi {
  position: relative;
  min-height: 120px;
  overflow: auto;
  animation: kpiPulse 6s ease-in-out infinite;
}

.kpi-label {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 26px;
  margin-top: 6px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Accent underline */
.kpi::after {
  content: '';
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

/* Glow animation */
@keyframes kpiPulse {
  0%,
  100% {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  50% {
    box-shadow: 0 18px 44px var(--accent-glow),
      inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

/* =========================
                       BUTTON SYSTEM
                    ========================= */
.btn {
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;

  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.25s ease;
}

/* === PRIMARY ACTION (ONE SOURCE OF TRUTH) === */
.btn-primary {
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;

  background: linear-gradient(135deg, var(--accent), var(--accent-soft));

  color: #052e16;
  border: 1px solid var(--accent-border);

  box-shadow: 0 10px 26px var(--accent-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 42px var(--accent-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.btn-secondary {
  background: #1f2937;
  color: var(--text-primary);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.btn-soft-green {
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;

  background: linear-gradient(135deg, var(--accent), var(--accent-soft));

  color: #052e16;
  border: 1px solid var(--accent-border);

  box-shadow: 0 10px 26px var(--accent-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* =========================
                       POS
                    ========================= */
:root {
  --pos-action-height: 96px;
}
.pos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
}
/* =========================
                       POS LAYOUT LOCK
                    ========================= */

#posView {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.pos-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 16px;
  overflow-y: auto;
}
.pos-left,
.pos-right {
  overflow-y: auto;
  padding-bottom: calc(var(--pos-action-height) + 16px);
}
.pos-left,
.pos-right {
  overflow-y: auto;
  padding-bottom: 100px; /* space for bottom actions */
}
.pos-right .card,
.pos-left .card {
  margin-bottom: 12px;
}
.card.kpi {
  padding: 14px 16px;
}

.kpi-value {
  font-size: 1.4rem;
}
.dashboard-action {
  height: var(--pos-action-height);
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.75));
}

.dashboard-action {
  height: 96px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
/* =========================
                       POS CARD SPACING
                    ========================= */

.pos-left .card,
.pos-right .card {
  margin-bottom: 12px; /* was too big */
}

/* =========================
                       POS FOOTER LOCK
                    ========================= */

.pos-footer {
  padding-top: 12px;
  display: grid;
  gap: 8px;
}
.dashboard-grid {
  gap: 10px;
}
.kpi {
  padding: 14px;
}
/* =========================
                       POS MODE INDICATORS
                    ========================= */

body.advance-mode .pos-right {
  border: 2px dashed rgba(234, 179, 8, 0.45);
}

body.advance-mode .kpi-value {
  color: #eab308;
}

body.advance-mode #advanceNotice {
  display: block;
}
/* =========================
                       RECEIPT (FINAL – THERMAL + PREMIUM)
                    ========================= */

.receipt {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
}

/* rows inside receipt */
.receipt .pos-row,
.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  margin: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}
.receipt-flag {
  text-align: center;
  margin: 10px 0;
  padding: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  font-size: 11px;
  opacity: 0.85;
}
/* remove line on last row */
.receipt .pos-row:last-child,
.receipt-row:last-child {
  border-bottom: none;
}

/* totals */
.receipt .total {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 10px;
}

/* footer */
.receipt-footer {
  text-align: center;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.85;
}


/* =========================
                       SETTINGS PANEL
                    ========================= */
.settings-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-surface);
  padding: 20px;
  z-index: 9999;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.color-editor {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.color-target-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  font-size: 12px;
}

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

/* =========================
                       PRINT (LETTER / THERMAL)
========================= */
/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #111;
  color: #fff;
  width: 360px;
  padding: 20px;
  border-radius: 12px;
}

.modal-card input,
.modal-card textarea {
  width: 100%;
  margin: 6px 0 12px;
  padding: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.logout-action-card {
  width: min(420px, 92vw);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--app-card), rgba(0, 0, 0, 0.2));
  color: var(--app-text);
}

.logout-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0 8px;
}

.logout-action-grid .btn {
  width: 100%;
}
/* POS LOCK STATE */
#posView.locked {
  pointer-events: none;
  opacity: 0.6;
}
#posView.locked .receipt {
  opacity: 1;
  pointer-events: auto;
}
/* SECTION SPACING */
.dashboard-section {
  margin-bottom: 50px;
}

/* GRID BREATHING */
.dashboard-grid {
  gap: 26px;
  row-gap: 28px;
  column-gap: 28px;
}

/* CARD BREATHING */
.card {
  padding: 24px;
  margin-bottom: 24px;
}
.client-btn {
  padding: 15px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  font-weight: 600;
}

.client-btn.active {
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    rgba(255, 255, 255, 0.08)
  );
  box-shadow: 0 8px 22px var(--accent-glow);
}
.pay-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    rgba(255, 255, 255, 0.06)
  );
  font-weight: 700;
}

.pay-btn.active {
  box-shadow: 0 12px 30px var(--accent-glow);
}
.pos-right input[type='number'] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.pos-right input[type='number']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.payment-status {
  margin-top: 8px;
  font-size: 1rem;
}

.payment-status.warn {
  color: #facc15;
}

.payment-status.danger {
  color: #ef4444;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.payment-status.success {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.id-capture-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.id-capture-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.id-capture-status {
  margin: 8px 0 0;
  font-size: 12px;
}

.id-capture-preview {
  margin-top: 10px;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.15);
}
.payment-unified {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-btn.active {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

/* === PAYMENT / AMOUNT INPUTS (POS) === */
.input-money {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );

  border: 1px solid var(--border-soft);
  color: var(--text-primary);

  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* =========================
                       CURRENCY HINT
                    ========================= */

.input-money {
  font-variant-numeric: tabular-nums;
}

.input-money::placeholder {
  color: var(--text-secondary);
}

/* Focus state */
.input-money:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Remove ugly number arrows */
.input-money::-webkit-outer-spin-button,
.input-money::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-money[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.pay-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

body.advance-mode .payment-methods {
  opacity: 0.6;
}

body.advance-mode .payment-status {
  color: #eab308;
}
/* =========================
    LOGIN PAGE — FINAL
  ========================= */
.login-view {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center; /* vertical center */
  justify-content: center; /* horizontal center */
  position: relative;
  z-index: 1;
}
.login-wrapper {
  max-width: 960px;
  width: 100%;
  padding: 40px 48px;
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.login-info h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.login-info .subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.benefits {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits li {
  font-size: 14px;
  line-height: 1.8;
  opacity: 0.8;
}

.login-card {
  padding: 36px;
  border-radius: 20px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );

  border: 1px solid var(--border-soft);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);

  backdrop-filter: blur(14px);
}

.login-card h2 {
  margin: 0 0 8px;
}

.login-card button {
  width: 100%;
  margin-top: 18px;
}

/* LOGIN BACKGROUND */
body.login-active .login-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background: radial-gradient(circle at 20% 30%, #c9a24d 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, #6b4e2e 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, #1a1a1a 0%, transparent 55%),
    radial-gradient(circle at 70% 60%, #f5f1e6 0%, transparent 60%);

  filter: blur(80px);
  animation: goldFlow 28s ease-in-out infinite alternate;
  transform: translateZ(0);
}
body.login-active .login-gradient-bg {
  pointer-events: none;
}

body:not(.login-active) .login-gradient-bg {
  display: none;
}
/* 🚫 HARD STOP when not on login */
body:not(.login-active) .login-gradient-bg {
  display: none !important;
}

.pay-btn {
  padding: 10px 16px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);

  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;

  transition: all 0.15s ease;
}
.pay-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));

  color: #052e16;
  border-color: var(--accent-border);

  box-shadow: 0 10px 26px var(--accent-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.pay-btn:hover {
  border-color: var(--accent-border);
  color: var(--text-primary);
}
.client-btn {
  padding: 10px 16px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);

  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;

  transition: all 0.15s ease;
}
.client-btn {
  padding: 10px 16px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);

  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;

  transition: all 0.15s ease;
}
.client-btn:hover {
  border-color: var(--accent-border);
  color: var(--text-primary);
}
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}
.btn,
.client-btn,
.pay-btn {
  position: relative;
  z-index: 2;
}
.client-profile-card {
  padding: 24px;
}

.profile-header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-field.full-width {
  grid-column: span 2;
}
#salesView.locked {
  pointer-events: none;
}

#salesView.locked .receipt,
#salesView.locked #printReportBtn {
  pointer-events: auto;
  opacity: 1;
}
.receipt-meta {
  margin-top: 12px;
  font-size: 10px;
  color: #555;
  text-align: left;
}
/* =========================
                       REPORT — RECEIPT MODE
                    ========================= */
.report.receipt-mode {
  width: 80mm;
  margin: 0 auto;
  padding: 10px 8px;

  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;

  background: white;
  color: black;
}

.report.receipt-mode h3 {
  text-align: center;
  font-size: 13px;
  margin-bottom: 2px;
}

.report.receipt-mode p {
  text-align: center;
  margin: 0;
}

.report.receipt-mode .report-meta {
  font-size: 10px;
  margin-bottom: 8px;
}

.report.receipt-mode .section {
  margin-top: 10px;
}

.report.receipt-mode .row {
  display: flex;
  justify-content: space-between;
  margin: 3px 0;
}

.report.receipt-mode hr {
  border: none;
  border-top: 1px dashed #000;
  margin: 6px 0;
}
/* =========================
                       REPORT — STANDARD MODE
                    ========================= */
.report.standard-mode {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px;

  font-family: 'Inter', sans-serif;
  font-size: 14px;

  background: white;
  color: #111;
}

.report.standard-mode h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.report.standard-mode .section {
  margin-top: 24px;
}

.report.standard-mode table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.report.standard-mode th,
.report.standard-mode td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.report.standard-mode .total {
  font-weight: 700;
  font-size: 16px;
}
.report-watermark {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 64px;
  font-weight: 900;
  letter-spacing: 8px;

  color: rgba(0, 0, 0, 0.08);
  transform: rotate(-20deg);
  pointer-events: none;
}

.report.copy .report-watermark {
  display: flex;
}
@media print {
  body * {
    visibility: hidden;
  }

  .report,
  .report * {
    visibility: visible;
  }

  @page {
    margin: 0;
  }
}
.search-package-row.active {
  background: rgba(34, 197, 94, 0.15);
  outline: 1px solid var(--accent);
}
/* SESSION CLAIM CONTROLS */
#sessionControls .dashboard-grid {
  gap: 12px;
}

#sessionControls .btn {
  width: 100%;
  padding: 12px 14px;
  font-weight: 600;
  border-radius: 14px;
  transition: all 0.2s ease;
}

/* subtle emphasis */
#sessionControls .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent-border), 0 6px 18px rgba(0, 0, 0, 0.35);
}
#sharingControls input {
  margin-top: 6px;
  border-radius: 14px;
}

#sharingControls p {
  opacity: 0.75;
}
#advancePaymentBtn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  font-weight: 600;
  opacity: 0.9;
}

#advancePaymentBtn:hover {
  opacity: 1;
  box-shadow: 0 0 0 1px var(--accent-border), 0 8px 22px rgba(0, 0, 0, 0.45);
}
#advanceNotice {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(234, 179, 8, 0.15);
  color: #fde68a;
  font-size: 13px;
  display: none; /* IMPORTANT */
}
body.advance-mode .pos-right {
  border: 2px dashed rgba(234, 179, 8, 0.5);
}

body.advance-mode .kpi-value {
  color: #eab308;
}
.pos-right .btn {
  letter-spacing: 0.2px;
}

.pos-right .dashboard-action {
  gap: 12px;
}
/* CAPSULE INPUTS */
.branch-select,
.branch-select-capsule,
.input-money {
  border-radius: 999px;
  padding: 12px 16px;
  border: 1px solid var(--accent-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: all 0.2s ease;
}
.branch-select:focus,
.branch-select-capsule:focus,
.input-money:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border), 0 0 0 3px rgba(34, 197, 94, 0.25);
  background: rgba(255, 255, 255, 0.06);
}
.branch-select:disabled,
.branch-select-capsule:disabled,
.input-money:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.branch-select-capsule {
  font-weight: 500;
  letter-spacing: 0.3px;
}
.monthly-highlights-textarea {
  border-radius: 24px;
  padding: 14px 16px;
  resize: vertical;
}
.input-money {
  text-align: right;
  padding-right: 18px;
}
.btn.active,
.pay-btn.active,
.client-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent-border), 0 6px 18px rgba(34, 197, 94, 0.35);
}
button:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.4);
}
button:disabled::after {
  content: '🔒';
  margin-left: 6px;
  opacity: 0.6;
}
.branch-select:focus,
.input-money:focus {
  caret-color: var(--accent);
}
@keyframes caretGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

.branch-select:focus {
  animation: caretGlow 0.6s ease-out;
}
.input-error {
  border-color: #ef4444 !important;
  animation: errorPulse 0.4s ease;
}

@keyframes errorPulse {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}
.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border);
}
.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  cursor: pointer;
  font-size: 13px;
  color: #9ca3af;
}

.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.package-badge {
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  font-size: 12px;
  display: inline-block;
}
.package-badge {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--text-accent);
  font-size: 0.85rem;
}
/* =========================
                       ACTIVE / SELECTED STATES
                    ========================= */

.btn.active,
.btn-primary.active,
.toggle-btn.active,
.pay-btn.active {
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(34, 197, 94, 0.45);
  transform: translateY(-1px);
}
/* =========================
                       DISABLED STATES
                    ========================= */

button:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

button:disabled::after {
  content: 'Not allowed';
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
}
/* =========================
                       DISABLED STATES
                    ========================= */

button:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

button:disabled::after {
  content: 'Not allowed';
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
}
/* =========================
                       ERROR PULSE
                    ========================= */

@keyframes pulse-error {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.input-error {
  animation: pulse-error 0.6s ease-out;
  border-color: #ef4444;
}
/* =========================
                       POS-ONLY SAFETY LOCK
                    ========================= */

#searchView #sessionControls,
#searchView #sharingControls,
#dashboardView #sessionControls,
#dashboardView #sharingControls {
  display: none !important;
}
/* =========================
                       SHARING CHIPS
                    ========================= */

.chip-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.chip.disabled {
  opacity: 0.35;
  pointer-events: none;
}
body.sharing-mode .pos-right {
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.35);
}
.btn.active {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* =========================
                       DISCOUNT — SAFE ENHANCEMENT
                    ========================= */

.discount-card #discountInput {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.discount-card #discountInput.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.discount-card #discountInput:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}
.pay-btn.active {
  background: rgba(34, 197, 94, 0.15);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.input-money {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.input-money.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}
@keyframes subtle-shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

.shake {
  animation: subtle-shake 0.35s ease;
}
.input-money {
  position: relative;
  padding-left: 36px; /* room for ₱ */
}

.input-money::before {
  content: '₱';
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  font-size: 0.9rem;
}
@keyframes success-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.payment-status.success {
  animation: success-pulse 0.6s ease-out;
}
.pos-left .card:first-child {
  padding: 14px 16px; /* reduce from default */
}

.client-type {
  margin-bottom: 10px;
}

.client-walkin input {
  padding: 6px 12px;
}
.pos-left .pos-list .pos-row {
  padding: 2px 6px; /* tighter rows */
}

.pos-left .pos-list {
  gap: 6px;
}
.pos-left .card h4 {
  margin-bottom: 4px;
}
.pos-right .card:first-child {
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.pos-right .card:first-child h4 {
  color: #22c55e;
}
.pos-layout .card {
  margin-bottom: 10px; /* instead of larger gaps */
}
/* Prevent page scrolling */
body {
  overflow-y: auto;
}

/* Legacy duplicate POS/Search layout blocks removed.
   Canonical responsive rules are defined at the end of this file. */
/* =====================================
                       COMPACT VIEWS — GLOBAL
                       ===================================== */

.view.compact-view {
  height: calc(100vh - 72px); /* match POS/Search */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.view.compact-view .view-fixed {
  flex-shrink: 0;
}

.view.compact-view .view-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
}
.view.compact-view .card {
  margin-bottom: 10px;
  padding: 12px 14px;
}

.view.compact-view h4 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.view.compact-view p.text-secondary {
  margin-top: 4px;
  font-size: 0.85rem;
}
.view.compact-view .pos-row {
  padding: 6px 0;
}

.view.compact-view .pos-amount {
  font-size: 0.9rem;
}
.view.compact-view table {
  width: 100%;
  border-collapse: collapse;
}

.view.compact-view th,
.view.compact-view td {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.view.compact-view th {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2;
}
.view.compact-view .view-scroll::-webkit-scrollbar {
  width: 6px;
}

.view.compact-view .view-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}
/* =========================
                       VIEW CONTAINER (FINAL)
                       ========================= */

.view {
  height: 100%;
  overflow-y: auto;
}

.view-inner {
  max-width: none;
  margin: 0 auto;
  padding: 24px;
  height: 100%;
}
.view-inner > h2 {
  margin-bottom: 12px;
}

.view-inner > .text-secondary {
  margin-bottom: 20px;
}
/* =========================
  POS LEGACY LAYOUT NOTES
========================= */
/* Old duplicated POS layout declarations were removed.
   Canonical POS layout is defined in the final responsive block. */

/* Prevent global scroll */
body,
#staffView {
  overflow-y: auto;
}
.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}
.pending-clients {
  background: #ffffff;
  color: #111827;
  max-height: 260px;
  display: flex;
  flex-direction: column;
}

.pending-list {
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 4px;
}

.pending-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  background: #f9fafb;
}

.pending-row:hover {
  background: #f3f4f6;
}

.pending-name {
  font-weight: 500;
}

.pending-total {
  font-weight: 600;
}
.pending-badge {
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
  border: 1px dashed rgba(59, 130, 246, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

body.pending-mode .pending-badge {
  display: inline-block;
}
/* =========================
                     CART — TABLE STYLE (FINAL)
                  ========================= */

.cart-card {
  background: #ffffff;
  color: #111;
}

.cart-card.white {
  background: #fff;
  color: #111;
}

.cart-table {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr 60px 120px 44px;
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
  border-bottom: 1px dashed #e5e7eb;
}

.cart-row.header {
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

.cart-row .right {
  text-align: right;
}

.cart-row .center {
  text-align: center;
}

/* SCROLL */
.cart-body {
  max-height: 320px;
  overflow-y: auto;
}

.cart-summary {
  border-top: 1px solid #e5e7eb;
  margin-top: 10px;
  padding-top: 8px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}

.cart-row:not(.header):hover {
  background: rgba(0, 0, 0, 0.04);
}

.cart-remove-btn {
  border: none;
  background: none;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cart-qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover {
  background: rgba(15, 23, 42, 0.12);
}

.cart-qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.usage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.usage-today {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.35);
}

.usage-advance {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.35);
}

.usage-claim {
  background: rgba(59, 130, 246, 0.14);
  color: #1e3a8a;
  border-color: rgba(59, 130, 246, 0.35);
}

.indicator-badge {
  margin-left: 6px;
}

.indicator-new_service {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
}

.indicator-new_package {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.4);
}

.indicator-special_promo {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.4);
}

.indicator-special_package {
  background: rgba(249, 115, 22, 0.14);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.45);
}

.payment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.pos-offline-banner {
  width: 100%;
  background: rgba(245, 158, 11, 0.15);
  color: #9a3412;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pos-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
/* =========================
POS LAYOUT — FINAL DO NOT TOUCH WITHOUT REVIEW
========================= */
.pos-layout {
  /* locked */
}
.pos-left {
  /* locked */
}
.pos-right {
  /* locked */
}
.pos-bottom-grid {
  /* locked */
}
.cart-card.white {
  /* locked */
}
.payment-box {
  /* locked */
}
.pending-clients {
  /* locked */
}
.discount-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

#discountInput::placeholder {
  opacity: 0.6;
}
/* =========================
                 DISCOUNT CONFIRM ANIMATION
                 ========================= */

@keyframes confirmPulse {
  0% {
    transform: scale(1);
    box-shadow: none;
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.btn.confirmed {
  background: #22c55e !important;
  color: #fff;
  animation: confirmPulse 0.4s ease;
}
/* =========================
                 DISCOUNT BADGE
                 ========================= */

.discount-badge {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  width: fit-content;

  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
}

.nav-item {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 10px 12px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.nav-item.logout {
  color: #ef4444;
}

.nav-item.logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* MAIN */
.main-content {
  overflow: hidden;
  background: radial-gradient(ellipse at top, #0f172a, #020617);
}

/* NAV ITEMS */
.nav-item {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 10px 12px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.nav-item.logout {
  color: #ef4444;
}
.nav-item.active {
  position: relative;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  box-shadow: inset 3px 0 0 #22c55e;
}

/* Optional glowing dot */
.nav-item.active::after {
  content: '';
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}
.app-layout {
  display: flex;
  height: calc(100vh - 56px); /* height of top bar */
}
.app-content {
  flex: 1;
  overflow: auto;
}
.top-bar {
  height: var(--topbar-height);
  padding: 0 16px;

  display: flex;
  align-items: center;

  position: sticky;
  top: 0;
  z-index: 40;

  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
}

/* TOP BAR */
.top-bar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: #0f172a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}

/* APP SHELL */
.app-shell {
  display: flex;
  height: calc(100vh - 56px);
  overflow: visible;
}
/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: 0;
  padding: 24px;
  overflow-y: auto;
}
.nav-item {
  padding: 12px 16px;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  color: #cbd5f5;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(34, 197, 94, 0.18);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.45);
  color: #ecfdf5;
}
.top-bar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
  gap: 0; /* important */
  border-bottom: 1px solid rgba(170, 33, 33, 0.06);
}

/* Title NEVER overlaps */
.app-title {
  margin-left: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

/* =========================
  SIDEBAR ACTIVE STATE
 ========================= */

.nav-item {
  position: relative;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ACTIVE */
.nav-item.active {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.12);
}

/* LEFT ACCENT BAR */
.nav-item.active::before {
  content: '';
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
@keyframes confirmPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.discount-confirmed {
  animation: confirmPulse 0.35s ease;
}
.discount-badge {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 12px;
  display: inline-block;
}
.payment-status.success {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.payment-status.warn {
  color: #facc15;
}

.payment-status.danger {
  color: #ef4444;
  animation: shake 0.25s;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-3px);
  }
  100% {
    transform: translateX(0);
  }
}
.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge-active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.badge-finished {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}
.badge-expired {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.sessions-ok {
  color: #22c55e;
}
.sessions-low {
  color: #facc15;
}
.sessions-zero {
  color: #ef4444;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.summary-grid label {
  font-size: 12px;
  color: var(--text-secondary);
}
.discount-badge {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 12px;
}
/* =========================
                 CLIENT MESSAGE (SMS STYLE)
              ========================= */

.client-message-card {
  max-width: 100%;
}

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

.client-message-card .client-message-template-row {
  grid-template-columns: 1fr auto;
}

.client-message-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.client-message-checkbox input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.client-message-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-message-reminder-wrap {
  margin-top: 12px;
}

.client-message-reminder-wrap h5 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.client-reminder-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
}

.client-reminder-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.client-reminder-text {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

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

.sms-preview {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
}

.sms-textarea {
  width: 100%;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  color: var(--app-text, #e5e7eb);
  font-size: 14px;
  line-height: 1.5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
}

.sms-textarea::placeholder {
  color: color-mix(in srgb, var(--app-text, #e5e7eb) 35%, transparent);
}

/* Optional: make it feel like a phone message */
.sms-preview::before {
  content: 'SMS Preview';
  display: block;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}
/* =========================
                 SMS META
              ========================= */

.sms-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11px;
  color: color-mix(in srgb, var(--app-text, #e5e7eb) 55%, transparent);
}

/* WhatsApp spacing */
.whatsapp-format {
  line-height: 1.7;
}

/* Toggle buttons */
.toggle-group {
  display: flex;
  gap: 6px;
}

.toggle-btn {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  cursor: pointer;
  color: #e5e7eb;
}

.toggle-btn.active {
  background: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}
.report-table {
  border-collapse: collapse;
  width: 100%;
}

.report-table th,
.report-table td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px;
  text-align: left;
}
.view-inner {
  height: calc(100vh - 60px); /* adjust for header */
  overflow-y: auto;
}
.dashboard-container {
  padding-top: 0;
  min-height: 0;
}
@media print {
  body * {
    visibility: hidden;
  }
  .printable,
  .printable * {
    visibility: visible;
  }
  .printable {
    top: 0;
    width: 100%;
  }
}
.report-sheet {
  margin-top: 24px;
  padding: 24px;
  border-radius: 12px;
  background: #0f141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@media print {
  body * {
    visibility: hidden;
  }

  .report-sheet,
  .report-sheet * {
    visibility: visible;
  }

  .report-sheet {
    top: 0;
    width: 100%;
    background: #fff;
    color: #000;
    padding: 24px;
    box-shadow: none;
  }
}

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

  .report-sheet,
  .report-sheet * {
    visibility: visible;
  }

  .report-sheet {
    top: 0;
    width: 100%;
    background: white;
    color: black;
    padding: 24px;
  }

  .no-print {
    display: none;
  }
}
#packageTableBody tr.active {
  outline: 2px solid var(--accent);
  background: rgba(34, 197, 94, 0.08);
}
.search-result-row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.search-result-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.result-sub {
  font-size: 12px;
  line-height: 1.4;
}

.result-sub.muted {
  opacity: 0.7;
}
.badge-warning {
  background: #f59e0b;
  color: #111827;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}
.search-card-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
}

.search-card-grid > .card {
  min-height: 220px;
}

.search-results.hidden {
  visibility: hidden;
  pointer-events: none;
  min-height: 200px;
}
/* SEARCH BUTTON — FINAL */
.search-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;

  background: linear-gradient(
    180deg,
    rgba(34, 197, 94, 0.95),
    rgba(22, 163, 74, 0.95)
  );

  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #042f16;

  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25),
    0 8px 20px rgba(34, 197, 94, 0.25);

  transition: all 0.15s ease;
}

/* Hover */
.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35),
    0 10px 24px rgba(34, 197, 94, 0.35);
}

/* Active (click) */
.search-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2),
    0 4px 10px rgba(34, 197, 94, 0.2);
}

/* Disabled (optional) */
.search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.search-input-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

/* Clear (×) button */
.clear-search-btn {
  right: 90px; /* before Search button */
  top: 50%;
  transform: translateY(-50%);

  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;

  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;

  cursor: pointer;
  transition: all 0.15s ease;
}

.clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
}
.client-input.loading {
  opacity: 0.6;
  pointer-events: none;
}
.client-input.read-only {
  background: rgba(255, 255, 255, 0.03);
  cursor: not-allowed;
}
.search-top-grid {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* Left: results */
.search-column {
  min-height: 200px;
}

/* Center: profile */
.profile-column {
  min-width: 0;
}
.search-results {
  pointer-events: auto;
  position: relative;
  z-index: 10;
}
/* Right: message */
.message-column {
  min-height: 200px;
}
.search-results .result-row {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.search-results .result-row:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 180, 0.15);
}

.search-results .result-row.active {
  background: rgba(0, 255, 180, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 180, 0.35);
}

.search-results.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.result-package {
  margin-top: 6px;
  font-size: 12px;
}

.result-package-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.result-package-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  color: var(--app-text, #f3e4d3);
  cursor: pointer;
}

.result-package-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.result-package-item.is-selected {
  border-color: rgba(207, 161, 90, 0.65);
  box-shadow: 0 0 0 1px rgba(207, 161, 90, 0.35);
}

.result-package-item.is-disabled {
  cursor: not-allowed;
}

.result-package-item.is-completed {
  opacity: 0.55;
  filter: grayscale(0.3);
}

.result-package-item.is-expired {
  border-color: rgba(245, 158, 11, 0.45);
}

.result-package-item.is-low {
  border-color: rgba(239, 68, 68, 0.45);
}

.result-package-item.is-voided {
  border-color: rgba(148, 163, 184, 0.45);
}

.result-package-item.is-unpaid {
  border-color: rgba(14, 165, 233, 0.45);
}

.package-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex: 0 0 auto;
}

.dot-low {
  background: #ef4444;
}

.dot-expired {
  background: #f59e0b;
}

.dot-active {
  background: #22c55e;
}

.dot-completed {
  background: #3b82f6;
}

.dot-voided {
  background: #94a3b8;
}

.dot-unpaid {
  background: #0ea5e9;
}

.package-main {
  display: grid;
  gap: 2px;
}

.package-name {
  font-weight: 700;
  font-size: 12px;
}

.package-meta {
  font-size: 11px;
  opacity: 0.85;
}

.pos-client-search-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.client-profile-card {
  position: relative;
}

.client-profile-card::after {
  content: 'VIEW ONLY';
  top: 12px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.35;
}
.client-profile-card .lock {
  color: #7cffd6;
  opacity: 0.6;
}
.badge.warning {
  background: rgba(255, 180, 0, 0.15);
  color: #ffd27a;
  border: 1px solid rgba(255, 180, 0, 0.35);
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 999px;
}
.search-btn {
  box-shadow: 0 0 0 rgba(0, 255, 180, 0);
  transition: box-shadow 0.25s ease;
}

.search-btn:hover {
  box-shadow: 0 0 12px rgba(0, 255, 180, 0.45);
}
.fade-in {
  animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.search-input:focus {
  box-shadow: 0 0 0 1px rgba(0, 255, 180, 0.4),
    inset 0 0 10px rgba(0, 255, 180, 0.12);
}
.searching .search-icon {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}
.search-result-row.legacy {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-result-row.legacy::after {
  content: 'LEGACY';
  font-size: 11px;
  margin-left: 6px;
  color: #f59e0b;
}
.client-services-table td:first-child {
  font-weight: 500;
}
.badge.active {
  color: #22c55e;
}
.badge.finished {
  color: #9ca3af;
}
.session-cell {
  font-variant-numeric: tabular-nums;
}
.session-table-wrapper {
  max-height: 260px; /* 🔒 stable height */
  overflow-y: auto;
  overflow-x: hidden;

  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.session-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* 🔑 VERY IMPORTANT */
}

.session-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;

  background: var(--bg-panel);
  color: var(--text-main);

  font-size: 12px;
  font-weight: 600;
  text-align: left;

  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}
.session-table td {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-main);

  border-bottom: 1px dashed var(--border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-table td.right {
  text-align: right;
  font-variant-numeric: tabular-nums; /* 🔥 numbers don’t shift */
}
.skeleton td {
  height: 36px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.04)
  );
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200px;
  }
  100% {
    background-position: 200px;
  }
}
.session-table th:nth-child(1),
.session-table td:nth-child(1) {
  width: 28%;
}

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

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

.session-table th:nth-child(4),
.session-table td:nth-child(4) {
  width: 20%;
}

.skeleton td {
  height: 36px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.04)
  );
  animation: shimmer 1.2s infinite;
}
/* REPORT */
.report-panel {
  max-width: 420px;
  padding: 16px;
}

.report-panel label {
  display: block;
  margin-top: 8px;
  font-weight: 500;
}

.report-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.preview-switch {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.report-preview {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.dashboard-grid canvas {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
}
/* ===============================
     LOGIN GRADIENT BACKGROUND
     Brand: Gold · Brown · Black · White
     =============================== */

.login-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background: linear-gradient(
    120deg,
    #0b0b0b,
    /* deep black */ #3a2b1f,
    /* rich brown */ #d4af37,
    /* gold */ #f5f5f5 /* soft white */
  );

  background-size: 400% 400%;
  animation: luxuryFlow 18s ease-in-out infinite;
}

/* Smooth Apple-like movement */
@keyframes luxuryFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===============================
       LOGIN VIEW ABOVE BACKGROUND
       =============================== */

.login-view {
  position: relative;
  z-index: 1;
}

/* Glass card feel (premium) */
.login-wrapper {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}
.login-gradient-bg {
  background: linear-gradient(
    120deg,
    #0a0a0a,
    /* deep black */ #2a1c14,
    /* espresso brown */ #bfa14a,
    /* champagne gold */ #f2efe9 /* warm off-white */
  );

  background-size: 400% 400%;
  animation: luxuryFlow 18s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .login-gradient-bg {
    animation: none;
    background-position: 50% 50%;
  }
}
/* =========================
     LOGIN GRADIENT BACKGROUND
  ========================= */

.login-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background: radial-gradient(circle at 20% 30%, #c9a24d 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, #6b4e2e 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, #1a1a1a 0%, transparent 55%),
    radial-gradient(circle at 70% 60%, #f5f1e6 0%, transparent 60%);

  filter: blur(80px);
  animation: goldFlow 28s ease-in-out infinite alternate;
  transform: translateZ(0);
}

/* Smooth movement */
@keyframes goldFlow {
  0% {
    transform: translate(-4%, -2%) scale(1);
  }
  50% {
    transform: translate(3%, 2%) scale(1.05);
  }
  100% {
    transform: translate(-2%, 3%) scale(1.02);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-gradient-bg {
    animation: none;
  }
}
/* =========================
     LOGIN LAYOUT
  ========================= */

.login-view {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  z-index: 2;
}

.login-wrapper {
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.login-card {
  margin-top: 24px;
  padding: 28px;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* =========================
     BUTTON
  ========================= */

.btn-primary {
  margin-top: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #c9a24d, #9b7b2f);
  color: #111;
  font-weight: 700;
}
.login-gradient-bg {
  pointer-events: none;
  z-index: 1;
}

.login-content {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
/* =====================================================
   LOGIN SYSTEM — FINAL & ISOLATED
   Brand: Gold · Brown · Black · White
   ===================================================== */

/* 🚫 Login styles NEVER affect the app */
body:not(.login-active) .login-gradient-bg,
body:not(.login-active) .login-view {
  display: none !important;
}

/* ===============================
   BACKGROUND (Apple / iOS Style)
   =============================== */
body.login-active .login-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background: linear-gradient(
    120deg,
    #0a0a0a,
    /* deep black */ #2a1c14,
    /* espresso brown */ #bfa14a,
    /* champagne gold */ #f2efe9 /* warm white */
  );

  background-size: 400% 400%;
  animation: luxuryFlow 18s ease-in-out infinite;

  will-change: background-position;
}

/* Smooth Apple-like movement */
@keyframes luxuryFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  body.login-active .login-gradient-bg {
    animation: none;
  }
}

/* ===============================
   CENTER LAYOUT
   =============================== */
body.login-active .login-view {
  position: fixed;
  inset: 0;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===============================
   LOGIN WRAPPER (GLASS)
   =============================== */
body.login-active .login-wrapper {
  max-width: 520px;
  width: 100%;
  padding: 40px;

  text-align: center;
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* ===============================
   TEXT
   =============================== */
body.login-active .login-wrapper h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 6px;
}

body.login-active .login-wrapper .subtitle {
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 24px;
}

/* ===============================
   BUTTON (LOGIN ONLY)
   =============================== */
body.login-active .login-wrapper .btn-primary {
  width: 100%;
  margin-top: 18px;
  padding: 14px 28px;

  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #c9a24d, #9b7b2f);
  color: #111;
  font-weight: 700;
}
.login-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login-view {
  position: relative;
  z-index: 2;
}

.hidden {
  display: none !important;
}
.login-gradient-bg {
  pointer-events: none;
}
.report-sheet {
  background: #ffffff;
  color: #111;
}

.report-sheet table th {
  background: #f4f4f4;
  color: #000;
}

.report-sheet table td {
  background: #fff;
}

.report-sheet h2,
.report-sheet h3,
.report-sheet h4 {
  color: #000;
}

/* =====================================================
   LOGIN VISUAL OVERRIDE — SOFT CLINIC GLASS
   ===================================================== */
:root {
  --login-ink: #f3e4d3;
  --login-muted: #baa28e;
  --login-gold: #cfa15a;
  --login-brown: #5b332b;
  --login-pink: #a86a86;
  --login-black: #060507;
}

body.login-active {
  overflow: hidden;
}

body.login-active .login-gradient-bg {
  position: fixed !important;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: none !important;
  -webkit-filter: none !important;
  background:
    radial-gradient(
      70% 54% at 18% 20%,
      rgba(235, 193, 118, 0.22) 0%,
      rgba(235, 193, 118, 0) 62%
    ),
    radial-gradient(
      62% 48% at 82% 76%,
      rgba(197, 124, 138, 0.2) 0%,
      rgba(197, 124, 138, 0) 66%
    ),
    linear-gradient(
      140deg,
      #16131a 0%,
      #281b24 24%,
      #4b2f33 48%,
      #322437 74%,
      #14131a 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0) 28%,
      rgba(255, 255, 255, 0.1) 62%,
      rgba(255, 255, 255, 0) 100%
    );
  background-size: 220% 220%, 240% 240%, 210% 210%, 100% 100%;
  background-position: 8% 30%, 86% 74%, 0% 45%, 50% 50%;
  animation: loginShadeShift 16s ease-in-out infinite;
  will-change: background-position;
}

body.login-active .login-gradient-bg::before,
body.login-active .login-gradient-bg::after {
  content: '';
  position: absolute;
  inset: -6%;
  pointer-events: none;
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal;
  will-change: transform, opacity;
}

body.login-active .login-gradient-bg::before {
  opacity: 0.48;
  background:
    radial-gradient(
      44% 34% at 26% 34%,
      rgba(235, 193, 118, 0.36) 0%,
      rgba(235, 193, 118, 0) 68%
    ),
    radial-gradient(
      40% 30% at 78% 64%,
      rgba(197, 124, 138, 0.3) 0%,
      rgba(197, 124, 138, 0) 72%
    );
  filter: drop-shadow(0 0 40px rgba(235, 193, 118, 0.3))
    drop-shadow(0 0 50px rgba(197, 124, 138, 0.24)) !important;
  -webkit-filter: drop-shadow(0 0 40px rgba(235, 193, 118, 0.3))
    drop-shadow(0 0 50px rgba(197, 124, 138, 0.24)) !important;
  animation: loginGlowDrift 15s ease-in-out infinite;
}

body.login-active .login-gradient-bg::after {
  opacity: 0;
  background: none;
  animation: none;
}

body.login-active #loginView.login-view {
  position: fixed !important;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
}

body.login-active #loginView .login-card {
  position: relative;
  width: min(92vw, 390px);
  padding: 36px 30px 32px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.06) 34%,
    rgba(22, 16, 25, 0.54) 100%
  );
  box-shadow:
    0 28px 60px rgba(6, 4, 14, 0.5),
    0 8px 24px rgba(12, 8, 20, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  text-align: center;
  animation: loginCardFloat 7s ease-in-out infinite;
}

body.login-active #loginView .login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.02)
  );
  pointer-events: none;
}

body.login-active #loginView .login-card::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: calc(32px - 2px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

body.login-active #loginView .login-card > * {
  position: relative;
  z-index: 1;
}

body.login-active #loginView .login-card h2 {
  margin: 0;
  color: var(--login-ink);
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(29px, 4vw, 34px);
  font-weight: 450;
  letter-spacing: 0.012em;
  line-height: 1.08;
}

body.login-active #loginView .login-subtitle {
  margin: 10px 0 22px;
  color: var(--login-muted);
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

body.login-active #loginView .login-input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0 19px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff8f0;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

body.login-active #loginView .login-input::placeholder {
  color: rgba(255, 236, 220, 0.66);
}

body.login-active #loginView .login-input:focus {
  border-color: rgba(235, 193, 118, 0.82);
  box-shadow:
    0 0 0 4px rgba(235, 193, 118, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
}

body.login-active #loginView .login-password-input {
  margin-top: 16px;
}

body.login-active #loginView .login-branch-select {
  margin-top: 14px;
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 236, 220, 0.78) 50%),
    linear-gradient(135deg, rgba(255, 236, 220, 0.78) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% + 1px),
    calc(100% - 16px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

body.login-active #loginView .login-branch-select option {
  color: #1f1b1a;
}

body.login-active #loginView .login-btn {
  width: 100%;
  height: 50px;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(235, 193, 118, 0.98),
    rgba(197, 124, 138, 0.96)
  );
  color: #1f1b1a;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.045em;
  cursor: pointer;
  box-shadow:
    0 12px 26px rgba(88, 49, 34, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

body.login-active #loginView .login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(88, 49, 34, 0.56);
  filter: saturate(1.01);
}

body.login-active #loginView .login-btn:active {
  transform: translateY(0);
}

@keyframes loginShadeShift {
  0% {
    background-position: 8% 30%, 86% 74%, 0% 45%, 50% 50%;
  }
  50% {
    background-position: 62% 58%, 32% 34%, 100% 55%, 50% 50%;
  }
  100% {
    background-position: 8% 30%, 86% 74%, 0% 45%, 50% 50%;
  }
}

@keyframes loginGlowDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.42;
  }
  50% {
    transform: translate3d(2.4%, -1.8%, 0) scale(1.04);
    opacity: 0.56;
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.42;
  }
}

@keyframes loginCardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 640px) {
  body.login-active #loginView {
    padding: 16px;
  }

  body.login-active #loginView .login-card {
    width: min(94vw, 360px);
    padding: 30px 22px 26px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.login-active .login-gradient-bg,
  body.login-active .login-gradient-bg::before,
  body.login-active .login-gradient-bg::after,
  body.login-active #loginView .login-card {
    animation: none;
  }
}
.pdf-preview-wrapper {
  background: transparent;
  padding: 0;
  width: 100%;
}

/* The white "paper" */
.pdf-frame {
  width: 100%;
  max-width: 100%;
  height: 500px;             /* 👈 SMALL, NOT A4 */
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

#pdfPreviewFrame {
  width: 100%;
  height: 700px; /* A4 height */
  border: none;
  background: white;
}
/* =====================================================
   SIDEBAR + HAMBURGER — CLEAN & FINAL
   ===================================================== */

/* APP SHELL */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =========================
   SIDEBAR — SMOOTH SLIDE
========================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;

  width: 260px;
  height: 100vh;

  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);

  transform: translateX(-100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.38s ease;

  will-change: transform;
}

/* OPEN STATE */
.sidebar.open {
  transform: translateX(0);
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-toggle.active {
  transform: scale(0.96);
  color: #ef4444; /* 🔥 tailwind red-500 */
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
}

.sidebar.open ~ .menu-toggle {
  transform: scale(0.95);
}
.menu-toggle:hover {
  transform: scale(1.05);
  background: rgba(30, 41, 59, 0.9);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: radial-gradient(ellipse at top, #0f172a, #020617);
}
/* NAV ITEMS */
.nav-item {
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  box-shadow: inset 3px 0 0 #22c55e;
}
/*//// Generate PDF Lay Out ////*/
/* MAIN SPLIT */
.sales-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  margin-top: 20px;
  align-items: flex-start;
}

/* LEFT PANEL */
.sales-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

/* RIGHT PANEL */
.sales-preview {
  display: flex;
  justify-content: center;
}

/* PDF WHITE PAPER */
.pdf-frame {
  width: 100%;
  max-width: 100%;
  height: min(70vh, 820px);
  background: white;
  border: 1px solid #bbb;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  border-radius: 12px;
}

/* PRINT / SEND */
.pdf-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.pdf-action-btn {
  min-width: 120px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
}

/* =====================================================
   THEME SYSTEM + SETTINGS PANEL (FINAL OVERRIDE)
   ===================================================== */
:root {
  --app-font: 'Manrope', 'Inter', sans-serif;
  --app-heading-font: 'Cormorant Garamond', 'Manrope', serif;
  --app-bg: #0c0909;
  --app-bg-soft: #1a1110;
  --app-surface: #251816;
  --app-card: rgba(34, 22, 20, 0.9);
  --app-text: #f3e4d3;
  --app-muted: #b49d89;
  --app-accent: #cfa15a;
  --app-accent-soft: rgba(207, 161, 90, 0.26);
  --app-button-text: #1f130d;
  --app-border: rgba(207, 161, 90, 0.26);
  --app-sidebar: #120d0d;
  --app-sidebar-text: #ecd7bf;
}

body:not(.login-active) {
  font-family: var(--app-font);
  color: var(--app-text);
  background: linear-gradient(145deg, var(--app-bg-soft), var(--app-bg));
}

body:not(.login-active) .main-content {
  background: radial-gradient(circle at top, var(--app-bg-soft), var(--app-bg)) !important;
  color: var(--app-text);
  padding-top: 72px !important;
}

body:not(.login-active) .top-right-clock,
body:not(.login-active) .clock-date,
body:not(.login-active) .clock-time {
  color: var(--app-text);
}

body:not(.login-active) .top-bar {
  display: none !important;
}

body:not(.login-active) .sidebar {
  background: linear-gradient(180deg, var(--app-sidebar), var(--app-bg)) !important;
  border-right: 1px solid var(--app-outline) !important;
}

body:not(.login-active) .sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 72px 10px 16px;
}

body:not(.login-active) .sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
}

body:not(.login-active) .nav-item {
  color: var(--app-sidebar-text) !important;
}

body:not(.login-active) .nav-item:hover {
  background: var(--app-accent-soft) !important;
}

body:not(.login-active) .nav-item.active {
  color: var(--app-accent) !important;
  background: color-mix(in srgb, var(--app-accent) 20%, transparent) !important;
  box-shadow: inset 3px 0 0 var(--app-accent) !important;
}

body:not(.login-active) h2,
body:not(.login-active) h3,
body:not(.login-active) h4,
body:not(.login-active) .kpi-label {
  font-family: var(--app-heading-font);
}

body:not(.login-active) .view > h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--app-text);
}

body:not(.login-active) .view > .text-secondary {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.45;
}

body:not(.login-active) .card h4 {
  margin: 0 0 12px;
  font-size: clamp(1.06rem, 1.35vw, 1.2rem);
  font-weight: 600;
  color: var(--app-text);
  letter-spacing: 0.008em;
}

body:not(.login-active) .text-secondary,
body:not(.login-active) .kpi-sub,
body:not(.login-active) .clock-date {
  color: var(--app-muted) !important;
}

body:not(.login-active) .card {
  background: linear-gradient(180deg, var(--app-card), color-mix(in srgb, var(--app-bg) 78%, transparent)) !important;
  border: 1px solid var(--app-outline) !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}

body:not(.login-active) .btn-primary,
body:not(.login-active) .pay-btn.active {
  background: linear-gradient(
    135deg,
    var(--app-accent),
    color-mix(in srgb, var(--app-accent) 65%, #a45d7b)
  ) !important;
  color: var(--app-button-text) !important;
  border: 1px solid var(--app-outline-strong) !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--app-accent) 30%, transparent);
}

body:not(.login-active) .btn-secondary,
body:not(.login-active) .pay-btn {
  background: color-mix(in srgb, var(--app-surface) 82%, #000) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-outline) !important;
}

body:not(.login-active) .menu-toggle,
body:not(.login-active) .settings-toggle {
  background: color-mix(in srgb, var(--app-surface) 82%, #000) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-outline) !important;
}

body:not(.login-active) .menu-toggle:hover,
body:not(.login-active) .settings-toggle:hover {
  background: color-mix(in srgb, var(--app-accent) 18%, var(--app-surface)) !important;
}

body:not(.login-active) .branch-select,
body:not(.login-active) .input-money,
body:not(.login-active) textarea.branch-select {
  background: color-mix(in srgb, var(--app-surface) 88%, #000) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-outline) !important;
}

body:not(.login-active) .branch-select::placeholder,
body:not(.login-active) .input-money::placeholder {
  color: var(--app-muted) !important;
}

body:not(.login-active) .branch-select:focus,
body:not(.login-active) .input-money:focus {
  border-color: var(--app-accent) !important;
  box-shadow: 0 0 0 3px var(--app-focus-ring) !important;
}

body:not(.login-active) .kpi-value,
body:not(.login-active) .number,
body:not(.login-active) .money {
  color: var(--app-accent) !important;
}

@media (max-width: 900px) {
  body:not(.login-active) .main-content {
    padding-top: 78px !important;
  }

  body:not(.login-active) .view > h2 {
    font-size: clamp(1.34rem, 5.8vw, 1.7rem);
    margin-top: 4px;
  }

  body:not(.login-active) .view > .text-secondary {
    font-size: 0.9rem;
    margin-bottom: 14px;
  }
}

body:not(.login-active) .report-table th {
  background: color-mix(in srgb, var(--app-accent) 14%, var(--app-surface)) !important;
  color: var(--app-text) !important;
  border-bottom: 1px solid var(--app-outline-strong) !important;
}

body:not(.login-active) .report-table td {
  color: var(--app-text) !important;
  border-bottom: 1px solid var(--app-table-line) !important;
}

body:not(.login-active) .report-table tr.muted td,
body:not(.login-active) .muted {
  color: var(--app-muted) !important;
}

body:not(.login-active) .payment-status,
body:not(.login-active) .receipt,
body:not(.login-active) .cart-row.header {
  background: color-mix(in srgb, var(--app-surface) 84%, #000) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-outline) !important;
}

.settings-toggle {
  position: fixed;
  top: max(16px, calc(env(safe-area-inset-top, 0px) + 8px));
  left: 68px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 1110;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  writing-mode: horizontal-tb;
  -webkit-writing-mode: horizontal-tb;
  text-orientation: mixed;
  transform-origin: center center;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.settings-toggle:hover {
  transform: translateY(-1px);
  background: rgba(37, 48, 71, 0.92);
}

.theme-panel {
  position: fixed;
  top: 70px;
  left: 16px;
  z-index: 1200;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-surface) 88%, #000), color-mix(in srgb, var(--app-bg) 86%, #000));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.theme-panel-header h3 {
  margin: 0;
  font-family: var(--app-heading-font);
  font-size: 22px;
  color: var(--app-text);
}

.theme-close-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: transparent;
  color: var(--app-text);
  cursor: pointer;
}

.theme-panel-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--app-muted);
}

.theme-preset-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.theme-preset-btn {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--app-surface) 86%, #000);
  color: var(--app-text);
  font-size: 13px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.theme-preset-btn.active {
  border-color: var(--app-accent);
  background: color-mix(in srgb, var(--app-accent) 16%, var(--app-surface));
}

.theme-custom-section {
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--app-bg) 82%, #000);
}

.theme-custom-section h4 {
  margin: 0 0 10px;
  font-family: var(--app-heading-font);
  color: var(--app-text);
  font-size: 18px;
}

.theme-color-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  color: var(--app-muted);
  font-size: 13px;
}

.theme-color-row input[type='color'] {
  width: 44px;
  height: 30px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.theme-reset-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--app-accent),
    color-mix(in srgb, var(--app-accent) 60%, #8f607f)
  );
  color: var(--app-button-text);
  font-weight: 600;
  cursor: pointer;
}

body.login-active .settings-toggle,
body.login-active .theme-panel {
  display: none;
}

@media (max-width: 1024px) {
  .settings-toggle {
    left: 68px;
    right: auto;
    top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
    width: 42px;
    height: 42px;
  }

  .theme-panel {
    left: 12px;
    right: auto;
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    width: min(320px, calc(100vw - 24px));
    max-height: calc(100dvh - (env(safe-area-inset-top, 0px) + 80px));
  }
}

@media (max-width: 640px) {
  .settings-toggle {
    left: 64px;
    right: auto;
  }

  .theme-panel {
    left: 8px;
    right: auto;
    width: calc(100vw - 16px);
  }
}

/* =====================================================
   LOGIN LUXURY LAYOUT + AUTO SLIDING COPY
   ===================================================== */
body.login-active #loginView.login-view {
  padding: clamp(14px, 3vw, 34px);
}

body.login-active #loginView .login-stage {
  width: min(1140px, 96vw);
  margin: 0 auto;
}

body.login-active #loginView .login-main-title {
  margin: 0 0 clamp(12px, 1.8vw, 22px);
  text-align: center;
  color: rgba(255, 239, 217, 0.95);
  font-family: 'Playfair Display', 'Cormorant Garamond', serif;
  font-size: clamp(42px, 6.6vw, 86px);
  font-weight: 500;
  letter-spacing: 0.022em;
  word-spacing: 0.035em;
  line-height: 1.03;
}

body.login-active #loginView .login-layout {
  display: grid;
  grid-template-columns: minmax(260px, 430px) minmax(320px, 430px);
  gap: clamp(20px, 5vw, 74px);
  align-items: center;
  justify-content: center;
}

body.login-active #loginView .login-copy {
  padding-left: clamp(2px, 2vw, 22px);
}

body.login-active #loginView .login-copy-label {
  margin: 0 0 10px;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(238, 213, 182, 0.76);
}

body.login-active #loginView .login-copy-slider {
  position: relative;
  min-height: 186px;
}

body.login-active #loginView .login-copy-line {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  width: min(96%, 390px);
  color: rgba(240, 221, 200, 0.86);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.012em;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.login-active #loginView .login-copy-line.detail {
  font-size: clamp(17px, 1.9vw, 24px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: rgba(238, 214, 190, 0.8);
  font-family: 'Cormorant Garamond', serif;
}

body.login-active #loginView .login-copy-line.hero {
  font-size: clamp(29px, 3.4vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  color: rgba(247, 231, 212, 0.92);
}

body.login-active #loginView .login-copy-line.is-active {
  opacity: 1;
  transform: translateY(0);
}

body.login-active #loginView .login-copy-sub {
  display: none;
}

body.login-active #loginView .login-card-title {
  margin: 0 0 24px;
  text-align: center;
  color: rgba(255, 239, 217, 0.95);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600;
  letter-spacing: 0.015em;
}

body.login-active #loginView .forgot-password-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  color: rgba(225, 197, 168, 0.84);
  font-family: 'Inter', 'Manrope', sans-serif;
  font-size: 12px;
  text-decoration: none;
  text-align: left;
}

body.login-active #loginView .forgot-password-link:hover {
  color: rgba(239, 213, 184, 0.96);
  text-decoration: underline;
}

@media (max-width: 900px) {
  body.login-active #loginView .login-main-title {
    font-size: clamp(32px, 8.8vw, 54px);
    margin-bottom: 12px;
    letter-spacing: 0.012em;
    word-spacing: 0.02em;
  }

  body.login-active #loginView .login-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    width: min(540px, 95vw);
  }

  body.login-active #loginView .login-copy {
    order: 2;
    padding-left: 0;
    text-align: center;
  }

  body.login-active #loginView .login-copy-slider {
    min-height: 152px;
  }

  body.login-active #loginView .login-copy-line {
    left: 50%;
    transform: translate(-50%, 10px);
    text-align: center;
    width: min(94%, 460px);
    font-size: clamp(22px, 5.4vw, 32px);
  }

  body.login-active #loginView .login-copy-line.detail {
    font-size: clamp(15px, 4.2vw, 22px);
  }

  body.login-active #loginView .login-copy-line.hero {
    font-size: clamp(23px, 6vw, 34px);
  }

  body.login-active #loginView .login-copy-line.is-active {
    transform: translate(-50%, 0);
  }

  body.login-active #loginView .login-copy-sub {
    display: none;
  }
}

/* POS Payment + Cart Override */
#posView .pos-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr);
  align-items: start;
}

#posView .pos-right {
  display: grid;
  grid-template-rows: auto auto;
  gap: 14px;
}

#posView .cart-card {
  min-height: 420px;
}

#posView .cart-table {
  height: 100%;
}

#posView .cart-body {
  min-height: 280px;
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 6px 8px;
}

#posView .payment-box {
  padding: 16px;
}

#posView .discount-control {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

#posView .model-control {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

#posView .discount-approval-control {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

#posView #modelSponsorIdInput {
  max-width: 260px;
}

#posView #discountApprovalIdInput {
  max-width: 260px;
}

#posView .model-toggle {
  display: inline-flex;
  gap: 8px;
}

#posView .model-toggle .btn {
  min-width: 72px;
}

#posView .discount-type {
  display: inline-flex;
  gap: 8px;
}

#posView .discount-type .btn.active {
  background: var(--app-accent, #22c55e);
  color: var(--app-button-text, #102218);
  border-color: transparent;
}

#posView .payment-breakdown {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

#posView .payment-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#posView .payment-line.total {
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

#posView .pos-payment-grid .input-money {
  width: 100%;
}

#posView .installment-box {
  margin-top: 10px;
  margin-bottom: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 10px;
}

#posView .installment-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

#posView .installment-toggle input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

#posView .installment-fields {
  margin-top: 10px;
}

#posView #installmentPaymentCountInput[readonly] {
  opacity: 0.9;
  cursor: not-allowed;
}

#posView .installment-preview {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--app-accent, #cfa15a) 34%, rgba(0, 0, 0, 0.12));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--app-card, #ffffff) 92%, rgba(255, 255, 255, 0.08)),
    color-mix(in srgb, var(--app-surface, #f4ece3) 88%, rgba(255, 255, 255, 0.04))
  );
  color: var(--app-text, #1f2937);
}

#posView .installment-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#posView .installment-preview-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  color: var(--app-text, #111827);
}

#posView .installment-preview-subtitle {
  font-size: 0.84rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--app-text, #111827) 70%, transparent);
  margin-bottom: 8px;
}

#posView .installment-matrix-list {
  display: grid;
  gap: 6px;
}

#posView .installment-matrix-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--app-border, rgba(255, 255, 255, 0.2)) 80%, transparent);
  background: color-mix(in srgb, var(--app-surface, #f4ece3) 88%, rgba(255, 255, 255, 0.12));
}

#posView .installment-matrix-row span {
  font-weight: 700;
  color: color-mix(in srgb, var(--app-text, #111827) 85%, transparent);
}

#posView .installment-matrix-row strong {
  font-weight: 800;
  color: var(--app-text, #111827);
}

#posView .installment-matrix-row.is-current {
  border: 1px solid color-mix(in srgb, var(--app-accent, #cfa15a) 75%, transparent);
  background: color-mix(in srgb, var(--app-accent, #cfa15a) 24%, var(--app-surface, #f4ece3));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-accent, #cfa15a) 22%, transparent);
}

#posView .installment-preview-breakdown {
  display: grid;
  gap: 6px;
}

#posView .installment-preview-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 0;
}

#posView .installment-preview-line span {
  color: color-mix(in srgb, var(--app-text, #111827) 85%, transparent);
  font-weight: 600;
}

#posView .installment-preview-line strong {
  color: var(--app-text, #111827);
  font-weight: 800;
}

#posView .installment-preview-line.total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--app-accent, #cfa15a) 32%, transparent);
  background: color-mix(in srgb, var(--app-accent, #cfa15a) 10%, transparent);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

#posView .installment-preview-line.total strong {
  font-weight: 900;
  letter-spacing: 0.01em;
}

#posView .payment-variance {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

#posView #paymentPaidDisplay,
#posView #paymentVarianceDisplay {
  justify-self: end;
}

#posView #paymentVarianceDisplay.success {
  color: #22c55e;
}

#posView #paymentVarianceDisplay.warn {
  color: #f59e0b;
}

#posView #paymentVarianceDisplay.danger {
  color: #ef4444;
}

@media (max-width: 1100px) {
  #posView .pos-layout {
    grid-template-columns: 1fr;
  }

  #posView .cart-body {
    max-height: 320px;
  }

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

  .sales-controls {
    position: static;
  }

  #posView .installment-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #posView .pos-left,
  #posView .pos-right {
    padding-bottom: 16px;
  }

  #posView .card {
    padding: 14px;
  }

  #posView .cart-row {
    grid-template-columns: 1fr 48px 92px 36px;
    font-size: 13px;
    gap: 6px;
    padding: 8px 6px;
  }

  #posView .payment-variance {
    grid-template-columns: 1fr 1fr;
  }

  #posView .payment-variance span:nth-child(3) {
    justify-self: start;
  }

  #posView .payment-variance strong:nth-child(4) {
    justify-self: end;
  }

  .report-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  #posView .discount-control {
    grid-template-columns: 1fr;
  }

  #posView .discount-type {
    width: 100%;
  }

  #posView .discount-type .btn {
    flex: 1;
  }

  #posView .payment-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  #posView .action-buttons {
    width: 100%;
  }

  #posView .action-buttons .btn {
    flex: 1;
  }
}

/* =====================================================
   POS + SALES BUTTON ALIGNMENT (FINAL OVERRIDE)
   ===================================================== */
#posView .card,
#salesView .card {
  padding: 18px 20px;
}

#posView .btn,
#salesView .btn {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#posView .btn.btn-sm,
#salesView .btn.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

#posView .client-Registered {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 10px;
  align-items: center;
}

#posView .client-mode-box {
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
}

#posView .client-mode-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#posView .search-input-wrapper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

#posView .pos-client-search-actions,
#posView .client-actions {
  margin-top: 12px;
}

#posView .new-client-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#posView .new-client-summary-name {
  font-weight: 700;
  font-size: 15px;
}

#posView .new-client-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#posView .new-client-form-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#posView .payment-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 4px;
}

#posView .pay-btn {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#posView .payment-actions {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  gap: 12px;
}

#posView .action-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

#posView .discount-type {
  display: inline-flex;
  gap: 10px;
}

#posView .discount-type .btn {
  min-width: 48px;
  min-height: 40px;
  padding: 0 12px;
}

#posView .action-buttons .btn,
#salesView .pdf-action-btn,
#salesView .sales-controls > .btn {
  min-width: 120px;
}

#salesView .sales-controls {
  gap: 12px;
}

#salesView .pdf-actions {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  justify-content: flex-end;
  gap: 10px;
}

#posView #posServicesCard {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  row-gap: 12px;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

#posView .pos-left #posServicesCard {
  flex: 0 0 auto;
  overflow: visible;
}

#posView #posServicesCard.collapsed {
  height: auto;
}

#posView #posServicesCard .services-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#posView #posServicesCard .services-card-header h4 {
  margin: 0;
}

#posView #posServicesCard #posServiceList {
  flex: 0 0 auto;
  min-height: 210px;
}

#posView #posServicesCard #posPackageCatalogList {
  flex: 0 0 auto;
  min-height: 210px;
}

#posView #posServicesCard .services-split-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    'labels labels'
    'local aesthetic';
  gap: 12px;
  align-content: start;
}

#posView #posServicesCard .package-catalog-grid {
  margin-top: 10px;
}

#posView #posServicesCard .services-split-labels {
  grid-area: labels;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#posView #posServicesCard .services-split-labels span {
  text-align: center;
}

#posView #posServicesCard .service-box:first-of-type {
  grid-area: local;
}

#posView #posServicesCard .service-box:last-of-type {
  grid-area: aesthetic;
}

#posView #posServicesCard .services-split-grid::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 2px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

#posView #posServicesCard .service-box {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

#posView #posServicesCard .service-box h5 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

#posView #posServicesCard .service-search-row {
  margin-bottom: 8px;
}

#posView #posServicesCard .service-box .pos-list {
  flex: 1;
  min-height: 100px;
  max-height: 170px;
  overflow-y: auto;
}

#posView #posServicesCard .pos-list {
  gap: 8px;
}

#posView #posServicesCard .pos-row {
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

#posView #posServicesCard .pos-row > span:first-child {
  flex: 1;
  min-width: 0;
}

#posView #posServicesCard .pos-row > span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

#posView .services-toggle-btn {
  min-width: 96px;
}

#posView .services-resize-handle {
  display: none;
}

#posView .services-resize-handle::before {
  content: none;
}

#posView #posServicesCard.is-resizing {
  box-shadow: 0 0 0 2px rgba(207, 161, 90, 0.35);
}

.package-badge.is-active {
  background: rgba(34, 197, 94, 0.18);
}

.package-badge.is-low {
  background: rgba(239, 68, 68, 0.18);
}

.package-badge.is-expired {
  background: rgba(245, 158, 11, 0.2);
}

.package-badge.is-completed {
  background: rgba(59, 130, 246, 0.2);
  opacity: 0.75;
}

.package-badge.is-voided {
  background: rgba(148, 163, 184, 0.25);
  opacity: 0.72;
}

@media (max-width: 980px) {
  #posView .client-Registered {
    grid-template-columns: 1fr;
  }

  #posView .payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #posView .action-buttons {
    grid-template-columns: 1fr;
  }

  #salesView .pdf-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #salesView .pdf-action-btn,
  #salesView .sales-controls > .btn {
    width: 100%;
  }

  #posView #posServicesCard {
    max-height: none;
  }

  #posView #posServicesCard #posServiceList,
  #posView #posServicesCard #posPackageCatalogList {
    min-height: 180px;
  }

  #posView #posServicesCard .services-split-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      'labels'
      'local'
      'aesthetic';
  }

  #posView #posServicesCard .services-split-labels {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #posView #posServicesCard .services-split-grid::before {
    display: none;
  }
}

#serviceAdminView .service-admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#serviceAdminView .service-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#serviceAdminView .service-admin-discount-box {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

#serviceAdminView .service-admin-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
}

#serviceAdminView .service-admin-color-input {
  min-height: 42px;
  padding: 6px;
}

#serviceAdminView .service-admin-filter-grid {
  margin-top: 8px;
}

#serviceAdminView .service-admin-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

#serviceAdminView .staff-admin-bulk-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

#serviceAdminView .staff-admin-bulk-head h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

#serviceAdminView .staff-admin-bulk-head .text-secondary {
  margin: 4px 0 10px;
  font-size: 12px;
}

#serviceAdminView #staffAdminBulkCountValue[readonly] {
  opacity: 0.86;
  cursor: default;
}

#serviceAdminView .service-admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

#serviceAdminView .service-admin-header-row h4 {
  margin: 0;
}

#serviceAdminView #serviceAdminCollapseToggleBtn {
  min-width: 150px;
}

#serviceAdminView #staffAdminListToggleBtn {
  min-width: 150px;
}

#serviceAdminView .service-admin-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

#serviceAdminView .service-admin-table-wrap.is-hidden {
  display: none;
}

#serviceAdminView #serviceAdminManageTableWrap .report-table {
  table-layout: fixed;
  width: 100%;
}

#serviceAdminView #serviceAdminManageTableWrap th:nth-child(1) {
  width: 22%;
}

#serviceAdminView #serviceAdminManageTableWrap th:nth-child(2) {
  width: 16%;
}

#serviceAdminView #serviceAdminManageTableWrap th:nth-child(3) {
  width: 12%;
}

#serviceAdminView #serviceAdminManageTableWrap th:nth-child(4) {
  width: 20%;
}

#serviceAdminView #serviceAdminManageTableWrap th:nth-child(5) {
  width: 18%;
}

#serviceAdminView #serviceAdminManageTableWrap th:nth-child(6) {
  width: 12%;
}

#serviceAdminView #serviceAdminManageTableWrap td {
  vertical-align: top;
}

#serviceAdminView #serviceAdminManageTableWrap .service-admin-name,
#serviceAdminView #serviceAdminManageTableWrap .service-admin-note {
  display: block;
  overflow-wrap: anywhere;
}

#serviceAdminView .service-admin-price-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#serviceAdminView .service-admin-price-old {
  text-decoration: line-through;
  opacity: 0.7;
  font-size: 12px;
}

#serviceAdminView .service-admin-flag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#serviceAdminView .service-admin-flag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
}

#serviceAdminView .service-admin-flag.is-inactive {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  color: #b91c1c;
}

.staff-sync-status {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
}

.staff-sync-neutral {
  color: #64748b;
}

.staff-sync-success {
  color: #15803d;
}

.staff-sync-error {
  color: #b91c1c;
}

#serviceAdminView .staff-branch-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

#serviceAdminView .service-admin-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #fff;
  background: var(--tag-color, #ef4444);
}

#serviceAdminView .service-admin-action-wrap {
  display: flex;
  gap: 6px;
}

#serviceAdminView .staff-admin-bulk-options {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.dashboard-kpi-option-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.dashboard-kpi-option-select {
  min-height: 34px;
  max-width: 185px;
  padding: 6px 10px;
  font-size: 12px;
}

.dashboard-analytics-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-analytics-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-analytics-head h4 {
  margin: 0;
}

.dashboard-analytics-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.dashboard-analytics-control {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
}

.dashboard-analytics-control:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dashboard-analytics-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-analytics-table-wrap {
  overflow: auto;
  max-height: 260px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.dashboard-analytics-table {
  margin: 0;
  min-width: 520px;
}

.dashboard-analytics-table th,
.dashboard-analytics-table td {
  white-space: nowrap;
  font-size: 12px;
}

.dashboard-analytics-diff-positive {
  color: #16a34a;
  font-weight: 700;
}

.dashboard-analytics-diff-negative {
  color: #ef4444;
  font-weight: 700;
}

.dashboard-analytics-diff-even {
  opacity: 0.85;
  font-weight: 700;
}

.dashboard-analytics-lead-local {
  color: #16a34a;
  font-weight: 700;
}

.dashboard-analytics-lead-aesthetic {
  color: #d97706;
  font-weight: 700;
}

.dashboard-analytics-lead-tie {
  opacity: 0.85;
  font-weight: 700;
}

@media (max-width: 768px) {
  .dashboard-kpi-option-head {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-kpi-option-select {
    max-width: 100%;
  }

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

  .dashboard-analytics-table {
    min-width: 460px;
  }

  #searchView .client-message-grid {
    grid-template-columns: 1fr;
  }

  #searchView .client-reminder-top {
    flex-direction: column;
    align-items: flex-start;
  }

  #searchView .client-message-actions .btn {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (max-width: 980px) {
  .dashboard-analytics-table-wrap {
    max-height: 220px;
  }

  #serviceAdminView .service-admin-grid {
    grid-template-columns: 1fr;
  }

  #serviceAdminView .staff-branch-access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #serviceAdminView .service-admin-summary {
    justify-content: space-between;
  }
}

/* =====================================================
   MOBILE STABILITY OVERRIDES (FINAL)
   Keeps controls from overlapping across phone/tablet sizes.
   ===================================================== */
@media (max-width: 1024px) {
  .dashboard-grid.two-col,
  .dashboard-grid.three-col,
  .dashboard-grid.four-col,
  .service-admin-filter-grid,
  #serviceAdminView .service-admin-filter-grid,
  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  .form-field.full-width {
    grid-column: auto;
  }

  #posView #posServicesCard {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  #posView #posServicesCard #posServiceList,
  #posView #posServicesCard #posPackageCatalogList {
    flex: 0 0 auto;
    min-height: 180px;
  }

  #posView .services-resize-handle {
    display: none;
  }
}

@media (max-width: 768px) {
  .tabs {
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabs button {
    flex: 1 1 140px;
    min-width: 0;
    white-space: normal;
  }

  #posView .client-Registered,
  #posView .search-input-wrapper,
  #posView .discount-control,
  #posView .payment-variance {
    grid-template-columns: 1fr !important;
  }

  #posView .payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #posView .action-buttons {
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  #posView .action-buttons .btn,
  #salesView .pdf-action-btn,
  #salesView .sales-controls > .btn {
    min-width: 0 !important;
    width: 100% !important;
  }

  #posView .discount-type,
  #posView .model-toggle,
  #posView .client-mode-actions,
  #posView .pos-client-search-actions,
  #posView .client-actions,
  #posView .new-client-summary-actions,
  #searchView .client-message-actions,
  #salesView .pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  #posView .discount-type .btn,
  #posView .model-toggle .btn,
  #searchView .client-message-actions .btn {
    flex: 1 1 140px;
    min-width: 0;
  }

  #posView #posServicesCard .services-card-header {
    flex-wrap: wrap;
  }

  #posView .services-toggle-btn {
    display: none;
  }

  #posView #posServicesCard #posServiceList,
  #posView #posServicesCard #posPackageCatalogList {
    min-height: 150px;
  }

  #posView #posServicesCard .pos-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  #posView #posServicesCard .pos-row > span:last-child {
    margin-left: auto;
  }

  #searchView .client-reminder-top {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  #posView .payment-methods {
    grid-template-columns: 1fr !important;
  }

  #posView #posServicesCard .pos-row {
    flex-direction: column;
    align-items: stretch;
  }

  #posView #posServicesCard #posServiceList,
  #posView #posServicesCard #posPackageCatalogList {
    min-height: 130px;
  }

  #posView #posServicesCard .pos-row > span:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-left: 0;
  }
}

/* =====================================================
   POS + SEARCH RESPONSIVE SINGLE SOURCE (CANONICAL)
   This replaces legacy repeated layout overrides.
   ===================================================== */

/* =========================
   POS — Base Layout
   ========================= */
#posView {
  height: auto !important;
  min-height: calc(100dvh - 72px) !important;
  overflow: auto !important;
}

#posView .pos-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr) !important;
  gap: 14px !important;
  align-items: start !important;
  height: auto !important;
  overflow: visible !important;
}

#posView .pos-left,
#posView .pos-right {
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  overflow: visible !important;
  padding-bottom: 12px !important;
}

#posView .pos-right {
  justify-content: flex-start !important;
  align-items: stretch !important;
}

#posView .pos-right > .card {
  margin: 0 !important;
}

#posView .cart-card,
#posView .payment-box,
#posView .pending-clients {
  width: 100% !important;
}

#posView .cart-card {
  min-height: 250px !important;
}

#posView .cart-body {
  min-height: 170px !important;
  max-height: min(42dvh, 360px) !important;
  overflow-y: auto !important;
}

#posView .pending-clients {
  max-height: min(30dvh, 300px) !important;
  overflow-y: auto !important;
}

/* =========================
   POS — Services Panel
   ========================= */
#posView .pos-left .card.services,
#posView .pos-left #posServicesCard {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

#posView #posServicesCard {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

#posView #posServicesToggleBtn {
  display: none !important;
}

#posView #posServiceList,
#posView #posPackageCatalogList {
  min-height: 220px !important;
}

#posView #posServicesCard .services-split-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 12px !important;
}

#posView #posServicesCard .service-box {
  min-height: 180px !important;
}

#posView #posServicesCard .service-box .pos-list {
  min-height: 120px !important;
  max-height: 230px !important;
  overflow-y: auto !important;
}

#posView #posServicesCard .pos-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 8px !important;
}

#posView #posServicesCard .pos-row > span:first-child {
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

#posView #posServicesCard .pos-row > span:last-child {
  display: inline-flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

#posView #posServicesCard .pos-row > span:last-child strong {
  min-width: 96px !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}

/* =========================
   POS — Inputs/Buttons
   ========================= */
#posView .payment-methods {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

#posView .action-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#posView .payment-actions {
  gap: 12px !important;
}

/* =========================
   SEARCH — Base Layout
   ========================= */
#searchView {
  height: auto !important;
  min-height: calc(100dvh - 72px) !important;
  overflow: auto !important;
}

#searchView .search-card-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}

#searchView .search-card-grid > .card {
  min-width: 0 !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
}

#searchView .search-input-wrapper {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

#searchView .search-input-wrapper .btn {
  white-space: nowrap !important;
}

#searchView .profile-grid,
#searchView .client-message-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#searchView .form-field.full-width {
  grid-column: 1 / -1 !important;
}

#searchView #searchResults,
#searchView #searchTransactionHistory,
#searchView #searchSessionHistory,
#searchView #clientMessageReminderList {
  max-height: 280px !important;
  overflow-y: auto !important;
}

/* =========================
   Breakpoints
   ========================= */
@media (max-width: 1280px) {
  #posView .pos-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr) !important;
  }

  #searchView .search-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1024px) {
  #posView .pos-layout {
    grid-template-columns: 1fr !important;
  }

  #posView .pending-clients {
    max-height: none !important;
  }

  #searchView .search-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #searchView .profile-grid,
  #searchView .client-message-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  #posView #posServicesCard .services-split-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      'labels'
      'local'
      'aesthetic' !important;
  }

  #posView #posServicesCard .services-split-labels {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  #posView #posServicesCard .services-split-grid::before {
    display: none !important;
  }

  #posView #posServicesCard .service-search-row {
    grid-template-columns: 1fr !important;
  }

  #posView #posServicesCard .service-search-row .btn {
    width: 100% !important;
  }

  #posView #posServicesCard .pos-row {
    grid-template-columns: 1fr !important;
  }

  #posView #posServicesCard .pos-row > span:last-child {
    width: 100% !important;
    justify-content: space-between !important;
  }

  #posView .payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #posView .action-buttons {
    grid-template-columns: 1fr !important;
  }

  #posView .action-buttons .btn {
    width: 100% !important;
  }

  #searchView .search-card-grid {
    grid-template-columns: 1fr !important;
  }

  #searchView .search-input-wrapper {
    grid-template-columns: 1fr !important;
  }

  #searchView #searchClientBtn {
    width: 100% !important;
  }
}

@media (max-width: 560px) {
  #posView .payment-methods {
    grid-template-columns: 1fr !important;
  }

  #posView .pos-payment-grid {
    grid-template-columns: 1fr !important;
  }

  #posView .model-toggle,
  #posView .discount-type {
    width: 100% !important;
  }

  #posView .model-toggle .btn,
  #posView .discount-type .btn {
    flex: 1 1 0 !important;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  #posView .cart-body {
    max-height: 36dvh !important;
  }
}

/* =====================================================
   LOGIN VIDEO BACKGROUND (FINAL OVERRIDE)
   ===================================================== */
body.login-active .login-gradient-bg {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  overflow: hidden !important;
  background: #050402 !important;
  filter: none !important;
  -webkit-filter: none !important;
  animation: none !important;
}

body.login-active .login-gradient-bg::before {
  content: '' !important;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% 18%, rgba(245, 197, 56, 0.38) 0%, rgba(245, 197, 56, 0) 56%),
    radial-gradient(112% 88% at 88% 82%, rgba(196, 132, 24, 0.28) 0%, rgba(196, 132, 24, 0) 58%),
    linear-gradient(180deg, rgba(6, 4, 2, 0.68) 0%, rgba(6, 4, 2, 0.26) 34%, rgba(6, 4, 2, 0.76) 100%);
}

body.login-active .login-gradient-bg::after {
  content: '' !important;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.62) 100%);
}

body.login-active .login-bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.99;
  transform: scale(1.015);
  filter: brightness(0.95) contrast(1.12) saturate(2.1) sepia(1) hue-rotate(-40deg);
  pointer-events: none;
}

body.login-active .login-bg-video.is-hidden {
  display: none;
}

body.login-active .login-gradient-bg.no-video {
  background:
    radial-gradient(circle at 20% 30%, #4d3413 0%, transparent 42%),
    radial-gradient(circle at 80% 70%, #1f1408 0%, transparent 44%),
    linear-gradient(150deg, #050402 0%, #2c1d0d 46%, #0a0703 100%) !important;
}
