/* InstaPay Verifier — Main Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar: #0f172a;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.14);
}

body { font-family: 'Inter', system-ui, sans-serif; background: #f8fafc; color: #1e293b; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: 240px; background: var(--sidebar); color: #e2e8f0;
  display: flex; flex-direction: column; height: 100vh; flex-shrink: 0;
  position: sticky; top: 0;
}
.sidebar-logo {
  padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo h1 { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.sidebar-logo span { font-size: 11px; color: #64748b; display: block; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-section { font-size: 10px; font-weight: 600; color: #475569; text-transform: uppercase;
  letter-spacing: 0.8px; padding: 12px 8px 4px; }

.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px; color: #94a3b8;
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background 0.12s, color 0.12s; margin-bottom: 1px;
}
.nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-link.active { background: var(--sidebar-active); color: #fff; }
.nav-link .nav-icon { font-size: 15px; width: 20px; text-align: center; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: white; font-size: 10px; font-weight: 700;
  border-radius: 999px; margin-left: auto;
}
.badge:empty { display: none; }

/* WA status */
.wa-status-bar {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 8px;
}
.wa-dot { width: 7px; height: 7px; border-radius: 50%; background: #475569; flex-shrink: 0; }
.wa-dot.connected { background: #4ade80; }
.wa-dot.connecting { background: #fbbf24; }
.wa-dot.disconnected { background: #475569; }
.wa-dot.logged_out, .wa-dot.error { background: #f87171; }
.wa-status-text { font-size: 12px; color: #64748b; }

.sidebar-user {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-user-name { font-size: 13px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.sidebar-user a { font-size: 11px; color: #475569; text-decoration: none; white-space: nowrap; }
.sidebar-user a:hover { color: #94a3b8; }

/* ── Layout ──────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.main-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  padding: 0 24px; height: 52px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 20;
  flex-shrink: 0;
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #64748b; }
.topbar-breadcrumb a { color: #64748b; text-decoration: none; }
.topbar-breadcrumb a:hover { color: #2563eb; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-content { padding: 24px; flex: 1; }

/* ── Pills/Badges ────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.pill-green  { background: #dcfce7; color: #15803d; }
.pill-yellow { background: #fef9c3; color: #854d0e; }
.pill-orange { background: #ffedd5; color: #c2410c; }
.pill-red    { background: #fee2e2; color: #b91c1b; }
.pill-blue   { background: #dbeafe; color: #1d4ed8; }
.pill-gray   { background: #f1f5f9; color: #475569; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: 10px; padding: 20px;
  border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title { font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 16px; }

/* ── KPI Cards ───────────────────────────────────────────────────── */
.kpi-card {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kpi-value { font-size: 26px; font-weight: 700; color: #0f172a; margin-bottom: 2px; letter-spacing: -0.5px; }
.kpi-label { font-size: 12px; color: #64748b; font-weight: 500; }
.kpi-delta { font-size: 11px; margin-top: 6px; }
.kpi-delta.up { color: #16a34a; }
.kpi-delta.down { color: #dc2626; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }

/* ── Tables ──────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #1e293b; color: #e2e8f0; font-size: 11.5px; font-weight: 600;
  padding: 10px 14px; text-align: left; white-space: nowrap; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .td-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: #374151; letter-spacing: 0.2px; }
.form-input {
  width: 100%; padding: 8px 11px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 13.5px; font-family: 'Inter', sans-serif; background: #fff; color: #1e293b;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'Inter', sans-serif;
  transition: background 0.12s, box-shadow 0.12s; text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success   { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-outline   { background: #fff; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-ghost     { background: transparent; color: #64748b; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Drawer ──────────────────────────────────────────────────────── */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; width: 560px; max-width: 95vw;
  height: 100vh; background: #fff; z-index: 50; overflow-y: auto;
  box-shadow: -6px 0 30px rgba(0,0,0,0.12);
}
.drawer-header {
  padding: 18px 20px; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.drawer-body { padding: 20px; }

/* ── Section dividers ────────────────────────────────────────────── */
hr.section-divider { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }

/* ── Utilities ───────────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-muted { color: #64748b; }
.text-green { color: #16a34a; }
.text-red   { color: #dc2626; }
.text-blue  { color: #2563eb; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 10px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.block { display: block; }
.overflow-auto { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }

/* ── Filter bar ──────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 16px 20px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; margin-bottom: 16px;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px; }
.pagination-info { font-size: 13px; color: #64748b; padding: 0 8px; }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: #94a3b8; }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
}
