/* =========================================================
   Unicon Simulator — Design System
   Premium dark fintech dashboard CSS
   ========================================================= */

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

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------------------------
   2. Design Tokens
   ---------------------------------------------------------- */
:root {
  /* Brand palette */
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-400: #818cf8;
  --brand-glow: rgba(99, 102, 241, 0.35);

  --violet-500: #8b5cf6;
  --violet-400: #a78bfa;

  --teal-400:   #2dd4bf;
  --teal-500:   #14b8a6;

  --emerald-400:#34d399;
  --emerald-500:#10b981;

  --amber-400:  #fbbf24;
  --rose-400:   #f87171;
  --rose-500:   #ef4444;

  /* Backgrounds */
  --bg-base:    #080c18;
  --bg-surface: #0d1321;
  --bg-card:    rgba(17, 24, 44, 0.70);
  --bg-glass:   rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glass:  rgba(255, 255, 255, 0.12);
  --border-brand:  rgba(99, 102, 241, 0.40);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-brand:     #818cf8;

  /* Sidebar */
  --sidebar-w:      248px;
  --sidebar-w-col:  72px;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Typography */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'Fira Code', 'Cascadia Code', 'Courier New', monospace;

  /* Borders radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-brand: 0 4px 24px rgba(99,102,241,0.3);

  /* Transitions */
  --t-fast:   150ms ease;
  --t-normal: 250ms ease;
  --t-slow:   400ms cubic-bezier(0.4,0,0.2,1);
}

/* ----------------------------------------------------------
   3. Base
   ---------------------------------------------------------- */
html { font-size: 16px; height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(139,92,246,0.08) 0%, transparent 60%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------
   4. Layout Shell
   ---------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ----------------------------------------------------------
   5. Sidebar
   ---------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(10, 14, 28, 0.95);
  border-right: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: width var(--t-slow);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-col); }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  height: 64px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}

.brand-text {
  overflow: hidden;
  transition: opacity var(--t-normal), width var(--t-normal);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar.collapsed .brand-text { opacity: 0; width: 0; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-sm);
  margin-top: var(--space-sm);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-normal);
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  list-style: none;
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-sm) 10px 10px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.nav-link.active {
  color: var(--brand-400);
  background: rgba(99,102,241,0.12);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand-500), var(--violet-500));
}

.nav-link i.icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-label {
  transition: opacity var(--t-normal);
  overflow: hidden;
}

.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--brand-600);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  transition: opacity var(--t-normal);
}

.sidebar.collapsed .nav-badge { opacity: 0; }

/* Bottom section */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-md) var(--space-sm);
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-left: auto;
}

.sidebar-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

/* ----------------------------------------------------------
   6. Main Content Area
   ---------------------------------------------------------- */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left var(--t-slow);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-area.expanded { margin-left: var(--sidebar-w-col); }

/* ----------------------------------------------------------
   7. Topbar
   ---------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  height: 64px;
  background: rgba(8, 12, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.page-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.page-breadcrumb a:hover { color: var(--text-primary); }

.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; }

.page-title-bar {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  transition: all var(--t-fast);
}

.topbar-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 5px 10px 5px 5px;
  border-radius: var(--r-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  position: relative;
}

.user-pill:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ----------------------------------------------------------
   8. Page Content
   ---------------------------------------------------------- */
.page-content {
  flex: 1;
  padding: var(--space-xl);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.page-header-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-header-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ----------------------------------------------------------
   9. Cards
   ---------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: all var(--t-normal);
}

.card:hover { border-color: var(--border-glass); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title i { color: var(--brand-400); }

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.15);
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--t-normal);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.stat-card.brand::before  { background: linear-gradient(90deg, var(--brand-500), var(--violet-500)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--emerald-500), var(--teal-500)); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--amber-400), #f97316); }
.stat-card.danger::before  { background: linear-gradient(90deg, var(--rose-500), #db2777); }

.stat-card:hover { transform: translateY(-2px); border-color: var(--border-glass); }

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: var(--space-md);
}

.stat-card.brand  .stat-card-icon { background: rgba(99,102,241,0.15); color: var(--brand-400); }
.stat-card.success .stat-card-icon { background: rgba(16,185,129,0.15); color: var(--emerald-400); }
.stat-card.warning .stat-card-icon { background: rgba(251,191,36,0.15); color: var(--amber-400); }
.stat-card.danger  .stat-card-icon { background: rgba(239,68,68,0.15);  color: var(--rose-400); }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.stat-delta.up   { color: var(--emerald-400); }
.stat-delta.down { color: var(--rose-400); }

/* ----------------------------------------------------------
   10. Tables
   ---------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead tr {
  background: rgba(0,0,0,0.25);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover {
  background: rgba(99,102,241,0.04);
}

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

/* Cell helpers */
.cell-strong {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.cell-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-meta-primary {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
}

.cell-meta-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   11. Badges / Status Pills
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge i { font-size: 10px; }

.badge-success {
  background: rgba(16,185,129,0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16,185,129,0.25);
}

.badge-failed, .badge-danger {
  background: rgba(239,68,68,0.15);
  color: var(--rose-400);
  border: 1px solid rgba(239,68,68,0.25);
}

.badge-pending, .badge-warning {
  background: rgba(251,191,36,0.12);
  color: var(--amber-400);
  border: 1px solid rgba(251,191,36,0.25);
}

.badge-processing, .badge-info {
  background: rgba(45,212,191,0.12);
  color: var(--teal-400);
  border: 1px solid rgba(45,212,191,0.25);
}

.badge-secondary {
  background: rgba(148,163,184,0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(148,163,184,0.2);
}

.badge-brand {
  background: rgba(99,102,241,0.15);
  color: var(--brand-400);
  border: 1px solid rgba(99,102,241,0.3);
}

.badge-active {
  background: rgba(16,185,129,0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16,185,129,0.25);
}

.badge-inactive {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100,116,139,0.2);
}

/* ----------------------------------------------------------
   12. Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--violet-500));
  color: white;
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 2px 12px rgba(99,102,241,0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(99,102,241,0.45);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-success {
  background: linear-gradient(135deg, var(--emerald-500), var(--teal-500));
  color: white;
  box-shadow: 0 2px 12px rgba(16,185,129,0.25);
}

.btn-success:hover {
  box-shadow: 0 4px 20px rgba(16,185,129,0.4);
  transform: translateY(-1px);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--rose-500), #db2777);
  color: white;
}

.btn-danger:hover { transform: translateY(-1px); color: white; }

.btn-icon {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
  padding: 7px 10px;
}

.btn-icon:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.btn-icon.btn-info:hover  { color: var(--teal-400);    background: rgba(45,212,191,0.1); }
.btn-icon.btn-edit:hover  { color: var(--amber-400);   background: rgba(251,191,36,0.1); }
.btn-icon.btn-danger:hover{ color: var(--rose-400);    background: rgba(239,68,68,0.1);  }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* ----------------------------------------------------------
   13. Forms
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-label .required { color: var(--rose-400); margin-left: 2px; }

.form-control,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: all var(--t-fast);
  appearance: none;
  outline: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:hover,
.form-select:hover { border-color: var(--border-glass); }

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-500);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-500);
  cursor: pointer;
}

.form-check-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11.5px;
  color: var(--rose-400);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Input group (icon left) */
.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.input-group .form-control { padding-left: 38px; }

.input-group .input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color var(--t-fast);
}

.input-group .input-suffix:hover { color: var(--text-primary); }

/* Filter bar */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1.5fr auto;
  gap: var(--space-md);
  align-items: end;
}

