/* =====================================================================
   ICB Web App – Erweiterungen für Admin & Mitgliederbereich
   ===================================================================== */

/* hidden-Attribut darf nicht von Layout-display ueberschrieben werden */
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 980px) { .app-shell { grid-template-columns: 1fr; } }

.app-sidebar {
  background: var(--green);
  color: var(--ivory);
  padding: 28px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 980px) { .app-sidebar { position: static; height: auto; } }

.app-sidebar .brand-mark { background: var(--ivory); color: var(--green); border-color: transparent; }
.app-sidebar h2 { color: var(--ivory); font-size: 1.1rem; margin-top: 6px; letter-spacing: .02em; }
.app-sidebar .eyebrow { color: rgba(254, 249, 243, .55); }
.app-sidebar nav { display: grid; gap: 4px; margin-top: 18px; }
.app-sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 12.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(254, 249, 243, .82);
  transition: background .2s ease, color .2s ease;
}
.app-sidebar nav a:hover { background: rgba(254, 249, 243, .08); color: var(--ivory); }
.app-sidebar nav a.active { background: var(--ochre); color: var(--green); }
.app-sidebar .me {
  margin-top: auto; padding: 14px;
  background: rgba(254, 249, 243, .06);
  border-radius: var(--radius-sm);
  font-size: 13px; color: rgba(254, 249, 243, .82);
}
.app-sidebar .me .small { color: rgba(254, 249, 243, .55); font-size: 11px; }
.app-sidebar .me button {
  margin-top: 8px; width: 100%;
  background: transparent; border: 1px solid rgba(254, 249, 243, .26);
  color: var(--ivory); padding: 8px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
}
.app-sidebar .me button:hover { background: var(--ivory); color: var(--green); }

.app-main {
  padding: 36px clamp(20px, 4vw, 56px);
  background: var(--ivory);
  min-width: 0;
}
.app-main h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 6px; }
.app-main .page-eyebrow { display: inline-block; margin-bottom: 16px; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--green-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 22px;
}
.panel h3 { margin-bottom: 14px; }
.panel-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--green-faint); font-weight: 500;
}
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 61, 44, .12);
}
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 680px) { .field-row { grid-template-columns: 1fr; } }

.btn-danger { background: var(--limestone); color: var(--ivory); }
.btn-danger:hover { background: #5b2814; }
.btn-link { background: transparent; border: 0; color: var(--limestone); text-decoration: underline; padding: 0; font-size: 13px; letter-spacing: 0; text-transform: none; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--green-line); }
.tbl th {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--green-faint);
}
.tbl tr:hover td { background: var(--ivory-2); }
.tbl .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Booking grid (Tennis) ---------- */
.booking-grid {
  display: grid;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper);
  font-size: 13px;
}
.booking-grid .hd, .booking-grid .row { display: contents; }
.booking-grid .hd > div {
  background: var(--green); color: var(--ivory);
  padding: 10px; font-family: var(--sans); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; text-align: center;
}
.booking-grid .row > div {
  padding: 10px;
  border-top: 1px solid var(--green-line);
  text-align: center;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.booking-grid .row > .h { background: var(--ivory-2); font-family: var(--serif); }
.booking-grid .slot {
  cursor: pointer;
  background: var(--paper);
  transition: background .15s ease;
  position: relative;
}
.booking-grid .slot:hover { background: var(--ivory-2); }
.booking-grid .slot.free { color: var(--green-faint); font-size: 12px; }
.booking-grid .slot.booked { background: var(--ochre); color: var(--green); font-weight: 500; cursor: pointer; }
.booking-grid .slot.selected { background: var(--green); color: var(--ivory); font-weight: 500; }

/* ---------- Slot grid (Golf/Conference single resource) ---------- */
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.slot-btn {
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--green-line);
  background: var(--paper);
  font-family: var(--sans); font-size: 13px;
  cursor: pointer; text-align: center;
  transition: all .15s ease;
}
.slot-btn:hover:not(.booked) { border-color: var(--green); }
.slot-btn .price { display: block; color: var(--green-faint); font-size: 11px; margin-top: 4px; letter-spacing: .1em; }
.slot-btn.booked { background: var(--ochre); cursor: not-allowed; opacity: .85; }
.slot-btn.selected { background: var(--green); color: var(--ivory); border-color: var(--green); }
.slot-btn.selected .price { color: rgba(254, 249, 243, .7); }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ivory), var(--ivory-2));
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 440px;
  background: var(--paper);
  border: 1px solid var(--green-line);
  border-radius: var(--radius-xl);
  padding: 44px;
  box-shadow: var(--shadow);
}
.login-card .brand { justify-content: center; margin-bottom: 14px; }
.login-card h1 { font-size: 1.8rem; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--green-soft); font-size: 14px; margin-bottom: 26px; }

