/* ============================================================================
   HTG Time – Design-System
   Ruhig, luftig, klare Hierarchie. Flächen statt Rahmen, wenige große Blöcke.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Marke */
  --green-900: #002e2c;
  --green-800: #073f3b;
  --green-700: #0f564f;
  --green-600: #16776a;
  --green-500: #2a9d7f;
  --green-400: #4cb897;
  --green-100: #dcefe8;
  --green-50:  #eff7f4;

  /* Flächen */
  --sidebar:    #002e2c;
  --bg:         #f3f6f5;
  --card:       #ffffff;
  --surface-2:  #f7faf9;
  --surface-3:  #ebf0ee;
  --input-bg:   #ffffff;
  --hover:      #f7faf9;

  /* Linien und Text */
  --border:        #e7edeb;
  --border-strong: #d5dedb;
  --text:    #16211f;
  --heading: #062e2b;
  --muted:   #67746f;
  --faint:   #a3aeaa;

  /* Signale */
  --danger:       #c0392f;
  --danger-bg:    #fdeeec;
  --danger-hover: #f9dcd8;
  --warn:         #a8690d;
  --warn-bg:      #fdf2e0;
  --accent-yellow:#f2b53c;
  --info:         #2b5aa8;
  --info-bg:      #e9f0fb;
  --holiday:      #a8690d;
  --holiday-bg:   #fdf2e0;

  /* Abwesenheitsarten */
  --c-urlaub: #1f8e72;       --cbg-urlaub: #ddf0e9;
  --c-krank: #c0392f;        --cbg-krank: #fdeeec;
  --c-sonderurlaub: #6f45b0; --cbg-sonderurlaub: #eee8f8;
  --c-unbezahlt: #67746f;    --cbg-unbezahlt: #ebf0ee;
  --c-fortbildung: #2b5aa8;  --cbg-fortbildung: #e9f0fb;
  --c-homeoffice: #a8690d;   --cbg-homeoffice: #fdf2e0;
  --c-abwesend: #67746f;     --cbg-abwesend: #ebf0ee;

  /* Tiefe */
  --shadow-sm: 0 1px 2px rgba(3, 40, 37, .05);
  --shadow:    0 1px 2px rgba(3, 40, 37, .04), 0 10px 28px -12px rgba(3, 40, 37, .14);
  --shadow-lg: 0 24px 60px -16px rgba(3, 40, 37, .28);
  --overlay:   rgba(6, 34, 32, .42);
  --ring:      0 0 0 3px rgba(42, 157, 127, .22);

  /* Maße */
  --radius:    16px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --green-100: #1d5346;
  --green-50:  #1a4239;

  --sidebar:    #103430;
  --bg:         #151f1d;
  --card:       #1f2b28;
  --surface-2:  #263330;
  --surface-3:  #2f3d39;
  --input-bg:   #1a2523;
  --hover:      #263330;

  --border:        #33413c;
  --border-strong: #43524c;
  --text:    #eef3f1;
  --heading: #ffffff;
  --muted:   #a3b0ab;
  --faint:   #6e7c77;

  --danger:       #ef8079;
  --danger-bg:    #3a1f1c;
  --danger-hover: #4b2825;
  --warn:         #e0ab54;
  --warn-bg:      #392c15;
  --accent-yellow:#f2b53c;
  --info:         #8fb0ef;
  --info-bg:      #1c2740;
  --holiday:      #e0ab54;
  --holiday-bg:   #392c15;

  --c-urlaub: #4cc09d;       --cbg-urlaub: #16443a;
  --c-krank: #ef8079;        --cbg-krank: #3a1f1c;
  --c-sonderurlaub: #b391ef; --cbg-sonderurlaub: #2c2146;
  --c-unbezahlt: #a4b0ab;    --cbg-unbezahlt: #2b3733;
  --c-fortbildung: #8fb0ef;  --cbg-fortbildung: #1c2740;
  --c-homeoffice: #e0ab54;   --cbg-homeoffice: #392c15;
  --c-abwesend: #a4b0ab;     --cbg-abwesend: #2b3733;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, .7);
  --overlay:   rgba(0, 0, 0, .62);
  --ring:      0 0 0 3px rgba(76, 184, 151, .25);
}

