:root {
  /* guggbyte.com Palette (Dark) – #0A0C14 bg, #FFE600 brand, #0D1B4B navy */
  --bg: #0A0C14;
  --bg-2: #0f1220;
  --panel: #161929;
  --panel-2: #1e2235;
  --ink: #e8eaf0;
  --muted: #8b90a8;
  --line: #2a2f48;
  --brand: #FFE600;
  --brand-dark: #fff176;
  --navy: #0D1B4B;
  --sidebar: #0d1322;
  --sidebar-ink: #8b90a8;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  /* Fonts wie guggbyte.com */
  --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Barlow Condensed', 'Barlow', sans-serif;
  --font-sys: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--sidebar);
  color: var(--sidebar-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand);
  color: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 19px; letter-spacing: .3px; }
.brand-name small { color: var(--brand); font-weight: 700; margin-left: 3px; }

.nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-ink); font-weight: 500; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--brand); color: var(--bg); font-weight: 700; }
.nav-item .ic { width: 18px; text-align: center; opacity: .9; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 12px; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand);
  color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-name { font-size: 14px; color: #fff; }
.logout { color: var(--sidebar-ink); font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.page-title { font-family: var(--font-display); font-size: 23px; margin: 0; font-weight: 700; letter-spacing: .2px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { padding: 26px 28px; }
.flash {
  margin: 16px 28px -8px; padding: 11px 16px; background: rgba(52,211,153,.12); color: var(--green);
  border: 1px solid rgba(52,211,153,.3); border-radius: 8px; font-weight: 500;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
  font-family: inherit; line-height: 1.2;
}
.btn:hover { text-decoration: none; border-color: #3a4060; background: var(--panel-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--bg); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--bg); }
.btn-danger { color: var(--red); border-color: rgba(248,113,113,.4); }
.btn-danger:hover { background: rgba(248,113,113,.12); border-color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; }

/* ── Cards / panels ─────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 22px;
}
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between;
}
.card-head h2 { font-family: var(--font-display); margin: 0; font-size: 18px; font-weight: 700; }
.card-body { padding: 20px; }

/* ── Stat tiles ─────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-family: var(--font-display); font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: .3px; }
.stat .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat.accent-red .value { color: var(--red); }
.stat.accent-green .value { color: var(--green); }
.stat.accent-amber .value { color: var(--amber); }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; background: var(--bg-2); }
table.data tbody tr:hover { background: rgba(255,255,255,.03); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px;
  font-weight: 700; line-height: 1.4;
}
.badge.gray { background: rgba(139,144,168,.15); color: var(--muted); }
.badge.blue { background: rgba(255,230,0,.12); color: var(--brand); }
.badge.green { background: rgba(52,211,153,.15); color: var(--green); }
.badge.amber { background: rgba(251,191,36,.15); color: var(--amber); }
.badge.red { background: rgba(248,113,113,.15); color: var(--red); }

/* ── Forms ──────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit; color: var(--ink); background: var(--bg-2); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,230,0,.15);
}
.field textarea { resize: vertical; min-height: 72px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check input { width: auto; }
.field.check label { color: var(--ink); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.help { font-size: 12px; color: var(--muted); }

/* ── Line items editor ──────────────────────────────────── */
table.items { width: 100%; border-collapse: collapse; }
table.items th { font-size: 12px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 8px; }
table.items td { padding: 4px 6px; vertical-align: top; }
table.items input, table.items select, table.items textarea {
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px;
  width: 100%; font-family: inherit; color: var(--ink); background: var(--bg-2);
}
table.items textarea { min-height: 38px; resize: vertical; }
table.items .num input { text-align: right; }
.row-total { font-variant-numeric: tabular-nums; padding-top: 14px; white-space: nowrap; }
.del-row { color: var(--red); cursor: pointer; background: none; border: none; font-size: 18px; padding: 6px; }

.totals { margin-left: auto; width: 320px; margin-top: 18px; }
.totals .line { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .line.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 800; }

/* ── Detail layouts ─────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; }
.addr-block { white-space: pre-line; line-height: 1.6; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin: 0 0 10px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 18px; }
.searchbar input { flex: 1; max-width: 360px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--bg-2); }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-tabs a { padding: 6px 13px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.filter-tabs a.active { background: var(--brand); color: var(--bg); border-color: var(--brand); }

.inline-form { display: inline; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 16px; }

/* ── Steuer: Grenz-Meter & Hinweise ─────────────────────── */
.meter-row { display: grid; grid-template-columns: 1fr 220px auto; gap: 14px; align-items: center; margin-bottom: 12px; }
.meter-label { font-size: 14px; font-weight: 600; }
.meter { height: 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; background: var(--green); transition: width var(--transition, .3s ease); }
.meter-fill.over { background: var(--red); }
.meter-val { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.notice { padding: 11px 15px; border-radius: 8px; font-size: 14px; margin-top: 10px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim, var(--muted)); }
.notice.ok { background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.3); color: var(--ink); }
.notice.warn { background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.35); color: var(--ink); }
.notice.danger { background: rgba(248,113,113,.10); border-color: rgba(248,113,113,.35); color: var(--ink); }

@media (max-width: 880px) {
  .meter-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 880px) {
  .sidebar { width: 64px; }
  .brand-name, .nav-item span:not(.ic), .user-name, .logout { display: none; }
  .form-grid, .two-col { grid-template-columns: 1fr; }
  .nav-item { justify-content: center; }
}

/* ── Login ──────────────────────────────────────────────── */
.login-wrap { display: grid; place-items: center; min-height: 100vh; background: var(--sidebar); }
.login-card { background: var(--panel); padding: 36px; border-radius: 14px; width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-card .brand { justify-content: center; padding: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-error { background: rgba(248,113,113,.12); color: var(--red); border: 1px solid rgba(248,113,113,.3); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }

/* ── Print documents (immer weißes Papier, dunkle Schrift) ──── */
.doc, .doc2 {
  --ink: #1c2733;
  --muted: #6b7785;
  --line: #e3e7ec;
  font-family: var(--font-sys);
}
.doc {
  max-width: 820px; margin: 24px auto; background: #fff; padding: 54px 60px;
  box-shadow: var(--shadow); color: #1c2733;
}
.doc .doc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 48px; }
.doc .from { font-size: 12px; color: var(--muted); line-height: 1.5; }
.doc .company-name { font-size: 20px; font-weight: 800; color: var(--ink); }
.doc .to { margin-bottom: 36px; line-height: 1.6; }
.doc .to .sender-line { font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 10px; }
.doc h1 { font-size: 24px; margin: 0 0 4px; }
.doc .meta { display: flex; gap: 28px; margin-bottom: 30px; font-size: 14px; }
.doc .meta .muted { display: block; font-size: 12px; }
.doc table.lines { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.doc table.lines th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 6px; }
.doc table.lines td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc table.lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc .doc-totals { width: 300px; margin-left: auto; margin-top: 12px; }
.doc .doc-totals .line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.doc .doc-totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 9px; font-weight: 800; font-size: 17px; }
.doc .notes { margin: 30px 0; white-space: pre-line; }
.doc .doc-foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 24px; }
.doc .doc-foot div { flex: 1; white-space: pre-line; }
.print-toolbar { max-width: 820px; margin: 16px auto 0; display: flex; gap: 10px; }

@media print {
  .print-toolbar, .sidebar, .topbar { display: none !important; }
  body { background: #fff; }
  .doc { box-shadow: none; margin: 0; max-width: none; padding: 20px 10px; }
}

/* ── Beleg im Guggbyte-Layout (an Vorlage RE/2026/00240 angelehnt) ─────────── */
.doc2 {
  max-width: 820px; margin: 24px auto; background: #fff; padding: 48px 56px 28px;
  box-shadow: var(--shadow); color: #1c2733; position: relative;
  display: flex; flex-direction: column; min-height: 1000px;
}
.doc2 .logo { text-align: right; margin-bottom: 18px; }
.doc2 .logo img { width: 190px; height: auto; }
.doc2 .sender { font-size: 10.5px; color: #555; border-bottom: 1px solid #b9c0c9;
  padding-bottom: 4px; margin-bottom: 26px; }
.doc2 .head-cols { display: flex; justify-content: space-between; gap: 40px; margin-bottom: 44px; }
.doc2 .recipient { font-size: 14px; line-height: 1.55; }
.doc2 .recipient .name { font-weight: 700; }
.doc2 .meta { font-size: 13px; min-width: 250px; }
.doc2 .meta .row { display: flex; justify-content: space-between; gap: 28px; padding: 1px 0; }
.doc2 .meta .row .lbl { color: #333; }
.doc2 .title { font-size: 40px; font-weight: 400; margin: 0 0 44px; }
.doc2 .intro { margin-bottom: 22px; white-space: pre-line; font-size: 14px; }
.doc2 table.lines { width: 100%; border-collapse: collapse; margin-bottom: 0; }
.doc2 table.lines th { text-align: right; font-size: 12.5px; font-weight: 600; color: #1c2733;
  padding: 4px 6px 12px; }
.doc2 table.lines th.desc { text-align: left; }
.doc2 table.lines td { padding: 8px 6px; vertical-align: top; font-size: 13.5px; }
.doc2 table.lines td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc2 .line-desc .name { font-weight: 600; }
.doc2 .line-desc .extra { color: #333; white-space: pre-line; }
.doc2 .sum { width: 320px; margin-left: auto; margin-top: 2px; }
.doc2 .sum .row { display: flex; justify-content: space-between; padding: 5px 6px; font-size: 13.5px; }
.doc2 .sum .row.grand { border-top: 1px solid #1c2733; font-weight: 700; padding-top: 9px; margin-top: 2px; }
.doc2 .pay { font-size: 13px; margin-top: 30px; line-height: 1.7; }
.doc2 .pay b { font-weight: 700; }
.doc2 .terms { font-size: 12px; color: #9aa3ad; margin-top: 16px; }
.doc2 .spacer { flex: 1; min-height: 40px; }
.doc2 .page-no { text-align: right; font-size: 10.5px; color: #9aa3ad; margin-bottom: 8px; }
.doc2 .foot { display: flex; gap: 22px; border-top: 1px solid #d4d9df; padding-top: 10px; }
.doc2 .foot > div { flex: 1; font-size: 9.5px; color: #555; line-height: 1.5; white-space: pre-line; }
.doc2 .foot .b { font-weight: 700; }
.doc2 .kleinunt { text-align: center; font-size: 9.5px; color: #555; margin: 12px auto 0; max-width: 70%; line-height: 1.5; }

@page { size: A4; margin: 14mm 12mm; }
@media print {
  .doc2 { box-shadow: none; margin: 0; max-width: none; min-height: 0; padding: 0; }
  .doc2 .spacer { flex: none; min-height: 24px; }
}

/* ── HR-spezifische Erweiterungen ───────────────────────── */

/* Avatar-Initialen in Listen */
.emp-cell { display: flex; align-items: center; gap: 11px; }
.emp-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--panel-2); color: var(--brand); display: grid; place-items: center;
  font-weight: 700; font-size: 13px; border: 1px solid var(--line);
}
.emp-avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.emp-meta .sub { color: var(--muted); font-size: 13px; }

/* Profil-Kopf */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; }
.profile-head h2 { font-family: var(--font-display); margin: 0; font-size: 26px; }
.profile-head .role { color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
  padding: 10px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Urlaubskonto-Ringe / Balken */
.leave-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; }
.leave-bar { height: 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.leave-bar .fill { height: 100%; background: var(--brand); }

/* Recruiting Pipeline (Kanban) */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.pcol { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.pcol h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: block; }
.pcard:hover { border-color: #3a4060; text-decoration: none; }
.pcard .name { font-weight: 700; color: var(--ink); }
.pcard .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Org-Chart */
.org ul { list-style: none; margin: 0; padding-left: 26px; border-left: 1px solid var(--line); }
.org > ul { padding-left: 0; border-left: none; }
.org li { margin: 8px 0; }
.org .node {
  display: inline-flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
}
.org .node .nm { font-weight: 700; }
.org .node .ps { color: var(--muted); font-size: 13px; }

/* Statusband oben am Profil */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 0; }

/* kleine Definitionsliste in Karten */
.card-body .kv { margin: 0; }

/* Kalender-artige Abwesenheitsanzeige */
.timeline-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.timeline-row:last-child { border-bottom: none; }

/* ── Demo-Zugang auf der Login-Karte ─────────────────────── */
.login-demo { margin-top: 18px; }
.login-demo-sep {
  display: block; text-align: center; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; margin: 6px 0 14px; position: relative;
}
.login-demo-sep::before, .login-demo-sep::after {
  content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line);
}
.login-demo-sep::before { left: 0; }
.login-demo-sep::after { right: 0; }
.login-demo-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 12px 0 0; text-align: center; }