@media (max-width: 1100px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   14. Alerts & Toasts
   ---------------------------------------------------------- */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--r-md);
  font-size: 13.5px;
  margin-bottom: var(--space-md);
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.25);
  color: var(--emerald-400);
}

.alert-danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.25);
  color: var(--rose-400);
}

.alert-warning {
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.25);
  color: var(--amber-400);
}

.alert-info {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.25);
  color: var(--brand-400);
}

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.alert-close:hover { opacity: 1; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(17,24,44,0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-lg);
  padding: var(--space-md) var(--space-lg);
  min-width: 280px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ----------------------------------------------------------
   15. Pagination
   ---------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  transition: all var(--t-fast);
}

.page-item .page-link:hover {
  background: rgba(99,102,241,0.15);
  color: var(--brand-400);
  border-color: var(--border-brand);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, var(--brand-500), var(--violet-500));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-brand);
}

.page-item.disabled .page-link {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------
   16. Code blocks (JSON viewer)
   ---------------------------------------------------------- */
.json-viewer {
  background: #070b15;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-lg);
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #c9d1d9;
}

.json-viewer::-webkit-scrollbar { width: 6px; height: 6px; }
.json-viewer::-webkit-scrollbar-track { background: transparent; }
.json-viewer::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.json-viewer::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ----------------------------------------------------------
   17. Loading & Empty States
   ---------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-xl);
  background: rgba(99,102,241,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--brand-400);
  margin-bottom: var(--space-lg);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 300px;
  margin-bottom: var(--space-lg);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,12,24,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ----------------------------------------------------------
   18. Utilities
   ---------------------------------------------------------- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.flex-wrap { flex-wrap: wrap; }
.flex-1  { flex: 1; }
.ml-auto { margin-left: auto; }
.mb-sm   { margin-bottom: var(--space-sm); }
.mb-md   { margin-bottom: var(--space-md); }
.mb-lg   { margin-bottom: var(--space-lg); }
.mb-xl   { margin-bottom: var(--space-xl); }
.mt-md   { margin-top: var(--space-md); }
.mt-lg   { margin-top: var(--space-lg); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--text-primary) !important; }
.text-brand   { color: var(--brand-400); }
.text-success { color: var(--emerald-400); }
.text-danger  { color: var(--rose-400); }
.text-warning { color: var(--amber-400); }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.font-mono { font-family: var(--font-mono); }
.font-600 { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-md); }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

/* Sidebar overlay on mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-slow), width var(--t-slow);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-area {
    margin-left: 0 !important;
  }
  .sidebar-overlay {
    display: block;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-lg) 0;
}

/* Copy button */
.copy-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--t-fast);
}

.copy-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

/* Detail info rows */
.info-grid {
  display: grid;
  gap: 14px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  width: 130px;
  flex-shrink: 0;
  padding-top: 2px;
}

.info-value {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
  flex: 1;
}

/* Acquirer / Profile card grid */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.entity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  transition: all var(--t-normal);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  cursor: pointer;
}

.entity-card:hover {
  border-color: var(--border-brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.12);
}

.entity-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(99,102,241,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--brand-400);
  margin-bottom: var(--space-sm);
}

.entity-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.entity-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.entity-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

/* Credential field badge */
.cred-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-400);
}

/* ----------------------------------------------------------
   19. Scrollbar (global)
   ---------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ----------------------------------------------------------
   20. Animations
   ---------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.35s ease both;
}

.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.10s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.20s; }

/* ----------------------------------------------------------
   21. Modals
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-normal);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: all var(--t-normal);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--t-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