/* ---------- Status messages ---------- */
.toast {
  position: fixed; right: 22px; bottom: 22px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--green); color: var(--ivory);
  box-shadow: var(--shadow-sm);
  font-size: 14px; z-index: 1000;
  display: none;
}
.toast.error { background: var(--limestone); }
.toast.show { display: block; }

.empty {
  text-align: center; padding: 48px 24px;
  color: var(--green-faint); font-style: italic;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 36, 25, .42);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--paper);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  padding: 32px;
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Pills / status ---------- */
.pill {
  display: inline-block;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-family: var(--sans); font-weight: 500;
}
.pill.ok { background: rgba(47, 61, 44, .1); color: var(--green); }
.pill.warn { background: rgba(248, 215, 148, .35); color: var(--limestone); }
.pill.bad { background: rgba(115, 53, 28, .12); color: var(--limestone); }

/* ---------- Event card ---------- */
.event-card {
  background: var(--paper);
  border: 1px solid var(--green-line);
  border-radius: var(--radius-md);
  padding: 22px;
  display: grid; gap: 8px;
  overflow: hidden;
}
.event-card .event-img {
  margin: -22px -22px 6px;
  aspect-ratio: 16 / 9;
  background: var(--ivory-2);
  overflow: hidden;
}
.event-card .event-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.event-card h3 { font-size: 1.2rem; }
.event-card .meta { font-size: 13px; color: var(--green-faint); letter-spacing: .04em; }
.event-card .teaser { color: var(--green-soft); font-size: 14.5px; line-height: 1.7; }
.event-card .teaser p { margin: 0 0 10px; }
.event-card .teaser p:last-child { margin-bottom: 0; }
.event-card .teaser ul, .event-card .teaser ol { margin: 8px 0 10px 18px; padding: 0; }
.event-card .teaser strong { color: var(--green); }
.event-card .teaser a { color: var(--limestone); text-decoration: underline; text-underline-offset: 3px; }
.event-card .event-actions {
  display: flex; gap: 10px; margin-top: 10px;
  align-items: center; flex-wrap: wrap;
}

.event-detail-head {
  display: grid; grid-template-columns: minmax(0, 320px) 1fr;
  gap: 28px; align-items: start; margin: 16px 0 28px;
}
.event-detail-head .event-detail-img {
  border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--ivory-2);
}
.event-detail-head .event-detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 760px) { .event-detail-head { grid-template-columns: 1fr; } }

.tn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tn-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--green-line);
  border-radius: var(--radius-sm); background: var(--paper);
  flex-wrap: wrap;
}
.tn-list li .tn-price { color: var(--green-soft); font-size: 13px; }
.tn-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.panel.teaser p { margin: 0 0 12px; }
.panel.teaser p:last-child { margin-bottom: 0; }
.panel.teaser strong { color: var(--green); }
.panel.teaser a { color: var(--limestone); text-decoration: underline; text-underline-offset: 3px; }
.panel.teaser ul, .panel.teaser ol { margin: 8px 0 12px 18px; padding: 0; }
