/* ═══════════════════════════════════════════════════════════
   NG Bank Admin Panel — Production Design System v2.0
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-900: #1e3a8a;

  /* Sidebar gradient */
  --sidebar-from: #0f172a;
  --sidebar-to:   #1e3a5f;
  --sidebar-width: 260px;

  /* Surface */
  --bg:         #f0f4f9;
  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --border:     #e2e8f0;
  --border-2:   #f1f5f9;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Status */
  --success: #10b981;
  --danger:  #ef4444;
  --warning: #f59e0b;
  --info:    #06b6d4;
  --purple:  #8b5cf6;
  --pink:    #ec4899;

  /* Effects */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.18);
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --header-h:   64px;
  --transition: all .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: linear-gradient(175deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
  display: flex; flex-direction: column;
  z-index: 1000; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
  transition: var(--transition);
}

.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM36 6V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: center;
  position: relative;
}

.sidebar-logo-icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 10px;
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.sidebar-logo h2 {
  color: #fff; font-size: .95rem; font-weight: 700;
  letter-spacing: .3px;
}
.sidebar-logo small { color: rgba(255,255,255,.45); font-size: .7rem; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-title {
  padding: 12px 20px 4px;
  font-size: .62rem; font-weight: 700;
  color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: 1.2px;
}

.nav-item {
  display: flex; align-items: center;
  padding: 10px 16px; margin: 2px 10px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .835rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.1), transparent);
  opacity: 0; transition: opacity .2s;
  border-radius: var(--radius-sm);
}

.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item:hover::before { opacity: 1; }
.nav-item:hover i { transform: scale(1.15); }

.nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,.35), rgba(59,130,246,.15));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.3);
}

.nav-item.active::after {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--brand-500);
  border-radius: 0 4px 4px 0;
}

.nav-item i { width: 20px; text-align: center; font-size: 1rem; transition: transform .2s; }

/* ── Locked nav item (insufficient role) ── */
.nav-item-locked {
  opacity: .45;
  cursor: not-allowed !important;
  pointer-events: auto; /* allow click to show toast */
}
.nav-item-locked:hover { background: rgba(239,68,68,.08) !important; color: rgba(255,255,255,.5) !important; }
.nav-item-locked:hover::before { opacity: 0 !important; }
.nav-lock-badge {
  margin-left: auto;
  font-size: .75rem;
  opacity: .7;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--brand-500);
  color: #fff;
  font-size: .6rem; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  min-width: 20px; text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  cursor: pointer; transition: var(--transition);
}
.user-badge:hover { background: rgba(255,255,255,.1); }

.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
  box-shadow: 0 2px 8px rgba(59,130,246,.4);
  flex-shrink: 0;
}

.user-name { color: rgba(255,255,255,.9); font-size: .82rem; font-weight: 600; }
.user-role { color: rgba(255,255,255,.35); font-size: .68rem; }