/* ---------------------------------------------------------------- Basis -- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Inter", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }
:root[data-theme="dark"] a { color: var(--green-400); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--heading); }
h1 { font-size: 24px; letter-spacing: -.015em; }
h2 { font-size: 17px; letter-spacing: -.005em; }
h3 { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
p { margin: 0 0 12px; }
code {
  font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .88em;
  background: var(--surface-3); padding: 2px 6px; border-radius: 6px;
}

/* --------------------------------------------------------------- Layout -- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #fff;
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0;
  z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 26px 22px 22px;
  font-size: 20px; font-weight: 700;
}
.brand .logo { width: 38px; height: 38px; flex-shrink: 0; display: block; }
.brand .logo svg { width: 100%; height: 100%; display: block; }
.brand .wordmark { font-weight: 400; color: rgba(255,255,255,.82); }
.brand .wordmark b { font-weight: 700; color: #fff; }

.nav { padding: 4px 14px 14px; flex: 1; overflow-y: auto; }
.nav .section {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.38); font-weight: 600;
  padding: 20px 10px 8px;
}
.nav .section:first-child { padding-top: 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.74);
  font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav a.active svg { opacity: 1; color: var(--green-400); }
.nav a .badge {
  margin-left: auto; background: var(--accent-yellow); color: #002e2c;
  font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
}

.sidebar .userbox {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: 10px;
}
.userbox .profile-link {
  display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0;
  padding: 7px 9px; margin: -7px -9px; border-radius: var(--radius-sm);
  color: inherit; transition: background .15s;
}
.userbox .profile-link:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.userbox .profile-link.active { background: rgba(255,255,255,.12); }
.userbox .meta { flex: 1; min-width: 0; }
.userbox .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .role { font-size: 12.5px; color: rgba(255,255,255,.5); }
.userbox button {
  background: none; border: none; color: rgba(255,255,255,.55);
  padding: 8px; border-radius: 8px; flex-shrink: 0; transition: background .15s, color .15s;
}
.userbox button:hover { background: rgba(255,255,255,.1); color: #fff; }
.userbox button svg { width: 18px; height: 18px; display: block; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-400), var(--green-600));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 72px; background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; position: sticky; top: 0; z-index: 10;
}
.topbar .date { color: var(--muted); font-size: 14px; }
.content { padding: 32px 40px 64px; max-width: 1320px; width: 100%; }

/* ----------------------------------------------------------------- Grid -- */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- Card -- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
}
:root[data-theme="dark"] .card { border: 1px solid var(--border); }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.card-head .flex, .cal-toolbar { flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--green-500); flex-shrink: 0; }
/* Trennlinie innerhalb einer Karte – hält Blöcke zusammen statt sie zu zerteilen */
.sep { height: 1px; background: var(--border); margin: 26px 0 22px; }
.card.pad-0 { padding: 0; }
.card.pad-0 .card-head { padding: 24px 28px 0; margin-bottom: 18px; }
.card.pad-0 > .table-wrap:last-child table tr:last-child td { padding-bottom: 20px; }

/* Kennzahlen ---------------------------------------------------------------
   .figures: mehrere Werte nebeneinander in EINER Karte (statt vieler Kästen) */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figures > .stat { padding: 2px 22px; border-left: 1px solid var(--border); }
.figures > .stat:first-child { padding-left: 0; border-left: 0; }
@media (max-width: 1240px) {
  .figures { grid-template-columns: repeat(2, 1fr); gap: 26px 0; }
  .figures > .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .figures { grid-template-columns: 1fr; }
  .figures > .stat { padding: 0; border-left: 0; }
}

