/*
 * static/hub-rahmen.css – Kopf, Seitenleiste, Profilblatt, Fußzeile, Anmeldung und „Was ist neu“ wie im Office Hub.
 *
 * Diese Datei steht GLEICH in Gastro Hub, woid•living Hub, Einblick und Woijd timeTrack (wie hub-dialog.js,
 * hub-wache.js, hub-arbeit.js) – nur gemeinsam ändern. Vorbild sind die Regeln in frontend/index.html des
 * Office (.header, .logo-main, .pill, .snav, #profile-panel, .pp-*, .footer, .login-*): Kupfer-Kopf mit Logo
 * und Anton-Schrift, Seitenleiste mit Symbolen, Profilblatt mit großem Bild, Fußzeile in IBM Plex Mono.
 *
 * Farben nur über Token. Die Grundpalette ist die des Office (Haut „bsc“); eine Haut (static/haut/<key>.css)
 * überschreibt sie wie bisher – deshalb wird diese Datei VOR den Häuten eingebunden. --hbg/--htx sind der Kopf.
 */
:root, html[data-theme="light"] {
  --bg: #f4f1ec; --bg2: #ebe7df;
  --surface: #ffffff; --surface2: #f8f5f0; --hover: rgba(181, 107, 67, .08);
  --border: #d8d0c4; --text: #1a1a18; --text-dim: #7a7060;
  --primary: #b56b43; --primary-h: #9a5a37; --on-primary: #ffffff; --secondary: #b56b43;
  --success: #3a7d44; --warning: #b57d2a; --danger: #c0392b;
  --shadow: rgba(181, 107, 67, .12);
  --hbg: #b56b43; --htx: #ffffff;
}
html[data-theme="dark"] {
  --bg: #141a12; --bg2: #1c2419;
  --surface: #1f2b1c; --surface2: #263320; --hover: rgba(212, 132, 90, .1);
  --border: #384d30; --text: #e8ede4; --text-dim: #8a9e82;
  --primary: #d4845a; --primary-h: #e09068; --on-primary: #ffffff; --secondary: #6b8060;
  --success: #5aad6a; --warning: #d4a04a; --danger: #e05545;
  --shadow: rgba(0, 0, 0, .35);
  --hbg: #1c2419; --htx: #e8ede4;
}
/* Glas-Häute kennen keinen eigenen Kopf-Ton: dort trägt der Kopf die Hauptfarbe der Haut */
html[data-haut]:not([data-haut="bsc"]) { --hbg: var(--primary); --htx: #ffffff; }

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; }

