:root {
  --red: #c0564a;
  --bg: #f5f4f8;
  --card-bg: #ffffff;
  --border: #e0dee8;
  --text: #2b2733;
  --text-muted: #6c6779;

  /* Brand palette */
  --brand: #6a4fb3;
  --brand-dark: #3d2a63;
  --hammer-red: #e2273d;
}

* { box-sizing: border-box; }

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

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

.topbar {
  background: var(--brand-dark);
  border-bottom: 3px solid var(--hammer-red);
  padding: 0.85rem 1.5rem;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
}

.topbar .topbar-link {
  color: white;
  opacity: 0.9;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0;
}
.topbar .topbar-link:hover { opacity: 1; }

.hero {
  background: var(--brand-dark);
  color: white;
  padding: 1.5rem 1.5rem 2rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.hero-back {
  display: inline-block;
  color: #c9b8ea;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
}
.hero-back:hover { color: white; text-decoration: underline; }

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  color: white;
}

.hero p {
  margin: 0;
  color: #e6ddf5;
  font-size: 0.95rem;
  max-width: 70ch;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.nav-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.nav-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 64px;
  padding: 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
}

.nav-tile-secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}
.nav-tile-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }

.notification-card {
  background: var(--brand-dark);
  color: white;
  min-height: 90px;
  display: flex;
  align-items: center;
}
.notification-card h2 {
  color: white;
  opacity: 0.75;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.4rem;
}
.notification-card .notification-body { width: 100%; }
.notification-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.placeholder-card {
  border-style: dashed;
  background: #fbfaff;
}
.placeholder-card h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}
.placeholder-card p:last-child { margin-bottom: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.stat-tile .value { font-size: 1.8rem; font-weight: 700; color: var(--brand-dark); }
.stat-tile .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

tr:hover td { background: #faf9fc; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-yes { background: #e4f0de; color: #3d6b2c; }
.badge-no { background: #f4ded9; color: #8a3a2c; }
.badge-warn { background: #fbe8c6; color: #8a5b0a; }
.badge-info { background: #dce6f5; color: #1e4b8f; }
.badge-neutral { background: #e5e2ee; color: var(--text-muted); }

.missing-info-name {
  color: #b3261e;
  font-weight: 700;
}
.missing-info-flag {
  color: #b3261e;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-primary { background: var(--hammer-red); color: white; }
.btn-primary:hover { background: #c11f33; }
.btn-secondary { background: #e5e2ee; color: var(--text); }
.btn-danger { background: var(--red); color: white; }
.btn-link { background: transparent; color: var(--brand-dark); padding: 0.3rem 0; }

form .field { margin-bottom: 1rem; }
form label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
form input[type=text], form input[type=email], form input[type=date], form input[type=url],
form input[type=number], form input[type=password], form input[type=datetime-local],
form select, form textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
}

form input[type=datetime-local] {
  padding: 0.85rem 0.6rem;
  font-size: 1.05rem;
}

.score-radio-group > div {
  display: flex;
  gap: 0.5rem;
}
.score-radio-group input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.score-radio-group label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.score-radio-group label:has(input:checked) {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}
form .checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
form .checkbox-row label { margin: 0; font-weight: 500; }
form .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
form .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin: 1rem 0; }

.toggle-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.25rem 0 1rem;
}
.toggle-btn-group input[type=checkbox],
.toggle-btn-group input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.toggle-btn-group input:checked + .toggle-btn {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}

.toggle-status-group {
  display: inline-flex;
}
.toggle-status-group input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  background: #8a3a2c;
  color: white;
}
.toggle-status-btn .when-active { display: none; }
.toggle-status-group input:checked + .toggle-status-btn {
  background: #3d6b2c;
}
.toggle-status-group input:checked + .toggle-status-btn .when-active { display: inline; }
.toggle-status-group input:checked + .toggle-status-btn .when-inactive { display: none; }

form select.btn-select {
  width: auto;
  background: #e5e2ee;
  font-weight: 600;
  cursor: pointer;
}

.inline-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.inline-select-chip .inline-select-label {
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.evaluation-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fbfaff;
}

.decision-followup-card {
  border: 2px solid #e08a1e;
  background: #fff6ea;
}
.decision-followup-card h2 {
  color: #b5620c;
}

.pipeline-card-header {
  margin-bottom: 0.75rem;
}

.stage-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stage-mini-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.stage-btn-active {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}
.stage-btn-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}
.interviewing-picker {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.interviewing-picker input[type=date] {
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.messages { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.messages li { padding: 0.6rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; background: #e4f0de; color: #3d6b2c; }
.messages li.error { background: #f4ded9; color: #8a3a2c; }

body.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.login-banner {
  background: var(--brand-dark);
  border-bottom: 4px solid var(--hammer-red);
  color: white;
  padding: 2rem 1.5rem;
}

.login-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.login-banner-logo {
  height: 64px;
  width: auto;
  flex-shrink: 0;
  background: white;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

.login-banner-text h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.6rem;
  color: white;
}

.login-banner-text p {
  margin: 0;
  color: #e6ddf5;
  font-size: 0.95rem;
  max-width: 70ch;
}

.login-body {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .login-body { grid-template-columns: 1fr; }
  .login-banner-inner { flex-direction: column; text-align: center; }
}

.login-info-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-card h2 {
  color: var(--brand-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.info-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text);
}
.info-item:last-child { border-bottom: none; padding-bottom: 0; }
.info-item strong { color: var(--brand-dark); }

.login-form-column .login-card {
  position: sticky;
  top: 1.5rem;
}

.login-card h2 {
  text-align: center;
  color: var(--brand-dark);
  margin-top: 0;
}

.login-reset-note {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0;
}

.login-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.empty-state { color: var(--text-muted); padding: 2rem; text-align: center; }
