/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #8B4513;
  --primary-dark: #6B3410;
  --accent: #E67E22;
  --green: #2E7D32;
  --red: #c0392b;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --sidebar-bg: #1e1208;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active: rgba(139,69,19,0.6);
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --sidebar-w: 240px;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1208 0%, #3d2010 100%);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  text-align: center;
}

.login-logo { height: 80px; width: auto; margin: 0 auto 20px; }

.login-card h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }

.login-form { text-align: left; }

.login-error { color: var(--red); font-size: 0.82rem; font-weight: 600; min-height: 20px; margin-bottom: 8px; }
.login-hint { margin-top: 20px; font-size: 0.8rem; color: var(--muted); }

/* ===== ADMIN APP LAYOUT ===== */
.admin-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo { height: 52px; width: auto; }

.sidebar-tag {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.snav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s;
  font-family: inherit;
}
.snav-item:hover { background: var(--sidebar-hover); color: #fff; }
.snav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 700; }
.snav-icon { font-size: 1.1rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-site-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.view-site-btn:hover { background: rgba(255,255,255,0.15); }

.admin-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(192,57,43,0.2);
  border: 1px solid rgba(192,57,43,0.4);
  color: #ff8a80;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: all 0.2s;
}
.admin-logout-btn:hover { background: rgba(192,57,43,0.35); }

/* ===== MAIN CONTENT ===== */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

.page-title { font-size: 1.2rem; font-weight: 800; }

