@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Syne:wght@700;800&display=swap');

:root {
  /* ── Premium Boutique Palette (matches storefront) ── */
  --bg-main: #FAFAF8;
  --bg-alt: #F3F2EF;
  --bg-sidebar: rgba(255, 255, 255, 0.75);
  --bg-card: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.70);
  --bg-dark: #111827;

  /* Brand colors */
  --accent: #111111;
  --accent-glow: rgba(17, 17, 17, 0.05);
  --gold: #C9A84C;
  --gold-glow: rgba(201, 168, 76, 0.15);
  --gold-gradient: linear-gradient(135deg, #C9A84C 0%, #F0B835 100%);
  --saff: #f59e0b;
  --saff-glow: rgba(245, 158, 11, 0.15);

  /* Text & Surfaces */
  --text-main: #0D0D0D;
  --text-dim: #64748b;
  --text-muted: #94a3b8;
  --white: #ffffff;

  /* Premium Elevations */
  --border: #E5E5E0;
  --glass: blur(12px) saturate(180%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 10px 30px rgba(201, 168, 76, 0.25);

  /* Borders & shadows */
  --border: #E8E6E1;
  --glass: blur(28px);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* Fonts — same as storefront */
  --font-logo: 'Syne', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 80px;

  /* Alias tokens consumed by JS-rendered HTML */
  --teal: var(--accent);
  --teal2: var(--gold);
  --teal-glow: var(--accent-glow);
  --tealg: rgba(0, 0, 0, 0.03);
  --navy: #0f172a;
  --navy2: #1e293b;
  --gray: #94a3b8;
  --bdr: #E8E6E1;
  --black: #0D0D0D;
  --green: #22c55e;
  --red: #ef4444;
  --purple: #8b5cf6;
  --hot: #f59e0b;
}

[data-theme="dark"] {
  --bg-main: #0A0A0A;
  --bg-sidebar: rgba(22, 22, 22, 0.95);
  --bg-card: #161616;
  --bg-topbar: rgba(22, 22, 22, 0.85);
  --bg-dark: #F5F5F3;
  --text-main: #F5F5F3;
  --text-dim: #AAAAAA;
  --white: #161616;
  --border: #252525;
  --navy: var(--bg-main);
  --navy2: var(--bg-card);
  --gray: #AAAAAA;
  --bdr: var(--border);
  --accent: #C9A84C;
  --accent-glow: rgba(201, 168, 76, 0.1);
  --teal: #C9A84C;
  --teal2: #FFFFFF;
}

/* Fix specific button visibility in dark mode */
[data-theme="dark"] .btn-teal {
  background: var(--gold);
  color: #0A0A0A !important;
  font-weight: 800;
}

[data-theme="dark"] .btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .sb-item.active {
  background: #1a1a1a;
  border-color: var(--gold);
}

[data-theme="dark"] .sb-item.active .icon {
  color: var(--gold);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex !important;
  /* Force flex layout regardless of inline display:none from auth guard */
  min-height: 100vh;
  line-height: 1.6;
}

/* SIDEBAR */
/* SIDEBAR */
/* SIDEBAR */
/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: all 0.4s ease;
}

.sb-logo {
  padding: 32px 24px;
  border-bottom: 1px solid var(--border)
}

.sb-logo .logo {
  font-family: var(--font-logo);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -.04em
}

.sb-logo .logo span {
  background: var(--gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.sb-logo .sub {
  font-size: .65rem;
  color: var(--text-dim);
  margin-top: 2px;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  opacity: 0.8
}

.sb-nav {
  flex: 1;
  padding: 24px 16px;
  overflow-y: auto
}

.sb-section {
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 12px 8px;
  margin-top: 20px
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 4px;
  position: relative;
  border: 1px solid transparent;
}

.sb-item:hover {
  background: var(--bg-card);
  color: var(--accent);
  transform: translateX(6px);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.sb-item.active {
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 10px 25px -5px var(--accent-glow);
  transform: translateX(4px);
}

.sb-item .icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.8;
  stroke-width: 2.2px;
}

.sb-item.active .icon {
  opacity: 1;
  color: var(--gold);
}

.sb-item .badge {
  margin-left: auto;
  background: var(--saff);
  color: #fff;
  font-size: .65rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-heading);
  box-shadow: 0 4px 10px var(--saff-glow);
}

.sb-item .badge.g {
  background: var(--accent);
  box-shadow: 0 4px 10px var(--accent-glow);
}

.sb-nav i {
  stroke-width: 2px;
}

.sb-footer {
  padding: 24px;
  border-top: 1px solid var(--border);
  background: rgba(16, 185, 129, 0.03)
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 12px
}

.sb-ava {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 10px var(--accent-glow)
}

.sb-uname {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-main)
}

