/* =================================================
   CellCampus Profit v2 — Light Theme Only
   Times New Roman · Indigo accent · Responsive
================================================= */

:root {
  color-scheme: light;
  /* Gray scale */
  --black:    #000000;
  --white:    #ffffff;
  --g950:     #f8f9fa;
  --g900:     #ffffff;
  --g800:     #f1f3f5;
  --g700:     #e9ecef;
  --g600:     #dee2e6;
  --g500:     #adb5bd;
  --g400:     #6c757d;
  --g300:     #495057;
  --g200:     #343a40;
  --g100:     #212529;
  /* Semantic */
  --bg:       #f0f4f8;
  --surface:  #ffffff;
  --surface2: #f8f9fa;
  --border:   #dee2e6;
  --text:     #000000;
  --muted:    #495057;
  --subtle:   #6c757d;
  --primary:  #4f46e5;
  --primary-h:#4338ca;
  --danger:   #dc3545;
  --success:  #198754;
  --warn-col: #856404;
  /* Layout */
  --font:  'Times New Roman', Times, serif;
  --mono:  'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  --r:     8px;
  --nav-h: 60px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --glow:      0 0 0 3px rgba(79,70,229,.18);
  /* Legacy aliases */
  --gray-800: var(--g800);
  --gray-900: var(--g900);
  --gray-400: var(--g400);
  --radius:   var(--r);
}

/* ─── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 1rem;
  transition: background .2s ease, color .15s ease;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-h); text-decoration: underline; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* ─── Smooth theme transitions ───────────────── */
body, .cc-navbar, .panel, .stat-card, .form-card,
.approval-card, .report-card, .chart-card,
.data-table, .table-wrap, .mob-nav,
.filter-input, .filter-select,
.field-group input, .field-group select, .field-group textarea,
.card, .table, td, th {
  transition: background .2s ease, border-color .2s ease, color .15s ease, box-shadow .2s ease;
}

/* ══════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════ */
.cc-navbar {
  min-height: var(--nav-h);
  padding: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(0,0,0,.15);
  position: sticky;
  top: 0;
  z-index: 1030;
}
/* glassmorphism backdrop on supported browsers */
@supports (backdrop-filter: blur(10px)) {
  .cc-navbar {
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
  }
}

.cc-brand-dot {
  width: 9px; height: 9px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(99,102,241,.6);
}
.cc-brand-main { color: var(--text); font-weight: 700; }
.cc-brand-sub  { color: var(--muted); font-weight: 400; }

.navbar-brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none !important;
}

.nav-link {
  font-size: .875rem;
  padding: .4rem .75rem !important;
  border-radius: 6px;
  transition: background .12s, color .12s;
  color: var(--muted) !important;
}
.nav-link:hover {
  color: var(--text) !important;
  background: var(--surface2);
  text-decoration: none;
}
.nav-link.active {
  color: var(--primary-h) !important;
  background: rgba(99,102,241,.12);
  font-weight: 600;
}