.admin-user-badge {
  background: rgba(139,69,19,0.1);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== PAGES ===== */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ===== STAT CARDS ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card-val { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.stat-card-label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

/* ===== DASH GRID ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dash-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-card-header h3 { font-size: 0.95rem; font-weight: 700; }

.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.dash-row:last-child { border-bottom: none; }
.dash-row-label { font-weight: 600; color: var(--text); }
.dash-row-sub { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.dash-row-val { font-weight: 700; color: var(--primary); }

/* ===== PAGE ACTIONS ===== */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.asearch {
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 9px 20px;
  font-size: 0.9rem;
  outline: none;
  background: var(--surface);
  width: 280px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
}
.asearch:focus { border-color: var(--primary); }

/* ===== TABLE ===== */
.atable-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.atable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.atable thead tr {
  background: #f9fafb;
  border-bottom: 2px solid var(--border);
}

.atable th {
  padding: 13px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.atable td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.atable tbody tr:last-child td { border-bottom: none; }
.atable tbody tr:hover { background: #fafafa; }

.p-emoji { font-size: 1.6rem; }

.badge-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge-pill.bestseller { background: #fff3e0; color: #e65100; }
.badge-pill.new { background: #e8f5e9; color: #2e7d32; }
.badge-pill.sale { background: #fce4ec; color: #c62828; }
.badge-pill.organic { background: #e8f5e9; color: #2e7d32; }
.badge-pill.premium { background: #ede7f6; color: #512da8; }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-pill.delivered { background: #e8f5e9; color: #2e7d32; }
.status-pill.processing { background: #fff3e0; color: #e65100; }
.status-pill.cancelled { background: #fce4ec; color: #c62828; }

/* ===== INVENTORY ===== */
.inv-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.inv-stat-card {
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.inv-stat-card .isc-icon { font-size: 1.8rem; width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inv-stat-card .isc-val  { font-size: 1.6rem; font-weight: 800; }
.inv-stat-card .isc-label{ font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-top: 2px; }

.inv-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.inv-tab {
  padding: 7px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.2s;
}
.inv-tab:hover  { border-color: var(--primary); color: var(--primary); }
.inv-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Stock status pills */
.stock-in    { background: #e8f5e9; color: #2e7d32; }
.stock-low   { background: #fff8e1; color: #f57f17; }
.stock-out   { background: #fce4ec; color: #c62828; }

/* Inline qty editor */
.inv-qty-wrap { display: flex; align-items: center; gap: 6px; }
.inv-qty-input {
  width: 64px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
  outline: none;
  color: var(--text);
  transition: border-color 0.2s;
}
.inv-qty-input:focus { border-color: var(--primary); }

/* ===== QUICK INLINE FIELDS (unit / price in products table) ===== */
.quick-field {
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  background: transparent;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.quick-field:hover {
  border-color: var(--border);
  background: var(--bg);
  cursor: text;
}
.quick-field:focus {
  border-color: var(--primary);
  background: #fff;
  cursor: text;
}
.unit-field  { width: 82px; }
.price-field { width: 80px; text-align: right; }
.qf-price-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}
.qf-rupee {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}
/* hide number spinners for cleaner look */
.price-field::-webkit-inner-spin-button,
.price-field::-webkit-outer-spin-button { opacity: 0; }
.price-field:focus::-webkit-inner-spin-button,
.price-field:focus::-webkit-outer-spin-button { opacity: 1; }

/* Adjust modal */
.adj-type-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.adj-type {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.2s;
  text-align: center;
}
.adj-type:hover { border-color: var(--primary); color: var(--primary); }
.adj-type.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.inv-product-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border: 1px solid var(--border);
}
.inv-product-preview .prev-emoji { font-size: 2rem; }
.inv-product-preview .prev-name  { font-weight: 700; font-size: 0.92rem; }
.inv-product-preview .prev-sku   { font-size: 0.78rem; color: var(--muted); }

.inv-current-stock {
  background: rgba(139,69,19,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 8px;
  color: var(--text);
  min-height: 20px;
}

/* Stock history */
.stock-move-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 12px;
}
.stock-move-row:last-child { border-bottom: none; }
.smr-emoji  { font-size: 1.3rem; flex-shrink: 0; }
.smr-info   { flex: 1; }
.smr-name   { font-weight: 600; }
.smr-reason { color: var(--muted); font-size: 0.78rem; }
.smr-delta  { font-weight: 800; font-size: 0.95rem; white-space: nowrap; }
.smr-delta.pos { color: #2e7d32; }
.smr-delta.neg { color: #c62828; }
.smr-delta.set { color: var(--primary); }
.smr-date   { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* Low-stock warning banner */
.inv-alert-banner {
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f57f17;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .inv-stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .inv-stat-row { grid-template-columns: 1fr; }
}

/* ===== ACTION BUTTONS ===== */
.abtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
  transition: all 0.2s;
}
.abtn-primary { background: var(--primary); color: #fff; }
.abtn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.abtn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.abtn-outline:hover { border-color: var(--primary); color: var(--primary); }
.abtn-edit { background: #e3f2fd; color: #1565c0; border: none; padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; }
.abtn-edit:hover { background: #bbdefb; }
.abtn-danger { background: var(--red); color: #fff; border: none; }
.abtn-danger:hover { background: #a93226; }
.abtn-del { background: #fce4ec; color: #c62828; border: none; padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; }
.abtn-del:hover { background: #f8bbd0; }
.abtn-sm { padding: 6px 14px; font-size: 0.78rem; }

/* ===== ORDER STATUS PILLS ===== */
.ord-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.ord-pending    { background:#fff3e0; color:#e65100; }
.ord-confirmed  { background:#e3f2fd; color:#1565c0; }
.ord-processing { background:#f3e5f5; color:#6a1b9a; }
.ord-shipped    { background:#e0f7fa; color:#006064; }
.ord-delivered  { background:#e8f5e9; color:#2e7d32; }
.ord-cancelled  { background:#fce4ec; color:#b71c1c; }

.status-select {
  padding: 5px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  outline: none;
}
.status-select:focus { border-color: var(--primary); }

/* ===== ORDER DETAIL MODAL ===== */
.ord-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 0 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.pipe-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 64px;
}
.pipe-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  transition: all 0.2s;
}
.pipe-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.pipe-line {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: var(--border);
  margin-bottom: 19px;
}
.pipe-step.done .pipe-dot  { background: #2e7d32; border-color: #2e7d32; }
.pipe-step.done .pipe-label { color: #2e7d32; }
.pipe-step.active .pipe-dot { background: var(--primary); border-color: var(--primary); transform: scale(1.3); }
.pipe-step.active .pipe-label { color: var(--primary); font-weight: 800; }

.ord-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.ord-detail-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px 16px;
}
.ord-detail-card-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 10px;
}
.ord-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.ord-detail-row:last-child { border: none; }
.ord-detail-row span:first-child { color: var(--muted); }
.ord-detail-row span:last-child  { font-weight: 600; text-align: right; }

.ord-totals {
  margin-top: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px 16px;
}
.ord-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 5px 0;
  color: var(--muted);
}
.ord-grand {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  border-top: 2px solid var(--border);
  margin-top: 6px;
  padding-top: 10px;
}

/* ===== STAFF STATUS PILLS ===== */
.staff-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.staff-active   { background: #e8f5e9; color: #2e7d32; }
.staff-inactive { background: #fce4ec; color: #b71c1c; }

.abtn-enable  { background: #e8f5e9; color: #2e7d32; border: none; }
.abtn-enable:hover  { background: #c8e6c9; }
.abtn-disable { background: #fff3e0; color: #e65100; border: none; }
.abtn-disable:hover { background: #ffe0b2; }

/* ===== STAFF PAGE ===== */
.staff-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e3f2fd;
  border: 1.5px solid #90caf9;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #1565c0;
  margin-bottom: 16px;
}

/* WhatsApp button */
.abtn-whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
}
.abtn-whatsapp:hover { background: #1ebe5b; transform: translateY(-1px); }

/* ===== SHARE CATALOGUE MODAL ===== */
.wa-number-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  background: var(--surface);
  transition: border-color 0.2s;
}
.wa-number-wrap:focus-within { border-color: #25D366; }
.wa-cc {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  border-right: 1.5px solid var(--border);
  padding-right: 12px;
}
.wa-num-input {
  border: none !important;
  outline: none !important;
  flex: 1;
  padding: 11px 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: transparent;
}

.share-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

.share-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 4px;
}
.share-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.share-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.catalogue-preview-box {
  background: #f8f9fa;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.74rem;
  line-height: 1.65;
  color: #333;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre;
  overflow-x: auto;
}

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.settings-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.settings-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }

/* ===== FORM ELEMENTS ===== */
.aform-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.aform-group label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.aform-group input,
.aform-group select,
.aform-group textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
  resize: vertical;
}
.aform-group input:focus,
.aform-group select:focus,
.aform-group textarea:focus { border-color: var(--primary); background: #fff; }

.aform-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.apw-wrap { position: relative; display: flex; align-items: center; }
.apw-wrap input { flex: 1; padding-right: 44px !important; }
.apw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

/* ===== MODAL ===== */
.amodal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.amodal-overlay.open { display: flex; }

.amodal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

.amodal-sm { max-width: 420px; padding: 32px; }

.amodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.amodal-header h2 { font-size: 1.15rem; font-weight: 800; }

.amodal-close {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.amodal-close:hover { background: var(--border); }

.amodal-form { padding: 24px 28px; }

.amodal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-msg { color: var(--muted); font-size: 0.9rem; padding: 24px; text-align: center; }

/* ===== TOAST ===== */
.admin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e1208;
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  pointer-events: none;
}
.admin-toast.show { transform: translateX(-50%) translateY(0); }

/* ===== PROMOTIONS PAGE ===== */

/* How-it-works banner */
.promo-how-banner {
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, #fff8f0 0%, #fef3e8 100%);
  border: 1px solid #f0d5b5;
  border-radius: var(--radius);
  padding: 20px 28px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.promo-how-step {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 180px;
}
.promo-how-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.promo-how-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  flex-shrink: 0;
}
.promo-how-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}
.promo-how-arrow {
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 700;
  padding: 0 8px;
  flex-shrink: 0;
}

/* Stats row */
.promo-stat-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* Two-column layout */
.promo-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

/* Panels */
.promo-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Recipients panel */
.promo-recipients-panel {
  display: flex;
  flex-direction: column;
}

.promo-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

.promo-panel-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
}

.promo-panel-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.promo-sel-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  margin-top: 2px;
}
.promo-sel-all input { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; }

/* Search */
.promo-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.promo-search-icon { color: var(--muted); flex-shrink: 0; }
.promo-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text);
  outline: none;
}
.promo-search-input::placeholder { color: var(--muted); }
.promo-search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.85rem; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s;
}
.promo-search-clear:hover { color: var(--text); }

/* Filter tabs */
.promo-filter-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  background: #fafafa;
}
.promo-filter-tab {
  padding: 9px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.promo-filter-tab:hover { color: var(--primary); }
.promo-filter-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Customer list */
.promo-customer-list {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.promo-cust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.promo-cust-item:hover { background: #fdf6ef; }
.promo-cust-item.selected {
  background: #fff8f0;
  border-color: #e0a060;
}
.promo-cust-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px; height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.promo-cust-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b4513, #e67e22);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.promo-cust-info { flex: 1; min-width: 0; }
.promo-cust-name  { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-cust-phone { font-size: 0.73rem; color: var(--muted); font-family: monospace; margin-top: 1px; }

.promo-cust-source {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.promo-src-online  { background: #e3f2fd; color: #1565c0; }
.promo-src-instore { background: #e8f5e9; color: #2e7d32; }

.promo-empty-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 36px 16px;
  line-height: 1.7;
}

/* Selection footer */
.promo-selection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
#promoSelectedBar {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}
.promo-clear-link {
  background: none; border: none;
  font-family: inherit; font-size: 0.8rem;
  color: var(--muted); cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.promo-clear-link:hover { color: var(--red); }

/* ---- Composer panel ---- */
.promo-composer-panel { padding: 20px 22px 22px; }

.promo-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.promo-char-count {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

.promo-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  display: block;
}

.promo-tpl-section { margin-bottom: 16px; }

.promo-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.promo-tpl-btn {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.promo-tpl-btn:hover  { border-color: var(--primary); background: #fff8f0; color: var(--primary); }
.promo-tpl-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Editor row: textarea + preview side by side */
.promo-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.promo-editor-col { display: flex; flex-direction: column; }
.promo-preview-col { display: flex; flex-direction: column; }

.promo-textarea {
  flex: 1;
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.65;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  color: var(--text);
  min-height: 210px;
}
.promo-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,69,19,0.08); }

.promo-var-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.promo-var-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.promo-var-chip {
  padding: 4px 10px;
  background: #fff8f0;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  font-family: monospace;
  transition: all 0.15s;
  user-select: none;
}
.promo-var-chip:hover { background: #fde9cc; border-color: var(--primary); }

/* Phone mockup preview */
.promo-phone-mockup {
  flex: 1;
  border: 2px solid #ddd;
  border-radius: 14px;
  overflow: hidden;
  background: #ece5dd;
  display: flex;
  flex-direction: column;
  min-height: 210px;
}
.promo-phone-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #075e54;
  padding: 10px 14px;
}
.promo-phone-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.promo-phone-contact {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-phone-body {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}
.promo-preview-bubble {
  background: #fff;
  border-radius: 0 10px 10px 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  max-height: 160px;
  overflow-y: auto;
  align-self: flex-start;
  max-width: 95%;
}
.promo-preview-placeholder {
  color: #aaa;
  font-style: italic;
  font-size: 0.78rem;
}
.promo-preview-time {
  font-size: 0.68rem;
  color: #666;
  text-align: right;
  padding-right: 4px;
}

/* CTA */
.promo-cta-wrap {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.promo-send-btn {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(37,211,102,0.35);
  margin-bottom: 10px;
}
.promo-send-btn:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 22px rgba(37,211,102,0.4); }
.promo-send-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }
.promo-send-badge {
  background: rgba(255,255,255,0.25);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
}
.promo-send-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.5;
}
.promo-send-hint svg { flex-shrink: 0; margin-top: 1px; }

/* ===== BULK SEND MODAL ===== */
.bulk-send-modal {
  max-width: 520px;
  padding: 0;
  overflow: hidden;
}

.bulk-modal-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #128c7e, #075e54);
  color: #fff;
}
.bulk-modal-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bulk-modal-title { font-size: 1.05rem; font-weight: 700; }
.bulk-modal-sub   { font-size: 0.82rem; opacity: 0.85; margin-top: 2px; }
.bulk-modal-top .amodal-close {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  border: none;
  width: 32px; height: 32px;
  font-size: 1rem;
}

/* Progress */
.bulk-progress-wrap { padding: 18px 24px 14px; }
.bulk-progress-track {
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bulk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #25d366, #128c7e);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.bulk-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

/* Customer card */
.bulk-customer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.bulk-customer-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b4513, #e67e22);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bulk-customer-info { flex: 1; min-width: 0; }
.bulk-customer-name  { font-weight: 700; font-size: 0.97rem; }
.bulk-customer-phone { font-size: 0.8rem; color: var(--muted); font-family: monospace; }

/* Message preview */
.bulk-preview-label {
  padding: 12px 24px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.bulk-msg-preview {
  margin: 0 24px 10px;
  background: #dcf8c6;
  border-radius: 0 12px 12px 12px;
  padding: 12px 14px;
  font-size: 0.83rem;
  line-height: 1.6;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 130px;
  overflow-y: auto;
  border: 1px solid #b2dfb2;
}

/* Step label */
.bulk-step-label {
  margin: 8px 24px 14px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.8;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 12px;
}
.bulk-step-num {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-right: 3px;
}

/* Actions */
.bulk-actions { padding: 0 24px 24px; }
.bulk-wa-btn {
  width: 100%;
  padding: 14px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(37,211,102,0.3);
  margin-bottom: 10px;
}
.bulk-wa-btn:hover { background: #1da851; transform: translateY(-1px); }

.bulk-secondary-actions {
  display: flex;
  gap: 8px;
}
.bulk-sent-btn {
  flex: 1;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.bulk-sent-btn:hover { background: var(--primary-dark); }
.bulk-skip-btn {
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.bulk-skip-btn:hover { border-color: var(--muted); }
.bulk-stop-btn {
  padding: 10px 14px;
  background: #fce4ec;
  color: #c62828;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.bulk-stop-btn:hover { background: #f8bbd0; }

/* Done state */
.bulk-done-wrap {
  padding: 36px 28px 32px;
  text-align: center;
}
.bulk-done-icon  { font-size: 4rem; margin-bottom: 10px; }
.bulk-done-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.bulk-done-summary { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.bulk-done-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}
.bulk-done-stat {
  padding: 14px 28px;
  border-radius: var(--radius);
  text-align: center;
}
.bulk-done-sent    { background: #e8f5e9; }
.bulk-done-skipped { background: #fff8e1; }
.bulk-done-stat-val   { font-size: 2rem; font-weight: 800; }
.bulk-done-stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.bulk-done-sent    .bulk-done-stat-val { color: #2e7d32; }
.bulk-done-skipped .bulk-done-stat-val { color: #f57f17; }

@media (max-width: 1100px) {
  .promo-layout { grid-template-columns: 1fr; }
  .promo-editor-row { grid-template-columns: 1fr; }
  .promo-phone-mockup { min-height: 180px; }
  .promo-customer-list { max-height: 260px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 14px; }
  .page { padding: 16px; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .aform-row { grid-template-columns: 1fr; }
}

/* ===== ACCOUNT SETTINGS ===== */

.acc-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #1e1208 0%, #3d2010 100%);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  color: #fff;
  position: relative;
}
.acc-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B4513, #E67E22);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.3);
}
.acc-biz-name { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.acc-biz-sub  { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 3px; }
.acc-wa-badge {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  background: rgba(37,211,102,0.15);
  border: 1px solid rgba(37,211,102,0.4);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem; font-weight: 600;
  color: #25d366;
  white-space: nowrap;
}

.acc-otp-notice {
  background: linear-gradient(90deg, #fff8e1, #fffde7);
  border: 1.5px solid #FFD54F;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.84rem;
  color: #6d4c00;
  font-weight: 500;
  margin-bottom: 22px;
}

.acc-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .acc-settings-grid { grid-template-columns: 1fr; } }

.acc-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1.5px solid var(--border);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.acc-card-wa {
  border-color: rgba(37,211,102,0.3);
  background: linear-gradient(135deg, #f1fff6 0%, #ffffff 100%);
}
.acc-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border);
}
.acc-card-icon { font-size: 1.3rem; }
.acc-card-head h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }

.acc-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.acc-field-row:last-child { border-bottom: none; padding-bottom: 0; }
.acc-field-info { flex: 1; min-width: 0; }
.acc-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}
.acc-field-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.acc-field-val.acc-not-set { color: #aaa; font-style: italic; font-weight: 400; }
.acc-masked { font-family: monospace; letter-spacing: 0.05em; }

.acc-edit-btn {
  flex-shrink: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.acc-edit-btn:hover { background: #fff3e0; border-color: var(--accent); }

.acc-wa-info-box {
  background: rgba(37,211,102,0.07);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: #2e7d32;
  line-height: 1.5;
}
.acc-wa-status {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-size: 0.78rem; color: #2e7d32; font-weight: 500;
}
.acc-wa-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #25d366;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ===== OTP MODAL ===== */

.otp-modal { padding: 0; overflow: hidden; }
.otp-modal-header {
  background: linear-gradient(135deg, #1e1208, #3d2010);
  padding: 28px 28px 22px;
  text-align: center;
  color: #fff;
}
.otp-shield-icon { font-size: 2.2rem; margin-bottom: 8px; }
.otp-modal-header h2 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.otp-modal-sub { font-size: 0.82rem; color: rgba(255,255,255,0.65); margin-top: 6px; }

.otp-modal-body { padding: 24px 28px 28px; }
.otp-phone-display {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  background: #fff3e0;
  border: 1.5px solid #E67E22;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 18px;
  letter-spacing: 0.05em;
}
.otp-input-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.otp-input {
  width: 200px;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  border: 2.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: monospace;
  outline: none;
  transition: border-color 0.2s;
  color: var(--primary);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,69,19,0.12); }
.otp-hint { font-size: 0.78rem; color: var(--muted); text-align: center; margin-bottom: 8px; }
.otp-error { color: var(--red); font-size: 0.82rem; font-weight: 600; text-align: center; min-height: 20px; margin-bottom: 10px; }
.otp-verify-btn { width: 100%; padding: 13px; font-size: 1rem; font-weight: 700; border-radius: 10px; }
.otp-resend-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 16px; font-size: 0.8rem;
}
.otp-resend-text { color: var(--muted); }
.otp-resend-btn {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-weight: 700; font-size: 0.8rem;
  font-family: inherit; padding: 0;
}
.otp-timer { color: var(--muted); font-size: 0.8rem; min-width: 28px; }

.acc-edit-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  color: var(--text);
}
.acc-edit-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,69,19,0.1); }

/* ===== AUTO BULK SEND MODAL ===== */

/* Status pill */
.bulk-auto-status {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 22px 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem; font-weight: 600;
  transition: background 0.3s;
}
.bulk-auto-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.bulk-auto-sending { background: #e8f5e9; color: #2e7d32; }
.bulk-auto-sending .bulk-auto-dot { background: #25d366; }
.bulk-auto-waiting  { background: #fff8e1; color: #f57f17; }
.bulk-auto-waiting  .bulk-auto-dot { background: #FFA726; }
.bulk-auto-paused   { background: #fce4ec; color: #c62828; }
.bulk-auto-paused   .bulk-auto-dot { background: #ef5350; animation: none; }
.bulk-auto-done     { background: #e3f2fd; color: #1565c0; }
.bulk-auto-done     .bulk-auto-dot { background: #42a5f5; animation: none; }

/* Countdown ring */
.bulk-countdown-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin: 14px 22px 0;
}
.bulk-countdown-ring {
  position: relative; width: 64px; height: 64px;
}
.bulk-countdown-svg  { width: 64px; height: 64px; transform: rotate(-90deg); }
.bulk-countdown-bg   { fill: none; stroke: #f0f0f0; stroke-width: 4; }
.bulk-countdown-arc  {
  fill: none; stroke: #25d366; stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
}
.bulk-countdown-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: var(--text);
}
.bulk-countdown-label { font-size: 0.76rem; color: var(--muted); text-align: center; }

/* Queue peek */
.bulk-queue-peek { margin: 12px 22px 0; }
.bulk-peek-label { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.bulk-peek-item  {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #f3f4f6;
}
.bulk-peek-item:last-child { border-bottom: none; }
.bulk-peek-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #e5e7eb; color: var(--text);
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bulk-peek-name  { font-size: 0.8rem; font-weight: 600; flex: 1; }
.bulk-peek-phone { font-size: 0.72rem; color: var(--muted); }

/* Auto controls */
.bulk-auto-controls {
  display: flex; gap: 10px;
  padding: 14px 22px 22px;
}
.bulk-pause-btn {
  flex: 1; padding: 11px; background: #fff8e1; color: #f57f17;
  border: 1.5px solid #ffe082; border-radius: 10px;
  font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.bulk-pause-btn:hover { background: #fff3e0; }

/* ════════════════════════════════════════════
   COUPON / VOUCHER PAGE
   ════════════════════════════════════════════ */
.cpn-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.cpn-page-title { font-size: 1.4rem; font-weight: 800; color: #1a1a2e; margin: 0 0 4px; }
.cpn-page-sub   { font-size: 0.84rem; color: #666; margin: 0; }

.cpn-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px;
}
.cpn-stat-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 14px;
  padding: 16px 20px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cpn-stat-green { border-color: #bbf7d0; background: #f0fdf4; }
.cpn-stat-blue  { border-color: #bae6fd; background: #f0f9ff; }
.cpn-stat-amber { border-color: #fde68a; background: #fffbeb; }
.cpn-stat-val   { font-size: 1.6rem; font-weight: 800; color: #1a1a2e; line-height: 1; }
.cpn-stat-label { font-size: 0.72rem; color: #888; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.cpn-filter-bar {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.cpn-search {
  flex: 1; min-width: 200px; padding: 9px 14px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 0.84rem; font-family: inherit; outline: none;
}
.cpn-search:focus { border-color: #8B4513; }
.cpn-filter-select {
  padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 0.82rem; font-family: inherit; background: #fff; cursor: pointer; outline: none;
}

.cpn-table-wrap { background: #fff; border-radius: 16px; overflow: hidden; border: 1.5px solid #e2e8f0; }
.cpn-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.cpn-table thead tr { background: #f8f9fa; }
.cpn-table th {
  padding: 12px 14px; text-align: left; font-weight: 700;
  color: #555; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1.5px solid #e2e8f0;
}
.cpn-table td { padding: 13px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.cpn-table tbody tr:last-child td { border-bottom: none; }
.cpn-table tbody tr:hover { background: #fafafa; }

.cpn-code-cell { display: flex; flex-direction: column; gap: 2px; }
.cpn-code-tag {
  display: inline-block; background: #1a1a2e; color: #fff;
  font-family: 'Courier New', monospace; font-weight: 700; font-size: 0.82rem;
  padding: 3px 10px; border-radius: 6px; letter-spacing: 1px;
}
.cpn-desc-text { font-size: 0.73rem; color: #888; }

.cpn-type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700;
}
.cpn-type-pct  { background: #ede9fe; color: #7c3aed; }
.cpn-type-flat { background: #fef3c7; color: #d97706; }

.cpn-badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700;
}
.cpn-badge-active   { background: #dcfce7; color: #16a34a; }
.cpn-badge-inactive { background: #f1f5f9; color: #64748b; }
.cpn-badge-expired  { background: #fee2e2; color: #dc2626; }

.cpn-action-btns { display: flex; gap: 6px; }
.cpn-btn {
  padding: 5px 10px; border: none; border-radius: 8px; font-size: 0.73rem;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.cpn-btn-edit   { background: #eff6ff; color: #2563eb; }
.cpn-btn-edit:hover { background: #dbeafe; }
.cpn-btn-toggle { background: #f0fdf4; color: #16a34a; }
.cpn-btn-toggle:hover { background: #dcfce7; }
.cpn-btn-del    { background: #fff1f2; color: #dc2626; }
.cpn-btn-del:hover  { background: #fee2e2; }

/* Billing coupon input */
.coupon-apply-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 8px; border-bottom: 1px dashed #e2e8f0; margin-bottom: 2px;
}
.coupon-code-input {
  flex: 1; padding: 7px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 0.82rem; font-family: inherit; outline: none; text-transform: uppercase;
}
.coupon-code-input:focus { border-color: #8B4513; }
.coupon-apply-btn {
  padding: 7px 14px; background: #8B4513; color: #fff; border: none;
  border-radius: 8px; font-weight: 700; font-size: 0.8rem; cursor: pointer; font-family: inherit;
}
.coupon-apply-btn:hover { background: #6b3410; }
.coupon-status {
  font-size: 0.76rem; padding: 4px 10px; border-radius: 16px; font-weight: 600;
  display: none;
}
.coupon-status.ok  { display: block; background: #dcfce7; color: #16a34a; }
.coupon-status.err { display: block; background: #fee2e2; color: #dc2626; }
.coupon-remove-btn {
  background: none; border: none; color: #dc2626; font-size: 0.8rem;
  cursor: pointer; padding: 0 4px; font-weight: 700;
}

@media (max-width: 768px) {
  .cpn-stats-row { grid-template-columns: 1fr 1fr; }
}


/* ===== POS SYSTEM ===== */
#page-billing { padding: 0 !important; overflow: hidden !important; }
#page-billing.active { display: flex !important; flex-direction: column; }
.pos-container { display:flex; flex-direction:column; height:100%; background:#f5f6fa; overflow:hidden; }
.pos-header { display:flex; align-items:center; justify-content:space-between; padding:12px 20px; background:#fff; border-bottom:1.5px solid var(--border); flex-shrink:0; }
.pos-title { font-size:1.05rem; font-weight:800; color:var(--text); margin:0; }
.pos-body { display:flex; flex:1; overflow:hidden; }
/* Left panel */
.pos-left-panel { flex:1; display:flex; flex-direction:column; border-right:1.5px solid var(--border); background:#fff; overflow:hidden; min-width:0; }
.pos-search-wrap { padding:10px 14px; border-bottom:1px solid var(--border); flex-shrink:0; }
.pos-search-input { width:100%; padding:8px 13px; border:1.5px solid var(--border); border-radius:8px; font-size:0.88rem; outline:none; }
.pos-search-input:focus { border-color:var(--primary); }
.pos-cat-bar { display:flex; gap:6px; padding:8px 14px; border-bottom:1px solid var(--border); overflow-x:auto; flex-shrink:0; }
.pos-cat-bar::-webkit-scrollbar { height:3px; }
.pos-cat-btn { padding:4px 12px; border-radius:20px; border:1.5px solid var(--border); background:#f5f6fa; font-size:0.76rem; font-weight:600; cursor:pointer; white-space:nowrap; color:var(--text); transition:all .15s; }
.pos-cat-btn.active, .pos-cat-btn:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.pos-product-grid { flex:1; overflow-y:auto; padding:12px; display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; align-content:start; }
.pos-product-card { background:#fafafa; border:1.5px solid var(--border); border-radius:10px; padding:12px 8px; cursor:pointer; transition:all .15s; text-align:center; user-select:none; }
.pos-product-card:hover { border-color:var(--primary); background:#fffaf7; transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,.08); }
.pos-product-emoji { font-size:1.9rem; line-height:1; }
.pos-product-name { font-size:0.73rem; font-weight:700; color:var(--text); margin:5px 0 2px; line-height:1.3; }
.pos-product-price { font-size:0.82rem; font-weight:800; color:var(--primary); }
.pos-product-weight { font-size:0.67rem; color:var(--muted); }
.pos-no-results { grid-column:1/-1; text-align:center; padding:30px; color:var(--muted); font-size:0.88rem; }
/* Right panel */
.pos-right-panel { width:360px; display:flex; flex-direction:column; background:#f9f7f5; overflow-y:auto; flex-shrink:0; border-left:1.5px solid var(--border); }
.pos-bill-type-bar { display:flex; gap:18px; padding:9px 14px; background:#fff; border-bottom:1px solid var(--border); flex-shrink:0; }
.pos-bill-type-opt { display:flex; align-items:center; gap:6px; font-size:0.82rem; font-weight:600; color:var(--text); cursor:pointer; }
.pos-section { background:#fff; border-bottom:1px solid var(--border); padding:11px 14px; }
.pos-section-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.pos-section-label { font-size:0.75rem; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.04em; }
.pos-guest-label { display:flex; align-items:center; gap:5px; font-size:0.75rem; color:var(--muted); cursor:pointer; font-weight:600; }
.pos-customer-fields { display:flex; flex-direction:column; gap:7px; }
.pos-input { width:100%; padding:8px 11px; border:1.5px solid var(--border); border-radius:7px; font-size:0.84rem; outline:none; background:#fafafa; transition:border-color .15s; }
.pos-input:focus { border-color:var(--primary); background:#fff; }
.pos-input.pos-error { border-color:#dc2626; }
/* Cart */
.pos-cart-section { flex:1; }
.pos-cart-badge { background:var(--primary); color:#fff; font-size:0.7rem; font-weight:700; padding:2px 8px; border-radius:20px; }
.pos-cart-list { max-height:220px; overflow-y:auto; }
.pos-cart-empty { color:var(--muted); font-size:0.82rem; text-align:center; padding:18px 0; }
.pos-cart-item { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px dashed var(--border); }
.pos-cart-item:last-child { border-bottom:none; }
.pos-cart-item-emoji { font-size:1.2rem; flex-shrink:0; }
.pos-cart-item-info { flex:1; min-width:0; }
.pos-cart-item-name { font-size:0.76rem; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pos-cart-item-price { font-size:0.7rem; color:var(--muted); }
.pos-cart-qty { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.pos-qty-btn { width:22px; height:22px; border-radius:50%; border:1.5px solid var(--border); background:#fff; cursor:pointer; font-size:0.85rem; font-weight:700; display:flex; align-items:center; justify-content:center; transition:all .15s; color:var(--text); }
.pos-qty-btn:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.pos-qty-val { font-size:0.82rem; font-weight:700; min-width:18px; text-align:center; }
.pos-cart-item-total { font-size:0.8rem; font-weight:800; color:var(--primary); min-width:46px; text-align:right; flex-shrink:0; }
/* Discount & Coupon */
.pos-discount-row { display:flex; gap:8px; align-items:center; }
.pos-select { padding:8px 10px; border:1.5px solid var(--border); border-radius:7px; font-size:0.82rem; outline:none; background:#fafafa; font-weight:600; flex-shrink:0; cursor:pointer; }
.pos-select:focus { border-color:var(--primary); }
.pos-coupon-input-row { display:flex; gap:8px; }
.pos-coupon-tag { margin-top:8px; padding:7px 12px; background:#f0fdf4; border:1.5px solid #86efac; border-radius:7px; font-size:0.8rem; color:#15803d; font-weight:600; display:flex; align-items:center; justify-content:space-between; }
.pos-coupon-remove-btn { cursor:pointer; color:#dc2626; font-weight:800; font-size:0.85rem; background:none; border:none; padding:0; }
/* Totals */
.pos-totals-box { padding:12px 14px; background:#fff; border-bottom:1px solid var(--border); }
.pos-total-row { display:flex; justify-content:space-between; font-size:0.84rem; padding:3px 0; color:var(--text); }
.pos-grand-row { font-size:1rem; font-weight:800; padding-top:8px; margin-top:5px; border-top:2px solid var(--border); color:var(--primary); }
.pos-disc-val { color:#15803d; font-weight:700; }
/* Actions */
.pos-action-bar { display:flex; flex-direction:column; gap:8px; padding:12px 14px; background:#fff; }
.pos-btn { padding:9px 15px; border-radius:8px; border:none; cursor:pointer; font-size:0.84rem; font-weight:700; transition:all .15s; text-align:center; }
.pos-btn-primary { background:var(--primary); color:#fff; }
.pos-btn-primary:hover { filter:brightness(0.88); }
.pos-btn-outline { background:#fff; border:1.5px solid var(--border); color:var(--text); }
.pos-btn-outline:hover { border-color:var(--primary); color:var(--primary); }
.pos-btn-whatsapp { background:#25D366; color:#fff; }
.pos-btn-whatsapp:hover { background:#1da851; }
.pos-btn-ghost { background:transparent; border:1.5px solid #fca5a5; color:#dc2626; }
.pos-btn-ghost:hover { background:#fef2f2; }
.pos-full-btn { width:100%; }
/* Modal */
.pos-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:8000; display:flex; align-items:center; justify-content:center; padding:16px; }
.pos-modal { background:#fff; border-radius:14px; max-width:460px; width:100%; max-height:90vh; display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,.25); }
.pos-modal-head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1.5px solid var(--border); font-weight:800; font-size:0.95rem; flex-shrink:0; }
.pos-modal-close { background:none; border:none; font-size:1rem; cursor:pointer; color:var(--muted); width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.pos-modal-close:hover { background:#f3f4f6; }
.pos-bill-preview { flex:1; overflow-y:auto; padding:18px; background:#fafafa; }
.pos-modal-footer { display:flex; gap:8px; padding:12px 18px; border-top:1.5px solid var(--border); flex-shrink:0; }
.pos-modal-footer .pos-btn { flex:1; }
