/* ── BitnovaUI Platform CSS — Dashboard Theme ────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:wght@300;400;500;600&family=Caveat:wght@400;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --ff-display: 'Outfit', sans-serif;
  --ff-body:    'DM Sans', sans-serif;
  --ff-accent:  'Caveat', cursive;
  --ff-mono:    'Space Mono', monospace;

  --primary:       #6366f1;
  --primary-light: #818cf8;
  --primary-dark:  #4f46e5;
  --secondary:     #14b8a6;
  --amber:         #f59e0b;
  --danger:        #ef4444;
  --success:       #22c55e;
  --warning:       #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: 0.28s cubic-bezier(.4,0,.2,1);

  /* Light defaults */
  --bg:         #f5f5ff;
  --bg2:        #ededff;
  --surface:    #ffffff;
  --surface2:   #f0f0ff;
  --border:     rgba(99,102,241,0.18);
  --border2:    rgba(0,0,0,0.07);
  --text:       #0f0f2e;
  --text2:      #4a4a7a;
  --text3:      #8888aa;
  --card-bg:    rgba(255,255,255,0.98);
  --glow:       rgba(99,102,241,0.12);
  --sidebar-w:  260px;
  --topbar-h:   64px;
}

[data-theme="dark"] {
  --bg:       #080812;
  --bg2:      #10102a;
  --surface:  #1a1a3a;
  --surface2: #22224a;
  --border:   rgba(99,102,241,0.2);
  --border2:  rgba(255,255,255,0.07);
  --text:     #eef0ff;
  --text2:    #9ea3c8;
  --text3:    #5a5f88;
  --card-bg:  rgba(22,22,48,0.95);
  --glow:     rgba(99,102,241,0.3);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* Override Bootstrap body/html background completely */
html, body {
  background: var(--bg) !important;
  color: var(--text) !important;
}
body {
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--ff-display); font-weight: 700; color: var(--text); }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* ── Bootstrap neutralization ─────────────────────────────────
   Bootstrap 5.3 injects hardcoded whites via .card, .dropdown-menu,
   .list-group-item, .table, .modal-content, .form-control etc.
   These rules override all of them with our theme tokens. */

/* body background always from our token */
[data-theme="dark"] body,
[data-theme="dark"] html { background-color: var(--bg) !important; }

/* Bootstrap .card override */
.card {
  background-color: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.card-header, .card-footer {
  background-color: var(--surface2) !important;
  border-color: var(--border2) !important;
  color: var(--text) !important;
}
.card-body { color: var(--text) !important; }

/* Bootstrap dropdown */
.dropdown-menu {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.dropdown-item { color: var(--text2) !important; }
.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--bg2) !important;
  color: var(--text) !important;
}
.dropdown-divider { border-color: var(--border2) !important; }

/* Bootstrap table */
.table {
  --bs-table-bg: transparent !important;
  --bs-table-color: var(--text) !important;
  --bs-table-border-color: var(--border2) !important;
  --bs-table-striped-bg: var(--surface2) !important;
  --bs-table-hover-bg: rgba(99,102,241,0.05) !important;
  color: var(--text) !important;
  border-color: var(--border2) !important;
}
.table th, .table td { border-color: var(--border2) !important; color: var(--text) !important; }
.table thead th { background-color: var(--surface2) !important; color: var(--text3) !important; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--surface2) !important; }

/* Bootstrap nav override — prevents Bootstrap .nav-link color fighting ours */
.navbar-nav .nav-link,
.nav .nav-link {
  color: var(--text2) !important;
}
.navbar-nav .nav-link:hover,
.nav .nav-link:hover { color: var(--text) !important; }

/* Bootstrap list-group */
.list-group-item {
  background-color: var(--surface) !important;
  border-color: var(--border2) !important;
  color: var(--text) !important;
}
.list-group-item:hover { background-color: var(--surface2) !important; }

