/* ============================================================
   Dashboard macro — unified with main design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg:            #060d1a;
  --bg-soft:       #0a1424;
  --line:          rgba(255,255,255,0.07);
  --line-strong:   rgba(255,255,255,0.13);
  --text:          #eaf1ff;
  --muted:         #8fa4c8;
  --muted-strong:  #bccde8;
  --accent:        #5b9eff;
  --accent-strong: #2563eb;
  --accent-soft:   rgba(91,158,255,0.13);
  --green:         #3ecfa6;
  --warning:       #f5c842;
  --danger:        #ff6b7a;
  --shadow-xl:     0 32px 80px rgba(0,0,0,0.48);
  --shadow-md:     0 12px 40px rgba(0,0,0,0.28);
  --shadow-sm:     0 4px 16px rgba(0,0,0,0.18);
  --radius:        8px;
  --radius-lg:     12px;
  --max:           1320px;
  --font:          'Inter', ui-sans-serif, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 40% at 20% -10%, rgba(37,99,235,0.18), transparent),
    radial-gradient(ellipse 60% 30% at 85% 5%, rgba(62,207,166,0.09), transparent);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #8fbfff; }

/* ── NAV ── */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(4,9,18,0.90);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(20px) saturate(160%);
}
.dash-nav__inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.dash-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.dash-nav__logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #2563eb, #3ecfa6);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.dash-nav__brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.dash-nav__links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.dash-nav__links a {
  color: var(--muted-strong); font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.dash-nav__links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.dash-nav__links a.active { color: var(--accent); }
.dash-nav__meta { font-size: 11px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); border-radius: var(--radius); }

/* ── CONTAINER ── */
.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
.page-main { padding: 0 0 60px; }

/* ── HERO ── */
.hero { padding: 32px 0 20px; }
.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 1px solid rgba(91,158,255,0.18);
  background: rgba(91,158,255,0.08);
  border-radius: 999px;
  color: #bdd8ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero__title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 860px;
}
.hero__title span { color: var(--accent); }
.hero__desc {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(13px, 1.2vw, 15px);
  margin: 0;
  line-height: 1.6;
}

/* ── TOOLBAR ── */
.toolbar { position: sticky; top: 64px; z-index: 10; margin: 16px 0 22px; }
.toolbar__inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(6,13,26,0.92);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

/* ── UNIFIED FIELDS ── */
.field, .select {
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field:focus, .select:focus {
  border-color: var(--accent);
  background: rgba(91,158,255,0.06);
  box-shadow: 0 0 0 3px rgba(91,158,255,0.14);
}
.field::placeholder { color: rgba(143,164,200,0.5); }
.button {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity .18s, box-shadow .18s;
  box-shadow: 0 4px 14px rgba(37,99,235,0.28);
}
.button:hover { opacity: .9; color: #fff; box-shadow: 0 6px 20px rgba(37,99,235,0.4); }
.button--ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: none;
  color: var(--muted-strong);
}
.button--ghost:hover { background: rgba(255,255,255,0.07); color: var(--text); box-shadow: none; }

/* ── METRIC CARDS ── */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.card {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(13,24,47,0.96), rgba(8,14,28,0.97));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card--metric { padding: 18px; }
.card__eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.card__value {
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.card__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 14px;
}

/* ── PANELS ── */
.panel { padding: 18px; }
.panel__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel__title { margin: 0 0 4px; font-size: 15px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.panel__desc { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel__actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(91,158,255,0.18);
  background: rgba(91,158,255,0.07);
  color: #bdd8ff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ── CHARTS ── */
.chart-wrap { height: 310px; position: relative; }
.chart-wrap--sm { height: 250px; }
.chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

/* ── TABLE ── */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; min-width: 540px; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); }
.table th {
  position: sticky; top: 0;
  background: rgba(8,14,28,0.98);
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
}
.table td { font-size: 13px; }
.table tbody tr:hover { background: rgba(20,38,66,0.45); }
.table__name { font-weight: 700; color: var(--text); }

/* ── KPI / SEARCH ── */
.kpi-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.kpi { padding: 13px; border-radius: var(--radius); background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.kpi__label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.kpi__value { margin-top: 8px; font-size: 17px; font-weight: 800; letter-spacing: -0.025em; word-break: break-word; }
.search-results { margin-top: 12px; display: grid; gap: 8px; }
.search-item {
  padding: 11px 13px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  display: block; color: var(--text);
  transition: background .15s, border-color .15s;
}
.search-item:hover { background: rgba(255,255,255,0.05); border-color: var(--line-strong); }
.search-item__meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.empty, .notice { padding: 14px 16px; border-radius: var(--radius); background: rgba(255,255,255,0.03); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-space { height: 40px; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero__title { font-size: clamp(20px, 7vw, 30px); }
  .toolbar { top: 0; }
  .toolbar__inner { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; gap: 10px; }
  .chart-wrap { height: 250px; }
  .chart-wrap--sm { height: 200px; }
  .kpi-row { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
}
