/* Minimal global rules for sort coloring (problems.php style) */
table thead th.sortable { cursor: pointer; }
.table th.sortable.sorted[data-dir="asc"],
table thead th.sortable.sorted[data-dir="asc"] { background: #e9f7ef !important; color: #198754 !important; }
.table th.sortable.sorted[data-dir="desc"],
table thead th.sortable.sorted[data-dir="desc"] { background: #fdecea !important; color: #dc3545 !important; }

/* === admin_home.php – verschoben (inline style #1) === */
/* Lokalny, niewpływający na resztę styl */
    /* === stoerungen.php – verschoben (inline style #1) === */
.badge-time{display:inline-block;min-width:44px;padding:2px 8px;border-radius:6px;text-align:center;font-weight:600;border:1px solid rgba(0,0,0,.2)}
.badge-time.b-yellow{background:#fef9c3;border-color:#f59e0b;color:#92400e}
.badge-time.b-orange{background:#ffedd5;border-color:#f97316;color:#9a3412}
.badge-time.b-red{background:#fee2e2;border-color:#ef4444;color:#7f1d1d}
.badge-time.b-gray{background:#e5e7eb;border-color:#9ca3af;color:#374151}
th.sortable{cursor:pointer; user-select:none;}
th.sortable.asc{color:#16a34a;}
th.sortable.desc{color:#dc2626;}


/* === stoerungen.php – verschoben (inline style #2) === */
#filter-tabbar .filter-table input[type='text'],
      #filter-tabbar .filter-table select { width: 100% !important; max-width: none !important; display: block !important; box-sizing: border-box; }
      #filter-tabbar .filter-table { width: 100%; table-layout: fixed; }


/* === problems.php – verschoben (inline style #1) === */
/* === Icon rendering / sharpness fixes === */
.view-head .actions .btn.icon-only svg,
a[title="Neu"] svg {
  width: 24px !important;   /* 24px = brak pół‑pikseli dla stroke=2 */
  height: 24px !important;
  display: block;
  vector-effect: non-scaling-stroke;   /* nie skaluj grubości kreski */
  shape-rendering: geometricPrecision;
}
.view-head .actions .btn.icon-only:visited { color: inherit; }
/* Ikony w tabeli mogą być mniejsze, ale nadal bez skalowania kreski */
.table .aktionen .btn.icon-only svg {
  width: 18px; height: 18px; display:block; vector-effect: non-scaling-stroke; shape-rendering: geometricPrecision;
}

/* === Badges === */
.badge-time{display:inline-block;min-width:44px;padding:2px 8px;border-radius:9999px;text-align:center;font-weight:600;border:1px solid rgba(0,0,0,.2)}
.b-yellow{background:#fef9c3;border-color:#f59e0b;color:#92400e}
.b-orange{background:#ffedd5;border-color:#f97316;color:#9a3412}
.b-red{background:#fee2e2;border-color:#ef4444;color:#7f1d1d}
.b-gray{background:#e5e7eb;border-color:#9ca3af;color:#374151}

/* === Sortable headers === */
th.sortable{cursor:pointer;user-select:none;}
th.sortable.asc{color:#16a34a;}
th.sortable.desc{color:#dc2626;}

/* === Table layout & alignment (zunifikowane, bez duplikatów) === */
.table.table-striped.table-hover th,
.table.table-striped.table-hover td {
  text-align: center !important;
  vertical-align: middle !important;
}
.table.table-striped.table-hover td.col-kategorie,
.table.table-striped.table-hover th.col-kategorie,
.table.table-striped.table-hover td.col-beschreibung,
.table.table-striped.table-hover th.col-beschreibung {
  text-align: left !important;
}

/* === Filter table === */
.filter-table thead th{ text-align:center }
.filter-table td{ padding:8px 10px }
.filter-table select{ width:100% !important; display:block; margin:0; box-sizing:border-box; }
/* Wariant ciemny przycisku (biały plus na ciemnym tle) */
.btn-dark { background:#374151; color:#fff !important; border:1px solid #1f2937; }
.btn-dark:hover { background:#1f2937; }
.btn-dark:active { background:#111827; }
.btn-dark:visited { color:#fff !important; }
.view-head .actions .btn-dark svg { stroke: currentColor; }


/* === home – verschoben (inline style #1) === */
/* Angleichung wie in Geräte + Korrekturen */
  #filter-tabbar .form-table.filter-table thead th { text-align: center; font-weight: 600; padding: 6px 10px; }
  #filter-tabbar .form-table.filter-table tbody td { padding: 8px 10px; }
  #filter-tabbar .form-table.filter-table { font-size: 14px; }
  /* Kolumnen-Toggles: pełna szerokość komórki */
  #filter-tabbar .form-table.filter-table thead th .col-toggle,
  #filter-tabbar .form-table.filter-table thead th .btn-col-toggle,
  #filter-tabbar .form-table.filter-table thead th .toggle-col,
  #filter-tabbar .form-table.filter-table thead th .col-visibility-toggle {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }


/* === home – verschoben (inline style #2) === */
/* Filter-Tabbar (Home) */

#filter-tabbar .filter-table { text-align: center; }
#filter-tabbar .filter-table th,
#filter-tabbar .filter-table td { text-align: center; vertical-align: middle; }
#filter-tabbar .filter-table select,
#filter-tabbar .filter-table button,
#filter-tabbar .filter-table input { text-align: center; }

#filter-tabbar .filter-table{
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
#filter-tabbar .filter-table thead th{
  border-bottom: 1px solid #e5e7eb;
}
#filter-tabbar .filter-table tbody td{
  border-bottom: 1px solid #f1f5f9;
}


/* filter-table polish */
.filter-table { width:100%; border-collapse:separate; border-spacing:8px 6px; }
.filter-table thead th { font-weight:600; color:#334155; font-size:14px; }
.filter-table td { vertical-align:bottom; }
.filter-table .btn { padding:6px 10px; border:1px solid #e5e7eb; border-radius:8px; background:#f8fafc; }


.home-toggles { display:none !important; }
/* Filter bar normalization */
#filter-tabbar { margin: 8px 0 8px 0; padding: 0; }
#filter-tabbar .filter-table { width:100%; table-layout: fixed; border:1px solid #e5e7eb; border-radius:12px; border-collapse:separate; border-spacing:0; overflow:hidden; }
#filter-tabbar .filter-table thead th { text-align:center; font-weight: 600; padding: 4px 8px 6px 8px; border-bottom: 1px solid #e5e7eb; }
#filter-tabbar .filter-table tbody td { padding: 6px 8px 2px 8px;  }
#filter-tabbar .filter-table select,
#filter-tabbar .filter-table button,
#filter-tabbar .filter-table input { margin: 0; }

#filter-tabbar .filter-table tbody td{ text-align:center; vertical-align:middle; }


/* === home – verschoben (inline style #3) === */
.hide-abteilungen .th-dept, .hide-abteilungen .td-dept{ display:none; }
  .hide-projekte .th-projekte, .hide-projekte .td-projekte{ display:none; }


/* === home – verschoben (inline style #4) === */
.home-table .cols-panel { position:absolute; background:#fff; border:1px solid #e5e7eb; box-shadow:0 4px 12px rgba(0,0,0,.08); padding:8px; border-radius:8px; margin-top:6px; z-index:10; }
  .home-table .cols-panel label { display:flex; align-items:center; gap:8px; white-space:nowrap; padding:2px 0; }
  .home-table th, .home-table td { transition: opacity .15s ease; }
  .home-table .hidden-col { display:none; }
  .home-table thead { position: sticky; top: 0; background: #fff; }
  .home-table th:first-child { position: relative; }
  .btn.tiny { font-size: 11px; padding: 2px 6px; }


/* === home – verschoben (inline style #5) === */
/* Zusätzliche Badge‑Varianten nur für Home */
  .badge.success2 { background: #bbf7d0; color: #064e3b; } /* etwas satteres Grün für 'umgesetzt' */


/* === geraete.php – verschoben (inline style #1) === */
/* Geräte: Filterfelder sollen die gesamte Zellbreite einnehmen */
#filter-tabbar .filter-table input[type="text"],
#filter-tabbar .filter-table select {
  width: 100% !important;
  max-width: none !important;
  display: block !important;
  box-sizing: border-box;
}
#filter-tabbar .filter-table { width: 100%; table-layout: fixed; }


/* === geraete.php – verschoben (inline style #2) === */
#filter-tabbar[hidden]{display:none!important}


/* === externe_tasks_admin.php – verschoben (inline style #1) === */
/* sticky header */
  
  .filterbar{ }
  table thead th{ }
  /* due badges */
  .badge.due{ display:inline-block; padding:.1rem .35rem; border-radius:.5rem; border:1px solid #e5e7eb; font-size:.75em; margin-left:.35rem }
  .due-overdue{ background:#fee2e2; color:#991b1b }
  .due-today{ background:#e0f2fe; color:#075985 }
  .due-week{ background:#fef9c3; color:#854d0e }

#filter-tabbar[hidden]{ display:none !important; }
#filter-tabbar { overflow-x:auto; }
#filter-tabbar .filters select, #filter-tabbar .filters input { max-width: 240px; }


/* === externe_tasks_admin.php – verschoben (inline style #2) === */
/* Filter-Tabbar (Externe) */
#filter-tabbar { display:flex; gap:12px; align-items:center; padding:8px 0; border-bottom:1px solid #e5e7eb; }
#filter-tabbar .filters { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
#filter-tabbar .filters { display: grid; grid-auto-flow: column; align-items: end; gap: 12px; }
#filter-tabbar .filters > * { padding: 4px 0; white-space: nowrap; }
#filter-tabbar .filters label { display:flex; flex-direction:column; gap:4px; }
#filter-tabbar { overflow-x: auto; }

#filter-tabbar label { display:flex; flex-direction:column; font-size:14px; gap:4px; }
#filter-tabbar .btn-group { display:flex; gap:6px; }
#filter-tabbar .btn-quick { white-space:nowrap; }


/* === externe_tasks_admin.php – verschoben (inline style #3) === */
/* Filter-Tabbar (Externe → wie Home) */
#filter-tabbar .filter-table { text-align:center; width:100%; border:1px solid #e5e7eb; border-radius:12px; border-collapse:separate; border-spacing:0; overflow:hidden; table-layout:fixed; }
#filter-tabbar .filter-table th, #filter-tabbar .filter-table td { text-align:center; vertical-align:middle; }
#filter-tabbar .filter-table thead th { background:#f8fafc; color:#0f172a; font-weight:700; padding:8px; border-bottom:1px solid #e5e7eb; }
#filter-tabbar .filter-table tbody td { padding:6px 8px; border-bottom:1px solid #f1f5f9; }
#filter-tabbar .filter-table tbody tr:last-child td { border-bottom:none; }
#filter-tabbar .filter-table select, #filter-tabbar .filter-table button, #filter-tabbar .filter-table input { margin:0; }
#filter-tabbar .btn-group { display:inline-flex; gap:6px; }


/* === externe_tasks_admin.php – verschoben (inline style #4) === */
/* Externe Filter: ensure table renders normally, no grid/flex on the form wrapper */
#filter-tabbar .filters { display:block !important; padding:0; margin:0; }
#filter-tabbar button[type="reset"]{ display:none !important; } /* hide any reset button if present */


/* === externe_tasks_admin.php – verschoben (inline style #5) === */
#filter-tabbar .filter-table select{width:100%;}#filter-tabbar .filter-table td{padding:8px 10px;}


/* === externe_tasks_admin.php – verschoben (inline style #6) === */
#filter-tabbar .filter-table select{width:100%;display:block;}


/* === externe_tasks_admin.php – verschoben (inline style #7) === */
/* Externe Filter: selects sollten die ganze Zellenbreite einnehmen */
#filter-tabbar .filter-table select{
  width: 100% !important;
  max-width: none !important;
  display: block;
}


/* === externe_tasks_admin.php – verschoben (inline style #8) === */
/* Externe Filter: Quick-Buttons sollen die ganze Zellbreite ausfüllen */
#filter-tabbar .filter-table .btn-group{
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
#filter-tabbar .filter-table .btn-group .btn{
  width: 100%;
}


/* === externe_tasks_admin.php – verschoben (inline style #9) === */
/* Externe Filter: tighten vertical spacing between view header, filter bar, and data table */
#filter-tabbar{ padding: 4px 0 !important; margin: 0 !important; border-bottom: 1px solid #e5e7eb; }
#filter-tabbar .filters{ margin: 0 !important; }
#filter-tabbar .filter-table{ margin: 0 !important; }
main.container table.mt-2{ margin-top: 6px !important; }


/* === externe_tasks_admin.php – verschoben (inline style #10) === */
/* Spacing fix: View Header ⇄ Filter ⇄ Content */
#filter-tabbar{ display:block !important; padding:4px 0 !important; margin:0 !important; border-bottom:1px solid #e5e7eb; }
#filter-tabbar .filters{ margin:0 !important; }
#filter-tabbar .filter-table{ margin:0 !important; }
main.container table.mt-2{ margin-top:0 !important; }


/* === externe_tasks_admin.php – verschoben (inline style #11) === */
/* Spacing between filter table and content table (final override) */
#filter-tabbar{ margin: 8px 0 12px 0 !important; padding: 4px 0 !important; border-bottom: none !important; }
main.container table.mt-2{ margin-top: 8px !important; }


/* === externe_tasks_admin.php – verschoben (inline style #12) === */
/* Final tweak: reduce space between View Header and Filter */
#filter-tabbar { margin-top: 4px !important; }


/* === externe_tasks_admin.php – verschoben (inline style #13) === */
/* Externe: kompakter header + badge + filtr */
.view-head + .badge.success{ margin: 4px 0 !important; display:inline-block; }
#filter-tabbar{ margin-top: 4px !important; }


/* === Standardbreiten (aus Inline-Styles) === */
.breite-6p { width: 6% !important; }
.breite-10p { width: 10% !important; }
.breite-20p { width: 20% !important; }
.breite-25p { width: 25% !important; }


/* === 100% Breite Hilfsklasse === */
.breite-100p { width: 100% !important; }

/* === Admin-Grid (Kacheln) – vereinheitlicht === */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.admin-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  min-height: 120px;
  text-decoration: none;
  color: #0f172a;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
}
.admin-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-color: #d1d5db;
}
.admin-tile .icon svg {
  width: 28px;
  height: 28px;
  display: block;
  margin: 0 auto 8px auto;
}
.admin-tile .label {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}


/* === Utility – Textausrichtung === */
.text-zentriert { text-align: center !important; }
.text-rechts { text-align: right !important; }

/* === Tabellen – „Keine Treffer“ === */
.zeile-keine-treffer td {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: .75rem;
}

/* === Buttons – Icon Only (Fallback) === */
.btn.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 8px;
}

/* === Modale – Basis === */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
}
.modal.offen { display: block; }
.modal .dialog { max-width: 720px; margin: 6vh auto; }
.modal .panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal .modal-title { margin: 0; }
.modal .modal-footer { text-align: right; margin-top: 8px; }

/* === Tabellen: Leerzustand === */
.zeile-keine-treffer { display: none; }
table.leer .zeile-keine-treffer,
.table.leer .zeile-keine-treffer { display: table-row; }

/* === Tabellen: Leerzustand – kompatibel (server + client) === */
tr.no-matches, tr.no-matches-client { display: none; }
table.leer tr.no-matches,
.table.leer tr.no-matches,
table.leer tr.no-matches-client,
.table.leer tr.no-matches-client { display: table-row; }

/* === Icons – Vereinheitlichung: weiß bei Icon-Only === */
:root { --farbe-rot: #dc3545; }

.btn.icon-only,
.btn.icon-only .icon,
.btn.icon-only i,
.btn.icon-only span,
.btn.icon-only svg {
  color: #ffffff !important;
  stroke: currentColor;
}

/* SVGs verwenden Stroke-Farbe */
.btn.icon-only svg * {
  stroke: currentColor !important;
}

/* === Hover-Rahmen Rot === */
.admin-tile:hover { border-color: var(--farbe-rot) !important; }
.btn.icon-only:hover { border-color: var(--farbe-rot) !important; }

/* === Dialog (Modal) – global überführt aus header.css am 2025-10-30 === */
.dialog{padding:0;border:none;border-radius:10px;width:92vw;max-width:720px}
.dialog--s{max-width:480px}
.dialog--m{max-width:720px}
.dialog--l{max-width:960px}
/* === /Dialog (Modal) – Ende === */

/* === Dialog Zusatzstile – 2025-10-30 === */
.dialog__kopf{display:flex;justify-content:space-between;align-items:center}
.dialog__aktionen{display:flex;gap:8px;align-items:center}
.dialog--hellblau{border:2px solid #93c5fd;box-shadow:0 10px 30px rgba(59,130,246,.15)}
/* Sicherstellen, dass das Dialog zentriert bleibt */
dialog.dialog{margin:0;top:50%;left:50%;transform:translate(-50%,-50%)}

/* === Dialog-Rand – Verstärkung 2025-10-30 === */
/* Sichere Randfarbe gegen allgemeinere Regeln aus header.css */
.dialog.dialog--hellblau { border: 2px solid #93c5fd !important; }

/* === Dialog: Antwort – Eingabehöhe (2025-10-30) === */
#dlg-antwort-massnahme textarea#antw-text { min-height: 90px; }

/* === Dialog: Antwort – hellblauer Kopf (2025-10-30) === */
#dlg-antwort-massnahme .dialog__kopf { background: #eff6ff; border-bottom: 1px solid #bfdbfe; }
#dlg-antwort-massnahme .dialog__kopf strong { color: #1e3a8a; }

/* === Dialog: Antwort – Schaltflächenfarben (2025-10-30) === */
#dlg-antwort-massnahme #dlg-antw-close{background:#dc2626;border:1px solid #b91c1c;color:#fff}
#dlg-antwort-massnahme #dlg-antw-close:hover{background:#b91c1c}
#dlg-antwort-massnahme #dlg-antw-save{background:#16a34a;border:1px solid #15803d;color:#fff}
#dlg-antwort-massnahme #dlg-antw-save:hover{background:#15803d}
#dlg-antwort-massnahme #dlg-antw-close img,
#dlg-antwort-massnahme #dlg-antw-save img{display:block;filter:invert(1);}