.sb-urole {
  font-size: .7rem;
  color: var(--accent);
  font-weight: 600
}

.view-store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .3s
}

.view-store:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow)
}

/* MAIN */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-main);
  transition: margin-left 0.4s ease;
}

.topbar {
  padding: 0 48px;
  height: 88px;
  background: var(--bg-topbar);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02)
}

.topbar h1 {
  font-family: var(--font-logo);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.06em;
  color: var(--text-main);
  margin: 0;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }

  100% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

.hdr-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Syne', sans-serif;
  margin: 0 24px;
}
#adminClock {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.05em;
  line-height: 1;
}
#adminDate {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 4px;
}
.hdr-health {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
#netStatus {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notif:hover {
  border-color: var(--gold);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--gold-glow);
}

.notif-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--bg-card)
}

.content {
  flex: 1;
  padding: 40px;
  background: radial-gradient(circle at 100% 0%, rgba(201, 168, 76, 0.04) 0%, transparent 40%),
              radial-gradient(circle at 0% 100%, rgba(201, 168, 76, 0.02) 0%, transparent 40%),
              var(--bg-main);
  min-height: 100vh;
}

/* PANELS */
.panel {
  display: none;
  animation: fadeIn .4s cubic-bezier(0.16, 1, 0.3, 1)
}

.panel.active {
  display: block
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.stat {
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.stat:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 80%, var(--accent-glow));
  opacity: 0;
  transition: 0.5s;
}

.stat:hover::after {
  opacity: 1;
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.stat-val.teal {
  color: var(--accent);
}

.stat-val.saff {
  color: var(--saff);
}

.stat-lbl {
  font-size: .78rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.stat-chg {
  font-size: .72rem;
  margin-top: 14px;
  font-weight: 800;
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 8px;
}

.stat-chg.up {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
}

.stat-chg.dn {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* BIG STATS ROW */
.stats2 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 32px
}

.s2 {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.s2:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.s2::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.s2:hover::after {
  opacity: 1;
}

.s2-val {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 6px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.s2-lbl {
  font-size: .75rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em
}

/* CHARTS AREA */
.chart-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
  margin-bottom: 32px
}

.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02)
}

.chart-box h3 {
  font-family: var(--font-logo);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main)
}

.chart-box h3 .sub {
  font-size: .8rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-left: auto
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
  padding: 10px 0
}

.bar {
  flex: 1;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(to top, var(--accent), #34d399);
  position: relative;
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  min-width: 0;
  box-shadow: 0 4px 15px var(--accent-glow)
}

.bar:hover {
  transform: scaleY(1.05);
  filter: brightness(1.1);
  z-index: 10;
}

.bar.active {
  background: linear-gradient(to top, var(--accent), var(--text-main));
  border-color: var(--bg-dark);
  box-shadow: 0 0 25px var(--accent);
}

.bar-lbl {
  font-size: .7rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-heading);
  font-weight: 800
}

.pie-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.pie-item {
  display: flex;
  align-items: center;
  gap: 12px
}

.pie-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0
}

.pie-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden
}

.pie-fill {
  height: 100%;
  border-radius: 4px
}

.pie-pct {
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 800;
  min-width: 35px;
  text-align: right
}

.pie-lbl {
  font-size: .85rem;
  color: var(--text-dim);
  min-width: 90px;
  font-weight: 600
}

/* TABLE */
.tbl-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02)
}

.tbl-head {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(16, 185, 129, 0.02)
}

.tbl-head h3 {
  font-family: var(--font-logo);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main)
}

.tbl-actions {
  display: flex;
  align-items: center;
  gap: 16px
}

