:root {
  --hhs-red: #8B1E2D;
  --hhs-red-dark: #6c1622;
  --hhs-green: #1F4D2C;
  --hhs-gold: #D4AF37;
  --hhs-cream: #FFF8F0;
  --hhs-ink: #2b2b2b;
  --hhs-muted: #6b6b6b;
  --hhs-border: #e6dcd0;
  --hhs-card-bg: #ffffff;
  --hhs-danger: #b3261e;
  --hhs-success: #1F4D2C;
  font-size: 15px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--hhs-cream);
  color: var(--hhs-ink);
}

a { color: var(--hhs-red); }

/* ---------- Login / auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--hhs-cream) 0%, #f3e6d8 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--hhs-card-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(139, 30, 45, 0.18);
  padding: 36px 32px;
  text-align: center;
}

.auth-logo-box {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-logo-box img {
  max-height: 140px;
  max-width: 100%;
}

.auth-card h1 {
  font-size: 1.4rem;
  color: var(--hhs-red);
  margin: 4px 0 20px;
}

.auth-card form { text-align: left; }

.auth-card .btn-primary { width: 100%; margin-top: 8px; }

.auth-links { margin-top: 18px; font-size: 0.9rem; }
.auth-links a { display: block; margin-top: 6px; }

/* ---------- App shell ---------- */
.app-nav {
  background: var(--hhs-red);
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.app-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
}

.app-nav .brand img { height: 34px; }

.app-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.app-nav a {
  color: #fce9ea;
  text-decoration: none;
  padding: 14px 10px;
  display: inline-block;
  font-size: 0.92rem;
  border-bottom: 3px solid transparent;
}

.app-nav a:hover, .app-nav a.active {
  color: #fff;
  border-bottom-color: var(--hhs-gold);
}

.app-nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fce9ea;
  font-size: 0.9rem;
}

.app-nav .nav-right form { display: inline; }
.app-nav .nav-right button.link-btn {
  background: none;
  border: none;
  color: #fce9ea;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}

.year-switcher select {
  padding: 4px 6px;
  border-radius: 6px;
  border: none;
}

main.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1.page-title {
  color: var(--hhs-red);
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Flash messages ---------- */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.flash-success { background: #e6f2e9; color: var(--hhs-success); border: 1px solid #bfe0c8; }
.flash-error { background: #fbe9e7; color: var(--hhs-danger); border: 1px solid #f3c6c1; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--hhs-card-bg);
  border: 1px solid var(--hhs-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.card h2, .card h3 { margin-top: 0; color: var(--hhs-red); }

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stat-tile {
  background: var(--hhs-card-bg);
  border: 1px solid var(--hhs-border);
  border-radius: 12px;
  padding: 16px 18px;
}
.stat-tile .label { font-size: 0.82rem; color: var(--hhs-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .value { font-size: 1.6rem; font-weight: 700; color: var(--hhs-red); margin-top: 4px; }
.stat-tile .sub { font-size: 0.82rem; color: var(--hhs-muted); margin-top: 2px; }

/* ---------- Progress bars ---------- */
.progress-row { margin-bottom: 14px; }
.progress-row .progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 4px;
}
.progress-track {
  background: #eee2d3;
  border-radius: 20px;
  height: 14px;
  overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 20px; }

/* ---------- Tables ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--hhs-card-bg);
  border-radius: 10px;
  overflow: hidden;
}
table.data-table th, table.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--hhs-border);
  font-size: 0.92rem;
}
table.data-table th {
  background: #f5ece1;
  color: var(--hhs-red);
  font-weight: 600;
}
table.data-table tr:hover td { background: #fdf6ee; }
.table-wrap { overflow-x: auto; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--hhs-ink);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], input[type=time], input[type=color],
select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--hhs-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--hhs-ink);
}

input[type=color] { padding: 3px; height: 40px; }

textarea { resize: vertical; min-height: 80px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--hhs-red); color: #fff; }
.btn-primary:hover { background: var(--hhs-red-dark); }
.btn-secondary { background: #fff; border-color: var(--hhs-border); color: var(--hhs-ink); }
.btn-secondary:hover { background: #f5ece1; }
.btn-danger { background: #fff; border-color: var(--hhs-danger); color: var(--hhs-danger); }
.btn-danger:hover { background: #fbe9e7; }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f5ece1;
  color: var(--hhs-ink);
  border: 1px solid var(--hhs-border);
}
.tag .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.badge { padding: 2px 8px; border-radius: 20px; font-size: 0.76rem; font-weight: 700; }
.badge-overdue { background: #fbe9e7; color: var(--hhs-danger); }
.badge-committed { background: #fdf1d8; color: #8a6d1c; }
.badge-partial { background: #e3eef7; color: #2d5c86; }
.badge-fulfilled { background: #e6f2e9; color: var(--hhs-success); }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--hhs-muted);
}

.helper-text { font-size: 0.82rem; color: var(--hhs-muted); margin-top: 4px; }

@media (max-width: 640px) {
  .app-nav { padding: 0 12px; }
  main.container { padding: 16px 12px 40px; }
}
