/* ==========================================================================
   NOVUS Portal – Theme
   Akzentfarbe: NOVUS-Grün aus dem Logo (#0ab931). Dunkles Blau-Grau als
   Kontrast für Navigation und Tabellenköpfe.
   ========================================================================== */
:root {
  --novus-gruen: #0ab931;
  --novus-gruen-dunkel: #089427;
  --novus-gruen-hell: #e6f8ea;
  --novus-dunkel: #1e3a5f;
  --novus-dunkel-2: #2d4a6f;
  --novus-grau: #64748b;
  --novus-bg: #f4f6f9;
  --novus-rand: #e2e8f0;

  --bs-primary: var(--novus-gruen);
  --bs-primary-rgb: 10, 185, 49;
  --bs-link-color: var(--novus-gruen-dunkel);
  --bs-link-hover-color: var(--novus-dunkel);
  --bs-body-bg: var(--novus-bg);
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 0.95rem;
}

body { background: var(--novus-bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* ---------- Buttons ---------- */
.btn-primary {
  --bs-btn-bg: var(--novus-gruen);
  --bs-btn-border-color: var(--novus-gruen);
  --bs-btn-hover-bg: var(--novus-gruen-dunkel);
  --bs-btn-hover-border-color: var(--novus-gruen-dunkel);
  --bs-btn-active-bg: var(--novus-gruen-dunkel);
  --bs-btn-active-border-color: var(--novus-gruen-dunkel);
  --bs-btn-disabled-bg: #8fd9a0;
  --bs-btn-disabled-border-color: #8fd9a0;
  --bs-btn-color: #fff;
  font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: var(--novus-gruen-dunkel);
  --bs-btn-border-color: var(--novus-gruen);
  --bs-btn-hover-bg: var(--novus-gruen);
  --bs-btn-hover-border-color: var(--novus-gruen);
  --bs-btn-active-bg: var(--novus-gruen-dunkel);
  --bs-btn-active-border-color: var(--novus-gruen-dunkel);
}
.btn-dark-blue {
  --bs-btn-bg: var(--novus-dunkel);
  --bs-btn-border-color: var(--novus-dunkel);
  --bs-btn-hover-bg: var(--novus-dunkel-2);
  --bs-btn-hover-border-color: var(--novus-dunkel-2);
  --bs-btn-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--novus-gruen);
  box-shadow: 0 0 0 0.2rem rgba(10, 185, 49, 0.2);
}
.form-check-input:checked { background-color: var(--novus-gruen); border-color: var(--novus-gruen); }

/* ---------- Navigation ---------- */
.portal-navbar {
  background: #fff;
  border-bottom: 3px solid var(--novus-gruen);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.portal-navbar .brand-text { font-weight: 700; color: var(--novus-dunkel); font-size: 1.15rem; }
.portal-navbar .nav-link { color: var(--novus-grau); font-weight: 500; padding: .55rem .85rem; border-radius: .5rem; }
.portal-navbar .nav-link:hover { color: var(--novus-dunkel); background: var(--novus-bg); }
.portal-navbar .nav-link.active { color: var(--novus-gruen-dunkel); background: var(--novus-gruen-hell); }
.portal-navbar .nav-link i { margin-right: .25rem; }

.portal-footer { text-align: center; padding: 1rem; border-top: 1px solid var(--novus-rand); }

/* ---------- Seitenkopf ---------- */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.seitenkopf h1 { font-size: 1.5rem; font-weight: 700; color: var(--novus-dunkel); margin: 0; }
.seitenkopf .untertitel { color: var(--novus-grau); margin: 0; }

/* ---------- Karten ---------- */
.card { border: 1px solid var(--novus-rand); border-radius: .75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--novus-rand); font-weight: 600; color: var(--novus-dunkel); }

/* Modulkacheln auf der Startseite */
.modul-kachel { display: block; text-decoration: none; color: inherit; height: 100%; transition: transform .12s, box-shadow .12s; }
.modul-kachel:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(30, 58, 95, 0.12); color: inherit; }
.modul-kachel .kachel-icon {
  width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--novus-gruen-hell); color: var(--novus-gruen-dunkel); font-size: 1.6rem;
}
.modul-kachel.gesperrt { opacity: .55; }
.modul-kachel.gesperrt .kachel-icon { background: #eef0f3; color: var(--novus-grau); }

/* ---------- Filterleiste ---------- */
.filterleiste { background: #fff; border: 1px solid var(--novus-rand); border-radius: .75rem; padding: .9rem 1rem; margin-bottom: 1rem; }
.filterleiste label { font-size: .8rem; color: var(--novus-grau); margin-bottom: .15rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- Tabellen ---------- */
.tabelle-card { background: #fff; border: 1px solid var(--novus-rand); border-radius: .75rem; overflow: hidden; }
.tabelle-card .table { margin-bottom: 0; }
.table-portal thead th {
  background: var(--novus-dunkel); color: #fff; font-weight: 600; font-size: .8rem; white-space: nowrap;
  border-bottom: 0; vertical-align: middle; padding: .6rem .4rem;
}
.table-portal thead th.sortierbar { cursor: pointer; user-select: none; }
.table-portal thead th.sortierbar:hover { background: var(--novus-dunkel-2); }
.table-portal thead th .sort-pfeil { opacity: .5; font-size: .75rem; margin-left: .25rem; }
.table-portal thead th.sort-asc .sort-pfeil, .table-portal thead th.sort-desc .sort-pfeil { opacity: 1; }
.table-portal tbody td { vertical-align: middle; padding: .4rem .5rem; font-size: .84rem; }
.table-portal tbody tr.klickbar { cursor: pointer; }
.table-portal tbody tr.klickbar:hover td { background-color: rgba(10, 185, 49, 0.07); }
.table-portal .betrag { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-portal .zentriert { text-align: center; }
.table-portal tfoot td { font-weight: 700; background: #e8f1fb; color: var(--novus-dunkel); }

.table-portal td.kategorie { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status-Farben wie in der Desktop-Version */
tr.status-offen td { background-color: #fee2e2; }
tr.status-abgerechnet td { background-color: #dcfce7; }
tr.status-vorlaeufig td { background-color: #fef3c7; }
tr.zeile-summe td { font-weight: 700; background-color: #dbeafe; }
.text-negativ { color: #dc2626; }
.text-manuell { color: #1d4ed8; }

.badge-offen { background: #fecaca; color: #991b1b; }
.table-portal .badge { font-size: .7rem; }
.badge-abgerechnet { background: #bbf7d0; color: #166534; }
.badge-vorlaeufig { background: #fde68a; color: #92400e; }
.badge-admin { background: var(--novus-dunkel); color: #fff; }
.badge-recht { background: var(--novus-gruen-hell); color: var(--novus-gruen-dunkel); }
.badge-inaktiv { background: #e5e7eb; color: #4b5563; }

/* Summenleiste */
.summenleiste { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .75rem 1rem; border-top: 1px solid var(--novus-rand); background: #f8fafc; font-weight: 600; color: var(--novus-dunkel); font-size: .9rem; }
.summenleiste span b { color: var(--novus-gruen-dunkel); }

/* ---------- Login ---------- */
body.login-seite { background: linear-gradient(135deg, var(--novus-dunkel) 0%, #27507c 55%, var(--novus-gruen-dunkel) 100%); }
.login-card { max-width: 420px; margin: 8vh auto; border-radius: 1rem; }
.login-card .card-body { padding: 2.25rem; }
.login-logo { text-align: center; margin-bottom: 1.25rem; }
.login-logo img { height: 56px; }
.login-logo .titel { font-weight: 700; color: var(--novus-dunkel); font-size: 1.3rem; margin-top: .5rem; }
.login-logo .org { color: var(--novus-grau); font-size: .85rem; }

/* ---------- Formulare ---------- */
.formular-card { max-width: 760px; }
.form-label { font-weight: 600; color: var(--novus-dunkel); font-size: .9rem; }
.form-hinweis { font-size: .8rem; color: var(--novus-grau); }
.abschnitt-titel { font-weight: 700; color: var(--novus-dunkel); border-bottom: 2px solid var(--novus-gruen-hell); padding-bottom: .35rem; margin: 1.25rem 0 .9rem; }

/* ---------- Sonstiges ---------- */
.flash-container { max-width: 900px; }
.hinweis-box { background: var(--novus-gruen-hell); border-left: 4px solid var(--novus-gruen); padding: .75rem 1rem; border-radius: .5rem; color: #14532d; }
.fehler-seite { text-align: center; padding: 4rem 1rem; }
.fehler-seite .code { font-size: 5rem; font-weight: 800; color: var(--novus-rand); line-height: 1; }
.leer-hinweis { text-align: center; color: var(--novus-grau); padding: 3rem 1rem; }
.leer-hinweis i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .5; }

@media (max-width: 767.98px) {
  .seitenkopf h1 { font-size: 1.25rem; }
  .table-portal tbody td, .table-portal thead th { padding: .45rem .5rem; font-size: .82rem; }
}

/* ---------- Mitarbeiterverwaltung ---------- */
.badge-honorar { background: #ede9fe; color: #5b21b6; }
.badge-sensibel { background: #fef3c7; color: #92400e; }
tr.zeile-inaktiv td { color: var(--novus-grau); }
.hinweis-punkt { display: inline-block; margin: 0 .12rem; font-size: .95rem; line-height: 1; }
.hinweis-punkt.stufe-ueberfaellig { color: #dc2626; }
.hinweis-punkt.stufe-bald { color: #d97706; }
.hinweis-punkt.stufe-fehlt { color: #94a3b8; }
.badge-frist { font-weight: 600; font-size: .75rem; white-space: normal; text-align: left; }
.badge-frist.stufe-ueberfaellig { background: #fee2e2; color: #991b1b; }
.badge-frist.stufe-bald { background: #fef3c7; color: #92400e; }
.badge-frist.stufe-fehlt { background: #e2e8f0; color: #475569; }
.hinweis-karte { background: #fffbeb; border-left: 4px solid #f59e0b !important; }

.person-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 52px; display: flex; align-items: center; justify-content: center;
  background: var(--novus-dunkel); color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: .02em;
}
.person-tabs { padding: .5rem .75rem 0; border-bottom: 1px solid var(--novus-rand); flex-wrap: wrap; }
.person-tabs .nav-link { color: var(--novus-grau); font-weight: 600; font-size: .9rem; border: 0; border-bottom: 3px solid transparent; padding: .55rem .8rem; }
.person-tabs .nav-link:hover { color: var(--novus-dunkel); border-color: var(--novus-rand); }
.person-tabs .nav-link.active { color: var(--novus-gruen-dunkel); border-color: var(--novus-gruen); background: transparent; }
.feld-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--novus-grau); font-weight: 600; }
.feld-wert { font-size: .95rem; color: #0f172a; min-height: 1.4rem; word-break: break-word; }
.maskiert { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }

/* Zeitstrahl Werdegang */
.zeitstrahl { position: relative; padding-left: 1.25rem; border-left: 2px solid var(--novus-rand); margin-left: .4rem; }
.zeitstrahl-eintrag { position: relative; padding-bottom: 1.1rem; }
.zeitstrahl-eintrag::before { content: ''; position: absolute; left: -1.62rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--novus-rand); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--novus-rand); }
.zeitstrahl-eintrag.laufend::before { background: var(--novus-gruen); box-shadow: 0 0 0 2px var(--novus-gruen); }
.zeitstrahl-zeit { font-size: .78rem; color: var(--novus-grau); font-weight: 600; }
.zeitstrahl-titel { font-weight: 700; color: var(--novus-dunkel); }

/* Auswertung */
.kennzahl .kz-wert { font-size: 1.9rem; font-weight: 800; color: var(--novus-dunkel); line-height: 1.1; }
.kennzahl .kz-label { font-size: .8rem; color: var(--novus-grau); }
.balken-zeile { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 48px; gap: .6rem; align-items: center; margin-bottom: .45rem; font-size: .88rem; }
.balken-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balken-track { background: #eef2f7; border-radius: 4px; height: 12px; overflow: hidden; }
.balken { height: 100%; background: linear-gradient(90deg, var(--novus-gruen), var(--novus-gruen-dunkel)); border-radius: 4px; min-width: 2px; }
.balken-wert { text-align: right; font-weight: 700; color: var(--novus-dunkel); font-variant-numeric: tabular-nums; }

/* ---------- Zeitkonten ---------- */
.zettel { display: inline-block; width: 1.05rem; height: 1.05rem; line-height: 1.05rem; font-size: .62rem; font-weight: 700; text-align: center; border-radius: 3px; margin: 0 1px; }
.zettel.ok { background: #bbf7d0; color: #166534; }
.zettel.teil { background: #fde68a; color: #92400e; }
.zettel.fehlt { background: #fecaca; color: #991b1b; }
.zettel.offen { background: #eef0f3; color: #94a3b8; }
.zk-kopf td { padding: .25rem .35rem; vertical-align: middle; font-size: .9rem; }
.zk-kopf tr.zk-summe td { font-weight: 700; color: var(--novus-dunkel); border-top: 2px solid var(--novus-rand); font-size: 1rem; }
.zk-input { text-align: right; font-variant-numeric: tabular-nums; display: inline-block; }
input.zk-input { padding: .2rem .4rem; }
.zk-monate thead th.th-gruppe { background: var(--novus-dunkel-2); border-bottom: 1px solid rgba(255,255,255,.15); }
.zk-monate tbody td { padding: .25rem .3rem; }
.zk-monate tbody td.zentriert input { margin: 0 auto; }
.zk-monate tfoot td { font-variant-numeric: tabular-nums; }
.sz-tabelle thead th.sz-sub { font-size: .7rem; padding: .25rem .2rem; background: var(--novus-dunkel-2); }
.sz-tabelle tbody td.sz-zelle { padding: .25rem .2rem; text-align: center; }
.sz-tabelle tbody td.sz-rand { border-right: 2px solid var(--novus-rand); }
.sz-tabelle tbody td.sz-fehlt { background: #fee2e2; }
.sz-tabelle .form-check-input { margin: 0; cursor: pointer; }
