:root {
  --ground: #F6F7F5; --surface: #FFFFFF; --ink: #18201E; --muted: #5B6663; --border: #E2E6E3;
  --accent: #0B6E69; --accent-2: #095a56; --accent-light: #E3F1EF;
  --amber: #8A4B00; --amber-bg: #FDF1DC; --green: #1E6B3A; --green-bg: #E3F3E8;
  --red: #A3262A; --red-bg: #FBE7E7; --purple: #6B4FA0; --purple-bg: #EFEAF7;
  --blue: #2F5C8F; --blue-bg: #E6EEF7;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--ground); color: var(--ink); font-size: 14px; line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tabnum { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--ground); text-decoration: none; color: var(--ink); }
.nav a.active { color: var(--accent); background: var(--accent-light); }
.userbox { display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.userbox .who { line-height: 1.2; }
.userbox .who b { display: block; font-size: 13px; }
.userbox .who span { font-size: 11px; color: var(--muted); }
select.lang { border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; background: var(--surface); font: inherit; font-size: 13px; }

.page { max-width: 1240px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.footer { max-width: 1240px; margin: 0 auto; padding: 8px 24px 32px; color: var(--muted); font-size: 12px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card, .grid > * > .card:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 16px; }
@media (max-width: 960px) { .grid-2, .grid-3, .grid-4, .grid-main { grid-template-columns: 1fr; } .topbar .inner { gap: 12px; } .userbox .who { display: none; } }

.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.bar { height: 6px; background: var(--ground); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* Stempeluhr */
.clock { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.clock .big { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.clock .state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.working { background: #1F9D55; box-shadow: 0 0 0 4px #E3F3E8; }
.dot.pause { background: #D98B00; box-shadow: 0 0 0 4px var(--amber-bg); }
.dot.done { background: var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: inline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--ground); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.big { padding: 12px 20px; font-size: 15px; }
.btn.danger { color: var(--red); border-color: #F0C9CA; }
.btn.danger:hover { background: var(--red-bg); }
.btn.ok { color: var(--green); border-color: #BFE0CB; }
.btn.ok:hover { background: var(--green-bg); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.btn.link:hover { text-decoration: underline; background: none; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--ground); color: var(--muted); }
.pill.pending, .pill.cancel_requested, .pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.approved, .pill.ok { background: var(--green-bg); color: var(--green); }
.pill.rejected, .pill.cancelled, .pill.bad { background: var(--red-bg); color: var(--red); }
.pill.cancelled { background: var(--ground); color: var(--muted); }
.pill.vacation { background: var(--accent-light); color: var(--accent); }
.pill.sick { background: var(--red-bg); color: var(--red); }
.pill.overtime { background: var(--purple-bg); color: var(--purple); }
.pill.training, .pill.special { background: var(--blue-bg); color: var(--blue); }

/* Tabellen */
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.today td { background: #FAFCFB; }
table.data tr.off td { color: var(--muted); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* Hinweise */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--green-bg); color: var(--green); font-weight: 500; }
.flash.error { background: var(--red-bg); color: var(--red); }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); }
.notice.info { background: var(--accent-light); color: var(--accent); }
.notice + .notice { margin-top: 8px; }
.devbanner { background: #18201E; color: #fff; text-align: center; font-size: 12px; padding: 4px; }

/* Formulare */
form .row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
form .row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
form .row.one { grid-template-columns: 1fr; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=file], select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-light); border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; margin: 0 0 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.days-check { display: flex; gap: 6px; flex-wrap: wrap; }
.days-check label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--ink); margin: 0; font-weight: 500; }
.type-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.type-pills label { margin: 0; cursor: pointer; }
.type-pills input { position: absolute; opacity: 0; pointer-events: none; }
.type-pills span { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); font-size: 13px; font-weight: 600; }
.type-pills input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.type-pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.summary-box { background: var(--ground); border-radius: 8px; padding: 14px; }
.summary-box .num { font-size: 24px; font-weight: 700; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.breaks-table td { padding: 4px 8px 4px 0; border: 0; }
.hidden { display: none !important; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Team */
.status-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.status-row .name { flex: 1; min-width: 0; }
.counts { display: flex; gap: 10px; flex-wrap: wrap; }
.count { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; min-width: 120px; }
.count b { font-size: 22px; display: block; }
.request { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.request + .request { margin-top: 10px; }
.request .top { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.request form textarea { min-height: 38px; margin-top: 10px; }

/* Kalender */
.cal { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.cal th { font-weight: 600; color: var(--muted); padding: 4px 0; min-width: 26px; text-align: center; }
.cal th.we { color: #A2AAA7; }
.cal th.today { color: var(--accent); }
.cal td.person { padding-right: 10px; white-space: nowrap; font-size: 13px; font-weight: 500; position: sticky; left: 0; background: var(--surface); }
.cal td.c { height: 28px; border-radius: 5px; background: var(--ground); text-align: center; font-weight: 700; }
.cal td.c.free { background: #EEF0EE; }
.cal td.c.holiday { background: #E9ECEA; color: var(--muted); }
.cal td.c.vacation { background: var(--accent); color: #fff; }
.cal td.c.sick { background: #D9534F; color: #fff; }
.cal td.c.overtime { background: var(--purple); color: #fff; }
.cal td.c.training, .cal td.c.special { background: var(--blue); color: #fff; }
.cal td.c.absent { background: #8C9693; color: #fff; }
.cal td.c.half { background-image: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.65) 50%); }
.cal td.c.pending { opacity: .5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* Anmeldung */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 420px; text-align: center; }
.login .logo { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; margin: 0 auto 16px; }
.ms-btn { display: flex; width: 100%; gap: 10px; justify-content: center; align-items: center; padding: 12px; border: 1px solid #8C8C8C; border-radius: 6px; background: #fff; color: #5E5E5E; font-weight: 600; font-size: 15px; }
.ms-btn:hover { background: #F3F3F3; text-decoration: none; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
code.token { display: block; padding: 10px; background: var(--ground); border-radius: 8px; word-break: break-all; font-size: 13px; }
