/* ============================================================
   common.css
   THE AGRI WORLD - Coupon Automation System
   Shared base styles, CSS variables, utilities, animations
   ============================================================ */

/* ── Google Fonts: Poppins ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ════════════════════════════════════════════════════════════
   CSS VARIABLES - Green Agriculture Theme
   ════════════════════════════════════════════════════════════ */
:root {
  /* Primary Green Palette */
  --green:        #2d7a33;
  --green-dark:   #1e5a24;
  --green-light:  #4caf50;
  --green-lighter:#81c784;
  --green-50:     #e8f5e9;
  --green-100:    #c8e6c9;
  --green-200:    #a5d6a7;
  --green-300:    #81c784;
  --green-400:    #66bb6a;
  --green-500:    #4caf50;
  --green-600:    #43a047;
  --green-700:    #388e3c;
  --green-800:    #2e7d32;
  --green-900:     #1b5e20;

  /* Accent Colors */
  --accent-gold:   #f9a825;
  --accent-orange: #ff9800;
  --accent-teal:   #00897b;

  /* Neutral Colors */
  --bg:           #f0f4f0;
  --bg-card:      #ffffff;
  --bg-glass:     rgba(255,255,255,0.72);
  --bg-glass-border: rgba(255,255,255,0.3);

  /* Text Colors */
  --text:         #1a1a2e;
  --text-secondary:#555;
  --text-muted:   #888;
  --text-light:   #aaa;

  /* Border & Shadow */
  --border:       #e0e0e0;
  --border-light: #eee;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow:       0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.12);
  --shadow-green: 0 4px 20px rgba(45,122,51,0.15);

  /* Status Colors */
  --danger:       #e53935;
  --danger-bg:    #ffebee;
  --success:      #43a047;
  --success-bg:   #e8f5e9;
  --warning:      #fb8c00;
  --warning-bg:   #fff3e0;
  --info:         #1e88e5;
  --info-bg:      #e3f2fd;

  /* Layout */
  --header-h:     64px;
  --nav-h:        52px;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-xs:    6px;
  --max-width:    1440px;

  /* Typography Scale */
  --text-xs:      11px;
  --text-sm:      13px;
  --text-base:    14px;
  --text-md:      16px;
  --text-lg:      20px;
  --text-xl:      24px;
  --text-2xl:     32px;

  /* Transitions */
  --transition:   all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-bounce: all 0.35s cubic-bezier(0.68,-0.55,0.265,1.55);

  /* Sidebar */
  --sidebar-w:    260px;
}

/* ════════════════════════════════════════════════════════════
   DARK MODE VARIABLES
   ════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:           #0f1f14;
  --bg-card:      #1a2e1f;
  --bg-glass:     rgba(26,46,31,0.72);
  --bg-glass-border: rgba(255,255,255,0.08);

  --text:         #e0e8e0;
  --text-secondary:#b0b8b0;
  --text-muted:   #889988;
  --text-light:   #667766;

  --border:       #2a3a2e;
  --border-light: #223322;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.2);
  --shadow:       0 4px 20px rgba(0,0,0,0.25);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.35);
  --shadow-green: 0 4px 20px rgba(45,122,51,0.25);

  --green-50:     #1a2e1a;
  --green-100:    #1e3a22;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle leaf pattern background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(45,122,51,0.04) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(76,175,80,0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(45,122,51,0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

/* ════════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--green-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-400); }

/* ════════════════════════════════════════════════════════════
   HEADER  (clean white utility bar)
   ════════════════════════════════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: #ffffff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 1px 0 rgba(15,23,42,0.06);
}

header .brand {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

header .brand:has(.brand-logo-header)::before {
  content: none;
}

header .brand::before {
  content: '\1F33F';
  font-size: 22px;
}

.brand-logo-header {
  height: 38px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

header .user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--text-sm);
}

header .user-info span:first-child {
  font-weight: 600;
  color: var(--text);
}

.role-badge {
  background: var(--green-50);
  color: var(--green-700);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--green-100);
}

.logout-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-xs);
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.logout-btn:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

/* ════════════════════════════════════════════════════════════
   NAVIGATION TABS  (gradient hero banner)
   ════════════════════════════════════════════════════════════ */
