/* ==========================================================================
   Karl Krüger u. Sohn GmbH – HR System  ·  app.css  v5
   ========================================================================== */

/* ── Design-Tokens ──────────────────────────────────────────────────────── */
:root {
  --kk-blau:          #302585;
  --kk-blau-dunkel:   #1e1666;
  --kk-blau-hell:     #3d2fa6;
  --kk-gold:          #c8901a;
  --kk-gold-hell:     #e8a830;
  --kk-page-bg:       #f0f2f5;
  --kk-grau-hell:     #f4f6f8;
  --kk-grau-mittel:   #e0e4e8;
  --kk-text:          #1e2329;
  --kk-text-hell:     #5a6470;
  --kk-weiss:         #ffffff;
  --kk-radius:        10px;
  --kk-radius-lg:     14px;
  --kk-shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --kk-shadow:        0 4px 16px rgba(0,0,0,.08);
  --kk-shadow-stark:  0 8px 32px rgba(0,0,0,.14);
  --kk-sidebar-width: 220px;
  --kk-topbar-height: 56px;
  --kk-font-haupt:    'Montserrat', 'Segoe UI', Arial, sans-serif;
  --kk-font-text:     'Open Sans', 'Segoe UI', Arial, sans-serif;

  --bs-body-font-family: var(--kk-font-text);
  --bs-body-color:       var(--kk-text);
  --bs-border-radius:    var(--kk-radius);
  --kk-primary:          var(--kk-blau);
  --kk-accent:           var(--kk-gold);
}

/* ── Globale Typografie ─────────────────────────────────────────────────── */
body {
  font-family: var(--kk-font-text);
  color: var(--kk-text);
  font-size: 15px;
  line-height: 1.65;
  background: var(--kk-page-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--kk-font-haupt);
  color: var(--kk-blau);
  font-weight: 700;
}

a { color: var(--kk-blau); }
a:hover { color: var(--kk-gold); }

/* ── App-Shell (Sidebar-Layout) ─────────────────────────────────────────── */
.kk-app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.kk-sidebar {
  width: var(--kk-sidebar-width);
  background: var(--kk-blau);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.kk-sidebar::-webkit-scrollbar { width: 4px; }
.kk-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* Brand-Area */
.kk-sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
  padding: 1.1rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  text-decoration: none;
}
.kk-sidebar-logo { height: 26px; width: auto; }
.kk-sidebar-brand-text { flex: 1; min-width: 0; }
.kk-sidebar-brand-name {
  display: block;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .78rem;
  color: rgba(255,255,255,.95);
  letter-spacing: .02em;
  line-height: 1.2;
}
.kk-sidebar-brand-sub {
  display: block;
  font-size: .67rem;
  color: rgba(255,255,255,.42);
  font-family: var(--kk-font-haupt);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Nav-Bereich */
.kk-sidebar-nav {
  flex: 1;
  padding: .6rem 0;
  display: flex;
  flex-direction: column;
}

.kk-nav-section {
  font-size: .65rem;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  padding: .9rem 1.2rem .3rem;
  margin-top: .2rem;
}

.kk-sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .9rem;
  margin: 1px .5rem;
  border-radius: 7px;
  font-family: var(--kk-font-haupt);
  font-weight: 600;
  font-size: .82rem;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  transition: background .14s, color .14s;
  line-height: 1;
}
.kk-sidebar-link .bi {
  font-size: 1.05rem;
  width: 18px;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity .14s;
}
.kk-sidebar-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.kk-sidebar-link:hover .bi { opacity: 1; }
.kk-sidebar-link.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--kk-gold);
}
.kk-sidebar-link.active .bi { opacity: 1; }

/* Sub-Links (leicht eingerückt) */
.kk-sidebar-sublink {
  font-size: .78rem;
  padding: .4rem .9rem .4rem 2.5rem;
  color: rgba(255,255,255,.55);
}
.kk-sidebar-sublink.active {
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.08);
  box-shadow: inset 3px 0 0 var(--kk-gold);
}

