/* timeCapt Frontend CSS */

/* Default: Dark Theme */
:root {
  /* ---------------------------------------------------------------------
     Ebenen (z-index) — EINE Skala fuer die ganze Anwendung.
     ---------------------------------------------------------------------
     Bis Update _127 vergab jede Datei eigene Zahlen. Der gemeinsame Dialog
     (Modal.confirm/alert) lag auf 1001, die per JS gebauten Detail-Overlays
     (Rechnung, Kunde, Projekt, Aufgabe) auf 3000 — jede Rueckfrage aus so
     einem Overlay heraus erschien also DAHINTER und war unerreichbar.

     Deshalb gilt jetzt: der gemeinsame Dialog liegt ueber allem Bedienbaren.
     Neue Ebenen bitte NUR aus dieser Liste nehmen, keine neuen Zahlen
     erfinden — sonst faengt genau dieser Fehler wieder an.

       20    im Fluss liegende Kleinigkeiten (Tabellenkoepfe)
     1000    Kopfleiste, Seitenleiste
     1150    Verdunklung hinter der mobilen Seitenleiste
     1200    mobile Seitenleiste
     1300    mobiler Auswahl-Dialog (tc-dial)
     1400    Cookie-Banner
     1500    Popover und Dropdowns im Fluss
     3000    Detail-Overlays (Rechnung, Kunde, Projekt, Aufgabe, Import)
     4000    Kontextmenues
     5000    Bildbetrachter
     9000    GEMEINSAMER DIALOG (Backdrop 9000, Dialog 9001) — muss ueber allem liegen
     9002    Hinweis/Rueckfrage (#modal-message) — liegt ueber den Formular-
             Dialogen, damit eine Rueckfrage AUS einem Formular heraus sichtbar
             bleibt. Vorher entschied allein die Reihenfolge im HTML darueber
     9100    durchsuchbares Dropdown — muss ueber dem Dialog liegen,
             sonst laesst sich im Dialog nichts auswaehlen
     9900    Hinweise, die nichts blockieren (Toast, Offline-Leiste)
     --------------------------------------------------------------------- */
  --tc-z-sticky:        20;
  --tc-z-appbar:      1000;
  --tc-z-drawer-back: 1150;
  --tc-z-drawer:      1200;
  --tc-z-dial:        1300;
  --tc-z-consent:     1400;
  --tc-z-popover:     1500;
  --tc-z-overlay:     3000;
  --tc-z-menu:        4000;
  --tc-z-lightbox:    5000;
  --tc-z-modal:       9000;
  --tc-z-modal-front: 9001;
  --tc-z-message:     9002;
  --tc-z-select:      9100;
  --tc-z-toast:       9900;

  --tc-primary:         #f57c1f;
  --tc-primary-hover:   #ff8c2a;
  --tc-primary-fg:      #ffffff;
  --tc-primary-soft:    rgba(245, 124, 31, 0.12);

  --tc-accent-red:      #e34f4f;
  --tc-stat-cyan:       #29b6f6;
  --tc-stat-purple:     #ab47bc;
  --tc-stat-green:      #66bb6a;
  --tc-dot-blue:        #42a5f5;
  --tc-dot-red:         #ef5350;
  --tc-dot-green:       #66bb6a;
  --tc-dot-orange:      #f57c1f;

  --tc-bg:              #2d3a55;
  --tc-sidebar:         #252f45;
  --tc-appbar:          #2a3550;
  --tc-surface:         #323f5c;
  --tc-surface-2:       #3a4870;
  --tc-surface-border:  #3d4a68;

  --tc-text:            #e6e8ee;
  --tc-text-strong:     #ffffff;
  --tc-text-muted:      #a0a8bd;
  --tc-text-dim:        #6b7488;
  --tc-text-disabled:   #5a6478;

  --tc-divider:         rgba(255, 255, 255, 0.06);
  --tc-border:          rgba(255, 255, 255, 0.10);
  --tc-border-strong:   rgba(255, 255, 255, 0.18);

  --tc-input-bg:        rgba(0, 0, 0, 0.15);
  --tc-input-border:    rgba(255, 255, 255, 0.12);
  --tc-input-border-hover: rgba(255, 255, 255, 0.24);

  --tc-elev-1: 0 1px 2px rgba(0,0,0,0.3);
  --tc-elev-2: 0 2px 6px rgba(0,0,0,0.35);
  --tc-elev-4: 0 4px 14px rgba(0,0,0,0.4);
}

