/* BOS-Trainer CSS v0.7.2 */

:root {
  --bos-primary: #1a4a6e;
  --bos-primary-dark: #0b1320;
  --bos-bg: #f5f0e6;
  --bos-card-bg: #fff;
  --bos-border: #d0d7de;
  --bos-text: #0b1320;
  --bos-muted: #5a6b7a;
  --bos-success: #059669;
  --bos-error: #dc2626;
  --bos-info: #2563eb;
  --bos-header-height: 60px;
}

/* ============================================================ */
/* DARK MODE THEME - Hohe Spezifität */
/* ============================================================ */

/* CSS Variablen für Dark Mode */
html[data-theme="dark"],
html[data-theme="dark"] body,
body.bos-theme-dark,
body[data-theme="dark"] {
  --bos-bg: #1a1a2e;
  --bos-card-bg: #16213e;
  --bos-border: #3a4a5e;
  --bos-text: #e8e8e8;
  --bos-muted: #a0a8b4;
  --bos-primary: #3d7eaa;
  --bos-primary-dark: #2a5a7e;
}

/* Hintergrund für html und body im Dark Mode */
html[data-theme="dark"],
html[data-theme="dark"] body,
body.bos-theme-dark,
body[data-theme="dark"],
body.bos-page.bos-theme-dark,
body.bos-page[data-theme="dark"] {
  background-color: #1a1a2e !important;
  background: #1a1a2e !important;
  color: #e8e8e8 !important;
}

/* Main Content Area im Dark Mode */
html[data-theme="dark"] .bos-main,
body.bos-theme-dark .bos-main,
body[data-theme="dark"] .bos-main {
  background-color: #1a1a2e !important;
}

/* Cards im Dark Mode */
html[data-theme="dark"] .bos-card,
html[data-theme="dark"] .bos-subcard,
body.bos-theme-dark .bos-card,
body.bos-theme-dark .bos-subcard,
body[data-theme="dark"] .bos-card,
body[data-theme="dark"] .bos-subcard {
  background-color: #16213e !important;
  border-color: #3a4a5e !important;
  color: #e8e8e8 !important;
}

/* Sidebar im Dark Mode */
html[data-theme="dark"] .bos-sidebar-nav,
body.bos-theme-dark .bos-sidebar-nav,
body[data-theme="dark"] .bos-sidebar-nav {
  background-color: #16213e !important;
  border-color: #3a4a5e !important;
}

html[data-theme="dark"] .bos-sidebar-nav__link,
body.bos-theme-dark .bos-sidebar-nav__link,
body[data-theme="dark"] .bos-sidebar-nav__link {
  color: #e8e8e8 !important;
}

html[data-theme="dark"] .bos-sidebar-nav__link:hover,
body.bos-theme-dark .bos-sidebar-nav__link:hover,
body[data-theme="dark"] .bos-sidebar-nav__link:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .bos-sidebar-nav__link--active,
body.bos-theme-dark .bos-sidebar-nav__link--active,
body[data-theme="dark"] .bos-sidebar-nav__link--active {
  background-color: #3d7eaa !important;
  color: #fff !important;
}

/* Formulare im Dark Mode */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
body.bos-theme-dark input,
body.bos-theme-dark select,
body.bos-theme-dark textarea,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background-color: #1e2a3d !important;
  border-color: #3a4a5e !important;
  color: #e8e8e8 !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
body.bos-theme-dark input:focus,
body.bos-theme-dark select:focus,
body.bos-theme-dark textarea:focus,
body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
  border-color: #3d7eaa !important;
  outline: none;
}

/* Tabellen im Dark Mode */
html[data-theme="dark"] .bos-table th,
html[data-theme="dark"] .bos-table td,
body.bos-theme-dark .bos-table th,
body.bos-theme-dark .bos-table td,
body[data-theme="dark"] .bos-table th,
body[data-theme="dark"] .bos-table td {
  border-color: #3a4a5e !important;
  color: #e8e8e8 !important;
}

html[data-theme="dark"] .bos-table th,
body.bos-theme-dark .bos-table th,
body[data-theme="dark"] .bos-table th {
  background-color: #1e2a3d !important;
}

html[data-theme="dark"] .bos-table tr:hover,
body.bos-theme-dark .bos-table tr:hover,
body[data-theme="dark"] .bos-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Alerts im Dark Mode */
html[data-theme="dark"] .bos-alert--info,
body.bos-theme-dark .bos-alert--info,
body[data-theme="dark"] .bos-alert--info {
  background-color: #1e3a5f !important;
  border-color: #3d7eaa !important;
  color: #e8e8e8 !important;
}

html[data-theme="dark"] .bos-alert--ok,
body.bos-theme-dark .bos-alert--ok,
body[data-theme="dark"] .bos-alert--ok {
  background-color: #064e3b !important;
  border-color: #059669 !important;
  color: #e8e8e8 !important;
}

html[data-theme="dark"] .bos-alert--error,
body.bos-theme-dark .bos-alert--error,
body[data-theme="dark"] .bos-alert--error {
  background-color: #450a0a !important;
  border-color: #dc2626 !important;
  color: #e8e8e8 !important;
}

/* Text im Dark Mode */
html[data-theme="dark"] .bos-muted,
body.bos-theme-dark .bos-muted,
body[data-theme="dark"] .bos-muted {
  color: #a0a8b4 !important;
}

html[data-theme="dark"] .bos-link,
html[data-theme="dark"] a,
body.bos-theme-dark .bos-link,
body.bos-theme-dark a,
body[data-theme="dark"] .bos-link,
body[data-theme="dark"] a {
  color: #6db3e8 !important;
}

/* Buttons im Dark Mode */
html[data-theme="dark"] .bos-btn,
body.bos-theme-dark .bos-btn,
body[data-theme="dark"] .bos-btn {
  background-color: #3d7eaa !important;
  border-color: #3d7eaa !important;
}

html[data-theme="dark"] .bos-btn:hover,
body.bos-theme-dark .bos-btn:hover,
body[data-theme="dark"] .bos-btn:hover {
  background-color: #2a5a7e !important;
}

html[data-theme="dark"] .bos-btn--secondary,
body.bos-theme-dark .bos-btn--secondary,
body[data-theme="dark"] .bos-btn--secondary {
  background-color: transparent !important;
  color: #e8e8e8 !important;
  border-color: #3a4a5e !important;
}

/* Tabs im Dark Mode */
html[data-theme="dark"] .bos-tabs button,
body.bos-theme-dark .bos-tabs button,
body[data-theme="dark"] .bos-tabs button {
  color: #a0a8b4 !important;
}

html[data-theme="dark"] .bos-tabs button.active,
body.bos-theme-dark .bos-tabs button.active,
body[data-theme="dark"] .bos-tabs button.active {
  color: #e8e8e8 !important;
  border-bottom-color: #3d7eaa !important;
}

/* Trennlinien im Dark Mode */
html[data-theme="dark"] hr,
body.bos-theme-dark hr,
body[data-theme="dark"] hr {
  border-color: #3a4a5e !important;
}

/* Header Dropdown im Dark Mode */
html[data-theme="dark"] .bos-header__dropdown-menu,
body.bos-theme-dark .bos-header__dropdown-menu,
body[data-theme="dark"] .bos-header__dropdown-menu {
  background-color: #16213e !important;
  border-color: #3a4a5e !important;
}

html[data-theme="dark"] .bos-header__dropdown-item,
body.bos-theme-dark .bos-header__dropdown-item,
body[data-theme="dark"] .bos-header__dropdown-item {
  color: #e8e8e8 !important;
}

html[data-theme="dark"] .bos-header__dropdown-item:hover,
body.bos-theme-dark .bos-header__dropdown-item:hover,
body[data-theme="dark"] .bos-header__dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}
}

