:root {
  --primary: #0B4A86; --sidebar: #0B2C4A; --ink: #1F2933; --muted: #626E7D;
  --faint: #9AA5B1; --border: #DCE2E8; --bg: #EEF2F7; --card: #FFFFFF;
  --grid: #E4EAF1; --weekend: #F0F3F7; --today: #FFF6E0; --select: #E8F1FB;
  --ok: #11823B; --danger: #C0392B; --soft: #EDF1F6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink);
  background: var(--bg); font-size: 14px; }
h1, h2, h3 { margin: 0 0 .3em; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; background: var(--soft);
  color: var(--primary); white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-soft { background: var(--soft); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 6px 11px; background: transparent; color: var(--primary); font-size: 15px; }
.btn-block { width: 100%; justify-content: center; margin-top: 10px; }

/* ── Login ────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; }
.login-card { background: var(--card); padding: 30px 32px; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(11,44,74,.14); width: 340px; }
.login-card label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 13px; }
.login-card input { width: 100%; }
.login-foot { color: var(--faint); font-size: 12px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--primary);
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 17px; }
.brand-mark.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.brand-name { font-weight: 800; font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 12px; }

/* ── One-Branding (Wortmarke + Hero) ──────────────────────────────────── */
.one-word { font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.one-by { font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-weight: 600; letter-spacing: 4px; font-size: 12px; }
.brand-hero { display: flex; align-items: center; gap: 16px; }
.brand-hero-mark { width: 58px; height: 58px; }
.brand-hero-text { display: flex; flex-direction: column; }
.brand-hero .one-word { font-size: 44px; color: #fff; }
.brand-hero .one-by { color: #9DC4FF; margin-top: 3px; }
.login-hero { position: relative; overflow: hidden; background: #07172a; }
.login-hero::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: #0B2C4A url("/static/img/login-bg.jpg") center / cover no-repeat; }
.login-hero::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(8,24,44,.45) 0%, rgba(8,22,42,.80) 100%); }
.login-hero .brand-hero, .login-hero .login-card, .login-hero .login-foot {
  position: relative; z-index: 2; }
.login-hero .login-foot { color: rgba(255,255,255,.82); }

/* ── Login-Intro: Hintergrund öffnet sich, dann erscheint der Login ───────── */
.intro-curtain { position: fixed; inset: 0; z-index: 50; background: #07172a;
  pointer-events: none; display: none; }
.intro-skip { position: fixed; bottom: 18px; right: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.intro-skip:hover { background: rgba(255,255,255,.26); }
.intro-skip::before { content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #6FD3FF; }
.login-hero.intro-done .brand-hero, .login-hero.intro-done .login-card,
.login-hero.intro-done .login-foot, .login-hero.intro-done .intro-skip {
  animation: none !important; opacity: 1 !important; transform: none !important; }
.login-hero.intro-done::before { animation: none !important; transform: none !important; }
.login-hero.intro-done .intro-curtain { display: none !important; }

.login-hero.intro .intro-curtain { display: block; animation: curtainOut 1.3s ease-out forwards; }
.login-hero.intro::before { animation: heroZoom 7s ease-out forwards; }
.login-hero.intro .brand-hero { opacity: 0; animation: introUp 1s ease-out 1.1s forwards; }
.login-hero.intro .login-card { opacity: 0; animation: introUp 1.1s ease-out 1.9s forwards; }
.login-hero.intro .login-foot { opacity: 0; animation: introFade 1s ease-out 2.7s forwards; }
.login-hero.intro .intro-skip { opacity: 0; animation: introFade .6s ease-out .4s forwards; }
.login-hero.intro .intro-skip::before { animation: skipPulse 1.5s ease-out infinite; }
@keyframes curtainOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes introUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes introFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes skipPulse {
  0% { box-shadow: 0 0 0 0 rgba(111,211,255,.55); }
  70% { box-shadow: 0 0 0 8px rgba(111,211,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,211,255,0); } }
.topbar-mark { width: 26px; height: 26px; display: block; }
.topbar-word { font-size: 18px; color: #fff; }
.alert { background: #FDECEA; color: var(--danger); padding: 9px 12px; border-radius: 8px;
  font-size: 13px; margin-bottom: 6px; }

/* ── Inputs ───────────────────────────────────────────────────────────── */
input, select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--select); border-color: var(--primary); }

/* ── Topbar / Shell ───────────────────────────────────────────────────── */
.topbar { background: var(--sidebar); color: #fff; display: flex; align-items: center;
  gap: 14px; padding: 0 20px; height: 56px; }
.topbar-brand { font-weight: 700; display: flex; align-items: center; gap: 10px; color: #fff;
  flex-shrink: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ── Modul-Tabs (Schnellwechsler neben dem ONE-Logo) ───────────────────── */
.topbar-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 8px; color: rgba(255,255,255,.78); font-weight: 600; font-size: 13px;
  border: 1px solid transparent; white-space: nowrap; transition: background .12s, color .12s; }
.topbar-tab:hover { background: rgba(255,255,255,.10); color: #fff; }
.topbar-tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.topbar-tab-ico { font-size: 15px; line-height: 1; }
.topbar-tab-lbl { font-size: 13px; }
.topbar-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 42px; height: 36px; padding: 0 10px; background: rgba(255,255,255,.12); border: 0;
  border-radius: 8px; cursor: pointer; }
.topbar-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .2s, opacity .2s; }
.topbar.menu-open .topbar-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar.menu-open .topbar-toggle span:nth-child(2) { opacity: 0; }
.topbar.menu-open .topbar-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.firma-chip, .user-chip { font-size: 13px; color: #D7E6F4; }
.user-chip { opacity: .8; }
.firma-switch { background: #123a5e; color: #fff; border: 1px solid #1d4f7a; border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 13px; }
.firma-switch.admin-ansehen { background: #1b4f8a; border-color: #2c6fb5; max-width: 220px;
  font-weight: 600; }
.firma-switch.admin-ansehen option { font-weight: 400; background: #fff; color: var(--ink); }
.firma-switch.admin-ansehen option[value=""] { color: var(--muted); font-style: italic; }
.firma-switch.admin-ansehen optgroup { color: var(--primary); font-weight: 700; }
.field-hint { color: var(--faint); font-size: 11px; margin-top: 3px; }
.grid-table tr.active-row td { background: var(--select); }
.page { padding: 22px 26px; }
.page-head h1 { font-size: 22px; }

/* ── Dashboard tiles ──────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
  margin-top: 16px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; box-shadow: 0 4px 14px rgba(11,44,74,.05); transition: transform .1s; }
.tile:hover { transform: translateY(-2px); }
.tile-icon { font-size: 30px; } .tile-name { font-weight: 700; margin: 10px 0 4px; }
.tile-go { color: var(--primary); font-weight: 600; font-size: 13px; }
.tile-locked { opacity: .6; }
.tile-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.tile-link:hover { border-color: var(--primary); }
.tile-basis { border-color: var(--primary); background: linear-gradient(180deg, rgba(11,74,134,.06), var(--card)); }
.rk-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.rk-row > span { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.rk-row input[type=checkbox] { width: auto; }

/* Öffentliche Landingpage (pennone.de) – dunkel mit Bild-Hintergrund + Intro */
.lp-page { position: relative; min-height: 100vh; overflow: hidden; }
.lp-page::before { content: ""; position: fixed; inset: 0; z-index: -2;
  background: #0B2C4A url("/static/img/login-bg.jpg") center / cover no-repeat; }
.lp-page::after { content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7,23,42,.80), rgba(7,23,42,.93)); }
.lp { max-width: 940px; margin: 0 auto; padding: 18px 20px 60px; color: #fff; }
.lp-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 10px; }
.lp-brand { display: flex; align-items: center; gap: 10px; }
.lp-brand-name { font-size: 20px; font-weight: 600; color: #fff; }
.lp-hero { text-align: center; padding: 26px 10px 18px; }
.lp-brandhero { justify-content: center; margin-bottom: 16px; }
.lp-badge { display: inline-block; background: rgba(255,246,224,.16); border: 1px solid #E7C97a; color: #FFE6AE;
  border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.lp-hero h1 { font-size: 32px; line-height: 1.2; margin: 6px auto 10px; max-width: 720px; color: #fff; }
.lp-sub { color: rgba(255,255,255,.85); max-width: 640px; margin: 0 auto 18px; font-size: 16px; }
.lp-note { color: rgba(255,255,255,.72); font-size: 13px; margin-top: 12px; }
.lp-note a, .lp-kontakt a:not(.btn) { color: #9DC4FF; }
.lp-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lp-feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 26px 0; }
.lp-rechner { background: var(--card); color: var(--ink); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin: 26px 0; }
.lp-rechner h2 { color: var(--ink); }
.lp-rechner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.lp-kontakt { text-align: center; padding: 30px 10px; color: #fff; }
.lp-foot { text-align: center; color: rgba(255,255,255,.7); font-size: 13px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.15); }
.lp-foot a { color: #9DC4FF; }
/* Buttons für dunklen Hintergrund */
.btn-outline-light { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.12); }
.btn-ghost-light { background: transparent; border: 0; color: rgba(255,255,255,.85); }
.btn-ghost-light:hover { color: #fff; }
/* Intro: Vorhang + gestaffelter Aufbau */
.lp-curtain { position: fixed; inset: 0; z-index: 50; background: #07172a; display: none; }
.lp-skip { position: fixed; bottom: 18px; right: 18px; z-index: 60; display: none;
  background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; }
.lp-skip:hover { background: rgba(255,255,255,.28); }
.lp.intro .lp-curtain { display: block; animation: curtainOut 1.2s ease-out forwards; }
.lp.intro .lp-skip { display: block; opacity: 0; animation: introFade .6s ease-out .3s forwards; }
.lp.intro .lp-brandhero { opacity: 0; animation: introUp 1s ease-out .9s forwards; }
.lp.intro .lp-badge     { opacity: 0; animation: introUp .8s ease-out 1.3s forwards; }
.lp.intro .lp-hero h1   { opacity: 0; animation: introUp .9s ease-out 1.6s forwards; }
.lp.intro .lp-sub       { opacity: 0; animation: introUp .9s ease-out 2.0s forwards; }
.lp.intro .lp-cta       { opacity: 0; animation: introUp .9s ease-out 2.4s forwards; }
.lp.intro .lp-note      { opacity: 0; animation: introFade 1s ease-out 2.8s forwards; }
.lp.intro .lp-feat      { opacity: 0; animation: introUp .9s ease-out 3.0s forwards; }
.lp.intro .lp-rechner   { opacity: 0; animation: introUp .9s ease-out 3.4s forwards; }
.lp.intro .lp-kontakt   { opacity: 0; animation: introUp .9s ease-out 3.8s forwards; }
.lp.intro .lp-foot      { opacity: 0; animation: introFade 1s ease-out 4.1s forwards; }
@media (max-width: 640px) { .lp-rechner-grid { grid-template-columns: 1fr; } .lp-hero h1 { font-size: 24px; } }
.row-inline { display: flex; gap: 8px; align-items: center; margin: 4px 0 2px; }
.check-line { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-weight: 600; }
.check-line input { width: auto; }

/* ── Module head + subnav ─────────────────────────────────────────────── */
.module-head { background: var(--card); border-bottom: 1px solid var(--border); padding: 14px 26px 0; }
.module-title { font-weight: 800; font-size: 18px; }
.subnav { display: flex; gap: 4px; margin-top: 10px; }
.subnav a { padding: 9px 14px; border-radius: 8px 8px 0 0; font-weight: 600; color: var(--muted); }
.subnav a:hover { background: var(--soft); }
.subnav a.active { background: var(--primary); color: #fff; }
.badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px;
  font-size: 11px; font-weight: 700; }
.badge-warn { display: inline-grid; place-items: center; width: 17px; height: 17px;
  background: #9A6500; color: #fff; border-radius: 50%; font-size: 11px; font-weight: 800;
  line-height: 1; vertical-align: middle; }
.module-body { padding: 18px 26px; }

/* ── Modul-Titel + 4-Kachel-Symbol + Kachel-Übersicht ─────────────────────── */
.module-titlebar { display: flex; align-items: center; gap: 12px; }
.apps-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px;
  height: 34px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  color: var(--primary); cursor: pointer; flex: 0 0 auto; }
.apps-toggle:hover, .apps-toggle.on { background: var(--soft); }
.apps-toggle svg { fill: currentColor; }
.apps-overlay { padding: 14px 26px 0; }
.apps-group { margin-bottom: 16px; }
.apps-group-title { font-size: 12px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted, #667); margin: 0 0 8px 2px; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  box-shadow: 0 6px 18px rgba(11,44,74,.08); }
.app-tile { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 16px 10px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); font-weight: 600; color: var(--ink);
  transition: transform .1s, background .1s; }
.app-tile:hover { transform: translateY(-2px); background: var(--select); }
.app-tile.active { border-color: var(--primary); background: var(--select); }
.app-ico { font-size: 26px; line-height: 1; }
.app-lbl { font-size: 13px; }

/* ── Toolbar ──────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tb-label { font-weight: 600; color: var(--muted); }
.cal-title { font-weight: 700; font-size: 15px; min-width: 120px; text-align: center; }
.legend { display: flex; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.leg { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg a { padding: 7px 13px; font-weight: 600; color: var(--primary); }
.seg a.on { background: var(--primary); color: #fff; }
.hint { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; font-size: 15px; }

/* ── Organigramm-Board ────────────────────────────────────────────────── */
.board-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
  height: calc(100vh - 240px); }
.board { position: relative; }
.board-svg { position: absolute; top: 0; left: 0; pointer-events: none; }
.card { position: absolute; width: 196px; height: 96px; background: var(--card);
  border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px;
  box-shadow: 0 4px 12px rgba(11,44,74,.12); padding: 12px 14px; display: flex; gap: 10px;
  cursor: grab; user-select: none; }
.card.dragging { cursor: grabbing; box-shadow: 0 10px 24px rgba(11,44,74,.25); z-index: 50; }
.card-av { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700;
  display: grid; place-items: center; flex: 0 0 auto; }
.card-av.lg { width: 48px; height: 48px; font-size: 18px; }
.card-name { font-weight: 700; font-size: 13px; }
.card-pos { color: var(--muted); font-size: 12px; }
.card-dept { font-size: 10px; font-weight: 700; margin-top: 1px; }
.card-boss { color: var(--faint); font-size: 10px; margin-top: 4px; }
.link-del { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 1.5px solid var(--primary); color: var(--primary); font-weight: 700; line-height: 1;
  cursor: pointer; padding: 0; z-index: 40; }

/* ── Tabellen ─────────────────────────────────────────────────────────── */
.grid-table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.grid-table th { text-align: left; background: #EEF3F8; color: var(--primary); font-size: 12px;
  padding: 10px 12px; }
.grid-table td { padding: 10px 12px; border-top: 1px solid var(--grid); }
.grid-table tr.warn td { color: var(--danger); }
.grid-table.tight td { padding: 7px 12px; }
.row-actions { display: flex; gap: 6px; align-items: center; }

/* ── Arbeitsbereiche ──────────────────────────────────────────────────── */
.ab-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ab-name { font-weight: 700; font-size: 17px; }
.pill { margin-left: auto; background: var(--select); color: var(--primary); font-weight: 700;
  padding: 6px 14px; border-radius: 20px; }
.cat-title { font-size: 12px; font-weight: 700; color: var(--primary); margin: 16px 0 6px; }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.chip { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.chip-top { display: flex; align-items: center; gap: 8px; }
.chip-name { font-weight: 700; flex: 1; }
.chip-chain { color: var(--muted); font-size: 11px; margin-top: 6px; }
.role { color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.area-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.area-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.chain-row { display: flex; align-items: center; gap: 10px; padding: 3px 16px; }
.role-txt { font-weight: 700; width: 130px; font-size: 12px; }
.sec-title { font-size: 16px; }
.x { background: transparent; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.x.sm { font-size: 15px; }
.x:hover { color: var(--danger); }

/* ── Kalender ─────────────────────────────────────────────────────────── */
.cal-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); max-height: calc(100vh - 250px); }
.cal-grid { position: relative; }
.cal-bg { position: absolute; pointer-events: none; }
.cal-bg .band { position: absolute; top: 0; bottom: 0; }
.cal-bg .weekend { background: var(--weekend); }
.cal-bg .today { background: var(--today); }
.cal-bg .monthband { background: #F6F8FB; }
.cal-bg .vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.cal-bg .today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #E0A100; }
.cal-row { display: flex; height: var(--rowh); }
.cal-headrow { height: var(--headh); position: sticky; top: 0; z-index: 6; }
.cal-name { width: var(--neww); flex: 0 0 var(--neww); padding: 5px 12px; background: var(--card);
  position: sticky; left: 0; z-index: 5; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--grid); }
.cal-namehead { background: #EEF3F8; color: var(--primary); font-weight: 700; z-index: 7;
  display: flex; align-items: center; }
.cn { font-weight: 700; font-size: 13px; }
.cc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cc.over { color: var(--danger); }
.cal-track { position: relative; flex: 1; border-bottom: 1px solid var(--grid); }
.cal-headrow .cal-track { background: #EEF3F8; }
.dhead { position: absolute; top: 0; bottom: 0; text-align: center; display: flex;
  flex-direction: column; justify-content: center; }
.dhead.we { color: #A0461F; }
.dhead .wd { font-size: 9px; color: var(--muted); }
.dhead .dn { font-size: 11px; font-weight: 700; }
.dhead .dn.today { color: var(--primary); }
.mhead { position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700; }
.abw-bar { position: absolute; top: 7px; bottom: 7px; border-radius: 5px; color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; }
.abw-bar.pending { background-image: repeating-linear-gradient(45deg,
  rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,44,74,.45);
  display: grid; place-items: center; z-index: 100; }
.modal { background: var(--card); border-radius: 14px; padding: 22px 24px; width: 480px;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 60px); overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.modal input, .modal select { width: 100%; }
.modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.modal .grid2 label { margin-top: 6px; }
.check { display: flex !important; align-items: center; gap: 8px; margin-top: 12px; font-weight: 500 !important; }
.check input { width: auto !important; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; align-items: center; }
.detail p { margin: 4px 0; }

/* ── Einstellungen ────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.panel-accent { border: 1px solid #B9D2EC; box-shadow: 0 2px 10px rgba(11,74,134,.08); }
.panel-accent h2 { color: var(--primary); }
.panel h2 { font-size: 16px; }
.switch { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 600; }
.switch input { width: auto; }
.inline-form { display: inline-flex; gap: 8px; margin: 4px 0; }

/* ── Benutzerverwaltung / Rechte / Passwörter ─────────────────────────── */
.link-sm { color: var(--primary); font-size: 13px; font-weight: 600; }
.pw-banner { background: #FFF6E0; border: 1px solid #E7C97a; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; }
.pw-banner code { background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 10px; font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.pw-banner span { color: var(--muted); font-size: 13px; }
.support-banner { background: #FDECEA; border-bottom: 2px solid #E2998F; color: #7A2E26;
  padding: 8px 22px; font-size: 13px; }
.support-banner a { color: #7A2E26; font-weight: 700; margin-left: 8px; }
.group-banner { background: #EAF2FB; border-bottom: 2px solid #9DC4FF; color: #0B3A66;
  padding: 8px 22px; font-size: 13px; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.row-form label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600;
  color: var(--muted); gap: 3px; }
.row-form input, .row-form select { min-width: 180px; }
.perm-form { display: flex; flex-direction: column; gap: 6px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2px 12px; }
.check.sm { font-size: 12px; margin: 2px 0; font-weight: 500 !important; }
/* NMGone-Rechte-Picker: viele Rechte → einklappbar + scrollbar */
.nmgone-picker summary { cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.nmgone-picker[open] { max-height: 360px; overflow-y: auto; padding: 6px 8px; min-width: 320px;
  border: 1px solid var(--line, #e2e2e2); border-radius: 8px; margin-top: 4px; }
.nmgone-modul { margin: 6px 0; }
.nmgone-modul > b { font-size: 12px; color: var(--faint, #666); }
.filter-box { width: 100%; max-width: 320px; margin-bottom: 12px; }
.tag-ok { color: var(--ok); font-weight: 600; }
.tag-warn { color: #9A6500; font-weight: 600; }
.tag-off { color: var(--faint); font-weight: 600; }
.tag-soft { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--soft, #eef1f6); color: var(--muted); font-size: .78em; font-weight: 600;
  vertical-align: middle; }
.mini-select { font-size: .82em; padding: 3px 6px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card); color: inherit; max-width: 190px; }
.autobar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.autobar .switch { margin: 0; }
.todo-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid #E7C97a; background: #FFF6E0; border-radius: 10px; }
.todo-item.done { border-color: #9ED6B4; background: #E9F6EE; }
.todo-mark { font-size: 18px; font-weight: 700; color: #9A6500; line-height: 1.2; }
.todo-item.done .todo-mark { color: var(--ok); }
.todo-title { font-weight: 700; }
.env-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.env-list code { background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; }
.admin-menu { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.zhint { display: inline-block; font-size: 11px; color: var(--muted); background: var(--soft);
  border-radius: 5px; padding: 1px 7px; margin: 1px 3px 1px 0; }
.zhint.warn { color: #fff; background: var(--danger); }
details summary { cursor: pointer; }
textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 13px; resize: vertical; }
.preis-modul { border-top: 1px solid var(--grid); padding-top: 12px; margin-top: 12px; }
.preis-modul h3 { font-size: 14px; margin-bottom: 6px; }
.konto-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ks-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 18px; min-width: 120px; }
.ks-label { color: var(--muted); font-size: 12px; }
.ks-val { font-size: 20px; font-weight: 700; }
.ks-card.pos { border-color: #9ED6B4; } .ks-card.pos .ks-val { color: var(--ok); }
.ks-card.neg { border-color: #E7a9a0; } .ks-card.neg .ks-val { color: var(--danger); }
.grid-table tr.we-row td { background: #F8FAFC; color: var(--muted); }
.grid-table td.neg, .neg { color: var(--danger); }

/* ── Dienstplan ───────────────────────────────────────────────────────── */
.dp-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.dp-table { border-collapse: collapse; width: 100%; }
.dp-table th, .dp-table td { border: 1px solid var(--grid); padding: 4px; vertical-align: top; min-width: 84px; }
.dp-table th { background: #EEF3F8; font-size: 11px; font-weight: 700; text-align: center; }
.dp-table th.we, .dp-cell.we { background: var(--weekend); }
.dp-table th.today { background: var(--today); }
.dp-name { position: sticky; left: 0; background: var(--card); z-index: 2; min-width: 150px;
  font-weight: 700; font-size: 13px; text-align: left; }
th.dp-name { z-index: 3; }
.dp-cell { cursor: pointer; height: 52px; }
.dp-cell:hover { background: var(--select); }
.dp-dienst { display: block; color: #fff; border-radius: 6px; padding: 3px 6px; font-size: 11px;
  font-weight: 700; margin-bottom: 2px; line-height: 1.15; }
.dp-dienst small { font-weight: 500; opacity: .9; }
/* Kompakt-Ansicht: nur ein Anwesenheitsfenster „08–16" je Person/Tag */
.dp-compact-bar { display: none; color: #fff; background: #0B4A86; border-radius: 6px;
  padding: 3px 6px; font-size: 11px; font-weight: 700; line-height: 1.15; box-sizing: border-box; }
/* Kompakt-Balken einer Zelle, die (auch) einen unbestätigten Vorschlag enthält */
.dp-compact-vor { background: #4a6b8a; border: 2px dashed rgba(255,255,255,.95); }
body.dp-compact .dp-dienst { display: none; }
body.dp-compact .dp-compact-bar { display: inline-block; }
/* Vorschlags-Blöcke: deutlich gestrichelt markiert, anklickbar (Übernehmen/Ablehnen).
   So sind Vorschläge auf einen Blick vom festen Plan (durchgezogen) unterscheidbar. */
.dp-vorschlag { box-sizing: border-box; border: 2px dashed rgba(255,255,255,.95);
  cursor: pointer; opacity: .9; }
.dp-vorschlag:hover { filter: brightness(1.1); opacity: 1; }
.dp-vor-tag { font-size: 10px; margin-right: 1px; }
.vor-block { margin: 8px 0; }
.vor-label { font-size: 11px; font-weight: 700; color: #667; margin-bottom: 4px; text-transform: uppercase; }
.dp-x { background: rgba(255,255,255,.25); border: 0; color: #fff; border-radius: 4px;
  cursor: pointer; font-weight: 700; float: right; }
.dp-abw { display: block; color: #fff; border-radius: 6px; padding: 3px 6px; font-size: 11px;
  font-weight: 700; margin-bottom: 2px; line-height: 1.15; }
.dp-abw.pending { background-image: repeating-linear-gradient(45deg,
  rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }
.dp-wunsch { display: block; font-size: 10px; background: #FFF6E0; border: 1px solid #E7C97a;
  border-radius: 5px; padding: 1px 4px; margin-top: 2px; color: #8a5a00; }
.dp-wunsch.beruecksichtigt { background: #E9F6EE; border-color: #9ED6B4; color: var(--ok); }
.dp-wunsch.abgelehnt { background: #FDECEA; border-color: #E7a9a0; color: var(--danger); text-decoration: line-through; }
.dp-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.initpw { background: #FFF6E0; border: 1px solid #E7C97a; border-radius: 6px; padding: 2px 8px;
  font-size: 14px; font-weight: 700; letter-spacing: 1px; color: #8a5a00; }
.beleg-line { display: flex; justify-content: space-between; }

/* ════════════════════════════════════════════════════════════════════════
   Mobil / Tablet — Responsive-Schicht (alles additiv, nur in @media)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Tablet & kleiner: Ränder & mehrspaltige Raster entspannen ──────────── */
@media (max-width: 860px) {
  .page { padding: 16px 14px; }
  .module-head { padding: 12px 16px 0; }
  .module-body { padding: 16px; }
  .apps-overlay { padding: 12px 16px 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Handy: Layout auf eine Spalte, Topbar umbrechen, Tap-Targets ───────── */
@media (max-width: 640px) {
  /* iOS zoomt bei Fokus auf Felder < 16px — daher 16px erzwingen */
  input, select, textarea { font-size: 16px; }

  /* Topbar: Aktionen hinter Hamburger-Menü verstecken */
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 14px; gap: 8px 10px; }
  .topbar-toggle { display: inline-flex; margin-left: auto; }
  .topbar-right { display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.16); margin-left: 0; }
  .topbar.menu-open .topbar-right { display: flex; }
  .topbar-right .btn { width: 100%; justify-content: flex-start; padding: 11px 12px; }
  .firma-switch { width: 100%; }
  .firma-chip, .user-chip { width: 100%; padding: 4px 2px; opacity: 1; }
  .user-chip { order: -1; font-weight: 600; }    /* Name zuoberst im Menü */

  /* Modul-Tabs: eigene Zeile unter Logo+Toggle, horizontal scrollbar */
  .topbar-tabs { order: 99; width: 100%; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,.10); }
  .topbar-tab { padding: 8px 12px; }

  /* Login: Karte & Hero fluid */
  .login-card { width: 100%; max-width: 360px; padding: 26px 22px; }
  .brand-hero { gap: 12px; }
  .brand-hero-mark { width: 46px; height: 46px; }
  .brand-hero .one-word { font-size: 34px; }

  /* Seitenkopf & Kacheln */
  .page-head h1 { font-size: 19px; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .perm-grid { grid-template-columns: 1fr; }

  /* Subnav horizontal scrollbar statt Umbruch-Chaos */
  .module-head { overflow-x: auto; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .subnav a { white-space: nowrap; }

  /* Breite Tabellen werden für sich horizontal scrollbar */
  .grid-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Filter-/Zeilenformulare stapeln statt nebeneinander quetschen */
  .row-form { flex-direction: column; align-items: stretch; }
  .row-form label { width: 100%; }
  .row-form input, .row-form select { min-width: 0; width: 100%; }
  .filter-box { max-width: none; }

  /* Toolbar: Legende nicht nach rechts drücken */
  .legend { margin-left: 0; width: 100%; }

  /* Modal: zweispaltige Felder auf eine Spalte */
  .modal .grid2 { grid-template-columns: 1fr; }

  /* Admin-/Konto-Leisten sauber umbrechen */
  .konto-summary .ks-card { flex: 1 1 calc(50% - 12px); min-width: 0; }
}

/* ── Modul „Einsatzplanung" (planung) ─────────────────────────────────────── */
.banner { background: #FFF6E5; border: 1px solid #F0D9A8; color: #7a5800;
  padding: 10px 14px; border-radius: 10px; margin: 12px 0; }
.tiles2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 4px 14px rgba(11,44,74,.05); }
.panel h3 { margin: 0 0 6px; }
.panel form { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.datenav { display: flex; gap: 10px; align-items: center; margin: 6px 0 16px; flex-wrap: wrap; }
.statrow { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 18px; min-width: 130px; box-shadow: 0 3px 10px rgba(11,44,74,.04); }
.stat-num { font-size: 22px; font-weight: 800; color: var(--primary); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar-wrap { position: relative; background: #EEF3F8; border-radius: 6px; height: 20px; min-width: 160px; }
.bar { background: var(--primary); height: 100%; border-radius: 6px; min-width: 2px; }
.bar-cap { position: absolute; left: 8px; top: 1px; font-size: 11px; color: var(--ink); }
.heatmap .cell { display: inline-block; min-width: 2.6em; padding: 3px 8px; border-radius: 7px;
  font-weight: 700; color: #fff; font-size: 12px; }
.cell-ok    { background: #1f8a4c; }
.cell-unter { background: #c0392b; }
.cell-ueber { background: #2f6fa6; }

/* Wochenraster + Vorschlag */
.weekgrid td, .weekgrid th { padding: 6px 8px; }
.wk { color: #fff; font-weight: 700; font-size: 12px; border-radius: 6px; }
.wk-ok    { background: #1f8a4c; }
.wk-unter { background: #c0392b; }
.wk-ueber { background: #2f6fa6; }
.wk-sum td { background: #f6f9fb; font-size: 12px; }
.wunschliste { list-style: none; padding: 0; margin: 8px 0; }
.wunschliste li { background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 6px; }

/* Auswertung – Balkendiagramme */
.charts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 720px){ .charts2 { grid-template-columns: 1fr; } }
.barrow { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.barlbl { width: 2.6em; font-size: 12px; color: var(--muted); text-align: right; flex: none; }
.barval { font-size: 12px; font-weight: 600; width: 4.5em; text-align: right; flex: none; }
.barrow .bar-wrap { flex: 1; min-width: 60px; }

/* Notdienst-Jahreskalender */
.nd-legend { color:#fff; background:#c0392b; padding:0 6px; border-radius:5px; font-weight:700; }
.cal-year { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px,1fr)); gap:14px; margin-top:8px; }
.cal-month { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:10px 12px; }
.cal-mname { font-weight:700; color:var(--primary); margin-bottom:6px; }
.cal-grid { width:100%; border-collapse:collapse; }
.cal-grid th { font-size:10px; color:var(--faint); font-weight:600; padding:2px 0; text-align:center; }
.cal-day { text-align:center; font-size:12px; padding:5px 0; cursor:pointer; border-radius:6px;
  user-select:none; transition:background .08s; }
.cal-day:hover { background:#e7eef5; }
.cal-day.we { color:var(--muted); }
.cal-day.fei { color:#b8860b; }
.cal-day.nd { background:#c0392b !important; color:#fff !important; font-weight:700; }
.cal-empty { padding:5px 0; }

/* Info-Icon (ℹ) */
.info-i { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px;
  border-radius:50%; background:var(--primary); color:#fff; font-size:11px; font-weight:700;
  cursor:help; font-style:normal; vertical-align:middle; }

/* Dienstplan – firmenübergreifende Doppelplanung */
.banner-warn { background:#fdecea; border:1px solid #f5b7b1; color:#922b21; }
.banner-info { background:#eaf2fb; border:1px solid #b7d3f0; color:#1b4e84; }
.dp-cell.dp-konflikt { outline:2px solid #c0392b; outline-offset:-2px; background:#fdecea; }
.dp-konflikt-flag { float:right; font-size:12px; line-height:1; }

/* ── Dark Mode (Variablen-Override) ─────────────────────────────────────── */
body.theme-dark {
  --primary:#4a9eff; --sidebar:#0b1622; --ink:#e6edf3; --muted:#9fb0c0;
  --faint:#6b7c8c; --border:#2b3a4a; --bg:#0f1620; --card:#1a2430;
  --grid:#243140; --weekend:#161f2a; --today:#33300f; --select:#20344a;
  --ok:#3ec46a; --danger:#e05a4d; --soft:#1f2c3a;
}
body.theme-dark input, body.theme-dark select, body.theme-dark textarea { background:#141d28; color:var(--ink); }
body.theme-dark .topbar-tab.active { background:#1a2430; color:#fff; }
body.theme-dark .modal { background:var(--card); color:var(--ink); }

/* ── Gruppierte Modul-Navigation (Überschrift → Menü) ──────────────────────── */
.subnav-grp { display:flex; gap:4px; flex-wrap:wrap; padding:0 4px; }
.navg { position:relative; }
.navg-head { background:transparent; border:0; font:inherit; font-weight:600; color:var(--muted);
  padding:9px 14px; border-radius:8px 8px 0 0; cursor:pointer; white-space:nowrap; }
.navg-head.active, .navg:hover .navg-head { color:var(--primary); background:var(--card); }
.navg-arrow { font-size:9px; opacity:.55; }
.navg-menu { position:absolute; top:100%; left:0; z-index:50; min-width:215px; background:var(--card);
  border:1px solid var(--border); border-radius:0 8px 8px 8px; box-shadow:0 10px 26px rgba(0,0,0,.16);
  padding:5px; display:none; }
.navg:hover .navg-menu, .navg.open .navg-menu { display:block; }
.navg-menu a { display:block; padding:7px 11px; border-radius:6px; color:var(--ink); font-weight:500; white-space:nowrap; }
.navg-menu a:hover { background:var(--soft); }
.navg-menu a.active { background:var(--soft); color:var(--primary); font-weight:700; }
/* Dashboard-Cockpit Handlungskarten */
.cockpit { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 16px; }
.cockcard { flex:1; min-width:150px; background:var(--card); border:1px solid var(--border);
  border-left:5px solid var(--primary); border-radius:12px; padding:12px 14px; text-decoration:none; color:var(--ink); }
.cockcard.warn { border-left-color:#c0392b; } .cockcard.ok { border-left-color:#2e9e52; }
.cockcard .ck-n { font-size:1.7rem; font-weight:800; line-height:1; }
.cockcard .ck-l { font-size:.82rem; color:var(--muted); margin-top:3px; }