.tbl-srch {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  gap: 10px;
  transition: all .3s
}

.tbl-srch:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--bg-card)
}

.tbl-srch input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: .9rem;
  width: 220px;
  font-family: var(--font-body)
}

.tbl-srch input::placeholder {
  color: var(--text-dim)
}

.btn-sm {
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  letter-spacing: 0.02em
}

.btn-teal {
  background: var(--accent);
  color: white !important;
  box-shadow: 0 8px 20px var(--accent-glow)
}

.btn-teal:hover {
  background: #0d9488;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px var(--accent-glow)
}

.btn-saff {
  background: var(--saff);
  color: white
}

.btn-saff:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--saff-glow)
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border)
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  background: var(--accent-glow)
}

table {
  width: 100%;
  border-collapse: collapse
}

thead tr {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border)
}

th {
  padding: 18px 24px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim)
}

td {
  padding: 18px 24px;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-weight: 500
}

tr:hover td {
  background: rgba(16, 185, 129, 0.03)
}

tr:last-child td {
  border-bottom: none
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase
}

.badge.delivered {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2)
}

.badge.pending {
  background: rgba(251, 146, 60, 0.1);
  color: #ea580c;
  border: 1px solid rgba(251, 146, 60, 0.2)
}

.badge.cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2)
}

.badge.shipped {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2)
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

.act-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .75rem;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-weight: 800;
  transition: all .3s
}

.act-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow)
}

.act-btn.red:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05)
}

.pt-name {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-main)
}

.price-inr {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--text-main)
}

.price-inr::before {
  content: '₹';
  font-size: .9em;
  margin-right: 2px
}

/* MODAL */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center
}

.modal-bg.open {
  display: flex
}

.modal {
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 40px;
  width: 550px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.15)
}

.modal h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 28px;
  color: var(--text-main);
  letter-spacing: -.02em
}

.form-row {
  margin-bottom: 24px
}

.form-row label {
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 10px
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 20px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: .95rem;
  outline: none;
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02)
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--bg-card)
}

.form-row textarea {
  resize: vertical;
  min-height: 120px
}

.btn {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all .3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05)
}

.form-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

.modal-btns {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  justify-content: flex-end
}

/* INVOICE */
.inv {
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04)
}

.inv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px
}

.inv-brand .logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800
}

.inv-brand .logo span {
  color: var(--teal)
}

.inv-brand p {
  font-size: .8rem;
  color: var(--gray);
  margin-top: 8px;
  line-height: 1.6
}

.inv-details h3 {
  font-family: 'Syne', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  color: var(--saff);
  margin-bottom: 10px
}

.inv-details p {
  font-size: .8rem;
  color: var(--gray);
  margin-bottom: 6px
}

.inv-details strong {
  color: var(--teal2)
}

.inv-table table {
  width: 100%
}

.inv-table th {
  background: var(--navy2);
  border-radius: 0
}

.inv-total {
  text-align: right;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--bdr)
}

.inv-total .row {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  font-size: .85rem;
  margin-bottom: 6px
}

.inv-total .row span {
  min-width: 90px;
  text-align: right
}

.inv-total .row.final {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--teal)
}

/* PAYMENT GATEWAY */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px
}

.pg-card {
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03)
}

.pg-card.active-gw {
  border-color: var(--teal);
  box-shadow: 0 15px 40px rgba(0, 229, 200, .1)
}

.pg-card:hover {
  transform: translateY(-5px);
  border-color: var(--teal)
}

.pg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px
}

.pg-icon {
  font-size: 2.2rem
}

.toggle {
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--navy2);
  border: 1px solid var(--bdr);
  position: relative;
  cursor: pointer;
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1)
}

.toggle.on {
  background: var(--teal);
  border-color: var(--teal)
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-main);
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
}

.toggle.on::after {
  transform: translateX(20px)
}

.pg-name {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px
}

.pg-desc {
  font-size: .8rem;
  color: var(--gray);
  line-height: 1.5
}

.pg-fees {
  font-size: .76rem;
  color: var(--teal);
  margin-top: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 600
}

/* CUSTOMIZATION & SETTINGS BOXES */
.cust-box,
.sett-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02)
}