/* Light Theme - nur bei explizitem data-theme="light" */
[data-theme="light"] {
  --tc-primary:         #f57c1f;
  --tc-primary-hover:   #e66a00;
  --tc-primary-fg:      #ffffff;
  --tc-primary-soft:    rgba(245, 124, 31, 0.10);

  --tc-bg:              #f3f4f8;
  --tc-sidebar:         #ffffff;
  --tc-appbar:          #ffffff;
  --tc-surface:         #ffffff;
  --tc-surface-2:       #f8f9fc;
  --tc-surface-border:  #e4e7ef;

  --tc-text:            #1f2333;
  --tc-text-strong:     #0f1320;
  --tc-text-muted:      #5f6780;
  --tc-text-dim:        #9aa2b8;
  --tc-text-disabled:   #bac0d0;

  --tc-divider:         rgba(0, 0, 0, 0.06);
  --tc-border:          rgba(0, 0, 0, 0.10);
  --tc-border-strong:   rgba(0, 0, 0, 0.18);

  --tc-input-bg:        #ffffff;
  --tc-input-border:    #d6dae4;
  --tc-input-border-hover: #9aa2b8;

  --tc-elev-1: 0 1px 2px rgba(0,0,0,0.06);
  --tc-elev-2: 0 2px 8px rgba(0,0,0,0.08);
  --tc-elev-4: 0 6px 20px rgba(0,0,0,0.10);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tc-text);
  background: var(--tc-bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

/* App Layout */
.tc-app {
  display: grid;
  grid-template-columns: var(--sidebar-w, 200px) 1fr;
  grid-template-rows: 70px 1fr;
  grid-template-areas: "sidebar appbar" "sidebar main";
  min-height: 100vh;
  transition: grid-template-columns .25s ease;
}
.tc-app[data-sidebar="mini"] { --sidebar-w: 64px; }

/* Sidebar */
.tc-sidebar {
  grid-area: sidebar;
  background: var(--tc-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--tc-divider);
}
.tc-sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--tc-divider);
}
.tc-logo-img { height: 26px; width: auto; flex-shrink: 0; }
.tc-sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.tc-nav-section {
  padding: 16px 20px 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tc-text-dim);
}

.tc-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 42px;
  padding: 0 20px;
  color: var(--tc-text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}
.tc-nav-item:hover { color: var(--tc-text-strong); background: rgba(255,255,255,0.04); }
[data-theme="light"] .tc-nav-item:hover { background: rgba(0,0,0,0.04); }
.tc-nav-item.active { color: var(--tc-text-strong); font-weight: 500; }
.tc-nav-item.active::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tc-primary);
}
.tc-nav-item .mdi { font-size: 20px; width: 22px; text-align: center; flex-shrink: 0; }

.tc-sidebar-footer {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--tc-divider);
}

.tc-app[data-sidebar="mini"] .tc-nav-item { justify-content: center; padding: 0; }
.tc-app[data-sidebar="mini"] .tc-nav-item > span,
.tc-app[data-sidebar="mini"] .tc-nav-section,
.tc-app[data-sidebar="mini"] .tc-logo-img,
.tc-app[data-sidebar="mini"] .tc-theme-toggle > span { display: none; }
.tc-app[data-sidebar="mini"] .tc-nav-item.active::after { display: none; }
.tc-app[data-sidebar="mini"] .tc-theme-toggle { justify-content: center; }

/* Switch */
.tc-switch {
  position: relative;
  width: 36px;
  height: 14px;
  background: rgba(255,255,255,0.2);
  border-radius: 7px;
  cursor: pointer;
  transition: background-color .2s ease;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
[data-theme="light"] .tc-switch { background: rgba(0,0,0,0.24); }
.tc-switch::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fafafa;
  box-shadow: var(--tc-elev-1);
  transition: transform .2s ease, background-color .2s ease;
}
.tc-switch[aria-checked="true"] { background: color-mix(in srgb, var(--tc-primary) 40%, transparent); }
.tc-switch[aria-checked="true"]::before { transform: translateX(18px); background: var(--tc-primary); }

.tc-theme-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--tc-text-muted);
  font-size: 14px;
}
.tc-theme-toggle .mdi { font-size: 20px; width: 22px; text-align: center; }
.tc-theme-toggle > span { flex: 1; }

/* AppBar */
.tc-appbar {
  grid-area: appbar;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: var(--tc-appbar);
  border-bottom: 1px solid var(--tc-divider);
  position: sticky;
  top: 0;
  z-index: var(--tc-z-sticky);
}
.tc-appbar-spacer { flex: 1; }

/* --------------------------------------------------------------------------
   Dunkle Kopfleiste je Partner (Migration 055, partner_settings.color_header)
   --------------------------------------------------------------------------
   Manche Marken haben ihr Gewicht nicht in der Akzentfarbe, sondern in einer
   dunklen Kopfleiste. branding.js setzt Variable und Kennzeichen am <html> —
   bewusst dort und nicht an den Elementen: das Skript laeuft im <head>, wo es
   die Leiste noch gar nicht gibt. So steht die Farbe schon im ERSTEN Bild.

   Der Kniff: die Text- und Rahmen-Tokens werden HIER neu gesetzt, nicht an
   jedem Kind einzeln. Custom Properties vererben sich, also gelten sie ab
   dieser Ebene fuer alles in der Leiste — Knoepfe, Timer-Pille, Icons — ohne
   dass eine einzige Regel je Bauteil noetig waere. Ohne das erbt die Leiste
   die dunklen Schriftfarben des hellen Themes und ihre Bedienelemente
   verschwinden auf dunklem Grund.

   Seit _142 in BEIDEN Modi aktiv: eine Marke hat einen Kopfton, nicht zwei.
   Die Token-Ueberschreibung unten ist im dunklen Modus ohnehin deckungsgleich
   mit dem Theme — sie schadet dort nicht und haelt die Regel an einer Stelle.
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Neutraler Ladeschleier, bis das Branding steht (Update _141)
   --------------------------------------------------------------------------
   Bewusst ohne Markenfarbe und ohne Logo: solange nicht feststeht, WESSEN
   Marke gilt, darf keine zu sehen sein. Gesetzt wird die Klasse von einem
   Inline-Skript im <head>, entfernt von branding.js — oder nach 2,5 s von der
   Notbremse dort.

   ::before/::after am <html> statt eines eigenen Elements: das Skript laeuft,
   bevor es einen <body> gibt.
   -------------------------------------------------------------------------- */