nav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: linear-gradient(115deg, var(--green-dark) 0%, var(--green) 45%, var(--accent-teal) 100%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 28px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 6px 20px rgba(30,90,36,0.18);
}

nav::-webkit-scrollbar { display: none; }

nav button {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  position: relative;
  backdrop-filter: blur(6px);
}

nav button:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
}

nav button.active {
  color: var(--green-dark);
  background: #fff;
  border-color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

nav button.active::after {
  content: none;
}

/* ════════════════════════════════════════════════════════════
   PAGE CONTAINER  (floating card over the gradient hero)
   ════════════════════════════════════════════════════════════ */
.page {
  display: none;
  max-width: var(--max-width);
  margin: -22px auto 40px;
  padding: 28px 28px 40px;
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -2px 24px rgba(15,23,42,0.06);
  animation: pageIn 0.35s ease-out;
}

.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page > h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page > h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 28px;
  background: linear-gradient(180deg, var(--green), var(--accent-teal));
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--green-100);
}

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 20px;
  background: var(--green);
  border-radius: 3px;
}

/* ════════════════════════════════════════════════════════════
   STATS / SUMMARY GRIDS
   ════════════════════════════════════════════════════════════ */
.stats, .coupon-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat, .coupon-summary-item {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--green-50) 100%);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.stat:hover, .coupon-summary-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
  border-color: var(--green-200);
}

.stat::before, .coupon-summary-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat .num, .coupon-summary-num {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--green);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat .lbl, .coupon-summary-lbl {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-grid .field.full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-sm);
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,122,51,0.1);
}

input::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 10px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.sm {
  padding: 6px 14px;
  font-size: var(--text-xs);
}

.btn.lg {
  padding: 14px 32px;
  font-size: var(--text-md);
}

.btn.full {
  width: 100%;
}

/* Button Variants */
.btn.outline {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
}

.btn.outline:hover {
  background: var(--green);
  color: #fff;
}

.btn.red {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
}

.btn.red:hover {
  box-shadow: 0 4px 16px rgba(229,57,53,0.3);
}

.btn.blue {
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
}

.btn.blue:hover {
  box-shadow: 0 4px 16px rgba(30,136,229,0.25);
}

.btn.gold {
  background: linear-gradient(135deg, #f9a825 0%, #f57f17 100%);
  color: #fff;
}

.btn.gold:hover {
  box-shadow: 0 4px 16px rgba(249,168,37,0.3);
}

/* ════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════ */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  padding: 13px 14px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: var(--green-50);
}

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

.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   STATUS SELECT / BADGES
   ════════════════════════════════════════════════════════════ */
.status-select {
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.status-select.is-claim {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.status-select.is-notclaim {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.status-badge.is-claim {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.status-badge.is-notclaim {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

/* ════════════════════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════════════════════ */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 12px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease-out;
}

.alert.ok {
  display: block;
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.alert.err {
  display: block;
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.alert.warn {
  display: block;
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}

.alert.info {
  display: block;
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info);
}

/* ════════════════════════════════════════════════════════════
   MODALS
   ════════════════════════════════════════════════════════════ */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-bg.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: modalSlide 0.3s ease-out;
}

.modal h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ════════════════════════════════════════════════════════════
   COUPON / CARD COMPONENTS
   ════════════════════════════════════════════════════════════ */
.coupon-code {
  font-family: 'Courier New', monospace;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--green);
  background: var(--green-50);
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  border: 1.5px dashed var(--green-200);
  display: inline-block;
  letter-spacing: 1px;
  margin: 8px 0;
}

.coupon-thumb-wrap {
  position: relative;
  display: inline-block;
}

.coupon-thumb {
  width: 80px;
  height: 48px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
}

.coupon-thumb.loading {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gen-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.card-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ════════════════════════════════════════════════════════════
   RESULT / ACTION ROWS
   ════════════════════════════════════════════════════════════ */
.result-wrap {
  display: none;
  animation: pageIn 0.4s ease-out;
}

.result-box {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--green-50) 100%);
  border: 1.5px solid var(--green-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
}

.result-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--green);
  margin-bottom: 12px;
}

.result-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.act-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ════════════════════════════════════════════════════════════
   WHATSAPP BUTTON
   ════════════════════════════════════════════════════════════ */
.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
  color: #fff;
}

