/* ══════════════════════════════════════════════════════════════════════════
   Mein Bereich – Gemeinsame Komponenten
   Einheitliches Design für alle my_*.php Seiten
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Seitenkopf ───────────────────────────────────────────────────────────── */
.mb-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 22px;
}
.mb-header h1 {
  font-size: 22px; font-weight: 700; margin: 0; line-height: 1.3;
}
.mb-header .mb-sub {
  font-size: 14px; color: var(--muted); margin-top: 2px;
}

/* ── Sektions-Karten ──────────────────────────────────────────────────────── */
.mb-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 18px; overflow: hidden;
}
.mb-section-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.mb-section-head h2 {
  font-size: 15px; font-weight: 700; margin: 0;
}
.mb-section-head .mb-head-sub {
  font-size: 12px; color: var(--muted);
}
.mb-section-body {
  padding: 18px;
}

/* ── KPI / Statistik-Karten ───────────────────────────────────────────────── */
.mb-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px;
}
@media (max-width: 900px) { .mb-kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .mb-kpi-row { grid-template-columns: 1fr; } }

.mb-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  border-left: 4px solid var(--kpi-accent, var(--primary));
  display: flex; flex-direction: column; gap: 4px;
}
.mb-kpi .kpi-val {
  font-size: 28px; font-weight: 800; line-height: 1;
  color: var(--kpi-accent, var(--primary));
}
.mb-kpi .kpi-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.mb-kpi .kpi-sub {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}

/* ── Fortschrittsbalken ───────────────────────────────────────────────────── */
.mb-progress-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px;
}
.mb-progress-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; margin-bottom: 10px;
}
.mb-progress-bar {
  height: 12px; background: var(--border); border-radius: 7px; overflow: hidden;
}
.mb-progress-fill {
  height: 100%; border-radius: 7px; transition: width .4s ease;
}
.mb-progress-legend {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted);
}
.mb-progress-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px;
  vertical-align: middle;
}

/* ── Datentabellen ────────────────────────────────────────────────────────── */
.mb-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.mb-table th {
  padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 2px solid var(--border); background: var(--surface-2);
}
.mb-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.mb-table tr:last-child td { border-bottom: none; }
.mb-table tr:hover td { background: var(--surface-2); }

/* ── Badges / Pills ───────────────────────────────────────────────────────── */
.mb-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.mb-badge.green  { background: rgba(16,185,129,.12); color: #065f46; border-color: rgba(16,185,129,.3); }
.mb-badge.yellow { background: rgba(245,158,11,.12); color: #92400e; border-color: rgba(245,158,11,.3); }
.mb-badge.red    { background: rgba(239,68,68,.12);  color: #991b1b; border-color: rgba(239,68,68,.3); }
.mb-badge.blue   { background: rgba(0,58,92,.1); color: var(--primary); border-color: rgba(0,58,92,.25); }

/* ── Leerer Zustand ───────────────────────────────────────────────────────── */
.mb-empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.mb-empty-icon { font-size: 48px; margin-bottom: 14px; line-height: 1; }
.mb-empty p {
  font-size: 14px; line-height: 1.7; max-width: 420px; margin: 0 auto;
}

/* ── Navigation (Monat/Jahr) ──────────────────────────────────────────────── */
.mb-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 22px;
}
.mb-nav a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background .15s;
}
.mb-nav a:hover { background: var(--surface-2); }
.mb-nav-label {
  font-size: 18px; font-weight: 700; min-width: 180px; text-align: center;
}

/* ── Filter-Tabs / Jahr-Buttons ───────────────────────────────────────────── */
.mb-filter-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
  align-items: center;
}
.mb-filter-row .mb-filter-label {
  font-size: 13px; font-weight: 600; margin-right: 4px; color: var(--muted);
}
.mb-filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: .15s; text-decoration: none; font-family: inherit;
}
.mb-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.mb-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Formular-Karten ──────────────────────────────────────────────────────── */
.mb-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.mb-form-card h3 {
  font-size: 16px; font-weight: 700; margin: 0 0 14px;
}
.mb-form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (max-width: 600px) { .mb-form-grid { grid-template-columns: 1fr; } }
.mb-form-grid .full { grid-column: 1 / -1; }
.mb-form-card label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text);
}
.mb-form-card input[type="text"],
.mb-form-card input[type="date"],
.mb-form-card input[type="number"],
.mb-form-card input[type="email"],
.mb-form-card input[type="tel"],
.mb-form-card input[type="url"],
.mb-form-card input[type="password"],
.mb-form-card input[type="file"],
.mb-form-card select,
.mb-form-card textarea {
  width: 100%; padding: 8px 12px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.mb-form-card input:focus,
.mb-form-card select:focus,
.mb-form-card textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,58,92,.12);
}

/* ── Aktions-Buttons ──────────────────────────────────────────────────────── */
.mb-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
}
.mb-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: var(--radius); border: none;
  background: var(--primary); color: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: opacity .15s;
}
.mb-btn-primary:hover { opacity: .88; }
.mb-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: .15s; text-decoration: none;
}
.mb-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.mb-btn-sm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  font-family: inherit; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); transition: .15s;
  text-decoration: none;
}
.mb-btn-sm:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.mb-btn-sm.danger { color: #ef4444; border-color: rgba(239,68,68,.3); }
.mb-btn-sm.danger:hover { background: rgba(239,68,68,.08); }

/* ── Zusammenfassungs-Leiste ──────────────────────────────────────────────── */
.mb-summary-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.mb-summary-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
}

/* ── Typ-Karten-Reihe (z.B. Abwesenheitstypen) ───────────────────────────── */
.mb-type-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px;
}
@media (max-width: 900px) { .mb-type-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .mb-type-row { grid-template-columns: 1fr; } }

.mb-type-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.mb-type-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.mb-type-val { font-size: 22px; font-weight: 700; }
.mb-type-name { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Dark Mode Overrides ──────────────────────────────────────────────────── */
/* Badge-Textfarben sind im Light Mode absichtlich dunkel (für Kontrast auf
   hellem Hintergrund). Im Dark Mode müssen sie aufgehellt werden. */
html[data-theme="dark"] .mb-badge.green  { color: #4ade80; background: rgba(74,222,128,.1);  border-color: rgba(74,222,128,.25); }
html[data-theme="dark"] .mb-badge.yellow { color: #fbbf24; background: rgba(251,191,36,.1);  border-color: rgba(251,191,36,.25); }
html[data-theme="dark"] .mb-badge.red    { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.25); }
html[data-theme="dark"] .mb-badge.blue   { color: var(--primary); background: rgba(92,184,232,.1); border-color: rgba(92,184,232,.25); }

/* Section-Header */
html[data-theme="dark"] .mb-section-head { border-bottom-color: var(--border); }

/* Tabellen */
html[data-theme="dark"] .mb-table th { background: var(--table-head-bg); color: var(--muted); }
html[data-theme="dark"] .mb-table tr:hover td { background: var(--row-hover); }

/* Filter-Buttons */
html[data-theme="dark"] .mb-filter-btn { background: var(--surface-2); border-color: var(--border); }
html[data-theme="dark"] .mb-filter-btn:hover { background: var(--row-hover); }

/* Form-Karten */
html[data-theme="dark"] .mb-form-card { background: var(--surface); border-color: var(--border); }

/* Fortschrittsbalken Hintergrund */
html[data-theme="dark"] .mb-progress-track { background: var(--surface-2); }