html.tc-brandwait body { visibility: hidden; }
/* Logos sind Markenware: bis feststeht, wessen, bleiben sie unsichtbar.
   Nur sie — der Rest der Seite ist neutral und darf ruhig schon stehen. */
html.tc-logohide img.tc-logo-img,
html.tc-logohide img.tc-mobile-logo,
html.tc-logohide #logo-auth,
html.tc-logohide .tc-auth-subtitle { visibility: hidden; }
/* Fusszeile baut legal.js — bis dahin stuende dort „© timeCapt" mit
   Plattformlinks. Lieber leerer Platz als kurz die falsche Marke. */
html.tc-footerhide .tc-auth-footer,
html.tc-footerhide .tc-legal-footer { visibility: hidden; }
html.tc-brandwait::before {
  content: ''; position: fixed; inset: 0; z-index: 2147483000;
  background: var(--tc-bg, #f3f4f8);
}
html.tc-brandwait::after {
  content: ''; position: fixed; top: 50%; left: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid rgba(128, 128, 128, 0.22);
  border-top-color: rgba(128, 128, 128, 0.65);
  border-radius: 50%;
  animation: tc-brandspin .8s linear infinite;
  z-index: 2147483001;
}
@keyframes tc-brandspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html.tc-brandwait::after { animation: none; }
}

html[data-tc-header] .tc-appbar,
html[data-tc-header] .tc-sidebar-header,
html[data-tc-header] .tc-auth-topbar {
  background: var(--tc-appbar-brand, #222428);
  border-bottom-color: rgba(255, 255, 255, 0.10);

  --tc-text:            #e8eaf0;
  --tc-text-strong:     #ffffff;
  --tc-text-muted:      #a8b0c0;
  --tc-text-dim:        #7d8698;
  --tc-text-disabled:   #5d6577;
  --tc-border:          rgba(255, 255, 255, 0.18);
  --tc-border-strong:   rgba(255, 255, 255, 0.28);
  --tc-divider:         rgba(255, 255, 255, 0.10);
  --tc-surface:         rgba(255, 255, 255, 0.08);
  --tc-surface-2:       rgba(255, 255, 255, 0.14);
  --tc-surface-border:  rgba(255, 255, 255, 0.18);

  color: var(--tc-text);
}
html[data-tc-header] .tc-appbar .tc-timer-pill { background: rgba(255, 255, 255, 0.10); }

/* Der Logoblock sitzt in der Seitenleiste, nicht in der Kopfleiste — ohne die
   eigene Regel bliebe genau dieses Feld weiss und risse die dunkle Leiste auf.
   Die Trennlinie zur Navigation darunter bleibt die HELLE des Themes: dort
   beginnt wieder die helle Seitenleiste. */
html[data-tc-header] .tc-sidebar-header { border-bottom-color: rgba(0, 0, 0, 0.10); }

.tc-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 6px 0 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--tc-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--tc-text);
  cursor: pointer;
  transition: background-color .15s ease;
}
[data-theme="light"] .tc-timer-pill { background: var(--tc-surface-2); }
.tc-timer-pill:hover { background: rgba(0,0,0,0.3); }
[data-theme="light"] .tc-timer-pill:hover { background: #edf0f7; }
.tc-timer-pill .tc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc-dot-blue); }
.tc-timer-pill .tc-time-val { font-variant-numeric: tabular-nums; color: var(--tc-text-muted); }
.tc-timer-pill .tc-play-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: transparent; color: var(--tc-primary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background-color .15s ease;
}
.tc-timer-pill .tc-play-btn:hover { background: var(--tc-primary-soft); }
.tc-timer-pill .tc-play-btn .mdi { font-size: 16px; }

.tc-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #b0c4de, #7a8aa8);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 13px;
  flex-shrink: 0; cursor: pointer;
}

/* Icon Button */
.tc-icon-btn {
  width: 40px; height: 40px;
  border: none; background: transparent;
  color: var(--tc-text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
  flex-shrink: 0;
}
.tc-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--tc-text-strong); }
[data-theme="light"] .tc-icon-btn:hover { background: rgba(0,0,0,0.06); }
.tc-icon-btn .mdi { font-size: 22px; }

