﻿:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18202c;
  --muted: #667085;
  --line: #d9dee7;
  --soft: #eef2f7;
  --accent: #0f9f8f;
  --accent-dark: #08786d;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 22px 55px rgba(24, 32, 44, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(15, 159, 143, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(24, 32, 44, 0.08), transparent 42%),
    #f7fafc;
}
.auth-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #204d76);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 7px; }
.eyebrow {
  margin: 18px 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: 34px; line-height: 1.05; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 28px; letter-spacing: 0; }
h3 { margin-bottom: 10px; font-size: 16px; letter-spacing: 0; }
.auth-copy { color: var(--muted); line-height: 1.65; }
.auth-message { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.primary-button, .ghost-button, .small-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
}
.primary-button {
  width: 100%;
  padding: 0 18px;
  color: white;
  background: var(--accent);
  font-weight: 750;
}
.primary-button:hover { background: var(--accent-dark); }
.ghost-button, .small-button {
  padding: 0 14px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
}
.small-button { min-height: 34px; font-size: 13px; }

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #111827;
  color: white;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-weight: 800;
  margin-bottom: 28px;
}
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a {
  padding: 11px 12px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
}
.sidebar-nav a.active, .sidebar-nav a:hover { color: white; background: rgba(255, 255, 255, 0.11); }
.main-panel { min-width: 0; padding: 26px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
#accountEmail { color: var(--muted); font-size: 14px; }
.status-banner {
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  color: var(--warning);
  background: #fffaeb;
}
.content-grid { display: grid; gap: 16px; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.card, .table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(24, 32, 44, 0.05);
}
.card { padding: 18px; }
.metric-value { font-size: 30px; font-weight: 850; letter-spacing: 0; }
.metric-label { color: var(--muted); font-size: 13px; }
.table-card { overflow: hidden; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.search-input {
  width: min(360px, 100%);
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #e6f7f4;
  font-size: 12px;
  font-weight: 750;
}
.split-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.kv { display: grid; gap: 10px; }
.kv-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; }
.kv-row span:first-child { color: var(--muted); }
.empty-state { padding: 30px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .account-chip { align-items: flex-start; flex-direction: column; }
  .metrics-grid, .split-grid { grid-template-columns: 1fr; }
  .main-panel { padding: 18px; }
  table { min-width: 720px; }
  .table-card { overflow-x: auto; }
}
