/* LagerRent Zeiterfassung - Custom CSS */

:root {
  --mdl-primary: #0d6efd;
  --mdl-primary-dark: #0b5ed7;
  --mdl-success: #198754;
  --mdl-danger: #dc3545;
  --mdl-warning: #ffc107;
  --mdl-border: #dee2e6;
  --mdl-bg: #f5f7fa;
  --mdl-card-bg: #ffffff;
  --mdl-muted: #6c757d;
  --mdl-today: #fff9e6;
  --mdl-weekend: #eef1f5;
  --mdl-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --mdl-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --mdl-radius: 12px;
  --mdl-touch: 48px;
}

* { box-sizing: border-box; }

body {
  background-color: var(--mdl-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 120px;
}

/* Das Benutzermenü der Topbar muss über dem Sticky-Monatskopf (z-index 1020)
   liegen, sonst verschluckt der Header die Einträge. */
.mdl-top .dropdown-menu {
  z-index: 1040;
}

/* ==================== STICKY HEADER ==================== */

.mdl-header {
  background: var(--mdl-card-bg);
  border-bottom: 1px solid var(--mdl-border);
  box-shadow: var(--mdl-shadow);
  top: 0;
  z-index: 1020;
}

.mdl-header-inner {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  max-width: 960px;
  margin: 0 auto;
}

.mdl-header-nav {
  width: var(--mdl-touch);
  height: var(--mdl-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mdl-primary);
  background: transparent;
  border: none;
  border-radius: 50%;
  font-size: 1.35rem;
  text-decoration: none;
  transition: background-color 0.15s;
  flex-shrink: 0;
}

.mdl-header-nav:hover,
.mdl-header-nav:focus {
  background-color: rgba(13, 110, 253, 0.08);
  color: var(--mdl-primary-dark);
}

.mdl-header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 0.125rem;
}

.mdl-header-select {
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 600;
  color: #212529;
  text-align: center;
  text-align-last: center;
  padding: 0.25rem 0.5rem;
  max-width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 8px;
  min-height: 36px;
}

.mdl-header-select:focus {
  outline: 2px solid var(--mdl-primary);
  outline-offset: 2px;
}

.mdl-header-total {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mdl-success);
  white-space: nowrap;
}

.mdl-lock-banner {
  background: var(--mdl-warning);
  color: #664d03;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.mdl-info-banner {
  background: #cfe2ff;
  color: #084298;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  border-top: 1px solid #9ec5fe;
}

.mdl-info-banner a {
  color: #052c65;
  font-weight: 600;
  text-decoration: underline;
}

.mdl-info-banner .bi {
  margin-right: 0.25rem;
}

/* ==================== HEADER-MENÜ (Vereinbarung) ==================== */

.mdl-menu {
  min-width: 260px;
}

.mdl-menu-section {
  padding: 0.5rem 0.75rem 0.25rem;
}

.mdl-menu-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.4rem;
}

.mdl-menu-section-title .bi {
  margin-right: 0.3rem;
  color: #0d6efd;
}

.mdl-rate-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mdl-rate-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.3rem 0.25rem;
  border-bottom: 1px dashed #e9ecef;
  font-size: 0.875rem;
}

.mdl-rate-list li:last-child {
  border-bottom: none;
}

.mdl-rate-name {
  color: #212529;
}

.mdl-rate-value {
  font-weight: 600;
  color: #198754;
  white-space: nowrap;
}

.mdl-rate-unit {
  font-weight: 500;
  color: #6c757d;
  font-size: 0.8rem;
  margin-left: 0.15rem;
}

.mdl-rate-empty {
  font-size: 0.8125rem;
  color: #6c757d;
  font-style: italic;
  padding: 0.25rem 0;
}

.mdl-rate-min {
  border-top: 1px solid #dee2e6;
  margin-top: 0.15rem;
  padding-top: 0.4rem;
}

.mdl-rate-topup {
  font-size: 0.8125rem;
  color: #6c757d;
  padding: 0.35rem 0.25rem 0;
}

.mdl-rate-topup strong {
  color: #198754;
}

/* ==================== SONDERZAHLUNG (Karte oben im Monat) ==================== */

.mdl-special {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #e9f7ee;
  border: 1px solid #a3d9b8;
  border-left: 4px solid var(--mdl-success);
  border-radius: var(--mdl-radius);
  box-shadow: var(--mdl-shadow);
  padding: 0.75rem 0.875rem;
}

.mdl-special-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mdl-success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mdl-special-body {
  flex: 1;
  min-width: 0;
}

.mdl-special-title {
  font-weight: 700;
  color: #0f5132;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.mdl-special-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #212529;
  padding: 0.15rem 0;
}

.mdl-special-amount {
  font-weight: 700;
  color: var(--mdl-success);
  white-space: nowrap;
}

.mdl-special-hint {
  font-size: 0.75rem;
  color: #4a6b57;
  margin-top: 0.3rem;
  line-height: 1.35;
}

/* ==================== TAGES-CARDS ==================== */