/* ── Kopf (Office: .header) ─────────────────────────────────────────── */
.hr-kopf {
  position: sticky; top: 0; z-index: 100; height: 56px; padding: 0 20px;
  display: flex; align-items: center; gap: 16px;
  background: var(--hbg); color: var(--htx); box-shadow: 0 2px 8px var(--shadow);
}
.hr-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; }
.hr-logo-img { height: 34px; width: auto; object-fit: contain; opacity: .88; border-radius: 4px; }
.hr-logo-main { font-family: 'Anton', sans-serif; font-size: 22px; letter-spacing: 3px; line-height: 1; color: #fff; white-space: nowrap; text-transform: uppercase; }
.hr-logo-sub { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 2px; opacity: .55; color: #fff; text-transform: uppercase; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-pill {
  display: flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; flex-shrink: 0;
  background: rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .9);
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .5px;
}
.hr-dot { width: 7px; height: 7px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.hr-pill.online .hr-dot { background: #6dde80; animation: hrBlink 2.5s ease-in-out infinite; }
.hr-pill.offline .hr-dot { background: #e05545; }
@keyframes hrBlink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .hr-pill.online .hr-dot { animation: none; } }
.hr-luecke { flex: 1; }
.hr-uhr { font-family: 'IBM Plex Mono', monospace; font-size: 12px; opacity: .65; letter-spacing: 1px; flex-shrink: 0; }
.hr-rund {
  height: 32px; min-width: 38px; padding: 0 12px; border: 0; border-radius: 20px; flex-shrink: 0;
  background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s;
}
.hr-rund:hover { background: rgba(255, 255, 255, .28); }
.hr-rund svg { width: 16px; height: 16px; }
.hr-av {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; flex-shrink: 0; overflow: hidden; cursor: pointer;
  background: var(--secondary); border: 2.5px solid rgba(255, 255, 255, .3); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; line-height: 1;
  transition: border-color .15s, box-shadow .15s;
}
.hr-av:hover, .hr-av[aria-expanded="true"] { border-color: rgba(255, 255, 255, .75); box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.hr-av img, .pp-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hr-burger { display: none; background: none; border: 0; color: var(--htx); cursor: pointer; padding: 4px; flex-shrink: 0; align-items: center; }

/* ── Profilblatt (Office: #profile-panel) ───────────────────────────── */
.hr-profil {
  position: fixed; top: 62px; right: 16px; width: 292px; max-height: calc(100vh - 78px); overflow-y: auto;
  overscroll-behavior: contain; z-index: 6300; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
  animation: hrPpIn .12s ease;
}
@keyframes hrPpIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.pp-head { padding: 18px 20px; background: var(--surface2); display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.pp-av {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: var(--secondary); color: #fff; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700;
}
.pp-info { flex: 1; min-width: 0; }
.pp-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-role { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 1px; }
.pp-body { padding: 6px 0; }
.pp-sec { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-dim); padding: 10px 18px 3px; font-weight: 700; }
.pp-row {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 9px 18px;
  border: 0; background: none; color: var(--text); text-align: left; text-decoration: none; font: inherit; cursor: pointer;
  transition: background .1s;
}
.pp-row:hover, .pp-row:focus-visible { background: var(--surface2); outline: none; }
.pp-row[hidden] { display: none; }
.pp-row-icon { width: 22px; flex-shrink: 0; display: flex; justify-content: center; color: var(--text-dim); }
.pp-row-icon svg { width: 18px; height: 18px; display: block; }
.pp-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-row-label { font-size: 13px; font-weight: 500; }
.pp-row-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-row.gefahr, .pp-row.gefahr .pp-row-icon { color: var(--danger); }
.pp-div { height: 1px; background: var(--border); margin: 4px 0; border: 0; }

/* ── Seitenleiste (Office: .snav) ───────────────────────────────────── */
.rumpf { display: flex; min-height: calc(100vh - 56px - 36px); }
#nav.nav {
  width: 238px; flex: 0 0 238px; padding: 4px 10px 12px; gap: 0;
  position: sticky; top: 56px; align-self: flex-start; height: calc(100vh - 56px - 36px); overflow-y: auto; overflow-x: hidden;
  background: var(--surface); border-right: 1px solid var(--border); border-bottom: 0;
  display: flex; flex-direction: column; scrollbar-width: thin;
}
.hr-gruppe {
  font-family: 'Anton', sans-serif; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary); padding: 13px 8px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#nav.nav button {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 9px; margin: 1px 0;
  border: 0; border-radius: 8px; background: none; color: var(--text);
  font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; white-space: nowrap;
}
#nav.nav button:hover { background: var(--surface2); }
#nav.nav button.an { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 600; }
.snav-ic { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-dim); }
#nav.nav button.an .snav-ic { color: var(--primary); }
.snav-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hr-nav-schleier { display: none; }
.inhalt { padding: 28px 24px 90px; }

