/* ============================================================
   VPN Panel v2 — Dark Theme (x-ui style, enhanced edition)
   Bootstrap 5.3 RTL + custom components
   ============================================================ */

:root {
  --bg-body:      #080c18;
  --bg-card:      #0f1623;
  --bg-sidebar:   #0b0f1d;
  --bg-input:     #141c2e;
  --bg-hover:     rgba(255,255,255,0.035);
  --border:       rgba(51,65,85,0.5);
  --border-light: rgba(51,65,85,0.25);
  --text-primary: #f1f5f9;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;
  --cyan:         #06b6d4;
  --blue:         #3b82f6;
  --green:        #22c55e;
  --amber:        #f59e0b;
  --red:          #ef4444;
  --gradient:         linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-btn:     linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-amber:   linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-red:     linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --sidebar-w:    260px;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-xs:    7px;
  --shadow-card:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:  0 0 40px rgba(6,182,212,0.07);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(6,182,212,0.1);
}

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

html, body {
  direction: rtl;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Segoe UI', Tahoma, 'IRANSans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #38bdf8; }

/* ── Background mesh ────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(6,182,212,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(59,130,246,0.04) 0%, transparent 60%);
  z-index: 0;
}

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(6,182,212,0.05) 0%, transparent 100%);
}

.sidebar-logo {
  width: 42px; height: 42px;
  background: var(--gradient);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(6,182,212,0.35);
}

.sidebar-title    { font-weight: 700; font-size: 15px; color: var(--text-primary); line-height: 1.2; }
.sidebar-subtitle { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

.sidebar-nav { padding: 10px 8px; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .18s;
  position: relative;
  overflow: hidden;
}
.sidebar-link i { font-size: 16px; flex-shrink: 0; transition: transform .2s; }
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.sidebar-link:hover i { transform: scale(1.1); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(6,182,212,.15) 0%, rgba(59,130,246,.08) 100%);
  color: var(--cyan);
  border: 1px solid rgba(6,182,212,.18);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--gradient);
  border-radius: 3px 0 0 3px;
}

.sidebar-badge {
  margin-right: auto;
  background: var(--gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  animation: badge-pulse 2s infinite;
}
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(6,182,212,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(6,182,212,0); }
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 8px 12px 4px;
}

.sidebar-footer {
  padding: 10px 8px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: border-color .2s;
}
.sidebar-user:hover { border-color: rgba(6,182,212,.2); }

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(6,182,212,.3);
}

.sidebar-username { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.sidebar-balance  { font-size: 11px; color: var(--cyan); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  background: none;
  border: none;
  width: 100%;
  text-align: right;
}
.sidebar-logout:hover { color: #f87171; background: rgba(239,68,68,.07); }
.sidebar-logout i { font-size: 15px; }

/* ── Main Layout ────────────────────────────────── */
.main-wrapper {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-topbar .toggle-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: all .15s;
}
.mobile-topbar .toggle-btn:hover { color: var(--text-primary); background: rgba(255,255,255,.1); }

.page-content { padding: 24px; flex: 1; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1039;
  backdrop-filter: blur(4px);
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); box-shadow: -12px 0 50px rgba(0,0,0,.6); }
  .sidebar-overlay.open { display: block; }
  .main-wrapper { margin-right: 0; }
  .mobile-topbar { display: flex; }
  .page-content { padding: 16px; }
}

/* ── Cards ──────────────────────────────────────── */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255,255,255,.02) 0%, transparent 100%);
}

.card-panel-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-panel-header h2 i { color: var(--cyan); font-size: 16px; }

.card-panel-body { padding: 20px; }

