/* ─── MwPay Portal Stylesheet ─────────────────────────────────────────────────
   Pure CSS, no build step, no CDN dependency.
   Color palette mirrors Tailwind slate/indigo/emerald/amber/red.
───────────────────────────────────────────────────────────────────────────── */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --c-slate-50:  #f8fafc; --c-slate-100: #f1f5f9; --c-slate-200: #e2e8f0;
  --c-slate-300: #cbd5e1; --c-slate-400: #94a3b8; --c-slate-500: #64748b;
  --c-slate-600: #475569; --c-slate-700: #334155; --c-slate-800: #1e293b;
  --c-slate-900: #0f172a; --c-slate-950: #020617;

  --c-indigo-300: #a5b4fc; --c-indigo-400: #818cf8; --c-indigo-500: #6366f1;
  --c-indigo-600: #4f46e5; --c-indigo-700: #4338ca; --c-indigo-800: #3730a3;
  --c-indigo-900: #312e81; --c-indigo-950: #1e1b4b;

  --c-emerald-300: #6ee7b7; --c-emerald-400: #34d399; --c-emerald-500: #10b981;
  --c-emerald-600: #059669; --c-emerald-700: #047857; --c-emerald-900: #064e3b;
  --c-emerald-950: #022c22;

  --c-amber-400: #fbbf24; --c-amber-500: #f59e0b; --c-amber-900: #78350f;

  --c-red-300: #fca5a5; --c-red-400: #f87171; --c-red-500: #ef4444;
  --c-red-600: #dc2626; --c-red-700: #b91c1c; --c-red-900: #7f1d1d;
  --c-red-950: #450a0a;

  --c-violet-300: #c4b5fd; --c-violet-400: #a78bfa; --c-violet-900: #4c1d95;
  --c-rose-500: #f43f5e;
  --c-blue-400: #60a5fa; --c-blue-900: #1e3a8a;
  --c-cyan-400: #22d3ee; --c-cyan-900: #164e63;
  --c-purple-400: #c084fc; --c-purple-900: #581c87;

  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-2xl: 20px; --radius-full: 9999px;
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.5), 0 8px 10px -6px rgba(0,0,0,.4);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,.7);
  --transition: 150ms ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { height: 100%; font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; background: var(--c-slate-900); color: #fff; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: transparent; font-family: inherit; }
input, select, textarea { font-family: inherit; }
table { border-collapse: collapse; width: 100%; }
svg { display: block; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-slate-700); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-slate-600); }