.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value {
  font-size: 32px; font-weight: 650; color: var(--heading);
  letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.stat .value.sm { font-size: 23px; }
.stat .sub { font-size: 13px; color: var(--muted); }
.stat .value.pos { color: var(--green-600); }
:root[data-theme="dark"] .stat .value.pos { color: var(--green-400); }
.stat .value.neg { color: var(--danger); }
.card.stat { gap: 4px; }

/* -------------------------------------------------------------- Buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; line-height: 1.25;
  white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary { background: var(--green-900); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
:root[data-theme="dark"] .btn-primary { background: var(--green-500); color: #05201d; }
:root[data-theme="dark"] .btn-primary:hover { background: var(--green-400); }
.btn-success { background: var(--green-500); color: #fff; }
.btn-success:hover { background: var(--green-600); }
.btn-secondary { background: var(--card); color: var(--heading); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--green-500); color: var(--green-600); }
:root[data-theme="dark"] .btn-secondary { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .btn-secondary:hover { color: var(--green-400); }
.btn-warn { background: var(--accent-yellow); color: #3a2a05; }
.btn-warn:hover { background: #e5a72d; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--muted); padding: 7px 9px; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-lg { padding: 13px 24px; font-size: 15.5px; border-radius: 12px; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 8px; }
select.btn { padding: 9px 14px; font-weight: 500; }

/* --------------------------------------------------------------- Formen -- */
.form { display: grid; gap: 18px; }
.form.cols-2 { grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
/* Inline-Symbole in Beschriftungen und Hinweisen dürfen nie die Fläche sprengen */
.field label svg, .hint svg, .settings-row svg, .list-item > svg {
  width: 15px; height: 15px; flex-shrink: 0; color: var(--green-500);
}
.field input, .field select, .field textarea {
  padding: 11px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text);
  outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green-500); box-shadow: var(--ring);
}
.field input:disabled { background: var(--surface-3); color: var(--muted); }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field .check {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; color: var(--text); font-weight: 500; padding-top: 4px; cursor: pointer;
}
.field .check input { width: auto; accent-color: var(--green-500); }
.field input[type="file"] { padding: 9px 12px; }
.field input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  border-radius: 8px; padding: 6px 12px; margin-right: 12px; cursor: pointer;
}
.field input[type="file"]::file-selector-button:hover { border-color: var(--green-500); color: var(--green-600); }

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 2px; }
.error {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--danger-bg); color: var(--danger);
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px;
}
/* Sicherheitsnetz: Symbole in Textcontainern nie ungebremst wachsen lassen */
.error svg, .empty svg, .kv-v svg, .stat .sub svg, .stat .label svg, .list-item .s svg {
  width: 16px; height: 16px; flex-shrink: 0;
}
.error svg { margin-top: 2px; }
.hint { font-size: 13px; color: var(--muted); }
form h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
form h3 svg { width: 15px; height: 15px; color: var(--green-500); }

/* Schnelleingabe auf dem Dashboard */
.form.quick { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 18px; }
.quick-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding-top: 4px;
  border-top: 1px solid var(--border); margin-top: 2px;
}
.quick-foot .hint { padding-top: 12px; }
.quick-foot .btn { margin-top: 10px; }
@media (max-width: 1180px) { .form.quick { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .form.quick { grid-template-columns: repeat(2, 1fr); } }

/* Hinweisblöcke */
.note-warn, .note-ok {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5;
}
.note-warn { background: var(--warn-bg); color: var(--warn); }
.note-ok { background: var(--green-100); color: var(--c-urlaub); }
.note-warn svg, .note-ok svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; }
.note-warn ul { margin: 5px 0 0; padding-left: 18px; }
.note-warn li { margin: 3px 0; }