/* Glow card variant */
.card-glow {
  position: relative;
  overflow: hidden;
}
.card-glow::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient);
  opacity: 0.5;
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .22s, border-color .22s, box-shadow .22s;
  display: block;
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .22s;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6,182,212,.25);
  box-shadow: var(--shadow-hover);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  transition: transform .2s;
}
.stat-card:hover .stat-value { transform: scale(1.04); }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.stat-change {
  font-size: 11.5px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up   { color: #4ade80; }
.stat-change.down { color: #f87171; }

.icon-cyan    { background: rgba(6,182,212,.12);   color: var(--cyan);   border: 1px solid rgba(6,182,212,.2);  }
.icon-blue    { background: rgba(59,130,246,.12);  color: #60a5fa;       border: 1px solid rgba(59,130,246,.2); }
.icon-green   { background: rgba(34,197,94,.12);   color: #4ade80;       border: 1px solid rgba(34,197,94,.2);  }
.icon-amber   { background: rgba(245,158,11,.12);  color: #fbbf24;       border: 1px solid rgba(245,158,11,.2); }
.icon-red     { background: rgba(239,68,68,.12);   color: #f87171;       border: 1px solid rgba(239,68,68,.2);  }
.icon-purple  { background: rgba(168,85,247,.12);  color: #c084fc;       border: 1px solid rgba(168,85,247,.2); }
.icon-teal    { background: rgba(20,184,166,.12);  color: #2dd4bf;       border: 1px solid rgba(20,184,166,.2); }

/* Balance hero card */
.balance-hero {
  background: linear-gradient(135deg,
    rgba(6,182,212,.12) 0%,
    rgba(59,130,246,.08) 50%,
    rgba(168,85,247,.05) 100%);
  border: 1px solid rgba(6,182,212,.2);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.balance-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(6,182,212,.06);
  pointer-events: none;
}
.balance-value {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.balance-value span { color: var(--cyan); font-size: 2rem; }

/* Chart containers */
.chart-wrap {
  position: relative;
  padding: 16px 20px 20px;
  min-height: 260px;
}
.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Tables ─────────────────────────────────────── */
.table-panel { overflow-x: auto; }

.vpn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.vpn-table thead th {
  background: rgba(255,255,255,.025);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .05em;
  padding: 11px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  text-align: right;
  text-transform: uppercase;
}
.vpn-table thead th.check-col {
  width: 42px;
  text-align: center;
}

.vpn-table tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(51,65,85,.25);
  vertical-align: middle;
}

.vpn-table tbody tr {
  transition: background .12s;
}
.vpn-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.vpn-table tbody tr:last-child td { border-bottom: none; }
.vpn-table tbody tr.selected td { background: rgba(6,182,212,.06); }

/* Checkbox col */
.vpn-table .row-check {
  width: 16px; height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
}

/* Batch action bar */
.batch-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(6,182,212,.08);
  border-bottom: 1px solid rgba(6,182,212,.2);
  flex-wrap: wrap;
}
.batch-bar.visible { display: flex; }
.batch-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
}

/* ── Config type badges ──────────────────────────── */
.badge-type {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid;
  white-space: nowrap;
}
.badge-vmess       { color: #60a5fa; background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.2);  }
.badge-vless       { color: var(--cyan); background: rgba(6,182,212,.1);  border-color: rgba(6,182,212,.2);   }
.badge-trojan      { color: #c084fc; background: rgba(168,85,247,.1);  border-color: rgba(168,85,247,.2);  }
.badge-shadowsocks { color: #4ade80; background: rgba(34,197,94,.1);   border-color: rgba(34,197,94,.2);   }
.badge-hysteria2   { color: #fbbf24; background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.2);  }
.badge-reality     { color: #f472b6; background: rgba(236,72,153,.1);  border-color: rgba(236,72,153,.2);  }
.badge-other       { color: var(--text-muted); background: rgba(100,116,139,.1); border-color: rgba(100,116,139,.2); }

/* Location badge */
.badge-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(20,184,166,.1);
  border: 1px solid rgba(20,184,166,.2);
  color: #2dd4bf;
  white-space: nowrap;
}

/* Tag badge */
.badge-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Status badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.status-pending  { color: #fbbf24; background: rgba(245,158,11,.1);   border-color: rgba(245,158,11,.25);  }
.status-approved { color: #4ade80; background: rgba(34,197,94,.1);    border-color: rgba(34,197,94,.25);   }
.status-rejected { color: #f87171; background: rgba(239,68,68,.1);    border-color: rgba(239,68,68,.25);   }
.status-active   { color: #4ade80; background: rgba(34,197,94,.1);    border-color: rgba(34,197,94,.25);   }
.status-inactive { color: #f87171; background: rgba(239,68,68,.1);    border-color: rgba(239,68,68,.25);   }
.status-expired  { color: #f87171; background: rgba(239,68,68,.1);    border-color: rgba(239,68,68,.25);   }
.status-available { color: #4ade80; background: rgba(34,197,94,.1);   border-color: rgba(34,197,94,.25);   }
.status-unavail  { color: #94a3b8; background: rgba(100,116,139,.1);  border-color: rgba(100,116,139,.2);  }

/* Star quality rating */
.stars {
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: 1px;
}
.stars .empty { color: rgba(255,255,255,.15); }

/* ── Buttons ────────────────────────────────────── */
.btn-grad {
  background: var(--gradient-btn);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(6,182,212,.22);
  text-decoration: none !important;
}
.btn-grad:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 7px 22px rgba(6,182,212,.32); }
.btn-grad:active { transform: translateY(0); }
.btn-grad:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-grad.sm { padding: 6px 14px; font-size: 12.5px; }
.btn-grad.w-100 { justify-content: center; }

.btn-ghost {
  background: rgba(255,255,255,.055);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
}
.btn-ghost:hover { background: rgba(255,255,255,.09); color: var(--text-primary); border-color: rgba(255,255,255,.18); }
.btn-ghost.sm { padding: 6px 12px; font-size: 12px; }

.btn-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all .15s;
  background: rgba(255,255,255,.055);
  color: var(--text-muted);
  flex-shrink: 0;
}
.btn-icon:hover          { background: rgba(255,255,255,.12); color: var(--text-primary); }
.btn-icon.danger:hover   { background: rgba(239,68,68,.14);   color: #f87171; }
.btn-icon.cyan:hover     { background: rgba(6,182,212,.14);   color: var(--cyan); }
.btn-icon.green:hover    { background: rgba(34,197,94,.14);   color: #4ade80; }
.btn-icon.amber:hover    { background: rgba(245,158,11,.14);  color: #fbbf24; }
.btn-icon.active-fav     { color: #fbbf24 !important; background: rgba(245,158,11,.12); }

.btn-approve {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.22);
  color: #4ade80;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-approve:hover { background: rgba(34,197,94,.2); }

.btn-reject {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.22);
  color: #f87171;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-reject:hover { background: rgba(239,68,68,.16); }

/* ── Forms ──────────────────────────────────────── */
.form-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; letter-spacing: .02em; }

.form-control, .form-select {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 9px 14px !important;
  font-size: 13.5px;
  transition: border-color .18s, box-shadow .18s !important;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(6,182,212,.45) !important;
  box-shadow: 0 0 0 3px rgba(6,182,212,.08) !important;
  outline: none !important;
}
.form-control::placeholder { color: var(--text-dim) !important; }
.form-select option { background: #1a2235; color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-check-input[type=checkbox] {
  background-color: #334155 !important;
  border-color: #475569 !important;
  width: 40px; height: 22px;
  border-radius: 12px !important;
  cursor: pointer;
  transition: all .18s;
}
.form-check-input[type=checkbox]:checked {
  background-color: var(--cyan) !important;
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 3px rgba(6,182,212,.2) !important;
}

.search-wrap { position: relative; }
.search-wrap .form-control { padding-right: 40px !important; }
.search-wrap .search-icon {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
  pointer-events: none;
}

/* Star rating input */
.star-rating {
  display: flex;
  gap: 4px;
  align-items: center;
}
.star-rating input[type=radio] { display: none; }
.star-rating label {
  font-size: 20px;
  color: rgba(255,255,255,.15);
  cursor: pointer;
  transition: color .15s, transform .15s;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #f59e0b;
}
.star-rating label:hover { transform: scale(1.2); }

/* ── Modals ──────────────────────────────────────── */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 25px 60px rgba(0,0,0,.6) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 16px 20px !important;
  background: linear-gradient(180deg, rgba(6,182,212,.04) 0%, transparent 100%);
}
.modal-header .modal-title { font-size: 15px; font-weight: 600; }
.btn-close { filter: invert(1) !important; opacity: .5 !important; }
.btn-close:hover { opacity: 1 !important; }
.modal-body  { padding: 20px !important; }
.modal-footer { border-top: 1px solid var(--border) !important; padding: 14px 20px !important; }

/* ── Alerts (Flash) ──────────────────────────────── */
.alert {
  border-radius: var(--radius-sm) !important;
  font-size: 13.5px;
  border-left: none !important;
  animation: alert-in .3s ease;
}
@keyframes alert-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert-success {
  background: rgba(34,197,94,.08) !important;
  border: 1px solid rgba(34,197,94,.25) !important;
  color: #4ade80 !important;
}
.alert-danger {
  background: rgba(239,68,68,.08) !important;
  border: 1px solid rgba(239,68,68,.25) !important;
  color: #f87171 !important;
}
.alert-warning {
  background: rgba(245,158,11,.08) !important;
  border: 1px solid rgba(245,158,11,.25) !important;
  color: #fbbf24 !important;
}
.btn-close-white { filter: invert(1); }

/* ── Toast notifications ─────────────────────────── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: all;
  animation: toast-in .3s cubic-bezier(.34,1.56,.64,1);
  min-width: 240px;
  max-width: 360px;
}
.toast-msg.removing { animation: toast-out .25s ease forwards; }
.toast-msg.success { border-color: rgba(34,197,94,.3); }
.toast-msg.success .toast-icon { color: #4ade80; }
.toast-msg.error   { border-color: rgba(239,68,68,.3); }
.toast-msg.error   .toast-icon { color: #f87171; }
.toast-msg.info    { border-color: rgba(6,182,212,.3); }
.toast-msg.info    .toast-icon { color: var(--cyan); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  to   { opacity: 0; transform: translateX(-12px) scale(0.96); }
}

/* ── Filter tabs ─────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: all .18s;
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: 0 2px 10px rgba(6,182,212,.22);
}
.filter-tab .tab-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.15);
  padding: 1px 6px;
  border-radius: 10px;
  margin-right: 5px;
}
.filter-tab.active .tab-count {
  background: rgba(255,255,255,.25);
}

/* ── Config cards (seller) ───────────────────────── */
.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: border-color .22s, box-shadow .22s, transform .22s;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.config-card:hover {
  border-color: rgba(6,182,212,.28);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.config-card.claimed  { border-color: rgba(34,197,94,.25); }
.config-card.full     { opacity: .5; pointer-events: none; }
.config-card.favorited { border-color: rgba(245,158,11,.25); }

.config-card-top-bar {
  height: 3px;
  background: var(--gradient);
  width: 0;
  transition: width .4s;
}
.config-card:hover .config-card-top-bar { width: 100%; }

.config-card-body { padding: 18px; flex: 1; }
.config-card-footer {
  border-top: 1px solid var(--border);
  display: flex;
}
.config-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  border: none;
  background: none;
  color: var(--text-muted);
}
.config-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.config-action-btn.claim {
  background: var(--gradient-btn);
  color: #fff;
}
.config-action-btn.claim:hover { opacity: .88; }
.config-action-btn.claimed { color: #4ade80; cursor: default; }
.config-action-btn.no-balance { color: #f87171; cursor: not-allowed; }
.config-action-btn.full-cap { color: var(--text-dim); cursor: not-allowed; }

.config-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}
.config-meta-item {
  background: rgba(255,255,255,.035);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.config-meta-item i { font-size: 11px; color: var(--text-dim); display: block; margin-bottom: 3px; }
.config-meta-value  { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.config-meta-label  { font-size: 10px; color: var(--text-dim); margin-top: 1px; }

.capacity-bar {
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}
.capacity-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 4px;
  transition: width .5s ease;
}
.capacity-fill.warn { background: var(--gradient-amber); }
.capacity-fill.full { background: var(--gradient-red); }

/* ── Notification items ──────────────────────────── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(51,65,85,.25);
  transition: background .15s;
  cursor: default;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread {
  border-right: 3px solid var(--cyan);
  background: rgba(6,182,212,.035);
  cursor: pointer;
}

.notif-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.notif-icon.unread { background: rgba(6,182,212,.14); color: var(--cyan); }
.notif-icon.read   { background: rgba(255,255,255,.04); color: var(--text-dim); }

.notif-title   { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.notif-body    { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.notif-time    { font-size: 11px; color: var(--text-dim); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.unread-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
  margin-top: 6px;
  animation: pulse-dot 2.5s infinite;
  box-shadow: 0 0 6px rgba(6,182,212,.5);
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(6,182,212,.4); }
  50%      { opacity: .7; transform: scale(.9); box-shadow: 0 0 0 4px rgba(6,182,212,0); }
}

/* ── Charge cards ────────────────────────────────── */
.charge-amount { font-size: 2rem; font-weight: 700; color: var(--cyan); line-height: 1; }
.charge-unit   { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ── Code block ──────────────────────────────────── */
.config-code {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Courier New', 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #7dd3fc;
  word-break: break-all;
  max-height: 60px;
  overflow: hidden;
  position: relative;
}
.config-code::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,.35));
}

/* ── Page header ─────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -.02em;
}
.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 5px 0 0;
}

/* ── Activity log ────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(51,65,85,.2);
  transition: background .12s;
}
.activity-item:hover { background: var(--bg-hover); }
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-action { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.activity-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.activity-meta   { font-size: 11px; color: var(--text-dim); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Profile card ────────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, rgba(6,182,212,.1) 0%, rgba(59,130,246,.07) 100%);
  border: 1px solid rgba(6,182,212,.2);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(6,182,212,.35);
}
.profile-stat {
  text-align: center;
  padding: 12px 20px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.profile-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.profile-stat-label { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* ── Misc ────────────────────────────────────────── */
.text-cyan   { color: var(--cyan) !important; }
.text-dim    { color: var(--text-dim) !important; }
.text-muted2 { color: var(--text-muted) !important; }

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-dim);
}
.empty-state i { font-size: 44px; display: block; margin-bottom: 14px; opacity: .3; }
.empty-state p { font-size: 14px; }

.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.divider-v {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* Warning / expiry banner */
.expiry-banner {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #fbbf24;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-info { font-size: 12.5px; color: var(--text-dim); }
.pagination { gap: 4px; }
.page-link {
  background: rgba(255,255,255,.04) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  border-radius: 8px !important;
  padding: 5px 12px !important;
  font-size: 13px !important;
  transition: all .15s !important;
}
.page-link:hover { background: rgba(255,255,255,.09) !important; color: var(--text-primary) !important; }
.page-item.active .page-link {
  background: var(--gradient-btn) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(6,182,212,.25) !important;
}
.page-item.disabled .page-link { opacity: .4 !important; }

/* Progress bar */
.prog-bar { height: 5px; background: rgba(255,255,255,.07); border-radius: 5px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--gradient); border-radius: 5px; transition: width .5s; }

/* Number animate */
.num-animate { transition: all .5s; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 575px) {
  .page-content { padding: 12px; }
  .card-panel-header { flex-direction: column; align-items: flex-start; }
  .filter-tabs { overflow-x: auto; }
  .batch-bar { flex-direction: column; align-items: flex-start; }
  .balance-value { font-size: 2.2rem; }
}

/* Bootstrap overrides */
.dropdown-menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,.4) !important;
}
.dropdown-item { color: var(--text-muted) !important; font-size: 13px; padding: 9px 16px !important; }
.dropdown-item:hover { background: var(--bg-hover) !important; color: var(--text-primary) !important; }
.dropdown-divider { border-color: var(--border) !important; }

.tooltip-inner { background: #1e293b; font-size: 12px; border: 1px solid var(--border); }
.tooltip-arrow::before { border-top-color: var(--border) !important; }

/* Input group */
.input-group .form-control { border-radius: var(--radius-sm) !important; }
.input-group .btn { border-radius: var(--radius-sm) !important; }

/* Fade in animation for page content */
.page-content { animation: page-in .25s ease; }
@keyframes page-in {
  from { opacity: .7; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