/* Navbar toggler (dark theme) */
.navbar-toggler {
  border: 1px solid var(--border) !important;
  padding: .35rem .55rem;
  border-radius: 6px;
}
.navbar-toggler:focus { box-shadow: var(--glow) !important; }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28140,140,170,0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
[data-theme="light"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833,37,41,0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* User avatar initial bubble */
.nav-avatar-initial {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

/* Wallet balance chip */
.wallet-chip {
  display: inline-flex; align-items: center;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.3);
  color: var(--primary-h) !important;
  border-radius: 99px;
  padding: 3px 12px; font-size: .78rem; font-family: var(--mono);
  text-decoration: none !important; white-space: nowrap;
  transition: all .15s;
}
.wallet-chip:hover {
  background: rgba(99,102,241,.2);
  border-color: rgba(99,102,241,.5);
}
[data-theme="light"] .wallet-chip {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #4f46e5 !important;
}
[data-theme="light"] .wallet-chip:hover {
  background: #ddd6fe;
}

/* Theme toggle button */
.theme-toggle {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  transition: all .15s;
  flex-shrink: 0;
}
.theme-toggle i {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle:hover {
  background: rgba(99,102,241,.15);
  border-color: var(--primary);
  color: var(--primary-h);
}
.theme-toggle:hover i {
  transform: rotate(360deg);
}

/* ══════════════════════════════════════════════
   MAIN CONTENT WRAPPER
══════════════════════════════════════════════ */
.main-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
  overflow-x: hidden;
}
@media (max-width: 600px) { .main-wrap { padding: 1rem .85rem; } }

/* ─── Flash messages ─────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1.25rem; }
.flash {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 11px 16px; border-radius: var(--r); font-size: .875rem;
  animation: fadeDown .2s ease;
}
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; } }
.flash button {
  background: none; border: none; cursor: pointer;
  color: inherit; font-size: 1rem; opacity: .6; padding: 0; flex-shrink: 0;
}
.flash button:hover { opacity: 1; }
.flash-success { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); color: #6ee7b7; }
.flash-danger  { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3); color: #fca5a5; }
.flash-warning { background: rgba(251,191,36,.1);  border: 1px solid rgba(251,191,36,.3);  color: #fde68a; }
.flash-info    { background: rgba(99,102,241,.12);  border: 1px solid rgba(99,102,241,.3);  color: #a5b4fc; }
[data-theme="light"] .flash-success { background: #d1e7dd; border-color: #badbcc; color: #0f5132; }
[data-theme="light"] .flash-danger  { background: #f8d7da; border-color: #f5c2c7; color: #842029; }
[data-theme="light"] .flash-warning { background: #fff3cd; border-color: #ffecb5; color: #664d03; }
[data-theme="light"] .flash-info    { background: #e0e7ff; border-color: #c7d2fe; color: #3730a3; }

/* ─── Page header ─────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0; }
.page-sub   { color: var(--muted); font-size: .875rem; margin-top: 3px; margin-bottom: 0; }
@media (max-width: 480px) { .page-title { font-size: 1.25rem; } }

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn-success {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 18px; border-radius: var(--r);
  font-size: .875rem; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s; white-space: nowrap;
  text-decoration: none !important; font-weight: 600;
}
.btn-primary {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}
.btn-primary:hover {
  background: var(--primary-h); border-color: var(--primary-h); color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.45);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface2); color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--g600); color: var(--text); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface2); color: var(--text);
  border-color: var(--g500);
}
.btn-ghost.is-active {
  background: rgba(99,102,241,.12); color: var(--primary-h);
  border-color: rgba(99,102,241,.3); font-weight: 600;
}
.btn-danger {
  background: transparent; color: var(--danger);
  border-color: rgba(248,113,113,.35);
}
.btn-danger:hover {
  background: rgba(248,113,113,.12);
  color: var(--danger); border-color: var(--danger);
}
.btn-success {
  background: transparent; color: var(--success);
  border-color: rgba(52,211,153,.35);
}
.btn-success:hover {
  background: rgba(52,211,153,.12);
  color: var(--success); border-color: var(--success);
}
[data-theme="light"] .btn-danger {
  background: #fff; color: #dc3545; border-color: #f5c2c7;
}
[data-theme="light"] .btn-danger:hover { background: #f8d7da; color: #842029; }
[data-theme="light"] .btn-success {
  background: #fff; color: #198754; border-color: #badbcc;
}
[data-theme="light"] .btn-success:hover { background: #d1e7dd; color: #0f5132; }
[data-theme="light"] .btn-ghost {
  background: #fff; color: #495057; border-color: #dee2e6;
}
[data-theme="light"] .btn-ghost:hover { background: #f8f9fa; color: #212529; }
.btn-full { width: 100%; }
.btn-sm   { padding: 5px 12px; font-size: .8rem; }
button[disabled], .btn-primary[disabled],
.btn-success[disabled], .btn-danger[disabled] {
  opacity: .5; cursor: not-allowed;
  transform: none !important; box-shadow: none !important;
}

/* Icon button */
.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: .9rem;
  transition: all .15s; padding: 0; text-decoration: none !important;
  flex-shrink: 0;
}
.btn-icon:hover { background: rgba(99,102,241,.12); color: var(--primary-h); border-color: rgba(99,102,241,.3); }

@media (max-width: 480px) {
  .btn-primary, .btn-ghost { padding: 10px 16px; }
}

/* ══════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════ */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  gap: 2.5rem; padding: 2rem 1rem; flex-wrap: wrap;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 440px) { .auth-card { padding: 1.75rem 1.1rem; } }
.auth-header { text-align: center; margin-bottom: 1.85rem; }
.auth-logo   { font-size: 2rem; margin-bottom: .4rem; }
.auth-header h1 { font-size: 1.45rem; font-weight: 700; color: var(--text); }
.auth-header p  { color: var(--muted); font-size: .875rem; margin-top: 5px; }
.auth-form   { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; color: var(--muted); font-size: .875rem; }
.auth-footer a { color: var(--primary-h); }
.auth-deco   { display: flex; flex-direction: column; gap: .75rem; max-width: 280px; }
@media (max-width: 600px) { .auth-deco { display: none; } }
.deco-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 15px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--muted); font-size: .875rem;
  box-shadow: var(--shadow);
}
.deco-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════════════ */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label {
  font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.field-group input[type="checkbox"],
.field-group input[type="radio"] {
  -webkit-appearance: checkbox; appearance: auto;
  width: 16px; height: 16px; flex-shrink: 0; cursor: pointer;
}
.field-group input:not([type="checkbox"]):not([type="radio"]),
.field-group select,
.field-group textarea {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r);
  padding: 9px 12px; font-size: .95rem; font-family: var(--font);
  outline: none; width: 100%; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-group input:not([type="checkbox"]):not([type="radio"]):focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--glow);
}
.field-group input::placeholder,
.field-group textarea::placeholder { color: var(--subtle); }
.field-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23868698' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
[data-theme="light"] .field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236c757d' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}
[data-theme="light"] .field-group input:not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] .field-group select,
[data-theme="light"] .field-group textarea {
  background: #fff; border-color: #dee2e6; color: #212529;
}
.field-hint { font-size: .78rem; color: var(--muted); }
.required   { color: var(--danger); margin-left: 2px; }
.file-input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 7px 10px;
  color: var(--muted); font-size: .875rem; width: 100%; cursor: pointer;
}
.auto-tag { color: var(--muted); font-size: .72rem; text-transform: none; font-weight: 400; letter-spacing: 0; }

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: .95rem; padding: 0; transition: color .15s;
}
.pwd-toggle:hover { color: var(--text); }

.otp-input {
  font-family: var(--mono) !important; font-size: 2rem !important;
  text-align: center; letter-spacing: 12px; padding: 14px 8px !important;
  background: var(--surface2) !important; border: 2px solid var(--border) !important;
}
@media (max-width: 380px) { .otp-input { font-size: 1.5rem !important; letter-spacing: 6px; } }

