/* Chronio – vorläufige Web-Oberfläche (Meilenstein 1). Design gemäß abgenommener UI-Vorschau. */
:root {
  --accent: #0F766E;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --ink: #14181F;
  --ink-2: #3B4350;
  --muted: #5B6472;
  --line: #E3E7EC;
  --ground: #F4F6F8;
  --card: #FFFFFF;
  --ok-bg: #ECFDF5; --ok: #14532D;
  --warn-bg: #FEF3C7; --warn: #78350F;
  --err-bg: #FEE2E2; --err: #991B1B;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 28px; }
h2 { font-size: 16px; }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 220px; background: var(--card); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.nav .brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.logo { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none; }
.brand-name { font-weight: 700; font-size: 18px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a { display: block; min-height: 44px; line-height: 44px; padding: 0 14px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav-links a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.me { margin-top: auto; display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--ground); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #DCE7E6; color: #134E4A; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; }

.row { display: flex; flex-wrap: wrap; gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.grow2 { flex: 2 1 420px; } .grow1 { flex: 1 1 260px; } .grow3 { flex: 3 1 420px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.big { font-size: 56px; font-weight: 600; letter-spacing: -1px; line-height: 1; }
.stat { font-size: 30px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; background: var(--ground); border-radius: 999px; padding: 6px 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8A94A3; }
.dot.on { background: #15803D; } .dot.pause { background: #B45309; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid #C9D0D8; background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
label.inline { flex-direction: row; align-items: center; font-weight: 500; }
input, select, textarea { min-height: 44px; border-radius: 10px; border: 1px solid #C9D0D8; padding: 0 12px; background: #fff; color: var(--ink); }
textarea { padding: 10px 12px; min-height: 80px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.note { border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.err { background: var(--err-bg); color: var(--err); }
.list { display: flex; flex-direction: column; }
.item { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid #EEF1F4; }
.item:first-child { border-top: none; }
.item .grow { flex: 1 1 200px; min-width: 0; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #F1F5F9; color: #334155; white-space: nowrap; }
.tag.green { background: #DCFCE7; color: #166534; } .tag.amber { background: #FEF3C7; color: #92400E; } .tag.red { background: #FEE2E2; color: #991B1B; } .tag.accent { background: var(--accent-soft); color: var(--accent); }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar { width: 100%; max-width: 56px; border-radius: 8px 8px 0 0; background: var(--accent); opacity: .55; }
.bar.today { opacity: 1; }
.bar-labels { display: flex; gap: 12px; } .bar-labels span { flex: 1 1 0; text-align: center; font-size: 13px; color: var(--muted); }
.sig-pad { border: 1px dashed #B8C0CA; border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 160px; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 400px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.hidden { display: none !important; }
code.key { font-size: 14px; word-break: break-all; background: var(--ground); padding: 8px; border-radius: 8px; display: block; }
@media (max-width: 640px) {
  .main { padding: 16px; }
  .nav { flex-basis: 100%; min-width: 0; max-width: 100vw; padding: 12px; gap: 12px; }
  .nav-links { flex-direction: row; overflow-x: auto; max-width: 100%; }
  .nav-links a { white-space: nowrap; }
  .me { display: none; }
  .big { font-size: 44px; }
}

/* Meilenstein 2: Ampel, Tabellen */
.stat.pos { color: #166534; } .stat.neg { color: #991B1B; }
.amp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: currentColor; }
.tag.amp-gruen { background: #DCFCE7; color: #166534; }
.tag.amp-gelb { background: #FEF3C7; color: #92400E; }
.tag.amp-rot { background: #FEE2E2; color: #991B1B; }
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.table input { min-height: 36px; }
h3 { font-size: 14px; margin-top: 4px; }
ol.small { margin: 0; padding-left: 20px; line-height: 1.6; color: var(--ink-2); }
details > summary { cursor: pointer; min-height: 32px; }

/* Version 0.3: Notizen, AU */
.note-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.note-box.lvl-lead { border-left: 4px solid #1D4ED8; }
.note-box.lvl-hr { border-left: 4px solid #6D28D9; }
.note-box.lvl-employee { border-left: 4px solid var(--accent); }
.pre { white-space: pre-wrap; margin: 0; }
.item .full { flex-basis: 100%; }
details.au > summary { font-size: 14px; color: var(--accent); font-weight: 600; }

/* Version 0.4: Zeiten, Kalender, Dokumente, Personen, Einstellungen */
.badge { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: #B91C1C; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.logo-img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.seg { display: inline-flex; gap: 6px; }
.period { min-width: 190px; text-align: center; align-self: center; }
.btns.tight { gap: 6px; align-items: center; }
.table.times td { vertical-align: middle; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .num.neg, .neg { color: #991B1B; } .table .num.pos { color: #166534; }
.table tr.we td { background: #F8FAFC; }
.table tr.hol td { background: #F0FDFA; }
.table tr.today td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table tfoot td { border-top: 2px solid var(--line); border-bottom: none; }
button.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0 4px; font-size: 13px; min-height: 0; text-decoration: underline; }
.accent-border { border-color: var(--accent); }
/* Kalender */
.cal { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.cal th, .cal td { border-bottom: 1px solid #EEF1F4; }
.cal thead th { font-weight: 600; color: var(--muted); padding: 4px 0; width: 28px; min-width: 28px; text-align: center; line-height: 1.3; }
.cal .cal-name { position: sticky; left: 0; background: var(--card); text-align: left; padding: 6px 12px 6px 0; min-width: 170px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 500; z-index: 1; }
.cal tr.mine .cal-name { font-weight: 700; }
.cal-cell { height: 34px; width: 28px; min-width: 28px; border-left: 1px solid #F1F5F9; }
.cal .we { background: #F1F5F9; }
.cal .hol { background: #CCFBF1; }
.cal td.today, .cal th.today { box-shadow: inset 0 0 0 2px var(--accent); }
.abs-urlaub { background: var(--accent) !important; }
.abs-krank { background: #DC2626 !important; }
.abs-sonstiges { background: #D97706 !important; }
.abs-abwesend { background: #64748B !important; }
.pending { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.65) 0 4px, transparent 4px 8px) !important; }
.half { background-image: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.85) 50%) !important; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.legend .lg { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); }
.legend .lg.we { background: #F1F5F9; } .legend .lg.hol { background: #CCFBF1; }
/* Dokumente */
.doc-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0; }
.checks.roles { gap: 4px 12px; }
label.role { font-size: 13px; }
/* Personen */
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.table.people td { vertical-align: middle; }
.table tr.inactive td { opacity: .55; }
.ro { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--ground); font-weight: 400; color: var(--ink); }
/* Einstellungen */
label.feature { align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #EEF1F4; }
label.feature input { margin-top: 3px; min-height: 0; width: 18px; height: 18px; }
.block { display: block; font-weight: 400; }
.preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; min-height: 180px; background: var(--ground); }
.preview-nav { flex: 0 0 210px; background: var(--card); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.preview-nav a { padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.preview-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.preview-main { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.preview .btn.primary { background: var(--accent); border-color: var(--accent); }
.preview .tag.accent { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) {
  .preview { flex-direction: column; } .preview-nav { flex-basis: auto; }
  .period { min-width: 0; }
  .cal .cal-name { min-width: 110px; max-width: 130px; }
}
.nowrap { white-space: nowrap; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.item.approval { align-items: flex-start; }
.cb-spacer { width: 16px; text-align: center; color: var(--muted); }
.tabs .badge { margin-left: 6px; }

/* Gleichmäßiges Formularraster: Felder bündig, Erläuterungen darunter */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; align-items: start; }
.grid3 .cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.grid3 .cell > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid3 .cell > label > input, .grid3 .cell > label > select { width: 100%; }
.form > label { justify-content: space-between; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } .grid3 .cell > label { white-space: normal; } }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-height: 90px; }

/* Zwei-Faktor-Einrichtung */
.qr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; align-self: center; }
.qr img { width: 240px; height: 240px; max-width: 100%; image-rendering: pixelated; }
ol.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.code-input { font-size: 22px; letter-spacing: 6px; width: 170px; text-align: center; font-variant-numeric: tabular-nums; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.codes code { font-size: 15px; background: #fff; padding: 6px 10px; border-radius: 8px; text-align: center; letter-spacing: 1px; }
.login .card.wide { max-width: 520px; }
@media print { .nav, .btns, button, .no-print { display: none !important; } .main { padding: 0 !important; } .card { box-shadow: none !important; border: 1px solid #999; break-inside: avoid; } }
.warn-text { color: var(--warn); font-weight: 600; }
.nav a.emergency { color: var(--err); font-weight: 600; }
.emergency-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: baseline; justify-content: space-between; }
.emergency-count { font-size: 40px; font-weight: 700; color: var(--err); }
.mustered { text-decoration: line-through; color: var(--muted); }
.steps-list { margin: 0; padding-left: 20px; font-size: 13px; }
.budget-bar { width: 140px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.budget-fill { height: 100%; background: var(--accent); }
.budget-fill.warn { background: #D97706; }
.budget-fill.over { background: var(--err); }

/* Version 0.9.2: Seitenleiste in der Breite verstellbar, Inhalt rechts unabhängig scrollbar */
.nav-links a { white-space: nowrap; padding-right: 22px; overflow: hidden; text-overflow: ellipsis; }
.nav .brand, .nav .me { width: 0; min-width: 100%; }           /* Firmenname/Person bestimmen die Breite nicht mit */
.nav .brand > div, .nav .me > div { min-width: 0; overflow-wrap: anywhere; }
.nav-resizer { display: none; }
.main > .note[role="status"] { position: sticky; top: 0; z-index: 5; box-shadow: 0 4px 14px rgba(20, 24, 31, .12); }
@media (min-width: 641px) {
  .shell { flex-wrap: nowrap; height: 100vh; min-height: 0; overflow: hidden; }
  /* Grundbreite: so breit wie der längste Menüpunkt plus Abstand; nach dem Ziehen feste Breite */
  .nav { flex: 0 0 auto; width: var(--nav-w, max-content); min-width: 170px; max-width: 45vw;
         height: 100vh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; position: relative; }
  .main { flex: 1 1 auto; height: 100vh; overflow-y: auto; overscroll-behavior: contain; max-width: none; }
  .main > * { flex-shrink: 0; }   /* Inhalte nicht stauchen, sondern scrollen */
  .nav-resizer { display: block; flex: 0 0 6px; margin-left: -6px; position: relative; z-index: 6; cursor: col-resize;
                 background: transparent; border: 0; padding: 0; touch-action: none; }
  .nav-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 2px; background: transparent; transition: background .15s; }
  .nav-resizer:hover::after, .nav-resizer:focus-visible::after, .shell.resizing .nav-resizer::after { background: var(--accent); }
  .nav-resizer:focus-visible { outline: none; }
  .shell.resizing { cursor: col-resize; user-select: none; }
  .shell.resizing .main { pointer-events: none; }
}
@media print {
  .shell { display: block !important; height: auto !important; overflow: visible !important; }
  .main { height: auto !important; overflow: visible !important; }
  .nav-resizer { display: none !important; }
}