/* Sidebar-Footer (User + Logout) */
.kk-sidebar-footer {
  padding: .65rem .75rem;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.kk-sidebar-user {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  padding: .3rem .35rem;
  border-radius: 7px;
  transition: background .14s;
}
.kk-sidebar-user:hover { background: rgba(255,255,255,.08); }
.kk-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--kk-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
  flex-shrink: 0;
}
.kk-user-info { flex: 1; min-width: 0; }
.kk-user-name {
  display: block;
  font-family: var(--kk-font-haupt);
  font-size: .75rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  line-height: 1.3;
  word-break: break-word;
}
.kk-user-role {
  display: block;
  font-size: .65rem;
  color: rgba(255,255,255,.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kk-logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.38);
  font-size: 1.1rem;
  padding: .3rem .35rem;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .14s, background .14s;
  display: flex;
  align-items: center;
}
.kk-logout-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}

/* Mobile Overlay */
.kk-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1029;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.kk-sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ── Main-Bereich ────────────────────────────────────────────────────────── */
.kk-main {
  margin-left: var(--kk-sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--kk-page-bg);
}

/* ── Topbar (slim Header) ────────────────────────────────────────────────── */
.kk-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: var(--kk-topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--kk-grau-mittel);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: .75rem;
  flex-shrink: 0;
}
.kk-sidebar-toggle {
  background: none;
  border: none;
  color: var(--kk-text-hell);
  font-size: 1.4rem;
  padding: .2rem .3rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background .14s;
}
.kk-sidebar-toggle:hover { background: var(--kk-grau-hell); }
.kk-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.kk-topbar-btn {
  background: none;
  border: none;
  color: var(--kk-text-hell);
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s, color .14s;
  position: relative;
}
.kk-topbar-btn:hover { background: var(--kk-grau-hell); color: var(--kk-blau); }

/* Topbar Dropdown */
.kk-topbar .dropdown-toggle::after { display: none; }
.kk-topbar .dropdown-menu {
  border: 1px solid var(--kk-grau-mittel);
  box-shadow: var(--kk-shadow);
  border-radius: var(--kk-radius);
  overflow: hidden;
  margin-top: .3rem;
  min-width: 180px;
}
.kk-topbar .dropdown-item {
  font-family: var(--kk-font-haupt);
  font-weight: 600;
  font-size: .82rem;
  padding: .55rem 1rem;
  color: var(--kk-text);
}
.kk-topbar .dropdown-item:hover { background: var(--kk-grau-hell); color: var(--kk-blau); }
.kk-topbar-user-label {
  font-family: var(--kk-font-haupt);
  font-size: .82rem;
  font-weight: 600;
  color: var(--kk-text);
}
.kk-topbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--kk-blau);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
}

/* ── Content-Bereich ─────────────────────────────────────────────────────── */
.kk-content {
  flex: 1;
  padding: 1.5rem 1.5rem 1rem;
}

