/* =====================================================
   HR-System — UI (Clockodo-inspiriert)
   Breakpoints: 375px | 768px | 1024px
   ===================================================== */

:root {
  --nav-bg:          #0f4c3a;   /* dunkles Tannengrün */
  --nav-text:        #d1fae5;
  --nav-active:      #ffffff;
  --nav-hover-bg:    rgba(255,255,255,.1);
  --color-primary:   #0d9488;   /* Teal */
  --color-primary-h: #0f766e;
  --color-success:   #16a34a;
  --color-warning:   #d97706;
  --color-danger:    #dc2626;
  --color-secondary: #64748b;
  --color-bg:        #f1f5f9;
  --color-surface:   #ffffff;
  --color-border:    #e2e8f0;
  --color-text:      #1e293b;
  --color-text-muted:#64748b;
  --radius:          6px;
  --shadow:          0 1px 3px rgba(0,0,0,.08);
  --left-panel-w:    220px;
  --topbar-h:        48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   TOP NAVIGATION BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0;
  z-index: 200;
}

.topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-nav a {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 .85rem;
  color: var(--nav-text);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: background .15s, color .15s;
}
.topbar-nav a:hover { background: var(--nav-hover-bg); color: var(--nav-active); text-decoration: none; }
.topbar-nav a.active { color: var(--nav-active); border-bottom-color: var(--color-primary); }

/* Dropdown-Untermenü (z.B. "Verwaltung") innerhalb der Nav */
.nav-dropdown { position: relative; height: var(--topbar-h); }
.nav-dropdown-toggle {
  display: flex; align-items: center; gap: .3rem; height: 100%;
  padding: 0 .85rem; color: var(--nav-text); font-size: .78rem; font-weight: 500;
  letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent; background: none; border-left: none; border-right: none; border-top: none;
  transition: background .15s, color .15s;
}
.nav-dropdown-toggle::after { content: '▾'; font-size: .65em; }
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle { background: var(--nav-hover-bg); color: var(--nav-active); }
.nav-dropdown.has-active .nav-dropdown-toggle { color: var(--nav-active); border-bottom-color: var(--color-primary); }

.nav-dropdown-menu {
  display: none;
  /* position:fixed statt absolute + Koordinaten per JS gesetzt (toggleNavDropdown) —
     .topbar-nav hat overflow-x:auto fürs mobile Scrollen, das würde ein absolut
     positioniertes Kind sonst abschneiden, auch wenn es korrekt "offen" ist. */
  position: fixed; top: 0; left: 0;
  background: var(--nav-bg);
  min-width: 210px;
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  flex-direction: column;
  z-index: 60;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a {
  height: auto; padding: .7rem 1rem; border-bottom: none;
  text-transform: none; letter-spacing: normal; font-size: .82rem;
}
.nav-dropdown-menu a.active { background: var(--nav-hover-bg); color: var(--nav-active); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
  margin-left: auto;
}
.topbar-right a, .topbar-right button {
  color: var(--nav-text);
  background: none;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .3rem .5rem;
  border-radius: var(--radius);
  transition: background .15s;
}
.topbar-right a:hover, .topbar-right button:hover {
  background: var(--nav-hover-bg); color: var(--nav-active); text-decoration: none;
}

.nav-link-with-badge { position: relative; }
.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-danger);
  color: #fff;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--nav-bg, #14532d);
  animation: nav-badge-pop .25s ease-out;
}
@keyframes nav-badge-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   APP LAYOUT: Left Panel + Main
   ============================================================ */
