/* ============================================================
   Cat Texture Premium – Voucher System Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Neutrals */
  --n50:  #F9FAFB; --n100: #F3F4F6; --n200: #E5E7EB; --n300: #D1D5DB;
  --n400: #9CA3AF; --n500: #6B7280; --n600: #4B5563; --n700: #374151;
  --n800: #1F2937; --n900: #111827;
  /* Brand – dark slate */
  --brand:   #0F172A;  --brand-2: #1E293B;  --brand-3: #334155;
  /* Accent – warm amber */
  --accent:  #92400E;  --accent-h: #78350F;
  /* Status */
  --ok:    #065F46; --ok-bg:   #ECFDF5;
  --err:   #991B1B; --err-bg:  #FEF2F2;
  --warn:  #92400E; --warn-bg: #FFFBEB;
  --info-c:#1E40AF; --info-bg: #EFF6FF;
  /* Radius & Shadow */
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  /* Legacy compatibility – used by admin pages */
  --primary:      #92400E; --primary-dark: #78350F; --primary-light: #B45309;
  --secondary:    #374151; --sec-light:    #6B7280;
  --text:         #111827; --text-muted:   #6B7280;
  --white:        #FFFFFF; --border:       #E5E7EB;
  --bg:           #F9FAFB; --bg-alt:       #F3F4F6;
  --success:      #065F46; --danger:       #991B1B;
  --warning:      #92400E; --info:         #1E40AF;
  --shadow:       0 1px 3px rgba(0,0,0,.07); --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 14px; --radius-sm: 8px; --sidebar-w: 200px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--n50); color: var(--n900); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; }