/* Arbeitstage-Auswahl */
.daypick { display: flex; gap: 7px; flex-wrap: wrap; }
.daypick label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; background: var(--input-bg); color: var(--muted);
  user-select: none; transition: background .15s, color .15s, border-color .15s;
}
.daypick label:hover { border-color: var(--green-500); }
.daypick label.on { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.daypick input { display: none; }

/* -------------------------------------------------------------- Tabellen -- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 14px 16px; vertical-align: middle; }
th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600;
  padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .actions { display: flex; gap: 3px; justify-content: flex-end; align-items: center; opacity: .55; transition: opacity .15s; }
tr:hover td .actions { opacity: 1; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.row-sep td {
  background: var(--surface-2); font-weight: 600; color: var(--heading);
  font-size: 13.5px; padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
tbody tr.row-sep:hover td { background: var(--surface-2); }

/* ---------------------------------------------------------------- Pills -- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.pill svg { width: 13px; height: 13px; }
.pill.approved, .pill.working { background: var(--cbg-urlaub); color: var(--c-urlaub); }
.pill.pending, .pill.pause    { background: var(--warn-bg); color: var(--warn); }
.pill.rejected, .pill.inactive{ background: var(--danger-bg); color: var(--danger); }
.pill.off, .pill.employee, .pill.src { background: var(--surface-3); color: var(--muted); }
.pill.src { font-weight: 500; }
.pill.admin { background: var(--green-900); color: #fff; }
:root[data-theme="dark"] .pill.admin { background: var(--green-500); color: #05201d; }
.pill.holiday { background: var(--holiday-bg); color: var(--holiday); }

.abs-urlaub       { --c: var(--c-urlaub);       --cbg: var(--cbg-urlaub); }
.abs-krank        { --c: var(--c-krank);        --cbg: var(--cbg-krank); }
.abs-sonderurlaub { --c: var(--c-sonderurlaub); --cbg: var(--cbg-sonderurlaub); }
.abs-unbezahlt    { --c: var(--c-unbezahlt);    --cbg: var(--cbg-unbezahlt); }
.abs-fortbildung  { --c: var(--c-fortbildung);  --cbg: var(--cbg-fortbildung); }
.abs-homeoffice   { --c: var(--c-homeoffice);   --cbg: var(--cbg-homeoffice); }
.abs-abwesend     { --c: var(--c-abwesend);     --cbg: var(--cbg-abwesend); }
.abs-feiertag     { --c: var(--holiday);        --cbg: var(--holiday-bg); }
.pill.abs { background: var(--cbg); color: var(--c); }

/* -------------------------------------------------------------- Kalender -- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; }
.cal-toolbar .month { font-size: 18px; font-weight: 600; min-width: 176px; text-align: center; color: var(--heading); }

.calendar {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.calendar .dow {
  padding: 10px 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600; background: var(--surface-2);
  border-bottom: 1px solid var(--border); text-align: center;
}
.calendar .day {
  min-height: 112px; min-width: 0; padding: 8px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--card); display: flex; flex-direction: column; gap: 3px;
}
.calendar .day:nth-child(7n+7) { border-right: none; }
.calendar .day.other { background: var(--surface-2); color: var(--faint); }
.calendar .day.weekend { background: var(--surface-2); }
.calendar .day.holiday { background: var(--holiday-bg); }
.calendar .day.today .n { background: var(--green-500); color: #fff; }
.calendar .day .n {
  font-size: 13px; font-weight: 600; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%; margin-bottom: 2px;
}
.calendar .ev {
  font-size: 11.5px; padding: 3px 7px; border-radius: 6px;
  background: var(--cbg); color: var(--c); border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;
}
.calendar .ev.pending { opacity: .72; border-left-style: dashed; }
.calendar .hol {
  font-size: 11.5px; color: var(--holiday); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar .more { font-size: 11.5px; color: var(--muted); padding-left: 7px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); margin-top: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }

/* ------------------------------------------------------------ Fortschritt -- */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green-500), var(--green-400));
  transition: width .4s ease;
}

