:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --primary: #111827;
  --border: #dfe5ef;
  --border-soft: #edf1f6;
  --soft: #f8fafc;
  --blue-soft: #eef3ff;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;

  --shadow-card: 0 14px 38px rgba(15, 23, 42, .055);
  --shadow-modal: 0 24px 80px rgba(15, 23, 42, .22);

  --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
}

/* ---------- Basics ---------- */

a {
  color: inherit;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.05em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

h2 {
  letter-spacing: -.04em;
}

h2 {
  font-size: 18px;
  font-weight: 900;
}

button,
.button,
.start-button {
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease, background .14s ease;
}

button,
.button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 10px 15px;
  background: var(--primary);
  color: #fff;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  line-height: 1.1;
  white-space: nowrap;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

button:hover,
.button:hover,
.start-button:hover {
  transform: translateY(-1px);
  opacity: .95;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.card + .card {
  margin-top: 14px;
}

/* ---------- Startseite ---------- */

.start-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 32px 32px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.85), transparent 360px),
    var(--bg);
}

.start-card {
  width: min(960px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 54px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .08);
}

.start-card h1 {
  font-size: 42px;
}

.start-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.start-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 38px;
}

.start-button {
  min-height: 138px;
  border-radius: 26px;
  padding: 28px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.15;
}

.start-button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .16);
}

.start-button.secondary {
  background: var(--soft);
  color: var(--primary);
}

/* ---------- App Layout ---------- */

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px 1fr;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 18px 12px;
}

.brand {
  margin-bottom: 20px;
}

.brand strong {
  display: block;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.06em;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.sidebar a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}

.sidebar a:hover {
  background: var(--soft);
}

.sidebar a.active {
  background: var(--primary);
  color: #fff;
}

.sidebar hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.main {
  padding: 20px 24px;
  overflow-x: auto;
}

.topbar,
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 16px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Statistik ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  min-height: 76px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.15;
  min-height: 24px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.05em;
}

/* ---------- Formulare / Filter ---------- */

.filter-grid {
  display: grid;
  grid-template-columns: 170px 190px 230px minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

label {
  display: block;
  font-weight: 850;
  font-size: 12px;
  line-height: 1.2;
}

input,
select,
textarea {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  padding: 8px 11px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text);
}

input[type="file"] {
  padding: 7px 10px;
  line-height: 1;
}

textarea {
  min-height: 82px;
  height: auto;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #dbeafe;
  border-color: #93c5fd;
}

/* ---------- Tabelle ---------- */

.table-shell {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
  line-height: 1.25;
}

th {
  background: var(--soft);
  font-weight: 950;
  white-space: nowrap;
  color: #111827;
}

td {
  white-space: normal;
  word-break: normal;
}

tbody tr:nth-child(even) {
  background: #fbfcfe;
}