.cust-box h3,
.sett-box h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main)
}

.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px
}

.color-swatch {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05)
}

.color-swatch.active {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 8px 15px var(--accent-glow)
}

.preview-store {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: .95rem;
  color: var(--text-dim);
  flex-direction: column;
  gap: 10px
}

.tag {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: .8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-dim);
  transition: all .3s
}

.tag.active {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow)
}

.sett-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border)
}

.sett-item:last-child {
  border-bottom: none
}

.sett-l strong {
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 800;
  display: block;
  color: var(--text-main);
  margin-bottom: 2px
}

.sett-l span {
  font-size: .8rem;
  color: var(--text-dim);
  font-weight: 500
}

.toggle {
  width: 52px;
  height: 28px;
  border-radius: 20px;
  background: var(--bg-main);
  position: relative;
  cursor: pointer;
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1)
}

.toggle.on {
  background: var(--accent)
}

.toggle::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-main);
  transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
}

.toggle.on::after {
  transform: translateX(24px);
  background: white
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: var(--bg-main)
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent)
}

/* ── PRODUCT THUMBNAIL (admin table) ── */
.prod-thumb {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pt-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid var(--border);
  background-size: cover !important;
}

.pt-cat {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
}

/* Stock bar */
.stock-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  width: 60px;
}

.stock-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── BADGE VARIANTS ── */
.badge.hot {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.processing {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge.b {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge.green {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ── GRIDS for Settings & Customize panels ── */
.cust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media(max-width:900px) {

  .cust-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Sliders & color helpers */
.slider-row {
  margin-bottom: 20px;
}

.slider-row label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.slider-row input[type=range] {
  width: 100%;
  accent-color: var(--accent);
}

.color-lbl {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Preview store box */
.preview-store {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-main);
  border: 1px dashed var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Loyalty report grids */
.cust-grid.loyalty,
.stat-grid .tier-card {
  flex: 1;
}

/* Upload states */
.preview-item.uploading {
  border: 2px solid var(--saff);
  opacity: 0.7;
  animation: pulse-upload 1.5s infinite;
}

.preview-item.uploaded {
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

@keyframes pulse-upload {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(0.98);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}

/* MOBILE */
@media(max-width:1024px) {
  .sidebar {
    display: none
  }

  .main {
    margin-left: 0
  }
}

@media(max-width:768px) {
  .sidebar {
    width: 60px
  }

  .sb-logo,
  .sb-section,
  .sb-item span:not(.icon),
  .sb-user .sb-uname,
  .sb-user .sb-urole,
  .view-store span {
    display: none
  }

  .main {
    margin-left: 60px
  }

  .stat-grid,
  .stats2 {
    grid-template-columns: 1fr 1fr
  }

  .chart-row,
  .cust-grid,
  .settings-grid,
  .pg-grid {
    grid-template-columns: 1fr
  }
}

/* NOTIFICATION PANEL */
.notif-panel {
  position: absolute;
  top: 60px;
  right: 0;
  width: 360px;
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

.notif-panel.active {
  display: flex;
  animation: slideIn .3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.notif-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--bg-dark);
}

.notif-head span {
  font-size: .75rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  padding: 16px 24px;
  display: flex;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .3s;
}

.notif-item:hover {
  background: var(--accent-glow);
}

.notif-item.unread {
  background: rgba(16, 185, 129, 0.04);
}

.ni-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ni-body strong {
  display: block;
  font-size: .85rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 4px;
}

.ni-body span {
  display: block;
  font-size: .8rem;
  color: var(--text-dim);
  line-height: 1.5;
  font-weight: 500;
}

.ni-body small {
  font-size: .7rem;
  color: var(--accent);
  margin-top: 6px;
  display: block;
  font-weight: 700;
}

.notif-foot {
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-dim);
  background: var(--bg-main);
  cursor: pointer;
  font-weight: 800;
  font-family: var(--font-heading);
}

/* OTP BOXES */
.otp-box {
  width: 55px;
  height: 70px;
  background: var(--bg-main) !important;
  border: 2px solid var(--border) !important;
  border-radius: 16px !important;
  font-size: 1.8rem !important;
  font-weight: 900;
  color: var(--accent) !important;
  text-align: center;
  outline: none;
  transition: all .3s;
  margin: 0 6px;
  font-family: var(--font-heading);
}

.otp-box:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-3px);
}

/* MODAL OVERRIDES */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 32px;
  width: 500px;
  max-width: 95vw;
  position: relative;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-head h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--bg-dark);
  margin: 0;
  letter-spacing: -.02em;
}

.close {
  font-size: 2rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .3s;
  line-height: 1;
}

.close:hover {
  color: #ef4444;
  transform: rotate(90deg);
}

/* THEME TOGGLE */
.theme-toggle {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--accent-glow);
}

[data-theme="dark"] .theme-toggle .icon {
  transform: rotate(360deg);
}

/* AI CHAT */
.ai-chat-btn {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 60px;
  height: 60px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 10px 30px var(--accent-glow);
  transition: all .3s
}

.ai-chat-btn:hover {
  transform: scale(1.1) rotate(5deg)
}

.ai-panel {
  position: fixed;
  right: 30px;
  bottom: 100px;
  width: 350px;
  height: 450px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  display: none;
  flex-direction: column;
  z-index: 2000;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass)
}

