:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f5f5f2;
}

body {
  margin: 0;
}

main {
  width: min(1050px, calc(100vw - 32px));
  margin: 32px auto;
}

main.narrow {
  width: min(620px, calc(100vw - 32px));
  margin-top: 56px;
}

.card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.center {
  text-align: center;
}

.lead {
  color: #46505a;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.tile {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tile:hover {
  border-color: #aaa;
  transform: translateY(-1px);
}

label {
  display: block;
  margin: 12px 0;
}

input, select, textarea {
  display: block;
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  padding: 10px;
  margin-top: 4px;
}

button, .button {
  display: inline-block;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #bbb;
  background: #fff;
  color: #1f2933;
  text-decoration: none;
  font: inherit;
}

button:hover, .button:hover {
  background: #f0efe8;
}

.hidden {
  display: none;
}

.error {
  color: #a40000;
}

.notice {
  color: #355e3b;
}

.small {
  font-size: 0.9rem;
  color: #5b6470;
}

.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  border-bottom: 1px solid #eee;
  padding: 8px;
  vertical-align: top;
}

/* --- J2K2 school-gate / room metaphor layer ---------------------------- */
.gate-login-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(18, 24, 31, 0.48), rgba(18, 24, 31, 0.58)),
    url('/assets/backgrounds/school-gate.svg'),
    linear-gradient(135deg, #293241, #5f6f52);
  background-size: cover;
  background-position: center;
  overflow-x: hidden;
}

.gate-stage {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-gate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: flex;
}

