:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --border: #e0e2e6;
  --text: #1c1e21;
  --muted: #6b7280;
  --accent: #2f6fd6;
  --accent-dark: #24519f;
  --radius: 8px;
}

html[data-theme="dark"] {
  --bg: #16181c;
  --surface: #1f2227;
  --border: #33373e;
  --text: #e7e9ec;
  --muted: #9aa1ab;
  --accent: #6ea1ef;
  --accent-dark: #93bcf7;
}

* { box-sizing: border-box; }

body.portal {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.portal__header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.portal__brand {
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 16px;
}

.portal__user {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal__user a { color: var(--accent); text-decoration: none; }
.portal__user a:hover { text-decoration: underline; }

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.portal__body {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 0 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.portal__sidebar {
  width: 230px;
  flex-shrink: 0;
  padding: 16px 0;
  font-size: 13px;
}
.portal__sidebar-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.portal__sidebar-title a { color: var(--text); text-decoration: none; }
.portal__sidebar-tickets {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.portal__sidebar-tickets:hover { text-decoration: underline; }

.folder-tree, .folder-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 14px;
}
.folder-tree { padding-left: 0; }
.folder-tree summary {
  cursor: pointer;
  list-style: none;
  padding: 3px 0;
}
.folder-tree summary::-webkit-details-marker { display: none; }
.folder-tree summary::before { content: "▸ "; color: var(--muted); }
.folder-tree details[open] > summary::before { content: "▾ "; }
.folder-tree a { color: var(--text); text-decoration: none; }
.folder-tree a:hover { color: var(--accent); }
.folder-tree a.active { color: var(--accent); font-weight: 700; }

/* Zielordner-Auswahl (Verschieben/Kopieren, siehe _folder_tree_picker.html) -
   dieselbe Baum-Optik wie oben, nur ein Radio-Button statt eines Links je
   Zeile. */
.folder-tree__pick { cursor: pointer; color: var(--text); }
.folder-tree__pick input { margin-right: 4px; vertical-align: -2px; }
.folder-tree__root { display: block; padding: 3px 0 10px; cursor: pointer; color: var(--text); }
.folder-tree__root input { margin-right: 4px; vertical-align: -2px; }

/* Formulare mit Baum-Auswahl (Verschieben/Kopieren, siehe workspace.html) -
   bewusst NICHT .inline-form (dessen flex-wrap liess die Buttons je nach
   Baumgroesse an wechselnden Stellen landen, siehe Bugreport) - feste
   Reihenfolge als eigene Bloecke: Baum, ggf. Name, dann rechtsbuendige
   Button-Zeile. */
.folder-picker-form { display: block; margin-top: 6px; }
.folder-picker-form__tree {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.folder-picker-form__name { margin-bottom: 12px; }
.folder-picker-form__name input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.folder-picker-form__actions { display: flex; gap: 8px; justify-content: flex-end; }

.portal__main {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
  /* Grosszuegiger Abstand am Seitenende, damit Pop-ups wie das Dreipunkte-
   * Menue (.card-menu__dropdown, oeffnet sich nach unten) an der letzten
   * Zeile einer Tabelle/Liste noch vollstaendig ins Sichtfeld gescrollt
   * werden koennen, statt am Seitenende abgeschnitten zu sein. */
  padding: 16px 0 200px;
}

@media (max-width: 700px) {
  .portal__body { flex-direction: column; padding: 0 16px; }
  .portal__sidebar { width: 100%; border-bottom: 1px solid var(--border); }
}

.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs__sep { margin: 0 6px; }

h1.portal__title {
  font-size: 22px;
  margin: 0 0 4px;
}
.portal__subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.card-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 700px;
}

.card-list .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s;
}
.card-list a.card {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
}
.card-list .card:hover { border-color: var(--accent); }
/* Karten mit Dreipunkte-Menue (Ordner/Plaene in der Ordner-Ansicht): kein
 * <a class="card"> mehr, das die ganze Flaeche umschliesst (ein Menue-
 * Button darin waere ungueltig verschachtelt) - stattdessen ein Wrapper-Div
 * mit separatem Link fuer den Klickbereich und einem eigenstaendigen
 * Menue-Button daneben. */
.card-list div.card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 14px;
}
.card__link {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 12px 0;
  text-decoration: none;
  color: var(--text);
}

.card__title { font-weight: 600; }
.card__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* --- Dreipunkte-Menue (Karten in der Ordner-Ansicht: Ordner/Plaene) ------ */
.card-menu { position: relative; flex-shrink: 0; }
.card-menu__trigger {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
}
.card-menu__trigger:hover { background: var(--bg); color: var(--text); }
.card-menu__dropdown {
  /* display erst bei :not([hidden]) auf flex setzen - sonst gewinnt diese
   * Klassenregel (author stylesheet) immer gegen die UA-Default-Regel
   * "[hidden]{display:none}", das Dropdown waere trotz hidden-Attribut
   * dauerhaft sichtbar. */
  display: none;
  position: absolute;
  top: 100%;
  right: 4px;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  min-width: 170px;
  padding: 4px;
  flex-direction: column;
}
.card-menu__dropdown:not([hidden]) { display: flex; }
.card-menu__dropdown button,
.card-menu__dropdown form {
  margin: 0;
}
.card-menu__dropdown button {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.card-menu__dropdown button:hover { background: var(--bg); }
.card-menu__dropdown button.card-menu__delete { color: #d63b3b; }

.section-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 22px 0 8px;
}
.section-heading:first-child { margin-top: 0; }

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn--secondary:hover { background: #eef3fc; }

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.inline-form input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  min-width: 220px;
}

table.ticket-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}
table.ticket-table th, table.ticket-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.ticket-table th { color: var(--muted); font-weight: 600; }
table.ticket-table tr:last-child td { border-bottom: none; }
table.ticket-table a { color: var(--accent); text-decoration: none; }
table.ticket-table a:hover { text-decoration: underline; }

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  vertical-align: middle;
  margin-right: 8px;
}