/* Bootstrap modal */
.modal-content {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.modal-header, .modal-footer {
  border-color: var(--border2) !important;
  color: var(--text) !important;
}
.modal-header .btn-close { filter: none; }
[data-theme="dark"] .modal-header .btn-close { filter: invert(1); }

/* Bootstrap form controls */
.form-control, .form-select {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.form-control:focus, .form-select:focus {
  background-color: var(--surface) !important;
  border-color: var(--primary) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}
.form-control::placeholder { color: var(--text3) !important; }
.form-control:disabled, .form-select:disabled {
  background-color: var(--surface2) !important;
  color: var(--text3) !important;
}

/* Bootstrap input-group */
.input-group-text {
  background-color: var(--surface2) !important;
  border-color: var(--border) !important;
  color: var(--text2) !important;
}

/* Bootstrap pagination */
.page-link {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text2) !important;
}
.page-link:hover {
  background-color: var(--surface2) !important;
  border-color: var(--primary) !important;
  color: var(--text) !important;
}
.page-item.active .page-link {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.page-item.disabled .page-link {
  background-color: var(--surface) !important;
  color: var(--text3) !important;
}

/* Bootstrap breadcrumb */
.breadcrumb-item, .breadcrumb-item a { color: var(--text2) !important; }
.breadcrumb-item.active { color: var(--text3) !important; }

/* Bootstrap tooltip/popover */
.tooltip .tooltip-inner { background-color: var(--surface2); color: var(--text); }
.popover {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.2rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  /* Prevent Bootstrap .navbar rules from touching this */
  background: var(--surface);
}
.sidebar-brand img { max-width: 140px; height: auto; display: block; }
.sidebar-brand small {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  color: var(--text3);
  font-weight: 400;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* nav-section label — explicitly set for dark mode */
.nav-section {
  padding: 1rem 1rem 0.25rem;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3) !important;
}

.sidebar-nav { padding: 0.5rem 0.75rem; flex: 1; }
.nav-item { margin-bottom: 2px; }

/* Sidebar nav links — use !important to beat Bootstrap .nav-link */
.sidebar .nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.62rem 0.9rem !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text2) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  transition: all var(--transition) !important;
  position: relative !important;
  background: transparent !important;
  text-decoration: none !important;
}
.sidebar .nav-link .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar .nav-link .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-family: var(--ff-mono);
}
.sidebar .nav-link:hover {
  background: var(--bg2) !important;
  color: var(--text) !important;
}
.sidebar .nav-link.active {
  background: rgba(99,102,241,0.12) !important;
  color: var(--primary-light) !important;
  font-weight: 600 !important;
}
.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