/* ── Flash-Messages ──────────────────────────────────────────────────────── */
.kk-flash-container { margin-bottom: .75rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.kk-footer {
  background: #fff;
  border-top: 1px solid var(--kk-grau-mittel);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.kk-footer-logo { height: 20px; width: auto; opacity: .35; }
.kk-footer-text { color: var(--kk-text-hell); font-size: .75rem; }

/* ── Karten ──────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--kk-grau-mittel);
  border-radius: var(--kk-radius-lg) !important;
  box-shadow: var(--kk-shadow-sm);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--kk-grau-mittel);
  border-radius: var(--kk-radius-lg) var(--kk-radius-lg) 0 0 !important;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .85rem;
  color: var(--kk-blau);
  padding: .75rem 1rem;
}

/* Stat-Karte (linker Farbbalken) */
.card-stat {
  border-left: 4px solid var(--kk-blau);
  transition: box-shadow .18s, transform .18s;
}
.card-stat:hover { box-shadow: var(--kk-shadow); transform: translateY(-1px); }
.card-stat.accent { border-left-color: var(--kk-gold); }

/* ── KPI-Kacheln (Dashboard) ─────────────────────────────────────────────── */
.kk-kpi-card {
  background: #fff;
  border: 1px solid var(--kk-grau-mittel);
  border-radius: var(--kk-radius-lg);
  padding: 1.15rem 1.15rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  box-shadow: var(--kk-shadow-sm);
  transition: box-shadow .18s, transform .18s;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.kk-kpi-card:hover {
  box-shadow: var(--kk-shadow);
  transform: translateY(-1px);
  color: inherit;
}
.kk-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.kk-kpi-blau  { background: rgba(48,37,133,.1);  color: var(--kk-blau); }
.kk-kpi-gold  { background: rgba(200,144,26,.1);  color: var(--kk-gold); }
.kk-kpi-green { background: rgba(25,135,84,.1);   color: #198754; }
.kk-kpi-red   { background: rgba(220,53,69,.1);   color: #dc3545; }
.kk-kpi-teal  { background: rgba(13,202,240,.1);  color: #0dcaf0; }
.kk-kpi-body  { flex: 1; min-width: 0; }
.kk-kpi-label {
  font-size: .72rem;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  color: var(--kk-text-hell);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.kk-kpi-value {
  font-size: 1.7rem;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  line-height: 1;
  margin-bottom: .25rem;
  color: var(--kk-text);
}
.kk-kpi-sub { font-size: .78rem; color: var(--kk-text-hell); }

/* ── Bootstrap-Primärfarbe = KK-Blau ────────────────────────────────────── */
.btn-primary {
  background-color: var(--kk-blau) !important;
  border-color: var(--kk-blau) !important;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--kk-blau-hell) !important;
  border-color: var(--kk-blau-hell) !important;
}
.bg-primary  { background-color: var(--kk-blau) !important; }
.text-primary { color: var(--kk-blau) !important; }
.border-primary { border-color: var(--kk-blau) !important; }
.btn-outline-primary {
  color: var(--kk-blau) !important;
  border-color: var(--kk-blau) !important;
}
.btn-outline-primary:hover {
  background-color: var(--kk-blau) !important;
  color: #fff !important;
}

/* Gold-Button */
.btn-kk-gold {
  background-color: var(--kk-gold);
  border-color: var(--kk-gold);
  color: #fff;
  font-family: var(--kk-font-haupt);
  font-weight: 600;
}
.btn-kk-gold:hover {
  background-color: var(--kk-gold-hell);
  border-color: var(--kk-gold-hell);
  color: #fff;
}

/* ── Buttons allgemein ───────────────────────────────────────────────────── */
.btn {
  font-family: var(--kk-font-haupt);
  font-weight: 600;
  border-radius: 7px;
  letter-spacing: .02em;
}

/* ── Tabellen ────────────────────────────────────────────────────────────── */
.table th {
  background-color: var(--kk-grau-hell);
  font-family: var(--kk-font-haupt);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  color: var(--kk-text-hell);
  border-bottom: 2px solid var(--kk-grau-mittel) !important;
}
.table > :not(caption) > * > * {
  padding: .65rem .85rem;
}
.table-hover > tbody > tr:hover > td {
  background-color: rgba(48,37,133,.03);
}

/* ── Form-Elemente ───────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--kk-grau-mittel);
  border-radius: 7px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--kk-blau);
  box-shadow: 0 0 0 3px rgba(48,37,133,.12);
}
.form-label {
  font-family: var(--kk-font-haupt);
  font-weight: 600;
  font-size: .84rem;
  color: var(--kk-text);
  margin-bottom: .35rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-admin        { background-color: var(--kk-blau); }
.badge-buchhaltung  { background-color: #2E6DA4; }
.badge-vorgesetzter { background-color: #5A7A99; }
.badge-mitarbeiter  { background-color: var(--kk-text-hell); }

/* ── Auth / Login Split-Design ──────────────────────────────────────────── */
.kk-auth-split {
  min-height: 100vh;
  display: flex;
}
.kk-auth-brand {
  width: 42%;
  background: linear-gradient(160deg, var(--kk-blau) 0%, var(--kk-blau-dunkel) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.kk-auth-brand::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.kk-auth-brand::after {
  content: '';
  position: absolute;
  bottom: -70px;
  left: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(200,144,26,.07);
  pointer-events: none;
}
.kk-auth-brand-logo { height: 38px; width: auto; margin-bottom: 2rem; position: relative; }
.kk-auth-brand-title {
  font-family: var(--kk-font-haupt);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .6rem;
  position: relative;
}
.kk-auth-brand-divider {
  width: 36px;
  height: 3px;
  background: var(--kk-gold);
  margin: 0 auto .9rem;
  border-radius: 2px;
  position: relative;
}
.kk-auth-brand-sub {
  font-size: .88rem;
  color: rgba(255,255,255,.6);
  line-height: 1.65;
  max-width: 240px;
  position: relative;
}
.kk-auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 2.5rem;
}
.kk-auth-form-inner { width: 100%; max-width: 380px; }
.kk-auth-form-title {
  font-family: var(--kk-font-haupt);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--kk-blau);
  margin-bottom: .3rem;
}
.kk-auth-form-subtitle {
  color: var(--kk-text-hell);
  font-size: .88rem;
  margin-bottom: 1.75rem;
}

/* Legacy-Klassen (für Seiten die noch login-wrapper benutzen) */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kk-page-bg);
}
.login-card { width: 100%; max-width: 420px; }
.kk-login-logo-wrap { display: flex; justify-content: center; }
.kk-login-logo-img  { height: 48px; width: auto; }

/* ── HTMX ────────────────────────────────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

/* ── Teamkalender ────────────────────────────────────────────────────────── */

/* Monats-Label in der Navigation */
.kk-cal-month-label {
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .92rem;
  color: var(--kk-text);
  min-width: 170px;
  text-align: center;
}

/* Legende */
.kk-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  padding: .6rem .85rem;
  background: #fff;
  border: 1px solid var(--kk-grau-mittel);
  border-radius: var(--kk-radius);
  box-shadow: var(--kk-shadow-sm);
}
.kk-cal-legend-item {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.kk-cal-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.kk-cal-legend-text {
  font-size: .78rem;
  color: var(--kk-text-hell);
  white-space: nowrap;
}
.kk-cal-legend-text strong { color: var(--kk-text); }

/* Legend-Punkte Farben */
.kk-abs-dot-urlaub            { background: rgba(13,110,253,.6); }
.kk-abs-dot-krank             { background: rgba(220,53,69,.6);  }
.kk-abs-dot-kind_krank        { background: rgba(255,193,7,.85); }
.kk-abs-dot-sonderurlaub      { background: rgba(13,202,240,.7); }
.kk-abs-dot-unbezahlt         { background: rgba(108,117,125,.55); }
.kk-abs-dot-berufsschule      { background: rgba(25,135,84,.6);  }
.kk-abs-dot-freizeitausgleich { background: rgba(111,66,193,.6); }

/* Wrap + Tabelle */
.kk-cal-wrap {
  overflow-x: auto;
  border-radius: var(--kk-radius-lg);
  border: 1px solid var(--kk-grau-mittel);
  box-shadow: var(--kk-shadow-sm);
  background: #fff;
}
.kk-cal-table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

/* Kopfzeile – Name-Spalte */
.kk-cal-name-col {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 150px;
  background: var(--kk-grau-hell);
  font-family: var(--kk-font-haupt);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--kk-text-hell);
  padding: .55rem .85rem .5rem;
  border-bottom: 2px solid var(--kk-grau-mittel);
  border-right: 2px solid var(--kk-grau-mittel);
  vertical-align: bottom;
}

/* Kopfzeile – Tages-Spalten */
.kk-cal-day-col {
  min-width: 34px;
  width: 34px;
  text-align: center;
  padding: .3rem .15rem .35rem;
  background: var(--kk-grau-hell);
  border-bottom: 2px solid var(--kk-grau-mittel);
  border-left: 1px solid rgba(0,0,0,.06);
  vertical-align: bottom;
}
.kk-cal-day-col.kk-cal-we  { background: #ededf0; }
.kk-cal-day-col.kk-cal-ft  { background: #f8d7da; }
.kk-cal-day-col.kk-cal-now { background: rgba(48,37,133,.09); }

.kk-cal-weekday {
  display: block;
  font-size: .57rem;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  color: var(--kk-text-hell);
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.1;
}
.kk-cal-daynum {
  display: block;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .82rem;
  color: var(--kk-text);
  line-height: 1.25;
}
.kk-cal-day-col.kk-cal-now .kk-cal-daynum { color: var(--kk-blau); }
.kk-cal-ft-tag {
  display: block;
  font-size: .52rem;
  color: #dc3545;
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  line-height: 1.1;
}

/* Daten-Zeilen – Name-Spalte */
.kk-cal-emp-td {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  font-family: var(--kk-font-haupt);
  font-size: .82rem;
  font-weight: 600;
  color: var(--kk-text);
  padding: .45rem .85rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--kk-grau-mittel);
  border-right: 2px solid var(--kk-grau-mittel);
}
.kk-cal-row:hover .kk-cal-emp-td { background: rgba(48,37,133,.025); }

/* Daten-Zeilen – Tages-Zellen */
.kk-cal-td {
  padding: 2px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--kk-grau-mittel);
  border-left: 1px solid rgba(0,0,0,.04);
  height: 34px;
}
.kk-cal-td.kk-cal-we  { background: #f6f6f8; }
.kk-cal-td.kk-cal-now { background: rgba(48,37,133,.05); }

/* Abwesenheits-Farben (Zellen-Hintergrund) */
.kk-cal-td.kk-abs-urlaub            { background: rgba(13,110,253,.14); }
.kk-cal-td.kk-abs-krank             { background: rgba(220,53,69,.13);  }
.kk-cal-td.kk-abs-kind_krank        { background: rgba(255,193,7,.24);  }
.kk-cal-td.kk-abs-sonderurlaub      { background: rgba(13,202,240,.17); }
.kk-cal-td.kk-abs-unbezahlt         { background: rgba(108,117,125,.14); }
.kk-cal-td.kk-abs-berufsschule      { background: rgba(25,135,84,.14);  }
.kk-cal-td.kk-abs-freizeitausgleich { background: rgba(111,66,193,.13); }

/* Kürzel-Label */
.kk-cal-abs-label {
  font-family: var(--kk-font-haupt);
  font-weight: 700;
  font-size: .59rem;
  letter-spacing: .03em;
  line-height: 1;
}
.kk-cal-td.kk-abs-urlaub            .kk-cal-abs-label { color: #0a5dc1; }
.kk-cal-td.kk-abs-krank             .kk-cal-abs-label { color: #b91c2c; }
.kk-cal-td.kk-abs-kind_krank        .kk-cal-abs-label { color: #7a5b00; }
.kk-cal-td.kk-abs-sonderurlaub      .kk-cal-abs-label { color: #0e7490; }
.kk-cal-td.kk-abs-unbezahlt         .kk-cal-abs-label { color: #5a6370; }
.kk-cal-td.kk-abs-berufsschule      .kk-cal-abs-label { color: #166534; }
.kk-cal-td.kk-abs-freizeitausgleich .kk-cal-abs-label { color: #5b21b6; }
.kk-cal-abs-pending                  .kk-cal-abs-label { opacity: .45; }

/* ── Stundenzettel ───────────────────────────────────────────────────────── */
.arbzg-warn-hard { background-color: #fff3cd; }
.arbzg-warn-soft { background-color: var(--kk-grau-hell); }

/* ── Tages-Karten ────────────────────────────────────────────────────────── */
.kk-day-card {
  border-radius: var(--kk-radius);
  border: 1px solid var(--kk-grau-mittel);
  border-left: 4px solid var(--kk-grau-mittel);
  background: #fff;
  margin-bottom: .5rem;
  overflow: hidden;
  box-shadow: var(--kk-shadow-sm);
  transition: box-shadow .15s;
}
.kk-day-card:hover { box-shadow: var(--kk-shadow); }
.kk-day-card.kk-today   { border-left-color: var(--kk-blau); background: #f5f8fc; }
.kk-day-card.kk-arbeit  { border-left-color: #198754; }
.kk-day-card.kk-krank   { border-left-color: #dc3545; background: #fff8f8; }
.kk-day-card.kk-urlaub  { border-left-color: #0d6efd; background: #f5f8ff; }
.kk-day-card.kk-weekend { background: var(--kk-grau-hell); opacity: .75; }
.kk-day-card.kk-future  { opacity: .5; }

.kk-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .875rem;
}
.kk-day-name  { font-family: var(--kk-font-haupt); font-weight: 700; font-size: .95rem; color: var(--kk-blau); }
.kk-day-date  { color: var(--kk-text-hell); font-size: .82rem; margin-left: .3rem; }

.kk-day-body {
  padding: .3rem .875rem .55rem;
  font-size: .875rem;
  border-top: 1px solid rgba(0,0,0,.06);
}
.kk-job-line {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .2rem 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.kk-job-line:last-child { border-bottom: none; }
.kk-job-dur { color: var(--kk-text-hell); white-space: nowrap; min-width: 3.5rem; font-size: .82rem; }
.kk-job-dur-select { width: 110px; }
.kk-notif-badge { font-size: .6rem; padding: 2px 5px; }

.kk-day-actions {
  display: flex;
  gap: .4rem;
  padding: .45rem .875rem .55rem;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(0,0,0,.015);
}
.kk-day-actions .btn {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  font-size: .875rem;
}
.kk-btn-main { flex: 1; }

/* Wochennavigation */
.kk-week-nav { display: flex; gap: .4rem; align-items: center; }
.kk-week-nav .btn-nav {
  min-height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Dokumente ───────────────────────────────────────────────────────────── */
.employee-doc-card {
  border: 1px solid var(--kk-grau-mittel);
  border-radius: var(--kk-radius) !important;
  transition: border-color .15s, box-shadow .15s;
}
.employee-doc-card:hover {
  border-color: var(--kk-blau) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* ── Unterweisungen ──────────────────────────────────────────────────────── */
.instruction-content { line-height: 1.75; }
.instruction-content h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.2rem; color: var(--kk-blau); }
.instruction-content h4 { font-size: .95rem; font-weight: 700; color: var(--kk-blau); }
.instruction-content ul,
.instruction-content ol { padding-left: 1.5rem; }
.instruction-content li { margin-bottom: .3rem; }

/* ── Benachrichtigungs-Banner ────────────────────────────────────────────── */
.kk-notif-banner {
  border-left-width: 4px;
  border-radius: var(--kk-radius);
  animation: kk-slide-in .2s ease;
}
@keyframes kk-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Editor-Toolbar ──────────────────────────────────────────────────────── */
.kk-editor-toolbar { user-select: none; }
.kk-fmt-btn { min-width: 32px; padding: .15rem .4rem !important; font-size: .8rem !important; line-height: 1.4; }
.kk-editor-toolbar .vr { height: 1.4rem; align-self: center; }

/* ── List-Group ──────────────────────────────────────────────────────────── */
a.list-group-item-action:hover { background-color: var(--kk-grau-hell); }

/* ── Abwesenheiten – Mobile-Karten ──────────────────────────────────────── */
.kk-absence-card {
  border-left: 4px solid var(--kk-grau-mittel);
  border-radius: var(--kk-radius) !important;
  transition: box-shadow .15s;
}
.kk-absence-card:hover { box-shadow: var(--kk-shadow); }
.kk-absence-card.status-approved  { border-left-color: #198754; }
.kk-absence-card.status-pending   { border-left-color: var(--kk-gold); }
.kk-absence-card.status-rejected  { border-left-color: #dc3545; }
.kk-absence-card.status-cancelled { border-left-color: var(--kk-grau-mittel); opacity: .7; }

/* ── Alert ───────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--kk-radius) !important; }

/* ── Responsive – Sidebar & Layout ──────────────────────────────────────── */
@media (max-width: 991.98px) {
  .kk-sidebar {
    transform: translateX(-100%);
  }
  .kk-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0,0,0,.25);
  }
  .kk-sidebar-overlay { display: block; }
  .kk-main { margin-left: 0; }
  .kk-auth-brand { display: none; }
  .kk-auth-form { min-height: 100vh; padding: 2rem 1.5rem; }

  .kk-content { padding: 1rem; }
}

@media (max-width: 767.98px) {
  .kk-content { padding: .875rem; }
  .kk-day-actions .btn { min-height: 48px; font-size: .9rem; }
  .kk-day-header { padding: .65rem .875rem; }
  .kk-day-name   { font-size: 1rem; }
  .kk-week-nav .btn-nav { min-height: 48px; min-width: 48px; }
  .card-body { padding: .875rem; }
  .table { font-size: .82rem; }
  h5 { font-size: 1rem; }
}

@media (max-width: 575.98px) {
  .kk-kpi-value { font-size: 1.45rem; }
}

/* ── Geräteverwaltung: Foto-Thumbnails ─────────────────────────────────────── */
.kk-eq-foto-thumb {
  height: 72px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.kk-eq-foto-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.kk-eq-foto-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.employee-doc-card:hover { border-color: var(--bs-primary) !important; }

.kk-eq-icon-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(48,37,133,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--kk-blau);
}

/* ── Server-Status ──────────────────────────────────────────────────────── */
.kk-page-title {
  font-family: var(--kk-font-haupt);
  color: var(--kk-blau);
}
.kk-card-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--kk-text-hell);
}
.kk-disk-stats { display: flex; flex-direction: column; gap: .6rem; }
.kk-disk-stat { display: flex; flex-direction: column; }
.kk-disk-stat-label { font-size: .7rem; color: var(--kk-text-hell); }
.kk-disk-stat-value { font-size: .95rem; font-weight: 600; }
.kk-backup-dir-size { font-size: .8rem; color: var(--kk-text-hell); }
.kk-backup-file-list { max-height: 180px; overflow-y: auto; }
.kk-backup-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .25rem 0;
  border-bottom: 1px solid var(--kk-grau-mittel);
  font-size: .76rem;
}
.kk-backup-file-row:last-child { border-bottom: none; }
.kk-backup-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: .5rem; }
.kk-backup-file-size { flex-shrink: 0; font-size: .72rem; }
.kk-backup-run { padding: .6rem .85rem; }
.kk-backup-run-header { font-size: .84rem; }
.kk-backup-run-entries { margin-top: .35rem; }
.kk-backup-entry { font-size: .74rem; line-height: 1.5; }

/* ── DSGVO-Dokumente ────────────────────────────────────────────────────── */
.kk-doc-card { max-width: 860px; }
.kk-doc-body { padding: 2rem 2.5rem; font-size: .92rem; line-height: 1.7; }
.kk-doc-title { font-family: var(--kk-font-haupt); color: var(--kk-blau); margin-bottom: .25rem; }
.kk-doc-meta { color: var(--kk-text-hell); font-size: .82rem; margin-bottom: 1.5rem; }
.kk-doc-h6 { font-family: var(--kk-font-haupt); color: var(--kk-blau); font-size: .88rem; margin-top: 1.4rem; margin-bottom: .4rem; }
.kk-doc-block { background: var(--kk-grau-hell); border-left: 3px solid var(--kk-blau); border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1.25rem; font-size: .88rem; }
.kk-doc-table { font-size: .84rem; }
.kk-doc-table th { color: var(--kk-text-hell); font-weight: 600; }
.kk-doc-footer { color: var(--kk-text-hell); font-size: .78rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--kk-grau-mittel); }
.kk-doc-signature { background: var(--kk-grau-hell); border-radius: var(--kk-radius); padding: 1.5rem; font-size: .88rem; }
.kk-sig-line { border-bottom: 1px solid var(--kk-text); margin-bottom: .35rem; height: 2rem; }
.kk-sig-label { font-size: .74rem; color: var(--kk-text-hell); }

@media print {
  .kk-sidebar, .kk-topbar, .kk-footer, .nav-tabs, button, .btn { display: none !important; }
  .kk-main { margin: 0 !important; }
  .kk-content { padding: 0 !important; }
  .tab-pane { display: block !important; opacity: 1 !important; }
  .tab-pane:not(.active) { display: none !important; }
  .kk-doc-card { box-shadow: none !important; border: none !important; max-width: 100%; }
  .kk-doc-body { padding: 0 !important; }
}