.entry-list { list-style: none; margin: 0 0 16px; padding: 0; }
.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.entry__meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.entry__text { margin: 0 0 6px; white-space: pre-wrap; }
.entry__image { max-width: 240px; max-height: 240px; border-radius: 6px; border: 1px solid var(--border); }
.entry__actions { margin-top: 6px; display: flex; gap: 14px; font-size: 13px; }
.entry__actions a { color: var(--accent); text-decoration: none; }
.entry__actions a:hover { text-decoration: underline; }
.status-pill.status-offen { background: #d63b3b; }
.status-pill.status-in_bearbeitung { background: #e08a1e; }
.status-pill.status-erledigt { background: #3b9c3b; }
.status-pill.status-geprueft { background: #2f6fd6; }

.tickets-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.tickets-layout__main { flex: 1; min-width: 0; }
.tickets-layout__filters {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.filter-group { margin-bottom: 12px; }
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 3px;
}
.filter-group select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 700px) {
  .tickets-layout { flex-direction: column; }
  .tickets-layout__filters { width: 100%; }
}

.filter-bar {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.filter-bar a { color: var(--accent); text-decoration: none; }
.filter-bar a:hover { text-decoration: underline; }

/* --- Breiten-Begrenzung des Inhalts unter dem Plan (Ticket-Detailseite) ---
 * Status/Zustaendigkeit, Beschreibung, Eintrag hinzufuegen und die Content-
 * Tabelle sollen optisch buendig unter dem Plan enden statt bis unter die
 * Filter-Spalte des Verortungs-Ausschnitts zu reichen. Reserviert dafuer
 * exakt dieselbe Breite (190px + 20px Abstand) wie
 * .plan-overview__layout/.plan-overview__filters in plan_overview.css ueber
 * eine unsichtbare, gleich breite Platzhalter-Spalte statt eines geschaetzten
 * Fixwerts - bleibt so auch bei Fenstergroessen-Aenderungen exakt buendig. */
.ticket-detail-body { display: flex; gap: 20px; align-items: flex-start; }
.ticket-detail-body__main { flex: 1; min-width: 0; }
.ticket-detail-body__spacer { width: 190px; flex-shrink: 0; }
@media (max-width: 720px) {
  .ticket-detail-body { flex-direction: column; }
  .ticket-detail-body__spacer { display: none; }
}

/* --- Kompakte Feldzeile/-tabelle (Ticket-Detailseite: je Zeile gleich
 * breite Felder - Status/Prioritaet/Frist zu je 1/3, Firma/Mitarbeiter zu
 * je 50% in der Zeile darunter - via flex:1 auf gleicher flex-basis, ergibt
 * automatisch eine Gleichverteilung unabhaengig von der Kinderzahl. Custom-
 * Felder darunter gestapelt wie eine Tabelle) ------------------------- */
.field-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.field-row__item { display: flex; flex: 1 1 0; flex-direction: column; gap: 4px; min-width: 160px; }
.field-row__item label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field-row__item select, .field-row__item input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}

.field-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.field-table__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.field-table__row:last-child { border-bottom: none; }
.field-table__row label { flex: 0 0 180px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field-table__row input, .field-table__row select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.field-table__row input[type="checkbox"] { flex: 0 0 auto; width: auto; }

/* Hoehere Spezifitaet als ".stacked-form textarea" (max-width:400px, siehe
 * unten) - sonst gewinnt bei gleicher Spezifitaet dessen spaetere
 * Regel-Position im Stylesheet und die Breite wuerde trotz width:100% auf
 * 400px begrenzt bleiben. */
.stacked-form .description-box textarea {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 90px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

/* --- Verlaufs-Tabelle "Bisheriger Content" (Ticket-Detailseite) ---------
 * Vier Spalten: Datum (~20%) / Inhalt-Vorschau (~40%) / Kommentar (~40%,
 * eigene Spalte statt unter dem Inhalt) / schmale Menue-Spalte (fix). */
table.entry-table td { vertical-align: top; }
table.entry-table th.entry-table__date-col, table.entry-table td.entry-table__date { width: 20%; }
table.entry-table th.entry-table__content-col, table.entry-table td.entry-table__content { width: 40%; }
table.entry-table th.entry-table__comment-col, table.entry-table td.entry-table__comment-col { width: 40%; }
.entry-table__kind { font-size: 12px; color: var(--muted); margin-top: 2px; }
.entry-table__text { margin: 0; white-space: pre-wrap; }
.entry-table__thumb { max-width: 100px; max-height: 100px; border-radius: 6px; border: 1px solid var(--border); display: block; }
.entry-table__comment { font-size: 13px; color: var(--text); white-space: pre-wrap; display: flex; gap: 6px; }
.entry-table__comment-empty { font-size: 12px; color: var(--muted); }
table.entry-table td.entry-table__menu-col { width: 36px; text-align: right; position: relative; }

/* --- "Eintrag hinzufuegen": eigene, visuell abgegrenzte Box ------------- */
.entry-form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.entry-form-box .section-heading:first-child { margin-top: 0; }
.entry-form__row { display: flex; gap: 14px; margin-bottom: 14px; }
.entry-form__col { flex: 1; min-width: 0; }
.entry-form__col select, .entry-form__col textarea { width: 100%; max-width: none; }

.stacked-form p { margin: 0 0 14px; }
.stacked-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.stacked-form input[type="text"],
.stacked-form input[type="number"],
.stacked-form input[type="email"],
.stacked-form input[type="tel"],
.stacked-form input[type="date"],
.stacked-form textarea,
.stacked-form select {
  width: 100%;
  max-width: 400px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.stacked-form .errorlist {
  color: #d63b3b;
  font-size: 12px;
  list-style: none;
  padding: 0;
  margin: 2px 0;
}
.stacked-form .helptext { color: var(--muted); font-size: 12px; }

.login-page {
  min-height: calc(100vh - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  max-width: 340px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.login-card__logo { margin-bottom: 16px; }
.login-card__logo svg { height: 56px; width: auto; color: var(--text); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card__subtitle { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 13px; margin: 12px 0 4px; }
.login-card input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.login-card .btn { width: 100%; margin-top: 16px; padding: 10px; text-align: center; }
.login-card .errorlist { color: #d63b3b; font-size: 13px; padding-left: 18px; }

/* --- Aktions-Bar (oberhalb von Ordner-/Listen-Inhalten) -------------------
 * Vereinheitlichtes Muster: statt verstreuter Inline-Formulare/Links eine
 * Bar mit Buttons, die ein Modal (siehe unten) mit dem jeweiligen Formular
 * oeffnen. */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

/* --- Modal (Dialog) --------------------------------------------------------
 * Zwei Varianten, gleiche Optik:
 *  - #portal-modal (global, einmal in base.html): laedt eine bestehende
 *    Portal-Seite per <iframe> - fuer eigenstaendige Formular-Seiten
 *    (Ordner/Plan/Ticket/Firma/Mitarbeiter anlegen/bearbeiten). Die Zielseite
 *    erkennt ueber modal.js selbst, dass sie eingebettet ist und blendet
 *    Header/Sidebar aus (Klasse "in-modal-frame" auf <html>).
 *  - dialog.local-dialog: enthaelt das Formular direkt inline (fuer kleine,
 *    seiteneigene Aktionen wie Projektbeteiligte/Mitarbeiter hinzufuegen),
 *    kein Iframe noetig.
 * Schliessen: Klick auf Backdrop, Klick auf [data-role="dialog-close"]/
 * [data-role="modal-close"], oder Esc (Browser-Standard bei <dialog>). */
dialog.portal-modal, dialog.local-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
}
dialog.portal-modal::backdrop, dialog.local-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.portal-modal__box {
  display: flex;
  flex-direction: column;
  width: min(640px, 92vw);
  height: min(80vh, 640px);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
dialog.portal-modal.portal-modal--large .portal-modal__box {
  width: min(1150px, 96vw);
  height: min(92vh, 920px);
}
.portal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  flex-shrink: 0;
}
.portal-modal__close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.portal-modal__close:hover { color: var(--text); }
.portal-modal__iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--bg);
}

.local-dialog__box {
  width: min(420px, 92vw);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.local-dialog__box .section-heading:first-child { margin-top: 0; }
/* Breiter fuer Inhalte, die mehr Platz brauchen (z.B. das Zeichnungs-Tool
 * mit seinem bis zu 800px breiten Canvas, siehe ticket_detail.html). */
dialog.local-dialog--large .local-dialog__box { width: min(880px, 94vw); }

/* Anlagen-Raster (Ticket-Detailseite) - Galerie statt Tabelle, 4 Kacheln
 * pro Zeile (siehe attachment_grid.js fuer Auswahl-/Popup-Verhalten). */
.action-bar__gap { flex: 1 1 auto; }
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .attachment-grid { grid-template-columns: repeat(2, 1fr); }
}
.attachment-cell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.attachment-cell__select {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 5px;
}
.attachment-cell__select input { margin: 0; }
.attachment-cell__body {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}
.attachment-cell__thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.attachment-cell__doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 120px;
  padding: 8px;
  text-align: center;
}
.attachment-cell__doc-icon { font-size: 32px; }
.attachment-cell__doc-name {
  font-size: 12px;
  word-break: break-word;
  color: var(--muted);
}
.attachment-cell__comment {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-detail__meta { color: var(--muted); font-size: 13px; }
.attachment-detail__image {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 12px;
}
.bulk-edit__box { width: min(480px, 92vw); max-height: 85vh; overflow-y: auto; }
.bulk-edit__box .stacked-form p { margin-bottom: 12px; }

/* Checkbox-Spalte + Mehrfachbearbeiten-Auslöser in Ticket-Tabellen (Ticket-
 * Liste und Tickets-Tabelle unter einem Plan). */
.bulk-edit-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
table.ticket-table th.ticket-table__select-col,
table.ticket-table td.ticket-table__select-col { width: 26px; padding-right: 0; }
/* Zeilen-Auswahl per Klick (Shift/Strg-Block-/Einzelauswahl, siehe
 * column_table.js) - nur auf Tabellen mit Checkbox-Spalte. */
table.ticket-table--selectable tbody tr { cursor: pointer; user-select: none; }
table.ticket-table--selectable tbody tr:hover { background: rgba(47, 111, 214, 0.08); }

/* Wird von modal.js gesetzt, wenn diese Seite selbst in #portal-modal als
 * Iframe laeuft - Header/Sidebar duplizieren dort nur den Rahmen. */
html.in-modal-frame .portal__header,
html.in-modal-frame .portal__sidebar,
html.in-modal-frame .breadcrumbs {
  display: none;
}
html.in-modal-frame .portal__body { padding: 0; max-width: none; }
html.in-modal-frame .portal__main { max-width: none; padding: 14px; }