.week-bar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.week-bar .d { text-align: center; font-size: 12.5px; color: var(--muted); }
.week-bar .bar {
  height: 82px; background: var(--surface-3); border-radius: 8px;
  display: flex; align-items: flex-end; overflow: hidden; margin-bottom: 8px;
}
.week-bar .bar i {
  display: block; width: 100%; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--green-400), var(--green-500));
  transition: height .4s ease;
}
.week-bar .today .bar { box-shadow: inset 0 0 0 2px var(--green-500); }
.week-bar .off .bar { opacity: .45; }
.week-bar .v { font-weight: 600; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Modal -- */
.modal-bg {
  position: fixed; inset: 0; background: var(--overlay);
  display: grid; place-items: center; z-index: 50; padding: 24px;
  backdrop-filter: blur(3px); animation: fadein .15s ease;
}
.modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 580px;
  box-shadow: var(--shadow-lg); padding: 28px 30px;
  max-height: 92vh; overflow-y: auto;
  animation: rise .2s cubic-bezier(.2, .8, .3, 1);
}
:root[data-theme="dark"] .modal { border: 1px solid var(--border); }
.modal h2 { margin-bottom: 18px; font-size: 19px; display: flex; align-items: center; gap: 9px; }
.modal h2 svg { width: 19px; height: 19px; color: var(--green-500); flex-shrink: 0; }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.99) } to { opacity: 1; transform: none } }

/* ---------------------------------------------------------------- Toast -- */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 100;
  background: var(--green-900); color: #fff;
  padding: 13px 20px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-weight: 500;
  animation: rise .2s cubic-bezier(.2, .8, .3, 1);
}
:root[data-theme="dark"] .toast { background: var(--green-500); color: #05201d; }
.toast.err { background: var(--danger); color: #fff; }

/* ---------------------------------------------------------------- Login -- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-left {
  background: var(--sidebar); color: #fff; padding: 56px 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-left::after {
  content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, var(--green-500) 0%, transparent 70%);
  opacity: .3; right: -200px; bottom: -220px;
}
.login-left > * { position: relative; z-index: 1; }
.login-left .brand { padding: 0; font-size: 25px; }
.login-left .brand .logo { width: 52px; height: 52px; }
.login-left h1 { font-size: 40px; line-height: 1.15; font-weight: 700; max-width: 500px; color: #fff; letter-spacing: -.025em; }
.login-left p { color: rgba(255,255,255,.72); font-size: 16.5px; max-width: 440px; margin-top: 16px; }
.login-right { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 410px; padding: 34px 36px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }
.login-card .demo {
  margin-top: 20px; font-size: 13px; color: var(--muted);
  background: var(--green-50); padding: 14px; border-radius: var(--radius-sm); line-height: 1.65;
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; align-content: center; }
  .login-left { display: none; }
  .login-card { padding: 28px 24px; }
}

/* ---------------------------------------------------------- Einstellungen -- */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .choice-grid { grid-template-columns: 1fr; } }
.choice {
  border: 2px solid var(--border); border-radius: 14px; padding: 16px;
  cursor: pointer; display: flex; flex-direction: column; gap: 11px;
  background: var(--card); transition: border-color .15s, background .15s, transform .1s;
}
.choice:hover { border-color: var(--green-400); transform: translateY(-1px); }
.choice.active { border-color: var(--green-500); background: var(--green-50); }
.choice .t { font-weight: 600; display: flex; align-items: center; gap: 9px; color: var(--heading); }
.choice .t svg { width: 18px; height: 18px; color: var(--green-500); }
.choice .s { font-size: 13px; color: var(--muted); }
.choice .preview {
  height: 58px; border-radius: 9px; border: 1px solid var(--border);
  display: flex; overflow: hidden; position: relative;
}
.choice .preview i { display: block; }
.choice .preview .pv-side { width: 28%; }
.choice .preview .pv-main { flex: 1; padding: 9px; display: flex; flex-direction: column; gap: 6px; }
.choice .preview .pv-main b { display: block; height: 8px; border-radius: 3px; width: 62%; }
.choice .preview .pv-main b + b { width: 86%; opacity: .5; }
.pv-light .pv-side { background: #002e2c; } .pv-light .pv-main { background: #f3f6f5; } .pv-light b { background: #fff; border: 1px solid #e7edeb; }
.pv-dark  .pv-side { background: #062825; } .pv-dark  .pv-main { background: #0a1211; } .pv-dark  b { background: #17211f; border: 1px solid #27332f; }
.pv-system .half { position: absolute; inset: 0; width: 50%; overflow: hidden; display: flex; }
.pv-system .half.r { left: 50%; }
.pv-system .half .pv-side { width: 56%; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row:first-of-type { padding-top: 4px; }
.settings-row .t { font-weight: 600; color: var(--heading); }
.settings-row .s { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* --------------------------------------------------------------- Listen -- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.list-item .grow { min-width: 140px; }
.list-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; color: var(--heading); }
.list-item .s { font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------- Dateien -- */
.files { display: flex; flex-wrap: wrap; gap: 7px; }
.file {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface-3); border-radius: 999px;
  padding: 3px 5px 3px 12px; font-size: 13px; max-width: 100%;
}
.file a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file a:hover { color: var(--green-600); text-decoration: none; }
.file a svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--green-500); }
.file .btn-icon { padding: 4px; }
.file .btn-icon svg { width: 12px; height: 12px; }
.inline-confirm { display: inline-flex; align-items: center; gap: 5px; margin-left: 5px; }
.inline-confirm .btn-sm { padding: 3px 9px; font-size: 12.5px; }

/* ------------------------------------------------------------- Hilfsmittel -- */
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.mt { margin-top: 18px; }
.flex { display: flex; align-items: center; gap: 12px; }
.sp { flex: 1; }
.tabs { display: inline-flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 11px; }
.tabs button {
  border: none; background: transparent; padding: 8px 16px;
  border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted);
  transition: background .15s, color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--card); color: var(--heading); box-shadow: var(--shadow-sm); }

