/* Roots to Rise — HR board styles */
:root {
  --brand: #1b7a6e;        /* brand teal-green, extracted from the RtR logo */
  --brand-dark: #14594f;
  --brand-light: #e7f2f0;
  --red: #c62828;
  --red-light: #fdecea;
  --amber: #e39a00;
  --amber-light: #fdf3dc;
  --green: #2e7d32;
  --green-light: #e8f3e9;
  --text: #2b2b2b;
  --muted: #6b7280;
  --border: #e2e5e9;
  --bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

/* --- Header ---------------------------------------------------------- */

.topbar {
  background: #fff;
  border-bottom: 3px solid var(--brand);
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }

.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}

.brand-text small {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted);
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; }

.nav a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
}

.nav a:hover { background: var(--brand-light); }
.nav a.active { background: var(--brand); color: #fff; }

.session-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bearbeiter-chip {
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.bearbeiter-chip:hover { background: var(--brand); color: #fff; }

.linklike {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 6px;
  text-decoration: underline;
}

.linklike:hover { color: var(--text); }

/* --- Layout ---------------------------------------------------------- */

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

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

h1 { font-size: 1.5rem; margin: 8px 0; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1.1rem;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-light);
  color: var(--brand-dark);
}

/* --- Flash / hints ---------------------------------------------------- */

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 12px 0;
  font-weight: 500;
}

.flash-success { background: var(--green-light); color: var(--green); }
.flash-error { background: var(--red-light); color: var(--red); }
.flash-info { background: var(--brand-light); color: var(--brand-dark); }

.hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0 12px; }

.field-error { color: var(--red); font-size: 0.88rem; margin: 2px 0; font-weight: 500; }

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 14px 16px;
  background: #fafafa;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.audit { color: var(--muted); font-size: 0.82rem; margin-top: 20px; }

/* --- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #1f5c23; }

.btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-ghost { background: #fff; color: var(--brand-dark); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--brand); }

.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-row { margin-top: 8px; }

/* --- Forms ------------------------------------------------------------ */

.stack { display: flex; flex-direction: column; gap: 6px; }

.stack label, .card label { font-weight: 600; font-size: 0.9rem; margin-top: 10px; }

input[type="text"], input[type="password"], input[type="date"],
input[type="search"], select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  width: 100%;
}

input:focus, select:focus, textarea:focus { border-color: var(--brand); }

textarea { resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.flags {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0 0;
}

.flags legend { font-weight: 600; font-size: 0.9rem; padding: 0 6px; }

.checkbox {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 500 !important;
  margin: 6px 0 !important;
}

.checkbox input { width: auto; }
.checkbox small { color: var(--muted); font-weight: 400; }

.notes-readonly {
  white-space: pre-wrap;
  font: inherit;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.absage-form { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }

/* --- Board ------------------------------------------------------------ */

.category { margin-top: 24px; }

.category h2 {
  font-size: 1.05rem;
  color: var(--brand-dark);
  border-bottom: 2px solid var(--brand-light);
  padding-bottom: 6px;
  margin: 0 0 10px;
}

.count {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: middle;
}

.person-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.person-row {
  display: grid;
  grid-template-columns: 1fr auto auto 28px;
  grid-template-areas: "name status date ampel";
  align-items: center;
  gap: 6px 14px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}

a.person-row:hover { border-color: var(--brand); }

.person-name { grid-area: name; font-weight: 600; }
.person-status { grid-area: status; color: var(--muted); font-size: 0.88rem; }
.person-date { grid-area: date; color: var(--muted); font-size: 0.88rem; white-space: nowrap; }

.status-step {
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.row-actions { grid-area: ampel; display: flex; gap: 8px; align-items: center; }

.archived-row { grid-template-columns: 1fr auto auto auto; }

.badge {
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-absage { background: var(--red-light); color: var(--red); }
.badge-abgeschlossen { background: var(--green-light); color: var(--green); }

/* --- Ampel ------------------------------------------------------------- */

.ampel-dot {
  grid-area: ampel;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 2px solid rgba(0, 0, 0, 0.15);
}

.ampel-dot.big { width: 26px; height: 26px; }

.state-red { background: var(--red); }
.state-yellow { background: var(--amber); }
.state-green { background: var(--green); }
.state-none { background: #d6d9dd; }

.overall {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.checklist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.ampel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  min-height: 52px;
}

.ampel-item:hover { border-color: var(--brand); background: var(--brand-light); }

.item-text { flex: 1; display: flex; flex-direction: column; }
.item-label { font-weight: 500; }
.item-hint { color: var(--muted); font-size: 0.82rem; }

.state-text {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  min-width: 130px;
  text-align: right;
}

/* --- Auth card ---------------------------------------------------------- */

.auth-card {
  max-width: 400px;
  margin: 8vh auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card h1 { margin: 12px 0 4px; }
.auth-card .stack { text-align: left; margin-top: 16px; }
.auth-logo { width: 72px; height: 72px; }
.auth-subtitle { color: var(--muted); margin: 0 0 8px; }

/* --- Settings / archive -------------------------------------------------- */

.settings-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; }
.inline-form .btn { flex-shrink: 0; }

.settings-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.item-edit { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.item-delete { flex-shrink: 0; margin-top: 4px; }

.item-num { color: var(--muted); font-size: 0.88rem; min-width: 22px; text-align: right; }

.badge-cond { background: var(--brand-light); color: var(--brand-dark); align-self: flex-start; }

.variant-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

ol.settings-list { list-style: none; }

.search-form { display: flex; gap: 8px; margin: 12px 0 20px; }
.search-form input { flex: 1; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none; }

/* --- Mobile -------------------------------------------------------------- */

@media (max-width: 640px) {
  .topbar-inner { padding: 8px 12px; gap: 8px; }
  .brand-text { font-size: 0.95rem; }
  .nav { order: 3; width: 100%; }
  .nav a { padding: 8px 10px; }

  .person-row {
    grid-template-columns: 1fr 28px;
    grid-template-areas:
      "name ampel"
      "status status"
      "date date";
    gap: 2px 10px;
  }

  .archived-row {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "status" "date" "ampel";
  }

  .row-actions { margin-top: 8px; }

  .form-grid { grid-template-columns: 1fr; }

  .state-text { min-width: 0; }
  .ampel-item { flex-wrap: wrap; }
  .item-text { flex-basis: 70%; }

  .auth-card { margin-top: 4vh; padding: 24px; }
}