.app-layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ---- Left Panel ---- */
.left-panel {
  width: var(--left-panel-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.left-panel-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.left-panel-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.left-panel-user-name { font-size: .82rem; font-weight: 600; }

/* ---- Mitarbeiter-Selector ---- */
.left-panel-user-wrap {
  border-bottom: 1px solid var(--color-border);
}
.ma-selector-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
}
.ma-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ma-selector {
  flex: 1;
  min-width: 0;
  padding: .25rem .4rem;
  font-size: .78rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}
.ma-selector:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* ---- Live-Uhr ---- */
.live-clock-box {
  padding: 1.25rem 1rem .5rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.live-clock {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: .05em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.live-clock-label-top {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: .2rem;
}
.laufzeit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .35rem;
}
.laufzeit-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.laufzeit-value {
  font-size: .95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
}
.clock-status {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: .6rem;
}

/* ---- Stempel-Buttons (links) ---- */
.stempel-btn-group {
  display: flex;
  justify-content: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.stempel-circle-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform .1s, box-shadow .1s;
}
.stempel-circle-btn:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.btn-circle-start  { background: var(--color-primary); color: #fff; }
.btn-circle-pause  { background: #f59e0b; color: #fff; }
.btn-circle-stop   { background: var(--color-danger);  color: #fff; }
.btn-circle-resume { background: var(--color-success);  color: #fff; }

/* ---- Left Panel Sections ---- */
.left-section {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.left-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: .6rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .3rem;
  font-size: .82rem;
}
.stat-row .stat-label { color: var(--color-text-muted); }
.stat-row .stat-value { font-weight: 600; }
.stat-value.green  { color: var(--color-success); }
.stat-value.red    { color: var(--color-danger); }
.stat-value.orange { color: var(--color-warning); }

.week-nav, .stats-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
.week-nav button, .stats-nav button {
  background: none; border: 1px solid var(--color-border);
  border-radius: 50%; width: 22px; height: 22px;
  cursor: pointer; font-size: .75rem;
  color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.week-nav button:hover, .stats-nav button:hover { background: var(--color-bg); }
.week-nav span, .stats-nav span { font-size: .82rem; font-weight: 600; }

/* ---- Today Entries in Left Panel ---- */
.today-entry {
  display: flex;
  gap: .4rem;
  align-items: flex-start;
  margin-bottom: .4rem;
  font-size: .8rem;
}
.today-entry-icon { margin-top: 1px; color: var(--color-text-muted); }
.today-entry-time { color: var(--color-text-muted); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  background: var(--color-bg);
}

/* ---- Page Header Bar (Tabs + Aktionen) ---- */
.page-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.1rem; font-weight: 700; margin-right: auto; }

.tab-group {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
}
.tab-group a {
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.tab-group a:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.tab-group a.active { background: var(--color-primary); color: #fff; }

/* ---- Monat-Headline ---- */
.monat-headline { margin-bottom: 1.25rem; }
.monat-headline .jahr { font-size: .9rem; color: var(--color-text-muted); font-weight: 400; }
.monat-headline .monat-name {
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.monat-headline .stunden-info {
  font-size: .88rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ---- Timeline (Tages-Liste) ---- */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-day {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  background: var(--color-surface);
  overflow: hidden;
}
.timeline-day.today { border-color: var(--color-primary); }
.timeline-day.today .timeline-day-header { background: #e0f2fe; }
.timeline-day.weekend .timeline-day-header { background: #f8fafc; }

.timeline-day-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1rem;
  cursor: pointer;
}
.timeline-day-wochentag {
  font-size: .82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 52px;
}
.timeline-day-datum {
  font-size: .82rem;
  color: var(--color-text-muted);
  min-width: 72px;
}
.timeline-day-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
}
.timeline-day-icon.day-off { background: var(--color-bg); }
.timeline-day-label { flex: 1; font-size: .85rem; color: var(--color-text-muted); }
.timeline-day-total { font-size: .85rem; font-weight: 600; margin-left: auto; min-width: 60px; text-align: right; }
.timeline-day-ue    { font-size: .75rem; color: var(--color-text-muted); min-width: 50px; text-align: right; }

.timeline-entries { padding: 0 1rem .5rem 1rem; }

.entry-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .45rem 0;
  border-top: 1px solid #f1f5f9;
  font-size: .82rem;
}
.entry-row:first-child { border-top: none; }
.entry-row-icon { color: var(--color-text-muted); font-size: .9rem; flex-shrink: 0; }
.entry-col-label { color: var(--color-text-muted); font-size: .72rem; margin-bottom: 1px; }
.entry-col-value { font-weight: 600; }
.entry-actions {
  margin-left: auto;
  display: flex;
  gap: .25rem;
}
.entry-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: .2rem .3rem;
  border-radius: 3px;
  font-size: .85rem;
}
.entry-actions button:hover { background: var(--color-bg); color: var(--color-text); }

/* ============================================================
   BUTTONS (allgemein)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  text-decoration: none;
}
.btn-primary   { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-h); border-color: var(--color-primary-h); text-decoration:none; color:#fff; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg); text-decoration: none; }
.btn-danger         { background: var(--color-danger); color: #fff; }
.btn-danger-outline { background: transparent; color: var(--color-danger); border-color: transparent; }
.btn-danger-outline:hover { background: #fef2f2; border-color: var(--color-danger); text-decoration: none; }

/* ---- Inline Zeit-Editierung ---- */
.te-input {
  border: none;
  background: transparent;
  font-size: inherit;
  font-weight: 600;
  color: var(--color-text);
  padding: 0 2px;
  cursor: pointer;
  width: 54px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.te-input:hover  { background: var(--color-bg); }
.te-input:focus  { outline: 2px solid var(--color-primary); background: #fff; cursor: text; }
.te-dirty .te-input { background: #f0fdfa; outline: 1px solid var(--color-primary); }

.te-pause-input {
  border: none;
  background: transparent;
  font-size: .75rem;
  color: var(--color-text-muted);
  padding: 0 1px;
  cursor: pointer;
  width: 48px;
  border-radius: 3px;
}
.te-pause-input:hover { background: var(--color-bg); }
.te-pause-input:focus { outline: 2px solid var(--color-primary); background: #fff; cursor: text; }

/* ---- Offener-Vortag-Warn ---- */
.offener-warn { background: #fef2f2; border: 1px solid #fca5a5 !important; }
.offener-warn-title { font-size: .8rem; font-weight: 700; color: var(--color-danger); }
.offener-warn-info  { font-size: .75rem; color: var(--color-text-muted); margin-top: .2rem; }

/* ---- Pausen in Timeline ---- */
.timeline-pauses { padding: .2rem .75rem .35rem 2.5rem; display: flex; flex-direction: column; gap: .15rem; }
.pause-row { display: flex; align-items: center; gap: .5rem; }
.pause-row-time { font-size: .75rem; color: var(--color-text-muted); flex: 1; }
.btn-sm        { padding: .3rem .65rem; font-size: .78rem; }
.btn-full      { width: 100%; justify-content: center; }
.btn-icon      { padding: .3rem .4rem; }

/* ============================================================
   CARDS (allgemein, für nicht-Timeline-Seiten)
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card h2 { font-size: .88rem; font-weight: 600; margin-bottom: .75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.card-wide { grid-column: 1 / -1; }

/* ---- Dashboard-Grid ---- */
.dashboard-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px)  { .dashboard-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .dashboard-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* ============================================================
   FORMS
   ============================================================ */
label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: .25rem;
  margin-top: .85rem;
  color: var(--color-text-muted);
}
input[type=text], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=number],
input[type=month], select, textarea {
  width: 100%;
  padding: .45rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .88rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
textarea { min-height: 80px; resize: vertical; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: .75rem;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.alert-info    { background: #f0fdfa; border: 1px solid #99f6e4; color: #115e59; }

/* ============================================================
   TABLES
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { font-weight: 600; background: var(--color-bg); color: var(--color-text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.table tr:hover td { background: #f8fafc; }
.table-wrap { overflow-x: auto; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-teal   { background: #ccfbf1; color: #115e59; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ============================================================
   LOGIN
   ============================================================ */
body.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--color-bg);
}
.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%; max-width: 360px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.login-logo {
  font-size: 1.3rem; font-weight: 800;
  text-align: center; margin-bottom: 1.5rem;
  color: var(--color-primary);
}
.login-card .btn { margin-top: 1.25rem; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
.modal-card {
  background: #fff; border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal-card h2 { margin-bottom: 1rem; font-size: 1rem; }

/* ============================================================
   STEMPELUHR SPEZIFISCH
   ============================================================ */
.sperr-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center; z-index: 400;
}
.sperr-card {
  background: #fff; border-radius: var(--radius);
  padding: 2rem; width: 100%; max-width: 400px;
  text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.sperr-card h2 { margin-bottom: .75rem; }

/* Mood Smileys */
.mood-grid {
  display: flex; gap: .85rem; justify-content: center; margin: 1rem 0;
}
.mood-btn {
  font-size: 1.75rem;
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  width: 52px; height: 52px;
  cursor: pointer;
  transition: border-color .12s, transform .1s;
}
.mood-btn:hover, .mood-btn.selected {
  border-color: var(--color-primary); transform: scale(1.12);
}

/* ============================================================
   KALENDER
   ============================================================ */
.kal-monat { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kal-monat th {
  padding: .4rem; background: var(--color-bg); font-size: .75rem; font-weight: 700;
  text-align: center; color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  text-transform: uppercase; letter-spacing: .05em;
}
.kal-monat td { border: 1px solid var(--color-border); vertical-align: top; padding: 4px; min-height: 80px; }
.kal-tag-num { font-size: .75rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 3px; }
.kal-heute .kal-tag-num {
  background: var(--color-primary); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
}
.kal-heute { background: #f0fdfa; }
.kal-we    { background: #f8fafc; }
.kal-leer  { background: #f8fafc; }
.kal-chip {
  border-radius: 3px; padding: 1px 5px; margin-bottom: 2px;
  font-size: .7rem; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kal-woche { width: 100%; border-collapse: collapse; }
.kal-woche th, .kal-woche td { border: 1px solid var(--color-border); padding: 4px 6px; min-width: 80px; }
.kal-woche th { background: var(--color-bg); font-size: .75rem; text-align: center; }

/* ============================================================
   FEHLERSEITEN
   ============================================================ */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 3rem; color: var(--color-danger); }
.error-page p  { margin-top: 1rem; color: var(--color-text-muted); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination a, .pagination span {
  padding: .3rem .6rem; border: 1px solid var(--color-border);
  border-radius: 4px; font-size: .8rem;
}
.pagination .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .left-panel { display: none; }
  .topbar-nav a { padding: 0 .55rem; font-size: .72rem; }
  .nav-dropdown-toggle { padding: 0 .55rem; font-size: .72rem; }
}

/* ================================================================
   TIMELINE — Clockodo-Style Redesign
   ================================================================ */

/* Day container */
.tl-day { border-bottom: 2px solid var(--color-border); }
.tl-day:last-child { border-bottom: none; }

/* Day header */
.tl-day-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  cursor: pointer;
  user-select: none;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  min-height: 40px;
}
.tl-day-header:hover { background: #eef2f7; }
.tl-day-dow  { font-size: .75rem; font-weight: 700; color: var(--color-text-muted); width: 24px; flex-shrink: 0; }
.tl-day-date { font-size: .82rem; font-weight: 600; min-width: 76px; }
.tl-day-icon { flex-shrink: 0; }
.tl-day-spacer { flex: 1; }
.tl-day-total { font-size: .82rem; font-weight: 700; }
.tl-day-delta { font-size: .75rem; font-weight: 600; margin-left: .25rem; min-width: 52px; text-align: right; }
.tl-day-empty { font-size: .78rem; color: var(--color-text-muted); }

/* Entry row (main) */
.tl-entry {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .75rem .45rem 1rem;
  border-bottom: 1px solid var(--color-border);
  min-height: 48px;
  background: var(--color-surface);
  position: relative;
}
.tl-entry:last-child { border-bottom: none; }
.tl-entry.tl-active { background: #f0fdfa; }

/* Work type icon */
.tl-typ { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }

/* Time/value columns */
.tl-col { display: flex; flex-direction: column; min-width: 52px; }
.tl-col-wide { min-width: 70px; }
.tl-col-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted); line-height: 1.2;
}
.tl-col-val {
  font-size: .9rem; font-weight: 600; color: var(--color-text);
  font-variant-numeric: tabular-nums; line-height: 1.4;
}
.tl-col-muted { color: var(--color-text-muted); }

/* Extras (mood, badge) */
.tl-extras { display: flex; align-items: center; gap: .3rem; margin-left: .25rem; }
.tl-spacer  { flex: 1; }

/* Action buttons */
.tl-actions { display: flex; align-items: center; gap: .2rem; flex-shrink: 0; }
.tl-edit-actions { display: flex; align-items: center; gap: .2rem; flex-shrink: 0; }
.tl-error {
  font-size: .72rem; color: var(--color-danger);
  white-space: nowrap; max-width: 180px; margin-left: .25rem;
}

/* Divider between entry-icon and columns */
.tl-sep { width: 1px; height: 28px; background: var(--color-border); flex-shrink: 0; margin: 0 .15rem; }

/* Pause sub-row */
.tl-pause {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .75rem .2rem 2.75rem;
  font-size: .78rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  min-height: 30px;
}
.tl-pause:last-child { border-bottom: none; }
.tl-pause-icon { font-size: .72rem; flex-shrink: 0; }
.tl-pause-time { font-variant-numeric: tabular-nums; flex: 1; }
.tl-pause-dur  { font-size: .72rem; color: var(--color-text-muted); flex-shrink: 0; }

/* te-input override for new layout */
.tl-entry .te-input, .tl-entry .te-input:hover, .tl-entry .te-input:focus {
  width: 52px; font-size: .9rem; font-weight: 600;
  font-variant-numeric: tabular-nums; padding: 0;
  border: none; background: transparent; cursor: pointer;
  color: var(--color-text); border-radius: 3px;
}
.tl-entry .te-input:hover { background: var(--color-bg); }
.tl-entry .te-input:focus { outline: 2px solid var(--color-primary); background: #fff; cursor: text; }

.tl-pause .te-pause-input {
  width: 46px; font-size: .78rem; font-weight: 500;
  border: none; background: transparent; cursor: pointer;
  color: var(--color-text-muted); padding: 0; border-radius: 3px;
}
.tl-pause .te-pause-input:hover { background: var(--color-bg); }
.tl-pause .te-pause-input:focus { outline: 2px solid var(--color-primary); background: #fff; cursor: text; color: var(--color-text); }

/* Audit history */
.tl-history {
  padding: .4rem .75rem .4rem 2.75rem;
  background: #f8fafc;
  border-top: 1px dashed var(--color-border);
}
.tl-history-toggle {
  font-size: .72rem; color: var(--color-primary); cursor: pointer;
  padding: .2rem 0; display: inline-flex; align-items: center; gap: .25rem;
}
.tl-history-list { margin-top: .3rem; }
.tl-history-item {
  display: flex; gap: .5rem; font-size: .72rem;
  color: var(--color-text-muted); padding: .12rem 0;
  border-bottom: 1px dotted var(--color-border);
}
.tl-history-item:last-child { border-bottom: none; }
.tl-history-ts   { flex-shrink: 0; font-variant-numeric: tabular-nums; min-width: 72px; white-space: nowrap; }
.tl-history-who  { flex-shrink: 0; min-width: 80px; color: var(--color-text); }
.tl-history-what { flex: 1; }
.tl-history-via  { margin-left: .3rem; font-size: .8rem; opacity: .75; }
.tl-history-del  { color: var(--color-danger); font-weight: 600; }

/* "+" add entry button in empty day header */
.tl-add-btn {
  font-size: .7rem; padding: .1rem .35rem; margin-left: auto;
}

/* ================================================================
   SEGMENT-VIEW (Arbeit / Pause / Arbeit…)
   ================================================================ */
.seg-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .75rem .35rem 1rem;
  border-bottom: 1px solid var(--color-border);
  min-height: 44px; background: var(--color-surface);
}
.seg-row.seg-pause  { background: #f8fafc; }
.seg-row.seg-active { background: #f0fdfa; }
.seg-icon   { font-size: .95rem; flex-shrink: 0; width: 20px; text-align: center; }
.seg-col    { display: flex; flex-direction: column; min-width: 50px; }
.seg-lbl    { font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); line-height: 1.3; }
.seg-dash   { color: var(--color-text-muted); flex-shrink: 0; align-self: flex-end; padding-bottom: .1rem; }
.seg-dur    { font-size: .78rem; color: var(--color-text-muted); min-width: 58px; font-variant-numeric: tabular-nums; flex-shrink: 0; align-self: flex-end; padding-bottom: .1rem; }
.seg-spacer { flex: 1; }
.seg-val-ro { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-text); }
.seg-muted  { color: var(--color-text-muted) !important; font-weight: 400 !important; }

/* Editierbare Zeit-Zelle */
.seg-time { display: inline-flex; align-items: center; gap: .1rem; cursor: pointer; border-radius: 3px; }
.seg-time .seg-val {
  font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--color-text); padding: .05rem .12rem; border-radius: 3px;
}
.seg-time:hover .seg-val { background: var(--color-bg); }
.seg-time.seg-editing .seg-val { display: none; }
.seg-input {
  width: 54px; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 0 2px; border: none; outline: 2px solid var(--color-primary);
  background: #fff; border-radius: 3px; display: none; cursor: text; color: var(--color-text);
}
.seg-time.seg-editing .seg-input { display: inline; }
.seg-btns { display: none; align-items: center; gap: .1rem; }
.seg-time.seg-editing .seg-btns { display: inline-flex; }
.seg-err { font-size: .68rem; color: var(--color-danger); white-space: nowrap; }

/* Entry-Header bei mehrsegmentigen Einträgen */
.seg-entry-hd {
  display: flex; align-items: center; gap: .5rem;
  padding: .2rem .75rem .2rem 1rem;
  background: #eef2f7; border-bottom: 1px solid var(--color-border);
  min-height: 28px;
}
.seg-entry-hd-label { font-size: .72rem; color: var(--color-text-muted); flex: 1; }
.seg-entry-hd-net   { font-size: .72rem; font-weight: 700; color: var(--color-text); flex-shrink: 0; }