/* Begrüßung auf dem Dashboard */
.greeting { margin-bottom: 26px; display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.greeting h1 { font-size: 27px; font-weight: 650; letter-spacing: -.02em; }
.greeting .sub { color: var(--muted); margin-top: 3px; font-size: 15px; }

/* ---------------------------------------------------------- Mobiles Menü -- */
.menu-btn { display: none; }
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s cubic-bezier(.2,.8,.3,1); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 22px 18px 56px; }
  .topbar { padding: 0 18px; height: 64px; }
  .form.cols-2 { grid-template-columns: 1fr; }
  .calendar .day { min-height: 76px; }
  .greeting h1 { font-size: 23px; }
}

/* ------------------------------------------------ Handy: Tabellen als Karten -- */
@media (max-width: 720px) {
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    display: block; border: 1px solid var(--border); border-radius: 12px;
    margin: 12px 16px; padding: 4px 0; background: var(--card);
  }
  .table-wrap tbody tr.row-sep {
    border: 0; border-radius: 8px; padding: 10px 14px; margin: 18px 16px 6px;
  }
  .table-wrap tbody tr.row-sep td { display: inline; padding: 0; background: transparent !important; border: 0; }
  .table-wrap tbody tr.row-sep td.num::before { content: " · "; }
  .table-wrap tbody td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 9px 16px; border-bottom: 1px solid var(--border); text-align: right;
  }
  .table-wrap tbody td:last-child { border-bottom: 0; }
  .table-wrap tbody td[data-label]::before {
    content: attr(data-label); font-size: 12px; letter-spacing: .04em;
    color: var(--muted); font-weight: 600; text-align: left; flex-shrink: 0;
  }
  .table-wrap tbody td:not([data-label]):empty { display: none; }
  .table-wrap tbody td .actions { opacity: 1; }
  .table-wrap tbody td.empty { display: block; text-align: center; }
  .table-wrap tbody tr:hover td { background: transparent; }
  .card.pad-0 .card-head { padding: 20px 18px 0; }
}

/* ---------------------------------------------------------------- Druck -- */
@media print {
  .sidebar, .topbar, .no-print, .toast, .modal-bg, .card-head .flex, .legend, .hint { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; page-break-inside: avoid; }
  .stat .value { font-size: 18px !important; }
  th, td { padding: 6px 8px !important; }
  a[href]::after { content: none !important; }
}

