/* Mitarbeiter-Portal - Verwaltung (Personal -> Mitarbeiter-Portal)
 * Aufbau nach sperrlager.css: Karten, Kennzahlen, Tabs, Tabelle, Dialog. */

.pa-card { margin-bottom: 18px; }

.pa-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pa-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* style.css zwingt Buttons auf volle Breite - hier nicht */
.pa-btn, .pa-btn.btn { width: auto; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; margin: 0; }
.pa-btn-klein { padding: 5px 10px !important; font-size: 12px !important; }
.pa-btn-gefahr { background: #dc2626 !important; color: #fff !important; }
.pa-btn-gefahr:hover { background: #b91c1c !important; }
.pa-btn[hidden] { display: none !important; }

/* Grundlinie als Innen-Schatten statt border + negativem Tab-Rand: sonst erzeugt
   overflow-x:auto einen senkrechten Überlauf (Scroll-Pfeile neben der Leiste) */
.pa-tabs { display: flex; gap: 2px; box-shadow: inset 0 -2px 0 #e2e8f0; overflow-x: auto; overflow-y: hidden; margin-bottom: 16px; }
.pa-tab {
  background: none; border: none; border-bottom: 3px solid transparent; margin: 0;
  padding: 10px 14px; font-weight: 600; color: #64748b; cursor: pointer; white-space: nowrap; width: auto;
  box-shadow: none; border-radius: 0; display: inline-flex; align-items: center; gap: 6px;
}
.pa-tab.active { color: #4f46e5; border-bottom-color: #4f46e5; }
.pa-tab:hover { color: #0f172a; background: none; }
.pa-tab-zaehler { background: #fee2e2; color: #991b1b; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.pa-tab-zaehler.leer { display: none; }

.pa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pa-kpi { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid #94a3b8; border-radius: 10px; padding: 10px 14px; }
.pa-kpi-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.pa-kpi-wert { font-size: 24px; font-weight: 800; color: #0f172a; margin-top: 2px; }
.pa-kpi-gelb { border-left-color: #f59e0b; }
.pa-kpi-gruen { border-left-color: #16a34a; }
.pa-kpi-rot { border-left-color: #dc2626; }
.pa-kpi-blau { border-left-color: #4f46e5; }

.pa-filterbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.pa-filterbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #475569; }
.pa-filterbar .form-input { min-width: 160px; }
.pa-filterbar .pa-suche .form-input { min-width: 240px; }

.pa-tabelle-wrap { overflow-x: auto; }
.pa-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
.pa-tabelle th, .pa-tabelle td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.pa-tabelle th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #475569; white-space: nowrap; }
.pa-tabelle td.pa-aktionen { white-space: normal; min-width: 250px; }
.pa-tabelle td.pa-aktionen .btn { margin: 0 4px 4px 0; }
.pa-tabelle tr.pa-wartet { background: #fffbeb; }
.pa-klein { font-size: 11px; color: #64748b; }
.pa-leer { padding: 20px 0; text-align: center; color: #64748b; }
.pa-text-umbruch { white-space: normal; min-width: 200px; }

.pa-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pa-badge-gelb { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.pa-badge-gruen { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.pa-badge-rot { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.pa-badge-grau { background: #e5e7eb; color: #4b5563; border-color: #d1d5db; }
.pa-badge-blau { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }

.pa-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pa-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #475569; }
.pa-form .form-input { width: 100%; font-weight: 400; }
.pa-form textarea.form-input { resize: vertical; min-height: 70px; }
.pa-span2 { grid-column: span 2; }
.pa-span3 { grid-column: span 3; }
.pa-form-aktionen { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.pa-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.pa-check input { width: auto; }
.pa-hinweis { font-size: 12px; color: #64748b; line-height: 1.5; }

/* Dialog */
.pa-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pa-modal[hidden] { display: none; }
.pa-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.pa-modal-fenster { position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.pa-modal-kopf { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid #e2e8f0; }
.pa-modal-kopf h3 { margin: 0; font-size: 17px; }
.pa-modal-close { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: #64748b; width: auto; padding: 0 6px; box-shadow: none; margin: 0; }
.pa-modal-body { padding: 18px; overflow-y: auto; }

@media (max-width: 760px) {
  .pa-form { grid-template-columns: 1fr; }
  .pa-span2, .pa-span3 { grid-column: span 1; }
}

/* Editor Schwarzes Brett */
.pa-editor-wrap { border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; overflow: hidden; }
.pa-editor-leiste { display: flex; gap: 2px; flex-wrap: wrap; padding: 6px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.pa-editor-leiste[hidden] { display: none; }
.pa-editor-btn {
  width: auto; min-width: 32px; height: 30px; padding: 0 8px; margin: 0; border: 1px solid transparent; border-radius: 6px;
  background: #fff; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: none; font-family: inherit;
}
.pa-editor-btn:hover { border-color: #cbd5e1; background: #fff; }
.pa-editor-trenner { width: 1px; background: #cbd5e1; margin: 4px 4px; }
.pa-editor { min-height: 160px; max-height: 420px; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.55; color: #0f172a; outline: none; }
.pa-editor[hidden] { display: none; }
.pa-editor:focus { box-shadow: inset 0 0 0 2px #c7d2fe; }
.pa-editor p, .pa-editor h3, .pa-editor h4, .pa-editor ul, .pa-editor ol, .pa-editor blockquote { margin: 0 0 8px; }
.pa-editor h3 { font-size: 17px; } .pa-editor h4 { font-size: 15px; }
.pa-editor ul, .pa-editor ol { padding-left: 22px; }
.pa-editor a { color: #4f46e5; text-decoration: underline; }
.pa-editor blockquote { border-left: 3px solid #cbd5e1; padding-left: 10px; color: #475569; }
.pa-editor-quelle { border: none !important; border-radius: 0 !important; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; min-height: 160px; }
.pa-editor-quelle[hidden] { display: none; }

/* Fotos */
.pa-fotos { display: flex; gap: 10px; flex-wrap: wrap; }
.pa-foto { width: 150px; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.pa-foto img { display: block; width: 150px; height: 110px; object-fit: cover; background: #f1f5f9; }
.pa-foto-leiste { display: flex; justify-content: space-between; padding: 4px; gap: 2px; }
.pa-foto-btn { width: auto; flex: 1; margin: 0; padding: 4px 0; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #1e293b; font-size: 12px; cursor: pointer; box-shadow: none; }
.pa-foto-btn:hover:not(:disabled) { background: #eef2ff; border-color: #a5b4fc; }
.pa-foto-btn:disabled { opacity: .35; cursor: default; }
.pa-foto-btn-gefahr { color: #b91c1c; }

/* ---------- Handouts mit Zugangsschlüssel -------------------------------- */
.pa-handout { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.pa-handout h3 { margin: 0 0 6px; font-size: 16px; }
.pa-handout-optionen { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.pa-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.pa-radio input { width: 16px; height: 16px; }
.pa-handout-liste { margin: 10px 0 16px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; max-height: 420px; overflow: auto; }
.pa-handout-werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pa-handout-gruppe + .pa-handout-gruppe { margin-top: 14px; }
.pa-handout-gruppe h4 { margin: 0 0 6px; font-size: 13px; color: #475569; text-transform: uppercase; letter-spacing: .4px; }
.pa-handout-namen { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px; }
/* style.css zieht Formularfelder in Karten auf 100 % Breite - hier nicht. */
.pa-handout-name { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.pa-handout-name:hover { background: #eef2ff; }
.pa-handout-name input[type="checkbox"] { width: 16px !important; height: 16px; flex: 0 0 auto; margin: 0 !important; }
.pa-handout-name-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-handout-name .pa-badge { flex: 0 0 auto; }

/* Der Handout-Abschnitt steht außerhalb von .pa-form: Schrift und Hinweis
   dort selbst setzen, sonst klebt der Hinweis am Label. */
.pa-handout .pa-check { display: flex; align-items: flex-start; font-size: 14px; }
.pa-handout .pa-check input { margin-top: 3px; }
.pa-handout .pa-hinweis { display: block; margin-top: 2px; font-size: 12.5px; color: #64748b; font-weight: 400; }
.pa-handout .pa-check > .pa-hinweis { margin-left: 4px; }

/* Bestätiger je Gruppe (Einstellungen, Kommt/Geht vergessen) */
.pa-zb { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.pa-zb-titel { font-size: 12px; font-weight: 600; color: #475569; }
.pa-zb-zeile { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; align-items: center; }
.pa-zb-gruppe { font-size: 13px; color: #1e293b; }
.pa-zb-gruppe small { color: #94a3b8; }
@media (max-width: 760px) { .pa-zb-zeile { grid-template-columns: 1fr; gap: 4px; } }