.btn-wa::before {
  content: '\1F4AC';
}

/* ════════════════════════════════════════════════════════════
   DOWNLOAD BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-dl:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

.btn-dl-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--green);
  cursor: pointer;
  transition: var(--transition);
  margin-left: 4px;
  vertical-align: middle;
}

.btn-dl-mini:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ════════════════════════════════════════════════════════════
   COUPON FILTER BAR
   ════════════════════════════════════════════════════════════ */
.coupon-filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.coupon-filter-bar .field {
  min-width: 140px;
}

.coupon-filter-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* ════════════════════════════════════════════════════════════
   CHART CONTAINER
   ════════════════════════════════════════════════════════════ */
#coupon-chart-box, #emp-coupon-chart-box {
  position: relative;
  height: 300px;
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* ════════════════════════════════════════════════════════════
   ACCESS CHECKLIST
   ════════════════════════════════════════════════════════════ */
.access-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.access-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: var(--transition);
}

.access-checklist label:hover {
  border-color: var(--green-200);
  background: var(--green-50);
}

.access-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════
   SPINNER
   ════════════════════════════════════════════════════════════ */
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════
   DARK MODE TOGGLE
   ════════════════════════════════════════════════════════════ */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(15deg);
}

/* ════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS (see toast.js)
   ════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: all;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.4s cubic-bezier(0.68,-0.55,0.265,1.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
}

.toast.hiding {
  animation: toastHide 0.3s ease-in forwards;
}

.toast-success { background: rgba(67,160,71,0.92); }
.toast-error   { background: rgba(229,57,53,0.92); }
.toast-warning { background: rgba(251,140,0,0.92); }
.toast-info    { background: rgba(30,136,229,0.92); }

@keyframes toastSlide {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastHide {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   LOGIN SCREEN SHARED
   ════════════════════════════════════════════════════════════ */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15,30,20,0.85) 0%, rgba(30,60,35,0.9) 50%, rgba(20,40,25,0.85) 100%),
    url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=1920&q=80') center/cover no-repeat;
  position: relative;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(45,122,51,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(76,175,80,0.2) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(45,122,51,0.1);
  animation: cardFloat 0.6s ease-out;
}

@keyframes cardFloat {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img,
.login-logo .brand-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(45,122,51,0.2);
  border: 3px solid rgba(255,255,255,0.2);
}

.login-logo h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.login-logo p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Role Tabs */
.role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.role-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid transparent;
}

.role-tab:hover {
  color: var(--green);
  background: rgba(45,122,51,0.05);
}

.role-tab.active {
  background: var(--bg-card);
  color: var(--green);
  border-color: var(--green-200);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.role-tab .icon::before {
  font-size: 16px;
}

#tab-emp .icon::before { content: '\1F468\200D\1F33E'; }
#tab-adm .icon::before { content: '\1F510'; }

/* Login Fields */
.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  font-size: var(--text-sm);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  outline: none;
}

.login-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,122,51,0.1);
}

/* Login Error */
.login-err {
  display: none;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-green);
  letter-spacing: 0.5px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45,122,51,0.3);
}

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

.login-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* ════════════════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  padding: 12px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}

.pagination button:hover {
  border-color: var(--green);
  color: var(--green);
}

.pagination button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  font-weight: 600;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0 8px;
}

/* ════════════════════════════════════════════════════════════
   NO ACCESS MESSAGE
   ════════════════════════════════════════════════════════════ */
.no-access {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-access-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.gap-4       { gap: 16px; }

.mt-2        { margin-top: 8px; }
.mt-3        { margin-top: 12px; }
.mt-4        { margin-top: 16px; }
.mb-2        { margin-bottom: 8px; }
.mb-3        { margin-bottom: 12px; }
.mb-4        { margin-bottom: 16px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ════════════════════════════════════════════════════════════
   PRINT STYLES
   ════════════════════════════════════════════════════════════ */
@media print {
  header, nav, .btn, .modal-bg, .pagination, .theme-toggle { display: none !important; }
  .page { display: block !important; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}