/* ============================================================ */
/* THEME OVERRIDE - Versteckt Theme Header/Footer auf BOS-Seiten */
/* ============================================================ */

/* Block Themes (Twenty Twenty-Five, etc.) */
body.bos-page .wp-site-blocks > header,
body.bos-page .wp-site-blocks > footer,
body.bos-page .wp-site-blocks > .wp-block-template-part,
body.bos-page header.wp-block-template-part,
body.bos-page footer.wp-block-template-part {
  display: none !important;
}

/* Twenty Twenty-Five spezifisch */
body.bos-page .wp-block-group.has-global-padding,
body.bos-page .wp-block-template-part.site-header,
body.bos-page .wp-block-template-part.site-footer {
  display: none !important;
}

/* Alle Header/Footer Elemente im Block Theme */
body.bos-page [class*="header"]:not(.bos-header):not([class*="bos-"]),
body.bos-page [class*="footer"]:not(.bos-footer):not([class*="bos-"]) {
  display: none !important;
}

/* Classic Themes */
body.bos-page #masthead,
body.bos-page #colophon,
body.bos-page .site-header,
body.bos-page .site-footer,
body.bos-page #site-header,
body.bos-page #site-footer,
body.bos-page > header:not(.bos-header),
body.bos-page > footer:not(.bos-footer) {
  display: none !important;
}

/* Theme Navigation verstecken */
body.bos-page .wp-block-navigation,
body.bos-page #site-navigation,
body.bos-page .main-navigation,
body.bos-page nav.primary-menu,
body.bos-page nav[class*="navigation"] {
  display: none !important;
}

/* WordPress Admin Bar - Position korrigieren wenn eingeloggt */
body.bos-page.admin-bar .bos-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.bos-page.admin-bar .bos-header {
    top: 46px;
  }
}

/* Theme-Container auf volle Breite */
body.bos-page .wp-site-blocks,
body.bos-page .site-content,
body.bos-page #content,
body.bos-page .content-area,
body.bos-page main#main,
body.bos-page .entry-content,
body.bos-page article.page,
body.bos-page .wp-block-post-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ============================================================ */
/* GLOBAL LAYOUT */
/* ============================================================ */

body.bos-page {
  margin: 0;
  padding: 0;
  background: var(--bos-bg);
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--bos-text);
  /* Sticky Footer: Flexbox Layout */
  display: flex;
  flex-direction: column;
}

/* Header/Topbar */
.bos-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bos-primary);
  height: var(--bos-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bos-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.bos-header__logo img {
  height: 36px;
  width: auto;
}
.bos-header__logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.bos-header__search {
  flex: 0 1 400px;
  position: relative;
}
.bos-header__search-form {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
}
.bos-header__search input {
  width: 100%;
  padding: 8px 40px 8px 16px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}
.bos-header__search input::placeholder { color: rgba(255,255,255,0.7); }
.bos-header__search input:focus {
  outline: none;
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}
.bos-header__search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.7);
  pointer-events: none;
  z-index: 2;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bos-header__welcome {
  color: rgba(255,255,255,0.95);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.bos-header__nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.bos-header__link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.bos-header__link:hover { background: rgba(255,255,255,0.15); }
.bos-header__separator { color: rgba(255,255,255,0.5); }

/* Username im Header */
.bos-header__username {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  margin-right: 8px;
}

/* User Info Container (Name + Organisation) */
.bos-header__user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 8px;
  line-height: 1.3;
}
.bos-header__user-info .bos-header__username {
  margin-right: 0;
}
.bos-header__org-name {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 400;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown-Menü im Header */
.bos-header__dropdown {
  position: relative;
}
.bos-header__dropdown-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.bos-header__dropdown-btn:hover {
  background: rgba(255,255,255,0.2);
}
.bos-header__dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
}
.bos-header__dropdown:hover .bos-header__dropdown-menu,
.bos-header__dropdown:focus-within .bos-header__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.bos-header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--bos-text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s ease;
}
.bos-header__dropdown-item:first-child {
  border-radius: 10px 10px 0 0;
}
.bos-header__dropdown-item:last-child {
  border-radius: 0 0 10px 10px;
}
.bos-header__dropdown-item:hover {
  background: var(--bos-bg);
}
.bos-header__dropdown-item svg {
  flex-shrink: 0;
  color: var(--bos-muted);
}
.bos-header__dropdown-item--danger {
  color: var(--bos-error);
}
.bos-header__dropdown-item--danger svg {
  color: var(--bos-error);
}
.bos-header__dropdown-divider {
  height: 1px;
  background: var(--bos-border);
  margin: 4px 0;
}

/* Status Banner */
.bos-status-banner {
  color: white;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  position: relative;
  z-index: 999;
}

body.admin-bar .bos-status-banner {
  /* Kein Top-Offset nötig, da Banner unter Header ist */
}

/* Page Wrapper - füllt den Raum zwischen Header und Footer */
.bos-page-wrapper {
  display: flex;
  flex: 1;
  min-height: 0; /* wichtig für flexbox overflow */
}

/* Footer - bleibt immer unten */
.bos-footer {
  background: #fff;
  border-top: 1px solid var(--bos-border);
  padding: 16px 24px;
  font-size: 13px;
  color: var(--bos-muted);
  margin-top: auto; /* Sticky Footer: drückt Footer nach unten */
}
.bos-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.bos-footer__left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.bos-footer__left a {
  color: var(--bos-muted);
  text-decoration: none;
}
.bos-footer__left a:hover { color: var(--bos-primary); text-decoration: underline; }
.bos-footer__left span { color: var(--bos-border); }
.bos-footer__center {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bos-footer__center a {
  color: var(--bos-primary);
  text-decoration: none;
  font-weight: 500;
}
.bos-footer__center a:hover { text-decoration: underline; }
.bos-footer__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.bos-footer__copyright {
  color: var(--bos-muted);
}
.bos-footer__version {
  color: var(--bos-muted);
  font-size: 12px;
}

/* Legacy support for old footer structure */
.bos-footer__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bos-footer__links a {
  color: var(--bos-muted);
  text-decoration: none;
}
.bos-footer__links a:hover { color: var(--bos-primary); text-decoration: underline; }
.bos-footer__links span { color: var(--bos-border); }
.bos-footer__bottom {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================ */
/* SIDEBAR (eingeloggt) */
/* ============================================================ */

.bos-sidebar-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--bos-card-bg);
  border-right: 1px solid var(--bos-border);
  padding: 20px 0;
  overflow-y: auto;
}
.bos-sidebar-nav__section { margin-bottom: 24px; padding: 0 16px; }
.bos-sidebar-nav__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bos-primary);
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--bos-primary);
}
.bos-sidebar-nav__link {
  display: block;
  padding: 5px 0 5px 12px;
  color: var(--bos-text);
  text-decoration: none;
  font-size: 13px;
  position: relative;
}
.bos-sidebar-nav__link::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--bos-muted);
}
.bos-sidebar-nav__link:hover { color: var(--bos-primary); }
.bos-sidebar-nav__link--active { 
  font-weight: 700; 
  color: var(--bos-primary);
}

/* Main Content Area */
.bos-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

/* ============================================================ */
/* CONTAINER & CARDS */
/* ============================================================ */

.bos-container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--bos-text);
}
.bos-container--wide { max-width: 1200px; }
.bos-container--full { max-width: none; margin: 0; padding: 0; }

/* Old Layout (Kompatibilität) */
.bos-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .bos-layout { grid-template-columns: 1fr; }
}

/* Sidebar (innerhalb Card) */
.bos-sidebar {
  background: var(--bos-card-bg);
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  padding: 16px;
  height: fit-content;
}
.bos-sidebar__section { margin-bottom: 20px; }
.bos-sidebar__section:last-child { margin-bottom: 0; }
.bos-sidebar__section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--bos-primary);
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--bos-primary);
}
.bos-sidebar__link {
  display: block;
  padding: 4px 0;
  color: var(--bos-text);
  text-decoration: none;
  font-size: 13px;
}
.bos-sidebar__link:hover { color: var(--bos-primary); }
.bos-sidebar__link--active { font-weight: 700; color: var(--bos-primary); }

/* Main */
.bos-main { min-width: 0; }

/* Card */
.bos-card {
  background: var(--bos-card-bg);
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  padding: 20px;
}
.bos-subcard {
  background: #f7f9fb;
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

/* Typography */
h2 {
  margin: 0 0 16px 0;
  font-size: 22px;
  color: var(--bos-primary);
  text-decoration: underline;
}
h3 {
  margin: 20px 0 12px 0;
  font-size: 16px;
  color: var(--bos-primary);
}

/* Row */
.bos-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bos-row--space { justify-content: space-between; }

/* Forms */
label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bos-primary);
  box-shadow: 0 0 0 2px rgba(26, 74, 110, 0.1);
}
input:disabled { background: #f3f4f6; color: var(--bos-muted); }
hr { border: none; border-top: 1px solid var(--bos-border); margin: 20px 0; }

/* Buttons */
.bos-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--bos-primary-dark);
  background: var(--bos-primary-dark);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.bos-btn:hover { background: var(--bos-primary); border-color: var(--bos-primary); }
.bos-btn--secondary { background: #fff; color: var(--bos-primary-dark); }
.bos-btn--secondary:hover { background: #f3f4f6; }
.bos-btn--small { padding: 6px 12px; font-size: 0.85em; }
.bos-btn--danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.bos-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }
.bos-btn--success { background: #059669; border-color: #059669; color: #fff; }
.bos-btn--success:hover { background: #047857; border-color: #047857; }
.bos-btn--small { padding: 6px 12px; font-size: 13px; }
.bos-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Alerts */
.bos-alert { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-size: 14px; }
.bos-alert--error { background: #fff1f2; border: 1px solid #fecdd3; color: var(--bos-error); }
.bos-alert--ok, .bos-alert--success { background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--bos-success); }
.bos-alert--info { background: #eff6ff; border: 1px solid #bfdbfe; color: var(--bos-info); }

/* Muted */
.bos-muted { color: var(--bos-muted); font-size: 13px; }

/* Links */
.bos-link { color: var(--bos-primary-dark); text-decoration: underline; }
.bos-link:hover { color: var(--bos-primary); }

/* Tables */
.bos-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.bos-table th, .bos-table td { border: 1px solid var(--bos-border); padding: 10px 12px; text-align: left; }
.bos-table th { background: #f7f9fb; font-weight: 600; }
.bos-table--compact td, .bos-table--compact th { padding: 6px 10px; }
.bos-text-right { text-align: right; }

/* Checkboxes */
.bos-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 8px 0;
  cursor: pointer;
}
.bos-checkbox input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* Function Grid (Profile) */
.bos-function-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  background: #f7f9fb;
  border-radius: 8px;
}
.bos-function-grid .bos-checkbox {
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--bos-border);
  border-radius: 6px;
  font-size: 13px;
}
.bos-function-grid .bos-checkbox:hover { border-color: var(--bos-primary); }
.bos-function-grid .bos-checkbox--selected {
  background: #e0f2fe;
  border-color: var(--bos-primary);
}

/* Badge */
.bos-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: #e5e7eb;
  color: var(--bos-muted);
  margin-left: auto;
}
.bos-badge--default { background: var(--bos-primary); color: #fff; }
.bos-badge--success { background: #d1fae5; color: var(--bos-success); }
.bos-badge--error { background: #fee2e2; color: var(--bos-error); }
.bos-badge--info { background: #dbeafe; color: var(--bos-info); }
.bos-badge--pending { background: #fef9c3; color: #a16207; }

/* Funkspruch-Formular */
.bos-funkspruch-row {
  background: #f8fafc;
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.bos-funkspruch-row:hover {
  background: #f1f5f9;
}
.bos-label-mini {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--bos-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bos-input-mini {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--bos-border);
  border-radius: 6px;
  font-size: 14px;
}
.bos-input-mini:focus {
  border-color: var(--bos-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 64, 94, 0.1);
}
.bos-btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.bos-btn-icon:hover {
  opacity: 1;
  background: #fee2e2;
}

/* Dashboard Grid */
.bos-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 16px 0;
}
.bos-dashboard-section h3 { margin-top: 0; }

/* Quick Actions */
.bos-quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Catalog Grid */
.bos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.bos-catalog-card {
  background: #f7f9fb;
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  padding: 16px;
}
.bos-catalog-card h4 { margin: 0 0 8px 0; font-size: 16px; color: var(--bos-primary); }
.bos-catalog-card__desc { font-size: 13px; color: var(--bos-muted); margin: 8px 0; }

/* Training Stats */
.bos-training-stats {
  display: flex;
  gap: 24px;
  margin: 16px 0;
  padding: 16px;
  background: #f7f9fb;
  border-radius: 8px;
}
.bos-stat { text-align: center; }
.bos-stat__value { display: block; font-size: 28px; font-weight: 700; color: var(--bos-primary); }
.bos-stat__label { font-size: 12px; color: var(--bos-muted); }

/* Filter */
.bos-filter { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.bos-filter label { margin: 0; font-size: 14px; }
.bos-filter select { width: auto; min-width: 200px; }

/* Question */
.bos-question { margin: 20px 0; }
.bos-question__category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bos-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: 12px;
}
.bos-question__text { font-size: 18px; line-height: 1.5; margin-bottom: 20px; }
.bos-question__actions { margin-top: 20px; }

/* Answers */
.bos-answers { display: flex; flex-direction: column; gap: 10px; }
.bos-answer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #f7f9fb;
  border: 2px solid var(--bos-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bos-answer:hover { border-color: var(--bos-primary); background: #fff; }
.bos-answer input { margin-top: 2px; width: 18px; height: 18px; cursor: pointer; }
.bos-answer__text { flex: 1; font-size: 15px; }
.bos-answer--correct { background: #d1fae5; border-color: var(--bos-success); }
.bos-answer--wrong { background: #fee2e2; border-color: var(--bos-error); }

/* Feedback */
.bos-feedback { margin: 20px 0; padding: 16px; background: #f7f9fb; border-radius: 8px; }
.bos-feedback--success { color: var(--bos-success); font-weight: 700; font-size: 18px; }
.bos-feedback--error { color: var(--bos-error); font-weight: 700; font-size: 18px; }
.bos-feedback--info { color: var(--bos-info); font-weight: 600; }

/* Hint */
.bos-hint {
  margin: 16px 0;
  padding: 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 14px;
}

/* Source */
.bos-source { margin: 12px 0; color: var(--bos-muted); }

/* Progress Bar */
.bos-progress { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.bos-progress__bar { height: 100%; background: var(--bos-success); border-radius: 4px; transition: width 0.3s ease; }

/* Tabs */
.bos-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--bos-border); }
.bos-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--bos-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bos-tab:hover { color: var(--bos-primary); }
.bos-tab--active { color: var(--bos-primary); border-bottom-color: var(--bos-primary); }
.bos-tab .bos-badge { font-size: 12px; padding: 2px 6px; }
.bos-tab-content { padding: 16px 0; }

/* Responsive */
@media (max-width: 600px) {
  .bos-container { padding: 0 12px; margin: 16px auto; }
  .bos-card { padding: 16px; }
  .bos-function-grid { grid-template-columns: 1fr; }
  .bos-training-stats { flex-direction: column; gap: 16px; }
  .bos-dashboard-grid { grid-template-columns: 1fr; }
}

/* Form Grid (Question Edit) */
.bos-form-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
.bos-form-main { min-width: 0; }
.bos-form-side { }
@media (max-width: 900px) {
  .bos-form-grid { grid-template-columns: 1fr; }
}

/* Answers List (Admin) */
.bos-answers-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bos-answer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bos-answer-row input[type="checkbox"],
.bos-answer-row input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.bos-answer-input {
  flex: 1;
}

/* Feedback Card */
.bos-feedback-card {
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  border: 2px solid;
}
.bos-feedback-card--correct {
  background: #ecfdf5;
  border-color: var(--bos-success);
}
.bos-feedback-card--wrong {
  background: #fff1f2;
  border-color: var(--bos-error);
}
.bos-feedback-card__header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.bos-feedback-card--correct .bos-feedback-card__header { color: var(--bos-success); }
.bos-feedback-card--wrong .bos-feedback-card__header { color: var(--bos-error); }
.bos-feedback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
}
.bos-feedback-card--correct .bos-feedback-icon { background: var(--bos-success); color: #fff; }
.bos-feedback-card--wrong .bos-feedback-icon { background: var(--bos-error); color: #fff; }
.bos-feedback-card__question {
  font-size: 14px;
  color: var(--bos-muted);
  margin-bottom: 8px;
}
.bos-feedback-card__correct {
  font-size: 14px;
  margin-top: 12px;
}
.bos-feedback-card__correct ul {
  margin: 8px 0 0 20px;
  padding: 0;
}
.bos-feedback-card__correct li { margin: 4px 0; }
.bos-feedback-card__hint {
  font-size: 13px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bos-border);
  color: var(--bos-muted);
}

/* List (simple) */
.bos-list { margin: 0; padding-left: 18px; }
.bos-list li { margin: 4px 0; }

/* ============================================================ */
/* STUNDENPLAN / SCHEDULE */
/* ============================================================ */

.bos-schedule-table { font-size: 13px; }
.bos-schedule-table th { padding: 8px 10px; font-size: 12px; }
.bos-schedule-table td { padding: 8px 10px; vertical-align: top; }

.bos-schedule-month td {
  background: var(--bos-primary) !important;
  color: #fff;
  font-weight: 700;
  padding: 6px 10px !important;
}

.bos-schedule-practice td { background: #fef3c7; }
.bos-schedule-cancelled td { 
  background: #fee2e2; 
  text-decoration: line-through;
  color: var(--bos-muted);
}

.bos-schedule-notes td {
  background: #fffbeb;
  border-top: none !important;
  padding-top: 0 !important;
  font-size: 12px;
  color: var(--bos-muted);
}

/* Module Badge */
.bos-module-badge {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bos-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 6px;
}

/* Instructor Highlight */
.bos-instructor-main { font-weight: 700; color: var(--bos-primary); }

/* Time inputs */
input[type="time"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
input[type="time"]:focus {
  outline: none;
  border-color: var(--bos-primary);
  box-shadow: 0 0 0 2px rgba(26, 74, 110, 0.1);
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
input[type="number"]:focus {
  outline: none;
  border-color: var(--bos-primary);
  box-shadow: 0 0 0 2px rgba(26, 74, 110, 0.1);
}

/* Multi-select styling */
select[multiple] {
  height: auto;
  min-height: 80px;
}

/* Course Status Badges */
.bos-status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
}
.bos-status-badge--draft { background: #e5e7eb; color: var(--bos-muted); }
.bos-status-badge--planned { background: #dbeafe; color: var(--bos-info); }
.bos-status-badge--active { background: #d1fae5; color: var(--bos-success); }
.bos-status-badge--completed { background: #a7f3d0; color: #047857; }
.bos-status-badge--cancelled { background: #fee2e2; color: var(--bos-error); }

/* ============================================================ */
/* RESPONSIVE */
/* ============================================================ */

@media (max-width: 900px) {
  .bos-header { padding: 0 16px; }
  .bos-header__search { display: none; }
  .bos-sidebar-nav { width: 180px; }
}

@media (max-width: 768px) {
  .bos-page-wrapper { flex-direction: column; }
  .bos-sidebar-nav { 
    width: 100%; 
    border-right: none;
    border-bottom: 1px solid var(--bos-border);
    padding: 12px 0;
  }
  .bos-sidebar-nav__section { 
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }
  .bos-sidebar-nav__title { 
    width: 100%;
    margin-bottom: 4px;
  }
  .bos-sidebar-nav__link {
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
  }
  .bos-sidebar-nav__link::before { display: none; }
  .bos-content { padding: 16px; }
  .bos-footer { 
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .bos-header__logo-text { display: none; }
  .bos-container { padding: 0 12px; margin: 16px auto; }
  .bos-card { padding: 16px; }
  .bos-function-grid { grid-template-columns: 1fr; }
  .bos-training-stats { flex-direction: column; gap: 16px; }
  .bos-dashboard-grid { grid-template-columns: 1fr; }
}

/* ============================================================ */
/* APP WRAPPER (für vollständiges Layout) */
/* ============================================================ */

.bos-app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bos-bg);
}

.bos-app-wrapper .bos-page-wrapper {
  flex: 1;
  display: flex;
}

.bos-app-wrapper .bos-content {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

/* Tabs als Links */
.bos-tabs a.bos-tab {
  text-decoration: none;
}

/* ============================================================ */
/* STARTSEITE / LANDING PAGE */
/* ============================================================ */

.bos-home {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 40px 24px;
  min-height: calc(100vh - var(--bos-header-height) - 60px);
  overflow-x: hidden;
}

.bos-home__card {
  background: var(--bos-card-bg);
  border: 1px solid var(--bos-border);
  border-radius: 12px;
  padding: 40px 48px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.bos-home__hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.bos-home__logo {
  flex-shrink: 0;
}

.bos-home__logo img {
  width: 180px;
  height: auto;
  max-width: 100%;
}

.bos-home__logo-fallback {
  font-size: 80px;
  display: block;
  line-height: 1;
}

.bos-home__claim {
  flex: 1;
}

.bos-home__tagline {
  color: var(--bos-primary);
  font-size: 1.25rem;
  margin: 0 0 12px 0;
}

.bos-home__claim p {
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.bos-home__title {
  color: var(--bos-primary);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 24px 0;
  letter-spacing: 0.05em;
}

.bos-home__content {
  margin-bottom: 32px;
}

.bos-home__content p {
  margin: 0 0 16px 0;
  line-height: 1.7;
}

.bos-home__orgs-intro {
  font-weight: 500;
  margin-bottom: 8px !important;
}

.bos-home__orgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0 24px 0;
  padding: 20px;
  background: var(--bos-bg-muted);
  border-radius: 12px;
  max-width: 100%;
  overflow-x: hidden;
}

.bos-home__org-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--bos-border);
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

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

.bos-home__org-card--link:hover {
  border-color: var(--bos-primary);
  cursor: pointer;
}

.bos-home__org-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.bos-home__org-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bos-home__org-name {
  font-weight: 600;
  color: var(--bos-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bos-home__org-subtitle {
  font-size: 0.8rem;
  color: var(--bos-muted);
}

.bos-home__org-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  flex-shrink: 0;
}

.bos-home__org-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--bos-muted);
  background: var(--bos-bg-muted);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.bos-home__org-stat-icon {
  font-size: 0.7rem;
}

@media (max-width: 600px) {
  .bos-home__orgs {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  
  .bos-home__org-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
    gap: 8px;
  }
  
  .bos-home__org-icon {
    font-size: 2rem;
    width: auto;
  }
  
  .bos-home__org-info {
    align-items: center;
  }
  
  .bos-home__org-name {
    white-space: normal;
    text-align: center;
  }
  
  .bos-home__org-stats {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  .bos-home__org-card {
    padding: 14px 10px;
  }
  
  .bos-home__org-icon {
    font-size: 1.8rem;
  }
}

.bos-home__motto {
  color: var(--bos-primary);
  font-size: 1.1rem;
}

.bos-home__cta {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--bos-border);
}

.bos-home__cta p {
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.bos-home__buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.bos-home__buttons .bos-btn {
  padding: 12px 28px;
  font-size: 1rem;
}

.bos-btn--primary {
  background: var(--bos-primary);
  color: #fff;
  border-color: var(--bos-primary);
}

.bos-btn--primary:hover {
  background: var(--bos-primary-dark);
  border-color: var(--bos-primary-dark);
}

/* ============================================================
   NEUES STARTSEITEN-LAYOUT (Side-by-Side)
   ============================================================ */
.bos-home__top-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  max-width: 1200px;
  width: 100%;
  align-items: start;
}

/* Vertikale Emergency-Card (linke Spalte) */
.bos-emergency-card--vertical {
  margin-bottom: 0;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.bos-emergency-card--vertical .bos-emergency-card__title {
  font-size: 1rem;
  padding-bottom: 10px;
}

.bos-emergency-card--vertical .bos-emergency-card__numbers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bos-emergency-card--vertical .bos-emergency-number {
  text-decoration: none;
  color: inherit;
  padding: 14px 12px;
}

.bos-emergency-card--vertical .bos-emergency-number:hover {
  border-color: var(--bos-primary);
}

.bos-emergency-card--vertical .bos-emergency-number__digits {
  font-size: 1.8rem;
}

.bos-emergency-card--vertical .bos-emergency-number--medical .bos-emergency-number__digits {
  font-size: 1.5rem;
}

/* Instagram-Feed (volle Breite) */
.bos-home__instagram {
  background: var(--bos-card-bg);
  border: 1px solid var(--bos-border);
  border-radius: 12px;
  padding: 24px 32px;
  max-width: 1200px;
  width: 100%;
  margin-top: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.bos-home__instagram-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  color: var(--bos-primary);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bos-border);
}

.bos-home__instagram-icon {
  font-size: 1.5rem;
}

.bos-home__instagram-link {
  color: #E1306C;
  text-decoration: none;
  font-weight: 600;
  margin-left: auto;
  font-size: 1rem;
}

.bos-home__instagram-link:hover {
  text-decoration: underline;
}

.bos-home__instagram-feed {
  min-height: 200px;
}

.bos-home__instagram-placeholder {
  text-align: center;
  padding: 40px 20px;
  background: #f8fafc;
  border-radius: 8px;
  color: var(--bos-muted);
}

.bos-home__instagram-placeholder p {
  margin: 0 0 16px 0;
}

/* Responsive Startseite */
@media (max-width: 900px) {
  .bos-home__top-row {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
    padding: 0;
  }
  
  .bos-emergency-card--vertical {
    position: static;
    order: 2; /* Notrufnummern nach dem Hauptinhalt */
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .bos-home__card {
    order: 1; /* Hauptinhalt zuerst */
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Notrufnummern bleiben vertikal untereinander - KEIN horizontales Scrollen */
  .bos-emergency-card--vertical .bos-emergency-card__numbers {
    flex-direction: column;
    gap: 12px;
  }
  
  .bos-emergency-card--vertical .bos-emergency-number {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .bos-home {
    padding: 16px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .bos-home__top-row {
    width: 100%;
    max-width: 100%;
  }
  
  .bos-home__card {
    padding: 20px 16px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .bos-emergency-card--vertical {
    padding: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .bos-home__instagram {
    padding: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .bos-home__instagram-title {
    flex-wrap: wrap;
    font-size: 1rem;
  }
  
  .bos-home__instagram-link {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
  
  .bos-home__hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .bos-home__logo img {
    width: 100px;
  }
  
  .bos-home__title {
    font-size: 1.5rem;
    text-align: center;
  }
  
  .bos-home__tagline {
    font-size: 1.1rem;
  }
  
  .bos-home__buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  
  .bos-home__buttons .bos-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}

@media (max-width: 480px) {
  /* Zusätzliche Anpassungen für sehr kleine Bildschirme */
}

/* Star Rating für Feedback */
.bos-star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.bos-star-rating label {
  cursor: pointer;
  padding: 0 2px;
}

.bos-star-rating label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bos-star-rating label .star {
  font-size: 24px;
  color: #d1d5db;
  transition: color 0.15s;
}

.bos-star-rating label:hover .star,
.bos-star-rating label:hover ~ label .star {
  color: #fbbf24;
}

.bos-star-rating input:checked ~ .star,
.bos-star-rating label:has(input:checked) .star,
.bos-star-rating label:has(input:checked) ~ label .star {
  color: #f59e0b;
}

/* Fallback für Browser ohne :has() */
.bos-star-rating input:checked + .star {
  color: #f59e0b;
}

.bos-stars {
  color: #f59e0b;
  letter-spacing: 2px;
}

/* ============================================================ */
/* MODAL STYLES */
/* ============================================================ */

.bos-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bos-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.bos-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bos-border);
  background: #f9fafb;
  border-radius: 12px 12px 0 0;
}

.bos-modal-header h3 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 600;
}

.bos-modal-close {
  font-size: 24px;
  line-height: 1;
  color: var(--bos-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.bos-modal-close:hover {
  background: #e5e7eb;
  color: var(--bos-text);
}

.bos-modal-body {
  padding: 20px;
}

.bos-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--bos-border);
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

/* Modal Form Styling */
.bos-modal form {
  margin: 0;
}

.bos-modal label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
  font-size: 0.9em;
}

.bos-modal input[type="text"],
.bos-modal input[type="date"],
.bos-modal input[type="email"],
.bos-modal select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  font-size: 14px;
}

/* Functions Grid im Modal */
.bos-functions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 500px) {
  .bos-functions-grid {
    grid-template-columns: 1fr;
  }
}

/* Bild-Upload Komponente */
.bos-image-upload {
  margin-bottom: 16px;
}
.bos-image-preview {
  margin-bottom: 10px;
  padding: 8px;
  background: #f7f9fb;
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  text-align: center;
}
.bos-image-preview img {
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}
.bos-image-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bos-btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

/* Fragen-Bild im Training */
.bos-question__image {
  text-align: center;
  margin: 12px 0;
}
.bos-question__image img {
  border: 1px solid var(--bos-border);
}

/* Feedback-Bild */
.bos-feedback-card__hint-image {
  text-align: center;
  margin-top: 12px;
}
.bos-feedback-card__hint-image img {
  border: 1px solid var(--bos-border);
}

/* Wiki Typ-Selektor */
.bos-wiki-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bos-wiki-header-left h2 {
  margin: 0;
}
.bos-wiki-type-select {
  padding: 6px 12px;
  border: 1px solid var(--bos-border);
  border-radius: 6px;
  background: var(--bos-bg);
  color: var(--bos-text);
  font-size: 14px;
  cursor: pointer;
}
.bos-wiki-type-select:hover {
  border-color: var(--bos-primary);
}
.bos-wiki-type-select:focus {
  outline: none;
  border-color: var(--bos-primary);
  box-shadow: 0 0 0 2px rgba(15, 87, 117, 0.1);
}

/* ===== Organisations-Verzeichnis ===== */
.bos-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.bos-breadcrumb a {
  color: var(--bos-primary);
  text-decoration: none;
}
.bos-breadcrumb a:hover {
  text-decoration: underline;
}
.bos-breadcrumb__sep {
  color: var(--bos-muted);
}

.bos-directory__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.bos-directory__icon {
  font-size: 3rem;
  line-height: 1;
}
.bos-directory__title h1 {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
}
.bos-directory__motto {
  color: var(--bos-primary);
  font-style: italic;
  margin: 0;
}
.bos-directory__stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--bos-muted);
  font-size: 14px;
}
.bos-directory__search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.bos-directory__search .bos-input {
  flex: 1;
  min-width: 200px;
}
.bos-directory__categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}
.bos-directory__category {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bos-bg-alt, #f7f9fb);
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--bos-text);
  transition: all 0.15s ease;
}
.bos-directory__category:hover {
  border-color: var(--bos-primary);
  background: var(--bos-bg);
  transform: translateX(4px);
}
.bos-directory__category-icon {
  font-size: 2rem;
  line-height: 1;
}
.bos-directory__category-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bos-directory__category-name {
  font-weight: 600;
  font-size: 1rem;
}
.bos-directory__category-stats {
  font-size: 13px;
  color: var(--bos-muted);
}
.bos-directory__category-arrow {
  font-size: 1.5rem;
  color: var(--bos-muted);
}
.bos-directory__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
}
.bos-directory__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bos-bg);
  border: 1px solid var(--bos-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--bos-text);
  transition: all 0.15s ease;
}
.bos-directory__item:hover {
  border-color: var(--bos-primary);
  background: var(--bos-bg-alt, #f7f9fb);
}
.bos-directory__item-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.bos-directory__item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bos-directory__item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bos-directory__item-city {
  font-size: 13px;
  color: var(--bos-muted);
}
.bos-directory__item-stats {
  font-size: 13px;
  color: var(--bos-muted);
}
.bos-directory__item-arrow {
  font-size: 1.2rem;
  color: var(--bos-muted);
}
.bos-directory__cta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--bos-border);
  text-align: center;
}
.bos-directory__cta p {
  margin: 0 0 12px 0;
  color: var(--bos-muted);
}

/* Öffentliche Org-Detailseite */
.bos-org-public__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.bos-org-public__icon {
  font-size: 3.5rem;
  line-height: 1;
}
.bos-org-public__title h1 {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
}
.bos-org-public__info {
  margin: 20px 0;
  padding: 16px;
  background: var(--bos-bg-alt, #f7f9fb);
  border-radius: 10px;
}
.bos-org-public__info h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
}
.bos-org-public__info p {
  margin: 0;
  line-height: 1.6;
}
.bos-org-public__details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
}
.bos-org-public__detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 200px;
}
.bos-org-public__detail-icon {
  font-size: 1.2rem;
}
.bos-org-public__vehicles {
  margin: 24px 0;
}
.bos-org-public__vehicles h3 {
  margin: 0 0 12px 0;
}
.bos-org-public__vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.bos-org-public__vehicle {
  background: var(--bos-bg-alt, #f7f9fb);
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}
.bos-org-public__vehicle img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}
.bos-org-public__vehicle-placeholder {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--bos-bg);
}
.bos-org-public__vehicle-name {
  padding: 8px;
  font-weight: 600;
  font-size: 14px;
}
.bos-org-public__vehicle-callsign {
  padding: 0 8px 8px;
  font-size: 12px;
  color: var(--bos-muted);
}
.bos-org-public__donation,
.bos-org-public__membership {
  margin: 24px 0;
  padding: 16px;
  background: var(--bos-bg-alt, #f7f9fb);
  border-radius: 10px;
}
.bos-org-public__donation h3,
.bos-org-public__membership h3 {
  margin: 0 0 10px 0;
}
.bos-org-public__donation p,
.bos-org-public__membership p {
  margin: 0 0 12px 0;
}
.bos-org-public__cta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--bos-border);
  text-align: center;
}
.bos-org-public__cta p {
  margin: 0 0 12px 0;
  color: var(--bos-muted);
}

/* Responsive Verzeichnis */
@media (max-width: 600px) {
  .bos-directory__header {
    flex-direction: column;
    text-align: center;
  }
  .bos-directory__stats {
    justify-content: center;
  }
  .bos-directory__search {
    flex-direction: column;
  }
  .bos-directory__search .bos-input {
    min-width: 0;
  }
  .bos-org-public__header {
    flex-direction: column;
    text-align: center;
  }
  .bos-org-public__details {
    flex-direction: column;
  }
  .bos-org-public__vehicles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   EMERGENCY NUMBERS CARD (Startseite)
   ============================================================ */
.bos-emergency-card {
  background: #fff;
  border: 1px solid var(--bos-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.bos-emergency-card__title {
  text-align: center;
  font-size: 1.1rem;
  margin: 0 0 16px 0;
  color: var(--bos-primary);
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bos-border);
}

.bos-emergency-card__numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bos-emergency-number {
  background: #f8fafc;
  border: 1px solid var(--bos-border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bos-emergency-number:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.bos-emergency-number--police {
  border-left: 4px solid #3b82f6;
}

.bos-emergency-number--fire {
  border-left: 4px solid #ef4444;
}

.bos-emergency-number--medical {
  border-left: 4px solid #22c55e;
}

.bos-emergency-number__icon {
  font-size: 1.8rem;
  line-height: 1;
}

.bos-emergency-number__digits {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.bos-emergency-number--police .bos-emergency-number__digits {
  color: #2563eb;
}

.bos-emergency-number--fire .bos-emergency-number__digits {
  color: #dc2626;
}

.bos-emergency-number--medical .bos-emergency-number__digits {
  color: #16a34a;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.bos-emergency-number__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bos-text);
  margin-top: 2px;
}

.bos-emergency-number__desc {
  font-size: 0.75rem;
  color: var(--bos-muted);
  line-height: 1.3;
}

/* Responsive */
@media (max-width: 768px) {
  .bos-emergency-card__numbers {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .bos-emergency-number {
    flex-direction: row;
    text-align: left;
    padding: 12px 16px;
    gap: 12px;
  }
  
  .bos-emergency-number__icon {
    font-size: 1.5rem;
  }
  
  .bos-emergency-number__digits {
    font-size: 1.8rem;
  }
  
  .bos-emergency-number--medical .bos-emergency-number__digits {
    font-size: 1.5rem;
  }
  
  .bos-emergency-number__label {
    font-size: 0.8rem;
  }
  
  .bos-emergency-number__desc {
    display: none;
  }
}

/* ========================================================
   RESPONSIVE DESIGN - Mobile & Tablet Optimierung
   v1.0.87 - Burger-Menü und Layout-Anpassungen
   ======================================================== */

/* Burger-Button (nur auf mobilen Geräten sichtbar) */
.bos-burger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  margin-left: 12px;
}

.bos-burger-line {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Burger-Button Animation (aktiver Zustand = X) */
.bos-burger-btn--active .bos-burger-line:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.bos-burger-btn--active .bos-burger-line:nth-child(2) {
  opacity: 0;
}
.bos-burger-btn--active .bos-burger-line:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* Mobile Overlay */
.bos-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bos-mobile-overlay--visible {
  display: block;
  opacity: 1;
}

/* Body-Klasse wenn Menü offen */
body.bos-mobile-menu-open {
  overflow: hidden;
}

/* ========== TABLET (max 1024px) ========== */
@media (max-width: 1024px) {
  /* Sidebar schmaler */
  .bos-sidebar-nav {
    width: 200px;
    font-size: 13px;
  }
  
  .bos-sidebar-nav__title {
    font-size: 10px;
  }
  
  .bos-sidebar-nav__link {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  /* Content mehr Platz */
  .bos-content {
    padding: 16px;
  }
  
  /* Tabellen horizontal scrollbar */
  .bos-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Formulare Grid anpassen */
  .bos-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========== MOBILE (max 768px) ========== */
@media (max-width: 768px) {
  /* Burger-Button anzeigen */
  .bos-burger-btn {
    display: flex;
  }
  
  /* Header anpassen */
  .bos-header {
    padding: 8px 12px;
  }
  
  .bos-header__logo-text {
    font-size: 16px;
  }
  
  .bos-header__search {
    display: none;
  }
  
  .bos-header__username {
    display: none;
  }
  
  .bos-header__nav {
    gap: 8px;
  }
  
  /* Sidebar als Off-Canvas Menü */
  .bos-sidebar-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding-top: 60px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  }
  
  /* Dark Mode für Sidebar */
  html[data-theme="dark"] .bos-sidebar-nav,
  body.bos-theme-dark .bos-sidebar-nav {
    background: #16213e;
  }
  
  /* Sidebar offen */
  .bos-sidebar-nav--open {
    left: 0;
  }
  
  /* Haupt-Content volle Breite */
  .bos-app-wrapper,
  .bos-main {
    display: block !important;
  }
  
  .bos-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    margin-left: 0 !important;
  }
  
  /* Cards und Subcards */
  .bos-card,
  .bos-subcard {
    padding: 12px !important;
    margin-bottom: 12px !important;
  }
  
  /* Buttons */
  .bos-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .bos-btn--small {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Tabellen */
  .bos-table {
    font-size: 12px;
  }
  
  .bos-table th,
  .bos-table td {
    padding: 8px 6px;
  }
  
  /* Formulare */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important; /* Verhindert Zoom auf iOS */
    padding: 10px 12px;
  }
  
  /* Grid-Layouts einspaltg */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Flex-Layouts vertikal */
  [style*="display: flex"][style*="gap"] {
    flex-direction: column;
  }
  
  /* Tabs horizontal scrollbar */
  .bos-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  
  .bos-tabs button {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 12px;
  }
  
  /* Alerts */
  .bos-alert {
    padding: 12px;
    font-size: 13px;
  }
  
  /* Footer */
  .bos-footer {
    padding: 16px 12px;
    font-size: 11px;
  }
  
  .bos-footer__links {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ========== SMALL MOBILE (max 480px) ========== */
@media (max-width: 480px) {
  /* Header noch kompakter */
  .bos-header {
    padding: 6px 8px;
  }
  
  .bos-header__logo img {
    height: 28px;
  }
  
  .bos-header__logo-text {
    font-size: 14px;
  }
  
  /* Sidebar schmaler */
  .bos-sidebar-nav {
    width: 260px;
    left: -260px;
  }
  
  /* Content minimaler Padding */
  .bos-content {
    padding: 8px !important;
  }
  
  /* Cards noch kompakter */
  .bos-card,
  .bos-subcard {
    padding: 10px !important;
    border-radius: 8px;
  }
  
  /* Überschriften */
  h1, .bos-page-title {
    font-size: 20px !important;
  }
  
  h2 {
    font-size: 18px !important;
  }
  
  h3 {
    font-size: 16px !important;
  }
  
  h4 {
    font-size: 14px !important;
  }
  
  /* Buttons stapeln */
  .bos-btn-group,
  [style*="display: flex"][style*="gap: 8px"],
  [style*="display: flex"][style*="gap: 12px"] {
    flex-direction: column !important;
    width: 100%;
  }
  
  .bos-btn-group .bos-btn,
  [style*="display: flex"][style*="gap: 8px"] > button,
  [style*="display: flex"][style*="gap: 12px"] > button {
    width: 100% !important;
  }
  
  /* Tabellen noch kleiner */
  .bos-table {
    font-size: 11px;
  }
  
  .bos-table th,
  .bos-table td {
    padding: 6px 4px;
  }
  
  /* Login/Registrieren Text */
  .bos-header__link {
    font-size: 12px;
  }
  
  .bos-header__separator {
    margin: 0 4px;
  }
}

/* ========== LIVE-FUNKRAUM SPEZIFISCH ========== */
@media (max-width: 768px) {
  /* LiveRoom Header */
  .bos-liveroom > div:first-child {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start !important;
  }
  
  .bos-liveroom > div:first-child > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }
  
  /* Funkgerät zentriert */
  #phase-radio,
  #phase-ready,
  #phase-alarm,
  #phase-radio-placeholder {
    max-width: 100% !important;
    margin: 0 auto;
  }
  
  /* Dispatcher-View einspaltg */
  #dispatcher-view > div:first-of-type {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Karte volle Breite */
  #live-map-container,
  [id*="map"] {
    height: 250px !important;
    min-height: 250px;
  }
  
  /* Teilnehmer-Liste kompakt */
  #participant-list {
    max-height: 200px;
    overflow-y: auto;
  }
  
  /* Protokoll kompakt */
  #radio-protocol {
    max-height: 250px;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .bos-sidebar-nav,
  .bos-header,
  .bos-burger-btn,
  .bos-footer,
  #wpadminbar {
    display: none !important;
  }
  
  .bos-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ========== MOBILE TABS IN SIDEBAR ========== */
/* Die Seiten-Tabs werden im mobilen Menü als Submenü angezeigt */
.bos-sidebar-nav__mobile-tabs {
  display: none !important;
  border-top: 1px solid var(--bos-border, #e2e8f0);
  padding-top: 16px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  /* Mobile Tabs anzeigen wenn befüllt */
  .bos-sidebar-nav__mobile-tabs[style*="display: block"] {
    display: block !important;
  }
  
  /* Desktop Tabs ausblenden auf Mobile */
  .bos-tabs {
    display: none !important;
  }
}

/* Dark Mode für Mobile-Tabs */
html[data-theme="dark"] .bos-sidebar-nav__mobile-tabs,
body.bos-theme-dark .bos-sidebar-nav__mobile-tabs {
  border-color: #3a4a5e;
}

/* ========== SIDEBAR CLOSE BUTTON ========== */
.bos-sidebar-nav__close {
  display: none;
  width: 100%;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bos-muted, #64748b);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--bos-border, #e2e8f0);
  cursor: pointer;
  text-align: right;
}

.bos-sidebar-nav__close:hover {
  background: var(--bos-bg-hover, #f1f5f9);
  color: var(--bos-text, #1e293b);
}

@media (max-width: 768px) {
  .bos-sidebar-nav__close {
    display: block;
  }
  
  /* ::before Pseudo-Element entfernen */
  .bos-sidebar-nav::before {
    display: none !important;
  }
}

/* Dark Mode */
html[data-theme="dark"] .bos-sidebar-nav__close,
body.bos-theme-dark .bos-sidebar-nav__close {
  color: #a0a8b4;
  border-color: #3a4a5e;
}

html[data-theme="dark"] .bos-sidebar-nav__close:hover,
body.bos-theme-dark .bos-sidebar-nav__close:hover {
  background: rgba(255,255,255,0.05);
  color: #e8e8e8;
}

/* ========== SIDEBAR SUBMENÜ STYLES ========== */
.bos-sidebar-nav__link--sub {
  padding-left: 24px !important;
  font-size: 13px;
  color: var(--bos-text, #1e293b);
}

/* Kein > Prefix für Untermenüs */
.bos-sidebar-nav__link--sub::before {
  display: none !important;
}

.bos-sidebar-nav__link--sub:hover {
  color: var(--bos-primary, #0f4c81);
}

.bos-sidebar-nav__link--sub.bos-sidebar-nav__link--active {
  color: var(--bos-primary, #0f4c81);
  font-weight: 600;
}

/* Dark Mode */
html[data-theme="dark"] .bos-sidebar-nav__link--sub,
body.bos-theme-dark .bos-sidebar-nav__link--sub {
  color: #e8e8e8;
}

html[data-theme="dark"] .bos-sidebar-nav__link--sub:hover,
body.bos-theme-dark .bos-sidebar-nav__link--sub:hover {
  color: #6db3e8;
}

html[data-theme="dark"] .bos-sidebar-nav__link--sub.bos-sidebar-nav__link--active,
body.bos-theme-dark .bos-sidebar-nav__link--sub.bos-sidebar-nav__link--active {
  color: #6db3e8;
}

/* ========== HEADER NAVIGATION DROPDOWN ========== */
/* Desktop: Burger-Menü verstecken */
.bos-header__dropdown--menu {
  display: none;
}

/* Mobile/Tablet: Burger-Menü anzeigen, Einstellungs-Dropdown verstecken */
@media (max-width: 768px) {
  .bos-header__dropdown--menu {
    display: block;
  }
  
  /* Einstellungs-Dropdown ausblenden (nicht das Burger-Menü) */
  .bos-header__dropdown:not(.bos-header__dropdown--menu) {
    display: none;
  }
}

.bos-header__dropdown--menu .bos-header__dropdown-menu--wide {
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
}

.bos-header__dropdown-section {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bos-muted, #64748b);
  letter-spacing: 0.5px;
}

.bos-header__dropdown--menu .bos-header__dropdown-item {
  padding: 6px 16px;
  font-size: 13px;
}

/* Dark Mode für Dropdown-Sektionen */
html[data-theme="dark"] .bos-header__dropdown-section,
body.bos-theme-dark .bos-header__dropdown-section {
  color: #8899aa;
}

/* ========== FUNKGERÄT TASTATUR ========== */
/* Immer 3 Spalten, auch auf Mobilgeräten */
.radio-keypad {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
}

@media (max-width: 768px) {
    .radio-keypad {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ============================================================
   RESPONSIVE DESIGN IMPROVEMENTS - v1.2.19
   ============================================================ */

/* =========================
   2FA CODE INPUT - Mobile Optimized
   ========================= */
.bos-2fa-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
}

.bos-2fa-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.bos-2fa-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  border: 2px solid var(--bos-border);
  border-radius: 10px;
  background: var(--bos-bg);
  color: var(--bos-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bos-2fa-digit:focus {
  border-color: var(--bos-primary);
  box-shadow: 0 0 0 3px rgba(61, 126, 170, 0.2);
  outline: none;
}

/* Desktop: Alle 8 in einer Reihe */
@media (min-width: 600px) {
  .bos-2fa-inputs {
    flex-direction: row;
    gap: 6px;
  }
  .bos-2fa-row {
    gap: 6px;
  }
  .bos-2fa-digit {
    width: 42px;
    height: 50px;
    font-size: 22px;
  }
}

/* =========================
   HEADER - Mobile Optimizations
   ========================= */
@media (max-width: 768px) {
  .bos-header {
    padding: 8px 12px;
  }
  
  .bos-header__logo-text {
    font-size: 16px;
  }
  
  .bos-header__search {
    display: none;
  }
  
  .bos-header__username {
    display: none;
  }
  
  .bos-header__nav {
    gap: 8px;
  }
  
  .bos-header__dropdown-btn {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .bos-header__logo img {
    height: 28px;
  }
  
  .bos-header__logo-text {
    font-size: 14px;
  }
}

/* =========================
   SIDEBAR - Mobile Touch-Friendly
   ========================= */
@media (max-width: 900px) {
  .bos-sidebar-nav {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 280px;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding-top: 60px;
  }
  
  .bos-sidebar-nav--open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  
  .bos-sidebar-nav__link {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .bos-main {
    margin-left: 0;
    width: 100%;
  }
}

/* Mobile Overlay */
.bos-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bos-mobile-overlay--visible {
  display: block;
  opacity: 1;
}

/* =========================
   CARDS - Mobile Layout
   ========================= */
@media (max-width: 768px) {
  .bos-card {
    padding: 16px;
    margin: 8px;
    border-radius: 12px;
  }
  
  .bos-card h1,
  .bos-card h2 {
    font-size: 1.4em;
  }
  
  .bos-card h3 {
    font-size: 1.2em;
  }
}

@media (max-width: 480px) {
  .bos-card {
    padding: 12px;
    margin: 4px;
    border-radius: 8px;
  }
}

/* =========================
   FORMS - Touch-Friendly
   ========================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
  font-size: 16px; /* Prevents iOS zoom */
  min-height: 44px; /* Touch target */
  padding: 10px 12px;
}

.bos-btn {
  min-height: 44px;
  padding: 12px 20px;
  font-size: 15px;
  touch-action: manipulation;
}

@media (max-width: 480px) {
  .bos-btn {
    width: 100%;
    padding: 14px 20px;
  }
  
  .bos-btn + .bos-btn {
    margin-top: 8px;
    margin-left: 0;
  }
}

/* Form Grid - Mobile Stack */
@media (max-width: 600px) {
  .bos-form-row,
  .bos-form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .bos-form-row > *,
  .bos-form-grid > * {
    width: 100%;
  }
}

/* =========================
   TABLES - Mobile Responsive
   ========================= */
@media (max-width: 768px) {
  .bos-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }
  
  .bos-table {
    min-width: 500px;
  }
  
  .bos-table th,
  .bos-table td {
    padding: 10px 8px;
    font-size: 14px;
  }
}

/* Card-Style Tables for Mobile */
@media (max-width: 600px) {
  .bos-table--cards {
    display: block;
    min-width: auto;
  }
  
  .bos-table--cards thead {
    display: none;
  }
  
  .bos-table--cards tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .bos-table--cards tr {
    display: block;
    background: var(--bos-card-bg);
    border: 1px solid var(--bos-border);
    border-radius: 8px;
    padding: 12px;
  }
  
  .bos-table--cards td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border: none;
  }
  
  .bos-table--cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--bos-muted);
  }
}

/* =========================
   TABS - Mobile Scrollable
   ========================= */
@media (max-width: 600px) {
  .bos-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
    padding-bottom: 2px;
  }
  
  .bos-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .bos-tabs button,
  .bos-tabs a {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* =========================
   DASHBOARD TILES - Mobile Grid
   ========================= */
@media (max-width: 768px) {
  .bos-dashboard-grid,
  .bos-quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .bos-dashboard-grid,
  .bos-quick-links {
    grid-template-columns: 1fr;
  }
}

/* =========================
   ALERTS - Mobile
   ========================= */
@media (max-width: 600px) {
  .bos-alert {
    padding: 12px;
    font-size: 14px;
    border-radius: 8px;
  }
}

/* =========================
   LOGIN/REGISTER FORMS - Mobile Centered
   ========================= */
@media (max-width: 600px) {
  .bos-login-card,
  .bos-register-card {
    margin: 8px;
    padding: 20px;
  }
  
  .bos-login-card h2,
  .bos-register-card h2 {
    font-size: 1.3em;
    margin-bottom: 16px;
  }
}

/* =========================
   PROFILE PAGE - Mobile Layout
   ========================= */
@media (max-width: 768px) {
  .bos-profile-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .bos-profile-avatar {
    margin: 0 auto;
  }
  
  .bos-invite-card {
    padding: 16px;
  }
  
  .bos-invite-card > div {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .bos-invite-card > div > div:first-child {
    order: -1;
  }
}

/* =========================
   ORGANISATION PAGE - Mobile
   ========================= */
@media (max-width: 768px) {
  .bos-org-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .bos-org-info {
    text-align: center;
  }
}

/* =========================
   DROPDOWN MENUS - Mobile Touch
   ========================= */
@media (max-width: 768px) {
  .bos-header__dropdown-menu {
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .bos-header__dropdown-item {
    padding: 12px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .bos-header__dropdown-menu--wide {
    max-width: 90vw;
  }
}

/* =========================
   QR CODE - Mobile
   ========================= */
@media (max-width: 480px) {
  #qrcode-container canvas,
  [id^="qrcode-"] canvas {
    max-width: 120px !important;
    height: auto !important;
  }
}

/* =========================
   GENERAL MOBILE IMPROVEMENTS
   ========================= */

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Better touch targets */
a, button {
  touch-action: manipulation;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
  .bos-header {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  
  .bos-main {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* Fix iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select,
  textarea,
  input {
    font-size: 16px;
  }
}

/* =========================
   PRINT IMPROVEMENTS
   ========================= */
@media print {
  .bos-header,
  .bos-sidebar-nav,
  .bos-mobile-overlay,
  .bos-btn,
  .bos-header__dropdown {
    display: none !important;
  }
  
  .bos-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  .bos-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }
}
