/*
 * Partner Performance Review — base styles.
 *
 * Deliberately unbranded for v1 (CLAUDE.md §1/§2): legible and professional,
 * not themed against the old Stash style guide. Expect a re-theme against Mary
 * Kate's new guide later. Data-presentation styling is worked separately, to a
 * recognised standard, in the deck skill.
 */

:root {
  --ink: #1a1d21;
  --ink-soft: #565c66;
  --line: #dfe3e8;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --danger: #a23b3b;
  --danger-bg: #fbeaea;
  --ok: #2f6f4f;
  --ok-bg: #e8f3ec;
  --radius: 8px;
  --gap: 1rem;
}

* { box-sizing: border-box; }

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.app-header__brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.app-header__signout button,
.app-header__signout {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
}

.app-main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.flashes { max-width: 960px; margin: 1rem auto 0; padding: 0 1.5rem; }

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.flash--alert { background: var(--danger-bg); color: var(--danger); }
.flash--notice { background: var(--ok-bg); color: var(--ok); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.login {
  max-width: 380px;
  margin: 4rem auto;
}

.login h1 { margin-top: 0; font-size: 1.3rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.3rem; }

.field input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap);
  margin-top: 1.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.stat__value { font-size: 1.8rem; font-weight: 600; }
.stat__label { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }

/* ---- Phase 2: navigation, tables, tiles, widgets, verify view ---- */

.app-nav { display: flex; gap: 1rem; margin-left: 1.5rem; flex: 1; }
.app-nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.app-nav a:hover, .app-nav a.is-active { color: var(--accent); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.stack > * + * { margin-top: 1.25rem; }

.btn--secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.btn--ghost { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); }
.btn--small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.field input[type="text"], .field input[type="date"], .field select, .field textarea,
.field input[type="url"] {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.95rem; background: var(--surface);
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table--wrap { overflow-x: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 0.9rem; background: var(--bg); }
.tile__value { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile__label { font-size: 0.75rem; color: var(--ink-soft); }

.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge--critical { background: var(--danger-bg); color: var(--danger); }
.badge--warning { background: #fbf3e2; color: #8a5a00; }
.badge--info { background: #e8eef5; color: var(--accent); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }

.section { margin-top: 2rem; }
.section > h2 { font-size: 1.1rem; border-bottom: 2px solid var(--line); padding-bottom: 0.4rem; }

.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-top: 1rem; }
.widget__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.widget__title { margin: 0; font-size: 1rem; }
.widget__src { font-size: 0.72rem; color: var(--ink-soft); }
.widget__note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.5rem; border-left: 3px solid var(--line); padding-left: 0.6rem; }
.widget--reserved { border-style: dashed; background: var(--bg); }

.hbar { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.hbar li { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; font-size: 0.85rem; }
.hbar .track { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; height: 14px; overflow: hidden; }
.hbar .fill { background: var(--accent); height: 100%; }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0.1rem 0.45rem; font-size: 0.75rem; color: var(--ink-soft); }