/* Main */
.tc-main { grid-area: main; padding: 24px 32px 48px; overflow-y: auto; }
.tc-container { max-width: 1200px; margin: 0 auto; }
/* Volle Breite (App.toggleWide, Schalter in der Seitenleiste). Die Klasse
   sitzt auf <html>, damit sie schon vor dem ersten Rendern greift und es
   kein Umspringen gibt. Auf schmalen Screens ist ohnehin 100 % gesetzt. */
.tc-wide .tc-container { max-width: none; }
/* Der Schalter dazu sitzt in der Kopfleiste — Desktop only. Unter 1024px ist
   der Inhalt ohnehin schon so breit wie das Fenster; auf Tablet und Handy hat
   der Knopf deshalb nichts zu suchen und wird ausgeblendet. */
.tc-wide-btn.is-on { color: var(--tc-primary); }
@media (max-width: 1023px) { .tc-wide-btn { display: none !important; } }

.tc-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  min-height: 44px;
}
.tc-page-title {
  font-size: 28px;
  font-weight: 300;
  margin: 0;
  color: var(--tc-text-strong);
  letter-spacing: -.01em;
}
.tc-page-actions { display: flex; align-items: center; gap: 12px; }

/* Segmented */
.tc-segmented { display: inline-flex; background: rgba(255,255,255,0.06); border-radius: 18px; padding: 3px; }
[data-theme="light"] .tc-segmented { background: #e8eaf0; }
.tc-segmented button {
  padding: 6px 16px;
  border: none; background: transparent;
  color: var(--tc-text-muted);
  font-size: 13px; font-weight: 500;
  border-radius: 15px; cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
  font-family: inherit;
}
.tc-segmented button.active {
  background: var(--tc-surface);
  color: var(--tc-text-strong);
  box-shadow: var(--tc-elev-1);
}
[data-theme="light"] .tc-segmented button.active { background: #ffffff; }

/* Stat Grid */
.tc-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tc-stat-card {
  background: var(--tc-surface);
  border: 1px solid var(--tc-surface-border);
  border-radius: 8px;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.tc-stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.tc-stat-icon.cyan   { background: linear-gradient(135deg, var(--tc-stat-cyan)   0%, #0288d1 100%); }
.tc-stat-icon.purple { background: linear-gradient(135deg, var(--tc-stat-purple) 0%, #6a1b9a 100%); }
.tc-stat-icon.green  { background: linear-gradient(135deg, var(--tc-stat-green)  0%, #2e7d32 100%); }
.tc-stat-icon .mdi { font-size: 24px; }

.tc-stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tc-stat-value {
  font-size: 22px; font-weight: 500;
  color: var(--tc-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.tc-stat-label { font-size: 13px; color: var(--tc-text-muted); }

/* Cards */
.tc-card {
  background: var(--tc-surface);
  border: 1px solid var(--tc-surface-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.tc-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  font-size: 14px; color: var(--tc-text-muted);
  border-bottom: 1px solid var(--tc-divider);
}
.tc-card-header .mdi { font-size: 18px; }
.tc-card-body { padding: 20px; }

/* Quick Actions */
.tc-quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Tables */
.tc-table-wrap { padding: 4px 0; }
.tc-table { width: 100%; border-collapse: collapse; }
.tc-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px; font-weight: 400;
  color: var(--tc-text-muted);
  border-bottom: 1px solid var(--tc-divider);
  white-space: nowrap;
}
.tc-table td {
  padding: 14px 16px;
  font-size: 14px; color: var(--tc-text);
  border-bottom: 1px solid var(--tc-divider);
}
.tc-table tbody tr:hover { background: var(--tc-surface-2); }

.tc-loading-row {
  text-align: center;
  color: var(--tc-text-muted);
  font-style: italic;
}

/* Buttons */
.tc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px; height: 38px;
  background: transparent; color: var(--tc-primary);
  border: none; border-radius: 4px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
  letter-spacing: .02em;
  text-decoration: none;
}
.tc-btn:hover { background: var(--tc-primary-soft); }

.tc-btn--primary {
  background: var(--tc-primary); color: var(--tc-primary-fg);
  border-radius: 22px; padding: 0 24px; height: 40px;
  box-shadow: var(--tc-elev-1);
}
.tc-btn--primary:hover {
  background: var(--tc-primary-hover);
  box-shadow: var(--tc-elev-2);
}

.tc-btn--ghost {
  color: var(--tc-text-muted);
}
.tc-btn--ghost:hover { background: rgba(255,255,255,0.04); color: var(--tc-text); }

.tc-btn .mdi { font-size: 18px; }

.tc-btn--sm {
  height: 32px; padding: 0 16px; font-size: 12px;
}
.tc-btn--sm .mdi { font-size: 16px; }

/* Loading */
.tc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  color: var(--tc-text-muted);
}

.tc-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--tc-border);
  border-top: 3px solid var(--tc-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modals */
.tc-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--tc-z-modal);
  display: none;
}
.tc-modal-overlay.show { display: block; }

.tc-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--tc-surface);
  border-radius: 8px;
  box-shadow: var(--tc-elev-4);
  min-width: 400px;
  max-width: 90vw;
  max-height: 90vh;
  z-index: var(--tc-z-modal-front);
  display: none;
  border: 1px solid var(--tc-surface-border);
}
.tc-modal.show { display: block; }

/* Hinweis- und Rueckfrage-Dialog eine Stufe hoeher als die Formular-Dialoge.
   Er wird oft AUS einem offenen Formular heraus aufgerufen („Name bereits
   vergeben") und muss dann darueber liegen. Bisher ging das nur gut, weil
   #modal-message zufaellig als letztes im HTML steht — ein neuer Dialog
   dahinter haette die Rueckfrage wieder verdeckt. */
#modal-message { z-index: var(--tc-z-message); }
/* Formular-Modals (Projekt/Kunde/Leistung/Benutzer): feste, komfortable Breite
   auf Desktop — so springt die Breite nicht, wenn Optionen ein-/ausgeblendet
   werden. Auf schmalen Screens greift max-width: 90vw. */
.tc-modal--form { width: 660px; }
@media (max-width: 720px) { .tc-modal--form { width: 92vw; } }

.tc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--tc-divider);
}
.tc-modal-header h3 {
  margin: 0;
  color: var(--tc-text-strong);
  font-size: 18px;
  font-weight: 500;
}

.tc-modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.tc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--tc-divider);
}

/* Form Fields */
.tc-field { margin-bottom: 18px; }
.tc-field-label {
  display: block;
  font-size: 12px;
  color: var(--tc-text-muted);
  margin-bottom: 6px;
}

.tc-field-input {
  width: 100%; height: 44px;
  padding: 0 14px;
  font-size: 14px; color: var(--tc-text);
  background: var(--tc-input-bg);
  border: 1px solid var(--tc-input-border);
  border-radius: 6px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}

textarea.tc-field-input {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
}

select.tc-field-input {
  cursor: pointer;
}

.tc-field-input::placeholder { color: var(--tc-text-dim); }
.tc-field-input:hover { border-color: var(--tc-input-border-hover); }
.tc-field-input:focus {
  border-color: var(--tc-primary);
  box-shadow: 0 0 0 3px var(--tc-primary-soft);
}

/* Checkbox in labels */
.tc-field-label input[type="checkbox"] {
  margin-right: 8px;
}

/* Tooltips */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 25, 40, 0.95);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: var(--tc-z-appbar);
  border: 1px solid var(--tc-border);
}

