/* ============================================================
   Viewport shared design tokens + base styles
   Lifted from select/index.html so the internal tools site
   matches the existing customer-facing look.
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --brand-blue: #1E88E5;
  --brand-blue-dark: #1670c4;
  --brand-blue-light: #e8f3fd;
  --charcoal: #2E3B4E;
  --charcoal-soft: #43526a;
  --yellow: #FFCA28;
  --yellow-soft: #fff4cf;
  --indigo: #8E99F3;
  --indigo-soft: #eef0fe;

  /* Surfaces */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e3e7ee;
  --border-strong: #c9d1dc;
  --text: var(--charcoal);
  --text-muted: #6b7689;

  --success: #10b981;
  --warn: #f59e0b;
  --error: #ef4444;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(46,59,78,0.06);
  --shadow: 0 1px 2px rgba(46,59,78,0.05), 0 4px 12px rgba(46,59,78,0.06);
  --shadow-lg: 0 10px 30px rgba(30,136,229,0.12), 0 2px 6px rgba(46,59,78,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(30,136,229,0.07), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(142,153,243,0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.header {
  background: var(--charcoal);
  border-bottom: 3px solid var(--brand-blue);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.header .logo svg path { fill: #ffffff !important; }
.logo svg { height: 34px; width: auto; display: block; }
.logo a { display: block; line-height: 0; }
.header-meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}
.page-intro { margin-bottom: 28px; }
.page-intro h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.page-intro p { font-size: 14px; color: var(--text-muted); max-width: 680px; }

/* ---------- Internal banner ---------- */
.internal-banner {
  background: var(--yellow-soft);
  border: 1px solid #f0d98a;
  border-left: 4px solid var(--yellow);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: #8a6d1a;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  background: var(--brand-blue);
  border: 1px solid var(--brand-blue);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: 0 1px 2px rgba(30,136,229,0.25);
}
.btn:hover:not(:disabled) {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  box-shadow: 0 4px 12px rgba(30,136,229,0.3);
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost {
  background: #fff;
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--brand-blue-light);
  color: var(--brand-blue-dark);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  background: var(--indigo-soft);
  color: #4651b8;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  white-space: nowrap;
}
.badge.muted { background: #eef1f6; color: var(--text-muted); }
.badge.warn  { background: var(--yellow-soft); color: #8a6d1a; }
.badge.ok    { background: #dcfce7; color: #166534; }
.badge.bad   { background: #fee2e2; color: #991b1b; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: auto; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: var(--charcoal);
  font-weight: 700;
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 2px solid var(--brand-blue);
}
tbody tr { transition: background 0.12s ease; }
tbody tr:nth-child(even) td { background: var(--brand-blue-light); }
tbody tr:hover td { background: #d9ebfb; }
td.null { color: var(--border-strong); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Cards / error ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.error-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--error);
  color: #991b1b;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