.notice-box {
  padding: 10px 14px; border-radius: var(--r);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-size: .875rem;
}
.notice-warn {
  border-color: rgba(251,191,36,.4);
  color: var(--warn-col);
  background: rgba(251,191,36,.08);
}
[data-theme="light"] .notice-warn { border-color: #ffc107; color: #856404; background: #fff3cd; }

.error-list {
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--r); padding: 10px 14px;
}
.error-list p { color: #fca5a5; font-size: .875rem; margin: 2px 0; }
[data-theme="light"] .error-list { background: #f8d7da; border-color: #f5c2c7; }
[data-theme="light"] .error-list p { color: #842029; }

/* ══════════════════════════════════════════════
   STATS GRID
══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem; margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.1rem;
  display: flex; align-items: center; gap: .85rem;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s, background .2s, border-color .2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary);
}
.stat-icon  { font-size: 1.5rem; flex-shrink: 0; }
.stat-info  { min-width: 0; }
.stat-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); display: block;
}
.stat-value {
  font-family: var(--mono); font-size: 1.2rem; font-weight: 700;
  color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: block;
}
@media (max-width: 480px) { .stat-value { font-size: 1rem; } .stat-card { padding: .85rem; } }

.stats-strip { display: flex; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.2rem; }
.stats-strip .stat-card { flex: 1 1 160px; flex-direction: column; align-items: flex-start; gap: .25rem; }

/* ─── Dashboard grid ─────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════
   PANELS
══════════════════════════════════════════════ */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.panel-head h3 { font-size: .95rem; font-weight: 700; color: var(--text); margin: 0; }
.panel-link    { font-size: .82rem; color: var(--primary-h); }
.panel-link:hover { color: var(--primary); }

/* ══════════════════════════════════════════════
   DATA TABLE
══════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface); width: 100%;
}
.data-table {
  width: 100%; border-collapse: collapse;
  min-width: 900px; background: var(--surface);
}
.data-table th {
  padding: 10px 12px; text-align: left;
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--border);
  background: var(--surface2); white-space: nowrap;
}
.data-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: .875rem; vertical-align: middle; color: var(--text);
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }

/* ─── Typography utilities ───────────────────── */
.mono      { font-family: var(--mono); }
.txt-muted { color: var(--muted) !important; }
.txt-green { color: var(--success) !important; }
.txt-red   { color: var(--danger) !important; }

/* ══════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 4px;
  font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap;
}
/* Dark theme badge colors */
.badge-cash         { background: rgba(134,134,152,.15); color: var(--g300);  border: 1px solid var(--border); }
.badge-upi          { background: rgba(99,102,241,.15);  color: #a5b4fc;      border: 1px solid rgba(99,102,241,.3); }
.badge-card         { background: rgba(56,189,248,.12);  color: #7dd3fc;      border: 1px solid rgba(56,189,248,.25); }
.badge-banktransfer { background: rgba(52,211,153,.12);  color: #6ee7b7;      border: 1px solid rgba(52,211,153,.25); }
.badge-credit       { background: rgba(251,191,36,.12);  color: #fde68a;      border: 1px solid rgba(251,191,36,.25); }
.badge-finance      { background: rgba(167,139,250,.12); color: #c4b5fd;      border: 1px solid rgba(167,139,250,.25); }
.badge-pending      { background: rgba(251,191,36,.12);  color: #fde68a;      border: 1px solid rgba(251,191,36,.3); }
.badge-approved     { background: rgba(52,211,153,.12);  color: #6ee7b7;      border: 1px solid rgba(52,211,153,.3); }
.badge-rejected     { background: rgba(248,113,113,.12); color: #fca5a5;      border: 1px solid rgba(248,113,113,.3); }
.badge-deleted      { background: rgba(134,134,152,.1);  color: var(--muted); border: 1px solid var(--border); }

/* Light theme badge overrides */
[data-theme="light"] .badge-cash         { background: #e9ecef;  color: #495057;  border-color: #dee2e6; }
[data-theme="light"] .badge-upi          { background: #cff4fc;  color: #055160;  border-color: #b6effb; }
[data-theme="light"] .badge-card         { background: #cfe2ff;  color: #084298;  border-color: #b6d4fe; }
[data-theme="light"] .badge-banktransfer { background: #d1e7dd;  color: #0f5132;  border-color: #badbcc; }
[data-theme="light"] .badge-credit       { background: #fff3cd;  color: #664d03;  border-color: #ffecb5; }
[data-theme="light"] .badge-finance      { background: #e2d9f3;  color: #432874;  border-color: #d0bfff; }
[data-theme="light"] .badge-pending      { background: #fff3cd;  color: #664d03;  border-color: #ffecb5; }
[data-theme="light"] .badge-approved     { background: #d1e7dd;  color: #0f5132;  border-color: #badbcc; }
[data-theme="light"] .badge-rejected     { background: #f8d7da;  color: #842029;  border-color: #f5c2c7; }
[data-theme="light"] .badge-deleted      { background: #e9ecef;  color: #6c757d;  border-color: #dee2e6; }

/* Supplier purchase status badges */
.sp-badge-pending, .sp-badge-approved, .sp-badge-rejected, .sp-badge-deleted {
  font-size: .65rem; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px; font-weight: 700; display: inline-block;
}
.sp-badge-pending  { background: rgba(251,191,36,.12); color: #fde68a; border: 1px solid rgba(251,191,36,.3); }
.sp-badge-approved { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.sp-badge-rejected { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.sp-badge-deleted  { background: rgba(134,134,152,.1); color: var(--muted); border: 1px solid var(--border); }
[data-theme="light"] .sp-badge-pending  { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
[data-theme="light"] .sp-badge-approved { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
[data-theme="light"] .sp-badge-rejected { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
[data-theme="light"] .sp-badge-deleted  { background: #e9ecef; color: #6c757d; border-color: #dee2e6; }

/* Wallet transaction badges */
.wallet-badge-deposit  { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.wallet-badge-received { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.wallet-badge-sent     { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.wallet-badge-reserved { background: rgba(251,191,36,.12); color: #fde68a; border: 1px solid rgba(251,191,36,.3); }
.wallet-badge-refunded { background: rgba(99,102,241,.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }
.wallet-badge-purchase { background: rgba(251,191,36,.12); color: #fde68a; border: 1px solid rgba(251,191,36,.3); }
.wallet-badge-expense  { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.wallet-badge-credit   { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
[data-theme="light"] .wallet-badge-deposit,
[data-theme="light"] .wallet-badge-received,
[data-theme="light"] .wallet-badge-credit  { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
[data-theme="light"] .wallet-badge-sent,
[data-theme="light"] .wallet-badge-expense { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
[data-theme="light"] .wallet-badge-reserved,
[data-theme="light"] .wallet-badge-purchase { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
[data-theme="light"] .wallet-badge-refunded { background: #cff4fc; color: #055160; border-color: #b6effb; }

/* ─── Margin bar ─────────────────────────────── */
.mbar-wrap  { display: flex; align-items: center; gap: 7px; }
.mbar-track { flex: 1; height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.mbar-fill  { height: 5px; background: var(--primary); border-radius: 3px; transition: width .4s ease; }
.mbar-wrap .mono { font-size: .77rem; white-space: nowrap; color: var(--muted); }

/* ─── Icon action buttons ────────────────────── */
.act-btns { display: flex; gap: 4px; }
.btn-icon {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface2); color: var(--muted); cursor: pointer;
  font-size: .85rem; transition: all .15s; padding: 0; text-decoration: none !important;
}
.btn-edit:hover { border-color: var(--g500); background: var(--g700); color: var(--text); }
.btn-inv:hover  { border-color: rgba(99,102,241,.4); background: rgba(99,102,241,.12); color: var(--primary-h); }
.btn-del:hover  { border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.1); color: var(--danger); }

/* ─── Filter bar ─────────────────────────────── */
.filter-bar  { margin-bottom: 1.1rem; }
.filter-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filter-input, .filter-select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r);
  padding: 8px 11px; font-size: .875rem; font-family: var(--font);
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.filter-input { flex: 1; min-width: 150px; }
.filter-input::placeholder { color: var(--subtle); }
.filter-input:focus, .filter-select:focus {
  border-color: var(--primary); box-shadow: var(--glow);
}
[data-theme="light"] .filter-input, [data-theme="light"] .filter-select {
  background: #fff; border-color: #dee2e6; color: #212529;
}
@media (max-width: 480px) {
  .filter-input, .filter-select { width: 100%; }
  .filter-form > button, .filter-form > a { flex: 1; }
}

/* ─── Form card ──────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.75rem;
  box-shadow: var(--shadow);
}
@media (max-width: 480px) { .form-card { padding: 1.1rem .9rem; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem; margin-bottom: 1.25rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: span 1 !important; } }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: .7rem; justify-content: flex-end; margin-top: 1.2rem; flex-wrap: wrap; }
@media (max-width: 480px) {
  .form-actions { flex-direction: column-reverse; }
  .form-actions > * { width: 100%; justify-content: center; }
}

/* ─── Calc preview ───────────────────────────── */
.calc-preview {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r); padding: .95rem; margin-bottom: 1rem;
}
.calc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .875rem;
}
.calc-row:last-child { border: none; }
.calc-row span:first-child { color: var(--muted); }
.calc-row span:last-child  { font-family: var(--mono); color: var(--text); }
.calc-total span:last-child { font-size: 1.05rem; font-weight: 700; color: var(--primary-h); }

/* ─── Report cards ───────────────────────────── */
.report-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: .85rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .report-grid { grid-template-columns: repeat(2,1fr); } }
.report-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rc-label  { font-size: .67rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .3rem; }
.rc-profit { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; margin-bottom: .35rem; color: var(--text); }
.rc-meta   { font-size: .78rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 480px) { .rc-profit { font-size: 1.1rem; } .report-card { padding: .85rem; } }

/* ─── Charts ─────────────────────────────────── */
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .chart-row { grid-template-columns: 1fr; } }
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.2rem; box-shadow: var(--shadow);
}
.chart-title { font-size: .875rem; font-weight: 700; margin-bottom: .85rem; color: var(--text); }
.legend-list { margin-top: .8rem; display: flex; flex-direction: column; gap: 5px; }
.legend-list li { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.legend-list li span { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ─── Activity log ───────────────────────────── */
.act-list { padding: .85rem 1.1rem; display: flex; flex-direction: column; gap: .65rem; }
.act-item { display: flex; gap: 10px; align-items: flex-start; }
.act-dot  {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  margin-top: 6px; background: var(--subtle);
}
.act-dot.act-add    { background: var(--success); }
.act-dot.act-edit   { background: var(--warn-col); }
.act-dot.act-delete { background: var(--danger); }
.act-body p     { font-size: .875rem; margin: 0; color: var(--text); }
.act-body small { color: var(--muted); font-size: .76rem; }

/* ══════════════════════════════════════════════
   APPROVAL CARDS
══════════════════════════════════════════════ */
.approval-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--warn-col);
  border-radius: var(--r); padding: 1.25rem; margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.approval-card:hover { box-shadow: var(--shadow-lg); }
.approval-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem; margin-bottom: .85rem;
}
.approval-actions {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-top: .85rem; align-items: center;
}

/* ─── OTP ─────────────────────────────────────── */
.resend-wrap { text-align: center; margin-top: 1rem; font-size: .875rem; color: var(--muted); }
.resend-btn  {
  background: none; border: none; cursor: pointer;
  color: var(--primary-h); font-family: var(--font);
  font-size: .875rem; text-decoration: underline; padding: 0;
}
.resend-btn:disabled { color: var(--subtle); cursor: not-allowed; text-decoration: none; }
#resend-timer { font-family: var(--mono); font-size: .82rem; margin-left: 3px; }

/* ─── Empty states ───────────────────────────── */
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; }
.empty-page  { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-icon  { font-size: 2.5rem; margin-bottom: .85rem; }
.empty-page h3 { font-size: 1.2rem; color: var(--text); margin-bottom: .4rem; }

/* ─── Misc ───────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ══════════════════════════════════════════════
   WALLET HERO
══════════════════════════════════════════════ */
.wallet-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border: none; border-radius: 16px;
  padding: 2rem; max-width: 480px; margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(99,102,241,.35);
  position: relative; overflow: hidden;
}
.wallet-hero::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.wallet-hero-inner { display: flex; align-items: center; justify-content: space-between; position: relative; }
.wallet-hero-label  { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.75); margin-bottom: .4rem; }
.wallet-hero-amount { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; color: #fff; line-height: 1.1; }
.wallet-hero-name   { font-size: .82rem; color: rgba(255,255,255,.7); margin-top: .4rem; }
.wallet-hero-icon   { font-size: 2.8rem; opacity: .35; color: #fff; }
@media (max-width: 480px) { .wallet-hero-amount { font-size: 1.6rem; } .wallet-hero { padding: 1.25rem; } }

/* ══════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--g500); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--g400); }

/* ══════════════════════════════════════════════
   BUTTON SPINNER
══════════════════════════════════════════════ */
.btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.9);
  border-radius: 50%;
  animation: btnSpin .6s linear infinite;
  vertical-align: -2px;
  margin-right: 5px;
  flex-shrink: 0;
}
.btn-ghost .btn-spinner,
.btn-danger .btn-spinner,
.btn-success .btn-spinner {
  border-color: rgba(255,255,255,.15);
  border-top-color: currentColor;
}
button[disabled], a[disabled] { opacity: .5; pointer-events: none; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   MOBILE BOTTOM NAV
══════════════════════════════════════════════ */
.mob-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -1px 0 var(--border), 0 -8px 32px rgba(0,0,0,.3);
  transition: background .2s, border-color .2s;
}
.mob-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; color: var(--subtle);
  text-decoration: none !important;
  padding: 8px 4px 6px;
  transition: color .12s;
  -webkit-tap-highlight-color: transparent;
  position: relative; outline: none;
}
.mob-nav-item.active { color: var(--primary-h); }
.mob-nav-item:active { opacity: .65; }
.mob-nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.mob-nav-icon {
  position: relative; display: flex;
  align-items: center; justify-content: center;
  width: 28px; height: 22px;
}
.mob-nav-icon .bi { font-size: 1.3rem; line-height: 1; }
.mob-nav-label {
  font-size: .58rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1;
}
.mob-nav-badge {
  position: absolute; top: -4px; right: -7px;
  min-width: 15px; height: 15px;
  background: var(--danger); color: #fff;
  font-size: .5rem; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
  border: 1.5px solid var(--surface);
}
.mob-nav-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; border: 2px solid currentColor;
}
@media (min-width: 992px) { .mob-nav { display: none !important; } }
@media (max-width: 991.98px) {
  .main-wrap { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + .75rem); }
}

/* ══════════════════════════════════════════════
   BOOTSTRAP OVERRIDES
══════════════════════════════════════════════ */

/* Dropdown */
.dropdown-menu {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: 10px !important;
  overflow: hidden;
}
.dropdown-item {
  color: var(--text) !important;
  transition: background .1s;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--surface2) !important;
  color: var(--text) !important;
}

/* Modal */
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text);
}
.modal-header, .modal-footer { border-color: var(--border) !important; }
.modal-body p { color: var(--text); }

/* Role badge in navbar */
.badge.bg-dark {
  background-color: var(--g600) !important;
  color: var(--g200) !important;
}
.badge.bg-secondary {
  background-color: var(--g500) !important;
  color: var(--g200) !important;
}

/* Navbar count badges */
.navbar .badge.bg-danger {
  background-color: var(--danger) !important;
}

/* Collapse navbar in dark */
.navbar-collapse {
  background: var(--surface);
}
@media (max-width: 991.98px) {
  .navbar-collapse {
    border-top: 1px solid var(--border);
    padding: .75rem 0;
    margin-top: 2px;
  }
}

/* ══════════════════════════════════════════════
   DEMAND NOTIFICATION DROPDOWN
══════════════════════════════════════════════ */
.dn-dropdown-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: .6rem .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dn-dropdown-header span { font-weight: 600; font-size: .88rem; color: var(--text); }
.dn-dropdown-header a    { font-size: .78rem; color: var(--primary-h); text-decoration: none; }
.dn-dropdown-header a:hover { text-decoration: underline; }

.dn-item {
  border-bottom: 1px solid var(--border) !important;
  padding: .6rem .85rem !important;
  white-space: normal !important;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.dn-item:last-child { border-bottom: none !important; }

.dn-title { font-size: .84rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.dn-sub   { font-size: .79rem; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.dn-meta  { font-size: .72rem; color: var(--subtle); margin-top: 2px; }

/* Pop alert modal message text */
.pop-alert-msg { color: var(--text); }