/* ============================================================
   Zeiterfassung (Schnelleingabe, Chips, Hinweise)
   ============================================================ */
.tc-entry-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.9fr 1.5fr auto;
  gap: 10px;
  align-items: center;
}
@media (max-width: 980px) {
  .tc-entry-form { grid-template-columns: 1fr 1fr; }
}

.tc-chip-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--tc-border);
  background: transparent;
  color: var(--tc-text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.tc-chip:hover {
  border-color: var(--tc-primary);
  color: var(--tc-primary);
  background: var(--tc-primary-soft);
}
.tc-chip .mdi { font-size: 14px; }

.tc-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--tc-text-dim);
}
.tc-hint code {
  background: var(--tc-input-bg);
  border: 1px solid var(--tc-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

/* Badges (Rollen, Status) */
.tc-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
.tc-badge--success { background: rgba(76, 175, 110, 0.15); color: #4caf6e; }
.tc-badge--info    { background: var(--tc-primary-soft);   color: var(--tc-primary); }
.tc-badge--muted   { background: var(--tc-input-bg); color: var(--tc-text-muted); border: 1px solid var(--tc-border); }

/* Kalender */
.tc-cal-grid {
  display: grid;
  grid-template-columns: minmax(34px, auto) repeat(7, 1fr);
  gap: 6px;
}
.tc-cal-kwhead { color: var(--tc-text-dim) !important; }
.tc-cal-kw {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--tc-text-muted);
  border-right: 1px solid var(--tc-divider);
  padding-right: 6px;
}
.tc-cal-head {
  text-align: center;
  font-size: 12px;
  color: var(--tc-text-muted);
  padding: 4px 0;
}
.tc-cal-day {
  min-height: 72px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .15s ease, background-color .15s ease;
}
.tc-cal-day:hover {
  border-color: var(--tc-primary);
  background: var(--tc-primary-soft);
}
.tc-cal-day--dim {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.tc-cal-day--weekend { background: var(--tc-input-bg); }
.tc-cal-day--today { border-color: var(--tc-primary); box-shadow: 0 0 0 1px var(--tc-primary) inset; }
.tc-cal-num { font-size: 12px; color: var(--tc-text-muted); }
.tc-cal-day--today .tc-cal-num { color: var(--tc-primary); font-weight: 700; }
.tc-cal-sum {
  align-self: flex-end;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--tc-text-strong);
}
@media (max-width: 720px) {
  .tc-cal-day { min-height: 52px; padding: 4px 6px; }
  .tc-cal-sum { font-size: 11px; }
}

/* Berichte-Filter */
.tc-report-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Einstellungen */
.tc-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 20px;
  margin-bottom: 6px;
}

/* Hilfe-Seite */
.tc-help p {
  font-size: 14px;
  color: var(--tc-text-muted);
  line-height: 1.65;
  margin: 0 0 12px;
}
.tc-help p:last-child { margin-bottom: 0; }
.tc-help strong { color: var(--tc-text); }
.tc-help ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.tc-help li {
  font-size: 14px;
  color: var(--tc-text-muted);
  line-height: 1.65;
  margin-bottom: 4px;
}
.tc-help code {
  background: var(--tc-input-bg);
  border: 1px solid var(--tc-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  color: var(--tc-text);
}

/* ============================================================
   Berichte 2.0: Tabs, Trends, Progress, Budgets, Heatmap, DPA
   ============================================================ */

/* Tabs */
.tc-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--tc-divider);
}
.tc-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--tc-text-muted);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 14px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.tc-tab:hover { color: var(--tc-text-strong); }
.tc-tab.active {
  color: var(--tc-primary);
  border-bottom-color: var(--tc-primary);
  font-weight: 600;
}