/* Online dot */
.user-badge::after {
  content: '';
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--sidebar-from);
  margin-left: auto;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  50%      { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

/* ════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ════════════════════════════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 900;
  gap: 16px;
  box-shadow: 0 1px 0 var(--border-2);
}

.topbar-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary); flex: 1;
  display: flex; align-items: center; gap: 8px;
}

.topbar-title::before {
  content: '';
  width: 4px; height: 20px;
  background: linear-gradient(180deg, var(--brand-500), var(--purple));
  border-radius: 99px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.topbar-clock {
  font-size: .75rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--border);
}

.btn-logout {
  background: none; border: 1px solid #fecaca;
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--danger); cursor: pointer; font-size: .8rem; font-weight: 500;
  transition: var(--transition); display: flex; align-items: center; gap: 5px;
}
.btn-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); transform: translateY(-1px); }

/* ── Content ──────────────────────────────────────────────── */
.content { padding: 28px; flex: 1; }

/* Page enter animation */
.content > * {
  animation: fadeSlideUp .35s cubic-bezier(.4,0,.2,1) both;
}
.content > *:nth-child(1) { animation-delay: .03s; }
.content > *:nth-child(2) { animation-delay: .06s; }
.content > *:nth-child(3) { animation-delay: .09s; }
.content > *:nth-child(4) { animation-delay: .12s; }

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

/* ════════════════════════════════════════════════════════════
   STAT CARDS
   ════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border-2);
  transition: var(--transition);
  cursor: default;
  position: relative; overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-accent, rgba(59,130,246,.06)) 0%, transparent 70%);
  transform: translate(20px, -20px);
  transition: transform .3s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { transform: translate(10px,-10px) scale(1.5); }

.stat-icon {
  width: 54px; height: 54px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
  transition: transform .2s;
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-5deg); }

.stat-icon.blue   { background: linear-gradient(135deg,#dbeafe,#bfdbfe); --card-accent: rgba(59,130,246,.1); }
.stat-icon.green  { background: linear-gradient(135deg,#d1fae5,#a7f3d0); --card-accent: rgba(16,185,129,.1); }
.stat-icon.orange { background: linear-gradient(135deg,#fef3c7,#fde68a); --card-accent: rgba(245,158,11,.1); }
.stat-icon.cyan   { background: linear-gradient(135deg,#cffafe,#a5f3fc); --card-accent: rgba(6,182,212,.1); }
.stat-icon.purple { background: linear-gradient(135deg,#ede9fe,#ddd6fe); --card-accent: rgba(139,92,246,.1); }
.stat-icon.red    { background: linear-gradient(135deg,#fee2e2,#fecaca); --card-accent: rgba(239,68,68,.1); }

.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-change { font-size: .72rem; color: var(--success); font-weight: 500; margin-top: 2px; }
.stat-change.down { color: var(--danger); }

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

.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
  font-size: .95rem; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: .83rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative; overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
}
.btn:hover::after { background: rgba(255,255,255,.15); }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(37,99,235,.5); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.35);
}
.btn-success:hover { box-shadow: 0 4px 16px rgba(16,185,129,.5); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.35);
}
.btn-danger:hover { box-shadow: 0 4px 16px rgba(239,68,68,.5); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }

.btn-sm { padding: 5px 11px; font-size: .76rem; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: .95rem; }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* Icon button */
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }

table { width: 100%; border-collapse: collapse; font-size: .845rem; }

thead tr {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-2));
}

th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 700; font-size: .71rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-2);
  color: var(--text-primary);
  transition: background .15s;
}

tbody tr { transition: var(--transition); }
tbody tr:hover td { background: var(--brand-50); }
tbody tr:last-child td { border-bottom: none; }

/* Row animation on load */
tbody tr {
  animation: rowFadeIn .3s ease both;
}
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #cffafe; color: #155e75; }
.badge-primary  { background: #dbeafe; color: #1e40af; }
.badge-secondary{ background: #f1f5f9; color: #475569; }
.badge-purple   { background: #ede9fe; color: #5b21b6; }

/* Live dot in badge */
.badge-live::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes livePulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.7); }
}

/* ════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px; letter-spacing: .2px;
}

.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .865rem; transition: var(--transition);
  background: var(--surface); color: var(--text-primary);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  background: #fff;
}

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

.form-control:read-only {
  background: var(--surface-2); color: var(--text-muted); cursor: not-allowed;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Input with icon */
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; pointer-events: none;
}
.input-group .form-control { padding-left: 36px; }