/* ── Utility ───────────────────────────────────────────────── */
.hidden, .d-none { display: none !important; }
.text-center { text-align: center; }
.text-muted  { color: var(--n500); }
.text-sm     { font-size: .85rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ================================================================
   PUBLIC PAGES
   ================================================================ */

/* ── Site Header ────────────────────────────────────────────── */
.pub-nav, .site-header {
  background: #fff;
  border-bottom: 1px solid var(--n200);
}
.pub-nav {
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  gap: .75rem;
}
.pub-nav .brand      { color: var(--brand); font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.pub-nav .brand-icon { display: none; }
.pub-nav .tagline    { display: none; }
.site-header-inner {
  max-width: 520px; margin: 0 auto;
  padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: center; gap: .75rem;
}
.site-logo-img     { height: 36px; width: auto; object-fit: contain; }
.site-logo-name    { font-size: .95rem; font-weight: 700; color: var(--brand); }
.site-logo-tagline { font-size: .72rem; color: var(--n500); }

/* ── Hero / Main wrapper ────────────────────────────────────── */
.hero, .site-main {
  min-height: calc(100vh - 58px);
  padding: 2.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--n50);
}
.hero-card, .content-wrap {
  width: 100%;
  max-width: 440px;
}
.hero-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 2rem 1.75rem;
  border: 1px solid var(--n200);
  box-shadow: var(--shadow-sm);
}
.hero-logo, .hero-block { text-align: center; margin-bottom: 1.75rem; }
.hero-logo .logo-icon { display: none; }
.hero-logo h1, .hero-block h1 { font-size: 1.4rem; font-weight: 700; color: var(--brand); margin-bottom: .35rem; }
.hero-logo p,  .hero-block p  { font-size: .88rem; color: var(--n500); margin-top: .2rem; }
.site-logo-wrap { margin-bottom: 1.25rem; text-align: center; }
.site-logo-wrap img { height: 44px; width: auto; margin: 0 auto; }
/* Voucher page */
.voucher-page {
  min-height: calc(100vh - 58px);
  display: flex; flex-direction: column; align-items: center;
  padding: 1.75rem 1.25rem 3rem; background: var(--n50);
}
.voucher-page .page-title, .page-title {
  font-size: .7rem; font-weight: 700; color: var(--n400);
  text-transform: uppercase; letter-spacing: 1.2px;
  text-align: center; margin-bottom: 1.25rem;
}
/* Surface */
.surface { background: #fff; border: 1px solid var(--n200); border-radius: var(--r-lg); padding: 1.75rem 1.5rem; }
/* Footer */
.site-footer { text-align: center; padding: 1.25rem 1rem; font-size: .75rem; color: var(--n400); border-top: 1px solid var(--n200); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label, .admin-form label {
  display: block; font-weight: 600; font-size: .82rem; color: var(--n700); margin-bottom: .4rem;
}
.form-row { display: grid; grid-template-columns: 1fr; gap: .9rem; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--n300);
  border-radius: var(--r-sm);
  background: #fff; color: var(--n900); font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none; outline: none;
}
.form-control:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(30,41,59,.08); }
.form-control::placeholder { color: var(--n400); }
.form-control.is-invalid { border-color: var(--err); }
.form-hint, .form-text { font-size: .76rem; color: var(--n500); margin-top: .3rem; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem; padding: .65rem 1.4rem;
  border: 1.5px solid transparent; border-radius: var(--r-sm);
  font-weight: 600; font-size: .88rem; cursor: pointer;
  text-decoration: none; transition: background .15s, opacity .15s;
  white-space: nowrap; line-height: 1;
}
.btn:active { opacity: .85; }
.btn:hover  { opacity: .92; text-decoration: none; }
.btn-primary  { background: var(--brand);   color: #fff; border-color: var(--brand); }
.btn-primary:hover  { background: var(--brand-2); border-color: var(--brand-2); opacity: 1; }
.btn-secondary{ background: #fff; color: var(--n700); border-color: var(--n300); }
.btn-secondary:hover{ background: var(--n100); opacity: 1; }
.btn-success  { background: var(--ok);      color: #fff; border-color: var(--ok); }
.btn-danger   { background: var(--err);     color: #fff; border-color: var(--err); }
.btn-danger:hover { opacity: .88; }
.btn-warning  { background: var(--accent);  color: #fff; border-color: var(--accent); }
.btn-info     { background: var(--info-c);  color: #fff; border-color: var(--info-c); }
.btn-sm { padding: .4rem .85rem; font-size: .78rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: .95rem; }
.btn-block { width: 100%; display: flex; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem;
  font-size: .88rem; display: flex; align-items: flex-start; gap: .6rem;
  border-left: 3px solid transparent;
}
.alert-success { background: var(--ok-bg);   color: var(--ok);    border-left-color: var(--ok);    }
.alert-danger  { background: var(--err-bg);  color: var(--err);   border-left-color: var(--err);   }
.alert-warning { background: var(--warn-bg); color: var(--warn);  border-left-color: var(--warn);  }
.alert-info    { background: var(--info-bg); color: var(--info-c);border-left-color: var(--info-c);}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .55rem;
  border-radius: 3px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.badge-success, .badge-active    { background: var(--ok-bg);   color: var(--ok);    }
.badge-danger,  .badge-exhausted { background: var(--err-bg);  color: var(--err);   }
.badge-warning, .badge-expired   { background: var(--warn-bg); color: var(--warn);  }
.badge-info                      { background: var(--info-bg); color: var(--info-c);}
.badge-gray,    .badge-inactive  { background: var(--n100);    color: var(--n600);  }

/* ================================================================
   VOUCHER FLIP CARD
   ================================================================ */
.flip-wrapper {
  perspective: 1100px;
  width: 100%; max-width: 440px;
  margin: 0 auto 1.5rem;
}
.flip-card {
  width: 100%; aspect-ratio: 1.586 / 1;
  position: relative; transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}
.flip-card.flipped       { transform: rotateY(180deg); }
.flip-card-inner         { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.flip-card-inner.flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; inset: 0;
  border-radius: var(--r-lg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden; box-shadow: var(--shadow-lg);
}

/* ── Card Front ────────────────────────────────────────────── */
.card-front {
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 55%, #161B2E 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex; flex-direction: column;
}
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(150deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 50%, rgba(0,0,0,.50) 100%);
  z-index: 1;
}
.card-deco {
  position: absolute; inset: 0; overflow: hidden; z-index: 1;
}
.card-deco::before {
  content: ''; position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.025); top: -80px; right: -60px;
}
.card-deco::after {
  content: ''; position: absolute;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.02); bottom: -45px; left: -40px;
}
.card-front .card-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; height: 100%; padding: 18px 22px;
}
.card-front .card-top { display: flex; justify-content: space-between; align-items: flex-start; }
/* Brand – top-left (logo image or text) */
.card-brand {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 30px;
  padding: 5px 12px 5px 6px;
}
.card-brand-logo {
  height: 28px; width: auto; max-width: 72px; object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
}
.card-brand-name {
  font-size: .58rem; font-weight: 700;
  color: rgba(255,255,255,.72); text-transform: uppercase; letter-spacing: .8px;
}
/* Legacy: chip-logo fallback */
.card-chip-logo { display: flex; align-items: center; gap: 6px; }
.card-chip-logo .chip-icon { display: none; }
.card-chip-logo span {
  font-size: .58rem; font-weight: 700;
  color: rgba(255,255,255,.72); text-transform: uppercase; letter-spacing: .8px;
}
/* Discount badge */
.card-discount-badge {
  background: var(--accent); border-radius: var(--r-sm);
  padding: 5px 11px; text-align: center; flex-shrink: 0;
}
.badge-label {
  font-size: .4rem; font-weight: 700; color: rgba(255,255,255,.72);
  letter-spacing: 1.5px; text-transform: uppercase; display: block;
}
.badge-value {
  font-size: .85rem; font-weight: 800; color: #fff; line-height: 1.2; display: block;
}
/* Mid */
.card-front .card-mid {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 7px;
}
.card-divider-line { height: 1px; background: rgba(255,255,255,.14); width: 44px; }
.card-center-label {
  font-size: .48rem; font-weight: 600; color: rgba(255,255,255,.38);
  letter-spacing: 2.5px; text-transform: uppercase;
}
/* Bottom */
.card-front .card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.card-holder-label {
  font-size: .46rem; color: rgba(255,255,255,.48);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; font-weight: 600;
}
.card-holder-name {
  color: #fff; font-size: .92rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-code-section { text-align: right; }
.card-code {
  color: rgba(255,255,255,.88); font-size: .64rem;
  font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: 2px;
  background: rgba(255,255,255,.07); padding: 3px 8px; border-radius: 3px;
  margin-bottom: 4px; display: inline-block; border: 1px solid rgba(255,255,255,.1);
}
.card-expiry { color: rgba(255,255,255,.48); font-size: .56rem; letter-spacing: .5px; text-align: right; }
.card-expiry span { font-weight: 700; color: rgba(255,255,255,.82); }

/* ── Card Back ───────────────────────────────────────────────── */
.card-back {
  background: #fff;
  transform: rotateY(180deg);
  display: flex; flex-direction: column;
}
.back-stripe, .card-back .back-stripe {
  height: 34px; background: var(--n200); margin-top: 18px;
}
.back-body, .card-back .back-body {
  flex: 1; padding: 12px 16px; overflow: hidden; display: flex; flex-direction: column;
}
.back-title, .card-back .back-title {
  font-size: .68rem; font-weight: 700; color: var(--n700);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 7px;
}
.back-terms, .card-back .back-terms {
  font-size: .63rem; color: var(--n600); line-height: 1.55; white-space: pre-line;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 9; line-clamp: 9; -webkit-box-orient: vertical;
}
.back-hint {
  font-size: .58rem; color: var(--n400); margin-top: auto; padding-top: 6px; text-align: center;
}
.card-back .back-footer { display: none; }

/* ── Flip Controls / Print section ─────────────────────────────── */
.card-controls, .flip-hint {
  display: flex; gap: .6rem; margin-bottom: 1.25rem;
  flex-wrap: wrap; justify-content: center;
}
.flip-hint button, .card-controls .btn {
  background: none; border: 1px solid var(--n300);
  color: var(--n600); padding: .38rem 1.1rem;
  border-radius: 20px; font-size: .76rem; cursor: pointer;
  transition: all .15s;
}
.flip-hint button:hover { border-color: var(--brand-2); color: var(--brand-2); }
.print-section { text-align: center; margin-top: 1rem; }

/* ── Voucher Info Panel ───────────────────────────────────────── */
.voucher-info {
  background: #fff; border: 1px solid var(--n200);
  border-radius: var(--r-lg); overflow: hidden;
  width: 100%; max-width: 440px;
  margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.info-header {
  padding: .9rem 1.2rem .75rem; border-bottom: 1px solid var(--n100);
  display: flex; align-items: center; justify-content: space-between;
}
.info-header-title { font-size: .68rem; font-weight: 700; color: var(--n500); text-transform: uppercase; letter-spacing: .8px; }
.info-row {
  padding: .7rem 1.2rem; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid var(--n100); font-size: .88rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--n500); font-size: .82rem; }
.info-row .value { font-weight: 600; color: var(--n800); text-align: right; }
.discount-value { font-size: 1.05rem; font-weight: 800; color: var(--accent); }
/* Legacy info layout */
.voucher-info h3 { font-size: .78rem; font-weight: 700; color: var(--n600); padding: .9rem 1.2rem .75rem; border-bottom: 1px solid var(--n100); text-transform: uppercase; letter-spacing: .5px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; padding: .85rem 1.2rem; }
@media (max-width: 440px) { .info-grid { grid-template-columns: 1fr; } }
.info-item label { font-size: .72rem; color: var(--n500); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 2px; }
.info-item .value { font-size: .9rem; font-weight: 600; color: var(--n800); }
.info-item .value.big { font-size: 1.1rem; color: var(--accent); }

/* ── Voucher History (public) ─────────────────────────────────── */
.voucher-history {
  background: #fff; border: 1px solid var(--n200);
  border-radius: var(--r-lg); overflow: hidden;
  width: 100%; max-width: 440px; margin-top: .85rem;
}
.voucher-history-title {
  font-size: .72rem; font-weight: 700; color: var(--n600);
  text-transform: uppercase; letter-spacing: .5px;
  padding: .85rem 1.2rem .7rem; border-bottom: 1px solid var(--n100);
}
.history-list { padding: .35rem 0; }
.history-item {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: .75rem;
  padding: .7rem 1.2rem;
  border-bottom: 1px solid var(--n100);
}
.history-item:last-child { border-bottom: none; }
.history-meta { display: flex; align-items: flex-start; gap: .65rem; flex: 1; min-width: 0; }
.history-num {
  flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--n100); border: 1px solid var(--n200);
  font-size: .65rem; font-weight: 700; color: var(--n500);
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.history-date { font-size: .78rem; color: var(--n500); }
.history-notes {
  font-size: .85rem; font-weight: 500; color: var(--n800);
  margin-top: .15rem; word-break: break-word;
}
.history-discount {
  flex-shrink: 0;
  font-size: .82rem; font-weight: 700; color: var(--accent);
  white-space: nowrap; padding-top: 2px;
}

/* ── Claims Meter ─────────────────────────────────────────────── */
.claims-meter { padding: .7rem 1.2rem; border-bottom: 1px solid var(--n100); }
.claims-meter .label, .claims-meter-label {
  font-size: .76rem; color: var(--n500); margin-bottom: .4rem;
  display: flex; justify-content: space-between;
}
.meter-bar, .claims-bar { height: 5px; background: var(--n200); border-radius: 3px; overflow: hidden; }
.meter-fill, .claims-bar-fill { height: 100%; background: var(--brand-2); border-radius: 3px; transition: width .35s; }
.meter-fill.low { background: var(--err); }
.status-notice { padding: .7rem 1.2rem; font-size: .82rem; font-weight: 500; }

/* ── Not Found ───────────────────────────────────────────────── */
.not-found { text-align: center; padding: 3rem 1.25rem; }
.not-found .icon { font-size: 3rem; margin-bottom: 1rem; }
.not-found h2 { color: var(--n700); margin-bottom: .5rem; }
.not-found p  { color: var(--n500); margin-bottom: 1.5rem; }

/* ================================================================
   ADMIN PANEL  –  mobile-first
   ================================================================ */

/* ── Topbar ──────────────────────────────────────────────────── */
.admin-body  { background: var(--n100); min-height: 100vh; }
.admin-topbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--brand); height: 52px;
  display: flex; align-items: center;
  padding: 0 1rem; gap: .75rem;
}
.topbar-brand {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
}
.topbar-logo-img {
  height: 22px; width: auto; max-width: 70px; object-fit: contain;
  flex-shrink: 0;
}
.topbar-company-name {
  font-size: .82rem; font-weight: 700; color: rgba(255,255,255,.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* legacy brand */
.admin-topbar .brand { color: rgba(255,255,255,.88); font-weight: 700; font-size: .82rem; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.admin-topbar .brand small { display: none; }
.topbar-right, .admin-topbar .admin-user {
  display: flex; align-items: center; gap: .6rem; flex-shrink: 0;
}
.topbar-user { font-size: .72rem; color: rgba(255,255,255,.45); display: none; }
.topbar-logout, .admin-topbar .btn-secondary {
  font-size: .72rem; color: rgba(255,255,255,.65);
  padding: .25rem .65rem; border: 1px solid rgba(255,255,255,.2);
  border-radius: 3px; transition: all .15s; background: transparent; cursor: pointer;
  white-space: nowrap;
}
.topbar-logout:hover, .admin-topbar .btn-secondary:hover {
  color: #fff; border-color: rgba(255,255,255,.5);
}
@media (min-width: 640px) {
  .topbar-user { display: block; }
}

/* ── Layout shell ────────────────────────────────────────────── */
/* Mobile: column (nav bar on top, content below)                */
/* Desktop 768 +: row (sidebar on left, content on right)        */
.admin-wrapper {
  display: flex;
  flex-direction: column;       /* ← mobile default */
  min-height: calc(100vh - 52px);
}

/* ── Sidebar / Nav ───────────────────────────────────────────── */
.admin-sidebar {
  background: var(--brand-2);
  display: flex;
  flex-direction: row;          /* horizontal on mobile */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  width: 100%;
  scrollbar-width: none;        /* hide scrollbar firefox */
}
.admin-sidebar::-webkit-scrollbar { display: none; }

.sidebar-section {
  display: none;                /* hidden on mobile */
}
.sidebar-link {
  display: block;
  padding: .72rem 1.1rem;
  font-size: .72rem; font-weight: 600;
  color: rgba(255,255,255,.52);
  text-transform: uppercase; letter-spacing: .6px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-link:hover {
  color: rgba(255,255,255,.82);
  border-bottom-color: rgba(255,255,255,.35);
}
.sidebar-link.active {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.06);
}
.sidebar-link .icon { display: none; }

/* Desktop sidebar — vertical column */
@media (min-width: 768px) {
  .admin-wrapper { flex-direction: row; }

  .admin-sidebar {
    flex-direction: column;
    flex-shrink: 0;
    width: 196px; min-width: 196px;
    overflow-x: hidden;
    overflow-y: auto;
    height: calc(100vh - 52px);
    position: sticky; top: 52px;
    padding: .75rem .5rem;
    gap: 1px;
  }
  .sidebar-section {
    display: block;
    font-size: .6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: rgba(255,255,255,.25);
    padding: .9rem .75rem .3rem;
    margin-top: .25rem;
  }
  .sidebar-section:first-child { margin-top: 0; }
  .sidebar-link {
    border-bottom: none;
    border-radius: var(--r-sm);
    padding: .6rem .85rem;
    border-left: 2px solid transparent;
  }
  .sidebar-link:hover {
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.07);
    border-bottom-color: transparent;
    border-left-color: rgba(255,255,255,.3);
  }
  .sidebar-link.active {
    color: #fff;
    background: rgba(255,255,255,.1);
    border-bottom-color: transparent;
    border-left-color: rgba(255,255,255,.75);
  }
}

/* ── Main content area ───────────────────────────────────────── */
.admin-main {
  flex: 1; min-width: 0;
  padding: 1.25rem 1rem;
  overflow-x: hidden;
}
.admin-page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--n200);
}
.admin-page-header h1 { font-size: 1.1rem; font-weight: 700; color: var(--n900); }
.admin-page-header p  { font-size: .82rem; color: var(--n500); margin-top: .2rem; }
@media (min-width: 768px) {
  .admin-main { padding: 1.75rem 1.75rem; }
  .admin-page-header h1 { font-size: 1.25rem; }
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid, .stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .65rem; margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .stats-grid, .stat-grid { grid-template-columns: repeat(4, 1fr); gap: .85rem; }
}
.stat-card {
  background: #fff; border: 1px solid var(--n200);
  border-radius: var(--r-md); padding: .9rem 1rem;
  box-shadow: var(--shadow-sm);
}
.stat-icon { display: none; }
.stat-card .stat-label {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--n400); margin-bottom: .35rem;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--n900); line-height: 1; }
.stat-card .stat-sub   { font-size: .7rem; color: var(--n400); margin-top: .3rem; }

/* ── Admin Cards ─────────────────────────────────────────────── */
.a-card, .admin-card {
  background: #fff; border: 1px solid var(--n200);
  border-radius: var(--r-md); overflow: hidden;
  margin-bottom: 1.1rem; box-shadow: var(--shadow-sm);
}
.a-card-header, .admin-card-header {
  padding: .75rem 1rem; border-bottom: 1px solid var(--n200);
  display: flex; align-items: center;
  justify-content: space-between; gap: .6rem; flex-wrap: wrap;
}
.a-card-header h3, .a-card-header h2,
.admin-card-header h3, .admin-card-header h2 {
  font-size: .75rem; font-weight: 700; color: var(--n600);
  text-transform: uppercase; letter-spacing: .5px;
}
.a-card-body, .admin-card-body { padding: 1rem; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table, .admin-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
thead th {
  text-align: left; padding: .55rem .9rem;
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--n400); background: var(--n50);
  border-bottom: 1px solid var(--n200); white-space: nowrap;
}
tbody td {
  padding: .7rem .9rem; border-bottom: 1px solid var(--n100);
  color: var(--n800); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--n50); }
.code-cell {
  font-family: 'Courier New', monospace; font-size: .78rem;
  font-weight: 700; letter-spacing: 1px; color: var(--brand-2);
}
.actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }

/* Search / toolbar */
.table-toolbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem .9rem; border-bottom: 1px solid var(--n200);
  background: var(--n50); flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--n300);
  border-radius: var(--r-sm); padding: .38rem .7rem;
  flex: 1; min-width: 160px; max-width: 300px;
}
.search-box input { border: none; outline: none; font-size: .83rem; width: 100%; background: transparent; }

/* ── Settings tab-nav ────────────────────────────────────────── */
.tab-nav {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--n200); margin-bottom: 1.25rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav a {
  display: block; padding: .6rem .9rem;
  font-size: .75rem; font-weight: 600; color: var(--n500);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.tab-nav a:hover  { color: var(--n800); }
.tab-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active  { display: block; }

/* ── Upload Zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--n300); border-radius: var(--r-md);
  padding: 1.75rem 1.25rem; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; background: var(--n50);
}
.upload-zone:hover { border-color: var(--brand-2); background: #fff; }
.upload-zone .upload-icon { font-size: 1.6rem; margin-bottom: .4rem; color: var(--n400); }
.upload-zone p { color: var(--n500); font-size: .83rem; margin-top: .25rem; }
.upload-zone strong { color: var(--n700); }
.design-preview { max-width: 340px; border-radius: var(--r-md); border: 1px solid var(--n200); }
.logo-preview {
  display: inline-flex; align-items: center; gap: .75rem;
  height: 50px; padding: .5rem 1rem;
  background: var(--n100); border: 1px solid var(--n200);
  border-radius: var(--r-sm); margin-bottom: .7rem;
}
.logo-preview img {
  height: 100%; width: auto; max-width: 130px;
  object-fit: contain;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-body {
  min-height: 100vh; background: var(--n100);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.5rem 1.25rem;
}
.login-box  { width: 100%; max-width: 360px; }
.login-logo, .login-header {
  text-align: center; margin-bottom: 1.5rem;
}
.login-logo img {
  height: 38px; width: auto; max-width: 130px;
  margin: 0 auto .65rem;
}
.login-logo .logo-icon { display: none; }
.login-logo h2, .login-header h2 {
  font-size: 1.15rem; font-weight: 700; color: var(--brand); margin-bottom: .2rem;
}
.login-logo p, .login-header p { font-size: .82rem; color: var(--n500); }
.login-card {
  background: #fff; border: 1px solid var(--n200);
  border-radius: var(--r-lg); padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-md); margin-bottom: .75rem;
}

/* ── Admin form label override ───────────────────────────────── */
.admin-form .form-group { margin-bottom: 1rem; }
.admin-form label { font-size: .8rem; color: var(--n700); font-weight: 600; }
.admin-form textarea.form-control { resize: vertical; min-height: 90px; }
.admin-form select.form-control { cursor: pointer; }
.form-section-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--n500);
  padding-top: 1rem; margin: 1rem 0 .75rem;
  border-top: 1px solid var(--n200);
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  body { background: #fff; }
  .pub-nav, .site-header, .site-footer,
  .card-controls, .flip-hint, .print-section,
  .voucher-info, .back-to-home { display: none !important; }
  .voucher-page, .site-main { padding: 0; min-height: auto; }
  .flip-wrapper { max-width: 100%; perspective: none; }
  .flip-card { transform: none !important; }
  .card-face { box-shadow: none; border: 1px solid #ccc; }
  .card-front { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .card-back { display: none; }
}