/* Dark-mode sidebar explicit overrides */
[data-theme="dark"] .sidebar {
  background: var(--surface) !important;
  border-right-color: var(--border) !important;
}
[data-theme="dark"] .sidebar .nav-link {
  color: var(--text2) !important;
}
[data-theme="dark"] .sidebar .nav-link:hover {
  background: var(--bg2) !important;
  color: var(--text) !important;
}
[data-theme="dark"] .sidebar .nav-link.active {
  color: var(--primary-light) !important;
  background: rgba(99,102,241,0.15) !important;
}
[data-theme="dark"] .nav-section {
  color: var(--text3) !important;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  background: var(--surface);
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text) !important;
  line-height: 1.2;
}
.sidebar-user-role {
  font-size: 0.68rem;
  color: var(--text3) !important;
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Main layout ─────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 400;
  backdrop-filter: blur(12px);
}
.topbar-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text) !important;
}
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-action {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text2) !important;
  position: relative;
  transition: all var(--transition);
  text-decoration: none;
}
.topbar-action:hover {
  background: var(--bg2);
  color: var(--text) !important;
}
.notif-dot {
  position: absolute;
  top: 3px; right: 3px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.theme-toggle {
  width: 44px; height: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  top: 2px; left: 2px;
  transition: transform var(--transition);
}
[data-theme="light"] .theme-toggle::after { transform: translateX(20px); }

/* ── Page content ────────────────────────────────────────────── */
.page-content {
  padding: 2rem;
  flex: 1;
  background: var(--bg);
}

/* ── Banner — landing page only ──────────────────────────────── */
.promo-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), #7c3aed);
  color: #fff;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-family: var(--ff-body);
  font-weight: 500;
  position: relative;
  z-index: 600;
}
.promo-banner a { color: #fff; text-decoration: underline; opacity: 0.9; }
.promo-banner a:hover { opacity: 1; }
.promo-close {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.promo-close:hover { color: #fff; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}
.stat-card:hover { border-color: var(--primary); box-shadow: 0 8px 32px var(--glow); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.si-purple { background: rgba(99,102,241,0.15); }
.si-teal   { background: rgba(20,184,166,0.15); }
.si-amber  { background: rgba(245,158,11,0.15); }
.si-green  { background: rgba(34,197,94,0.15); }
.si-rose   { background: rgba(244,63,94,0.15); }
.stat-value { font-family: var(--ff-display); font-weight: 800; font-size: 1.8rem; line-height: 1; color: var(--text) !important; }
.stat-label { font-size: 0.8rem; color: var(--text3) !important; font-family: var(--ff-mono); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.2rem; }
.stat-change { font-size: 0.78rem; margin-top: 0.3rem; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── bcard (custom card) ────────────────────────────────────── */
.bcard {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  overflow: hidden;
  color: var(--text) !important;
}
.bcard-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card-bg) !important;
}
.bcard-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text) !important;
}
.bcard-body {
  padding: 1.4rem;
  background: var(--card-bg) !important;
  color: var(--text) !important;
}

/* ── Tables ──────────────────────────────────────────────────── */
.btable { width: 100%; border-collapse: collapse; }
.btable thead tr { background: var(--surface2) !important; }
.btable th {
  padding: 0.75rem 1rem;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3) !important;
  font-weight: 400;
  white-space: nowrap;
  border-bottom: 1px solid var(--border2);
}
.btable td {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}
.btable tbody tr { transition: background var(--transition); }
.btable tbody tr:hover { background: rgba(99,102,241,0.04) !important; }
.btable tbody tr:last-child td { border-bottom: none; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-bv {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn-bv-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  box-shadow: 0 2px 12px var(--glow);
}
.btn-bv-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--glow); color: #fff !important; }
.btn-bv-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text) !important; }
.btn-bv-secondary:hover { border-color: var(--primary); color: var(--primary-light) !important; }
.btn-bv-danger { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: var(--danger) !important; }
.btn-bv-danger:hover { background: var(--danger); color: #fff !important; }
.btn-bv-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: var(--success) !important; }
.btn-bv-success:hover { background: var(--success); color: #fff !important; }
.btn-bv-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-bv-lg { padding: 0.8rem 2rem; font-size: 1rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text2) !important;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-control, .form-select {
  width: 100%;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--text) !important;
  transition: all var(--transition);
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}
.form-control::placeholder { color: var(--text3) !important; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.bg-success  { background: rgba(34,197,94,0.15)  !important; color: #16a34a !important; }
.bg-danger   { background: rgba(239,68,68,0.15)  !important; color: #dc2626 !important; }
.bg-warning  { background: rgba(245,158,11,0.15) !important; color: #d97706 !important; }
.bg-primary  { background: rgba(99,102,241,0.15) !important; color: var(--primary-light) !important; }
.bg-secondary{ background: rgba(100,116,139,0.15)!important; color: #64748b !important; }
[data-theme="dark"] .bg-success  { background: rgba(34,197,94,0.18)  !important; color: #4ade80 !important; }
[data-theme="dark"] .bg-danger   { background: rgba(239,68,68,0.18)  !important; color: #f87171 !important; }
[data-theme="dark"] .bg-warning  { background: rgba(245,158,11,0.18) !important; color: #fbbf24 !important; }
[data-theme="dark"] .bg-secondary{ background: rgba(100,116,139,0.18)!important; color: #94a3b8 !important; }

/* ── License key display ─────────────────────────────────────── */
.license-key-box {
  background: var(--surface2) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--ff-mono);
  font-size: 0.9rem;
  color: var(--primary-light) !important;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  word-break: break-all;
}
.copy-btn {
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-size: 1rem;
  transition: color var(--transition);
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--primary-light); }

/* ── Resource card ───────────────────────────────────────────── */
.resource-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.resource-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 12px 40px var(--glow); }
.resource-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  color: var(--text3);
}
.resource-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resource-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; background: var(--card-bg) !important; }
.resource-title { font-family: var(--ff-display); font-weight: 700; font-size: 0.98rem; color: var(--text) !important; margin-bottom: 0.4rem; }
.resource-desc { font-size: 0.83rem; color: var(--text2) !important; line-height: 1.6; flex: 1; }
.resource-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; font-size: 0.75rem; color: var(--text3) !important; font-family: var(--ff-mono); }

/* ── Notifications dropdown ──────────────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--surface) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  z-index: 999;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border2);
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text) !important;
  background: var(--surface) !important;
}
.notif-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border2);
  font-size: 0.83rem;
  color: var(--text2) !important;
  cursor: pointer;
  transition: background var(--transition);
  background: var(--surface) !important;
}
.notif-item:hover { background: var(--surface2) !important; }
.notif-item.unread { background: rgba(99,102,241,0.06) !important; }
.notif-item .notif-title { font-weight: 600; color: var(--text) !important; font-size: 0.85rem; margin-bottom: 0.15rem; }
.notif-item .notif-time { font-size: 0.7rem; color: var(--text3) !important; font-family: var(--ff-mono); }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--text3); font-size: 0.85rem; background: var(--surface) !important; }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg) !important;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.auth-blob {
  position: fixed; border-radius: 50%; filter: blur(100px); opacity: 0.18; pointer-events: none;
}
.auth-blob-1 { width: 500px; height: 500px; background: var(--primary); top: -200px; left: -150px; }
.auth-blob-2 { width: 400px; height: 400px; background: var(--secondary); bottom: -150px; right: -100px; }
.auth-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
  color: var(--text) !important;
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.3rem;
}
.auth-logo img { max-width: 180px; height: auto; }
.auth-subtitle { text-align: center; color: var(--text2) !important; font-size: 0.9rem; margin-bottom: 2rem; }

/* ── Modal overrides ─────────────────────────────────────────── */
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border2) !important;
  font-family: var(--ff-display);
  font-weight: 700;
  color: var(--text) !important;
  background: var(--surface) !important;
}
.modal-body { background: var(--surface) !important; color: var(--text) !important; }
.modal-footer { border-top: 1px solid var(--border2) !important; background: var(--surface) !important; }
[data-theme="dark"] .btn-close { filter: invert(1); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,0.12) !important; border-color: rgba(34,197,94,0.3) !important; color: var(--success) !important; }
.alert-danger   { background: rgba(239,68,68,0.12) !important; border-color: rgba(239,68,68,0.3) !important; color: var(--danger) !important; }
.alert-warning  { background: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.3) !important; color: var(--warning) !important; }
.alert-info     { background: rgba(99,102,241,0.1) !important; border-color: rgba(99,102,241,0.3) !important; color: var(--primary-light) !important; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination .page-link {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text2) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.85rem;
  margin: 0 2px;
  transition: all var(--transition);
}
.pagination .page-link:hover { background: var(--surface2) !important; color: var(--text) !important; border-color: var(--primary) !important; }
.pagination .active .page-link { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }

/* ── Empty states ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text3) !important; }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h5 { font-family: var(--ff-display); color: var(--text2) !important; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.88rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block !important; }
  .main-wrap { margin-left: 0; }
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 499;
  backdrop-filter: blur(2px);
}
