/* CLEO National dashboard — single-file design system. No build step. */

:root {
  --blue: #1a4d8f;
  --blue-dark: #143c70;
  --blue-tint: #eaf1f9;
  --ink: #1c2733;
  --muted: #5f6c7b;
  --line: #dfe5ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --green: #1a7f37;
  --green-bg: #ddf4e4;
  --amber: #9a6700;
  --amber-bg: #fff1cc;
  --orange: #bc4c00;
  --orange-bg: #ffe8d7;
  --red: #c62828;
  --red-bg: #fde3e1;
  --gray: #57606a;
  --gray-bg: #eceff2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 56, 0.06), 0 1px 8px rgba(16, 32, 56, 0.04);
  --sidebar-w: 216px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 14px;
  font-weight: 700; font-size: 16px; letter-spacing: 0.2px;
}
.sidebar .brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: #fff; color: var(--blue);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.sidebar .brand small { display: block; font-weight: 500; font-size: 11px; opacity: 0.75; }
.sidebar nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; justify-content: space-between;
  color: rgba(255, 255, 255, 0.85);
  padding: 9px 12px; border-radius: 8px;
  font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }
.sidebar .nav-badge {
  background: #fff; color: var(--blue);
  font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px;
}
.sidebar .foot { margin-top: auto; padding: 14px 20px; font-size: 11px; color: rgba(255,255,255,0.55); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; }
.topbar .who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.topbar .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  display: grid; place-items: center; font-weight: 700; font-size: 11px;
}

main { padding: 24px 28px 48px; max-width: 1080px; width: 100%; }

/* ---------- Components ---------- */
.flash {
  background: var(--green-bg); color: var(--green);
  border: 1px solid #bfe8cc;
  padding: 10px 14px; border-radius: var(--radius);
  margin-bottom: 16px; font-weight: 500;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 500; }
.stat.accent { border-top: 3px solid var(--blue); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.card > h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 0 0 12px; font-weight: 650;
}
.card .empty { color: var(--muted); font-style: italic; padding: 6px 0; }

/* chips */
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip.s-ACTIVE { background: var(--green-bg); color: var(--green); }
.chip.s-PROSPECTIVE { background: var(--amber-bg); color: var(--amber); }
.chip.s-AT_RISK { background: var(--orange-bg); color: var(--orange); }
.chip.s-INACTIVE { background: var(--gray-bg); color: var(--gray); }
.chip.s-ARCHIVED { background: var(--gray-bg); color: #8c959f; }
.chip.s-SUSPENDED { background: var(--red-bg); color: var(--red); }
.chip.h-HEALTHY { background: var(--green-bg); color: var(--green); }
.chip.h-UNHEALTHY { background: var(--red-bg); color: var(--red); }
.chip.h-UNKNOWN { background: var(--gray-bg); color: var(--gray); }
.chip.ok { background: var(--green-bg); color: var(--green); }
.chip.warn { background: var(--amber-bg); color: var(--amber); }
.chip.bad { background: var(--red-bg); color: var(--red); }
.chip.neutral { background: var(--gray-bg); color: var(--gray); }
.chip.info { background: var(--blue-tint); color: var(--blue); }

/* tables */
table { width: 100%; border-collapse: collapse; }
.card table { margin: -6px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 650; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfd; }

/* buttons & forms */
.btn {
  display: inline-block;
  background: var(--blue); color: #fff;
  border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--blue-dark); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #efc4c1; }
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }

input[type="text"], input[type="date"], input[type="search"], textarea, select {
  font-family: inherit; font-size: 13.5px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
  width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus { outline: 2px solid var(--blue-tint); border-color: var(--blue); }
form.inline { display: inline-block; }
.actions-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; }
.reveal { display: none; margin-top: 10px; }
.reveal.open { display: block; }
.reveal form { display: flex; gap: 8px; align-items: flex-start; }

/* filter chips row */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters a {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 550;
}
.filters a:hover { text-decoration: none; border-color: var(--blue); }
.filters a.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.filters .search { margin-left: auto; min-width: 220px; }

/* field grid (application review) */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 12px 0; }
.fields .f label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.fields .f div { font-size: 13.5px; }
.fields .f.wide { grid-column: 1 / -1; }

/* applicant strip */
.applicant {
  display: flex; align-items: center; gap: 12px;
  background: var(--blue-tint); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 8px;
}
.applicant .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.applicant .meta { font-size: 12.5px; color: var(--muted); }
.applicant .name { font-weight: 650; font-size: 14px; color: var(--ink); }

/* banner */
.banner {
  display: flex; gap: 10px; align-items: center;
  background: var(--amber-bg); color: var(--amber);
  border: 1px solid #f0dba4; border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; font-weight: 550;
}

/* note / thread */
.thread { border-left: 3px solid var(--line); margin: 10px 0; padding-left: 14px; }
.thread .msg { margin-bottom: 10px; }
.thread .msg .by { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.thread .msg.q { border-left: none; }
.thread .msg .bubble { background: var(--bg); border-radius: 8px; padding: 8px 12px; display: inline-block; }
.thread .msg.a .bubble { background: var(--blue-tint); }

/* people cards */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lead-card {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.lead-card .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  display: grid; place-items: center; font-weight: 700;
  flex-shrink: 0;
}
.lead-card .who .nm { font-weight: 650; }
.lead-card .who .rl { font-size: 12px; color: var(--muted); }
.lead-card .star { margin-left: auto; color: var(--amber); font-size: 16px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 2px; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.timeline .when { font-size: 11.5px; color: var(--muted); }
.timeline .what { font-size: 13.5px; }

/* meta line under page titles */
.page-meta { color: var(--muted); margin: -6px 0 18px; font-size: 13px; }

/* ---------- Auth pages (outside the shell) ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(10, 25, 50, 0.35);
  padding: 38px 40px; width: 100%; max-width: 400px; text-align: center;
}
.auth-card .logo {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px;
  background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
}
.auth-card h1 { font-size: 19px; margin: 0 0 4px; }
.auth-card p { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.auth-card .error {
  background: var(--red-bg); color: var(--red);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 16px;
}
.slack-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 22px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow);
}
.slack-btn:hover { border-color: var(--blue); text-decoration: none; }
.auth-card .fine { margin-top: 18px; font-size: 12px; color: var(--muted); }
