/* SALHR - Grundstil aus SALWeb (Farben, Knoepfe, Dialoge, Meldungen), ergaenzt um die HR-Bausteine. */

html { font-size: 14px; overflow-x: hidden; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #32373c;
    overflow-x: hidden;
}

/* ---------- Knoepfe, Dialoge, Meldungen (wie SALWeb) ---------- */
.btn-sal { background: #0693e3; color: white; border: none; border-radius: 10px; font-weight: 600; }
.btn-sal:hover, .btn-sal:focus { background: #d39f75; color: white; }
.btn-sal:disabled { background: #7bc4f0; color: white; }
.modal-content { border-radius: 8px; }
.modal-footer .btn { border-radius: 10px; padding: 6px 20px; font-size: .9em; }
.modal-header-sal { background: #0693e3; color: white; }
.modal-header-sal .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

.modal-msg { font-size: .85em; padding: 8px 14px; border-radius: 6px; margin-bottom: 10px; animation: msgFadeIn .2s; }
.modal-msg.msg-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.modal-msg.msg-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
@keyframes msgFadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

#sideMenu a.d-block:hover, #sideMenu button.d-block:hover { background-color: #f0ece8; }

.spinner-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,90,154,.85); z-index: 9999;
    align-items: center; justify-content: center; flex-direction: column;
}
.spinner-overlay.active { display: flex; }
.spinner-overlay .spinner-border { width: 3rem; height: 3rem; color: #fff; }
.spinner-overlay p { margin-top: 12px; color: #fff; font-size: .95em; }

/* ---------- Karten und Formulare ---------- */
.hr-karte { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.hr-karte h6, .hr-titel { color: #0b3d5c; font-weight: 600; }
.hr-karte .form-label { font-size: .82em; font-weight: 500; color: #555; margin-bottom: 2px; }
.hr-karte .form-control, .hr-karte .form-select { border-radius: 8px; }
.hr-leer { color: #98a2ad; font-style: italic; }
.text-sek { color: #69727d; }

/* Reiter, die beim Scrollen unter der Titelleiste kleben (Muster aus SALWeb "Verwaltung"). */
.hr-reiter { position: sticky; top: 46px; z-index: 1010; background: #f4f6f9; padding-top: 8px; }
.hr-reiter .nav-link { color: #32373c; border-radius: 10px 10px 0 0; }
.hr-reiter .nav-link.active { color: #0693e3; font-weight: 600; }

/* ---------- Tabellen ---------- */
.hr-tabelle { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; }
.hr-tabelle table { margin: 0; }
.hr-tabelle thead th { background: #32373c; color: #fff; font-weight: 500; font-size: .85em; white-space: nowrap; border: 0; }
.hr-tabelle tbody tr { cursor: default; }
.hr-tabelle tbody tr.klickbar { cursor: pointer; }
.hr-tabelle td { vertical-align: middle; }

.hr-badge { display: inline-block; font-size: .75em; padding: 2px 8px; border-radius: 10px; background: #eef0f2; color: #32373c; }
.hr-badge.offen { background: #fff3cd; color: #856404; }
.hr-badge.gut { background: #d4edda; color: #155724; }
.hr-badge.schlecht { background: #f8d7da; color: #721c24; }
.hr-badge.info { background: #eaf6fd; color: #0b5c8a; }

/* ---------- Zeitkonto (Monatsraster) ---------- */
.zk-raster { overflow: auto; max-height: calc(100vh - 210px); background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.zk-raster table { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.zk-raster th, .zk-raster td { border-right: 1px solid #eef0f2; border-bottom: 1px solid #eef0f2; padding: 3px 4px; text-align: center; white-space: nowrap; }
.zk-raster thead th { position: sticky; top: 0; background: #32373c; color: #fff; z-index: 2; font-weight: 500; }
.zk-raster .zk-name { position: sticky; left: 0; background: #fff; text-align: left; min-width: 190px; z-index: 1; }
.zk-raster thead .zk-name { z-index: 3; background: #32373c; }
.zk-raster th.we, .zk-raster td.we { background: #f6f7f9; }
.zk-raster th.ft, .zk-raster td.ft { background: #fdf3e9; }
.zk-raster thead th.we { background: #4a5058; }
.zk-raster thead th.ft { background: #b07a4d; }
.zk-zelle { cursor: pointer; min-width: 38px; height: 34px; }
.zk-zelle:hover { outline: 2px solid #0693e3; outline-offset: -2px; }
.zk-wert { display: block; line-height: 1.1; }
.zk-art-A { color: #0b3d5c; font-weight: 600; }
.zk-art-U { background: #e3f4e3 !important; color: #1e6b1e; font-weight: 600; }
.zk-art-K { background: #fde4e4 !important; color: #a12222; font-weight: 600; }
.zk-art-F { background: #fdf3e9 !important; color: #8a5a2f; font-weight: 600; }
.zk-art-X { background: #ece7fa !important; color: #4b3a8c; font-weight: 600; }
.zk-offen { box-shadow: inset 0 0 0 2px #f44336; }
.zk-frei { position: relative; }
.zk-frei::after { content: ""; position: absolute; right: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: #4caf50; }
.zk-hand::before { content: ""; position: absolute; left: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: #d39f75; }
.zk-summe { font-weight: 600; background: #f8f9fa; }

/* ---------- Kontakthistorie / Nachrichten ---------- */
.kh-eintrag { border-left: 3px solid #0693e3; padding: 6px 12px; margin-bottom: 10px; background: #fff; border-radius: 0 8px 8px 0; }
.kh-eintrag.art-chat { border-left-color: #d39f75; }
.kh-eintrag.art-notiz { border-left-color: #69727d; }
.kh-kopf { font-size: .8em; color: #69727d; }
.kh-text { white-space: pre-wrap; }
.chat-blase { max-width: 80%; padding: 8px 12px; border-radius: 14px; margin-bottom: 8px; white-space: pre-wrap; }
.chat-blase.ich { margin-left: auto; background: #0693e3; color: #fff; border-bottom-right-radius: 4px; }
.chat-blase.du { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.chat-zeit { font-size: .7em; opacity: .75; margin-top: 2px; }

/* ---------- Freigabekette ---------- */
.fk-schritt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.fk-punkt { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: .8em; font-weight: 600; background: #eef0f2; color: #69727d; }
.fk-punkt.ja { background: #4caf50; color: #fff; }
.fk-punkt.auflagen { background: #ff9800; color: #fff; }
.fk-punkt.nein { background: #f44336; color: #fff; }
.fk-punkt.dran { background: #0693e3; color: #fff; }

@media (max-width: 767px) {
    .hr-karte { padding: 14px; border-radius: 12px; }
    .zk-raster { max-height: none; }
}
.zk-raster td.klickbar { cursor: pointer; }
.zk-raster td.klickbar:hover { outline: 2px solid #0693e3; outline-offset: -2px; }