.gate-panel {
  width: 50%;
  height: 100%;
  background:
    repeating-linear-gradient(90deg, rgba(40, 45, 48, 0.98) 0, rgba(40, 45, 48, 0.98) 18px, rgba(20, 24, 27, 0.98) 18px, rgba(20, 24, 27, 0.98) 26px),
    linear-gradient(#262b30, #111418);
  border-color: rgba(255,255,255,0.18);
  transition: transform 850ms ease-in-out;
}

.gate-left {
  border-right: 2px solid rgba(255,255,255,0.25);
  transform-origin: left center;
}

.gate-right {
  border-left: 2px solid rgba(255,255,255,0.25);
  transform-origin: right center;
}

.gate-opening .gate-left {
  transform: translateX(-52%);
}

.gate-opening .gate-right {
  transform: translateX(52%);
}

.gate-login-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(3px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hero {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.hero-courtyard {
  color: white;
  background:
    linear-gradient(rgba(15,23,42,0.35), rgba(15,23,42,0.75)),
    url('/assets/backgrounds/school-courtyard.svg'),
    linear-gradient(135deg, #52616b, #8d8741);
}

.hero .lead,
.hero .small {
  color: rgba(255,255,255,0.88);
}

.room-grid {
  align-items: stretch;
}

.room-card {
  min-height: 150px;
  position: relative;
  overflow: hidden;
}

.room-card:before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.10;
  background: linear-gradient(135deg, #111827, #6b7280);
  pointer-events: none;
}

.room-card > * {
  position: relative;
}

.room-label {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6470;
  font-weight: 700;
}

.room-rooms:before {
  background: linear-gradient(135deg, #2e1065, #b45309);
}

.room-wanted:before {
  background: linear-gradient(135deg, #7f1d1d, #ca8a04);
}

.room-roster:before {
  background: linear-gradient(135deg, #1e3a8a, #0f766e);
}

.room-stories:before {
  background: linear-gradient(135deg, #064e3b, #0369a1);
}

.room-address:before {
  background: linear-gradient(135deg, #1f2937, #78716c);
}

.room-profile:before {
  background: linear-gradient(135deg, #3f3f46, #4d7c0f);
}


/* --- Stilisierte Raum-Illustrationen (funktioniert ohne echte Fotos) ---- */
.room-card {
  background-size: cover;
  background-position: center;
}

.room-address {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/sekretariat.svg');
}

.room-roster {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/jahrgangsbuch.svg');
}

.room-wanted {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/aushang.svg');
}

.room-stories {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/raeume.svg');
}

.room-profile {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/spind.svg');
}

.room-check {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/hausmeisterraum.svg');
}

@media (prefers-reduced-motion: reduce) {
  .gate-panel {
    transition: none;
  }
}

/* --- Foundation pass additions ----------------------------------------- */
.form-card {
  margin-top: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.visibility-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.visibility-row.block-row {
  align-items: start;
}

.visibility-row textarea,
.visibility-row input,
.visibility-row select,
.two-col input {
  max-width: none;
}

.check-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.check-row {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  background: #fafaf7;
}

.check-ok {
  border-color: #86a789;
  background: #f2f7f1;
}

.check-warn {
  border-color: #d3b36a;
  background: #fff9e8;
}

.check-bad {
  border-color: #c58484;
  background: #fff1f1;
}

.room-check {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(244,244,236,0.96));
}

@media (max-width: 720px) {
  .visibility-row {
    grid-template-columns: 1fr;
  }
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.search-label {
  min-width: min(100%, 22rem);
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.person-card {
  border: 1px solid rgba(54, 39, 25, 0.12);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 252, 246, 0.78);
  box-shadow: 0 0.4rem 1rem rgba(45, 32, 18, 0.06);
}

.person-card h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(95, 66, 34, 0.12);
}

.note-text {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(54, 39, 25, 0.10);
}

.lead-box {
  margin-top: 0.75rem;
}

.lead-box summary {
  cursor: pointer;
  font-weight: 700;
}

.lead-box form {
  margin-top: 0.75rem;
}

.muted {
  color: rgba(36, 28, 20, 0.68);
}

/* --- School-wide rooms / time-layer stories ---------------------------- */
.room-timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.room-timeline-card h2 {
  margin: 0.15rem 0 0.35rem;
}

.timeline-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  border-left: 3px solid rgba(95, 66, 34, 0.18);
}

.timeline-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  position: relative;
  padding: 0.35rem 0 0.9rem 0.8rem;
}

.timeline-item:before {
  content: '';
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: #7a5a36;
  position: absolute;
  left: -0.43rem;
  top: 0.7rem;
}

.timeline-date {
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(36, 28, 20, 0.68);
}

.timeline-body p {
  margin: 0.25rem 0 0;
}

@media (max-width: 560px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }
}

/* --- Sekretariat ↔ Jahrgangsbuch connection --------------------------- */
.filters-toolbar {
  align-items: center;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  border: 1px solid rgba(54, 39, 25, 0.18);
  background: rgba(255, 252, 246, 0.85);
  color: #3f3428;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.pill.active,
.pill:hover {
  background: rgba(95, 66, 34, 0.14);
  border-color: rgba(95, 66, 34, 0.35);
}

.directory-table a,
.person-card a {
  color: inherit;
  text-decoration: none;
}

.directory-table a:hover,
.person-card a:hover {
  text-decoration: underline;
}

.click-row:hover {
  background: rgba(95, 66, 34, 0.06);
}

.person-title-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.detail-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.subcard {
  border: 1px solid rgba(54, 39, 25, 0.12);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 252, 246, 0.72);
}

.subcard h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.4rem 0.75rem;
  margin: 0;
}

.detail-list dt {
  font-weight: 700;
  color: rgba(36, 28, 20, 0.75);
}

.detail-list dd {
  margin: 0;
}

.actions-row {
  margin-top: 1rem;
}

.button-link {
  display: inline-block;
  border-radius: 0.75rem;
  padding: 0.55rem 0.8rem;
  background: rgba(95, 66, 34, 0.14);
  border: 1px solid rgba(95, 66, 34, 0.20);
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.button-link:hover {
  background: rgba(95, 66, 34, 0.20);
}

@media (max-width: 720px) {
  .person-title-row,
  .detail-list {
    display: block;
  }

  .detail-list dt {
    margin-top: 0.75rem;
  }
}

.wide-card {
  max-width: 46rem;
}

.invite-person {
  border: 1px solid rgba(54, 39, 25, 0.14);
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  background: rgba(255, 252, 246, 0.78);
}

.invite-person h2 {
  margin: 0 0 0.35rem;
}

.invite-link-box input {
  width: 100%;
  box-sizing: border-box;
  margin: 0.4rem 0 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.room-invites {
  background-image: linear-gradient(rgba(255,255,255,.84), rgba(255,255,255,.92)), url('/assets/rooms/default-room.svg');
}


.badge.soft {
  opacity: 0.72;
  background: rgba(15, 23, 42, 0.07);
}

.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.button-link {
  display: inline-block;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  text-decoration: none;
  font-weight: 700;
}

.button-link:hover {
  transform: translateY(-1px);
}

/* J2K2 addressbook-yearbook bridge additions */
.directory-person-row {
  cursor: pointer;
}
.directory-person-row:focus {
  outline: 2px solid rgba(95, 66, 34, 0.45);
  outline-offset: -2px;
}
.yearbook-open-link {
  white-space: nowrap;
}
.badge.soft {
  opacity: 0.72;
  background: rgba(95, 66, 34, 0.08);
}


/* J2K2 person depth + contact_status three-value additions, v20260706b */
.person-hero {
  margin-bottom: 1rem;
}
.person-depth-grid {
  align-items: stretch;
}
.notice-soft {
  border-style: dashed;
}
.detail-list dt {
  font-weight: 700;
}
.detail-list dd {
  margin-bottom: .65rem;
}
.person-title-row {
  gap: 1rem;
}

/* J2K2 Konsolidierung: alte Person-Vorschlagen-Reiter bleiben im MVP unsichtbar.
   Fehlende Personen laufen über den Aushang. */
a[href="/suggest-person.html"],
a[data-nav="suggest"] {
  display: none !important;
}

/* J2K2 portalweiter Schließen-Button */
button[aria-label*="Schließen"],
button[aria-label*="schließen"],
button[aria-label*="Schliessen"],
button[aria-label*="schliessen"],
button[title="Schließen"],
button[title="Schliessen"] {
  display: grid;
  place-items: center;

  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;

  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;

  color: rgb(126, 45, 41);

  font-family: Arial, Helvetica, sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;

  cursor: pointer;
}

button[aria-label*="Schließen"]:hover,
button[aria-label*="schließen"]:hover,
button[aria-label*="Schliessen"]:hover,
button[aria-label*="schliessen"]:hover,
button[title="Schließen"]:hover,
button[title="Schliessen"]:hover,
button[aria-label*="Schließen"]:focus-visible,
button[aria-label*="schließen"]:focus-visible,
button[aria-label*="Schliessen"]:focus-visible,
button[aria-label*="schliessen"]:focus-visible,
button[title="Schließen"]:focus-visible,
button[title="Schliessen"]:focus-visible {
  background: rgba(176, 67, 61, 0.10);
  color: rgb(126, 45, 41);
}

button[aria-label*="Schließen"]:focus-visible,
button[aria-label*="schließen"]:focus-visible,
button[aria-label*="Schliessen"]:focus-visible,
button[aria-label*="schliessen"]:focus-visible,
button[title="Schließen"]:focus-visible,
button[title="Schliessen"]:focus-visible {
  outline: 2px solid rgba(151, 54, 49, 0.42);
  outline-offset: 2px;
}
