/* ============================================================
   ADEPA Design System — vibrant Afro-fintech
   "adepa" (Twi: "good/excellent") — same component vocabulary
   as the original app.css (.card,.btn,.form-control,.badge,
   .table,.alert,.pagination,.modal,.stat-card, CSS custom
   properties) so every existing view inherits this look with
   zero markup changes. Layout shells add the bespoke structure.
   ============================================================ */

:root {
  /* ── Adepa palette ── */
  --ad-indigo:      #1B1035;
  --ad-indigo-2:    #2A1B4D;
  --ad-gold:        #FFB800;
  --ad-gold-2:      #FFCF4D;
  --ad-magenta:     #E63888;
  --ad-violet:      #7C3AED;
  --ad-green:       #12B76A;
  --ad-cream:       #FFF9F0;

  /* ── Mapped onto the original token names so every existing
       view (which references var(--primary) etc. inline)
       repaints automatically ── */
  --primary:        var(--ad-violet);
  --primary-dark:   #5F21C9;
  --primary-light:  #F1E9FE;
  --secondary:      #6B5A8E;
  --success:        var(--ad-green);
  --success-light:  #E1F9EE;
  --danger:         #E0396B;
  --danger-light:   #FCE4ED;
  --warning:        #D97F06;
  --warning-light:  #FEF1D6;
  --info:           #0E9F6E;
  --bg:             var(--ad-cream);
  --surface:        #ffffff;
  --surface-2:      #FBF4E8;
  --border:         #EFE2D0;
  --border-dark:    #E0CDAF;
  --text:           #221733;
  --text-secondary: #5E5074;
  --text-muted:     #9587AC;
  --sidebar-bg:     var(--ad-indigo);
  --sidebar-text:   #C9B8EC;
  --sidebar-active: #ffffff;
  --sidebar-hover:  rgba(255,255,255,.08);
  --sidebar-accent: var(--ad-gold);
  --sidebar-w:      264px;
  --topbar-h:       64px;
  --radius:         14px;
  --radius-lg:      20px;
  --shadow:         0 2px 10px rgba(43,20,80,.07), 0 1px 2px rgba(43,20,80,.05);
  --shadow-md:      0 12px 32px rgba(43,20,80,.14), 0 4px 10px rgba(43,20,80,.08);
  --transition:     .2s cubic-bezier(.4,0,.2,1);
  --font:           'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display:   'Sora', var(--font);
  --font-mono:      'Space Mono', ui-monospace, monospace;
  --stripe-grad:    linear-gradient(90deg,
                       var(--ad-gold) 0%, var(--ad-gold) 20%,
                       var(--ad-magenta) 20%, var(--ad-magenta) 45%,
                       var(--ad-violet) 45%, var(--ad-violet) 70%,
                       var(--ad-green) 70%, var(--ad-green) 100%);
  --hero-grad:      radial-gradient(120% 140% at 0% 0%, #3A2166 0%, var(--ad-indigo) 45%, #170B2E 100%);
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --primary:        #A97BFF;
  --primary-dark:   #8A55F0;
  --primary-light:  #2E2050;
  --secondary:      #A093C0;
  --success:        #3DD68C;
  --success-light:  #0F3A28;
  --danger:         #FF6B9D;
  --danger-light:   #3D1327;
  --warning:        #FDBB4D;
  --warning-light:  #3A2A0A;
  --info:           #34d399;
  --bg:             #150C29;
  --surface:        #1E1338;
  --surface-2:      #251743;
  --border:         #33224F;
  --border-dark:    #402C63;
  --text:           #F4EEFF;
  --text-secondary: #C3B4E0;
  --text-muted:     #8C7AB0;
  --sidebar-bg:     #12081F;
  --sidebar-text:   #B49FDD;
  --sidebar-active: #ffffff;
  --sidebar-hover:  rgba(255,255,255,.06);
  --sidebar-accent: var(--ad-gold);
  --shadow:         0 2px 10px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-md:      0 16px 40px rgba(0,0,0,.5), 0 4px 10px rgba(0,0,0,.3);
}

/* ── Dark mode badge/status overrides ── */
[data-theme="dark"] .badge-success  { background: #0F3A28; color: #3DD68C; }
[data-theme="dark"] .badge-danger   { background: #3D1327; color: #FF6B9D; }
[data-theme="dark"] .badge-warning  { background: #3A2A0A; color: #FDBB4D; }
[data-theme="dark"] .badge-info     { background: #0c2d48; color: #38bdf8; }
[data-theme="dark"] .badge-secondary{ background: #251743; color: #A093C0; }
[data-theme="dark"] .badge-primary  { background: #2E2050; color: #A97BFF; }

[data-theme="dark"] .status-accepted   { background: #251743; color: #A093C0; }
[data-theme="dark"] .status-placed     { background: #16324A; color: #62C6F2; }
[data-theme="dark"] .status-processing { background: #3A2A0A; color: #FDBB4D; }
[data-theme="dark"] .status-delivered  { background: #0F3A28; color: #3DD68C; }
[data-theme="dark"] .status-failed     { background: #3D1327; color: #FF6B9D; }
[data-theme="dark"] .status-refunded   { background: #2A1B4D; color: #C6A6FF; }
[data-theme="dark"] .status-skipped    { background: #3A2410; color: #FDA35C; }

[data-theme="dark"] .alert-success { background: #0F3A28; border-color: #3DD68C; color: #9CF0C7; }
[data-theme="dark"] .alert-danger  { background: #3D1327; border-color: #FF6B9D; color: #FFB4CD; }
[data-theme="dark"] .alert-warning { background: #3A2A0A; border-color: #FDBB4D; color: #FDE1A8; }
[data-theme="dark"] .alert-info    { background: #0c2d48; border-color: #38bdf8; color: #7dd3fc; }

[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23A093C0' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E");
}

/* ── Theme toggle ── */
.theme-toggle {
  background: none; border: 1px solid var(--border-dark);
  border-radius: 50px; padding: 5px 10px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 500; color: var(--text-secondary);
  transition: var(--transition); white-space: nowrap; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); border-color: var(--primary); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { width: 15px; height: 15px; flex-shrink: 0; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Typography — Sora carries the personality ── */
h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-family: var(--font-display); font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; }
h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
h4 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }

/* ── Kente-stripe signature — the one bold recurring motif ──
   Used sparingly: card top accents, section dividers, hero edge.
   A thin 4-colour woven band that ties every screen back to the
   brand without repeating anywhere near as decoration-for-its-
   own-sake. */
.stripe-rule {
  height: 4px; width: 100%; border-radius: 999px;
  background: var(--stripe-grad);
}
.stripe-edge { position: relative; }
.stripe-edge::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--stripe-grad);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 12px;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: var(--transition);
  white-space: nowrap; text-decoration: none; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--ad-violet), var(--ad-magenta));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(124,58,237,.28);
}
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; box-shadow: 0 8px 20px rgba(124,58,237,.36); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { opacity: .9; text-decoration: none; }

.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: .9; text-decoration: none; }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-dark); }
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }

.btn-sm { padding: 6px 14px; font-size: .8rem; border-radius: 10px; }
.btn-lg { padding: 13px 26px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 9px; border-radius: 10px; }

/* ── Forms ── */
.form-group { margin-bottom: 1.05rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--text); }
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block; width: 100%;
  padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--border-dark);
  background: var(--surface); color: var(--text);
  font-size: .9rem; font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--ad-violet);
  box-shadow: 0 0 0 4px rgba(124,58,237,.14);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--bg); cursor: not-allowed; }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%235E5074' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint  { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox],
.form-check input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ── Cards ──
   Soft glass-adjacent surfaces with generous rounding. Every
   card gets a hairline border + warm shadow; the kente stripe
   appears only where a card is explicitly marked .stripe-edge
   (used on hero/primary cards) to keep the motif restrained. */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; transition: box-shadow var(--transition), transform var(--transition);
}
.card-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  background: var(--surface);
}
.card-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; }
.card-body  { padding: 22px; }
.card-footer { padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ── Stat cards ── */
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: .76rem; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-card .stat-sub   { font-size: .8rem; color: var(--text-muted); }
.stat-card .stat-icon  { font-size: 1.4rem; margin-bottom: 4px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 540px; }
.table th {
  background: var(--surface-2); color: var(--text-secondary);
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: left;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table-sm th, .table-sm td { padding: 8px 12px; }

/* ── Badges / Status ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 50px; font-size: .7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.badge-success  { background: var(--success-light); color: var(--success); }
.badge-danger   { background: var(--danger-light);  color: var(--danger); }
.badge-warning  { background: var(--warning-light); color: var(--warning); }
.badge-info     { background: #e0f2fe; color: #0369a1; }
.badge-secondary{ background: var(--surface-2); color: var(--secondary); }
.badge-primary  { background: var(--primary-light); color: var(--primary); }

.status-accepted   { background: var(--surface-2); color: var(--secondary); }
.status-placed     { background: #E4F3FC; color: #0d76ab; }
.status-processing { background: var(--warning-light); color: var(--warning); }
.status-delivered  { background: var(--success-light); color: var(--success); }
.status-failed     { background: var(--danger-light);  color: var(--danger); }
.status-refunded   { background: #F1E9FE; color: #6d28d9; }
.status-skipped    { background: #FEEEDC; color: #c2410c; }

/* ── Alerts ── */
.alert {
  padding: 13px 16px; border-radius: 12px;
  border-left: 4px solid; font-size: .875rem;
  display: flex; align-items: flex-start; gap: 10px;
  position: relative;
}
.alert-close { position: absolute; top: 10px; right: 12px; background: none; border: none; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success); }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }
.alert-info    { background: #e0f2fe; border-color: #0ea5e9; color: #0369a1; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--border);
  font-size: .85rem; color: var(--text); transition: var(--transition);
  text-decoration: none;
}
.page-link:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-link.active { background: linear-gradient(135deg, var(--ad-violet), var(--ad-magenta)); color: #fff; border-color: transparent; }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* ── Modals ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(27,16,53,.55); backdrop-filter: blur(2px);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: 100%; max-width: 500px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  animation: modalIn .22s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn { from { transform: scale(.95) translateY(6px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; }
.modal-close  { background: none; border: none; cursor: pointer; font-size: 1.3rem; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--hero-grad);
  padding: 20px; position: relative; overflow: hidden;
}
.auth-wrap::before, .auth-wrap::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.auth-wrap::before { width: 420px; height: 420px; background: var(--ad-magenta); top: -140px; left: -120px; }
.auth-wrap::after  { width: 380px; height: 380px; background: var(--ad-gold); bottom: -160px; right: -100px; opacity: .35; }
.auth-card {
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-md);
  padding: 40px 34px; width: 100%; max-width: 420px;
  position: relative; z-index: 1; overflow: hidden;
}
.auth-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--stripe-grad); }
.auth-logo  { text-align: center; margin-bottom: 26px; }
.auth-logo img { height: 48px; margin: 0 auto 8px; }
.auth-logo .site-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; }
.auth-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 22px; text-align: center; }

/* ── Grid helpers ── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ── Utilities ── */
.d-flex    { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: .82rem; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-600 { font-weight: 700; }
.w-100  { width: 100%; }
.mono   { font-family: var(--font-mono); font-size: .83rem; }

/* ── Page header (used by many inner pages) ── */
.page-header { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.page-title  { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }

/* ── New Adepa-only helper classes used by rebuilt pages ── */
.glass-panel {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
}
.icon-chip {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(50px);
  pointer-events: none; z-index: 0;
}
.hero-band {
  position: relative; overflow: hidden;
  background: var(--hero-grad);
  border-radius: var(--radius-lg);
  color: #fff;
}
.hero-band::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--stripe-grad); z-index: 2;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .btn { padding: 10px 16px; }
  .btn-sm { padding: 7px 12px; }
  .modal { max-width: 100%; }
  .table th, .table td { padding: 9px 10px; font-size: .82rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .auth-card  { padding: 26px 18px; }
  .card-body  { padding: 15px; }
  .card-header{ padding: 13px 15px; }
  .stat-card  { padding: 15px; }
  .stat-card .stat-value { font-size: 1.45rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
