/* KLJB Admin Dashboard - Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --acker-turquoise: #2A9D8F;
  --acker-brown: #8B6F47;
  --acker-gold: #E9B44C;
  --acker-cream: #F5F1E8;
  --primary: #2D5016;
  --primary-dark: #1A3009;
  --success: #28A745;
  --warning: #FFC107;
  --danger: #DC3545;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--acker-cream);
  color: #1A1A1A;
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Dev-Mode: Header bekommt KLJB-Dunkelrot statt Prod-Grün — visueller
   Hinweis, dass man auf der Dev-Instanz arbeitet. Class wird per JS aus
   /health (environment) gesetzt. */
body.env-dev .header {
  background: linear-gradient(135deg, #501C16, #2A0E0B);
}

.header-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary);
}

/* Modal Footer */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 2px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: white;
  border-radius: 0 0 12px 12px;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--acker-turquoise);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #238276;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-secondary {
  background: var(--acker-gold);
  color: var(--primary-dark);
}

.btn-secondary:hover:not(:disabled) {
  background: #d4a343;
}

.btn-secondary.active {
  background: var(--acker-turquoise);
  color: white;
}

.btn-all {
  background: rgba(42, 157, 143, 0.1);
  color: var(--acker-turquoise);
  border: 1px solid var(--acker-turquoise);
}

.btn-all:hover:not(:disabled) {
  background: rgba(42, 157, 143, 0.2);
}

.btn-all.active {
  background: var(--acker-turquoise);
  color: white;
}

.btn-faq {
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #E9B44C;
}

.btn-faq:hover:not(:disabled) {
  background: #fdeaa3;
}

.btn-faq.active {
  background: var(--acker-gold);
  color: var(--primary-dark);
}

.btn-awareness {
  background: #D1ECF1;
  color: #0C5460;
  border: 1px solid #17a2b8;
}

.btn-awareness:hover:not(:disabled) {
  background: #bee5eb;
}

.btn-awareness.active {
  background: #17a2b8;
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #1e7e34;
}

/* Container */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  background: white;
  padding: 0.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  /* overflow MUSS visible bleiben, sonst clippt .tabs das absolut positionierte
     Dropdown nach unten und es entsteht eine ungewollte Scrollbar — siehe CSS-Spec:
     sobald overflow-x != visible, wird overflow-y auch zu auto. flex-wrap kümmert
     sich um zu viele Tabs auf schmalen Viewports. */
  overflow: visible;
  flex-wrap: wrap;
}

.tab {
  padding: 0.5rem 0.85rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6C757D;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab:hover {
  background: rgba(42, 157, 143, 0.1);
  color: var(--acker-turquoise);
}

.tab.active {
  background: var(--acker-turquoise);
  color: white;
}

/* Gruppen in der Tab-Bar = Dropdown-Untermenüs.
   Toggle-Button ist optisch ein .tab, das Menü darunter wird per .is-open
   sichtbar. .tab-group.is-empty wird via JS gesetzt, wenn der User keinen
   einzigen Eintrag der Gruppe sehen darf. */
.tab-group { position: relative; }
.tab-group.is-empty { display: none; }

.tab-group-toggle .caret {
  display: inline-block;
  font-size: 1.5em;
  line-height: 1;
  margin-left: 0.45rem;
  vertical-align: -0.05em;
  transition: transform 0.2s;
}
.tab-group.is-open > .tab-group-toggle .caret { transform: rotate(180deg); }
/* Toggle-Button bekommt aktive Optik, wenn die aktuell offene Seite in
   dieser Gruppe liegt (JS setzt .has-active). */
.tab-group.has-active > .tab-group-toggle {
  background: rgba(42, 157, 143, 0.12);
  color: var(--acker-turquoise);
}

.tab-group-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 200;
}
.tab-group.is-open > .tab-group-menu { display: flex; }
.tab-group-menu .tab {
  text-align: left;
  border-radius: 6px;
  width: 100%;
}

/* Mobile: Dropdown wird inline-Akkordeon (kein floating-Layer), Toggle bleibt
   klickbar, geöffnetes Menü erscheint im Fluss darunter. */
