/* Büro-Bereich */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: var(--navy-soft); padding: .1em .4em; border-radius: 6px; font-size: .88em; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, #fff 0, var(--bg) 50%), var(--bg); }
.login-card { width: min(100%, 400px); background: #fff; border-radius: 24px; padding: 2rem 1.6rem; box-shadow: var(--shadow-lg); animation: pop .5s var(--spring); }
.login-logo { width: 100%; max-width: 280px; display: block; margin: 0 auto 1.2rem; }
.login-card h1 { margin: 0; color: var(--navy); font-size: 1.4rem; text-align: center; }
.login-card > p { text-align: center; margin: .2rem 0 1.4rem; }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 1.2rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { width: 100%; max-width: 200px; margin: .2rem auto 1.6rem; display: block; }
.side nav { display: flex; flex-direction: column; gap: .25rem; }
.side nav button { display: flex; align-items: center; gap: .7rem; border: 0; background: none; text-align: left; padding: .75rem .9rem; border-radius: 12px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.side nav button span { width: 1.4em; text-align: center; }
.side nav button:hover { background: var(--bg); color: var(--navy); }
.side nav button.active { background: var(--navy); color: #fff; box-shadow: 0 6px 18px rgba(31, 44, 81, .25); }
.badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; padding: .05em .55em; font-size: .78rem; animation: pop .4s var(--spring); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; font-size: .88rem; color: var(--muted); }

.main { padding: 1.8rem 2rem 3rem; min-width: 0; }
.tab { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; } }
.main h1 { margin: 0 0 .2rem; color: var(--navy); font-size: 1.7rem; }
.tab-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.kpi { background: #fff; border-radius: 18px; padding: 1.1rem 1.3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .3rem; border-left: 5px solid var(--lime); animation: cardIn .5s var(--ease) both; }
.kpi:nth-child(2) { animation-delay: .05s; } .kpi:nth-child(3) { animation-delay: .1s; } .kpi:nth-child(4) { animation-delay: .15s; }
.kpi span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.kpi b { font-size: 2rem; color: var(--navy); }
.kpi.warn.has { border-left-color: var(--warn); cursor: pointer; }
.kpi.warn.has b { color: var(--warn); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }

.panel { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 1.2rem; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.panel h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }

.running { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.run { display: flex; align-items: center; gap: .8rem; padding: .8rem; border-radius: 14px; background: var(--bg); animation: cardIn .4s var(--ease) both; }
.run .avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, hsl(var(--h) 45% 32%), hsl(calc(var(--h) + 30) 50% 45%)); flex-shrink: 0; }
.run b { display: block; color: var(--navy); }
.run small { color: var(--muted); }
.run .dur { margin-left: auto; font-weight: 750; color: var(--ok); }
.none { color: var(--muted); padding: 1rem; text-align: center; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; background: #fff; border-radius: 18px; padding: 1rem 1rem .2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.sumbar { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 0 .3rem 1rem; color: var(--muted); font-size: .92rem; }
.sumbar b { color: var(--navy); }

/* Tabelle */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .6rem .7rem; border-bottom: 2px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: #fff; }
.tbl td { padding: .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr { animation: fade .3s both; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tr.st-unvollstaendig td { background: #fff7f6; }
.tbl tr.st-storniert td { opacity: .5; text-decoration: line-through; }
.tbl .name { font-weight: 650; color: var(--navy); white-space: nowrap; }
.tbl .num { font-weight: 700; color: var(--navy); white-space: nowrap; }
.tbl .sub { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; }
.tbl .sub.warn { color: #a06200; font-weight: 650; }
.tbl .flags { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 320px; }
.tbl .acts { display: flex; gap: .3rem; justify-content: flex-end; white-space: nowrap; }
.tbl .geo a { text-decoration: none; }
.tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); }
.table-wrap { overflow-x: auto; }
.icon-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: .35rem .6rem; font-weight: 650; color: var(--navy); font-size: .85rem; transition: background .2s, transform .1s; }
.icon-btn:hover { background: var(--bg); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.ok { background: #e2f3e4; border-color: #c5e6c9; color: #24692e; }
.danger-text { color: var(--danger) !important; border-color: var(--danger-soft) !important; }

.modal.wide { width: min(100%, 640px); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.details { background: var(--bg); border-radius: 14px; padding: .8rem 1rem; font-size: .88rem; margin-top: .4rem; }
.details:empty { display: none; }
.details h4 { margin: .2rem 0 .5rem; color: var(--navy); }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: 0 0 .6rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.audit { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--lime); }
.audit li { padding: .2rem 0 .6rem .8rem; position: relative; }
.audit li::before { content: ''; position: absolute; left: -6px; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
.audit small { color: var(--muted); }

.export-panel { padding: 1.5rem; }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.presets button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .45em 1em; font-weight: 600; color: var(--navy); transition: all .2s; }
.presets button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.big { padding: 1em 2em; font-size: 1.05rem; margin: .4rem 0 .8rem; }
.export-warn { background: var(--warn-soft); color: #8a5300; padding: .8rem 1rem; border-radius: 12px; margin-bottom: .8rem; font-weight: 600; }
.import-info { margin-bottom: 1rem; }
.import-info .err { background: var(--danger-soft); color: #a42222; padding: .7rem 1rem; border-radius: 12px; margin-top: .5rem; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; flex-direction: row; align-items: center; padding: .6rem .8rem; z-index: 20; overflow-x: auto; gap: .6rem; }
  .side-logo { width: 110px; margin: 0; }
  .side nav { flex-direction: row; }
  .side nav button { padding: .55rem .7rem; white-space: nowrap; font-size: .88rem; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .side-foot .me { display: none; }
  .main { padding: 1.2rem 16px 3rem; }
}

/* Feinschliff */
.tbl .chip { white-space: normal; }
.tbl td:nth-child(n) { white-space: normal; }
.tbl td.nowrap, .tbl .pause { white-space: nowrap; }
.run { min-width: 0; }
.run > span:nth-child(2) { min-width: 0; }
.run .dur { white-space: nowrap; }
.running { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.file-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Mitarbeiter-Pflege */
.emp-tools { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.emp-tools .input { max-width: 360px; background: #fff; box-shadow: var(--shadow); border-color: transparent; }
.emp-tools .input:focus { border-color: var(--navy); }
.check { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 600; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }
.emp-tbl td { vertical-align: middle; }
.emp-tbl td.name { cursor: pointer; }
.emp-tbl .who { display: flex; align-items: center; gap: .7rem; }
.emp-tbl tr.inactive td { opacity: .55; }
.mini-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .78rem; font-weight: 700; flex-shrink: 0;
  background: linear-gradient(135deg, hsl(var(--h) 45% 32%), hsl(calc(var(--h) + 30) 50% 45%)); }
.pin-peek { border: 0; background: var(--bg); border-radius: 8px; padding: .25rem .6rem; font-weight: 700; letter-spacing: .15em; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.2em; }
.pin-peek.shown { color: var(--navy); background: var(--lime-soft); }
.pin-row { display: flex; gap: .5rem; }
.pin-row .input { letter-spacing: .3em; font-weight: 700; font-size: 1.1rem; }
.pin-row .icon-btn { font-size: 1.15rem; padding: 0 .8rem; }

.switch { display: flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 600; color: var(--text); margin: .3rem 0 .4rem; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 46px; height: 27px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(31, 44, 81, .15); }
.hint-box { background: var(--info-soft); color: #22508f; border-radius: 12px; padding: .7rem .9rem; font-size: .88rem; margin: .6rem 0 0; animation: fade .25s; }

.file-box { margin-top: 1.4rem; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: .9rem 1.1rem; }
.file-box summary { cursor: pointer; font-weight: 650; color: var(--navy); }
.file-box[open] summary { margin-bottom: .4rem; }

/* Datensicherung */
.section-title { color: var(--navy); font-size: 1.25rem; margin: 2rem 0 .8rem; }
.backup-panel { padding: 1.3rem 1.4rem; }
.backup-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.backup-state { display: flex; gap: .8rem; align-items: flex-start; }
.backup-state div { display: flex; flex-direction: column; gap: .15rem; }
.backup-state b { color: var(--navy); }
.backup-state .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: .35rem; flex-shrink: 0; }
.backup-state .dot.ok { background: var(--ok); box-shadow: 0 0 0 4px #e2f3e4; }
.backup-state .dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.err-text { color: var(--danger); font-size: .85rem; font-weight: 600; }
.backup-list-box summary { cursor: pointer; font-weight: 650; color: var(--navy); margin-top: .4rem; }
.backup-list-box[open] summary { margin-bottom: .6rem; }
.backup-warn { background: var(--warn-soft); color: #8a5300; padding: .8rem 1rem; border-radius: 14px; margin: 1rem 0 0; font-weight: 600; }
.backup-warn .link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; color: #8a5300; margin-left: .4rem; text-decoration: underline; text-underline-offset: 3px; }
.lang-cell { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-size: .88rem; }
.lang-cell .flag { width: 20px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* Hilfe */
.help-q-btn { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--navy); font-weight: 800; font-size: .85rem; vertical-align: middle; margin-left: .3rem; transition: background .2s, border-color .2s; }
.help-q-btn:hover { background: var(--lime-soft); border-color: var(--lime); }
.help-search { display: flex; align-items: center; gap: .7rem; background: #fff; border-radius: 16px; padding: .2rem 1.1rem; box-shadow: var(--shadow); margin: 1.2rem 0 1rem; color: var(--muted); border: 1.5px solid transparent; max-width: 760px; }
.help-search:focus-within { border-color: var(--navy); }
.help-search input { border: 0; outline: 0; flex: 1; padding: .9rem 0; font-size: 1.05rem; background: transparent; color: var(--text); }
.help-cats { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.4rem; max-width: 980px; }
.help-cats button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .4em .9em; font-weight: 600; color: var(--navy); font-size: .9rem; transition: all .2s; }
.help-cats button:hover { border-color: var(--navy); }
.help-sec { max-width: 900px; margin-bottom: 1.6rem; scroll-margin-top: 20px; border-radius: 18px; transition: box-shadow .4s; }
.help-sec.flash { box-shadow: 0 0 0 4px var(--lime); }
.help-sec h2 { font-size: 1.15rem; color: var(--navy); margin: 0 0 .6rem; }
.help-item { background: #fff; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: .5rem; overflow: hidden; }
.help-item summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 650; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: '+'; font-size: 1.3rem; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.help-item[open] summary::after { transform: rotate(45deg); }
.help-item[open] summary { border-bottom: 1px solid var(--line); }
.help-a { padding: .4rem 1.2rem 1rem; line-height: 1.55; color: var(--text); animation: fade .25s; }
.help-a p { margin: .6rem 0; }
.help-a ul, .help-a ol { margin: .5rem 0; padding-left: 1.3rem; }
.help-a li { margin: .3rem 0; }
.help-a a { color: var(--navy); font-weight: 600; }
.help-tbl { border-collapse: collapse; width: 100%; font-size: .92rem; }
.help-tbl td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.help-tbl td:first-child { width: 1%; white-space: nowrap; }
@media (max-width: 860px) { .help-tbl td:first-child { white-space: normal; } }

/* Neustart */
.reset-panel { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; flex-wrap: wrap; border: 1.5px solid var(--danger-soft); }
.reset-panel > div { flex: 1; min-width: 260px; }
.reset-panel b { color: var(--navy); }
.reset-panel p { margin: .3rem 0 0; }
.reset-emps { display: grid; gap: .4rem; max-height: 260px; overflow: auto; margin-top: .5rem; }
.reset-emp { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 10px; background: var(--bg); cursor: pointer; }
.reset-emp input { width: 18px; height: 18px; accent-color: var(--danger); flex-shrink: 0; }
.reset-warn { background: var(--danger-soft); color: #a42222; padding: .8rem 1rem; border-radius: 12px; }
.modal h4 { margin: 1rem 0 .2rem; color: var(--navy); }

.chip.test { background: #efe7fb; color: #5b3a96; }
.test-switch { margin-top: .2rem; }

/* Wechsel zur Stempel-App */
.app-link { text-decoration: none; justify-content: center; }
.back-to-app { display: block; text-align: center; margin-top: 1rem; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none; }
.back-to-app:hover { color: var(--navy); }
@media (max-width: 860px) { .side-foot .app-link { display: none; } }
