/* =========================================================
   Hüttenbuchung – Belegungskalender (Nachbau des WPBC-Looks)
   Farben wie Original: Frei #f5f5f5 · Belegt #5577aa · Tour #55aa55
   ========================================================= */
.hb {
  --hb-frei:   #f5f5f5;
  --hb-belegt: #5577aa;
  --hb-tour:   #55aa55;
  --hb-sel:    #ffd24d;
  --hb-border: #d9d9d9;
  --hb-text:   #333;
  max-width: 1100px;
}
.hb * { box-sizing: border-box; }

/* Innenabstand oben: die graue Leiste klebt nicht am oberen Rand des beigen Kastens,
   ohne den ganzen Inhaltsblock nach unten zu schieben. */
#hb-root { padding-top: 24px; }

/* --- Kopfleiste: angemeldet-als + Aktionen --- */
.hb-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 10px 12px;
  background: #eef1f4; border: 1px solid var(--hb-border); border-radius: 6px;
}
.hb-bar .hb-who { font-weight: 600; }
.hb-bar .hb-spacer { flex: 1 1 auto; }
.hb-year { display: flex; align-items: center; gap: 8px; }
.hb-year b { min-width: 3.5em; text-align: center; }
.hb-btn {
  display: inline-block; cursor: pointer; border: 1px solid #4a6a99;
  background: #5577aa; color: #fff; padding: 7px 14px; border-radius: 5px;
  font: inherit; line-height: 1.1;
}
.hb-btn:hover { background: #4a6a99; }
.hb-btn.hb-ghost { background: #fff; color: #333; border-color: var(--hb-border); }
.hb-btn.hb-ghost:hover { background: #f2f2f2; }
.hb-btn.hb-danger { background: #b23b3b; border-color: #963030; }
.hb-btn:disabled { opacity: .5; cursor: default; }

/* Navigations-Links im Intern-Widget als gestapelte Buttons */
.hb-nav { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.hb-navbtn {
  display: block; width: 100%; box-sizing: border-box;
  padding: 10px 14px; border: 1px solid #aac0dd; border-radius: 5px;
  background: #e8eff8; color: #2a3f5f; text-decoration: none; font: inherit; line-height: 1.2;
}
.hb-navbtn:hover { background: #d5e2f2; border-color: #7f9fc8; color: #2a3f5f; }
/* hidden-Attribut MUSS greifen (sonst zeigt display:block den Admin-Link für alle) */
.hb-navbtn[hidden] { display: none; }
.hb-navbtn.hb-navbtn-admin,
.hb-navbtn.hb-navbtn-admin:link,
.hb-navbtn.hb-navbtn-admin:visited {
  margin-top: 4px; background: #5577aa; border-color: #4a6a99; color: #fff !important; font-weight: bold;
}
.hb-navbtn.hb-navbtn-admin:hover { background: #4a6a99; color: #fff !important; }

/* --- Legende --- */
.hb-legend {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin: 0 0 14px; font-size: 14px; color: var(--hb-text);
}
.hb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hb-legend i {
  width: 20px; height: 16px; border-radius: 3px; border: 1px solid var(--hb-border);
  display: inline-block;
}
.hb-legend .lg-frei   { background: var(--hb-frei); }
.hb-legend .lg-belegt { background: var(--hb-belegt); }
.hb-legend .lg-tour   { background: var(--hb-tour); }

.hb-hint { margin: 0 0 12px; font-size: 14px; color: #5577aa; min-height: 1.2em; }

/* --- Monatsraster (3 pro Reihe wie Original) --- */
.hb-months {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.hb-month {
  border: 1px solid var(--hb-border); border-radius: 6px; overflow: hidden;
  background: #fff;
}
.hb-month h3 {
  margin: 0; padding: 8px 6px; text-align: center; font-size: 15px;
  background: #5577aa; color: #fff; font-weight: 600;
}
/* Mit .hb-Prefix, um Theme-Regeln (.entry-content td, td-Reset) sicher zu überschreiben. */
.hb .hb-month table {
  width: 100%; border: 0; border-collapse: collapse; table-layout: fixed; margin: 0;
}
.hb .hb-month th {
  font-size: 11px; font-weight: 600; color: #666;
  border: 0; padding: 4px 0; line-height: normal;
  text-align: center; vertical-align: middle; background: #fafafa;
}
.hb .hb-month td {
  border: 0; padding: 2px; line-height: normal;
  text-align: center; vertical-align: middle; background: transparent;
}
.hb-cell {
  display: block; width: 100%;
  height: 34px; line-height: 34px;          /* senkrecht zentriert */
  text-align: center;                        /* waagerecht zentriert */
  font-size: 13px; color: var(--hb-text);
  background: var(--hb-frei); border: 1px solid #eee; border-radius: 3px;
  cursor: default; user-select: none;
  overflow: hidden;
}
.hb-cell.is-empty { background: transparent; border: none; }
.hb-cell.is-selectable { cursor: pointer; }
.hb-cell.is-selectable:hover { outline: 2px solid #5577aa; outline-offset: -2px; }
.hb-cell.is-past { color: #bbb; background: #fbfbfb; cursor: default; }
.hb-cell.is-today { font-weight: 700; box-shadow: inset 0 0 0 2px #333; }

.hb-cell.is-belegt { background: var(--hb-belegt); color: #10233b; }
.hb-cell.is-tour   { background: var(--hb-tour);   color: #0d2a0d; }
/* Tour UND Belegt am selben Tag: diagonaler Split (wie Vereins-Erweiterung) */
.hb-cell.is-belegt.is-tour {
  background: linear-gradient(135deg, var(--hb-belegt) 0%, var(--hb-belegt) 49%, var(--hb-tour) 50%, var(--hb-tour) 100%);
  color: #0d1f0d;
}
.hb-cell.is-selstart, .hb-cell.is-selrange {
  background: var(--hb-sel); color: #533; box-shadow: inset 0 0 0 2px #d9a400;
}

/* --- Tooltip --- */
.hb-tip {
  position: fixed; z-index: 9999; max-width: 260px;
  background: #222; color: #fff; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  pointer-events: none; opacity: 0; transition: opacity .1s;
}
.hb-tip.show { opacity: 1; }
.hb-tip strong { color: #ffe6a0; }

/* --- Login-Panel --- */
.hb-login {
  max-width: 380px; margin: 10px 0 0; padding: 18px 20px;
  border: 1px solid var(--hb-border); border-radius: 6px; background: #fafafa;
}
.hb-login h3 { margin: 0 0 12px; }
.hb-field { margin-bottom: 12px; }
.hb-field label { display: block; font-size: 14px; margin-bottom: 4px; }
.hb-field input {
  width: 100%; padding: 8px 10px; border: 1px solid #bbb; border-radius: 4px; font: inherit;
}
/* Buchungskasten in der Seitenleiste (Intern): flachere Datumsfelder.
   Bewusst nur hier, damit Buchungsdialog und Formulare unverändert bleiben. */
#intern-book .hb-field input { padding-top: 4px; padding-bottom: 4px; }
#intern-book .hb-field { margin-bottom: 9px; }

.hb-msg { min-height: 1.2em; font-size: 14px; margin: 6px 0 0; }
.hb-msg.err { color: #b23b3b; }
.hb-msg.ok  { color: #2f7d32; }

/* --- Modal (Buchungsdialog) --- */
.hb-modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center; z-index: 9000; padding: 16px;
}
.hb-modal-back.open { display: flex; }
.hb-modal {
  background: #fff; border-radius: 8px; width: 100%; max-width: 420px;
  padding: 20px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.hb-modal h3 { margin: 0 0 14px; }
.hb-modal .hb-row { display: flex; gap: 12px; }
.hb-modal .hb-row .hb-field { flex: 1; }
.hb-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.hb-detail-list { list-style: none; margin: 0 0 8px; padding: 0; }
.hb-detail-list li {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid #eee;
}
.hb-detail-list li .grow { flex: 1; }

/* --- Responsive: weniger Monate pro Reihe --- */
@media (max-width: 900px) { .hb-months { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hb-months { grid-template-columns: 1fr; } }

/* --- Verwaltung (admin.html) --- */
.hb-admin-grid { display: grid; grid-template-columns: 1fr; gap: 26px; }
.hb-panel { border: 1px solid var(--hb-border); border-radius: 6px; background: #fff; }
.hb-panel > h2 { margin: 0; padding: 10px 14px; font-size: 17px; background: #5577aa; color: #fff; border-radius: 6px 6px 0 0; }
.hb-panel-body { padding: 14px; }
.hb-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 14px; }
.hb-table th, .hb-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #d9d9d9; }
.hb-table th { background: #fafafa; font-weight: 600; border-bottom: 2px solid #c4c4c4; }
.hb-table td .hb-btn { padding: 4px 9px; font-size: 13px; }
.hb-form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hb-form-row .hb-field { flex: 1 1 140px; margin-bottom: 0; }
.hb-form-row .hb-field.check { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.hb-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #5577aa; color: #fff; font-size: 12px; }

/* --- Aufklappbare Verwaltungs-Panels --- */
.hb-collapsible > h2 { cursor: pointer; user-select: none; }
.hb-collapsible > h2::before { content: "\25BE  "; font-size: 13px; }        /* ▾ offen */
.hb-collapsible.collapsed > h2::before { content: "\25B8  "; }               /* ▸ zu */
.hb-collapsible.collapsed > .hb-panel-body { display: none; }

/* ---- Foto-Galerien (Admin-Verwaltung) ---- */
.hb .hb-muted { color: #777; font-size: 13px; }
.hb .gadm-row { border: 1px solid #ddd; border-radius: 6px; margin: 0 0 10px; overflow: hidden; }
.hb .gadm-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: #fafafa; flex-wrap: wrap; }
.hb .gadm-cover { width: 64px; height: 48px; object-fit: cover; border: 1px solid #ccc; border-radius: 3px; background: #eee; flex: 0 0 auto; }
.hb .gadm-nocover { display: inline-block; }
.hb .gadm-meta { flex: 1 1 160px; }
.hb .gadm-actions { flex: 0 0 auto; }
.hb .gadm-manage:not(:empty) { padding: 10px; border-top: 1px solid #eee; }
.hb .gadm-up { padding: 14px; border: 2px dashed #bbb; border-radius: 6px; text-align: center; margin-bottom: 12px; }
.hb .gadm-up.drag { border-color: #55aa55; background: #f0f8f0; }
.hb .gadm-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.hb .gthumb { position: relative; width: 100px; height: 75px; }
.hb .gthumb img { width: 100px; height: 75px; object-fit: cover; border: 1px solid #ccc; border-radius: 3px; display: block; }
.hb .gthumb-del { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: #c0392b; color: #fff; cursor: pointer; line-height: 1; font-size: 13px; }
.hb .gthumb-del:hover { background: #e04a3a; }
.hb .gthumb-nowm { position: absolute; left: 0; bottom: 0; background: rgba(200,120,0,.85);
  color: #fff; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 0 4px 0 3px; }