.mdl-days {
  max-width: 720px;
  margin: 0.75rem auto;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.mdl-day {
  background: var(--mdl-card-bg);
  border: 1px solid var(--mdl-border);
  border-radius: var(--mdl-radius);
  box-shadow: var(--mdl-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.mdl-day[open] {
  box-shadow: var(--mdl-shadow-lg);
}

.mdl-day.is-weekend {
  background: var(--mdl-weekend);
}

.mdl-day.is-today {
  border-left: 4px solid var(--mdl-primary);
}

.mdl-day.is-today .mdl-day-num {
  color: var(--mdl-primary);
}

/* Summary (kollabierter Kopf) */
.mdl-day-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  min-height: 64px;
  list-style: none;
  user-select: none;
}

.mdl-day-summary::-webkit-details-marker { display: none; }
.mdl-day-summary::marker { display: none; }

.mdl-day-date {
  flex-shrink: 0;
  text-align: center;
  width: 44px;
}

.mdl-day-num {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #212529;
}

.mdl-day-weekday {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--mdl-muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.mdl-day-info {
  flex: 1;
  min-width: 0;
}

.mdl-day-summary-text {
  font-size: 0.875rem;
  color: var(--mdl-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mdl-day-earnings {
  font-size: 1rem;
  font-weight: 600;
  color: var(--mdl-success);
  margin-top: 2px;
}

.mdl-day-chev {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mdl-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mdl-day[open] .mdl-day-chev {
  transform: rotate(180deg);
}

/* Body (expandierter Teil) */
.mdl-day-body {
  padding: 0.25rem 1rem 1rem;
  border-top: 1px solid var(--mdl-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==================== FIELDS ==================== */

.mdl-field {
  background: #fbfcfe;
  border: 1px solid #eef1f5;
  border-radius: 10px;
  padding: 0.75rem;
}

.mdl-day.is-weekend .mdl-field {
  background: #fff;
}

.mdl-field-head {
  margin-bottom: 0.5rem;
}

.mdl-field-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mdl-field-title i {
  color: var(--mdl-primary);
}

.mdl-field-hint {
  font-size: 0.75rem;
  color: var(--mdl-muted);
  margin-top: 2px;
}

/* ==================== TOGGLE (An-/Abfahrt) ==================== */

.mdl-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  min-height: var(--mdl-touch);
  margin: 0;
}

.mdl-toggle-text {
  flex: 1;
  min-width: 0;
}

.mdl-toggle-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mdl-toggle-title i {
  color: var(--mdl-primary);
}

.mdl-toggle-sub {
  font-size: 0.8rem;
  color: var(--mdl-muted);
  margin-top: 2px;
}

.mdl-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mdl-toggle-slider {
  position: relative;
  width: 52px;
  height: 32px;
  background: #ced4da;
  border-radius: 32px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.mdl-toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.mdl-toggle-input:checked + .mdl-toggle-slider {
  background: var(--mdl-success);
}

.mdl-toggle-input:checked + .mdl-toggle-slider::before {
  transform: translateX(20px);
}

.mdl-toggle-input:focus-visible + .mdl-toggle-slider {
  outline: 2px solid var(--mdl-primary);
  outline-offset: 2px;
}

/* Kompakte Toggle-Variante (Pauschale Anfahrt) */
.mdl-field-compact {
  padding: 0.45rem 0.75rem;
}

.mdl-toggle-compact {
  min-height: 36px;
  gap: 0.5rem;
}

.mdl-toggle-compact .mdl-toggle-title {
  font-size: 0.92rem;
}

.mdl-toggle-amount {
  margin-left: 0.4rem;
  font-weight: 500;
  color: var(--mdl-muted);
  font-size: 0.85rem;
}

.mdl-toggle-compact .mdl-toggle-slider {
  width: 44px;
  height: 26px;
}

.mdl-toggle-compact .mdl-toggle-slider::before {
  width: 20px;
  height: 20px;
}

.mdl-toggle-compact .mdl-toggle-input:checked + .mdl-toggle-slider::before {
  transform: translateX(18px);
}

/* ==================== LIST-ENTRIES (Besichtigung/Rücknahme) ==================== */

.mdl-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mdl-list:empty {
  display: none;
}

.mdl-entry {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.mdl-entry-input {
  flex: 1;
  min-height: var(--mdl-touch);
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--mdl-border);
  padding: 0 0.75rem;
}

.mdl-entry-input:focus {
  border-color: var(--mdl-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  outline: none;
}

.mdl-entry-remove {
  width: var(--mdl-touch);
  min-height: var(--mdl-touch);
  border: 1px solid var(--mdl-border);
  background: #fff;
  color: var(--mdl-danger);
  border-radius: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
  flex-shrink: 0;
}

.mdl-entry-appt {
  flex-wrap: wrap;
}

.mdl-entry-appt .appointment-name {
  flex: 1 1 100%;
  min-width: 0;
}

.mdl-entry-appt .mdl-entry-lager {
  flex: 0 0 5.5rem;
  min-width: 0;
}

.mdl-contract-toggle {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.7rem;
  min-height: var(--mdl-touch);
  border: 1px solid var(--mdl-border);
  border-radius: 8px;
  background: #fff;
  color: #6c757d;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  margin: 0;
}

.mdl-contract-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--mdl-primary);
  cursor: pointer;
}

.mdl-contract-toggle:has(input:checked) {
  background: #e7f1ff;
  border-color: var(--mdl-primary);
  color: var(--mdl-primary);
}

body.is-locked .mdl-contract-toggle {
  opacity: 0.65;
  pointer-events: none;
}

.mdl-entry-remove:hover,
.mdl-entry-remove:focus {
  background: #fef2f2;
  border-color: var(--mdl-danger);
}

.mdl-add-btn {
  margin-top: 0.5rem;
  width: 100%;
  min-height: var(--mdl-touch);
  border: 1.5px dashed var(--mdl-primary);
  background: transparent;
  color: var(--mdl-primary);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background-color 0.15s;
}

.mdl-add-btn:hover,
.mdl-add-btn:focus {
  background: rgba(13, 110, 253, 0.06);
}

.mdl-list:empty + .mdl-add-btn {
  margin-top: 0;
}

/* ==================== TEXTAREA & HOURS ==================== */

.mdl-textarea {
  min-height: 90px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--mdl-border);
  resize: vertical;
}

.mdl-textarea:focus {
  border-color: var(--mdl-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  outline: none;
}

.mdl-hours-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mdl-hours-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  flex: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mdl-hours-rate {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mdl-muted);
}

.mdl-hours-input,
.mdl-minutes-select {
  flex: 0 0 auto;
  width: 130px;
  min-height: var(--mdl-touch);
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--mdl-border);
  text-align: center;
  text-align-last: center;
}

.mdl-hours-input:focus,
.mdl-minutes-select:focus {
  border-color: var(--mdl-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  outline: none;
}

/* ==================== EARNINGS ==================== */

.mdl-earnings {
  background: linear-gradient(180deg, #f0f7ff 0%, #e7f1ff 100%);
  border-color: #cfe2ff;
}

.mdl-earnings-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.mdl-earnings-line {
  display: flex;
  justify-content: space-between;
  color: #495057;
}

.mdl-earnings-line span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.mdl-earnings-empty {
  font-size: 0.85rem;
  color: var(--mdl-muted);
  font-style: italic;
}

.mdl-earnings-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.5rem;
  border-top: 1px solid #cfe2ff;
}

.mdl-earnings-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
}

.mdl-earnings-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mdl-success);
  font-variant-numeric: tabular-nums;
}

/* ==================== FLOATING ACTION BUTTON ==================== */

.mdl-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  min-height: 56px;
  background: var(--mdl-primary);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.mdl-fab:hover,
.mdl-fab:focus {
  background: var(--mdl-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.5);
}

.mdl-fab:disabled {
  background: var(--mdl-muted);
  transform: none;
  box-shadow: none;
}

.mdl-fab.is-loading .bi-save::before {
  content: "\f12e"; /* arrow-clockwise */
  animation: mdl-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes mdl-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* iPhone Safe Area */
@supports (padding: max(0px)) {
  .mdl-fab {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
  body {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
}

/* ==================== LOCKED STATE ==================== */

body.is-locked .mdl-field {
  opacity: 0.85;
}

body.is-locked .mdl-add-btn,
body.is-locked .mdl-entry-remove {
  display: none;
}

/* ==================== RESPONSIVE ==================== */

/* Tablet: 2 Cards pro Reihe */
@media (min-width: 900px) {
  .mdl-days {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

/* Desktop: 3 Cards pro Reihe */
@media (min-width: 1400px) {
  .mdl-days {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Kleine Handys: Header kompakter */
@media (max-width: 360px) {
  .mdl-header-select {
    font-size: 0.95rem;
  }
  .mdl-header-total {
    font-size: 0.8rem;
  }
  .mdl-day-num {
    font-size: 1.3rem;
  }
}

/* Reste, die auch die Mitarbeiterseite nutzt */

.toast-container {
  z-index: 1100;
}

.btn:disabled {
  opacity: 0.65;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* ==================== VERWALTUNG ====================
   Eigene Stilebene für die Admin-Seiten (Topbar, Team-Matrix, Mitarbeiter,
   Monatsabschluss, Einstellungen). Bootstrap liefert nur noch Grundlagen und
   den Modal-Dialog; alles Sichtbare kommt von hier. */

.mdl-admin {
  --adm-bg: #f3f5f9;
  --adm-card: #ffffff;
  --adm-ink: #1b2430;
  --adm-ink2: #4b5563;
  --adm-muted: #6f7a89;
  --adm-line: #dce1e8;
  --adm-line-soft: #f1f3f7;
  --adm-blue: #2457d6;
  --adm-blue-soft: #e8eefc;
  --adm-blue-dark: #1d49b8;
  --adm-ok: #1e8e5a;
  --adm-ok-soft: #e3f3ea;
  --adm-warn: #b97a05;
  --adm-warn-soft: #fbf1d6;
  --adm-crit: #c93b3b;
  --adm-crit-soft: #fbe4e4;
  /* Farben der Tätigkeiten — auf Unterscheidbarkeit geprüft, auch bei
     Farbsehschwäche. Sie tauchen als Punkt/Balken überall gleich auf. */
  --act-visit: #1d4ed8;
  --act-contract: #db2777;
  --act-return: #f59e0b;
  --act-travel: #0d9488;
  --act-hours: #5b6675;
  background: var(--adm-bg);
  color: var(--adm-ink);
  padding-bottom: 0;
}

.mdl-admin a { color: var(--adm-blue); }
.mdl-admin :focus-visible { outline: 2px solid var(--adm-blue); outline-offset: 2px; }

/* -------- Topbar -------- */

.mdl-top {
  background: var(--mdl-card-bg);
  border-bottom: 1px solid var(--adm-line, var(--mdl-border));
}

.mdl-admin .mdl-top { position: sticky; top: 0; z-index: 1030; }

.mdl-top-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 56px;
}

.mdl-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.97rem;
  color: #1b2430;
  text-decoration: none;
  margin-right: 18px;
  white-space: nowrap;
}

.mdl-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--adm-blue, #2457d6);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.mdl-areas { display: flex; gap: 2px; flex: 1; min-width: 0; }

.mdl-area {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--adm-ink2, #4b5563);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.mdl-area:hover { background: var(--adm-bg, #f3f5f9); color: var(--adm-ink, #1b2430); }
.mdl-area.is-active { background: var(--adm-blue-soft, #e8eefc); color: var(--adm-blue, #2457d6); font-weight: 600; }

.mdl-user { margin-left: auto; }

.mdl-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--adm-line, #dce1e8);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  background: #fff;
  color: var(--adm-ink, #1b2430);
}

.mdl-user-btn:hover { background: var(--adm-bg, #f3f5f9); }

.mdl-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1b2430;
  color: #fff;
  font-size: 0.69rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mdl-avatar.is-soft { background: var(--adm-blue-soft, #e8eefc); color: var(--adm-blue, #2457d6); width: 32px; height: 32px; font-size: 0.72rem; }
.mdl-avatar.is-large { width: 46px; height: 46px; font-size: 0.95rem; }

.mdl-user-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.mdl-user-name { font-size: 0.81rem; font-weight: 600; }
.mdl-user-role { font-size: 0.69rem; color: var(--adm-muted, #6f7a89); }

/* -------- Seitenrahmen -------- */

.mdl-page { max-width: 1240px; margin: 0 auto; padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 14px; }

.mdl-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mdl-pagehead h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.mdl-pagehead-sub { color: var(--adm-muted); font-size: 0.85rem; margin: 2px 0 0; }
.mdl-pagehead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mdl-back { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-decoration: none; font-size: 0.88rem; }
.mdl-emphead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mdl-emphead h1 { font-size: 1.4rem; margin: 0; }

/* -------- Bedienelemente -------- */

.mdl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--adm-line);
  background: #fff;
  color: var(--adm-ink);
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  min-height: 38px;
}

.mdl-btn:hover { background: var(--adm-bg); color: var(--adm-ink); }
.mdl-btn.is-primary { background: var(--adm-blue); border-color: var(--adm-blue); color: #fff; }
.mdl-btn.is-primary:hover { background: var(--adm-blue-dark); color: #fff; }
.mdl-btn.is-danger { color: var(--adm-crit); border-color: #efc2c2; }
.mdl-btn.is-danger:hover { background: var(--adm-crit-soft); color: var(--adm-crit); }
.mdl-btn.is-small { padding: 5px 9px; font-size: 0.79rem; min-height: 32px; border-radius: 7px; }
.mdl-btn.is-dashed { border-style: dashed; border-color: var(--adm-blue); color: var(--adm-blue); width: 100%; }

.mdl-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--adm-line);
  background: #fff;
  border-radius: 8px;
  color: var(--adm-ink2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mdl-icon-btn:hover { background: var(--adm-bg); }
.mdl-icon-btn.is-danger { color: var(--adm-crit); }
.mdl-icon-btn.is-danger:hover { background: var(--adm-crit-soft); border-color: #efc2c2; }

.mdl-segmented { display: inline-flex; border: 1px solid var(--adm-line); border-radius: 9px; background: #fff; overflow: hidden; }
.mdl-segmented a { padding: 8px 13px; font-weight: 600; font-size: 0.83rem; color: var(--adm-ink2); text-decoration: none; }
.mdl-segmented a.is-active { background: var(--adm-ink); color: #fff; }

.mdl-monthnav { display: inline-flex; align-items: center; border: 1px solid var(--adm-line); background: #fff; border-radius: 10px; overflow: hidden; }
.mdl-monthnav-btn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--adm-ink2); text-decoration: none; }
.mdl-monthnav-btn:hover { background: var(--adm-bg); color: var(--adm-ink); }
.mdl-monthnav-current { padding: 0 12px; font-weight: 700; font-size: 0.88rem; min-width: 140px; text-align: center; border-left: 1px solid var(--adm-line); border-right: 1px solid var(--adm-line); line-height: 38px; }
.mdl-monthnav-today { padding: 0 12px; font-size: 0.81rem; font-weight: 600; line-height: 38px; text-decoration: none; }

/* -------- Karten, Listen, Hinweise -------- */

.mdl-card { background: var(--adm-card); border: 1px solid var(--adm-line); border-radius: 12px; }
.mdl-card-head { padding: 12px 16px; border-bottom: 1px solid var(--adm-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mdl-card-head h2 { font-size: 0.97rem; font-weight: 700; margin: 0; }
.mdl-card-head-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mdl-card-hint { font-size: 0.79rem; color: var(--adm-muted); }
.mdl-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mdl-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.mdl-card-foot { padding: 12px 16px; border-top: 1px solid var(--adm-line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.mdl-summary { justify-content: space-between; align-items: center; color: var(--adm-ink2); font-size: 0.85rem; }
.mdl-checksum { justify-content: flex-start; font-size: 0.75rem; color: var(--adm-muted); word-break: break-all; }
.mdl-empty { padding: 22px 16px; margin: 0; color: var(--adm-muted); text-align: center; }
.mdl-hint { font-size: 0.82rem; color: var(--adm-ink2); margin: 0; }
.mdl-muted { color: var(--adm-muted); }
.mdl-sep { border: none; border-top: 1px solid var(--adm-line); margin: 12px 0; }
.mdl-stack { display: flex; flex-direction: column; gap: 14px; }
.mdl-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }

.mdl-note { display: flex; gap: 9px; align-items: flex-start; border-radius: 10px; padding: 10px 13px; font-size: 0.85rem; border: 1px solid; }
.mdl-note .bi { flex-shrink: 0; margin-top: 2px; }
.mdl-note.is-info { background: var(--adm-blue-soft); border-color: #c9d7f7; color: #1e3f8f; }
.mdl-note.is-info a { color: #1e3f8f; font-weight: 600; }
.mdl-note.is-success { background: var(--adm-ok-soft); border-color: #b7e0c8; color: #14603c; }
.mdl-note.is-warning { background: var(--adm-warn-soft); border-color: #f0dda5; color: #6b4a05; }
.mdl-note.is-error { background: var(--adm-crit-soft); border-color: #efc2c2; color: #8f2020; }
.mdl-note.is-password { background: #fff; border-color: var(--adm-blue); color: var(--adm-ink); }
.mdl-password { font-size: 1rem; font-weight: 700; background: var(--adm-blue-soft); color: var(--adm-blue); padding: 2px 8px; border-radius: 6px; }

.mdl-rows { list-style: none; margin: 0; padding: 0; }
.mdl-rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--adm-line-soft); font-size: 0.86rem; }
.mdl-rows li:last-child { border-bottom: none; }
.mdl-rows-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mdl-amount-positive { color: var(--adm-ok); font-variant-numeric: tabular-nums; }

/* -------- Formularfelder -------- */

.mdl-formfield { display: flex; flex-direction: column; gap: 4px; }
.mdl-formfield label { font-size: 0.79rem; font-weight: 600; color: var(--adm-ink2); }
.mdl-formfield input, .mdl-formfield select {
  border: 1px solid var(--adm-line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--adm-ink);
  font-size: 0.92rem;
  min-height: 40px;
  width: 100%;
}
.mdl-formfield input:focus, .mdl-formfield select:focus { border-color: var(--adm-blue); box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.15); outline: none; }
.mdl-formfield-hint { font-size: 0.75rem; color: var(--adm-muted); }
.mdl-formfield-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mdl-input-unit { display: inline-flex; align-items: center; border: 1px solid var(--adm-line); border-radius: 8px; overflow: hidden; background: #fff; }
.mdl-input-unit input { border: none; padding: 8px 10px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; width: 92px; min-height: 38px; }
.mdl-input-unit input:focus { outline: none; }
.mdl-input-unit input:disabled { background: var(--adm-bg); color: var(--adm-muted); }
.mdl-input-unit span { padding: 8px 9px; background: var(--adm-bg); color: var(--adm-muted); font-size: 0.75rem; border-left: 1px solid var(--adm-line); white-space: nowrap; }
.mdl-input-unit:focus-within { border-color: var(--adm-blue); box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.15); }
/* In der Feld-Spalte soll die Einheit nicht auf volle Breite ziehen */
.mdl-formfield .mdl-input-unit { align-self: flex-start; }

/* -------- Kennzahlen -------- */

.mdl-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mdl-kpi { background: var(--adm-card); border: 1px solid var(--adm-line); border-radius: 10px; padding: 10px 14px; }
.mdl-kpi-label { font-size: 0.75rem; color: var(--adm-muted); font-weight: 500; }
.mdl-kpi-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 2px; }
.mdl-kpi-note { font-size: 0.72rem; color: var(--adm-muted); }

/* -------- Punkte und Chips -------- */

.mdl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; flex-shrink: 0; }
.act-visit { background: var(--act-visit); }
.act-contract { background: var(--act-contract); }
.act-return { background: var(--act-return); }
.act-travel { background: var(--act-travel); }
.act-hours { background: var(--act-hours); }

.mdl-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.mdl-chip { display: inline-flex; align-items: center; background: #f4f6fa; border: 1px solid var(--adm-line); border-radius: 6px; padding: 1px 8px; font-size: 0.78rem; white-space: nowrap; color: var(--adm-ink2); }
.mdl-chip.is-contract { border-color: #b7e0c8; background: var(--adm-ok-soft); color: var(--adm-ok); }
.mdl-chip.is-missing { border-color: #efc2c2; background: var(--adm-crit-soft); color: var(--adm-crit); }
.mdl-chip.is-note { border-style: dashed; white-space: normal; }

.mdl-chip-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.73rem; font-weight: 600; white-space: nowrap; }
.mdl-chip-status.is-open { background: #eef0f4; color: var(--adm-ink2); }
.mdl-chip-status.is-locked { background: var(--adm-warn-soft); color: var(--adm-warn); }
.mdl-chip-status.is-signed { background: var(--adm-ok-soft); color: var(--adm-ok); }

/* -------- Team-Matrix -------- */

.mdl-grid-scroll { overflow-x: auto; }
.mdl-matrix { border-collapse: separate; border-spacing: 0; font-size: 0.78rem; width: 100%; }
.mdl-matrix th, .mdl-matrix td { border-bottom: 1px solid var(--adm-line); white-space: nowrap; padding: 0; }
.mdl-matrix thead th { font-weight: 600; color: var(--adm-muted); text-align: center; font-size: 0.69rem; padding: 6px 0 5px; background: #fff; }
.mdl-matrix thead th span { display: block; font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.mdl-matrix thead th.is-weekend { background: #f0f2f6; }
.mdl-matrix thead th.is-today, .mdl-matrix thead th.is-today span { color: var(--adm-blue); }

.mdl-matrix-name { position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; padding: 8px 12px 8px 14px !important; min-width: 168px; border-right: 1px solid var(--adm-line); font-weight: 400; }
.mdl-matrix-name a { text-decoration: none; color: var(--adm-ink); }
.mdl-matrix-name a:hover strong { color: var(--adm-blue); }
.mdl-matrix-name strong { display: block; font-weight: 600; font-size: 0.83rem; }
.mdl-matrix-name span { font-size: 0.72rem; color: var(--adm-muted); }
.mdl-matrix thead .mdl-matrix-name { z-index: 3; }

.mdl-matrix-cell { width: 34px; min-width: 34px; height: 46px; text-align: center; vertical-align: middle; border-left: 1px solid var(--adm-line-soft); }
.mdl-matrix-cell.is-weekend { background: #f5f6f9; }
.mdl-matrix-cell.is-today { background: #fff8e3; }
.mdl-matrix-cell.is-future { background: repeating-linear-gradient(135deg, transparent 0 5px, #eef0f4 5px 6px); }

.mdl-cell { width: 28px; height: 36px; margin: 0 auto; border-radius: 6px; background: #fff; border: 1px solid var(--adm-line); box-shadow: 0 1px 1px rgba(27, 36, 48, 0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; text-decoration: none; }
.mdl-cell:hover { border-color: var(--adm-blue); box-shadow: 0 0 0 2px var(--adm-blue-soft); }
.mdl-cell-bars { display: flex; gap: 2px; height: 8px; align-items: flex-end; }
.mdl-cell-bars i { width: 4px; height: 8px; border-radius: 2px; display: block; }
.mdl-cell-bars i.act-visit { background: var(--act-visit); }
.mdl-cell-bars i.act-contract { background: var(--act-contract); }
.mdl-cell-bars i.act-return { background: var(--act-return); }
.mdl-cell-bars i.act-travel { background: var(--act-travel); }
.mdl-cell-bars i.act-hours { background: var(--act-hours); }
.mdl-cell-amount { font-size: 0.63rem; font-weight: 600; color: var(--adm-ink2); font-variant-numeric: tabular-nums; line-height: 1; }

.mdl-matrix-sum { padding: 6px 12px !important; text-align: right; font-variant-numeric: tabular-nums; border-left: 1px solid var(--adm-line); background: #fff; min-width: 148px; }
.mdl-matrix-sum strong { display: block; font-size: 0.83rem; }
.mdl-matrix-sum span { font-size: 0.72rem; color: var(--adm-muted); }

.mdl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.76rem; color: var(--adm-ink2); padding: 10px 16px; border-top: 1px solid var(--adm-line); align-items: center; }
.mdl-legend-hint { margin-left: auto; color: var(--adm-muted); }
/* Sonderfälle der Mitarbeiterliste als echte Chips in der Legende */
.mdl-legend-chips { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* -------- Tagesprotokoll und Feed -------- */

.mdl-log-day { border-bottom: 1px solid var(--adm-line); }
.mdl-log-day:last-child { border-bottom: none; }
.mdl-log-dayhead { display: flex; align-items: baseline; gap: 10px; padding: 10px 16px 6px; background: #fafbfd; flex-wrap: wrap; }
.mdl-log-dayhead span { font-size: 0.79rem; color: var(--adm-muted); }
.mdl-log-row { display: grid; grid-template-columns: 168px minmax(0, 1fr) 90px; gap: 12px; padding: 8px 16px; align-items: start; border-top: 1px solid var(--adm-line-soft); text-decoration: none; color: var(--adm-ink); }
.mdl-log-row:hover { background: #fafbfd; color: var(--adm-ink); }
.mdl-log-who { font-weight: 600; font-size: 0.85rem; }
.mdl-log-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.mdl-feed { list-style: none; margin: 0; padding: 0; }
.mdl-feed li { border-bottom: 1px solid var(--adm-line-soft); }
.mdl-feed li:last-child { border-bottom: none; }
.mdl-feed a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; padding: 9px 16px; align-items: center; text-decoration: none; color: var(--adm-ink); }
.mdl-feed a:hover { background: #fafbfd; }
.mdl-feed-text { min-width: 0; }
.mdl-feed-text strong { display: block; font-weight: 600; font-size: 0.85rem; }
.mdl-feed-text span { font-size: 0.78rem; color: var(--adm-muted); }
.mdl-feed-time { font-size: 0.75rem; color: var(--adm-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* -------- Mitarbeiterliste -------- */

.mdl-emprow { display: grid; grid-template-columns: 200px minmax(0, 1fr) 200px 32px; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--adm-line); align-items: center; text-decoration: none; color: var(--adm-ink); }
.mdl-emprow:hover { background: #fafbfd; color: var(--adm-ink); }
.mdl-emprow:last-child { border-bottom: none; }
.mdl-emprow-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mdl-emprow-who strong { display: block; font-size: 0.88rem; font-weight: 600; }
.mdl-emprow-user { font-size: 0.75rem; color: var(--adm-muted); }
.mdl-emprow-rates { display: flex; flex-wrap: wrap; gap: 4px; }
.mdl-emprow-month { text-align: right; }
.mdl-emprow-month strong { display: block; font-variant-numeric: tabular-nums; }
.mdl-emprow-month > span { font-size: 0.75rem; color: var(--adm-muted); }
.mdl-emprow-go { color: var(--adm-muted); display: grid; place-items: center; }

/* -------- Reiter im Mitarbeiter-Detail -------- */

.mdl-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--adm-line); overflow-x: auto; }
.mdl-tabs a { padding: 9px 14px; font-weight: 600; color: var(--adm-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; font-size: 0.88rem; }
.mdl-tabs a:hover { color: var(--adm-ink); }
.mdl-tabs a.is-active { color: var(--adm-blue); border-bottom-color: var(--adm-blue); }

.mdl-rates { width: 100%; border-collapse: collapse; }
.mdl-rates th { text-align: left; font-size: 0.75rem; color: var(--adm-muted); font-weight: 600; padding: 8px 16px; border-bottom: 1px solid var(--adm-line); }
.mdl-rates td { padding: 8px 16px; border-bottom: 1px solid var(--adm-line-soft); vertical-align: middle; font-size: 0.85rem; }
.mdl-rates tr:last-child td { border-bottom: none; }
.mdl-rates label { font-weight: 600; display: block; }
.mdl-rates-desc { display: block; font-size: 0.75rem; color: var(--adm-muted); }
.mdl-rates-value { text-align: right; width: 150px; }
.mdl-rates-min td { border-top: 1px solid var(--adm-line); }

.mdl-location { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.mdl-location > input[type="text"] { flex: 1; min-width: 0; border: 1px solid var(--adm-line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.mdl-location > input[type="text"]:focus { border-color: var(--adm-blue); box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.15); outline: none; }

.mdl-dayrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 100px; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--adm-line-soft); align-items: start; scroll-margin-top: 70px; }
.mdl-dayrow:last-child { border-bottom: none; }
.mdl-dayrow.is-weekend { background: #fafbfd; }
.mdl-dayrow:target { background: var(--adm-blue-soft); }
.mdl-dayrow-date strong { display: block; font-size: 1.05rem; line-height: 1; }
.mdl-dayrow-date span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--adm-muted); }
.mdl-dayrow-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* -------- Monatsabschluss -------- */

.mdl-progress { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--adm-ink2); flex-wrap: wrap; }
.mdl-progress-bar { width: 160px; height: 8px; border-radius: 4px; background: #eef0f4; overflow: hidden; display: block; }
.mdl-progress-bar i { display: block; height: 100%; background: var(--adm-ok); border-radius: 4px; }

.mdl-closing-row { display: grid; grid-template-columns: 180px 110px minmax(250px, 1fr) auto; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--adm-line); align-items: center; }
.mdl-closing-row:last-child { border-bottom: none; }
.mdl-closing-row.is-head { padding: 8px 16px; font-size: 0.75rem; color: var(--adm-muted); font-weight: 600; background: #fafbfd; }
.mdl-closing-actions-head { text-align: right; }
.mdl-closing-name strong { display: block; font-size: 0.88rem; font-weight: 600; }
.mdl-closing-name span { font-size: 0.75rem; color: var(--adm-muted); }
.mdl-closing-sum { font-variant-numeric: tabular-nums; }
.mdl-closing-sum strong { display: block; }
.mdl-closing-sum span { font-size: 0.75rem; color: var(--adm-muted); }
.mdl-closing-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.mdl-steps { display: flex; align-items: center; }
.mdl-step { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--adm-muted); white-space: nowrap; }
.mdl-step .bi { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--adm-line); display: grid; place-items: center; background: #fff; font-size: 0.66rem; flex-shrink: 0; }
.mdl-step small { display: block; font-size: 0.66rem; color: var(--adm-muted); line-height: 1.1; }
.mdl-step.is-done { color: var(--adm-ink); }
.mdl-step.is-done .bi { background: var(--adm-ok); border-color: var(--adm-ok); color: #fff; }
.mdl-step.is-warn .bi { background: var(--adm-warn); border-color: var(--adm-warn); color: #fff; }

/* -------- Lohnüberweisungen (SEPA) -------- */

.mdl-transfer { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mdl-transfer .mdl-muted { font-size: 0.78rem; overflow-wrap: anywhere; }
.mdl-transfer-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
a.mdl-chip { text-decoration: none; }
a.mdl-chip:hover { text-decoration: underline; }
.mdl-transfer-note { margin-right: auto; align-self: center; }
.mdl-iban { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.mdl-purpose { font-size: 0.82rem; background: #f4f6fa; color: var(--adm-ink); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.mdl-purpose-parts { margin: 0; padding-left: 18px; font-size: 0.82rem; color: var(--adm-ink2); display: flex; flex-direction: column; gap: 4px; }
.mdl-purpose-parts code { color: var(--adm-ink); background: #f4f6fa; padding: 0 5px; border-radius: 4px; }
.mdl-step-line { width: 26px; height: 2px; background: var(--adm-line); margin: 0 6px; flex-shrink: 0; }
.mdl-step-line.is-done { background: var(--adm-ok); }

/* -------- Einstellungen -------- */

.mdl-settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.mdl-settings-nav { display: flex; flex-direction: column; gap: 2px; }
.mdl-settings-nav a { padding: 9px 12px; border-radius: 8px; color: var(--adm-ink2); font-weight: 500; text-decoration: none; font-size: 0.88rem; }
.mdl-settings-nav a:hover { background: #fff; }
.mdl-settings-nav a.is-active { background: #fff; border: 1px solid var(--adm-line); color: var(--adm-ink); font-weight: 600; }

/* -------- Tab-Leiste (Handy) -------- */

.mdl-tabbar { display: none; }

@media (max-width: 860px) {
  .mdl-top-inner { min-height: 50px; padding: 0 14px; }
  .mdl-areas { display: none; }
  .mdl-user-text { display: none; }
  .mdl-user-btn { border: none; padding: 2px; }
  .mdl-user-btn .bi-chevron-down { display: none; }
  .mdl-brand { margin-right: 0; flex: 1; }

  .mdl-admin { padding-bottom: 76px; }
  .mdl-tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--adm-line);
    z-index: 1035;
    padding: 4px 0 max(6px, env(safe-area-inset-bottom));
  }
  .mdl-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--adm-muted);
    padding: 6px 0;
    text-decoration: none;
  }
  .mdl-tabbar a .bi { font-size: 1.25rem; }
  .mdl-tabbar a.is-active { color: var(--adm-blue); }

  .mdl-page { padding: 12px 12px 24px; }
  .mdl-pagehead h1 { font-size: 1.2rem; }
  .mdl-pagehead-actions { width: 100%; }
  .mdl-kpis { grid-template-columns: 1fr 1fr; }
  .mdl-kpis .mdl-kpi:last-child { grid-column: 1 / -1; }
  .mdl-kpi-value { font-size: 1.1rem; }
  .mdl-two-col, .mdl-settings, .mdl-formfield-row { grid-template-columns: 1fr; }
  .mdl-settings-nav { flex-direction: row; overflow-x: auto; }
  .mdl-settings-nav a { white-space: nowrap; }

  .mdl-matrix-name { min-width: 118px; padding: 6px 8px !important; }
  .mdl-matrix-name span { display: none; }
  .mdl-matrix-sum { min-width: 104px; padding: 6px 8px !important; }

  .mdl-legend { gap: 8px 12px; font-size: 0.72rem; }
  .mdl-legend-hint, .mdl-legend-chips { margin-left: 0; flex-basis: 100%; }
  .mdl-log-row { grid-template-columns: 1fr; gap: 3px; }
  .mdl-log-amount { text-align: left; }

  .mdl-emprow { grid-template-columns: minmax(0, 1fr) 24px; gap: 8px 10px; }
  .mdl-emprow-rates, .mdl-emprow-month { grid-column: 1 / -1; }
  .mdl-emprow-month { text-align: left; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

  .mdl-closing-row { grid-template-columns: 1fr; gap: 8px; }
  .mdl-closing-row.is-head { display: none; }
  .mdl-closing-actions { justify-content: flex-start; }
  .mdl-hide-sm { display: none; }

  .mdl-rates-value { width: auto; }
  .mdl-dayrow { grid-template-columns: 44px minmax(0, 1fr); }
  .mdl-dayrow-amount { grid-column: 2; text-align: left; }
}

@media (max-width: 420px) {
  .mdl-brand-text { display: none; }
}

/* ==================== PRINT ==================== */

@media print {
  .mdl-top,
  .mdl-tabbar,
  .mdl-header,
  .mdl-fab,
  .toast-container {
    display: none !important;
  }

  .mdl-day {
    box-shadow: none !important;
    border: 1px solid var(--mdl-border) !important;
    page-break-inside: avoid;
  }

  .mdl-day:not([open]) .mdl-day-body {
    display: block !important;
  }
}

/* ==================== Unterschrift-Pad ==================== */
.mdl-sig-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  border: 2px dashed var(--mdl-border, #d4dbe5);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.mdl-sig-canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* verhindert Scrollen/Zoomen beim Zeichnen mit dem Finger */
  touch-action: none;
  cursor: crosshair;
}

.mdl-sig-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #aab4c2;
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
}