/* Trend-Pfeile */
.tc-trend {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tc-trend--up   { color: var(--tc-dot-green); }
.tc-trend--down { color: var(--tc-dot-red); }

.tc-compare-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--tc-text-muted);
}

/* Fortschrittsbalken */
.tc-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--tc-input-bg);
  overflow: hidden;
  min-width: 60px;
}
.tc-progress--lg { height: 10px; border-radius: 5px; }
.tc-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--tc-primary);
  transition: width .3s ease;
}
.tc-progress-bar.warn   { background: var(--tc-dot-orange); }
.tc-progress-bar.danger { background: var(--tc-dot-red); }

/* Budget-Zeilen */
.tc-budget-row { padding: 12px 0; border-bottom: 1px solid var(--tc-divider); }
.tc-budget-row:last-child { border-bottom: none; }
.tc-budget-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

/* Auffälligkeiten */
.tc-anomaly-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--tc-text-muted);
}
.tc-anomaly-row .mdi { font-size: 17px; color: var(--tc-text-dim); margin-top: 1px; }
.tc-anomaly-row strong { color: var(--tc-text-strong); }

/* Team live */
.tc-dot--live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tc-dot-red);
  animation: tc-pulse 1.4s ease infinite;
}
@keyframes tc-pulse { 50% { opacity: 0.35; } }

/* Dashboard-Erweiterungen */
.tc-stat-icon.orange { background: linear-gradient(135deg, var(--tc-dot-orange) 0%, #e65100 100%); }
.tc-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
@media (max-width: 980px) { .tc-dash-grid { grid-template-columns: 1fr; } }

.tc-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.tc-top-name {
  width: 150px;
  font-size: 13px;
  color: var(--tc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-top-val {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--tc-text-muted);
  min-width: 70px;
  text-align: right;
}

/* Heatmap (53 Wochen × 7 Tage, horizontal scrollbar) */
.tc-heatmap {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.tc-heat-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tc-heat-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--tc-input-bg);
  flex: 0 0 auto;
}
.tc-heat--empty { background: transparent; }
.tc-heat--1 { background: rgba(245, 124, 31, 0.30); }
.tc-heat--2 { background: rgba(245, 124, 31, 0.55); }
.tc-heat--3 { background: rgba(245, 124, 31, 0.80); }
.tc-heat--4 { background: var(--tc-dot-orange); }

/* Breites Modal (AV-Vertrag-Vorschau) */
.tc-modal--wide { max-width: 760px; width: calc(100vw - 48px); }

/* AV-Vertrag-Dokument (HTML-Vorschau) */
.tc-dpa-doc h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--tc-text-strong);
  margin: 0 0 14px;
}
.tc-dpa-doc h3 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tc-text-strong);
  margin: 18px 0 6px;
}
.tc-dpa-doc p, .tc-dpa-doc li {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--tc-text-muted);
  margin: 0 0 10px;
}
.tc-dpa-doc ul { margin: 0 0 10px; padding-left: 20px; }
.tc-dpa-doc .tc-dpa-intro { text-align: center; }

/* ============================================================
   Kalender: Wochenende im Light-Theme leicht abheben
   ============================================================ */
[data-theme="light"] .tc-cal-day--weekend {
  background: #eaf1fb;                 /* zarter Blauton für Sa/So */
  border-color: #d8e3f4;
}
[data-theme="light"] .tc-cal-day--weekend:hover {
  background: var(--tc-primary-soft);
}
/* Wochenend-Kopfzeilen (Sa/So) ebenfalls dezent markieren */
.tc-cal-head--weekend { color: var(--tc-primary); }
/* im Dark-Theme nur eine Spur kühler */
.tc-cal-day--weekend { background: var(--tc-input-bg); }

/* ============================================================
   TCSelect — durchsuchbares Dropdown (select.tc-search)
   ============================================================ */
.tc-select { position: relative; }
.tc-select-native { display: none !important; }

.tc-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.tc-select-btn .tc-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-select-label.tc-select-placeholder { color: var(--tc-text-dim); }
.tc-select-caret { color: var(--tc-text-muted); transition: transform .15s ease; }
.tc-select.open .tc-select-caret { transform: rotate(180deg); }
.tc-select.is-disabled .tc-select-btn { opacity: .55; cursor: not-allowed; }