/* ── Alpine cloak ───────────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════════════ */
.portal-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--c-slate-800);
  border-right: 1px solid rgba(51,65,85,.6);
  box-shadow: var(--shadow-2xl);
  flex-shrink: 0;
  width: 240px;
  transition: width .2s ease;
  position: relative;
  z-index: 20;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(51,65,85,.6);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--c-indigo-600);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.sidebar-brand-name { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-brand-name p:first-child { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-brand-name p:last-child  { font-size: 10px; color: var(--c-slate-400); text-transform: capitalize; }

/* ── Sidebar nav ────────────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
  display: flex; flex-direction: column;
}
.sidebar-nav-inner { padding: 0 8px; }
.nav-item-wrap { display: block; width: 100%; }

.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-slate-600);
  padding: 12px 6px 4px;
  display: flex; align-items: center; gap: 6px;
}
.nav-section::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(71,85,105,.4); display: block;
}

.nav-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--c-slate-400);
  border-left: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: rgba(99,102,241,.1); color: var(--c-slate-200); border-left-color: rgba(99,102,241,.4); }
.nav-link.active { background: rgba(99,102,241,.18); color: #fff; border-left-color: var(--c-indigo-500); font-weight: 600; }
.nav-link i { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; }
.nav-link .badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); line-height: 1.4; flex-shrink: 0; }
.badge-amber { background: var(--c-amber-500); color: #111; }
.badge-rose  { background: var(--c-rose-500); color: #fff; }


/* ── System status widget ───────────────────────────────────────────────── */
.sys-widget {
  margin: 12px 8px 0;
  border-radius: var(--radius);
  background: rgba(15,23,42,.6);
  border: 1px solid rgba(51,65,85,.5);
  padding: 12px;
}
.sys-widget-title { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-slate-600); margin-bottom: 8px; }
.sys-row { display: flex; align-items: center; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }
.sys-row:last-child { margin-bottom: 0; }
.sys-label { color: var(--c-slate-500); display: flex; align-items: center; gap: 5px; }
.sys-dot         { width: 6px; height: 6px; border-radius: var(--radius-full); display: inline-block; flex-shrink: 0; }
.sys-dot-ok      { background: var(--c-emerald-400); }
.sys-dot-warn    { background: #f59e0b; }
.sys-dot-err     { background: #f87171; }
.sys-dot-loading { background: var(--c-slate-600); animation: pulse-dot 1.4s ease-in-out infinite; }

.sys-status          { font-weight: 500; }
.sys-status-ok       { color: var(--c-emerald-400); }
.sys-status-warn     { color: #f59e0b; }
.sys-status-err      { color: #f87171; }
.sys-status-loading  { color: var(--c-slate-600); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── Sidebar footer ─────────────────────────────────────────────────────── */
.sidebar-footer {
  border-top: 1px solid rgba(51,65,85,.6);
  padding: 12px;
  flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--c-indigo-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.avatar-dot {
  position: absolute; bottom: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--c-emerald-400); border-radius: var(--radius-full);
  border: 2px solid var(--c-slate-800);
}
.user-meta { flex: 1; min-width: 0; overflow: hidden; }
.user-meta-name  { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta-email { font-size: 10px; color: var(--c-slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.role-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.role-sa { background: rgba(109,40,217,.4); color: var(--c-violet-300); }
.role-ow { background: rgba(67,56,202,.4); color: var(--c-indigo-300); }
.role-ad { background: rgba(14,116,144,.4); color: var(--c-cyan-400); }
.role-vw { background: rgba(51,65,85,.6); color: var(--c-slate-400); }
.icon-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-slate-500); transition: color var(--transition), background var(--transition);
}
.icon-btn:hover { color: #f87171; background: rgba(239,68,68,.15); }
.icon-btn i { font-size: 12px; }

/* ── Main area ──────────────────────────────────────────────────────────── */
.main-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; background: var(--c-slate-900); }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--c-slate-800);
  border-bottom: 1px solid rgba(51,65,85,.6);
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.breadcrumb-sep { color: var(--c-slate-600); font-size: 9px; }
.breadcrumb-root { color: var(--c-slate-500); }
.breadcrumb-page { color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.client-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-indigo-950); border: 1px solid var(--c-indigo-800);
  color: var(--c-indigo-300); font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: var(--radius);
}
.clock { color: var(--c-slate-500); font-size: 12px; }

/* ── Page content ───────────────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   FLASH MESSAGES
═══════════════════════════════════════════════════════════════════════════ */
.flash { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-xl); font-size: 14px; margin: 16px 24px 0; }
.flash-success { background: var(--c-emerald-950); border: 1px solid var(--c-emerald-700); color: var(--c-emerald-300); }
.flash-error   { background: var(--c-red-950);     border: 1px solid var(--c-red-700);     color: var(--c-red-300); }
.flash i { flex-shrink: 0; }
.flash-close { margin-left: auto; background: transparent; border: none; font-size: 12px; cursor: pointer; opacity: .6; transition: opacity var(--transition); color: inherit; }
.flash-close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS & PANELS
═══════════════════════════════════════════════════════════════════════════ */
.card { background: var(--c-slate-800); border: 1px solid var(--c-slate-700); border-radius: var(--radius-xl); overflow: hidden; }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--c-slate-700); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 14px; font-weight: 600; color: #fff; }
.card-body { padding: 24px; }

/* ── Stat cards ─────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--c-slate-800); border-radius: var(--radius-xl); padding: 20px; border: 1px solid var(--c-slate-700); }
.stat-card.green  { border-color: rgba(4,120,87,.5); }
.stat-card.amber  { border-color: rgba(120,53,15,.5); }
.stat-card.red    { border-color: rgba(127,29,29,.5); }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--c-slate-400); }
.stat-card.green .stat-label { color: var(--c-emerald-400); }
.stat-card.amber .stat-label { color: var(--c-amber-400); }
.stat-card.red   .stat-label { color: #f87171; }
.stat-value { font-size: 30px; font-weight: 700; color: #fff; margin-top: 8px; line-height: 1; }
.stat-card.green .stat-value { color: var(--c-emerald-400); }
.stat-card.amber .stat-value { color: var(--c-amber-400); }
.stat-card.red   .stat-value { color: #f87171; }
.stat-sub { font-size: 11px; color: var(--c-slate-500); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; font-size: 13px; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--c-slate-700); background: rgba(30,41,59,.8); }
thead th { padding: 10px 20px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-slate-400); white-space: nowrap; }
tbody tr { border-bottom: 1px solid rgba(51,65,85,.5); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(51,65,85,.3); }
tbody td { padding: 14px 20px; color: var(--c-slate-300); vertical-align: middle; }
tbody td.mono { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 12px; }
tbody td.strong { color: #fff; font-weight: 600; }
.empty-row td { text-align: center; padding: 48px; color: var(--c-slate-500); }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES / STATUS PILLS
═══════════════════════════════════════════════════════════════════════════ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.pill-green   { background: rgba(6,78,59,.7);  color: var(--c-emerald-400); }
.pill-amber   { background: rgba(120,53,15,.7); color: var(--c-amber-400); }
.pill-red     { background: rgba(127,29,29,.6); color: #f87171; }
.pill-blue    { background: rgba(30,58,138,.7); color: var(--c-blue-400); }
.pill-violet  { background: rgba(76,29,149,.6); color: var(--c-violet-300); }
.pill-slate   { background: rgba(51,65,85,.6);  color: var(--c-slate-300); }
.pill-purple  { background: rgba(88,28,135,.6); color: var(--c-purple-400); }
.pill-cyan    { background: rgba(22,78,99,.6);  color: var(--c-cyan-400); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary   { background: var(--c-indigo-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--c-indigo-500); }

.btn-secondary { background: var(--c-slate-700); color: var(--c-slate-200); border-color: var(--c-slate-600); }
.btn-secondary:hover:not(:disabled) { background: var(--c-slate-600); color: #fff; }

.btn-danger    { background: rgba(127,29,29,.5); color: #f87171; border-color: rgba(220,38,38,.3); }
.btn-danger:hover:not(:disabled)  { background: rgba(127,29,29,.8); }

.btn-success   { background: rgba(6,78,59,.5); color: var(--c-emerald-400); border-color: rgba(4,120,87,.3); }
.btn-success:hover:not(:disabled) { background: rgba(6,78,59,.9); }

.btn-amber { background: var(--c-amber-500); color: #111; font-weight: 700; }
.btn-amber:hover:not(:disabled) { background: var(--c-amber-400); }

.btn-outline-amber { background: transparent; color: var(--c-amber-400); border-color: rgba(217,119,6,.5); font-size: 12px; padding: 5px 12px; }
.btn-outline-amber:hover { background: rgba(245,158,11,.1); border-color: var(--c-amber-400); }

.btn-outline-red { background: transparent; color: #f87171; border-color: rgba(220,38,38,.5); font-size: 12px; padding: 5px 12px; }
.btn-outline-red:hover { background: rgba(239,68,68,.1); border-color: #f87171; }

.btn-ghost-red { background: transparent; color: #f87171; border: none; font-size: 12px; padding: 0; }
.btn-ghost-red:hover { color: #fca5a5; }

.btn-ghost-green { background: transparent; color: var(--c-emerald-400); border: none; font-size: 12px; padding: 0; }
.btn-ghost-green:hover { color: var(--c-emerald-300); }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn-full { width: 100%; }
.btn-icon { width: 28px; height: 28px; padding: 0; border-radius: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--c-slate-300); }
.form-label-xs { font-size: 11px; color: var(--c-slate-400); }
.form-control {
  background: var(--c-slate-700); border: 1px solid var(--c-slate-600);
  color: #fff; border-radius: var(--radius); padding: 8px 12px;
  font-size: 13px; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--c-slate-500); }
.form-control:focus { outline: none; border-color: var(--c-indigo-500); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.form-control-sm { padding: 6px 10px; font-size: 12px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-error { font-size: 11px; color: #f87171; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTERS BAR
═══════════════════════════════════════════════════════════════════════════ */
.filter-bar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding: 14px 20px; border-bottom: 1px solid var(--c-slate-700); }
.filter-input { max-width: 260px; }
.filter-select { max-width: 160px; }
.filter-count { margin-left: auto; font-size: 13px; color: var(--c-slate-400); white-space: nowrap; }
.filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-reset { font-size: 13px; color: var(--c-slate-400); padding: 6px 0; transition: color var(--transition); }
.filter-reset:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.modal-wrap {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none;
}
.modal {
  background: var(--c-slate-800); border: 1px solid var(--c-slate-600);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow-2xl);
  width: 100%; max-width: 440px; pointer-events: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--c-slate-700);
}
.modal-title-wrap { display: flex; align-items: center; gap: 12px; }
.modal-icon {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: rgba(245,158,11,.15);
  display: flex; align-items: center; justify-content: center;
}
.modal-title { font-size: 17px; font-weight: 600; color: #fff; }
.modal-close { color: var(--c-slate-400); transition: color var(--transition); background: transparent; border: none; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 0 24px 24px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-desc { font-size: 13px; color: var(--c-slate-300); line-height: 1.6; }
.modal-details {
  background: rgba(15,23,42,.7); border-radius: var(--radius-lg);
  border: 1px solid var(--c-slate-700); overflow: hidden;
}
.modal-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid rgba(51,65,85,.6); font-size: 13px;
}
.modal-detail-row:last-child { border-bottom: none; }
.modal-detail-label { color: var(--c-slate-400); }
.modal-detail-value { color: #fff; font-weight: 500; font-family: ui-monospace, monospace; }
.modal-detail-value.green { color: var(--c-emerald-400); }
.modal-warn {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius);
  background: rgba(127,29,29,.2); border: 1px solid rgba(220,38,38,.3);
}
.modal-warn p { font-size: 12px; color: #fca5a5; line-height: 1.5; }
.modal-hint { font-size: 11px; color: var(--c-slate-500); }

/* ── hidden modal (non-Alpine version) ─────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }

/* ═══════════════════════════════════════════════════════════════════════════
   CLIENT DETAIL PAGE
═══════════════════════════════════════════════════════════════════════════ */

/* Selector bar */
.cd-selector-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.cd-client-select {
  flex: 1; max-width: 380px; font-size: 14px;
}

/* Empty state */
.cd-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px; text-align: center;
}

/* Full-page form */
.cd-form { display: flex; flex-direction: column; gap: 20px; }

/* Client header */
.cd-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  background: var(--c-slate-800); border: 1px solid var(--c-slate-700);
  border-radius: var(--radius-xl); padding: 20px 24px;
}
.cd-header-left { display: flex; align-items: center; gap: 16px; }
.cd-avatar {
  width: 52px; height: 52px; border-radius: var(--radius-lg); flex-shrink: 0;
  background: var(--c-indigo-600);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 20px;
}
.cd-title   { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; }
.cd-subtitle { font-size: 12px; color: var(--c-slate-500); margin-top: 2px; }
.cd-header-stats { display: flex; gap: 32px; }
.cd-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cd-stat-val { font-size: 20px; font-weight: 700; color: #fff; line-height: 1; }
.cd-stat-lbl { font-size: 11px; color: var(--c-slate-500); text-transform: uppercase; letter-spacing: .04em; }

/* 2-column grid */
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cd-grid { grid-template-columns: 1fr; } }
.cd-col { display: flex; flex-direction: column; gap: 16px; }