@media (max-width: 767px) {
  .tab-group-menu {
    position: static;
    box-shadow: none;
    padding: 0.15rem 0 0.15rem 0.75rem;
    border-left: 2px solid #e9ecef;
    margin: 0.2rem 0 0.2rem 0.75rem;
    min-width: 0;
    background: transparent;
  }
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-left: 4px solid var(--acker-turquoise);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-label {
  font-size: 0.85rem;
  color: #6C757D;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8f9fa;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.875rem;
  border-bottom: 2px solid #dee2e6;
  white-space: nowrap;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}

tr:hover {
  background: #f8f9fa;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #b0b0b0;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.toggle-switch input:checked + .toggle-slider { background: var(--acker-turquoise); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(24px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.6; cursor: not-allowed; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: #D4EDDA; color: #155724; }
.badge-warning { background: #FFF3CD; color: #856404; }
.badge-danger { background: #F8D7DA; color: #721C24; }
.badge-info { background: #D1ECF1; color: #0C5460; }
.badge-primary { background: rgba(42, 157, 143, 0.1); color: var(--acker-turquoise); }
.badge-secondary { background: rgba(233, 180, 76, 0.2); color: var(--acker-brown); }

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #1A1A1A;
  font-weight: 500;
  font-size: 0.9rem;
}

select, input[type="text"], input[type="search"], input[type="email"], 
input[type="password"], input[type="datetime-local"], input[type="date"], textarea {
  padding: 0.5rem 0.75rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  width: 100%;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--acker-turquoise);
}

/* Filters */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6C757D;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6C757D;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
}

/* Device Cards */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.device-card {
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s;
}

.device-card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-color: var(--acker-turquoise);
}

.device-card.selected {
  border-color: var(--acker-turquoise);
  background-color: rgba(42, 157, 143, 0.05);
}

/* Checkboxes */
.checkbox-custom {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.checkbox-custom:checked {
  background-color: var(--acker-turquoise);
  border-color: var(--acker-turquoise);
}

.checkbox-custom:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: #6C757D;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: var(--acker-turquoise);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success { background: #D4EDDA; color: #155724; border-left: 4px solid #28A745; }
.alert-warning { background: #FFF3CD; color: #856404; border-left: 4px solid #FFC107; }
.alert-danger { background: #F8D7DA; color: #721C24; border-left: 4px solid #DC3545; }
.alert-info { background: #D1ECF1; color: #0C5460; border-left: 4px solid #17A2B8; }

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.login-card {
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 100%;
}

.login-card h2 {
  color: var(--primary);
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.75rem;
}

/* Scroll-to-top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--acker-turquoise);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: #238276;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Stacked Table */
.table-stack-wrapper {
  overflow-x: auto;
}

@media (max-width: 768px) {
  .table-stack-wrapper {
    overflow-x: unset;
  }

  .table-stack-wrapper table,
  .table-stack-wrapper thead,
  .table-stack-wrapper tbody,
  .table-stack-wrapper th,
  .table-stack-wrapper td,
  .table-stack-wrapper tr {
    display: block;
    width: 100%;
  }

  .table-stack-wrapper thead {
    display: none;
  }

  .table-stack-wrapper tr {
    background: white;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }

  .table-stack-wrapper tr:hover {
    background: white;
  }

  .table-stack-wrapper td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
    white-space: normal;
    gap: 0.5rem;
  }

  .table-stack-wrapper td:last-child {
    border-bottom: none;
    padding-top: 0.5rem;
  }

  .table-stack-wrapper td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6C757D;
    font-size: 0.75rem;
    flex-shrink: 0;
    min-width: 85px;
  }

  .table-stack-wrapper td[data-label=""] {
    justify-content: flex-end;
  }

  .table-stack-wrapper td[data-label=""]::before {
    display: none;
  }
}

/* Burger Menu (Desktop: hidden) */
.mobile-nav-bar {
  display: none;
}

.burger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Responsive - Mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* Header */
  .header {
    padding: 0.625rem 1rem;
  }

  .header-content {
    gap: 0.5rem;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  /* Subtitle "KLJB Bundestreffen 2026" ausblenden */
  .header-content p {
    display: none;
  }

  /* Benutzername ausblenden — spart Platz */
  #currentUsername {
    display: none;
  }

  /* Container */
  .container {
    padding: 0.75rem;
  }

  /* Burger Bar */
  .mobile-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }

  .mobile-current-page {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
  }

  .burger-btn {
    min-height: auto;
  }

  /* Tabs — Dropdown-Menü auf Mobile */
  .tabs {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow-x: unset;
    -webkit-overflow-scrolling: unset;
    scroll-snap-type: unset;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  }

  .tabs.mobile-open {
    display: flex;
  }

  .tab {
    width: 100%;
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    flex-shrink: unset;
    scroll-snap-align: unset;
    white-space: normal;
  }

  /* Stats Grid — 2 Spalten auf mittlerem Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  /* Cards */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    gap: 0.625rem;
  }

  .card-header > .btn {
    width: 100%;
    justify-content: center;
  }

  .card-title {
    font-size: 1.05rem;
  }

  /* Buttons — Mindest-Tappgröße 44px */
  .btn {
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  /* Filters */
  .filters {
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1rem;
  }

  .filter-group {
    width: 100%;
    min-width: unset;
  }

  /* Tables */
  th {
    padding: 0.75rem 0.625rem;
    font-size: 0.8rem;
  }

  td {
    padding: 0.625rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Modals — von unten einblenden */
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  /* Push-Seite: Inline-Modals (Template, Liste, Empfänger-Vorschau) */
  #templateModal,
  #listModal,
  #recipientPreviewModal {
    align-items: flex-end !important;
  }

  #templateModal > div,
  #listModal > div,
  #recipientPreviewModal > div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px 16px 0 0 !important;
  }

  /* Devices Grid */
  .devices-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Login */
  .login-card {
    padding: 2rem 1.25rem;
    margin: 1rem;
    border-radius: 12px;
    max-width: calc(100% - 2rem);
  }

  .login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Push-Seite: 2-Spalten-Grid → 1 Spalte */
  .push-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* Push Listen-Modal: 2-Spalten-Formular → 1 Spalte */
  .list-modal-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 0.8rem;
  }
}