/* ── Fußzeile (Office: .footer) ─────────────────────────────────────── */
.hr-fuss {
  position: sticky; bottom: 0; z-index: 40; height: 36px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--hbg); border-top: 1px solid rgba(255, 255, 255, .1);
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 1px; color: rgba(255, 255, 255, .45);
}
.hr-fuss-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hr-fuss-ver, .hr-fuss-knopf {
  border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer;
}
.hr-fuss-ver { border-bottom: 1px dotted currentColor; }
.hr-fuss-ver:hover, .hr-fuss-knopf:hover { color: rgba(255, 255, 255, .9); }
.hr-fuss-rechts { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.hr-fuss-knopf { padding: 4px 8px; border-radius: 6px; }
.hr-fuss-knopf:hover { background: rgba(255, 255, 255, .12); }
.hr-fuss-ws { display: flex; align-items: center; gap: 5px; }
.hr-fuss-dot { width: 6px; height: 6px; border-radius: 50%; background: #ccc; }
.hr-fuss-dot.an { background: #6dde80; }
.fb-knopf { bottom: 52px; }

/* ── Anmeldung (Office: .login-*) ───────────────────────────────────── */
.anmeldung { background: var(--bg); }
.hr-anm.anm-blatt { padding: 0; gap: 0; overflow: hidden; border-radius: 16px; box-shadow: 0 16px 48px var(--shadow); }
.hr-anm-kopf { background: var(--hbg); padding: 30px 32px 22px; text-align: center; color: #fff; }
.hr-anm-logo { height: 46px; width: auto; opacity: .9; margin-bottom: 10px; }
.hr-anm-titel { font-family: 'Anton', sans-serif; font-size: 28px; letter-spacing: 4px; line-height: 1.1; text-transform: uppercase; }
.hr-anm-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2px; color: rgba(255, 255, 255, .6); margin-top: 6px; text-transform: uppercase; }
.hr-anm-rumpf { padding: 26px 32px; display: flex; flex-direction: column; gap: 14px; }

/* ── „Was ist neu“ (Office: _showReleaseNoteModal) ──────────────────── */
.hr-neu-ov { position: fixed; inset: 0; z-index: 7000; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 18px; }
.hr-neu {
  width: 520px; max-width: 100%; max-height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.hr-neu-kopf { flex: 0 0 auto; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); }
.hr-neu-titel { font-family: 'Anton', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; font-size: 17px; }
.hr-neu-unter { font-size: 12px; opacity: .85; margin-top: 3px; }
.hr-neu-rumpf { flex: 1 1 auto; min-height: 120px; overflow: auto; padding: 12px 20px 16px; font-size: 14px; }
.hr-neu-abschnitt { margin-top: 16px; }
.hr-neu-version {
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--primary);
  border-bottom: 1px solid var(--border); padding-bottom: 5px;
}
.hr-neu-punkt { padding: 10px 0 2px; }
.hr-neu-punkt b { font-weight: 600; }
.hr-neu-marke { display: inline-block; margin-right: 8px; font-size: 9px; font-weight: 800; letter-spacing: .6px; border-radius: 5px; padding: 2px 7px; vertical-align: 1px; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.hr-neu-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 3px 0 0 2px; }
.hr-neu-fuss { flex: 0 0 auto; padding: 12px 20px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* ── Handy: Seitenleiste als Schublade hinter dem Burger (Office: max-width 900px) ── */
@media (max-width: 900px) {
  .hr-burger { display: inline-flex; }
  .hr-kopf { padding: 0 12px; gap: 10px; }
  .hr-uhr, .hr-pill span:last-child { display: none; }
  .hr-pill { padding: 4px 6px; }
  .hr-logo-main { font-size: 18px; letter-spacing: 2px; }
  .rumpf { flex-direction: row; }
  #nav.nav {
    position: fixed; left: 0; top: 56px; bottom: auto; height: calc(100vh - 56px); height: calc(100dvh - 56px); z-index: 450; width: 256px; flex-basis: 256px;
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0, 0, 0, .3);
    flex-direction: column; overflow-y: auto; border-bottom: 0;
  }
  #nav.nav.mob-open { transform: none; }
  #nav.nav button { min-height: 44px; }
  .hr-nav-schleier.an { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0, 0, 0, .35); z-index: 440; }
  .inhalt { padding: 18px 16px 90px; }
  .hr-fuss { padding: 0 12px; }
  .hr-fuss-ws { display: none; }
}
@media (max-width: 480px) {
  .hr-logo-sub { display: none; }
  .hr-logo-img { height: 28px; }
}
