* { box-sizing: border-box; }
:root {
  --bg: #f5f7fb;
  --surface: rgba(255,255,255,.86);
  --surface-solid: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: rgba(16,24,40,.12);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --warning: #f59e0b;
  --success: #16a34a;
  --info: #0891b2;
  --shadow: 0 24px 80px rgba(15,23,42,.10);
  --radius: 24px;
}
body.dark {
  --bg: #07111f;
  --surface: rgba(15,23,42,.78);
  --surface-solid: #0f172a;
  --text: #e5edf8;
  --muted: #94a3b8;
  --line: rgba(148,163,184,.20);
  --shadow: 0 24px 80px rgba(0,0,0,.28);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.22), transparent 32rem),
    radial-gradient(circle at 85% 0, rgba(8,145,178,.18), transparent 30rem),
    var(--bg);
}
button, input, select { font: inherit; }
.app-shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 48px; }
.hero, .panel, .kpi-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 34px; border-radius: 32px; overflow: hidden; position: relative;
}
.hero::after { content: ""; position: absolute; inset: auto -10% -50% auto; width: 380px; height: 380px; border-radius: 999px; background: rgba(37,99,235,.12); pointer-events: none; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; line-height: 1.1; }
h1 { font-size: clamp(32px, 5vw, 64px); letter-spacing: -.06em; }
h2 { font-size: 22px; letter-spacing: -.03em; }
.hero-copy { margin: 14px 0 0; max-width: 820px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.hero-actions, .table-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; z-index: 1; }
.btn {
  border: 0; color: #fff; cursor: pointer; border-radius: 14px; padding: 11px 16px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 12px 28px rgba(37,99,235,.24);
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(37,99,235,.28); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { color: var(--text); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: none; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.kpi-card { border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -52px; top: -52px; width: 150px; height: 150px; border-radius: 999px; opacity: .14; background: currentColor; }
.kpi-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.kpi-card strong { display: block; margin-top: 10px; font-size: clamp(28px, 4vw, 44px); line-height: 1; letter-spacing: -.05em; }
.kpi-card small { display: block; margin-top: 10px; color: var(--muted); font-weight: 700; }
.kpi-card.accent { color: var(--primary); }
.kpi-card.danger { color: var(--danger); }
.kpi-card.info { color: var(--info); }
.kpi-card.success { color: var(--success); }
.panel { border-radius: var(--radius); padding: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 8px; }
.muted { color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.filters { display: grid; grid-template-columns: 1.4fr repeat(5, minmax(145px,1fr)); gap: 12px; }
label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
input, select {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; color: var(--text);
  background: var(--surface-solid); outline: none; transition: border .2s ease, box-shadow .2s ease;
}
input:focus, select:focus { border-color: rgba(37,99,235,.55); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr); gap: 18px; margin: 18px 0; }
.chart-panel canvas { width: 100%; display: block; }
.pill, .badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 900; background: rgba(37,99,235,.10); color: var(--primary); }
.badge.suspend { background: rgba(220,38,38,.12); color: var(--danger); }
.badge.notif { background: rgba(8,145,178,.12); color: var(--info); }
.legend { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-weight: 800; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 999px; }
.table-heading { align-items: flex-end; }
.rows-label { color: var(--muted); font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.rows-label select { padding: 9px 12px; min-width: 82px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; color: var(--muted); background: var(--surface-solid); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; user-select: none; }
th span { color: var(--primary); margin-left: 4px; }
tbody tr:hover { background: rgba(37,99,235,.06); }
td:first-child { font-weight: 800; color: var(--muted); width: 76px; }
td.target { font-weight: 800; word-break: break-word; }
td.empty { text-align: center; padding: 36px; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); font-weight: 800; }
.toast { position: fixed; right: 18px; bottom: 18px; transform: translateY(18px); opacity: 0; pointer-events: none; padding: 13px 16px; border-radius: 16px; background: #111827; color: white; font-weight: 800; box-shadow: 0 18px 48px rgba(0,0,0,.24); transition: .25s ease; z-index: 999; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0,1fr)); } .content-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) { .app-shell { width: min(100% - 20px, 1440px); padding-top: 16px; } .hero { flex-direction: column; align-items: flex-start; padding: 24px; } .kpi-grid, .content-grid, .filters { grid-template-columns: 1fr; } .section-heading, .table-heading { align-items: flex-start; flex-direction: column; } .hero-actions, .table-actions { width: 100%; } .btn { width: 100%; } }