/* Utility */
.hidden { display: none !important; }
.text-muted { color: #6C757D; }
.text-small { font-size: 0.875rem; }
.font-bold { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ===== NEWS MODULE ===== */

/* List */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-list-item {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  transition: box-shadow 0.2s;
}

.news-list-item:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.news-list-item.faq {
  border-left: 4px solid var(--acker-gold);
  background: #fffbf0;
}

.news-list-item.awareness {
  border-left: 4px solid #17a2b8;
  background: #f0fafc;
}

.news-thumb {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.news-thumb-empty {
  width: 100px;
  height: 75px;
  background: #f0f0f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  color: #bbb;
}

.news-list-info {
  flex: 1;
  min-width: 0;
}

.news-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.news-list-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.news-list-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.news-list-excerpt {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.45;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-list-meta {
  font-size: 0.78rem;
  color: #888;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Image area in editor */
.news-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: #f9f9f9;
  border: 2px dashed #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  text-align: center;
}

.news-upload-label:hover {
  border-color: var(--primary);
  background: #f0f7ec;
}

.news-image-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: #f5f5f5;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.news-image-preview img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

.news-image-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Crop modal */
.news-crop-body {
  padding: 0;
  max-height: 65vh;
  overflow: hidden;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-crop-body img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
}

/* Quill overrides */
.ql-toolbar.ql-snow {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: #f9f9f9;
}

.ql-container.ql-snow {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

.ql-editor {
  min-height: 180px;
}

/* Quill link tooltip — prevent overflow on small screens */
.ql-snow .ql-tooltip {
  max-width: calc(100% - 8px);
  white-space: normal;
  word-break: break-all;
}

.ql-snow .ql-tooltip input[type=text] {
  min-width: 0;
  width: 100%;
}

/* ===== TIMETABLE ===== */

.sub-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
}

.sub-tab {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.sub-tab:hover { color: var(--primary); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Day groups */
.tt-day-group { margin-bottom: 1.5rem; }

.tt-day-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

/* Entry item */
.tt-entry-item {
  background: #fff;
  border-radius: 8px;
  border-left: 4px solid #ccc;
  margin-bottom: 0.5rem;
  display: flex;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tt-entry-body {
  flex: 1;
  padding: 0.75rem 1rem;
}

.tt-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.tt-entry-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.tt-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #666;
}

.tt-entry-time,
.tt-entry-location {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.tt-entry-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Category badge (in entry) */
.tt-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

/* Category list */
.tt-cat-list { display: flex; flex-direction: column; gap: 0.5rem; }

.tt-cat-item {
  background: #fff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tt-cat-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tt-cat-icon-preview {
  font-size: 1.25rem !important;
  flex-shrink: 0;
}

.tt-cat-title {
  flex: 1;
  font-weight: 500;
}

.tt-cat-actions {
  display: flex;
  gap: 0.4rem;
}

/* Icon picker button */
.tt-icon-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.tt-icon-btn:hover { border-color: var(--primary); background: #f0f7ec; }

.tt-icon-btn .material-icons { font-size: 1.25rem; color: var(--primary); }

.tt-icon-btn-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  color: #999;
}

/* Icon picker panel */
.tt-icon-panel {
  margin-top: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.tt-icon-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

.tt-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 2px;
  padding: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}

.tt-icon-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  font-size: 0;
  transition: background 0.1s, border-color 0.1s;
}

.tt-icon-cell:hover { background: #f0f7ec; border-color: var(--primary); }
.tt-icon-cell.selected { background: #e8f5e9; border-color: var(--primary); }

.tt-icon-cell .material-icons { font-size: 1.5rem; color: #444; }
.tt-icon-cell.selected .material-icons { color: var(--primary); }

.tt-icon-label {
  font-size: 0.65rem;
  color: #888;
  text-align: center;
  line-height: 1.2;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* form-row helper (side-by-side fields) */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group { flex: 1; }

/* Responsive timetable */
@media (max-width: 600px) {
  .tt-entry-top { flex-wrap: wrap; }
  .tt-entry-actions { width: 100%; justify-content: flex-end; }
  .form-row { flex-direction: column; gap: 0; }
  .tt-icon-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
}

/* Misc */
.text-danger { color: var(--danger); }
.required { color: var(--danger); }

/* Responsive: mobile */
@media (max-width: 600px) {
  .news-thumb,
  .news-thumb-empty {
    width: 72px;
    height: 54px;
  }

  .news-list-header {
    flex-wrap: wrap;
  }

  .news-list-actions {
    order: -1;
    width: 100%;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
  }

  .news-image-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-image-preview img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }

  .news-image-actions {
    flex-direction: row;
  }
}