/* ════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: overlayIn .2s ease;
}

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

.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px; min-width: 480px; max-width: 90vw; max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: modalIn .28s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-2);
}

.modal-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.modal-close {
  background: var(--surface-2); border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); transform: rotate(90deg); }

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

/* ════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 18px; border-radius: var(--radius);
  font-size: .855rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(120%) scale(.9);
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  min-width: 290px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  pointer-events: all;
  position: relative; overflow: hidden;
}

.toast::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  height: 3px; width: 100%;
  border-radius: 0 0 var(--radius) var(--radius);
}

.toast.show { opacity: 1; transform: translateX(0) scale(1); }
.toast.hide { opacity: 0; transform: translateX(120%) scale(.9); }

.toast-success::after { background: var(--success); }
.toast-error::after   { background: var(--danger); }
.toast-warning::after { background: var(--warning); }
.toast-info::after    { background: var(--info); }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: .82rem; margin-bottom: 2px; }
.toast-msg { font-size: .8rem; color: var(--text-secondary); }

/* ════════════════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 5px; margin-top: 18px; flex-wrap: wrap; }

.page-btn {
  height: 34px; min-width: 34px; padding: 0 10px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: .82rem; font-weight: 500;
  transition: var(--transition); color: var(--text-secondary);
}

.page-btn:hover:not(:disabled) {
  background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-600);
  transform: translateY(-1px);
}

.page-btn.active {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════
   LOADING & EMPTY
   ════════════════════════════════════════════════════════════ */
.loading-spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 48px;
  color: var(--text-muted); font-size: .875rem;
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  text-align: center; padding: 56px 24px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 14px; opacity: .6; }
.empty-state p { font-size: .875rem; line-height: 1.7; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

/* ════════════════════════════════════════════════════════════
   STATUS INDICATORS
   ════════════════════════════════════════════════════════════ */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 5px; flex-shrink: 0;
}
.status-dot.green  { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.status-dot.red    { background: var(--danger);  box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.status-dot.yellow { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.status-dot.blue   { background: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }

/* ════════════════════════════════════════════════════════════
   FLOW EDITOR NODES
   ════════════════════════════════════════════════════════════ */
.node-list { display: flex; flex-direction: column; gap: 14px; }

.node-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; background: var(--surface-2); position: relative;
  transition: var(--transition);
}
.node-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-md); }
.node-card.start-node { border-color: var(--success); background: #f0fdf4; }
.node-card.end-node   { border-color: var(--info);    background: #ecfeff; }
.node-type-badge { position: absolute; top: 12px; right: 12px; }
.node-actions { display: flex; gap: 8px; margin-top: 12px; }
.option-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.option-row input { flex: 1; }

/* ════════════════════════════════════════════════════════════
   PROGRESS / CHART BARS
   ════════════════════════════════════════════════════════════ */
.progress-bar-wrap {
  background: var(--border); border-radius: 99px;
  height: 8px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--brand-500), var(--purple));
}

/* ════════════════════════════════════════════════════════════
   SEARCH BOX
   ════════════════════════════════════════════════════════════ */
.search-box {
  position: relative; display: flex; align-items: center;
}
.search-box::before {
  content: '🔍';
  position: absolute; left: 10px;
  font-size: .85rem; pointer-events: none;
}
.search-box input {
  padding-left: 34px;
  border-radius: 99px !important;
}
.search-box input:focus { border-radius: 99px !important; }

/* ════════════════════════════════════════════════════════════
   TAGS / CHIPS
   ════════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .73rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ════════════════════════════════════════════════════════════
   DETAIL GRID (Customer / SR view)
   ════════════════════════════════════════════════════════════ */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.detail-item {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 14px; border: 1px solid var(--border-2);
  transition: var(--transition);
}
.detail-item:hover { border-color: var(--brand-500); background: var(--brand-50); }

.detail-item-label {
  font-size: .67rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px; font-weight: 700;
  margin-bottom: 4px;
}

.detail-item-value {
  font-size: .875rem; font-weight: 600; color: var(--text-primary);
  word-break: break-all;
}

/* ════════════════════════════════════════════════════════════
   DIVIDER
   ════════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border-2); margin: 20px 0; }

/* ════════════════════════════════════════════════════════════
   TOOLTIP
   ════════════════════════════════════════════════════════════ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) scale(.9);
  background: var(--text-primary); color: #fff;
  font-size: .72rem; padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: all .2s;
  z-index: 1000;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* ════════════════════════════════════════════════════════════
   SELECT STYLED
   ════════════════════════════════════════════════════════════ */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .content { padding: 20px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .modal { min-width: unset; width: 100%; }
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════════════════════════ */
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info    { color: var(--info); }
.text-sm      { font-size: .8rem; }
.text-xs      { font-size: .72rem; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }
