/* ==========================================================================
   Arbeits-Template – Layout-Styles
   Ergänzt Bootstrap 5. Nur was Bootstrap nicht abdeckt, steht hier.
   Farb-Variablen zentral in :root → schnell umthemebar.
   ========================================================================== */
:root {
  --app-topbar-h: 54px;
  --app-sidebar-w: 250px;
  --app-sidebar-w-collapsed: 62px;
  --app-topbar-bg: #1f2733;
  --app-topbar-fg: #c7ced6;
  --app-accent: #5a96ff;
  --app-bg: #f4f6f9;
  --app-border: #e2e6ec;
}

html, body { height: 100%; margin: 0; }
body {
  background: var(--app-bg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden; /* App-Shell scrollt in den einzelnen Bereichen, nicht global */
}

/* ---------- Top-Iconbar (fixed) ---------------------------------------- */
.app-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--app-topbar-h); z-index: 1050;
  background: var(--app-topbar-bg);
  display: flex; align-items: center; gap: 2px; padding: 0 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.app-topbar__sep {
  width: 1px; height: 26px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .12); margin: 0 6px;
}
.app-topbar__spacer { flex: 1 1 0; min-width: 0; }

/* Icon-Button in der Topbar */
.app-iconbtn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 42px;
  border: 0; background: transparent; color: var(--app-topbar-fg);
  border-radius: 8px; font-size: 1.15rem; text-decoration: none; cursor: pointer;
  transition: background .12s, color .12s;
}
.app-iconbtn:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.app-iconbtn.active { background: rgba(90, 150, 255, .22); color: #fff; }

/* Icon-Leiste (die Nav-Icons, aus der überzählige ins Overflow-Menü wandern) */
.app-navicons { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 2px; }

/* Suchfeld */
.app-search { position: relative; flex: 0 0 auto; margin: 0 6px; }
.app-search i {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: #8b95a3; font-size: .9rem;
}
.app-search input {
  height: 36px; width: 200px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .10); color: #fff;
  padding: 0 12px 0 34px; font-size: .85rem; outline: none;
}
.app-search input::placeholder { color: #8b95a3; }

/* Ungelesen-Punkt auf der Glocke */
.app-badge-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  background: #ff5a5a; border-radius: 50%; border: 2px solid var(--app-topbar-bg);
}

/* ---------- Sidebar (fixed) -------------------------------------------- */
.app-sidebar {
  position: fixed; top: var(--app-topbar-h); bottom: 0; left: 0;
  width: var(--app-sidebar-w); z-index: 1040;
  background: #fff; border-right: 1px solid var(--app-border);
  display: flex; flex-direction: column;
  transition: width .16s ease, transform .18s ease;
}
.app-sidebar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid #eef1f5;
}
.app-sidebar__head .app-iconbtn { width: 32px; height: 32px; flex: 0 0 32px; color: #6b7482; font-size: 1rem; }
.app-sidebar__title {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  color: #9aa4b2; text-transform: uppercase;
}
.app-sidebar__body { flex: 1; overflow-y: auto; padding: 10px; }
.app-side-heading {
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; color: #9aa4b2;
  text-transform: uppercase; padding: 16px 12px 6px;
}
.app-side-filters { padding: 0 10px; }

/* Sidebar-Menülink */
.app-sidelink {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px; color: #3a4658;
  text-decoration: none; font-size: .9rem; white-space: nowrap; overflow: hidden;
}
.app-sidelink:hover { background: #eef1f6; color: #111; }
.app-sidelink.active { background: #e5edff; color: #1c4fd8; font-weight: 600; }
.app-sidelink i { font-size: 1.05rem; min-width: 20px; text-align: center; }

/* Eingeklappte Sidebar (Desktop) */
.app-shell.is-collapsed .app-sidebar { width: var(--app-sidebar-w-collapsed); }
.app-shell.is-collapsed .app-sidebar__head { justify-content: center; }
.app-shell.is-collapsed .app-sidelink { justify-content: center; padding: 9px 0; }
.app-shell.is-collapsed .app-sidelabel,
.app-shell.is-collapsed .app-side-heading,
.app-shell.is-collapsed .app-side-filters,
.app-shell.is-collapsed .app-sidebar__title { display: none !important; }

/* ---------- Content ----------------------------------------------------- */
.app-content {
  position: absolute; top: var(--app-topbar-h); right: 0; bottom: 0;
  left: var(--app-sidebar-w); overflow-y: auto; padding: 20px 24px;
  transition: left .16s ease;
}
.app-shell.is-collapsed .app-content { left: var(--app-sidebar-w-collapsed); }

/* ---------- Submenü im Dropdown ---------------------------------------- */
.dropdown-submenu > .dropdown-menu { display: none; }
.dropdown-submenu.open > .dropdown-menu {
  display: block; position: static; box-shadow: none; border: 0;
  padding-left: .75rem; margin: .1rem 0;
}

/* ---------- Benachrichtigungs-Overlay ---------------------------------- */
.app-notif { display: flex; gap: 8px; padding: 8px 16px; text-decoration: none; border-bottom: 1px solid #f3f5f8; }
.app-notif:hover { background: #f2f6ff; }
.app-notif.is-unread { background: #fbfcfe; }
.app-notif i { font-size: 1.1rem; margin-top: 2px; }
.app-notif__title { font-size: .85rem; font-weight: 500; line-height: 1.25; color: #1f2733; }
.app-notif.is-unread .app-notif__title { font-weight: 600; }
.app-notif__text { font-size: .8rem; color: #6c757d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-notif__time { font-size: .72rem; color: #6c757d; margin-top: 2px; }

/* ---------- Backdrop hinter der Mobil-Schublade ------------------------ */
.app-backdrop {
  position: fixed; inset: var(--app-topbar-h) 0 0 0;
  background: rgba(15, 20, 28, .45); z-index: 1035; display: none;
}

/* ---------- Scrollbar --------------------------------------------------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c4ccd6; border-radius: 20px; }

/* ==========================================================================
   MOBIL  (< 768px): Sidebar wird zur Schublade, Content volle Breite
   ========================================================================== */
@media (max-width: 767.98px) {
  .app-content { left: 0 !important; padding: 16px 14px; }
  .app-search { display: none; }
  .app-drawer-toggle { display: flex; }            /* Sidebar-Umschalter zeigen */

  .app-sidebar { width: 270px; transform: translateX(-105%); }
  .app-shell.is-drawer-open .app-sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0, 0, 0, .22); }
  .app-shell.is-drawer-open .app-backdrop { display: block; }

  /* Auf Mobil nie „collapsed“ – immer volle Beschriftung */
  .app-shell.is-collapsed .app-sidebar { width: 270px; }
  .app-shell.is-collapsed .app-sidelabel,
  .app-shell.is-collapsed .app-side-heading,
  .app-shell.is-collapsed .app-side-filters,
  .app-shell.is-collapsed .app-sidebar__title { display: revert !important; }
  .app-shell.is-collapsed .app-sidelink { justify-content: flex-start; padding: 9px 12px; }
}
@media (min-width: 768px) {
  .app-drawer-toggle { display: none; }             /* Umschalter nur mobil */
}

/* ==========================================================================
   Datentabelle (Grid statt <table> → volle Kontrolle)
   Spaltenraster pro Seite über eine Modifier-Klasse setzbar.
   ========================================================================== */
.data-table { background: #fff; border: 1px solid var(--app-border); border-radius: 10px; overflow-x: auto; font-size: .88rem; }
.data-table__grid { min-width: 720px; }
.data-table__row {
  display: grid;
  grid-template-columns: 80px minmax(0, 2fr) minmax(0, 1.4fr) 100px 110px 78px 34px;
  align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #f1f3f6;
}
.data-table__row:hover { background: #f7f9fb; }
.data-table__head {
  background: #f7f9fb; color: #6b7482; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid #eef1f5;
}
.data-table__num { font-variant-numeric: tabular-nums; color: #8b95a3; }

/* Spaltenraster der Buchungstabelle (Nr · Haus · Gruppe · Zeitraum · Gäste · Status · ⋯) */
.data-table--bookings .data-table__row {
  grid-template-columns: 82px minmax(0, 1.6fr) minmax(0, 1.4fr) 150px 70px 110px 34px;
}

/* ==========================================================================
   Statistik-Kacheln (Dashboard)
   ========================================================================== */
.stat-card {
  background: #fff; border: 1px solid var(--app-border); border-radius: 12px;
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
}
.stat-card__icon {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.stat-card__value { font-size: 1.5rem; font-weight: 700; color: #1f2733; line-height: 1.1; }
.stat-card__label { font-size: .8rem; color: #8b95a3; margin-top: 2px; }

/* Karten-Container für beliebige Inhaltsblöcke */
.app-card {
  background: #fff; border: 1px solid var(--app-border); border-radius: 12px; overflow: hidden;
}
.app-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #eef1f5;
}
.app-card__title { font-size: .95rem; font-weight: 600; color: #1f2733; margin: 0; }
.app-card__body { padding: 6px 0; }