.tc-select-panel {
  position: fixed;            /* per JS an den Button positioniert (umgeht overflow:hidden) */
  z-index: var(--tc-z-select);   /* MUSS ueber dem Dialog liegen, sonst ist im
                                    Dialog kein Auswahlfeld bedienbar */
  background: var(--tc-surface);
  border: 1px solid var(--tc-surface-border);
  border-radius: 8px;
  box-shadow: var(--tc-elev-4);
  display: none;
  overflow: hidden;
}
.tc-select.open .tc-select-panel { display: block; }

.tc-select-search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid var(--tc-divider);
}
.tc-select-search .mdi {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tc-text-muted);
  font-size: 18px;
  pointer-events: none;
}
.tc-select-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px 8px 36px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  background: var(--tc-input-bg);
  color: var(--tc-text);
  font-family: inherit;
  font-size: 14px;
}
.tc-select-input:focus { outline: none; border-color: var(--tc-primary); }

.tc-select-list { max-height: 280px; overflow-y: auto; padding: 4px; }
.tc-select-group {
  padding: 10px 10px 4px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tc-text);   /* schwarz im Hell-, weiß im Dunkelmodus (wie native optgroup) */
}
.tc-select-opt {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--tc-text);   /* im Dunkelmodus weiße Schrift auf hellerem Panel */
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-select-opt:hover { background: var(--tc-primary-soft); }
.tc-select-opt--grouped { padding-left: 28px; }   /* Optionen unter einer Gruppe deutlich eingerückt */

/* ---- Zahlungen-Tab (Selfservice) ---- */
#zahlungen-content .tc-bill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 820px) { #zahlungen-content .tc-bill-grid { grid-template-columns: 1fr; } }
#zahlungen-content .tc-bill-col { line-height: 1.7; }
#zahlungen-content .tc-bill-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tc-text-muted); margin: 0 0 10px; }
#zahlungen-content table { width: 100%; border-collapse: collapse; }
#zahlungen-content table th { text-align: left; font-size: 12px; color: var(--tc-text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--tc-divider); }
#zahlungen-content table td { padding: 9px 10px; border-bottom: 1px solid var(--tc-divider); font-size: 14px; }
.tc-link-btn { background: none; border: none; color: var(--tc-primary); cursor: pointer; padding: 6px 0; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
.tc-link-btn:hover { text-decoration: underline; }
.tc-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tc-btn--sm { padding: 6px 12px; font-size: 13px; }
.tc-select-opt.is-selected { background: var(--tc-primary-soft); color: var(--tc-primary); font-weight: 500; }
.tc-select-empty { padding: 14px 10px; color: var(--tc-text-muted); font-size: 13px; text-align: center; }

/* ============================================================
   Kunden: Sätze je Leistung (Picker-Liste im Modal)
   ============================================================ */
/* Abgesetzte Satz-Karte: jeder Modus eine Zeile, klar getrennt */
.tc-rate-card {
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  padding: 2px 14px;
  background: var(--tc-input-bg);
}
.tc-rate-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--tc-divider);
}
.tc-rate-opt:last-child { border-bottom: none; }
.tc-rate-opt input[type="radio"] { margin: 0; flex: 0 0 auto; }
.tc-rate-opt-main { flex: 1; }
.tc-rate-opt-side { display: flex; align-items: center; gap: 6px; }
.tc-rate-flat-input { width: 120px; text-align: right; }
.tc-rate-unit { color: var(--tc-text-muted); font-size: 13px; white-space: nowrap; }
/* Detailbereich für „spezielle Sätze", eingerückt und abgesetzt */
.tc-rate-detail {
  padding: 12px 0 10px 30px;
  border-top: 1px dashed var(--tc-divider);
}

.tc-svc-rate-add { display: flex; gap: 8px; align-items: flex-end; margin: 8px 0; }
.tc-svc-rate-add .tc-select { flex: 1; }
.tc-svc-rate-add input { width: 110px; }
.tc-svc-rate-list { display: flex; flex-direction: column; gap: 6px; }
.tc-svc-rate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
}
.tc-svc-rate-row .tc-svc-rate-name { flex: 1; font-size: 14px; }
.tc-svc-rate-row .tc-svc-rate-val { font-variant-numeric: tabular-nums; color: var(--tc-text-muted); }
.tc-svc-rate-empty { color: var(--tc-text-muted); font-size: 13px; padding: 6px 0; }

/* Inaktive Zeile (z. B. archivierte Leistung) */
.tc-row--inactive { opacity: .55; }

/* Tooltips in Topbar/Seitenkopf nach UNTEN klappen (oben sonst abgeschnitten) */
.tc-appbar [data-tooltip]:hover::after,
.tc-page-header [data-tooltip]:hover::after,
.tc-weekbar [data-tooltip]:hover::after { bottom: auto; top: calc(100% + 6px); }

/* Verstecktes Datumsfeld (nur als Picker-Anker) */
.tc-date-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; opacity: 0; pointer-events: none; }
.tc-daylabel { font-size: 14px; color: var(--tc-text-strong); font-weight: 500; margin-right: 4px; }

