:root {
  /* Great Clips "Greenlight" brand palette, pulled directly from greatclips.com's
     own CSS custom properties (--primary/--jade, --peacock, --error, --black-secondary). */
  --brand: #048667;
  --brand-dark: #035a45;
  --brand-darker: #073b3a;
  --brand-bg: #f0f8f6;
  --accent-teal: #186e89;
  --ink: #1c1b18;
  --ink-soft: #545454;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --border: #e5e8e7;
  --critical: #cb4e13;
  --critical-bg: #fbeee6;
  --watch: #186e89;
  --watch-bg: #e8f2f5;
  --warning: #c99a2e;
  --warning-bg: #faf3df;
  --good: #048667;
  --good-bg: #f0f8f6;
  --pending: #545454;
  --pending-bg: #f2f2f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 27, 24, 0.06), 0 4px 16px rgba(28, 27, 24, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

a { color: inherit; }

.topbar {
  background: var(--brand-darker);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: #fff;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: #d8d5cc;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav a.active { color: #fff; background: var(--brand); }

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: #cfcbc0;
}

.user-menu a {
  color: #cfcbc0;
  text-decoration: none;
  font-weight: 600;
}

.user-menu a:hover { color: #fff; }

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.page-header h1 { margin: 0; font-size: 1.5rem; }
.period-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-card .label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-card .value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 4px;
}

.kpi-card .delta {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.delta.up { color: var(--good); }
.delta.down { color: var(--critical); }
.delta.flat { color: var(--ink-soft); }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-tile {
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  border: 1px solid transparent;
}

.status-tile .n { font-size: 1.7rem; font-weight: 800; display: block; }
.status-tile .l { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

.status-tile.critical { background: var(--critical-bg); color: var(--critical); }
.status-tile.watch { background: var(--watch-bg); color: var(--watch); }
.status-tile.pending { background: var(--pending-bg); color: var(--pending); }
.status-tile.ok { background: var(--good-bg); color: var(--good); }

.flag-list { display: flex; flex-direction: column; gap: 8px; }

.flag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.flag-row .who { font-weight: 700; }
.flag-row .where { color: var(--ink-soft); font-size: 0.85rem; margin-left: 6px; }
.flag-row .meta { font-size: 0.85rem; color: var(--ink-soft); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.critical { background: var(--critical-bg); color: var(--critical); }
.badge.watch { background: var(--watch-bg); color: var(--watch); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.good { background: var(--good-bg); color: var(--good); }

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: start;
  gap: 20px;
}

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
}

.chart-wrap { position: relative; height: 220px; }
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.mini-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.mini-chart h3 { margin: 0 0 10px; font-size: 0.95rem; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table-scroll { overflow-x: auto; }

table.data-table th, table.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

table.data-table th {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  background: var(--surface);
}

table.data-table tbody tr:hover { background: var(--bg); }
table.data-table td a { font-weight: 700; text-decoration: none; color: var(--brand-dark); }

.insights-list { margin: 0; padding-left: 18px; }
.insights-list li { margin-bottom: 6px; line-height: 1.4; }

.block-title { font-weight: 700; margin: 16px 0 8px; font-size: 0.92rem; }
.block-title:first-child { margin-top: 0; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-darker);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
}

.login-card .brand-mark { margin: 0 auto 16px; width: 48px; height: 48px; font-size: 1.2rem; border-radius: 12px; }

.login-card h1 {
  text-align: center;
  font-size: 1.2rem;
  margin: 0 0 20px;
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.field input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

button.btn, a.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  text-align: center;
}
button.btn:hover, a.btn:hover { background: var(--brand-dark); }

.error-message {
  background: var(--critical-bg);
  color: var(--critical);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.empty-state { color: var(--ink-soft); font-size: 0.9rem; padding: 12px 0; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.back-link { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.back-link:hover { color: var(--ink); }