.ai-panel.active {
  display: flex;
  animation: fadeUp .3s ease
}

.ai-head {
  padding: 20px;
  background: var(--accent);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.ai-head strong {
  font-family: var(--font-logo);
  font-size: 1.1rem
}

.ai-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.ai-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: .85rem;
  line-height: 1.4
}

.ai-msg.bot {
  background: var(--bg-main);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 2px
}

.ai-msg.user {
  background: var(--accent);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px
}

.ai-input {
  padding: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px
}

.ai-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .85rem
}

.ai-input button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* LOGISTICS TIMELINE */
.track-wrap {
  padding: 20px;
  background: var(--bg-main);
  border-radius: 12px;
  margin-top: 15px;
}

.timeline {
  position: relative;
  padding-left: 30px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--border);
}

.t-item {
  position: relative;
  margin-bottom: 25px;
}

.t-dot {
  position: absolute;
  left: -25px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gray);
  border: 2px solid var(--bg-card);
  z-index: 2;
}

.t-item.active .t-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.t-item.active .t-lbl {
  color: var(--text-main);
  font-weight: 700;
}

.t-lbl {
  font-size: .85rem;
  color: var(--text-dim);
  display: block;
}

.t-date {
  font-size: .7rem;
  color: var(--gray);
}

/* SECURITY LOGS */
.sec-log {
  font-size: .75rem;
  border-top: 1px solid var(--border);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sec-log span {
  color: var(--gray);
}

.sec-log strong {
  color: var(--green);
}

.sec-log.fail strong {
  color: var(--red);
}

/* LOYALTY & REPORTS */
.tier-card {
  padding: 24px;
  border-radius: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-md);
  transition: transform .3s;
}

.tier-card:hover {
  transform: translateY(-5px);
}

.tier-bronze {
  background: linear-gradient(135deg, #5D4037, #8D6E63);
}

.tier-silver {
  background: linear-gradient(135deg, #455A64, #90A4AE);
}

.tier-gold {
  background: linear-gradient(135deg, #FF8F00, #FFD54F);
}

.tier-platinum {
  background: linear-gradient(135deg, #1A237E, #5C6BC0);
}

.tier-name {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .8;
}

.tier-pts {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: var(--font-logo);
}

.report-view {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.rep-item {
  padding: 15px;
  border-radius: 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
}

@media print {

  .sidebar,
  .topbar,
  .notif-panel,
  .ai-chat-btn,
  .btn-sm:not(.print-btn) {
    display: none !important;
  }

  .main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .panel:not(.active) {
    display: none !important;
  }
}

/* MEDIA UPLOAD IMPROVEMENTS */
.media-upload-c {
  margin-top: 10px;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-main);
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  z-index: 10;
  font-weight: 800;
  border: none;
}

.preview-item.uploading::after {
  content: "⏳";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.preview-item.uploaded::after {
  content: "✅";
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--green);
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

/* MULTI-SELECT CATEGORIES */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-main);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tag-chk {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.tag-chk:has(input:checked) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.tag-chk input {
  display: none;
}