/* Einklappbarer Kartenkopf */
.tc-collapse-head { cursor: pointer; user-select: none; }
.tc-collapse-caret { transition: transform .15s ease; color: var(--tc-text-muted); font-size: 20px; }
.tc-collapse-head.is-open .tc-collapse-caret { transform: rotate(180deg); }

/* Wochen-Leiste (Zeiterfassung) */
.tc-weekbar { display: flex; align-items: stretch; gap: 6px; margin-bottom: 20px; }
.tc-weekbar .wk {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 7px 10px; min-width: 46px;
  border: 1px solid var(--tc-surface-border); border-radius: 8px;
  background: var(--tc-surface); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.tc-weekbar .wk:hover { border-color: var(--tc-primary); }
.tc-weekbar .wk .wd { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--tc-text-muted); }
.tc-weekbar .wk .dn { font-size: 16px; font-weight: 600; color: var(--tc-text-strong); margin-top: 2px; line-height: 1.1; }
.tc-weekbar .wk .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--tc-primary); margin-top: 4px; opacity: 0; }
.tc-weekbar .wk.has .dot { opacity: 1; }
.tc-weekbar .wk.today { border-color: var(--tc-primary); }
.tc-weekbar .wk.active { background: var(--tc-primary); border-color: var(--tc-primary); }
.tc-weekbar .wk.active .wd, .tc-weekbar .wk.active .dn { color: #fff; }
.tc-weekbar .wk.active .dot { background: #fff; }
.tc-weekbar .wk--weekend:not(.active) { background: var(--tc-input-bg); }
.tc-weekbar .wk-nav {
  display: flex; align-items: center; justify-content: center; width: 36px;
  border: 1px solid var(--tc-surface-border); border-radius: 8px;
  background: var(--tc-surface); color: var(--tc-text-muted); cursor: pointer;
}
.tc-weekbar .wk-nav:hover { border-color: var(--tc-primary); color: var(--tc-primary); }
.tc-weekbar .wk-kw {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 7px 16px; color: var(--tc-text-muted); font-size: 12px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .03em;
}
.tc-weekbar .wk-kw b { color: var(--tc-text-strong); font-size: 19px; margin-top: 2px; line-height: 1.1; }
.tc-weekbar .wk-spring { flex: 1; }
/* Monats-Dropdown-Button in Tag-Größe */
.tc-weekbar .wk-monthbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 54px; height: 100%; box-sizing: border-box; padding: 7px 8px;
  border: 1px solid var(--tc-surface-border); border-radius: 8px;
  background: var(--tc-surface); color: var(--tc-text-muted); cursor: pointer;
}
.tc-monthpop-wrap { align-self: stretch; }
.tc-weekbar .wk-monthbtn:hover { border-color: var(--tc-primary); color: var(--tc-primary); }
.tc-weekbar .wk-monthbtn .mdi { font-size: 20px; }
/* „Heute" rechts mit kleiner Lücke */
.tc-weekbar .wk-today {
  margin-left: 8px; padding: 0 18px;
  border: 1px solid var(--tc-surface-border); border-radius: 8px;
  background: var(--tc-surface); color: var(--tc-text); cursor: pointer;
  font-family: inherit; font-size: 14px;
}
.tc-weekbar .wk-today:hover { border-color: var(--tc-primary); color: var(--tc-primary); }

/* Monats-Popover (Dropdown an der Wochenleiste) */
.tc-monthpop-wrap { position: relative; display: inline-flex; align-items: stretch; }
.tc-monthpop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--tc-z-popover);
  width: 280px; padding: 12px;
  background: var(--tc-surface); border: 1px solid var(--tc-surface-border);
  border-radius: 10px; box-shadow: var(--tc-elev-4);
}
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mp-navgroup { display: inline-flex; gap: 2px; }
.mp-title { font-weight: 600; color: var(--tc-text-strong); font-size: 14px; }
.mp-nav { background: transparent; border: none; color: var(--tc-text-muted); cursor: pointer; font-size: 20px; padding: 2px 6px; border-radius: 6px; line-height: 1; }
.mp-nav:hover { background: var(--tc-primary-soft); color: var(--tc-primary); }
.mp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mp-wd { text-align: center; font-size: 11px; color: var(--tc-text-muted); padding: 4px 0; }
.mp-day {
  position: relative; text-align: center; padding: 7px 0; border-radius: 6px;
  font-size: 13px; color: var(--tc-text); cursor: pointer; font-variant-numeric: tabular-nums;
}
.mp-day:hover { background: var(--tc-primary-soft); }
.mp-dim { visibility: hidden; cursor: default; }
.mp-day.today { box-shadow: 0 0 0 1px var(--tc-primary) inset; }
.mp-day.active { background: var(--tc-primary); color: #fff; }
.mp-day.has::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--tc-primary);
}
.mp-day.active.has::after { background: #fff; }
@media (max-width: 780px) {
  .tc-weekbar { flex-wrap: wrap; }
  .tc-weekbar .wk { flex: 1 1 13%; min-width: 0; }
  .tc-weekbar .wk-spring { display: none; }
}

