: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;
  justify-content: space-between; padding: 0 20px; height: 56px; }
.topbar-brand { font-weight: 700; display: flex; align-items: center; gap: 10px; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.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; }
.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; }

/* ── 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-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; }
.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; }
.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; }
.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; }
.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; }
  .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); }
  .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ü */

  /* 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; }
}
