:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1e40af;
  --brand-2: #4338ca;
  --brand-ink: #ffffff;
  --accent: #2563eb;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg) !important;
  color: var(--ink) !important;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { max-width: 960px; margin: 0 auto; padding: 20px 20px 60px; }

/* Header */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; background: #ffffff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white; font-weight: 700; display: grid; place-items: center; font-size: 14px;
  letter-spacing: .5px;
}
.topbar h1 { font-size: 15px; margin: 0; line-height: 1.2; }
.topbar .sub  { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--ink-2); }
.topbar .who strong { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #1d3fa0; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #f1f5f9; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); }
.btn-link { background: transparent; color: var(--accent); padding: 4px 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card + .card { margin-top: 16px; }

h2.section { font-size: 20px; margin: 0 0 6px; }
.section-sub { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

/* Login */
.login-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 24px 20px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { margin: 0 0 4px; font-size: 22px; }
.login-card p  { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.alert {
  padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: #fef2f2; color: var(--bad); border: 1px solid #fecaca;
  margin-bottom: 14px;
}
.alert-ok { background: #f0fdf4; color: var(--good); border-color: #bbf7d0; }

/* Dashboard */
.progress {
  display: flex; align-items: center; gap: 14px; margin: 14px 0 24px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.progress .bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress .bar > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .3s; }
.progress .count { font-size: 13px; color: var(--muted); white-space: nowrap; }

.pitch-list { display: grid; gap: 12px; }
.pitch-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: all .15s;
}
.pitch-row:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.pitch-row .order {
  width: 34px; height: 34px; border-radius: 10px; background: #eef2ff;
  color: var(--brand-2); font-weight: 700; display: grid; place-items: center; font-size: 14px;
  flex: 0 0 34px;
}
.pitch-row .info { flex: 1; min-width: 0; }
.pitch-row .company { font-weight: 600; font-size: 15px; }
.pitch-row .one { font-size: 13px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitch-row .status {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px;
  background: #f1f5f9; color: var(--muted);
}
.pitch-row .status.done { background: #dcfce7; color: var(--good); }

/* Score form */
.pitch-header {
  padding: 24px; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white; border-radius: var(--radius); margin-bottom: 20px;
}
.pitch-header .eyebrow { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }
.pitch-header h1 { margin: 4px 0 6px; font-size: 26px; }
.pitch-header p { margin: 0; opacity: .9; font-size: 14px; }

.criterion {
  padding: 16px 0; border-top: 1px solid var(--line);
}
.criterion:first-child { border-top: 0; padding-top: 4px; }
.criterion .row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.criterion .label { font-weight: 600; font-size: 15px; }
.criterion .help  { font-size: 13px; color: var(--muted); margin-top: 2px; }
.criterion .score { font-weight: 700; font-size: 18px; color: var(--brand-2); min-width: 32px; text-align: right; }
.criterion .slider {
  width: 100%; margin-top: 12px; accent-color: var(--brand);
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px;
  background: #e2e8f0; outline: none;
}
.criterion .slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand); cursor: pointer; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.2);
}
.criterion .slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand);
  cursor: pointer; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.2);
}
.criterion .ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

.notes label { font-weight: 600; font-size: 15px; display: block; margin-bottom: 8px; }
.notes textarea {
  width: 100%; min-height: 120px; padding: 12px 14px; font-family: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px; resize: vertical; background: #fff;
}
.notes textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.overall-bar {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  padding: 16px 18px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
}
.overall-bar .lbl { font-weight: 600; }
.overall-bar .val { font-size: 28px; font-weight: 700; color: var(--brand); margin-left: auto; }

.form-footer {
  display: flex; gap: 10px; justify-content: space-between; margin-top: 20px; align-items: center;
  flex-wrap: wrap;
}
.form-footer .status-msg { font-size: 13px; color: var(--muted); }

/* Admin */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin-table th { background: #f1f5f9; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-1 { background: #fef3c7; color: #92400e; }
.rank-2 { background: #e0e7ff; color: #3730a3; }
.rank-3 { background: #fce7f3; color: #9f1239; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
  background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
}

@media (max-width: 560px) {
  .app-shell { padding: 14px 14px 60px; }
  .card { padding: 18px; }
  .pitch-header { padding: 20px; }
  .pitch-header h1 { font-size: 22px; }
}