/* Section panels */
.cd-section {
  background: var(--c-slate-800); border: 1px solid var(--c-slate-700);
  border-radius: var(--radius-xl); padding: 20px 22px;
}
.cd-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--c-slate-500); margin-bottom: 14px;
}

/* Shared between card and detail */
.client-save-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.form-hint-inline { font-size: 12px; color: var(--c-emerald-400); font-weight: 500; }
.client-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-slate-500); }
.ip-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ip-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--c-slate-700); color: var(--c-slate-300);
  font-family: ui-monospace, monospace; font-size: 11px;
  padding: 2px 8px; border-radius: 4px;
}
.ip-tag-remove { color: var(--c-slate-400); background: none; border: none; cursor: pointer; line-height: 1; font-size: 11px; transition: color var(--transition); }
.ip-tag-remove:hover { color: #f87171; }
.ip-none { color: var(--c-slate-500); font-size: 11px; }
.webhook-url-box {
  background: var(--c-slate-900); border-radius: var(--radius); padding: 10px 12px;
  font-family: ui-monospace, monospace; font-size: 11px; color: var(--c-indigo-400);
  word-break: break-all;
}
.webhook-url-label { color: var(--c-slate-500); display: block; margin-bottom: 3px; font-size: 10px; }
.client-actions { display: flex; flex-direction: column; gap: 8px; }
.client-actions form { flex: 1; }
.client-actions .btn { width: 100%; }
.form-hint { font-size: 11px; color: var(--c-emerald-400); margin-top: 6px; }
.form-err  { font-size: 11px; color: #f87171; margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: var(--radius); font-size: 13px;
  color: var(--c-slate-400); background: transparent;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.page-link:hover { background: rgba(99,102,241,.1); color: var(--c-slate-200); }
.page-link.active { background: var(--c-indigo-600); color: #fff; border-color: var(--c-indigo-600); font-weight: 600; }
.page-link.disabled { opacity: .35; pointer-events: none; }
.page-wrap { padding: 12px 20px; border-top: 1px solid var(--c-slate-700); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--c-slate-900); padding: 16px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: var(--c-indigo-600); border-radius: 20px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(79,70,229,.4);
}
.login-title { font-size: 22px; font-weight: 700; color: #fff; }
.login-sub   { font-size: 13px; color: var(--c-slate-400); margin-top: 4px; }
.login-card  { background: var(--c-slate-800); border-radius: var(--radius-2xl); padding: 32px; border: 1px solid var(--c-slate-700); box-shadow: var(--shadow-2xl); }
.login-alert { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius); font-size: 13px; background: rgba(127,29,29,.5); border: 1px solid var(--c-red-600); color: var(--c-red-300); }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
.spin  { animation: spin 1s linear infinite; }
.pulse { animation: pulse 2s ease-in-out infinite; }

/* Alpine transitions */
.fade-enter { opacity: 0; }
.fade-leave { opacity: 0; }
[x-transition\:enter]  { transition: opacity .2s ease, transform .2s ease; }
[x-transition\:leave]  { transition: opacity .15s ease, transform .15s ease; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════════════════════ */
.flex   { display: flex; }
.inline-flex { display: inline-flex; }
.grid   { display: grid; }
.block  { display: block; }
.hidden { display: none !important; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.justify-center { justify-content: center; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1    { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1  { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4  { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-4 > * + * { margin-top: 16px; }
.text-xs  { font-size: 11px; } .text-sm { font-size: 13px; } .text-base { font-size: 15px; }
.text-lg  { font-size: 17px; } .text-xl  { font-size: 19px; } .text-2xl { font-size: 24px; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-white   { color: #fff; }
.text-slate-300 { color: var(--c-slate-300); }
.text-slate-400 { color: var(--c-slate-400); }
.text-slate-500 { color: var(--c-slate-500); }
.text-indigo-400 { color: var(--c-indigo-400); }
.text-emerald-400 { color: var(--c-emerald-400); }
.text-amber-400 { color: var(--c-amber-400); }
.text-red-400   { color: #f87171; }
.text-violet-300 { color: var(--c-violet-300); }
.mono { font-family: ui-monospace, 'Cascadia Code', monospace; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.leading-relaxed { line-height: 1.65; }
.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.overflow-hidden { overflow: hidden; }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }
.border { border: 1px solid var(--c-slate-700); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.w-4 { width: 16px; } .h-4 { height: 16px; }
.w-5 { width: 20px; } .h-5 { height: 20px; }
.transition { transition: all var(--transition); }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.fixed  { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-40 { z-index: 40; } .z-50 { z-index: 50; }
.inline { display: inline; }
.divide-y > * + * { border-top: 1px solid rgba(51,65,85,.5); }

/* ── Key rotation reveal banner ──────────────────────────────────────────── */
.key-reveal-banner {
  margin-bottom: 24px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.key-reveal-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.key-reveal-header strong { color: #fff; font-size: 14px; }
.key-reveal-warn {
  font-size: 12px; color: var(--c-amber-400);
  background: rgba(245,158,11,.12); border-radius: 4px; padding: 2px 8px;
}
.key-reveal-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.key-reveal-code {
  flex: 1; font-family: ui-monospace, monospace; font-size: 13px;
  color: var(--c-emerald-400); background: var(--c-slate-900);
  border: 1px solid var(--c-slate-700); border-radius: var(--radius);
  padding: 8px 12px; word-break: break-all;
}

/* ── client-actions multi-button ─────────────────────────────────────────── */
.client-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── ZainCash Logs page ──────────────────────────────────────────────────── */
.log-row:hover td { background: var(--c-slate-800); }
.log-row-error td { border-left: 3px solid var(--c-rose-500); }
.log-row-error:hover td { background: rgba(244,63,94,.06); }

.log-endpoint {
  font-family: ui-monospace, monospace; font-size: 12px;
  color: var(--c-slate-300); max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.method-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .5px;
  text-transform: uppercase;
}
.method-post   { background: rgba(99,102,241,.2); color: #818cf8; }
.method-get    { background: rgba(16,185,129,.2); color: #34d399; }
.method-patch  { background: rgba(245,158,11,.2); color: #fbbf24; }
.method-delete { background: rgba(244,63,94,.2);  color: #fb7185; }

.status-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}
.status-pill-ok    { background: rgba(16,185,129,.15); color: var(--c-emerald-400); }
.status-pill-error { background: rgba(244,63,94,.15);  color: var(--c-rose-400); }

.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.badge-dot-red { background: var(--c-rose-500); }

.log-detail-row td { padding: 0 !important; }
.log-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--c-slate-700);
  background: var(--c-slate-900);
}
.log-detail-col { padding: 16px 20px; }
.log-detail-col + .log-detail-col { border-left: 1px solid var(--c-slate-700); }
.log-detail-title {
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--c-slate-400); margin-bottom: 8px;
}
.log-pre {
  font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.6;
  color: var(--c-slate-300); white-space: pre-wrap; word-break: break-all;
  max-height: 300px; overflow-y: auto; margin: 0;
  background: var(--c-slate-950, #020617); border: 1px solid var(--c-slate-700);
  border-radius: var(--radius); padding: 12px;
}
