/* Admin-Bereich */
:root { --text:#1a1a1a; --muted:#6b6b6b; --line:#e4e4e4; --soft:#f5f5f5; --accent:#1a1a1a; --ok:#2f6b3a; --warn:#8a5a00; --err:#a12a2a; --hour:48px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: #fafafa; }
a { color: inherit; }
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
aside { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 16px; padding: 0 10px 4px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.projsel select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; width: 100%; margin: 16px 0; background: #fff; }
nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 6px; text-decoration: none; }
nav a:hover { background: var(--soft); }
nav a.on { background: var(--accent); color: #fff; }
nav .sep { height: 1px; background: var(--line); margin: 10px 0; }
.badge { background: #e9e9e9; color: #333; border-radius: 10px; font-size: 12px; padding: 0 7px; }
nav a.on .badge { background: #444; color: #fff; }
.user { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.user button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
main { padding: 28px 32px 60px; min-width: 0; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  aside { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.15); }
  aside.open { transform: none; }
  main { padding: 64px 16px 40px; }
  .menu-btn { display: block; position: fixed; top: 10px; left: 10px; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font: inherit; }
}
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); margin: 0 0 24px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 8px 15px; border-radius: 6px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.sec { background: #fff; color: var(--text); border-color: #d6d6d6; }
.btn.danger { background: #fff; color: var(--err); border-color: #e2b4b4; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.linkbtn.danger { color: var(--err); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; text-decoration: none; display: block; }
.card .n { font-size: 26px; font-weight: 600; }
.card .l { color: var(--muted); font-size: 13px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 24px; }
.panel > h2, .panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pad { padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 11px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafafa; }
tr.muted td { color: #999; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--soft); white-space: nowrap; }
.tag.ok { background: #e6f1e8; color: var(--ok); }
.tag.warn { background: #fbf1de; color: var(--warn); }
.tag.err { background: #fbeaea; color: var(--err); }
.muted { color: var(--muted); font-size: 13px; }
.empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.alert { padding: 11px 16px; border-radius: 6px; margin-bottom: 20px; }
.alert.ok { background: #e6f1e8; color: var(--ok); }
.alert.error { background: #fbeaea; color: var(--err); }
.alert.warn { background: #fff8e6; border: 1px solid #f0e0b0; color: #5c4400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
/* Formulare */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; font-size: 14px; }
.field > span:first-child { font-weight: 500; }
.field small, .help { color: var(--muted); font-size: 13px; font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input:not([type]), select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #d6d6d6; border-radius: 6px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .row2, .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }
.check input { width: 17px; height: 17px; margin-top: 2px; flex: none; }
.inline { display: inline; }
.hours-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: start; }
.hours-row:last-child { border-bottom: 0; }
.blocks-list { display: grid; gap: 6px; }
.tblock { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tblock input[type=time] { width: 112px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ccc; border-radius: 11px; cursor: pointer; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 19px; }
.switch input:focus-visible + span { outline: 2px solid #888; outline-offset: 2px; }
.dlist { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.dlist dt { color: var(--muted); }
.dlist dd { margin: 0; overflow-wrap: anywhere; }
code, .code { background: var(--soft); padding: 10px 12px; display: block; border-radius: 6px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-family: Consolas, Menlo, monospace; }
.slots-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.slots-pick button { background: #fff; border: 1px solid #d6d6d6; border-radius: 5px; padding: 4px 9px; font: inherit; font-size: 13px; cursor: pointer; }
.slots-pick button:hover { border-color: var(--accent); }
.ph { display: inline-block; background: var(--soft); border-radius: 4px; padding: 1px 6px; margin: 2px; font-size: 12px; font-family: Consolas, Menlo, monospace; cursor: pointer; border: 0; }
.ph:hover { background: #e6e6e6; }
/* Wochenkalender */
.week-wrap { overflow-x: auto; }
.week { display: grid; grid-template-columns: 54px repeat(var(--days), minmax(110px, 1fr)); min-width: calc(54px + var(--days) * 110px); user-select: none; }
.week .h { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; font-weight: 600; font-size: 13px; position: sticky; top: 0; background: #fff; z-index: 3; }
.week .h small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.week .h.today { background: var(--accent); color: #fff; }
.week .h.today small { color: #ccc; }
.week .times { position: relative; }
.week .times div { height: var(--hour); text-align: right; padding-right: 8px; font-size: 11px; color: var(--muted); transform: translateY(-7px); }
.week .col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(#fff 0 calc(var(--hour) - 1px), #efefef calc(var(--hour) - 1px) var(--hour)); cursor: crosshair; }
.week .closed { position: absolute; left: 0; right: 0; background: #f4f4f4; pointer-events: none; }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 3px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; z-index: 2; text-decoration: none; display: block; cursor: pointer; }
.ev.book { background: var(--accent); color: #fff; }
.ev.book.past { background: #555; }
.ev.ext { background: #e8e8e8; color: #333; border-left: 3px solid #999; cursor: default; }
.ev.block { background: repeating-linear-gradient(45deg, #f3f3f3 0 6px, #e4e4e4 6px 12px); color: #555; border: 1px dashed #c8c8c8; }
.ev.holiday { background: #fbf1de; color: var(--warn); }
.ev small { opacity: .75; }
.sel-box { position: absolute; left: 2px; right: 2px; background: rgba(26,26,26,.15); border: 2px solid var(--accent); border-radius: 5px; z-index: 4; pointer-events: none; font-size: 12px; padding: 2px 5px; font-weight: 600; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #d33; z-index: 3; pointer-events: none; }
.legend { display: flex; gap: 16px; padding: 10px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
/* Dialog */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog .pad { padding: 22px; }
dialog h2 { margin-bottom: 14px; }
/* Login */
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.login .panel { padding: 28px; }
/* Arbeitsplan */
table.wp { min-width: 900px; border-collapse: collapse; }
.wp th, .wp td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; text-align: center; vertical-align: middle; }
.wp th { font-size: 12px; font-weight: 600; color: #444; padding: 10px 6px; background: #fafafa; text-transform: none; letter-spacing: 0; }
.wp th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.wp th.today { background: var(--accent); color: #fff; }
.wp th.today small { color: #ccc; }
.wp .wp-name { text-align: left; padding: 10px 14px; border-left: 0; white-space: nowrap; }
.wp .wp-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.wp-sum { color: var(--muted); font-size: 13px; white-space: nowrap; }
.wp-cell { width: 100%; min-height: 46px; border-radius: 6px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; padding: 4px; font: inherit; font-size: 13px; line-height: 1.25; border: 1px dashed transparent; background: transparent; color: inherit; }
.wp-cell:hover { border-color: #aaa; }
.wp-cell.empty { color: #ccc; }
.wp-cell.empty::after { content: '+'; font-size: 18px; }
.wp-cell.work { background: var(--accent); color: #fff; }
.wp-cell small { opacity: .8; font-size: 11px; }
.wp-cell.vac { background: #e8f0fb; color: #1f4f8f; }
.wp-cell.sick { background: #fbeaea; color: var(--err); }
.wp-cell.school { background: #f3ecfb; color: #5b2f8f; }
.wp-cell.off { background: #eeeeee; color: #777; }
.wp-cell.pending { box-shadow: 0 0 0 2px #e0a800 inset; }
.wp-cell.work.pending { box-shadow: 0 0 0 3px #e0a800 inset; }
tr.wp-cover td { background: #fafafa; font-size: 12px; color: var(--muted); }
tr.wp-cover td.ok { color: var(--ok); font-weight: 600; }
tr.wp-cover td.low { color: var(--err); font-weight: 600; }
.wp-tpl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.wp-tpl button { text-align: left; background: #fff; border: 1px solid #d6d6d6; border-radius: 6px; padding: 9px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.wp-tpl button:hover { border-color: var(--accent); }
.wp-tpl button small { display: block; color: var(--muted); font-size: 12px; }
.wp-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.wp-row input[type=time] { width: 112px; }
.wp-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; display: none; z-index: 100; max-width: calc(100vw - 32px); }
.wp-toast.err { background: var(--err); }