tbody tr:hover {
  background: var(--blue-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.icon-button {
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 9px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
  font-size: 12px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  border: 1px solid var(--border);
  background: var(--soft);
  white-space: nowrap;
}

.badge.ovs {
  background: #eef3ff;
  color: #0b4db3;
  border-color: #bcd2ff;
}

.badge.cert {
  background: #fff4e5;
  color: #9a4b00;
  border-color: #ffd79d;
}

.badge.ovs-cert {
  background: #e8fbfb;
  color: #007070;
  border-color: #afe7e7;
}

.badge.relevant,
.badge.veroeffentlicht,
.badge.angepasst {
  background: #eaf8ee;
  color: #137333;
  border-color: #bce7c8;
}

.badge.nicht-relevant {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

.badge.zu-pruefen {
  background: #fff8db;
  color: #8a5b00;
  border-color: #fde68a;
}

.badge.anpassung-offen {
  background: #fff1e6;
  color: #c2410c;
  border-color: #fed7aa;
}

.badge.in-bearbeitung {
  background: #eaf2ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge.keine-anpassung-erforderlich {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.badge.archiviert {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15, 23, 42, .45);
  padding: 52px 24px 24px;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-box {
  width: min(1120px, 100%);
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow-modal);
}

.modal-box .filter-grid {
  grid-template-columns: 180px 260px minmax(260px, 1fr) minmax(260px, 1fr);
  align-items: end;
}

.modal-actions {
  margin-top: 22px;
}

.msg {
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 14px;
  background: #eef6ff;
  color: #16446b;
  border: 1px solid #d8eaff;
}

.msg.err {
  background: #fff1f1;
  color: #8a1620;
  border-color: #ffd7d7;
}

/* Export vorerst ausblenden */
a[href="export_xls.php"].button {
  display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1400px) {
  .stats {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .modal-box .filter-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .filter-grid,
  .modal-box .filter-grid {
    grid-template-columns: 1fr;
  }

  .start-wrap {
    padding: 42px 18px 18px;
  }

  .start-card {
    padding: 32px;
  }

  .start-card h1 {
    font-size: 32px;
  }

  .start-actions {
    grid-template-columns: 1fr;
  }
}
/* Tabelle ohne horizontales Scrollen */
.table-shell {
  overflow-x: visible;
}

table {
  table-layout: fixed;
  width: 100%;
}

th,
td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* Spaltenbreiten für perfekte Gesamtübersicht */
th:nth-child(1), td:nth-child(1) { width: 6%; }   /* Kategorie */
th:nth-child(2), td:nth-child(2) { width: 9%; }   /* Checklist Update */
th:nth-child(3), td:nth-child(3) { width: 7%; }   /* MOC */
th:nth-child(4), td:nth-child(4) { width: 8%; }   /* EASA Identifier */
th:nth-child(5), td:nth-child(5) { width: 15%; }  /* EASA Checkliste */
th:nth-child(6), td:nth-child(6) { width: 6%; }   /* EASA Version */
th:nth-child(7), td:nth-child(7) { width: 7%; }   /* Relevanz */
th:nth-child(8), td:nth-child(8) { width: 8%; }   /* ACG Identifier */
th:nth-child(9), td:nth-child(9) { width: 13%; }  /* ACG Checkliste */
th:nth-child(10), td:nth-child(10) { width: 6%; } /* ACG Version */
th:nth-child(11), td:nth-child(11) { width: 7%; } /* Status */
th:nth-child(12), td:nth-child(12) { width: 6%; } /* Kommentar */
th:nth-child(13), td:nth-child(13) { width: 2%; } /* Aktionen */

.icon-button {
  min-width: 26px;
}
/* ---------- Resizable Table ---------- */

.table-shell {
  overflow-x: auto;
}

.resizable-table {
  table-layout: fixed;
  min-width: 1180px;
}

.resizable-table th {
  position: relative;
  user-select: none;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.col-resizer:hover {
  background: rgba(17, 24, 39, .12);
}

.resizing-columns {
  cursor: col-resize;
  user-select: none;
}

.resizable-table th:nth-child(1) { width: 90px; }
.resizable-table th:nth-child(2) { width: 150px; }
.resizable-table th:nth-child(3) { width: 260px; }
.resizable-table th:nth-child(4) { width: 110px; }
.resizable-table th:nth-child(5) { width: 150px; }
.resizable-table th:nth-child(6) { width: 240px; }
.resizable-table th:nth-child(7) { width: 110px; }
.resizable-table th:nth-child(8) { width: 150px; }
.resizable-table th:nth-child(9) { width: 90px; }

/* ---------- Detailansicht ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.detail-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--soft);
  padding: 16px;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -.03em;
}

.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-value {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

/* ---------- Bearbeiten-Ansicht ---------- */

.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.edit-grid .full {
  grid-column: 1 / -1;
}

.edit-box {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.edit-box h3 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: -.03em;
}

.edit-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1100px) {
  .detail-grid,
  .edit-grid {
    grid-template-columns: 1fr;
  }
}
.hidden {
  display: none !important;
}

.table-shell {
  overflow-x: hidden;
}

.resizable-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.resizable-table th:nth-child(1) { width: 8%; }
.resizable-table th:nth-child(2) { width: 13%; }
.resizable-table th:nth-child(3) { width: 25%; }
.resizable-table th:nth-child(4) { width: 9%; }
.resizable-table th:nth-child(5) { width: 13%; }
.resizable-table th:nth-child(6) { width: 18%; }
.resizable-table th:nth-child(7) { width: 8%; }
.resizable-table th:nth-child(8) { width: 9%; }
.resizable-table th:nth-child(9) { width: 7%; }

.resizable-table th,
.resizable-table td {
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
}

.detail-panel {
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.detail-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--soft);
  padding: 14px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.detail-value {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

@media (max-width: 1500px) {
  .detail-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}
/* ---------- Farbtrennung Detailbereiche ---------- */

.detail-section.easa-section {
  background: #ffffff;
  border: 2px solid #f2b800;
  box-shadow: 0 10px 28px rgba(242, 184, 0, .08);
}

.detail-section.easa-section h3 {
  color: #003f7f;
  letter-spacing: .08em;
}

.detail-section.acg-section {
  background: #ffffff;
  border: 2px solid #003b70;
  box-shadow: 0 10px 28px rgba(0, 59, 112, .08);
}

.detail-section.acg-section h3 {
  color: #003b70;
  letter-spacing: .08em;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-tools input[type="search"] {
  width: min(420px, 32vw);
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 16px;
  font: inherit;
  font-weight: 750;
  background: #fff;
}

@media (max-width: 1100px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  
  .topbar-tools {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .topbar-tools input[type="search"] {
    width: 100%;
  }
}
.sidebar nav a.active {
  background: #111827;
  color: #ffffff;
  box-shadow: inset 4px 0 0 #f2b800;
}

.sidebar nav a.active:hover {
  background: #111827;
  color: #ffffff;
}
.muted-small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.version-list {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.version-list h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.version-list table {
  width: 100%;
}
.detail-section {
  position: relative;
  overflow: hidden;
}

.detail-section > * {
  position: relative;
  z-index: 1;
}

.detail-section.easa-section::before,
.detail-section.acg-section::before {
  content: "";
  position: absolute;
  inset: 10px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 82%;
  opacity: .07;
  z-index: 0;
  pointer-events: none;
}

.detail-section.easa-section::before {
  background-image: url("easa-logo.png");
}

.detail-section.acg-section::before {
  background-image: url("acg-logo.png");
}
/* Status-Badge darf nicht in Aktionen-Spalte laufen */
.resizable-table th:nth-child(8),
.resizable-table td:nth-child(8) {
  width: 180px;
  min-width: 180px;
}

.resizable-table th:nth-child(9),
.resizable-table td:nth-child(9) {
  width: 76px;
  min-width: 76px;
  text-align: center;
}

.resizable-table td:nth-child(8) .badge {
  max-width: 160px;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
}

.resizable-table td:nth-child(9) {
  white-space: nowrap;
}
.file-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  font-size: 11px;
}
.edit-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.edit-column {
  border: 1px solid #dfe7f3;
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
}

.edit-column h4 {
  margin: 0 0 16px;
  font-size: 18px;
}

@media (max-width: 1000px) {
  .edit-two-columns {
    grid-template-columns: 1fr;
  }
}
.edit-column input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

.icon-button.danger {
  color: #9f1239;
  border-color: #fecdd3;
  background: #fff1f2;
}

.icon-button.danger:hover {
  background: #ffe4e6;
}


.version-list th:last-child,
.version-list td:last-child {
  width: 230px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.row-actions .icon-button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.1;
}

.icon-button.soft-danger {
  color: #b45309;
  border-color: #fed7aa;
  background: #fff7ed;
}

.icon-button.soft-danger:hover {
  background: #ffedd5;
}

.icon-button.strong-danger {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
  font-weight: 900;
}

.icon-button.strong-danger:hover {
  background: #fee2e2;
}



/* Kompakte Aktionen in der Versionstabelle */
.version-list th:last-child,
.version-list td:last-child {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  text-align: left;
}

.version-actions {
  width: 132px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: stretch;
}

.version-actions .mini-action {
  width: 100%;
  min-height: 22px;
  padding: 3px 5px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.05;
  white-space: normal;
  text-align: center;
  box-shadow: none;
}

.version-actions .mini-action:hover {
  transform: none;
  background: #f8fafc;
  opacity: 1;
}

.version-actions .mini-action.warn {
  color: #9a3412;
  border-color: #fed7aa;
  background: #fffaf5;
}

.version-actions .mini-action.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fffafa;
}


.overview-row {
  cursor: pointer;
}

.overview-row:hover {
  background: var(--blue-soft);
}

.overview-row.is-not-relevant {
  opacity: .58;
  background: #f8fafc;
}

.overview-row.is-not-relevant:hover {
  opacity: .78;
  background: #f1f5f9;
}

.overview-row.is-not-relevant td {
  color: #64748b;
}

.overview-row.is-not-relevant .badge {
  opacity: .82;
}

/* Hauptübersicht hat keine Aktionsspalte mehr. */
.resizable-table th:nth-child(1) { width: 8%; }
.resizable-table th:nth-child(2) { width: 15%; }
.resizable-table th:nth-child(3) { width: 27%; }
.resizable-table th:nth-child(4) { width: 10%; }
.resizable-table th:nth-child(5) { width: 15%; }
.resizable-table th:nth-child(6) { width: 18%; }
.resizable-table th:nth-child(7) { width: 9%; }
.resizable-table th:nth-child(8),
.resizable-table td:nth-child(8) {
  width: 150px;
  min-width: 150px;
  text-align: left;
}


.detail-section.empty-acg {
  background: #fbfdff;
}

.empty-banner {
  display: block;
  width: 100%;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  letter-spacing: .02em;
}


.version-row {
  cursor: pointer;
}

.version-row:hover td {
  background: #f8fafc;
}


.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}

.brand-row .brand {
  margin-bottom: 0;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.layout.sidebar-collapsed {
  grid-template-columns: 58px 1fr;
}

.layout.sidebar-collapsed .sidebar {
  padding: 14px 8px;
}

.layout.sidebar-collapsed .brand span,
.layout.sidebar-collapsed .sidebar nav a,
.layout.sidebar-collapsed .sidebar hr {
  display: none;
}

.layout.sidebar-collapsed .brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.layout.sidebar-collapsed .brand-row {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.layout.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

.warn-text {
  color: #b45309;
  font-weight: 850;
}

.ok-text {
  color: #15803d;
  font-weight: 850;
}

.overview-row.has-acg-gap td {
  background: #fff7ed;
}

.overview-row.has-acg-gap:hover td {
  background: #ffedd5;
}

.overview-row.has-acg-gap-ok td {
  background: #f0fdf4;
}

.overview-row.has-acg-gap-ok:hover td {
  background: #dcfce7;
}

.warn-banner {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #b45309;
}


.badge.acg-nicht-aktuell,
.badge.acg-fehlt {
  background: #fff7ed;
  color: #b45309;
  border-color: #fed7aa;
}


.btn-easa {
  background: #377dbd;
  border-left: 8px solid #f1bf55;
  color: #fff;
}

.btn-acg {
  background: #1e408f;
  border-left: 8px solid #a3a5a7;
  color: #fff;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin: 16px 0 0;
}

.sidebar-stats .stat {
  min-height: 0;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: none;
}

.sidebar-stats .stat span {
  min-height: 0;
  font-size: 9px;
  letter-spacing: .05em;
}

.sidebar-stats .stat strong {
  font-size: 19px;
}

.layout.sidebar-collapsed .sidebar-stats {
  display: none;
}

.edit-box {
  margin-top: 14px;
}

.edit-box .edit-two-columns {
  gap: 14px;
}

.edit-box .edit-column {
  padding: 12px;
  border-radius: 12px;
}

.edit-box .edit-column h4 {
  margin-bottom: 10px;
  font-size: 14px;
}

.edit-box .edit-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.edit-box label {
  font-size: 11px;
}

.edit-box input,
.edit-box select {
  height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.edit-box textarea {
  min-height: 58px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
}


.edit-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.edit-inline-actions .mini-action {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 850;
}

.edit-inline-actions .mini-action.warn {
  color: #9a3412;
  border-color: #fed7aa;
  background: #fffaf5;
}

.edit-inline-actions .mini-action.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fffafa;
}

.version-list th:last-child,
.version-list td:last-child {
  width: auto;
  min-width: 0;
  max-width: none;
}


/* Modal-Farbwelten */
.modal-box.easa-modal {
  border-top: 8px solid #377dbd;
  box-shadow: inset 8px 0 0 #f1bf55, var(--shadow-modal);
}

.modal-box.acg-modal {
  border-top: 8px solid #1e408f;
  box-shadow: inset 8px 0 0 #a3a5a7, var(--shadow-modal);
}

.modal-box.easa-modal h2 {
  color: #377dbd;
}

.modal-box.acg-modal h2 {
  color: #1e408f;
}

/* Breite, lesbare Zuordnungstabelle */
.version-list {
  width: 100%;
}

.version-list table {
  width: 100%;
  table-layout: fixed;
}

.version-list th:nth-child(1),
.version-list td:nth-child(1) {
  width: 16%;
}

.version-list th:nth-child(2),
.version-list td:nth-child(2) {
  width: 16%;
}

.version-list th:nth-child(3),
.version-list td:nth-child(3) {
  width: 16%;
}

.version-list th:nth-child(4),
.version-list td:nth-child(4) {
  width: 16%;
}

.version-list th:nth-child(5),
.version-list td:nth-child(5) {
  width: 36%;
}

.version-list th,
.version-list td {
  overflow-wrap: anywhere;
}

/* Einheitliche, unten haftende Aktionsleiste in Bearbeitungsformularen */
.edit-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 16px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}

.edit-actions button {
  min-width: 132px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.edit-actions button[type="submit"] {
  background: var(--primary);
  color: #fff;
}


.filter-grid .full {
  grid-column: 1 / -1;
}


/* Einheitliche Button- und Control-Politur */
button,
.button {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-easa,
.btn-acg {
  min-height: 40px;
  border-radius: 12px;
  box-shadow: none;
}

.edit-inline-actions button,
.edit-inline-actions .mini-action {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edit-inline-actions .btn-easa,
.edit-inline-actions .btn-acg {
  min-height: 34px;
}

.modal-actions button {
  min-height: 42px;
  min-width: 150px;
}

input[type="file"] {
  height: 40px;
  padding: 5px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 800;
}

input[type="file"]::file-selector-button {
  height: 28px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
  height: 28px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
}

input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  transform: scale(0);
  transition: transform .12s ease;
  background: #fff;
  clip-path: polygon(14% 44%, 0 59%, 39% 100%, 100% 16%, 84% 0, 37% 63%);
}

input[type="checkbox"]:checked {
  background: #1e408f;
  border-color: #1e408f;
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.modal-box label:has(input[type="checkbox"]),
.edit-box label:has(input[type="checkbox"]) {
  min-height: 28px;
}


.topbar h1 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.refresh-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
  font-size: 18px;
  line-height: 1;
}

.card > .table-shell:first-child {
  margin-top: 0;
}

.edit-box {
  padding-bottom: 0;
}

.edit-actions {
  align-items: center;
  justify-content: flex-end;
}

.edit-actions .secondary {
  min-height: 42px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

.edit-actions button[type="submit"] {
  min-height: 42px;
  background: #111827;
  color: #fff;
  border: 1px solid #111827;
}

.edit-inline-actions .easa-action,
.edit-inline-actions .easa-danger,
.edit-inline-actions .acg-action,
.edit-inline-actions .acg-danger {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border-width: 1px;
}

.edit-inline-actions .easa-action {
  background: #377dbd;
  border-left: 7px solid #f1bf55;
  border-color: #377dbd;
  color: #fff;
}

.edit-inline-actions .acg-action {
  background: #1e408f;
  border-left: 7px solid #a3a5a7;
  border-color: #1e408f;
  color: #fff;
}

.edit-inline-actions .easa-danger {
  background: #fff8eb;
  border-color: #f1bf55;
  color: #9a3412;
}

.edit-inline-actions .acg-danger {
  background: #f3f4f6;
  border-color: #a3a5a7;
  color: #1e408f;
}


.version-dial {
  display: grid;
  grid-template-columns: 34px minmax(70px, 1fr) 34px;
  gap: 6px;
  margin-top: 6px;
}

.version-dial input {
  margin-top: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.version-dial button {
  min-width: 34px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-size: 16px;
}

.edit-two-columns {
  align-items: stretch;
}

.edit-column {
  display: flex;
  flex-direction: column;
}

.edit-column > .edit-grid {
  flex: 1;
}

.edit-inline-actions {
  align-self: stretch;
  margin-top: auto;
  padding-top: 10px;
}

.easa-single-field {
  display: none;
}


/* Latest UI cleanup */
select:disabled {
  background: #f6f8fb;
  color: #8793a7;
  cursor: not-allowed;
}

.edit-column {
  min-height: 100%;
}

.edit-column > .edit-grid {
  flex: 0 0 auto;
}

.edit-column > .edit-inline-actions {
  margin-top: auto;
  padding-top: 18px;
}


/* Export and action color cleanup */
.sidebar .nav-export {
  color: #0f2b56;
  background: #eef4ff;
  border-color: #cfe0ff;
}

.edit-inline-actions .neutral-action {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.edit-inline-actions .neutral-action:hover {
  background: #eef2f7;
}

.edit-inline-actions .easa-danger,
.edit-inline-actions .acg-danger {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}


/* Relevant EASA without ACG needs action */
.overview-row.needs-acg-action td {
  background: #fff1f2;
  color: #7f1d1d;
}

.overview-row.needs-acg-action:hover td {
  background: #ffe4e6;
}

.overview-row.needs-acg-action .warn-text {
  color: #b91c1c;
  font-weight: 900;
}


/* Übersicht-Ampel für ACG-Zuordnung */
.overview-row.has-current-acg td {
  background: #f0fdf4;
}

.overview-row.has-current-acg:hover td {
  background: #dcfce7;
}

.overview-row.has-current-acg .ok-text {
  color: #15803d;
}

.overview-row.has-acg-gap td,
.overview-row.has-acg-gap-ok td {
  background: #fff7ed;
}

.overview-row.has-acg-gap:hover td,
.overview-row.has-acg-gap-ok:hover td {
  background: #ffedd5;
}

.overview-row.has-acg-gap .warn-text,
.overview-row.has-acg-gap-ok .ok-text {
  color: #c2410c;
  font-weight: 900;
}

.overview-row.needs-acg-action td {
  background: #fff1f2;
  color: #7f1d1d;
}

.overview-row.needs-acg-action:hover td {
  background: #ffe4e6;
}


/* Custom date picker and app dialogs */
.date-field {
  position: relative;
}

.date-picker-button {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  padding: 8px 12px;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.date-picker-button:hover {
  border-color: #b9c7dc;
  background: #fff;
  transform: none;
}

.date-picker-button strong {
  color: var(--muted);
  font-size: 12px;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1800;
  width: 286px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-modal);
}

.date-picker-head,
.date-picker-weekdays,
.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-items: center;
}

.date-picker-head {
  grid-template-columns: 34px 1fr 34px;
  margin-bottom: 10px;
}

.date-picker-head strong {
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}

.date-picker-head button,
.date-picker-days button {
  min-height: 30px;
  padding: 0;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.date-picker-head button {
  border: 1px solid var(--border);
  color: var(--muted);
}

.date-picker-days button {
  border: 0;
  font-weight: 800;
}

.date-picker-head button:hover,
.date-picker-days button:hover {
  background: var(--blue-soft);
  transform: none;
}

.date-picker-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.date-picker-days .muted-day {
  color: #cbd5e1;
}

.date-picker-days .selected-day {
  background: #1e408f;
  color: #fff;
}

.date-picker-clear {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.date-picker-clear:hover {
  background: #f8fafc;
  transform: none;
}

.app-dialog-modal {
  z-index: 2600;
}

.app-dialog-box {
  width: min(560px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: start;
  border-top: 7px solid #377dbd;
  padding: 24px;
}

.app-dialog-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 950;
  background: #eef4ff;
  color: #1e408f;
}

.app-dialog-content h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.app-dialog-content p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
  white-space: pre-line;
}

.app-dialog-actions {
  justify-content: flex-end;
}

.app-dialog-box.dialog-danger {
  border-top-color: #dc2626;
}

.app-dialog-box.dialog-danger .app-dialog-mark {
  background: #fff1f2;
  color: #b91c1c;
}

.app-dialog-box.dialog-danger #appDialogConfirm {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.app-dialog-box.dialog-warning {
  border-top-color: #f59e0b;
}

.app-dialog-box.dialog-warning .app-dialog-mark {
  background: #fff7ed;
  color: #c2410c;
}

.app-dialog-box.dialog-success {
  border-top-color: #16a34a;
}

.app-dialog-box.dialog-success .app-dialog-mark {
  background: #f0fdf4;
  color: #15803d;
}

.app-dialog-box.dialog-error {
  border-top-color: #dc2626;
}

.app-dialog-box.dialog-error .app-dialog-mark {
  background: #fff1f2;
  color: #b91c1c;
}


/* Aktuell geöffnete Auswahl in der Hauptübersicht */
.overview-row.is-selected {
  filter: drop-shadow(0 4px 10px rgba(30, 64, 143, .11));
}

.overview-row.is-selected td {
  border-top-color: transparent;
  border-bottom-color: transparent;
  box-shadow: inset 0 1px 0 #7ea7d2, inset 0 -1px 0 #7ea7d2;
}

.overview-row.is-selected td:first-child {
  box-shadow: inset 0 1px 0 #7ea7d2, inset 0 -1px 0 #7ea7d2, inset 1px 0 0 #7ea7d2;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.overview-row.is-selected td:last-child {
  box-shadow: inset 0 1px 0 #7ea7d2, inset 0 -1px 0 #7ea7d2, inset -1px 0 0 #7ea7d2;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}


.app-version {
  position: relative;
  z-index: 1;
  padding: 16px 4px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 400;
}


.import-modal-box {
  width: min(1120px, calc(100vw - 36px));
}

.import-form {
  margin-top: 14px;
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.import-block {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.import-block h3,
.import-block p {
  margin: 12px 14px;
}

.import-block table {
  margin-top: 0;
}

.import-invalid {
  border-color: #fecaca;
  background: #fffafa;
}

.import-change {
  margin: 2px 0;
}