/* ------------------------------------------------------ Betreiber-Konsole -- */
.op-topbar {
  background: var(--sidebar); color: #fff;
  padding: 16px 40px; display: flex; align-items: center; gap: 16px;
}
.op-topbar .brand { padding: 0; }
.op-topbar .tag {
  background: rgba(255,255,255,.13); padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
}
.op-topbar .sp { flex: 1; }
.op-topbar button { background: rgba(255,255,255,.11); color: #fff; border: none; }
.op-topbar button:hover { background: rgba(255,255,255,.2); color: #fff; }
.op-wrap { max-width: 1320px; margin: 0 auto; padding: 32px 40px 72px; }
.op-center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: 14px; align-items: baseline; }
.kv b { color: var(--muted); font-weight: 600; white-space: nowrap; }
.slug-preview { font-family: Consolas, monospace; font-size: 13px; color: var(--green-600); }
:root[data-theme="dark"] .slug-preview { color: var(--green-400); }
.copy { cursor: pointer; }
@media (max-width: 720px) {
  .op-wrap { padding: 20px 16px 48px; }
  .op-topbar { padding: 14px 16px; flex-wrap: wrap; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv b { margin-top: 10px; }
}

/* ------------------------------------------------------------ Personalakte -- */
.profile-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 24px; }
.profile-head .avatar { width: 76px; height: 76px; font-size: 26px; }
.profile-head h1 { font-size: 28px; letter-spacing: -.02em; margin-bottom: 7px; }
.profile-head .meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: 8px;
  background: var(--surface-3); color: var(--text);
  font-size: 12.5px; font-weight: 500;
}
.tag svg { width: 13px; height: 13px; color: var(--muted); flex-shrink: 0; }

.profile-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 22px; align-items: start; }
.profile-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 96px; }
.profile-nav button {
  display: flex; align-items: center; gap: 11px; text-align: left; width: 100%;
  background: transparent; border: none; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  transition: background .15s, color .15s;
}
.profile-nav button:hover { background: var(--surface-3); color: var(--text); }
.profile-nav button.active { background: var(--green-50); color: var(--green-700); font-weight: 600; }
:root[data-theme="dark"] .profile-nav button.active { color: var(--green-400); }
.profile-nav button svg { width: 17px; height: 17px; flex-shrink: 0; }
.profile-nav button.active svg { color: var(--green-500); }
.profile-nav button .count {
  margin-left: auto; background: var(--surface-3); color: var(--muted);
  font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
}
.profile-nav button.active .count { background: var(--green-100); color: var(--green-700); }

.kv-row {
  display: grid; grid-template-columns: minmax(170px, 34%) 1fr; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center;
}
.kv-row:last-of-type { border-bottom: none; }
.kv-k { font-weight: 600; font-size: 14px; color: var(--heading); }
.kv-v { color: var(--text); min-width: 0; word-break: break-word; }
.kv-v .none { color: var(--faint); font-style: italic; }

@media (max-width: 960px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .profile-nav button { white-space: nowrap; width: auto; }
  .profile-head .avatar { width: 60px; height: 60px; font-size: 21px; }
  .profile-head h1 { font-size: 23px; }
}
@media (max-width: 620px) { .kv-row { grid-template-columns: 1fr; gap: 3px; padding: 11px 0; } }

/* ------------------------------------------------------ Zwei-Faktor-Anmeldung -- */
.twofa-setup { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.twofa-setup .qr {
  background: #fff; padding: 10px; border-radius: 12px;
  border: 1px solid var(--border-strong); line-height: 0; flex-shrink: 0;
}
.twofa-setup .grow { flex: 1; min-width: 230px; }
.twofa-setup p { font-size: 14px; }
.secret {
  font-family: Consolas, monospace; font-size: 15px; letter-spacing: .06em;
  background: var(--surface-3); padding: 10px 13px; border-radius: var(--radius-sm);
  word-break: break-all; user-select: all;
}
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codes span {
  font-family: Consolas, monospace; font-size: 14.5px; letter-spacing: .04em;
  background: var(--surface-3); padding: 9px 12px; border-radius: 8px;
  text-align: center; user-select: all;
}
