/* ==========================================================================
   YS-ASSISTENT · NEXT-GEN APPLE ICLOUD & GMAIL 3-PANE WORKSPACE
   Pixel-perfect typography, clean hairline borders, zero layout overflow,
   zero emojis, professional desktop-grade UI
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Google Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

  /* Apple / Modern Light Theme */
  --bg-app: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-subtle: #fbfbfd;
  --bg-hover: #f0f0f5;
  --bg-preview: #eef0f3;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;

  --border-subtle: #e5e5ea;
  --border-color: #e5e5ea;
  --border-default: #d1d1d6;
  --border-hairline: rgba(0, 0, 0, 0.08);

  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --text-inverse: #ffffff;

  /* Apple System Colors */
  --color-blue: #0071e3;
  --color-blue-hover: #0077ed;
  --color-blue-subtle: rgba(0, 113, 227, 0.09);

  --color-green: #34c759;
  --color-green-subtle: rgba(52, 199, 89, 0.12);
  --color-green-text: #1b7a37;

  --color-orange: #ff9500;
  --color-orange-subtle: rgba(255, 149, 0, 0.12);
  --color-orange-text: #b25900;

  --color-red: #ff3b30;
  --color-red-subtle: rgba(255, 59, 48, 0.12);
  --color-red-text: #c92a2a;

  --color-gold: #c59b27;
  --color-gold-subtle: rgba(197, 155, 39, 0.12);
  --color-gold-text: #8e6c10;
  --color-gold-border: rgba(197, 155, 39, 0.28);

  /* Geometry & Shadows */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-modal: 0 16px 40px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"],
[data-theme="dark"] {
  /* Apple / Modern Dark Slate Theme (OLED) */
  --bg-app: #0b0f19;
  --bg-surface: #131b2e;
  --bg-subtle: #0f172a;
  --bg-hover: #1e293b;
  --bg-preview: #0f172a;
  --bg-primary: #131b2e;
  --bg-secondary: #0b0f19;
  --bg-card: #182238;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-default: rgba(255, 255, 255, 0.18);
  --border-hairline: rgba(255, 255, 255, 0.08);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0b0f19;

  /* Apple System Colors - Vibrant in Dark Mode */
  --color-blue: #38bdf8;
  --color-blue-hover: #0ea5e9;
  --color-blue-subtle: rgba(56, 189, 248, 0.16);
  --color-blue-text: #7dd3fc;
  --color-blue-border: rgba(56, 189, 248, 0.35);

  --color-green: #34d399;
  --color-green-subtle: rgba(52, 211, 153, 0.16);
  --color-green-text: #6ee7b7;

  --color-orange: #fbbf24;
  --color-orange-subtle: rgba(251, 191, 36, 0.16);
  --color-orange-text: #fde68a;

  --color-red: #f87171;
  --color-red-subtle: rgba(248, 113, 113, 0.16);
  --color-red-text: #fca5a5;

  --color-gold: #fbbf24;
  --color-gold-hover: #f59e0b;
  --color-gold-subtle: rgba(251, 191, 36, 0.18);
  --color-gold-text: #fde68a;
  --color-gold-border: rgba(251, 191, 36, 0.35);

  --color-purple: #c084fc;
  --color-purple-subtle: rgba(192, 132, 252, 0.16);
  --color-purple-text: #e9d5ff;

  --color-pink: #f472b6;
  --color-pink-subtle: rgba(244, 114, 182, 0.16);
  --color-pink-text: #fbcfe8;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.7);
}


*, *::before, *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

html {
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-app);
}

body {
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overscroll-behavior: none;
  font-family: var(--font-family);
  background-color: #f8fafc;
  background-image: url('./img/stadium-bg.png');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Strict Single-View Visibility Architecture (Exclusivity & Responsive)
   ========================================================================== */
.view-section {
  display: none !important;
}

.view-section:not(.active) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  position: absolute !important;
  top: -99999px !important;
  left: -99999px !important;
}

.view-section.active {
  display: flex !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Custom Apple Slim Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

/* ==========================================================================
   Unified Top Navigation Bar
   ========================================================================== */
.app-header {
  height: 48px;
  min-height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  position: relative;
}

@supports (backdrop-filter: blur(20px)) {
  .app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  user-select: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 450;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Sidebar Toggle & Collapse Controls */
.sidebar-toggle-pill {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 3.5px 9px;
  font-size: 11.5px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin-left: 6px;
  flex-shrink: 0;
}

.sidebar-toggle-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hairline);
}

.sidebar-toggle-pill:active {
  transform: scale(0.95);
}

.sidebar-toggle-pill.active {
  background: rgba(197, 155, 39, 0.15);
  border-color: #c59b27;
  color: #8c6d13;
  font-weight: 600;
}

.sidebar-hide-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.sidebar-hide-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.floating-sidebar-btn {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 95;
  background: #0071e3;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
}

.floating-sidebar-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.floating-sidebar-btn:active {
  transform: scale(0.96);
}

/* Segmented Tabs in Header (Only visible in Assistent view) */
body:not([data-active-view="assistant"]) #assistant-header-filters,
#assistant-header-filters.hidden {
  display: none !important;
}

/* ==========================================================================
   ASSISTENT FILTER TABS (2x2 GRID, RADIANT BLUE GLOW ON ACTIVE)
   ========================================================================== */
.header-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 4px 0;
  margin: 6px 0 4px 0;
}

.filter-tab {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
  min-height: 42px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.filter-tab .filter-tab-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: inherit;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-tab .tab-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  min-width: 20px;
  text-align: center;
  line-height: 1.3;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.blue { background: #0071e3; }
.dot.orange { background: #ff9500; }
.dot.purple { background: #c59b27; }
.dot.gold { background: #c59b27; box-shadow: 0 0 6px rgba(234, 179, 8, 0.45); }
.dot.green { background: #34c759; }

/* The clicked/active tab - Radiant Blue Glow */
.filter-tab.active,
.filter-tab[data-filter="course"].active,
.filter-tab[data-filter="jersey"].active,
.filter-tab[data-filter="duplicate"].active,
.filter-tab[data-filter="completed"].active {
  background: rgba(0, 113, 227, 0.08) !important;
  border: 1.8px solid #0071e3 !important;
  color: #0071e3 !important;
  box-shadow: 0 0 16px rgba(0, 113, 227, 0.45), 0 2px 8px rgba(0, 113, 227, 0.22) !important;
  transform: translateY(-1px);
}

.filter-tab.active .filter-tab-label-wrap {
  color: #0071e3 !important;
}

.filter-tab.active .dot {
  background: #0071e3 !important;
  box-shadow: 0 0 8px #0071e3 !important;
}

.filter-tab.active .tab-badge {
  background: #0071e3 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.35) !important;
}

/* Dark Mode Glow */
[data-theme="dark"] .filter-tab {
  background: #182238;
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .filter-tab:hover {
  background: #1e293b;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .filter-tab .tab-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

[data-theme="dark"] .filter-tab.active,
[data-theme="dark"] .filter-tab[data-filter="course"].active,
[data-theme="dark"] .filter-tab[data-filter="jersey"].active,
[data-theme="dark"] .filter-tab[data-filter="duplicate"].active,
[data-theme="dark"] .filter-tab[data-filter="completed"].active {
  background: rgba(56, 189, 248, 0.15) !important;
  border: 1.8px solid #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.58), 0 2px 10px rgba(56, 189, 248, 0.32) !important;
}

[data-theme="dark"] .filter-tab.active .filter-tab-label-wrap {
  color: #38bdf8 !important;
}

[data-theme="dark"] .filter-tab.active .dot {
  background: #38bdf8 !important;
  box-shadow: 0 0 10px #38bdf8 !important;
}

[data-theme="dark"] .filter-tab.active .tab-badge {
  background: #38bdf8 !important;
  color: #0b0f19 !important;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.45) !important;
}

/* Right Header Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.batch-header-btn {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  width: auto !important;
  padding: 0 11px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  border-radius: var(--radius-full) !important;
  background: var(--color-blue) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3) !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease;
}

.batch-header-btn.hidden {
  display: none !important;
}

.batch-header-btn:hover {
  background: var(--color-blue-hover) !important;
  transform: translateY(-0.5px);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.4) !important;
}

.batch-header-btn:active {
  transform: translateY(0);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5.5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0 8px;
  height: 26px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  user-select: none;
}

.status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 5px rgba(52, 199, 89, 0.6);
  flex-shrink: 0;
}
.status-dot.offline {
  background: var(--color-red);
  box-shadow: 0 0 5px rgba(255, 59, 48, 0.6);
}

.header-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 2px;
  flex-shrink: 0;
}

.header-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
  padding: 0;
}

.header-icon-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hairline);
  color: var(--text-primary);
}

.header-icon-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   3-Pane Cockpit Container
   ========================================================================== */
.cockpit-container.active {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: row;
  height: 100% !important;
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* Sidebar Collapsed State */
.cockpit-container.sidebar-collapsed .sidebar-pane {
  display: none !important;
}

.cockpit-container.sidebar-collapsed .workspace-main {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* ==========================================================================
   Pane 1: Sidebar (Bestellungsliste links)
   ========================================================================== */
.sidebar-pane {
  width: 310px;
  min-width: 260px;
  max-width: 340px;
  flex: 0 0 310px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-search-area {
  padding: 10px 12px 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 9px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-field {
  width: 100%;
  height: 28px;
  padding: 0 26px 0 28px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.search-field:focus {
  background: var(--bg-surface);
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px var(--color-blue-subtle);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: none;
  padding: 2px;
  align-items: center;
  justify-content: center;
}

.sidebar-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 0 2px;
}

.orders-loading-indicator {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.orders-list-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Sidebar Read / Unread Filter Bar */
.sidebar-read-bar {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  margin-top: 2px;
}

.read-filter-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.read-filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.read-filter-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.read-filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-blue);
  flex-shrink: 0;
}

.read-count-pill {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 9999px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  line-height: 1.2;
}

.read-filter-btn.active .read-count-pill {
  background: var(--color-blue-subtle);
  color: var(--color-blue);
}

/* Compact Order Card (2-Row Design) */
.order-card-row {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  position: relative;
  display: flex;
  flex-direction: column;
}

.order-card-row:hover {
  background: var(--bg-hover);
}

.order-card-row.selected {
  background: var(--color-blue-subtle);
  border-color: rgba(0, 113, 227, 0.25);
}

.order-card-row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--color-blue);
  border-radius: 0 2px 2px 0;
}

.order-compact-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.order-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.order-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.order-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.order-unread-dot.active {
  background: var(--color-blue);
  box-shadow: 0 0 0 2px var(--color-blue-subtle);
}

.order-child-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.order-card-row.is-unread .order-child-name {
  font-weight: 700;
}

.order-row-price {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.order-row-price.is-zero {
  color: var(--text-tertiary) !important;
  font-weight: 500;
  opacity: 0.65;
}

.order-card-row.selected .order-row-price {
  color: var(--color-blue);
}

.order-line-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.order-subline-text {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.order-tags-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Read toggle pill button in detail header */
.read-toggle-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  vertical-align: middle;
}

.read-toggle-pill-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-hairline);
}

.read-dot-inline {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.read-dot-inline.active {
  background: var(--color-blue);
  box-shadow: 0 0 0 2px var(--color-blue-subtle);
}

.type-tag, .status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  line-height: 1.25;
  padding: 1.5px 7px;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.type-tag.course {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.22);
}

.type-tag.jersey {
  background: rgba(204, 160, 40, 0.12);
  color: #9a7310;
  border: 1px solid rgba(204, 160, 40, 0.32);
}

.status-tag.approved {
  background: rgba(0, 113, 227, 0.1);
  color: #0066cc;
  border: 1px solid rgba(0, 113, 227, 0.22);
}

.status-tag.review {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.status-tag.duplicate {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.status-tag.completed {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ==========================================================================
   Right Workspace Column: Oben Kunde -> Drunter PDF -> Drunter E-Mail
   ========================================================================== */
.workspace-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: transparent !important;
  padding: 16px 20px 48px;
  gap: 16px;
}

.detail-pane {
  flex: 0 0 auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  height: auto;
  overflow: visible;
}

.detail-scrollable-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.empty-state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state-view svg {
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state-view h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state-view p {
  font-size: 12.5px;
  max-width: 320px;
  line-height: 1.4;
}

/* Unified Customer & Order Card */
.box-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.box-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.identity-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.avatar-large {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.identity-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.child-title-h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.2;
  word-break: break-word;
}

.child-sub-line {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.price-header-box {
  text-align: right;
  flex-shrink: 0;
}

.price-header-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-blue);
  line-height: 1.2;
}

.price-header-status {
  margin-top: 3px;
}

/* Alerts */
.box-alert {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.box-alert.review {
  background: var(--color-orange-subtle);
  color: var(--color-orange-text);
  border: 1px solid rgba(255, 149, 0, 0.2);
}
.box-alert.duplicate {
  background: var(--color-red-subtle);
  color: var(--color-red-text);
  border: 1px solid rgba(255, 59, 48, 0.2);
}
.box-alert.completed {
  background: var(--color-green-subtle);
  color: var(--color-green-text);
  border: 1px solid rgba(52, 199, 89, 0.2);
}

/* Primary Action Bar */
.action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-form-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 0;
}

/* Inline Customer & Price Form */
.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.form-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.copy-icon-btn {
  background: transparent;
  border: none;
  color: var(--color-blue);
  cursor: pointer;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.copy-icon-btn:hover {
  background: var(--color-blue-subtle);
}

.field-input {
  height: 30px;
  padding: 0 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
}

.field-input:focus {
  background: var(--bg-surface);
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px var(--color-blue-subtle);
}

.price-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.price-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.price-chip:hover {
  background: var(--color-blue-subtle);
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.price-chip.active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #ffffff !important;
  font-weight: 600;
}

.price-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.form-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Sections 2 & 3: Stacked PDF (Drunter) & E-Mail (Drunter)
   ========================================================================== */
.preview-pane {
  flex: 0 0 auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  height: auto;
}

.preview-viewport {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  height: auto;
  background: transparent;
  overflow: visible;
}

.preview-doc-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
  min-height: 40px;
}

.preview-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.preview-card-title svg {
  color: var(--color-blue);
  flex-shrink: 0;
}

.preview-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.email-tab-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.email-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  line-height: 1.25;
}

.email-tab-btn:hover {
  color: var(--text-primary);
}

.email-tab-btn.active {
  background: var(--bg-surface);
  color: var(--color-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.open-ext-btn {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  height: 26px !important;
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pdf-responsive-wrapper {
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: none;
  position: relative;
  overflow: visible;
  background: var(--bg-subtle);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

#preview-pdf-frame {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 680px;
  border: none;
  display: block;
  background: #ffffff;
}

.pdf-preview-img {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  cursor: zoom-in;
}

#preview-email-frame {
  width: 100%;
  min-height: 220px;
  height: 320px;
  border: none;
  display: block;
  background: transparent !important;
  transition: height 0.15s ease-out;
}

.desktop-only {
  display: flex;
}
.mobile-only {
  display: none;
}

/* ==========================================================================
   Buttons (Apple Clean Standard)
   ========================================================================== */
.btn-primary {
  background: var(--color-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--color-blue-hover);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.btn-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.dialog-overlay.active {
  display: flex;
}

.dialog-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  animation: modalPop 0.16s ease-out;
}

@keyframes modalPop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.dialog-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-container {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 40000 !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.nextgen-toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastIn 0.12s ease-out;
}

@keyframes toastIn {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Responsive Layout: Tablet & Mobile
   - Links: Kompakte Leiste immer sichtbar angedockt
   - Rechts: Oben Kunde, drunter PDF, drunter E-Mail
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar-pane {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    flex: 0 0 220px !important;
  }

  .workspace-main {
    padding: 12px 14px 40px !important;
    gap: 14px !important;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }

  /* Mobile Header - Generous, touch-friendly & distinctly sized (XL) */
  .app-header {
    height: auto !important;
    min-height: 64px !important;
    padding: 12px 16px !important;
    padding-top: max(12px, env(safe-area-inset-top)) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    row-gap: 10px !important;
  }

  .header-brand {
    order: 1 !important;
    gap: 11px !important;
  }

  .brand-logo {
    width: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)) !important;
  }

  .brand-text {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 2px !important;
  }

  .brand-title {
    font-size: 18px !important;
    font-weight: 750 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.15 !important;
  }

  .sidebar-toggle-pill {
    padding: 5px 11px !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    gap: 5px !important;
    margin-left: 4px !important;
    border-radius: 8px !important;
    height: 32px !important;
  }

  .sidebar-toggle-pill svg {
    width: 14px !important;
    height: 14px !important;
  }

  .header-right {
    order: 2 !important;
    margin-left: auto !important;
    gap: 6px !important;
  }

  .header-icon-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    background: var(--bg-subtle) !important;
    border: 1px solid var(--border-hairline) !important;
  }

  .header-icon-btn svg {
    width: 19px !important;
    height: 19px !important;
  }

  .header-notif-dot {
    top: 7px !important;
    right: 7px !important;
    width: 9px !important;
    height: 9px !important;
  }

  .batch-header-btn {
    display: none !important;
  }

  body:not([data-active-view="assistant"]) .header-filters,
  .header-filters.hidden {
    display: none !important;
  }

  body[data-active-view="assistant"] .header-filters:not(.hidden) {
    display: flex !important;
  }

  .header-filters {
    order: 3 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 4px 0 !important;
    border-radius: 0 !important;
    margin-top: 6px !important;
    margin-bottom: 4px !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
  }
  .header-filters::-webkit-scrollbar {
    display: none !important;
  }

  .filter-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    border-radius: 12px !important;
  }

  .filter-tab .tab-badge {
    font-size: 11px !important;
    padding: 2px 7px !important;
    border-radius: 10px !important;
  }

  .filter-tab .dot {
    width: 8px !important;
    height: 8px !important;
  }

  /* Mobile Master-Detail Cockpit Architecture (Full-width list <-> Full-width detail) */
  .cockpit-container.active {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Mobile Default State: Show Full-Width Order List */
  .cockpit-container:not(.mobile-show-detail) .sidebar-pane {
    display: flex !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    height: 100% !important;
    border-right: none !important;
  }

  .cockpit-container:not(.mobile-show-detail) .workspace-main {
    display: none !important;
  }

  /* Mobile Detail State: When an order is selected, show Full-Width Detail Workspace */
  .cockpit-container.mobile-show-detail .sidebar-pane {
    display: none !important;
  }

  .cockpit-container.mobile-show-detail .workspace-main {
    display: flex !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    height: 100% !important;
    padding: 10px 12px calc(96px + env(safe-area-inset-bottom, 24px)) 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
  }

  /* Mobile Back Header Bar */
  .mobile-back-header {
    display: flex !important;
    align-items: center !important;
    padding: 2px 0 10px 0 !important;
    margin-bottom: 2px !important;
  }

  .mobile-back-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--color-blue) !important;
    font-size: 13.5px !important;
    font-weight: 650 !important;
    padding: 7px 14px !important;
    border-radius: var(--radius-full) !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-back-button:active {
    transform: scale(0.97) !important;
    background: var(--bg-hover) !important;
  }

  .mobile-back-button svg {
    stroke-width: 2.6 !important;
  }

  .sidebar-search-area {
    padding: 6px 6px 5px 6px !important;
    gap: 4px !important;
  }

  .search-icon {
    left: 7px !important;
    width: 12px !important;
    height: 12px !important;
  }

  .search-field {
    height: 25px !important;
    font-size: 11px !important;
    padding: 0 20px 0 22px !important;
  }

  .sidebar-read-bar {
    padding: 2px 1px !important;
    gap: 2px !important;
  }

  .read-filter-btn {
    padding: 3px 2px !important;
    font-size: 9.5px !important;
    gap: 3px !important;
    justify-content: center !important;
  }

  .read-btn-text {
    display: none !important;
  }

  .read-filter-dot {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    display: inline-block !important;
  }

  .read-count-pill {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }

  .sidebar-meta-row {
    font-size: 9.5px !important;
    padding: 2px 2px 0 2px !important;
  }

  .meta-hint {
    display: none !important;
  }

  .orders-list-scroll {
    padding: 6px 8px calc(96px + env(safe-area-inset-bottom, 24px)) 8px !important;
    gap: 4px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
  }

  .order-card-row {
    padding: 6px 6px !important;
    border-radius: 6px !important;
  }

  .order-line-top {
    gap: 4px !important;
  }

  .order-unread-dot {
    width: 5.5px !important;
    height: 5.5px !important;
  }

  .order-child-name {
    font-size: 11.5px !important;
  }

  .order-row-price {
    font-size: 10.5px !important;
  }

  .order-line-bot {
    gap: 3px !important;
  }

  .order-subline-text {
    font-size: 9.5px !important;
  }

  /* Hide redundant type-tag in ultra-compact mobile sidebar so status fits cleanly */
  .sidebar-pane .type-tag {
    display: none !important;
  }

  .sidebar-pane .status-tag {
    font-size: 8.5px !important;
    padding: 1px 4.5px !important;
  }

  /* Right Main Column: Oben Kunde, drunter PDF, drunter E-Mail */
  .workspace-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 100% !important;
    padding: 10px 12px calc(96px + env(safe-area-inset-bottom, 24px)) 12px !important;
    gap: 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
  }

  .box-card {
    padding: 10px 10px !important;
    border-radius: 10px !important;
  }

  .box-card-header {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .avatar-large {
    width: 30px !important;
    height: 30px !important;
    font-size: 11.5px !important;
  }

  .child-title-h2 {
    font-size: 14px !important;
  }

  .child-sub-line {
    font-size: 10.5px !important;
    gap: 4px !important;
  }

  .sub-sep {
    display: none !important;
  }

  .price-header-val {
    font-size: 14.5px !important;
  }

  .action-strip {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  .action-buttons-group {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .action-buttons-group .btn-primary,
  .action-buttons-group .btn-secondary {
    width: 100% !important;
    justify-content: center !important;
    height: 34px !important;
    font-size: 12px !important;
  }

  .customer-form-divider {
    margin: 9px 0 !important;
  }

  /* 1-Column Form on Mobile so inputs never overflow */
  .form-2col {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  .field-input {
    height: 32px !important;
    font-size: 12.5px !important;
    padding: 0 8px !important;
  }

  .price-chip {
    font-size: 10px !important;
    padding: 3px 7px !important;
    white-space: normal !important;
  }

  .form-bottom-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .form-bottom-bar .btn-primary {
    width: 100% !important;
    justify-content: center !important;
    height: 34px !important;
  }

  /* Stacked PDF & Email Cards on Mobile */
  .preview-viewport {
    gap: 10px !important;
  }

  .preview-card-header {
    padding: 8px 10px !important;
  }

  .preview-card-title {
    font-size: 11.5px !important;
  }

  .open-ext-btn span {
    display: none !important;
  }

  .open-ext-btn {
    padding: 4px 6px !important;
  }

  .pdf-responsive-wrapper {
    width: 100% !important;
    height: auto !important;
    min-height: 220px !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    padding: 6px !important;
    background: var(--bg-subtle) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  }

  #preview-pdf-frame {
    min-width: 100% !important;
    width: 100% !important;
    height: 480px !important;
  }

  .pdf-preview-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  }

  #preview-email-frame {
    min-height: 240px !important;
  }
}

@media (max-width: 400px) {
  /* Retain full touch targets on small phones */
}

/* ==========================================================================
   Bottom Footer Switcher & Fullpage Views (Offene Rechnungen + Dashboard & Logs)
   ========================================================================== */
.cockpit-container.active {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
}

.floating-sidebar-btn {
  bottom: 72px !important;
}

.workspace-main {
  padding-bottom: 36px !important;
}

.bottom-footer-switcher {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  min-height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border-subtle) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  z-index: 800 !important;
  box-sizing: border-box !important;
  user-select: none !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

@supports (backdrop-filter: blur(20px)) {
  .bottom-footer-switcher {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  
}

.footer-nav-btn {
  flex: 1;
  max-width: 240px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  position: relative;
}

.footer-nav-btn:hover {
  color: var(--text-primary);
}

.footer-nav-btn.active {
  color: var(--color-blue);
}

.footer-nav-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2.5px;
  background: var(--color-blue);
  border-radius: 0 0 3px 3px;
}

.footer-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-badge {
  position: absolute;
  top: -5px;
  right: -12px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.footer-badge.blue {
  background: var(--color-blue);
}

.footer-badge.orange {
  background: #f59e0b;
}

.footer-badge.green {
  background: #10b981;
}

.footer-badge.gray {
  background: var(--text-tertiary);
}

.header-notif-btn {
  position: relative;
}

.header-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.8);
}

/* Notification Banner Card */
.notif-banner-card {
  display: none !important;
}

.notif-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.notif-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.notif-banner-text {
  flex: 1;
  min-width: 200px;
}

.notif-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-banner-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .footer-nav-label {
    font-size: 9.5px;
    letter-spacing: -0.02em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .footer-badge {
    top: -4px;
    right: -8px;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
    padding: 0 3px;
  }
}

.footer-status-dot {
  position: absolute;
  top: -2px;
  right: -6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.7);
}

.footer-status-dot.offline {
  background: var(--color-red);
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.7);
}

/* Fullpage Scrollable Views (Offene Rechnungen & Dashboard & Logs & Anwesenheit) */
.fullpage-view.active {
  flex: 1 1 0% !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  background: transparent !important;
}

.fullpage-scroll-container {
  max-width: 1060px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 14px 16px 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Delete Button */
.btn-danger-ghost {
  background: transparent;
  color: var(--color-red);
  border: 1px solid rgba(255, 59, 48, 0.28);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger-ghost:hover {
  background: var(--color-red-subtle);
}

/* Spinner & Lightbox */
@keyframes spin360 {
  to { transform: rotate(360deg); }
}

.spin-anim {
  animation: spin360 0.8s linear infinite;
}

.pdf-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 12px;
}

.spinner-ring {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--border-subtle);
  border-top-color: var(--color-blue);
  border-radius: 50%;
  animation: spin360 0.75s linear infinite;
}

.pdf-lightbox-content {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  max-width: 920px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}

.pdf-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.pdf-lightbox-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.pdf-lightbox-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  background: #e2e8f0;
  display: flex;
  justify-content: center;
}

.pdf-lightbox-body img {
  width: 100%;
  max-width: 840px;
  height: auto;
  display: block;
  background: #ffffff;
  border-radius: 4px;
}

/* ==========================================================================
   VIEW 2: OFFENE RECHNUNGEN STYLES (Findappa / Modern KPI Cards)
   ========================================================================== */
.payments-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.pay-kpi-card {
  background: var(--bg-surface, #ffffff);
  border-radius: 18px;
  padding: 18px 20px 14px 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-color, #edf2f7);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pay-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.pay-kpi-card.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

.pay-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pay-kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #64748b;
  text-transform: uppercase;
}

.pay-kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.pay-kpi-sub {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

.section-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-card-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.bcc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bcc-month-pills, .logs-filter-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.chip-filter-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.chip-filter-btn.active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #ffffff;
}

.bcc-input-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bcc-readonly-input {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.bcc-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.payments-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.payments-subtabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.payments-subtabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.payments-category-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pay-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.pay-type-badge.course {
  background: rgba(0, 113, 227, 0.08);
  color: var(--color-blue);
  border: 1px solid rgba(0, 113, 227, 0.25);
}

.pay-type-badge.jersey {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.payments-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 12px 0 6px 0;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.payments-section-header .section-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.pay-subtab {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.pay-subtab.active {
  background: var(--bg-surface);
  border-color: var(--color-blue);
  color: var(--color-blue);
  box-shadow: 0 1px 4px rgba(0, 113, 227, 0.15);
}

.subtab-pill {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
}
.subtab-pill.red { background: var(--color-orange-subtle); color: var(--color-orange-text); }
.subtab-pill.green { background: var(--color-green-subtle); color: var(--color-green-text); }
.subtab-pill.gray { background: var(--bg-hover); color: var(--text-secondary); }

.payments-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payments-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payment-participant-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.12s ease;
}

.payment-participant-card.is-open {
  border-left: 3.5px solid var(--color-orange);
}

.payment-participant-card.is-paid {
  border-left: 3.5px solid var(--color-green);
}

.pay-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pay-card-identity {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.pay-index-badge {
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

.pay-child-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.pay-guardian-line {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.pay-card-right {
  text-align: right;
  flex-shrink: 0;
}

.pay-amount-val {
  font-size: 14.5px;
  font-weight: 800;
}
.pay-amount-val.open { color: var(--color-orange-text); }
.pay-amount-val.paid { color: var(--color-green-text); }

.pay-invoice-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.pay-card-middle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pay-ref-note {
  font-size: 11px;
  color: var(--text-tertiary);
}

.pay-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

.pay-contact-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pay-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-blue);
  background: var(--color-blue-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-decoration: none;
}

.btn-mark-paid {
  background: var(--color-green);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: inherit;
}

.btn-mark-unpaid {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ==========================================================================
   VIEW 3: DASHBOARD & LOGS STYLES
   ========================================================================== */
.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-main-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-main-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.dash-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease;
}

.dash-stat-card:hover {
  transform: translateY(-1px);
}

.dash-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.dash-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-stat-icon.blue { background: var(--color-blue-subtle); color: var(--color-blue); }
.dash-stat-icon.purple { background: #fef9c3; color: #b45309; }
.dash-stat-icon.green { background: var(--color-green-subtle); color: var(--color-green); }
.dash-stat-icon.orange { background: var(--color-orange-subtle); color: var(--color-orange); }

.dash-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.dash-stat-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.dash-2col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quota-bar-wrap {
  margin-top: 10px;
  margin-bottom: 12px;
}

.quota-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.quota-progress-track {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 9999px;
  overflow: hidden;
}

.quota-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-green), #10b981);
  border-radius: 9999px;
}

.dash-kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dash-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.dash-kv-row:last-child { border-bottom: none; }

.dash-kv-k { color: var(--text-secondary); }
.dash-kv-v { font-weight: 700; color: var(--text-primary); }
.dash-kv-v.green { color: var(--color-green-text); }
.dash-kv-v.orange { color: var(--color-orange-text); }
.dash-kv-v.blue { color: var(--color-blue); }
.dash-kv-v.purple { color: #d97706; }

.dash-locations-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loc-card-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 10px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
}

.loc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 3px;
  border-bottom: 1px dashed var(--border-color, #e2e8f0);
}

.loc-card-total {
  font-size: 11px;
  color: var(--text-secondary);
}

.loc-subgroups-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 1px;
}

.loc-stat-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loc-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  flex-wrap: wrap;
  gap: 4px;
}

.loc-stat-name {
  font-weight: 600;
  color: var(--text-primary);
}

.loc-stat-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.loc-stat-count {
  color: var(--text-secondary);
  font-size: 11px;
}

.loc-badge-full {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
  letter-spacing: 0.2px;
}

.loc-badge-free {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  color: #15803d;
  font-weight: 600;
  background: rgba(22, 163, 74, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.loc-bar-track {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 9999px;
  overflow: hidden;
}

.loc-bar-fill {
  height: 100%;
  background: var(--color-blue);
  border-radius: 9999px;
}

.loc-bar-fill.red {
  background: #ef4444 !important;
}

.loc-bar-fill.blue {
  background: var(--color-blue, #2563eb) !important;
}

.loc-total-footer {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-hover, #f1f5f9);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--border-color, #e2e8f0);
}

.loc-total-pill {
  font-size: 12.5px;
  color: var(--color-blue, #2563eb);
}

/* IONOS Connection Card */
.ionos-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ionos-status-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ionos-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--color-green-subtle);
  color: var(--color-green-text);
  font-size: 11px;
  font-weight: 700;
}

.ionos-live-indicator.offline {
  background: var(--color-red-subtle);
  color: var(--color-red-text);
}

.ionos-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.ionos-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ionos-detail-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.ionos-detail-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

/* Logs Terminal Box */
.logs-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.logs-terminal-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.log-entry-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.35;
  flex-wrap: wrap;
}

.log-time {
  color: #94a3b8;
  font-size: 10px;
  flex-shrink: 0;
}

.log-lvl-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.log-lvl-badge.info { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.log-lvl-badge.success { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.log-lvl-badge.warn { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.log-lvl-badge.error { background: rgba(248, 113, 113, 0.25); color: #f87171; }

.log-source-tag {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 10.5px;
  flex-shrink: 0;
}

.log-msg-text {
  color: #f8fafc;
  word-break: break-word;
  flex: 1;
  min-width: 160px;
}

@media (max-width: 768px) {
  .cockpit-container.active {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
  }

  .fullpage-view.active {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .fullpage-scroll-container {
    padding: 12px 14px calc(96px + env(safe-area-inset-bottom, 24px)) 14px !important;
    gap: 12px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .payments-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .dash-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .dash-2col-grid {
    grid-template-columns: 1fr !important;
  }

  .ionos-details-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .pay-card-bottom {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .btn-mark-paid, .btn-mark-unpaid {
    width: 100% !important;
    justify-content: center !important;
    height: 32px !important;
  }
}

/* ==========================================================================
   VIEW 4: ANWESENHEITSLISTE STYLES
   ========================================================================== */
.subtab-pill.blue {
  background: var(--color-blue-subtle);
  color: var(--color-blue);
}

.attendance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.att-loc-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}

.att-loc-kpi-card:hover {
  transform: translateY(-1px);
  border-color: var(--color-blue);
}

.att-loc-kpi-card.active {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15);
}

.att-loc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.att-loc-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.att-loc-day {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-blue);
  background: var(--color-blue-subtle);
  padding: 2px 7px;
  border-radius: 9999px;
  white-space: nowrap;
}

.att-loc-count-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.att-loc-count-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.att-loc-count-lbl {
  font-size: 11px;
  color: var(--text-secondary);
}

.att-loc-groups-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.att-loc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

.att-loc-dl-btn {
  flex: 1;
  background: var(--color-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.att-loc-dl-btn:hover {
  background: var(--color-blue-hover);
}

.att-loc-png-btn {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.att-loc-png-btn:hover {
  background: var(--bg-hover);
}

.attendance-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.attendance-lists-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.att-location-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.att-location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.att-location-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.att-location-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.att-location-btn-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.att-sheet-preview-wrap {
  padding: 14px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.att-sheet-img {
  width: 100%;
  max-width: 1020px;
  height: auto;
  display: block;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  cursor: zoom-in;
}

.att-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px 14px;
}

.att-sheet-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: visible;
}

.att-sheet-table th,
.att-sheet-table td {
  border: 1px solid var(--border-subtle);
  padding: 6px 9px;
  line-height: 1.3;
}

.att-sheet-table thead th {
  background: var(--bg-surface-elevated, rgba(10, 132, 255, 0.08));
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
  font-size: 11px;
  border-bottom: 1.5px solid var(--border-default);
}

.att-sheet-table tbody tr:nth-child(odd) {
  background: var(--bg-surface);
}

.att-sheet-table tbody tr:nth-child(even) {
  background: var(--bg-app);
}

.att-sheet-table tbody tr:hover {
  background: rgba(10, 132, 255, 0.05);
}

.att-group-banner-a td {
  background: rgba(245, 158, 11, 0.14) !important;
  color: var(--text-primary) !important;
  font-weight: 700;
  text-align: center;
  padding: 7px 10px !important;
  font-size: 12px;
  border-top: 1.5px solid rgba(245, 158, 11, 0.4) !important;
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.4) !important;
}

.att-group-banner-b td {
  background: rgba(10, 132, 255, 0.14) !important;
  color: var(--text-primary) !important;
  font-weight: 700;
  text-align: center;
  padding: 7px 10px !important;
  font-size: 12px;
  border-top: 1.5px solid rgba(10, 132, 255, 0.4) !important;
  border-bottom: 1.5px solid rgba(10, 132, 255, 0.4) !important;
}

.att-banner-text {
  position: sticky;
  left: 10px;
  display: inline-block;
  font-weight: 700;
}

.att-col-num {
  width: 32px;
  min-width: 32px;
  max-width: 36px;
  text-align: center;
  font-weight: 700;
  color: var(--text-tertiary);
  position: sticky;
  left: 0;
  z-index: 2;
}

.att-col-name {
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  left: 32px;
  z-index: 2;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.att-child-name {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.att-mobile-meta {
  display: none;
}

/* Ensure background color for sticky cells so text doesn't bleed through on horizontal scroll */
.att-sheet-table tbody tr:nth-child(odd) td.att-col-num,
.att-sheet-table tbody tr:nth-child(odd) td.att-col-name {
  background: var(--bg-surface, #ffffff);
}

.att-sheet-table tbody tr:nth-child(even) td.att-col-num,
.att-sheet-table tbody tr:nth-child(even) td.att-col-name {
  background: var(--bg-app, #f8fafc);
}

.att-sheet-table tbody tr:hover td.att-col-num,
.att-sheet-table tbody tr:hover td.att-col-name {
  background: rgba(10, 132, 255, 0.08) !important;
}

.att-sheet-table thead th.att-col-num {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bg-surface-elevated, #f1f5f9) !important;
}

.att-sheet-table thead th:nth-child(2) {
  position: sticky;
  left: 32px;
  z-index: 4;
  background: var(--bg-surface-elevated, #f1f5f9) !important;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.att-col-guardian {
  white-space: nowrap;
  color: var(--text-secondary);
}

.att-col-phone {
  text-align: center;
  white-space: nowrap;
}

.att-col-phone a,
.att-tel-link {
  color: var(--color-blue);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.2);
  transition: all 0.15s ease;
}

.att-col-phone a:hover,
.att-tel-link:hover {
  background: var(--color-blue);
  color: #ffffff !important;
  text-decoration: none;
}

.att-col-date {
  width: 34px;
  min-width: 34px;
  text-align: center;
}

/* Quick Jump Header Bar across schools */
.att-top-jump-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.att-jump-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.att-jump-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.att-jump-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.att-jump-chip:hover,
.att-jump-chip:active {
  background: var(--color-blue);
  color: #ffffff;
  border-color: var(--color-blue);
}

/* Quick Date Jump Row inside each attendance table block */
.att-table-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-subtle, #f8fafc);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.att-swipe-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-blue);
}

.att-quick-jumps {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-att-jump {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-att-jump:hover,
.btn-att-jump:active {
  background: var(--color-blue);
  color: #ffffff;
  border-color: var(--color-blue);
}

.att-single-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.att-single-nav-footer button {
  flex: 1 1 auto;
  font-size: 11.5px;
  padding: 6px 12px;
}

@media (max-width: 768px) {
  /* Prevent flex blowout on mobile */
  .fullpage-view,
  #view-attendance,
  .fullpage-scroll-container,
  .attendance-lists-stack,
  .att-location-block,
  .att-table-scroll {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Hide huge KPI cards on mobile to bring attendance list immediately to top */
  .attendance-kpi-grid {
    display: none !important;
  }

  .att-mobile-scroll-hint {
    display: none !important;
  }

  .attendance-toolbar-card {
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    position: static !important;
  }

  /* School Selector: 2-column grid showing ALL 4 locations clearly */
  .payments-subtabs#attendance-subtabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .payments-subtabs#attendance-subtabs .pay-subtab {
    flex: initial !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 9px !important;
    font-size: 11px !important;
    border-radius: var(--radius-sm) !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .payments-subtabs#attendance-subtabs .pay-subtab span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Full width button for 'Alle Standorte' */
  .payments-subtabs#attendance-subtabs .pay-subtab[data-att-loc="all"] {
    grid-column: 1 / -1 !important;
    justify-content: center !important;
    font-weight: 700 !important;
    gap: 8px !important;
  }

  /* Hide redundant toolbar download button on mobile */
  .attendance-active-download-wrap {
    display: none !important;
  }

  /* Hide redundant chips on mobile since tabs above show all schools clearly */
  .att-top-jump-bar {
    display: none !important;
  }

  .att-location-header {
    padding: 10px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .att-location-title {
    font-size: 13.5px !important;
    justify-content: space-between !important;
  }

  .att-location-btn-group {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }

  .att-location-btn-group .btn-primary,
  .att-location-btn-group .btn-secondary {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    justify-content: center !important;
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  .att-table-nav-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    flex-wrap: wrap !important;
  }

  .att-swipe-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  .att-quick-jumps {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }

  .btn-att-jump {
    padding: 2px 6px !important;
    font-size: 10px !important;
  }

  /* Table Container: truly scrollable horizontally */
  .att-table-scroll {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 4px 6px 12px 6px !important;
    border-radius: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    touch-action: pan-x pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    cursor: grab;
  }

  .att-table-scroll:active {
    cursor: grabbing;
  }

  .att-sheet-table {
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 11px !important;
  }

  .att-sheet-table th,
  .att-sheet-table td {
    padding: 5px 6px !important;
  }

  /* Sticky Column 1: Index (#) */
  .att-sheet-table th.att-col-num,
  .att-sheet-table td.att-col-num {
    position: sticky !important;
    left: 0 !important;
    z-index: 10 !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 30px !important;
    text-align: center !important;
    font-weight: 700 !important;
  }

  /* Sticky Column 2: Name des Kindes (with parent/phone inside) */
  .att-sheet-table th.att-col-name,
  .att-sheet-table td.att-col-name {
    position: sticky !important;
    left: 28px !important;
    z-index: 10 !important;
    width: 130px !important;
    min-width: 130px !important;
    max-width: 145px !important;
    padding: 6px 7px !important;
    white-space: normal !important;
    word-break: break-word !important;
    box-shadow: 3px 0 6px -1px rgba(0, 0, 0, 0.14) !important;
  }

  /* Solid background for sticky columns */
  .att-sheet-table thead th.att-col-num,
  .att-sheet-table thead th.att-col-name {
    background: var(--bg-surface-elevated, #f1f5f9) !important;
  }

  

  .att-sheet-table tbody tr:nth-child(odd) td.att-col-num,
  .att-sheet-table tbody tr:nth-child(odd) td.att-col-name {
    background: var(--bg-surface, #ffffff) !important;
  }

  .att-sheet-table tbody tr:nth-child(even) td.att-col-num,
  .att-sheet-table tbody tr:nth-child(even) td.att-col-name {
    background: var(--bg-app, #f8fafc) !important;
  }

  

  

  /* Hide separate guardian and phone columns on mobile */
  .att-col-guardian,
  .att-col-phone,
  .att-sheet-table th.att-col-guardian,
  .att-sheet-table th.att-col-phone {
    display: none !important;
  }

  /* Show parent and phone inside the sticky name cell */
  .att-mobile-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    margin-top: 3px !important;
    font-size: 9px !important;
    font-weight: normal !important;
    color: var(--text-tertiary) !important;
    line-height: 1.2 !important;
  }

  .att-meta-guardian {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
    color: var(--text-secondary);
  }

  .att-meta-phone {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    color: var(--color-blue) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
  }

  /* Compact date columns */
  .att-col-date {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 36px !important;
    font-size: 9.5px !important;
    padding: 6px 2px !important;
    text-align: center !important;
  }

  /* Sticky group banner */
  .att-group-banner-a td,
  .att-group-banner-b td {
    position: sticky !important;
    left: 0 !important;
    z-index: 6 !important;
    text-align: left !important;
    padding: 7px 10px !important;
  }

  .att-col-phone a {
    background: rgba(10, 132, 255, 0.08) !important;
  }
}

/* ==========================================================================
   Responsive Footer Labels & Mobile Polish
   ========================================================================== */
.mobile-short {
  display: none;
}
.desktop-long {
  display: inline;
}

@media (max-width: 768px) {
  .mobile-short {
    display: inline !important;
  }
  .desktop-long {
    display: none !important;
  }
  .bottom-footer-switcher {
    padding: 0 4px !important;
    gap: 2px !important;
  }
  .footer-nav-btn {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 2px 1px !important;
    gap: 2px !important;
  }
  .footer-nav-label {
    font-size: 10.5px !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
  }
  .footer-badge {
    top: -4px !important;
    right: -8px !important;
    font-size: 9px !important;
    padding: 0 3.5px !important;
    min-width: 15px !important;
    height: 15px !important;
  }
}

@media (max-width: 380px) {
  .footer-nav-label {
    font-size: 9.5px !important;
  }
  .footer-nav-icon-wrap svg {
    width: 17px !important;
    height: 17px !important;
  }
}

/* ==========================================================================
   MODUL 1 & 2: LOGIN OVERLAY & TRAINER HALLEN-COCKPIT
   ========================================================================== */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #f8fafc;
  background-image: url('./img/stadium-bg.png');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.login-screen-box {
  width: 100%;
  max-width: 410px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  padding: 34px 28px 24px;
  box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.05);
  text-align: center;
  animation: loginBoxAppear 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes loginBoxAppear {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo-wrap {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  box-shadow: 0 8px 18px rgba(10, 132, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  transition: transform 0.2s ease;
}
.login-logo-wrap:hover {
  transform: scale(1.03);
}
.login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-brand-header {
  margin-bottom: 16px;
}
.login-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 4px;
}
.login-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  margin: 0;
}
.login-role-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.login-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}
.login-role-pill .role-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
}
.login-role-pill .role-dot.blue {
  background: #0ea5e9;
  box-shadow: 0 0 5px rgba(14, 165, 233, 0.6);
}
.login-role-pill .role-dot.green {
  background: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
}
.login-form {
  margin: 0;
}
.login-field-wrap {
  margin-bottom: 16px;
  text-align: left;
}
.login-field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-field-sub {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: none;
  letter-spacing: normal;
}
.login-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.login-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-field-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 42px;
  font-size: 14.5px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 13px;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-field-input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.15);
  background: #ffffff;
}
.login-eye-btn {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.login-eye-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}
.login-error-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 10px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  animation: shakeError 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-success-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

@keyframes shakeError {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}
.login-submit-btn {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  border-radius: 13px;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
  transform: translateY(-1px);
}
.login-submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}
.login-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}
.login-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}
.login-security-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.trainer-top-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(10,132,255,0.15);
  color: var(--color-blue);
  margin-bottom: 8px;
}
.trainer-child-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}
.trainer-child-card.present {
  border-left: 4px solid var(--color-green, #34c759);
}
.trainer-child-card.absent {
  border-left: 4px solid var(--color-red, #ff3b30);
}
.trainer-child-card.excused {
  border-left: 4px solid var(--color-orange, #ff9500);
}
.trainer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.trainer-child-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.trainer-child-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.trainer-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(52, 199, 89, 0.15);
  color: #248a3d;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.trainer-checkin-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.trainer-status-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.trainer-status-btn.active-present {
  background: #34c759 !important;
  color: #ffffff !important;
  border-color: #34c759 !important;
}
.trainer-status-btn.active-absent {
  background: #ff3b30 !important;
  color: #ffffff !important;
  border-color: #ff3b30 !important;
}
.trainer-status-btn.active-excused {
  background: #ff9500 !important;
  color: #ffffff !important;
  border-color: #ff9500 !important;
}
.trainer-notes-toggle {
  background: transparent;
  border: none;
  color: var(--color-blue);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.trainer-notes-collapse {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

/* ==========================================================================
   MODUL 3: BANK PDF RECONCILIATION MODAL
   ========================================================================== */
.bank-recon-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.bank-recon-dropzone:hover {
  border-color: var(--color-blue);
  background: rgba(10,132,255,0.03);
}
.bank-match-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.bank-match-badge.exact { background: rgba(52,199,89,0.15); color: #248a3d; }
.bank-match-badge.high { background: rgba(255,149,0,0.15); color: #b26a00; }
.bank-match-badge.none { background: rgba(142,142,147,0.15); color: #636366; }

/* ==========================================================================
   MODUL 4: SEMESTER TRANSITION VIEW
   ========================================================================== */
.semester-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.semester-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.semester-table th {
  background: var(--bg-secondary);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.semester-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.semester-status-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   TRAINER GUIDED WORKFLOW (STEP-BY-STEP HALLEN-COCKPIT)
   ========================================================================== */
.trainer-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.trainer-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-blue);
  margin-bottom: 8px;
}
.trainer-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}
.trainer-group-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.trainer-group-tab-btn {
  flex: 1;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.trainer-group-tab-btn.active {
  background: var(--color-blue) !important;
  color: #ffffff !important;
  border-color: var(--color-blue) !important;
  box-shadow: 0 2px 8px rgba(0,113,227,0.3);
}
.trainer-group-tab-btn .tab-sub {
  font-size: 10.5px;
  font-weight: 500;
  opacity: 0.85;
}
.trainer-group-tab-btn.submitted {
  border-color: #34c759;
}
.trainer-submit-panel {
  position: sticky;
  bottom: 60px;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 16px;
  margin-bottom: 16px;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trainer-submit-btn {
  width: 100%;
  height: 48px;
  font-size: 14.5px;
  font-weight: 800;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  touch-action: manipulation;
}
.trainer-completion-card {
  background: rgba(52,199,89,0.12);
  border: 1px solid rgba(52,199,89,0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* ===== TRAINER COCKPIT V2 ===== */
.tc-wrap { max-width: 560px; margin: 0 auto; padding: 8px 4px 40px; }
.tc-progress { display: flex; justify-content: center; gap: 8px; margin: 8px 0 20px; }
.tc-dot { width: 28px; height: 5px; border-radius: 3px; background: var(--border-default); transition: background .2s; }
.tc-dot.done, .tc-dot.active { background: var(--color-blue); }
.tc-panel { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow-card); }
.tc-panel-wide { padding: 18px 14px; }
.tc-title { font-size: 24px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; margin-bottom: 6px; }
.tc-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 22px; }
.tc-input { width: 100%; height: 56px; border-radius: 14px; border: 2px solid var(--border-default); background: var(--bg-surface); padding: 0 16px; font-size: 18px; font-weight: 600; color: var(--text-primary); outline: none; margin-bottom: 16px; }
.tc-input:focus { border-color: var(--color-blue); }
.tc-btn-primary { width: 100%; height: 56px; border: none; border-radius: 14px; background: var(--color-blue); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.tc-btn-primary:disabled { opacity: .5; }
.tc-btn-primary:active { transform: scale(.99); }
.tc-btn-link { background: none; border: none; color: var(--color-blue); font-size: 14px; font-weight: 600; padding: 12px 4px; cursor: pointer; }
.tc-loc-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.tc-loc-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 62px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--border-subtle); background: var(--bg-subtle); font-size: 18px; font-weight: 700; color: var(--text-primary); cursor: pointer; touch-action: manipulation; }
.tc-loc-btn:active { background: var(--color-blue-subtle); border-color: var(--color-blue); }
.tc-today { font-style: normal; font-size: 12px; font-weight: 700; color: var(--color-green-text); background: var(--color-green-subtle); padding: 4px 10px; border-radius: 20px; }
.tc-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.tc-top-info { text-align: right; }
.tc-top-loc { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.tc-top-date { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.tc-date-change { margin: 4px 0 12px; font-size: 13px; color: var(--text-tertiary); }
.tc-date-change summary { cursor: pointer; padding: 4px 0; }
.tc-date-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.tc-select { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tc-btn-small { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.tc-group-tabs { display: flex; gap: 8px; margin-bottom: 12px; background: var(--bg-hover); padding: 4px; border-radius: 14px; }
.tc-group-tab { flex: 1; min-height: 48px; border: none; border-radius: 11px; background: transparent; font-size: 15px; font-weight: 700; color: var(--text-secondary); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.tc-group-tab small { font-size: 11px; font-weight: 500; opacity: .85; }
.tc-group-tab.active { background: var(--bg-surface); color: var(--color-blue); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.tc-group-tab.sent small { color: var(--color-green-text); font-weight: 700; opacity: 1; }
.tc-group-single { flex: 1; text-align: center; padding: 10px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.tc-stats { font-size: 13px; color: var(--text-secondary); margin: 4px 2px 12px; font-weight: 600; }
.tc-child { border: 1px solid var(--border-subtle); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: var(--bg-surface); }
.tc-child-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tc-child-name { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.tc-child-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.tc-call { flex-shrink: 0; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--color-blue); background: var(--color-blue-subtle); padding: 9px 14px; border-radius: 20px; }
.tc-status-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .tc-st {
    font-size: clamp(10px, 2.75vw, 12px) !important;
    border-width: 1.5px !important;
    padding: 0 1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    letter-spacing: -0.025em !important;
  }
.tc-st.present { background: var(--color-green-subtle); color: var(--color-green-text); border-color: rgba(52,199,89,.35); }
.tc-st.absent { background: var(--color-red-subtle); color: var(--color-red-text); border-color: rgba(255,59,48,.3); }
.tc-st.excused { background: var(--color-orange-subtle); color: var(--color-orange-text); border-color: rgba(255,149,0,.35); }
.tc-st.present.on { background: #34c759; color: #fff; border-color: #34c759; }
.tc-st.absent.on { background: #ff3b30; color: #fff; border-color: #ff3b30; }
.tc-st.excused.on { background: #ffcc00; color: #3a2e00; border-color: #ffcc00; }
.tc-note-toggle { background: none; border: none; color: var(--text-tertiary); font-size: 13px; font-weight: 600; padding: 10px 0 0; cursor: pointer; }
.tc-note-toggle.has { color: var(--color-blue); }
.tc-note-box { margin-top: 10px; display: none; flex-direction: column; gap: 8px; }
.tc-note-box.open { display: flex; }
.tc-note-box label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.tc-note-box input { height: 44px; border-radius: 10px; border: 1px solid var(--border-default); padding: 0 12px; font-size: 15px; background: var(--bg-surface); color: var(--text-primary); }
.tc-note-save { height: 44px; border: none; border-radius: 10px; background: var(--bg-hover); font-weight: 700; font-size: 14px; color: var(--color-blue); cursor: pointer; }
.tc-submit { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.tc-submit-counts { text-align: center; font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; }
/* Hallen-Schnellaktionen fuer Trainer */
.tc-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tc-quick-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.tc-quick-btn:active {
  transform: scale(0.97);
}
.tc-quick-btn.present {
  background: var(--color-green-subtle);
  color: var(--color-green-text);
  border-color: rgba(52, 199, 89, 0.4);
}
.tc-quick-btn.present:hover {
  background: #34c759;
  color: #fff;
}
.tc-quick-btn.absent {
  background: var(--color-red-subtle);
  color: var(--color-red-text);
  border-color: rgba(255, 59, 48, 0.35);
}
.tc-quick-btn.absent:hover {
  background: #ff3b30;
  color: #fff;
}
.tc-quick-btn.reset {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
}
.tc-quick-btn.reset:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}



/* 3-Dot Dropdown Menu in Header */
.header-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-more-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-hairline) !important;
  color: var(--text-primary) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.header-more-btn:hover {
  background: var(--bg-surface-elevated, var(--bg-surface)) !important;
  border-color: var(--border-subtle) !important;
  transform: translateY(-0.5px);
}

.header-more-btn:active {
  transform: scale(0.95);
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--bg-surface-elevated, var(--bg-surface));
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28), 0 2px 10px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: headerMenuFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@keyframes headerMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.header-menu-status {
  padding: 8px 10px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.15s;
}

.header-menu-status:hover {
  background: var(--bg-subtle);
}

.header-menu-status-hint {
  font-size: 10.5px;
  color: var(--text-tertiary);
  padding-left: 2px;
}

.header-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

.header-menu-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 9px 12px !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-size: 13.5px !important;
  font-weight: 550 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: background 0.15s, transform 0.1s !important;
  user-select: none !important;
}

.header-menu-item:hover {
  background: var(--bg-subtle) !important;
}

.header-menu-item:active {
  transform: scale(0.98) !important;
}

.header-menu-item svg {
  flex-shrink: 0 !important;
  color: var(--text-secondary) !important;
}

.header-menu-item.menu-item-danger {
  color: var(--color-red, #ef4444) !important;
}

.header-menu-item.menu-item-danger svg {
  color: var(--color-red, #ef4444) !important;
}


/* ==========================================================================
   Plotly Dash-Inspired Server & Services Panel
   ========================================================================== */
.dash-server-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-panel-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
  transition: all 0.15s ease;
}

.dash-sync-btn:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

.dash-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.dash-tile {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.dash-tile:hover {
  border-color: var(--border-hairline);
  background: var(--bg-surface-elevated, var(--bg-surface));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dash-tile-full {
  grid-column: 1 / -1;
}

.dash-tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-tile-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-tile-icon.blue { background: rgba(0, 113, 227, 0.1); color: var(--color-blue); }
.dash-tile-icon.green { background: rgba(46, 204, 113, 0.12); color: var(--color-green-text); }
.dash-tile-icon.purple { background: #e0f2fe; color: #0284c7; }
.dash-tile-icon.orange { background: rgba(245, 158, 11, 0.12); color: var(--color-orange-text); }

.dash-tile-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.dash-tile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-tile-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-tile-k {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dash-tile-v {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.3;
}

.dash-tile-v.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.dash-tile-v.highlight-green {
  color: var(--color-green-text);
  font-weight: 700;
}

/* Folder Chips Tag Cloud */
.dash-folder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.folder-chip:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--color-blue);
}

.folder-chip svg {
  color: var(--color-blue);
  flex-shrink: 0;
}

/* Dash Logs Banner */
.dash-logs-banner {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  transition: all 0.15s ease;
}

.dash-logs-banner:hover {
  background: var(--bg-surface-elevated, var(--bg-surface));
  border-color: var(--border-hairline);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.dash-logs-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-logs-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-logs-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-logs-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-logs-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.dash-to-logs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .dash-tiles-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}


/* ==========================================================================
   Findappa & Plotly Dash Aesthetic (Premium Analytics Theme)
   ========================================================================== */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.dash-stat-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 16px 16px 12px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.dash-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
}

.dash-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.dash-stat-icon.purple { background: #fefce8; color: #b45309; }
.dash-stat-icon.gray { background: #f1f5f9; color: #64748b; }
.dash-stat-icon.green { background: #f0fdf4; color: #16a34a; }
.dash-stat-icon.orange { background: #fff7ed; color: #ea580c; }

.dash-stat-main-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.dash-stat-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.dash-trend-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.dash-trend-pill.green { background: #dcfce7; color: #15803d; }
.dash-trend-pill.blue { background: #dbeafe; color: #1d4ed8; }
.dash-trend-pill.purple { background: #fef3c7; color: #92400e; }
.dash-trend-pill.gray { background: #f1f5f9; color: #475569; }
.dash-trend-pill.orange { background: #ffedd5; color: #c2410c; }

.dash-stat-meta {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 8px;
  flex: 1;
}

.dash-sparkline-track {
  width: 100%;
  height: 22px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 4px;
}

.dash-sparkline-svg {
  width: 100%;
  height: 22px;
  display: block;
}

.dash-2col-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-finance-card,
.dash-locations-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.dash-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.dash-card-header-row .section-card-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.dash-badge-subtle {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

/* Donut Chart Panel */
.dash-donut-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 16px;
}

.dash-donut-box {
  position: relative;
  width: 126px;
  height: 126px;
  flex-shrink: 0;
}

.dash-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.dash-donut-pct {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1;
}

.dash-donut-sub {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.donut-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-dot.green { background: #10b981; }
.donut-legend-dot.orange { background: #f59e0b; }
.donut-legend-dot.purple { background: #c59b27; }

.donut-legend-meta {
  display: flex;
  flex-direction: column;
}

.donut-legend-title {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  line-height: 1.2;
}

.donut-legend-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.2;
}

.dash-kv-clickable {
  transition: background-color 0.12s;
  border-radius: 6px;
  padding: 6px 4px !important;
}
.dash-kv-clickable:hover {
  background: var(--bg-hover, #f1f5f9);
}

/* Server & Cloud Panel */
.dash-server-panel {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  margin-bottom: 24px;
}

.dash-logs-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dash-logs-banner:hover {
  border-color: #94a3b8;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.dash-to-logs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s;
}

.dash-to-logs-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

@media (max-width: 900px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .dash-2col-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-donut-panel {
    flex-direction: column;
    text-align: center;
  }
}



/* ==========================================================================
   FINDAPPA & DESIGNHIRE COMPLETE SAAS THEME (PIXEL-PERFECT)
   ========================================================================== */
.dashboard-greeting-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dash-greeting-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}

.dash-greeting-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.dash-stat-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  padding: 18px 20px 16px 20px;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.1), inset 0 1px 0 #ffffff;
}

.dash-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #64748b;
  text-transform: uppercase;
}

.dash-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.dash-stat-icon.green { background: #f0fdf4; color: #16a34a; }
.dash-stat-icon.orange { background: #fff7ed; color: #ea580c; }
.dash-stat-icon.purple { background: #fefce8; color: #b45309; }
.dash-stat-icon.gray { background: #f1f5f9; color: #64748b; }

.dash-stat-main-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.dash-stat-val {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.dash-trend-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.dash-trend-pill.green { background: #dcfce7; color: #15803d; }
.dash-trend-pill.orange { background: #ffedd5; color: #c2410c; }
.dash-trend-pill.purple { background: #fef3c7; color: #92400e; }
.dash-trend-pill.gray { background: #f1f5f9; color: #475569; }

.dash-stat-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

.dash-sparkline-track {
  width: 100%;
  height: 20px;
  margin-top: auto;
}

.dash-sparkline-svg {
  width: 100%;
  height: 20px;
  display: block;
}

/* ==========================================================================
   HIGH-END 3D GLASSMORPHISM & 4-COLOR ANALYTICS SYSTEM
   Colors: Navy (#0f172a), Cyan (#0ea5e9), Emerald (#10b981), Amber (#f59e0b)
   ========================================================================== */

#view-dashboard {
  background: radial-gradient(circle at 12% 15%, rgba(14, 165, 233, 0.05) 0%, transparent 45%),
              radial-gradient(circle at 88% 78%, rgba(16, 185, 129, 0.04) 0%, transparent 45%),
              #f8fafc;
}

.dash-master-analytics-grid {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

/* 3D Glassmorphism Cards */
.dash-glass-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.dash-glass-card:hover {
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.09), inset 0 1px 0 #ffffff;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.dash-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-card-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
  letter-spacing: -0.3px;
}

.dash-card-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.dash-badge-subtle {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: rgba(241, 245, 249, 0.85);
  padding: 3px 9px;
  border-radius: 999px;
}

.dash-chart-legend {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.legend-dot.navy { background: #0f172a; }
.legend-dot.cyan { background: #0ea5e9; }

.dash-card-divider {
  height: 1px;
  background: rgba(226, 232, 240, 0.7);
  margin: 16px 0;
  border: none;
}

/* Teil A: Balkendiagramm */
.dash-barchart-wrap {
  width: 100%;
  height: 175px;
}

.dash-barchart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bar-group {
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.bar-group:hover rect {
  filter: brightness(1.15);
}

/* Teil B: Standorte Sub-Items (2x2 Grid) */
.dash-schools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dash-school-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(226, 232, 240, 0.75);
  border-radius: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dash-school-item:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.school-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.school-icon.cyan { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.school-icon.green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.school-icon.amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.school-icon.navy { background: rgba(15, 23, 42, 0.08); color: #0f172a; }

.school-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.school-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.school-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.school-amount {
  font-size: 11px;
  color: #64748b;
  flex-shrink: 0;
}

.school-track {
  height: 5px;
  background: rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  overflow: hidden;
}

.school-fill {
  height: 100%;
  border-radius: 999px;
}
.school-fill.cyan { background: #0ea5e9; }
.school-fill.green { background: #10b981; }
.school-fill.amber { background: #f59e0b; }

.school-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
}

.school-sub {
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.school-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.school-badge.green { background: rgba(16, 185, 129, 0.14); color: #059669; }
.school-badge.amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }

/* MASTER CARD 2: UNIFIED EFFICIENCY & CINEMATIC GLOW-RINGS */
.dash-eff-unified-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-eff-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-eff-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.dash-eff-sec-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.dash-eff-center-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Cinematic Glow Ring Styling */
.glow-ring-box {
  position: relative;
  width: 115px;
  height: 115px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glow-ring-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.35));
  transition: filter 0.3s ease;
}

.glow-ring-svg.amber {
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.35));
}

.glow-ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.glow-ring-val {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.5px;
}

.glow-ring-label {
  font-size: 8.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 3px;
}

.dash-eff-chips-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.eff-chip-modern {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(226, 232, 240, 0.75);
  border-radius: 10px;
  transition: transform 0.15s ease;
}

.eff-chip-modern:hover {
  transform: translateX(2px);
}

.eff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.eff-dot.green { background: #10b981; }
.eff-dot.amber { background: #f59e0b; }
.eff-dot.navy { background: #0f172a; }
.eff-dot.cyan { background: #0ea5e9; }

.eff-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.eff-meta-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.eff-meta-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
}

/* SECTION 4: FULL-WIDTH TRANSACTIONS GLASS CARD */
.dash-transactions-card-v2 {
  margin-bottom: 24px;
}

/* Transactions List */
.dash-transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background-color 0.12s;
}
.tx-row:hover {
  background: #f8fafc;
}

.tx-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.tx-avatar.blue { background: #e0f2fe; color: #0369a1; }
.tx-avatar.purple { background: #fef3c7; color: #92400e; }
.tx-avatar.orange { background: #ffedd5; color: #c2410c; }

.tx-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tx-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-sub {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.tx-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.tx-pill.green { background: #dcfce7; color: #15803d; }
.tx-pill.orange { background: #ffedd5; color: #c2410c; }
.tx-pill.blue { background: #dbeafe; color: #1d4ed8; }

@media (max-width: 900px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .dash-main-analytics-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-bottom-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-chart-card,
  .dash-efficiency-card,
  .dash-savings-card,
  .dash-transactions-card,
  .dash-server-panel {
    padding: 16px !important;
    border-radius: 16px !important;
  }
}



/* ==========================================================================
   MOBILE RESPONSIVENESS & CUTOFF PREVENTION (<= 768px and <= 480px)
   ========================================================================== */
@media (max-width: 768px) {
  #view-dashboard .fullpage-scroll-container {
    padding: 12px 14px calc(96px + env(safe-area-inset-bottom, 24px)) 14px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* 1. Greeting Bar */
  .dashboard-greeting-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }
  .dash-greeting-title {
    font-size: 19px !important;
    line-height: 1.25 !important;
  }
  .dash-greeting-subtitle {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }
  .dash-greeting-right {
    width: 100% !important;
  }
  .dash-refresh-btn {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
    font-size: 13px !important;
  }

  /* 2. Top KPI Cards */
  .dash-kpi-grid,
  .payments-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  .dash-stat-card,
  .pay-kpi-card {
    padding: 12px 12px 10px 12px !important;
    border-radius: 14px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .dash-stat-top,
  .pay-kpi-top {
    margin-bottom: 8px !important;
  }
  .dash-stat-label,
  .pay-kpi-label {
    font-size: 9.5px !important;
    letter-spacing: 0.2px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.25 !important;
    max-width: none !important;
  }
  .dash-stat-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
  }
  .dash-stat-icon svg {
    width: 14px !important;
    height: 14px !important;
  }
  .dash-stat-main-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
  }
  .dash-stat-val,
  .pay-kpi-value {
    font-size: 22px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.5px !important;
    word-break: break-all !important;
  }
  .dash-trend-pill {
    font-size: 9.5px !important;
    padding: 1px 6px !important;
    align-self: flex-start !important;
  }
  .dash-stat-meta,
  .pay-kpi-sub {
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  .dash-sparkline-track {
    height: 16px !important;
  }
  .dash-sparkline-svg {
    height: 16px !important;
  }

  /* 3. Master Analytics Grid on Mobile / PWA App */
  .dash-master-analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 16px !important;
  }

  .dash-master-card,
  .dash-glass-card,
  .dash-transactions-card-v2 {
    padding: 16px 14px !important;
    border-radius: 18px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  }

  .dash-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .dash-header-meta {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .dash-card-title {
    font-size: 15px !important;
  }

  .dash-card-subtitle {
    font-size: 11.5px !important;
  }

  /* Bar chart on mobile: fully responsive SVG */
  .dash-barchart-wrap {
    width: 100% !important;
    height: 160px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    min-width: 0 !important;
  }
  .dash-barchart-svg {
    min-width: 360px !important;
    height: 100% !important;
    display: block !important;
  }

  /* Standorte 4-Item List on mobile */
  .dash-schools-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .dash-school-item {
    padding: 9px 10px !important;
    gap: 9px !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, 0.7) !important;
  }

  .school-icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
  }
  .school-icon svg {
    width: 15px !important;
    height: 15px !important;
  }

  .school-head {
    font-size: 11.5px !important;
  }
  .school-amount {
    font-size: 10.5px !important;
  }
  .school-track {
    height: 5px !important;
  }
  .school-footer {
    font-size: 10px !important;
  }
  .school-badge {
    font-size: 9px !important;
    padding: 1px 6px !important;
  }

  /* Payment Efficiency on Mobile / PWA App */
  .dash-eff-unified-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .dash-eff-section {
    gap: 6px !important;
  }

  .dash-eff-sec-title {
    font-size: 12.5px !important;
  }

  .dash-eff-center-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .glow-ring-box {
    width: 90px !important;
    height: 90px !important;
    flex-shrink: 0 !important;
  }

  .glow-ring-val {
    font-size: 19px !important;
    letter-spacing: -0.5px !important;
  }

  .glow-ring-label {
    font-size: 7.5px !important;
  }

  .dash-eff-chips-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .eff-chip-modern {
    padding: 5px 8px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    gap: 6px !important;
  }

  .eff-dot {
    width: 7px !important;
    height: 7px !important;
  }

  .eff-meta-val {
    font-size: 10.5px !important;
    line-height: 1.2 !important;
  }

  .eff-meta-sub {
    font-size: 9.5px !important;
    line-height: 1.2 !important;
  }

  .dash-card-divider {
    margin: 12px 0 !important;
  }

  /* Transactions List on Mobile */
  .tx-row {
    padding: 8px 8px !important;
    gap: 10px !important;
  }
  .tx-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
  .tx-name {
    font-size: 12.5px !important;
  }
  .tx-sub {
    font-size: 10.5px !important;
  }
  .tx-amount {
    font-size: 12px !important;
  }
  .tx-pill {
    font-size: 9.5px !important;
    padding: 1px 6px !important;
  }

  /* 5. Server Panel on Mobile */
  .dash-server-panel {
    padding: 16px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .dash-panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .dash-panel-title {
    font-size: 14px !important;
    line-height: 1.3 !important;
  }
  .dash-sync-btn {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
    font-size: 13px !important;
  }
  .dash-tiles-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .dash-tile {
    padding: 12px 14px !important;
    box-sizing: border-box !important;
  }
  .dash-tile-v {
    font-size: 11.5px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  .dash-folder-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .folder-chip {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }
  .dash-logs-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 14px !important;
  }
  .dash-to-logs-btn {
    width: 100% !important;
    justify-content: center !important;
    height: 36px !important;
  }
}

/* Extra small devices (<= 380px) */
@media (max-width: 380px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-efficiency-chips {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .eff-chip {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }
}



/* ==========================================================================
   MODERN METRIC PROGRESS BARS & TRAININGSSETS HIGHLIGHT
   ========================================================================== */
.dash-kpi-bar-wrap {
  width: 100%;
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-kpi-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border-color, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  position: relative;
}

.dash-kpi-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.dash-kpi-bar-fill.blue { background: #2563eb; }
.dash-kpi-bar-fill.green { background: #10b981; }
.dash-kpi-bar-fill.orange { background: #f59e0b; }
.dash-kpi-bar-fill.purple { background: #c59b27; }
.dash-kpi-bar-fill.amber { background: #f59e0b; }
.dash-kpi-bar-fill.gray { background: #94a3b8; }

.dash-kpi-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  font-weight: 500;
  line-height: 1.2;
}

.dash-kpi-bar-lbl-left {
  color: var(--text-secondary, #475569);
  font-weight: 600;
}

.dash-kpi-bar-lbl-right {
  text-align: right;
  color: var(--text-tertiary, #94a3b8);
}

.jersey-highlight-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dash-stat-val-highlight {
  font-weight: 800;
  letter-spacing: -0.5px;
}

.dash-order-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .dash-kpi-bar-track {
  background: #334155;
}

[data-theme="dark"] .dash-kpi-bar-lbl-left {
  color: #cbd5e1;
}

[data-theme="dark"] .dash-kpi-bar-lbl-right {
  color: #94a3b8;
}


/* ==========================================================================
   2 SEPARATE EFFICIENCY CARDS (KURSE & TRAININGNSETS)
   ========================================================================== */
.dash-efficiency-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-efficiency-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dash-efficiency-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.dash-donut-box-compact {
  position: relative;
  width: 105px;
  height: 105px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-donut-svg-compact {
  width: 105px;
  height: 105px;
  display: block;
}

.dash-donut-compact-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.dash-donut-compact-val {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1;
  letter-spacing: -0.5px;
}

.dash-donut-compact-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary, #94a3b8);
  margin-top: 2px;
}

.dash-efficiency-chips-v {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.dash-efficiency-chips-v .eff-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
}

.eff-chip-dot.navy { background: #1e293b; }
.eff-chip-dot.cyan { background: #0ea5e9; }
.eff-chip-dot.purple { background: #c59b27; }
.eff-chip-dot.orange { background: #f59e0b; }
.eff-chip-dot.gray { background: #94a3b8; }

[data-theme="dark"] .dash-efficiency-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .dash-efficiency-chips-v .eff-chip {
  background: #0f172a;
}

[data-theme="dark"] .dash-donut-compact-val {
  color: #f8fafc;
}

[data-theme="dark"] .eff-chip-dot.navy {
  background: #38bdf8;
}

@media (max-width: 768px) {
  .dash-efficiency-column {
    gap: 12px !important;
  }
  .dash-efficiency-body {
    flex-direction: row !important;
    gap: 12px !important;
  }
  .dash-donut-box-compact {
    width: 90px !important;
    height: 90px !important;
  }
  .dash-donut-svg-compact {
    width: 90px !important;
    height: 90px !important;
  }
  .dash-donut-compact-val {
    font-size: 16px !important;
  }
  .dash-donut-compact-label {
    font-size: 8px !important;
  }
  .dash-efficiency-chips-v .eff-chip {
    padding: 3px 6px !important;
  }
}


/* ==========================================================================
   OFFICIAL CLUB GOLD PALETTE (REPLACES PURPLE & PINK)
   ========================================================================== */
.dot.gold {
  background: #c59b27 !important;
  box-shadow: 0 0 6px rgba(197, 155, 39, 0.45) !important;
}

.dash-stat-icon.gold {
  background: #fef9c3 !important;
  color: #b45309 !important;
}

.dash-trend-pill.gold {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

.dash-badge-pill.gold {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

.dash-kpi-bar-fill.gold {
  background: #c59b27 !important;
}

.eff-chip-dot.gold {
  background: #c59b27 !important;
}

.tx-avatar.gold {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.footer-badge.gold {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

.savings-icon.cyan {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

/* Comprehensive override to ensure NO purple or pink ever renders */
.dot.purple, .dot.pink { background: #c59b27 !important; }
.dash-stat-icon.purple, .dash-stat-icon.pink { background: #fef9c3 !important; color: #b45309 !important; }
.dash-trend-pill.purple, .dash-trend-pill.pink { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.dash-badge-pill.purple, .dash-badge-pill.pink { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.dash-kpi-bar-fill.purple, .dash-kpi-bar-fill.pink { background: #c59b27 !important; }
.eff-chip-dot.purple, .eff-chip-dot.pink { background: #c59b27 !important; }
.tx-avatar.purple, .tx-avatar.pink { background: #fef3c7 !important; color: #92400e !important; }
.savings-icon.purple, .savings-icon.pink { background: #e0f2fe !important; color: #0284c7 !important; }
.pay-kpi-dot.purple, .pay-kpi-dot.pink { background: #c59b27 !important; }
.dash-tile-icon.purple, .dash-tile-icon.pink { background: #e0f2fe !important; color: #0284c7 !important; }
.footer-badge.purple, .footer-badge.pink { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #fde68a !important; }

[data-theme="dark"] .dash-stat-icon.gold,
[data-theme="dark"] .dash-stat-icon.purple {
  background: rgba(197, 155, 39, 0.22) !important;
  color: #fde047 !important;
}

[data-theme="dark"] .dash-trend-pill.gold,
[data-theme="dark"] .dash-trend-pill.purple,
[data-theme="dark"] .dash-badge-pill.gold,
[data-theme="dark"] .dash-badge-pill.purple {
  background: rgba(197, 155, 39, 0.22) !important;
  color: #fde047 !important;
  border-color: rgba(197, 155, 39, 0.45) !important;
}

[data-theme="dark"] .tx-avatar.gold,
[data-theme="dark"] .tx-avatar.purple {
  background: rgba(197, 155, 39, 0.22) !important;
  color: #fde047 !important;
}

[data-theme="dark"] .footer-badge.gold,
[data-theme="dark"] .footer-badge.purple {
  background: rgba(197, 155, 39, 0.22) !important;
  color: #fde047 !important;
  border-color: rgba(197, 155, 39, 0.45) !important;
}

/* Responsive overrides for Master Analytics Grid */
@media (max-width: 900px) {
  .dash-master-analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

@media (max-width: 600px) {
  .dash-schools-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-eff-center-row {
    flex-direction: row !important;
    gap: 12px !important;
  }
  .glow-ring-box {
    width: 95px !important;
    height: 95px !important;
  }
  .glow-ring-val {
    font-size: 18px !important;
  }
  .glow-ring-label {
    font-size: 8px !important;
  }
}


/* ==========================================================================
   TRAINER PORTAL: REGISTRATION WIZARD, DASHBOARD & PRAE HOURS
   ========================================================================== */
.login-mode-tabs {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
  gap: 4px;
}

.login-mode-tab {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.login-mode-tab.active {
  background: var(--bg-surface);
  color: var(--color-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.login-field-input.plain {
  padding-left: 14px !important;
  padding-right: 14px !important;
  height: 44px;
  margin-bottom: 12px;
}

.reg-step-header {
  margin-bottom: 14px;
}

.reg-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-blue);
  background: var(--color-blue-subtle);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.reg-step-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.reg-step-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.reg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .reg-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.reg-check-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.reg-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
}

.reg-check-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--color-blue);
  flex-shrink: 0;
}

.tdash-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .tdash-action-grid {
    grid-template-columns: 1fr;
  }
}

.tdash-action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.tdash-action-card:hover {
  border-color: var(--color-blue);
  transform: translateY(-2px);
}

.tdash-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tdash-action-icon.blue {
  background: var(--color-blue-subtle);
  color: var(--color-blue);
}

.tdash-action-icon.green {
  background: var(--color-green-subtle);
  color: var(--color-green-text);
}

.tdash-action-body {
  flex: 1;
}

.tdash-action-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.tdash-action-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

.tdash-action-arrow {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-blue);
  flex-shrink: 0;
}

.tc-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-blue);
  background: var(--color-blue-subtle);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.th-date-picker-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
}

.th-quick-dates {
  display: flex;
  gap: 8px;
}

.th-chip {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.th-chip.active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #ffffff;
}

.th-hours-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.th-hour-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 68px;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}

.th-hour-card.active {
  border-color: var(--color-blue);
  background: var(--color-blue-subtle);
}

.th-hr-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.th-hr-eur {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-blue);
}

.th-confirm-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.th-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
}

.th-confirm-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.th-confirm-row.highlight {
  padding-top: 4px;
  font-size: 15px;
  color: var(--color-blue);
}

.th-confirm-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.th-confirm-val {
  color: var(--text-primary);
  font-weight: 800;
}


  .prae-month-sheet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.prae-days-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 16px 0;
}

@media (max-width: 640px) {
  .prae-days-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.prae-day-cell {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-subtle);
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prae-day-cell.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: #0284c7;
}

.prae-day-num {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.prae-day-amt {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.prae-day-cell.active .prae-day-amt {
  color: #0284c7;
}

.prae-sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   UNIVERSAL PWA MOBILE APP GLASS STYLING (ALL VIEWS)
   ========================================================================== */
body,
.fullpage-view,
.fullpage-scroll-container,
#view-dashboard,
#view-assistant,
#view-payments,
#view-attendance,
#view-semester,
#view-trainer {
  background: radial-gradient(circle at 10% 12%, rgba(14, 165, 233, 0.05) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 40%),
              #f8fafc !important;
}

/* Universal Glass Cards across PWA */
.box-card,
.pay-kpi-card,
.payments-toolbar-card,
.attendance-toolbar-card,
.semester-box-card,
.dash-glass-card,
.dash-stat-card {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

/* PWA App Top Header & Bottom Footer Switcher */
.app-header {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75) !important;
}

.bottom-footer-switcher {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06) !important;
}

.bottom-footer-tab.active {
  color: #0284c7 !important;
}

.bottom-footer-tab.active .bottom-footer-icon {
  color: #0ea5e9 !important;
  filter: drop-shadow(0 0 6px rgba(14, 165, 233, 0.35)) !important;
}

/* ==========================================================================
   TIER-1 HIGH-END DESIGN SYSTEM: AURORA MESH, MOTION, SPECULAR GLARE & FINTECH
   ========================================================================== */

/* 1. Dynamisches Aurora-Mesh im Hintergrund */
body::before {
  content: '';
  position: fixed;
  top: -20vh;
  left: -20vw;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: auroraDrift1 22s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20vh;
  right: -20vw;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: auroraDrift2 26s ease-in-out infinite alternate;
}

@keyframes auroraDrift1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(12vw, 8vh) scale(1.18); }
}

@keyframes auroraDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10vw, -10vh) scale(1.15); }
}

/* 2. Dynamischer Lichtreflex (Specular Glare) auf den KPI-Cards */
.dash-stat-card,
.pay-kpi-card {
  position: relative !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}
.dash-glass-card,
.box-card,
.payments-toolbar-card,
.attendance-toolbar-card,
.semester-box-card {
  position: relative !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
}

.dash-glass-card::before,
.dash-stat-card::before,
.box-card::before,
.pay-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: none;
  pointer-events: none;
  z-index: 1;
}

.dash-glass-card:hover::before,
.dash-stat-card:hover::before,
.box-card:hover::before,
.pay-kpi-card:hover::before {
  left: 150%;
  transition: left 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Atmendes Glühen (Ambient Glow Pulse) */
@keyframes ambientPulseCyan {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.3)); }
  50% { filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.65)); }
}

@keyframes ambientPulseAmber {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3)); }
  50% { filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.65)); }
}

.glow-ring-svg {
  animation: ambientPulseCyan 4.5s ease-in-out infinite;
}
.glow-ring-svg.amber {
  animation: ambientPulseAmber 4.5s ease-in-out infinite;
}

/* 4. High-Precision Fintech-Typografie & Cent-Formatierung */
.dash-stat-val,
.school-amount,
.eff-meta-sub,
.glow-ring-val,
.tx-amount,
.pay-kpi-value,
.th-confirm-val {
  font-feature-settings: "tnum" 1, "cv05" 1 !important;
  font-variant-numeric: tabular-nums !important;
}

.fintech-cents {
  font-size: 0.72em !important;
  opacity: 0.68 !important;
  font-weight: 600 !important;
  margin-left: 1px !important;
  display: inline-block !important;
}

/* Live Status Glow Dot */
.status-glow-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: statusDotPulse 2s infinite ease-in-out;
  margin-right: 5px;
  vertical-align: middle;
}

@keyframes statusDotPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 12px rgba(52, 211, 153, 0.95); }
}

/* 5. Quick-Actions in der Rechnungsliste */
.tx-actions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #475569;
}

.tx-action-btn:hover {
  transform: scale(1.1);
}

.tx-action-btn.mail:hover {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.4);
}

.tx-action-btn.pay:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.4);
}

/* 6. Spotlight Suche Modal (Strg+K) */
.spotlight-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}

.spotlight-dialog {
  width: 90%;
  max-width: 580px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.spotlight-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.spotlight-icon {
  color: #0ea5e9;
  flex-shrink: 0;
}

.spotlight-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}
.spotlight-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.spotlight-kbd {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 6px;
  color: #64748b;
}

.spotlight-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spotlight-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13.5px;
}

.spotlight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.spotlight-item:hover, .spotlight-item.active {
  background: rgba(14, 165, 233, 0.09);
  transform: translateX(2px);
}

.spotlight-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.05);
  color: #0ea5e9;
  flex-shrink: 0;
}
.spotlight-item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.spotlight-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}
.spotlight-item-sub {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-item-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
}

/* ==========================================================================
   7. OBSIDIAN-GLASS DARK-MODE (OLED & DARK SLATE)
   Comprehensive, WCAG AAA compliant high-contrast theme across all views,
   cards, tables, form controls, modals and navigation.
   ========================================================================== */

[data-theme="dark"] html {
  background-color: #0b0f19 !important;
}

[data-theme="dark"] body {
  background-color: #0b0f19 !important;
  background-image: linear-gradient(rgba(11, 15, 25, 0.90), rgba(11, 15, 25, 0.95)), url('./img/stadium-bg.png') !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .fullpage-view,
[data-theme="dark"] .fullpage-scroll-container,
[data-theme="dark"] .view-section,
[data-theme="dark"] #view-dashboard,
[data-theme="dark"] #view-assistant,
[data-theme="dark"] #view-payments,
[data-theme="dark"] #view-attendance,
[data-theme="dark"] #view-semester,
[data-theme="dark"] #view-logs,
[data-theme="dark"] #view-trainer,
[data-theme="dark"] #view-trainer-dash,
[data-theme="dark"] #view-trainer-hours,
[data-theme="dark"] #view-prae-admin {
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* Glass-Slate Cards, Panels & Containers */
[data-theme="dark"] .dash-glass-card,
[data-theme="dark"] .dash-stat-card,
[data-theme="dark"] .dash-master-card,
[data-theme="dark"] .dash-transactions-card-v2,
[data-theme="dark"] .dash-efficiency-card,
[data-theme="dark"] .box-card,
[data-theme="dark"] .pay-kpi-card,
[data-theme="dark"] .payments-toolbar-card,
[data-theme="dark"] .attendance-toolbar-card,
[data-theme="dark"] .semester-box-card,
[data-theme="dark"] .loc-card-group,
[data-theme="dark"] .tc-panel,
[data-theme="dark"] .tdash-action-card,
[data-theme="dark"] .prae-admin-sidebar,
[data-theme="dark"] .prae-admin-sheet-wrap,
[data-theme="dark"] .prae-month-sheet-card,
[data-theme="dark"] .login-screen-box,
[data-theme="dark"] .order-detail-pane,
[data-theme="dark"] .order-split-view,
[data-theme="dark"] .attendance-lists-stack,
[data-theme="dark"] .dash-server-panel,
[data-theme="dark"] .bcc-reminder-card,
[data-theme="dark"] .th-hour-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .school-card,
[data-theme="dark"] .tatt-session-card {
  background: rgba(19, 27, 46, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

/* App Header & Bottom Navigation */
[data-theme="dark"] .app-header {
  background: rgba(11, 15, 25, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

[data-theme="dark"] .bottom-footer-switcher {
  background: rgba(11, 15, 25, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

[data-theme="dark"] .footer-nav-btn {
  color: #94a3b8 !important;
}

[data-theme="dark"] .footer-nav-btn.active,
[data-theme="dark"] .footer-nav-btn:hover {
  color: #38bdf8 !important;
}

/* Modals, Overlays, Dialogs & Dropdowns */
[data-theme="dark"] .login-screen-overlay {
  background: radial-gradient(circle at 12% 15%, rgba(14, 165, 233, 0.14) 0%, transparent 45%),
              radial-gradient(circle at 88% 82%, rgba(16, 185, 129, 0.10) 0%, transparent 45%),
              #080c16 !important;
}

[data-theme="dark"] .header-dropdown-menu,
[data-theme="dark"] .spotlight-dialog,
[data-theme="dark"] .dialog-box,
[data-theme="dark"] .modal-box,
[data-theme="dark"] .app-modal,
[data-theme="dark"] .tc-modal-sheet,
[data-theme="dark"] .order-review-modal-box,
[data-theme="dark"] .tc-modal-content {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .header-menu-item {
  color: #f8fafc !important;
}

[data-theme="dark"] .header-menu-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .header-menu-divider {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Form Controls, Inputs, Selects & Textareas */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .login-field-input,
[data-theme="dark"] .tc-input,
[data-theme="dark"] .tc-select,
[data-theme="dark"] .th-day-input,
[data-theme="dark"] .prae-admin-day-input,
[data-theme="dark"] .spotlight-input,
[data-theme="dark"] .table-search-input,
[data-theme="dark"] .bcc-readonly-input {
  background-color: #1a2337 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .login-field-input:focus,
[data-theme="dark"] .tc-input:focus,
[data-theme="dark"] .tc-select:focus,
[data-theme="dark"] .spotlight-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  outline: none !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b !important;
}

[data-theme="dark"] .login-field-label,
[data-theme="dark"] .tc-label,
[data-theme="dark"] label {
  color: #cbd5e1 !important;
}

/* Tables, Data Grids & Rows */
[data-theme="dark"] table {
  color: #f8fafc !important;
}

[data-theme="dark"] th,
[data-theme="dark"] .table-header,
[data-theme="dark"] .dash-th,
[data-theme="dark"] .att-table-th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] td,
[data-theme="dark"] .table-cell,
[data-theme="dark"] .dash-td,
[data-theme="dark"] .att-table-td {
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] tr:hover,
[data-theme="dark"] .tx-row:hover,
[data-theme="dark"] .dash-school-item:hover,
[data-theme="dark"] .table-row:hover,
[data-theme="dark"] .order-row:hover,
[data-theme="dark"] .student-row:hover,
[data-theme="dark"] .tatt-student-row:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .dash-school-item,
[data-theme="dark"] .eff-chip-modern,
[data-theme="dark"] .order-list-item,
[data-theme="dark"] .student-row,
[data-theme="dark"] .tatt-student-row {
  background: rgba(24, 34, 56, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

/* Typography, Headings & Text Contrast */
[data-theme="dark"] .dash-card-title,
[data-theme="dark"] .dash-panel-title,
[data-theme="dark"] .dash-main-title,
[data-theme="dark"] .dash-stat-val,
[data-theme="dark"] .school-head,
[data-theme="dark"] .dash-eff-sec-title,
[data-theme="dark"] .glow-ring-val,
[data-theme="dark"] .tx-name,
[data-theme="dark"] .tx-amount,
[data-theme="dark"] .eff-meta-val,
[data-theme="dark"] .login-title,
[data-theme="dark"] .reg-step-title,
[data-theme="dark"] .tdash-action-title,
[data-theme="dark"] .order-review-title,
[data-theme="dark"] .header-trainer-info strong,
[data-theme="dark"] strong {
  color: #f8fafc !important;
}

[data-theme="dark"] .dash-card-subtitle,
[data-theme="dark"] .dash-main-subtitle,
[data-theme="dark"] .dash-panel-sub,
[data-theme="dark"] .school-sub,
[data-theme="dark"] .tx-meta,
[data-theme="dark"] .eff-meta-lbl,
[data-theme="dark"] .reg-step-sub,
[data-theme="dark"] .tdash-action-sub,
[data-theme="dark"] .header-trainer-info small,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .subtext {
  color: #94a3b8 !important;
}

/* Log Console & Logs View */
[data-theme="dark"] .log-console-card,
[data-theme="dark"] .log-output-pane,
[data-theme="dark"] #log-output-box {
  background: #060913 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

/* Document Previews & Paper Sheet Legibility */
[data-theme="dark"] .prae-official-form-sheet,
[data-theme="dark"] .pdf-preview-img,
[data-theme="dark"] #preview-pdf-frame,
[data-theme="dark"] .att-sheet-img,
[data-theme="dark"] .pdf-lightbox-body img,
[data-theme="dark"] .sig-canvas {
  background-color: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .pdf-preview-container,
[data-theme="dark"] .pdf-lightbox-body,
[data-theme="dark"] .prae-sheet-scroll-wrap {
  background: #080c16 !important;
}

/* Custom Scrollbars in Dark Mode */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: transparent !important;
}


/* ==========================================================================
   PERFECT MOBILE VIEWPORT & CUTOFF PREVENTION (< 768px and < 480px)
   100% Zero-Overflow · Universal Viewport Safety · Flexible Cards, Grids & Tables
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Global Viewport & Container Spacing (Universal Overflow Protection) */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
  }

  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  .app-viewport,
  .app-body,
  .fullpage-view {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .fullpage-view.active {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    box-sizing: border-box !important;
  }

  /* Universal container padding: Consistent 14px horizontal and safe-area bottom clearance (No bottom cut-off) */
  .fullpage-scroll-container,
  .workspace-main,
  #view-dashboard .fullpage-scroll-container,
  #view-payments .fullpage-scroll-container,
  #view-attendance .fullpage-scroll-container,
  #view-trainer-dash .fullpage-scroll-container,
  #view-trainer .fullpage-scroll-container,
  #view-trainer-hours .fullpage-scroll-container,
  #view-semester .fullpage-scroll-container,
  #view-logs .fullpage-scroll-container,
  #view-prae-admin .fullpage-scroll-container {
    padding: 12px 14px calc(96px + env(safe-area-inset-bottom, 24px)) 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
  }

  /* Trainer portal wrap inside fullpage-scroll-container */
  .tc-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 4px !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 24px)) !important;
    margin: 0 auto !important;
  }

  /* 2. Fixed Header & Mobile Navigation */
  .app-header {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    min-height: calc(52px + env(safe-area-inset-top, 0px)) !important;
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 8px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  .bottom-footer-switcher {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    z-index: 800 !important;
    box-sizing: border-box !important;
  }

  .footer-nav-btn {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 2px 1px !important;
    gap: 2px !important;
  }

  .footer-nav-label {
    font-size: clamp(9.5px, 2.7vw, 11px) !important;
    letter-spacing: -0.015em !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 100% !important;
    text-align: center !important;
  }

  .footer-badge {
    top: -4px !important;
    right: -8px !important;
    font-size: 9px !important;
    padding: 0 3.5px !important;
    min-width: 15px !important;
    height: 15px !important;
  }

  /* 3. Section Headers & Action Bars */
  .dashboard-section-header,
  .dashboard-greeting-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-main-title {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  .dash-main-subtitle {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .dashboard-section-header > div:last-child,
  .dash-header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .dashboard-section-header > div:last-child button,
  .dashboard-section-header > div:last-child a,
  .dash-header-actions button,
  .dash-header-actions a,
  .dash-header-actions select {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  /* 4. Top KPI Cards - 2 Columns using minmax(0, 1fr) with zero edge cutoff */
  .dash-kpi-grid,
  .payments-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-stat-card,
  .pay-kpi-card {
    padding: 11px 10px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 14px !important;
  }

  .dash-stat-top,
  .pay-kpi-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
  }

  .dash-stat-label,
  .pay-kpi-label {
    font-size: 9.5px !important;
    letter-spacing: 0.2px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.25 !important;
    max-width: none !important;
    word-break: break-word !important;
  }

  .dash-stat-icon {
    width: 26px !important;
    height: 26px !important;
    flex-shrink: 0 !important;
  }

  .dash-stat-icon svg {
    width: 13px !important;
    height: 13px !important;
  }

  .dash-stat-main-row {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
    margin-bottom: 4px !important;
  }

  .dash-stat-val,
  .pay-kpi-value {
    font-size: clamp(17px, 4.2vw, 21px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.5px !important;
    word-break: break-word !important;
    min-width: 0 !important;
  }

  .dash-trend-pill {
    font-size: 9px !important;
    padding: 1.5px 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .dash-stat-meta,
  .pay-kpi-sub {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-break: break-word !important;
    margin-bottom: 4px !important;
    max-width: 100% !important;
  }

  .jersey-highlight-row {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .dash-order-pill {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .dash-kpi-bar-labels {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 10px !important;
  }

  .dash-kpi-bar-lbl-left,
  .dash-kpi-bar-lbl-right {
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 100% !important;
    font-size: 9.5px !important;
    line-height: 1.2 !important;
  }

  /* 5. Master Analytics Grid - Single Column on Mobile */
  .dash-master-analytics-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-master-card,
  .dash-glass-card,
  .dash-transactions-card-v2,
  .dash-efficiency-card {
    padding: 14px 12px !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .dash-card-header {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-header-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
  }

  #eff-overall-quote-pill {
    flex-shrink: 0 !important;
    font-size: 10px !important;
    padding: 2px 7px !important;
  }

  /* 6. Responsive Bar Chart - Scrollable SVG wrapper */
  .dash-barchart-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    box-sizing: border-box !important;
  }

  .dash-barchart-svg {
    min-width: 290px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 150px !important;
    display: block !important;
  }

  /* 7. Standorte List on Mobile - Zero Edge Cutoff */
  .dash-schools-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-school-item {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 9px 10px !important;
    border-radius: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .school-content {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
  }

  .school-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .school-name {
    font-size: 11.5px !important;
    white-space: normal !important;
    word-break: break-word !important;
    flex: 1 1 120px !important;
    min-width: 0 !important;
  }

  .school-amount {
    font-size: 11px !important;
    flex-shrink: 0 !important;
    text-align: right !important;
  }

  .school-track {
    height: 5px !important;
    width: 100% !important;
    border-radius: 999px !important;
    margin: 2px 0 !important;
  }

  .school-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .school-sub {
    font-size: 10px !important;
    white-space: normal !important;
    word-break: break-word !important;
    flex: 1 1 120px !important;
    min-width: 0 !important;
  }

  .school-badge {
    font-size: 9px !important;
    padding: 1px 6px !important;
    flex-shrink: 0 !important;
    border-radius: 999px !important;
  }

  /* 8. Payment Efficiency on Mobile - Kurse & Trainingssets */
  .dash-efficiency-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .dash-eff-section-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
  }

  #eff-course-quote-pill,
  #eff-jersey-quote-pill {
    flex-shrink: 0 !important;
    font-size: 10px !important;
    padding: 1px 6px !important;
  }

  .dash-efficiency-body,
  .dash-eff-center-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .dash-donut-box-compact,
  .glow-ring-box {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    flex-shrink: 0 !important;
  }

  .dash-donut-svg-compact {
    width: 80px !important;
    height: 80px !important;
  }

  .dash-donut-compact-val,
  .glow-ring-val {
    font-size: 16px !important;
    line-height: 1 !important;
  }

  .dash-donut-compact-label,
  .glow-ring-label {
    font-size: 7.5px !important;
  }

  .dash-efficiency-chips-v,
  .dash-eff-chips-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .eff-chip,
  .eff-chip-modern {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .eff-meta {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .eff-meta-val {
    font-size: 10px !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }

  .eff-meta-sub {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  /* 9. Transactions List & Invoices */
  .tx-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    padding: 8px 8px !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tx-info {
    flex: 1 1 130px !important;
    min-width: 0 !important;
  }

  .tx-name {
    font-size: 12px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .tx-sub {
    font-size: 10px !important;
  }

  .tx-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .tx-amount {
    font-size: 12px !important;
  }

  .tx-action-btn {
    width: 26px !important;
    height: 26px !important;
    flex-shrink: 0 !important;
  }

  /* 10. Payments View Toolbar & Cards */
  .bcc-card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .bcc-input-action-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .bcc-readonly-input {
    width: 100% !important;
    min-width: 0 !important;
  }

  .bcc-btn-group {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .bcc-btn-group > * {
    flex: 1 !important;
    justify-content: center !important;
  }

  .payments-subtabs-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .payments-subtabs,
  .payments-category-chips {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
  }

  .payments-search-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .payments-search-row .search-input-wrap {
    width: 100% !important;
  }

  .payments-search-row button {
    width: 100% !important;
    justify-content: center !important;
  }

  .payment-participant-card {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .pay-card-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .pay-card-identity {
    flex: 1 1 180px !important;
    min-width: 0 !important;
  }

  .pay-child-name {
    white-space: normal !important;
    word-break: break-word !important;
  }

  .pay-card-right {
    text-align: right !important;
    flex-shrink: 0 !important;
  }

  .pay-card-middle {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .pay-card-bottom {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .btn-mark-paid, .btn-mark-unpaid {
    width: 100% !important;
    justify-content: center !important;
    height: 34px !important;
  }

  /* 11. Tables in Attendance, Semester, Logs, PRAE */
  .att-table-scroll,
  .semester-table-wrap,
  .logs-terminal-box,
  .prae-official-form-sheet,
  .prae-admin-sheet-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .att-sheet-table {
    min-width: 700px !important;
  }

  .semester-table {
    min-width: 600px !important;
  }

  .prae-days-grid,
  .prae-admin-days-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .prae-admin-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
  }

  /* 12. Trainer Portal on Mobile */
  .tc-wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding: 4px 0 24px 0 !important;
  }

  .tdash-action-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .tdash-action-card {
    padding: 16px 14px !important;
    flex-wrap: wrap !important;
  }

  .th-hours-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .th-confirm-row {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  /* 13. Server Panel on Mobile */
  .dash-server-panel {
    padding: 14px 12px !important;
  }

  .dash-panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .dash-sync-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .dash-tiles-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .dash-tile-row {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  .dash-tile-v {
    white-space: normal !important;
    word-break: break-word !important;
  }
}

/* Extra small devices (<= 380px) */
@media (max-width: 380px) {
  .fullpage-scroll-container,
  .workspace-main,
  #view-dashboard .fullpage-scroll-container,
  #view-payments .fullpage-scroll-container,
  #view-attendance .fullpage-scroll-container,
  #view-trainer-dash .fullpage-scroll-container,
  #view-trainer .fullpage-scroll-container,
  #view-trainer-hours .fullpage-scroll-container,
  #view-semester .fullpage-scroll-container,
  #view-logs .fullpage-scroll-container,
  #view-prae-admin .fullpage-scroll-container {
    padding: 10px 10px calc(96px + env(safe-area-inset-bottom, 24px)) 10px !important;
  }

  .dash-kpi-grid,
  .payments-kpi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .dash-efficiency-body,
  .dash-eff-center-row {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .dash-efficiency-chips-v,
  .dash-eff-chips-col {
    width: 100% !important;
  }

  .footer-nav-label {
    font-size: 9px !important;
  }

  .footer-nav-icon-wrap svg {
    width: 16px !important;
    height: 16px !important;
  }

  .prae-days-grid,
  .prae-admin-days-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }
}


/* ==========================================================================
   ADMIN PRAE ENDKONTROLLE
   ========================================================================== */
.prae-admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

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

.prae-admin-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.prae-admin-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-hairline);
}

.prae-admin-trainers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prae-admin-trainer-item {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-subtle);
  padding: 11px 12px;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.prae-admin-trainer-item:hover {
  border-color: var(--color-blue);
}

.prae-admin-trainer-item.active {
  background: var(--color-blue-subtle);
  border-color: var(--color-blue);
}

.prae-admin-sheet-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.prae-admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.prae-official-form-sheet {
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px;
  background: #ffffff;
}

.prae-form-top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #0f172a;
}

.prae-admin-days-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

@media (max-width: 720px) {
  .prae-admin-days-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.prae-admin-day-box {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-subtle);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}

.prae-admin-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
}

.prae-weekday-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.prae-weekday-tag.tag-blocked {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.prae-weekday-tag.tag-active {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.prae-weekday-tag.tag-course {
  background: rgba(16, 185, 129, 0.18);
  color: #059669;
}

.prae-admin-day-box.is-blocked {
  opacity: 0.45;
  background: rgba(241, 245, 249, 0.6) !important;
  cursor: not-allowed;
  border-style: dashed;
}

[data-theme="dark"] .prae-admin-day-box.is-blocked {
  background: rgba(30, 41, 59, 0.4) !important;
  opacity: 0.35;
}

.prae-admin-day-box.is-blocked input {
  background: transparent !important;
  cursor: not-allowed;
  color: #94a3b8 !important;
}

.prae-admin-day-box.is-course-day {
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.15);
}

.prae-admin-day-box.has-val {
  background: rgba(14, 165, 233, 0.1);
  border-color: #0284c7;
}

[data-theme="dark"] .prae-admin-day-box.has-val {
  background: rgba(2, 132, 199, 0.22);
  border-color: #38bdf8;
}

.prae-admin-day-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.prae-admin-day-input {
  width: 100%;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #ffffff;
  text-align: right;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

[data-theme="dark"] .prae-admin-day-input {
  background: #1e293b;
  color: #f8fafc;
}

.prae-admin-day-input:focus {
  border-color: var(--color-blue);
  outline: none;
}

/* ==========================================================================
   TRAINER HOURS STREAMLINED UI (ZERO REDUNDANCY)
   ========================================================================== */
.th-card-badge-standard {
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.4);
}

.th-live-selection-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 14px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
}

[data-theme="dark"] .th-live-selection-bar {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #f8fafc;
}

.th-live-selection-bar strong {
  color: #0284c7;
}

[data-theme="dark"] .th-live-selection-bar strong {
  color: #38bdf8;
}

.th-hour-card {
  position: relative !important;
  border-radius: 14px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.th-hour-card.active {
  border-color: #0ea5e9 !important;
  background: rgba(14, 165, 233, 0.08) !important;
  box-shadow: 0 0 0 1px #0ea5e9, 0 6px 18px rgba(14, 165, 233, 0.2) !important;
}

[data-theme="dark"] .th-hour-card.active {
  border-color: #38bdf8 !important;
  background: rgba(14, 165, 233, 0.18) !important;
  box-shadow: 0 0 0 1px #38bdf8, 0 6px 18px rgba(14, 165, 233, 0.35) !important;
}


/* Desktop hide for mobile-back-header */
@media (min-width: 769px) {
  .mobile-back-header {
    display: none !important;
  }
}

/* ==========================================================================
   Read / Unread Segmented Control
   ========================================================================== */
.read-filter-segmented {
  display: flex;
  align-items: center;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  padding: 2px;
  margin-top: 6px;
  gap: 2px;
}
[data-theme="dark"] .read-filter-segmented {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
.read-filter-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.read-filter-btn:hover {
  color: var(--text-primary, #0f172a);
}
.read-filter-btn.active {
  background: var(--bg-surface, #ffffff);
  color: var(--color-blue, #0071e3);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .read-filter-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #38bdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.read-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  background: var(--color-blue, #0071e3);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
}

/* On mobile, keep bottom navigation clean and roomy with 4 core tools */
@media (max-width: 768px) {
  #footer-nav-prae-admin,
  #footer-nav-semester {
    display: none !important;
  }
  .bottom-footer-switcher .footer-nav-btn {
    flex: 1 1 0% !important;
    max-width: none !important;
    padding: 3px 2px !important;
  }
  .bottom-footer-switcher .footer-nav-label {
    font-size: clamp(9.5px, 2.7vw, 11px) !important;
    font-weight: 600 !important;
  }
}


/* ==========================================================================
   UNIVERSAL 3D GLASSMORPHISM FOR LOGIN SCREEN, TRAINER COCKPIT & PRAE VIEWS
   ========================================================================== */
.login-screen-overlay,
#view-trainer-dash,
#view-trainer-hours,
#view-prae-admin {
  background: radial-gradient(circle at 12% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 42%),
              radial-gradient(circle at 88% 82%, rgba(16, 185, 129, 0.07) 0%, transparent 42%),
              radial-gradient(circle at 50% 50%, rgba(224, 242, 254, 0.45) 0%, transparent 60%),
              linear-gradient(135deg, #f0f6fc 0%, #f8fafc 50%, #eef5fb 100%) !important;
}

.login-screen-box {
  background: rgba(255, 255, 255, 0.84) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.14),
              0 4px 16px -2px rgba(14, 165, 233, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

.tc-panel,
.tdash-action-card,
.prae-admin-sidebar,
.prae-admin-sheet-wrap,
.prae-month-sheet-card {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

[data-theme="dark"] .login-screen-overlay,
[data-theme="dark"] #view-trainer-dash,
[data-theme="dark"] #view-trainer-hours,
[data-theme="dark"] #view-prae-admin {
  background: radial-gradient(circle at 12% 15%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
              radial-gradient(circle at 88% 82%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
              #090d16 !important;
}

[data-theme="dark"] .login-screen-box,
[data-theme="dark"] .tc-panel,
[data-theme="dark"] .tdash-action-card,
[data-theme="dark"] .prae-admin-sidebar,
[data-theme="dark"] .prae-admin-sheet-wrap,
[data-theme="dark"] .prae-month-sheet-card {
  background: rgba(15, 23, 42, 0.78) !important;
  border-color: rgba(51, 65, 85, 0.65) !important;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .login-title,
[data-theme="dark"] .reg-step-title,
[data-theme="dark"] .tdash-action-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .login-field-label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .login-field-input {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(71, 85, 105, 0.8) !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   DASHBOARD PRAE KPI CARD & VORMONAT AUDIT
   ========================================================================== */
.dash-stat-card.prae-kpi-card {
  border-left: 3px solid #0284c7 !important;
  position: relative !important;
}

.dash-stat-icon.purple {
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0284c7 !important;
}

.dash-prae-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dash-prae-mini-pill:hover {
  transform: translateY(-1px) scale(1.04);
}

.dash-prae-mini-pill.green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dash-prae-mini-pill.orange {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
  animation: ambientPulseAmber 3s infinite ease-in-out;
}

.dash-prae-mini-pill.gray {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .dash-prae-mini-pill.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

[data-theme="dark"] .dash-prae-mini-pill.orange {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

[data-theme="dark"] .dash-prae-mini-pill.gray {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.4);
}

/* Review summary card in Assistant to replace permanent 8-field form */
.order-review-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 12px;
}
[data-theme="dark"] .order-review-summary-grid {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.6);
}
.order-review-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.order-review-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.3px;
}
.order-review-val {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}
[data-theme="dark"] .order-review-val {
  color: #f8fafc;
}

@media (max-width: 768px) {
  .dash-stat-card.prae-kpi-card {
    grid-column: span 2 !important;
  }
  .order-review-summary-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   BIOMETRIC LOGIN BUTTON (FACE ID / TOUCH ID / FINGERABDRUCK)
   ========================================================================== */
.biometric-login-btn {
  width: 100%;
  height: 46px;
  border-radius: 13px;
  border: 1.5px solid rgba(14, 165, 233, 0.45);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: #0284c7;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.biometric-login-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(16, 185, 129, 0.14) 100%);
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.2);
}

.biometric-login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.biometric-login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

[data-theme="dark"] .biometric-login-btn {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(16, 185, 129, 0.12) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}


/* ==========================================================================
   v74.0 ADMIN & TRAINER SCROLL / FLEX-SHRINK / LAYOUT FIX (ALLE ANSICHTEN)
   Verhindert das Stauchen/Abschneiden von Cards (.box-card, .dash-glass-card,
   .tc-panel, .tdash-action-card, .prae-month-sheet-card) im Admin- & Trainer-
   Bereich und stellt flüssiges vertikales Scrollen in allen Fenstern sicher.
   ========================================================================== */
.fullpage-view.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

.fullpage-scroll-container,
#view-dashboard .fullpage-scroll-container,
#view-payments .fullpage-scroll-container,
#view-attendance .fullpage-scroll-container,
#view-trainer-dash .fullpage-scroll-container,
#view-trainer .fullpage-scroll-container,
#view-trainer-hours .fullpage-scroll-container,
#view-semester .fullpage-scroll-container,
#view-logs .fullpage-scroll-container,
#view-prae-admin .fullpage-scroll-container,
.tc-wrap {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: min-content !important;
  max-height: none !important;
  overflow: visible !important;
}

.fullpage-scroll-container > *,
.tc-wrap > *,
.box-card,
.dash-glass-card,
.dash-master-card,
.dash-transactions-card-v2,
.dash-stat-card,
.pay-kpi-card,
.payments-toolbar-card,
.payments-list-card,
.attendance-toolbar-card,
.attendance-lists-stack,
.att-location-block,
.semester-box-card,
.logs-viewer-card,
.dash-server-panel,
.tc-panel,
.tc-panel-wide,
.tdash-action-grid,
.tdash-action-card,
.prae-month-sheet-card,
.th-confirm-card,
.th-date-picker-box,
#tdash-missing-prae-banner,
#trainer-children-container,
.tc-loc-list,
.tc-loc-btn {
  flex-shrink: 0 !important;
  height: auto !important;
  min-height: min-content !important;
  max-height: none !important;
  box-sizing: border-box !important;
}

.box-card,
.dash-glass-card,
.dash-master-card,
.dash-transactions-card-v2,
.payments-toolbar-card,
.payments-list-card,
.attendance-toolbar-card,
.semester-box-card,
.logs-viewer-card,
.dash-server-panel,
.tc-panel,
.tc-panel-wide,
.tdash-action-grid,
.tdash-action-card,
.prae-month-sheet-card,
.th-confirm-card,
.th-date-picker-box,
#tdash-missing-prae-banner,
#trainer-children-container,
.tc-loc-list {
  overflow: visible !important;
}

/* Login-Overlay (Trainer-Registrierung / Passwort-Reset) & Modals (PRAE-Stammdaten)
   niemals oben/unten abschneiden, sondern sauber scrollbar halten */
.login-screen-overlay {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  align-items: flex-start !important;
  padding: 24px 16px 40px !important;
}

.login-screen-box {
  margin: auto !important;
  flex-shrink: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.dialog-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 20000 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 16px)) !important;
  align-items: center !important;
  justify-content: center !important;
}

.dialog-overlay.active,
.dialog-overlay[style*="display: block"],
.dialog-overlay[style*="display: flex"] {
  z-index: 20000 !important;
}

.dialog-overlay .dialog-box,
#trainer-profile-modal .dialog-box {
  position: relative !important;
  z-index: 20001 !important;
  max-height: calc(100vh - 40px) !important;
  max-height: calc(100dvh - 40px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: auto !important;
  box-sizing: border-box !important;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 16px)) !important;
}

@media (max-width: 600px) {
  .dialog-overlay {
    padding: 12px 10px calc(24px + env(safe-area-inset-bottom, 16px)) !important;
    align-items: flex-start !important;
  }
  .dialog-overlay .dialog-box,
  #trainer-profile-modal .dialog-box {
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: 18px !important;
    padding: 18px 14px calc(26px + env(safe-area-inset-bottom, 16px)) !important;
    margin: 8px auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Trainer-Buttons & PRAE-Monatsblatt sauber ausgerichtet */
.tc-loc-btn {
  padding: 14px 18px !important;
  min-height: 58px !important;
  height: auto !important;
  gap: 12px !important;
}

.tc-loc-btn > span {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.35 !important;
}

.prae-sheet-footer {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
}

/* Dashboard KPI-Grid & Transaktionen sauber ausgerichtet */
.dash-kpi-grid .dash-stat-val {
  white-space: nowrap;
}
.dash-kpi-grid .dash-stat-main-row {
  flex-wrap: wrap;
  row-gap: 4px;
}
.dash-kpi-grid .prae-kpi-card {
  grid-column: 1 / -1;
}
.dash-transactions-list {
  min-width: 0;
  max-height: none !important;
  overflow: visible !important;
}

/* Header, Assistent-Reiter & Trainer-Ansichten auf Mobilgeräten niemals abschneiden */
@media (max-width: 768px) {
  .app-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    height: auto !important;
  }

  .header-brand {
    order: 1 !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .brand-text {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .brand-title {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }

  .header-right {
    order: 2 !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }

  body[data-active-view="assistant"] #assistant-header-filters:not(.hidden) {
    order: 3 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 6px !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
  }

  body[data-active-view="assistant"] #assistant-header-filters {
    padding: 0 !important;
    gap: 8px !important;
    background: transparent !important;
    border: none !important;
  }

  body[data-active-view="assistant"] #assistant-header-filters .filter-tab {
    flex: initial !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }

  #semester-location-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  #semester-location-tabs .pay-subtab {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 11.5px !important;
    padding: 7px 8px !important;
  }

  #semester-location-tabs .pay-subtab:first-child {
    flex: 1 1 100% !important;
  }

  /* Trainer-Bereich Mobile Optimierungen */
  .login-screen-overlay {
    padding: 14px 10px 32px !important;
  }

  .login-screen-box {
    padding: 20px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .reg-grid-2 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  #view-trainer-dash .dash-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  #view-trainer-dash #tdash-month-select {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    height: 38px !important;
    font-size: 13px !important;
  }

  #view-trainer-dash .dash-header-actions > .btn-primary {
    flex: 1 1 50% !important;
    width: auto !important;
    min-width: 0 !important;
    height: 38px !important;
    font-size: 13px !important;
    justify-content: center !important;
  }

  .tc-wrap {
    padding: 12px 10px calc(96px + env(safe-area-inset-bottom, 24px)) !important;
  }

  .tc-panel,
  .tc-panel-wide {
    padding: 16px 14px !important;
    border-radius: 18px !important;
  }

  .tc-loc-btn {
    padding: 12px 14px !important;
    font-size: 15px !important;
    gap: 10px !important;
  }

  #th-fixed-dates-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  
  .prae-month-sheet-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
    margin: 16px 0 32px !important;
    border-radius: 18px !important;
  }

  .prae-days-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .prae-day-cell {
    padding: 6px 4px !important;
    min-height: 50px !important;
  }

  .prae-sheet-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .prae-sheet-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .prae-sheet-header > div:last-child > button {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  #tc-step-3 .tc-quick-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  #tc-step-3 .tc-quick-actions > button {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
  }
}

@media (max-width: 400px) {
  #th-fixed-dates-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .prae-days-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}


/* ==========================================================================
   Header Trainer Direct Logout (Trainer hat NUR Abmelden im Header)
   ========================================================================== */
.header-trainer-logout-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.08);
}
.header-trainer-logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.header-trainer-logout-btn:active {
  transform: scale(0.96);
}
[data-theme="dark"] .header-trainer-logout-btn {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
[data-theme="dark"] .header-trainer-logout-btn:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

/* Enforce role-trainer header visibility: Trainer hat NUR Abmelden im Header */
html.role-trainer #header-spotlight-btn,
html.role-trainer .header-menu-wrap,
body.role-trainer #header-spotlight-btn,
body.role-trainer .header-menu-wrap,
body[data-user-role="trainer"] #header-spotlight-btn,
body[data-user-role="trainer"] .header-menu-wrap,
body.role-trainer #sidebar-toggle-btn,
body[data-user-role="trainer"] #sidebar-toggle-btn {
  display: none !important;
}

html.role-trainer #header-trainer-logout-btn,
body.role-trainer #header-trainer-logout-btn,
body[data-user-role="trainer"] #header-trainer-logout-btn {
  display: inline-flex !important;
}

@media (max-width: 768px) {
  .header-trainer-logout-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    gap: 5px;
  }
}


/* Header Brand Greeting & Trainer Name Display */
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-subtitle {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  body:not(.role-trainer) .brand-subtitle {
    display: none;
  }
  html.role-trainer .brand-subtitle,
  body.role-trainer .brand-subtitle,
  body[data-user-role="trainer"] .brand-subtitle {
    display: block !important;
    font-size: 11px !important;
  }
}


/* ==========================================================================
   OFFICIAL YS-FOOTBALLCLUB BRAND PALETTE: BLAU · WEISS · GOLD
   Strikte Beschränkung auf Blau, Weiß und Gold in der gesamten Applikation.
   Abgestimmt auf das offizielle Vereinswappen (Logo).
   ========================================================================== */

/* --- Root Palette Alignment --- */
:root {
  --color-blue: #004b93 !important;
  --color-blue-hover: #003870 !important;
  --color-blue-subtle: #eff6ff !important;
  --color-blue-border: #bfdbfe !important;
  --color-blue-text: #004b93 !important;

  --color-gold: #c59b27 !important;
  --color-gold-hover: #b4881d !important;
  --color-gold-subtle: #fefce8 !important;
  --color-gold-border: #fde68a !important;
  --color-gold-text: #92400e !important;

  --color-green: #004b93 !important;
  --color-green-subtle: #eff6ff !important;
  --color-green-text: #004b93 !important;

  --color-orange: #c59b27 !important;
  --color-orange-subtle: #fefce8 !important;
  --color-orange-text: #92400e !important;

  --color-purple: #004b93 !important;
  --color-purple-subtle: #eff6ff !important;
  --color-purple-text: #004b93 !important;

  --color-pink: #c59b27 !important;
  --color-pink-subtle: #fefce8 !important;
  --color-pink-text: #92400e !important;
}

/* --- Stat Icons (Blau & Gold) --- */
.dash-stat-icon.blue,
.dash-stat-icon.green,
.dash-stat-icon.cyan,
.dash-stat-icon.navy {
  background: #eff6ff !important;
  color: #004b93 !important;
  border: 1px solid #bfdbfe !important;
}

.dash-stat-icon.gold,
.dash-stat-icon.orange,
.dash-stat-icon.amber,
.dash-stat-icon.purple,
.dash-stat-icon.pink {
  background: #fefce8 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

/* --- Trend Pills & Badges (Blau & Gold) --- */
.dash-trend-pill.blue,
.dash-trend-pill.green,
.dash-trend-pill.cyan,
.dash-badge-pill.blue,
.dash-badge-subtle.blue {
  background: #eff6ff !important;
  color: #004b93 !important;
  border: 1px solid #bfdbfe !important;
}

.dash-trend-pill.gold,
.dash-trend-pill.orange,
.dash-trend-pill.amber,
.dash-trend-pill.purple,
.dash-trend-pill.pink,
.dash-badge-pill.gold,
.dash-badge-subtle.gold {
  background: #fefce8 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

/* --- Trainer Action Cards (1. Blau, 2. Gold) --- */
.tdash-action-icon.blue,
.tdash-action-icon.cyan,
.tdash-action-icon.navy {
  background: #eff6ff !important;
  color: #004b93 !important;
  border: 1px solid #bfdbfe !important;
}

.tdash-action-icon.green,
.tdash-action-icon.gold,
.tdash-action-icon.orange,
.tdash-action-icon.amber,
.tdash-action-icon.purple {
  background: #fefce8 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

/* --- Standorte Breakdown & Progress Tracks --- */
.school-icon.blue,
.school-icon.cyan,
.school-icon.green,
.school-icon.navy {
  background: #eff6ff !important;
  color: #004b93 !important;
  border: 1px solid #bfdbfe !important;
}

.school-icon.gold,
.school-icon.amber,
.school-icon.orange,
.school-icon.purple {
  background: #fefce8 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

.school-badge.blue,
.school-badge.green,
.school-badge.cyan {
  background: #eff6ff !important;
  color: #004b93 !important;
  border: 1px solid #bfdbfe !important;
}

.school-badge.gold,
.school-badge.amber,
.school-badge.orange,
.school-badge.purple {
  background: #fefce8 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

.school-fill.blue,
.school-fill.green {
  background: #004b93 !important;
}

.school-fill.gold,
.school-fill.amber,
.school-fill.cyan {
  background: #c59b27 !important;
}

/* --- Filter Dots & Indicators --- */
.dot.blue, .dot.cyan {
  background: #004b93 !important;
  box-shadow: 0 0 6px rgba(0, 75, 147, 0.45) !important;
}

.dot.gold, .dot.orange, .dot.amber, .dot.purple, .dot.pink, .dot.green {
  background: #c59b27 !important;
  box-shadow: 0 0 6px rgba(197, 155, 39, 0.45) !important;
}

.status-dot, #live-dot, .role-dot.green {
  background: #004b93 !important;
  box-shadow: 0 0 6px rgba(0, 75, 147, 0.45) !important;
}

/* --- Check-In Buttons in Hallen-Modus --- */
.trainer-status-btn.active-present {
  background: #004b93 !important;
  color: #ffffff !important;
  border-color: #004b93 !important;
}
.trainer-status-btn.active-excused {
  background: #c59b27 !important;
  color: #ffffff !important;
  border-color: #c59b27 !important;
}
.trainer-status-btn.active-absent {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

/* --- Tiles, Legend Dots & Chips --- */
.dash-tile-icon.blue,
.dash-tile-icon.green,
.savings-icon.cyan,
.savings-icon.blue,
.savings-icon.green {
  background: #eff6ff !important;
  color: #004b93 !important;
}

.dash-tile-icon.gold,
.dash-tile-icon.orange,
.dash-tile-icon.amber,
.dash-tile-icon.purple,
.dash-tile-icon.pink,
.savings-icon.purple,
.savings-icon.pink {
  background: #fefce8 !important;
  color: #b45309 !important;
}

.eff-chip-dot.blue,
.eff-chip-dot.cyan,
.eff-chip-dot.green,
.eff-dot.cyan,
.eff-dot.green,
.donut-legend-dot.blue,
.donut-legend-dot.green,
.donut-legend-dot.cyan,
.dash-kpi-bar-fill.blue,
.dash-kpi-bar-fill.green,
.dash-kpi-bar-fill.cyan {
  background: #004b93 !important;
}

.eff-chip-dot.gold,
.eff-chip-dot.orange,
.eff-chip-dot.amber,
.eff-chip-dot.purple,
.eff-chip-dot.pink,
.eff-dot.amber,
.donut-legend-dot.gold,
.donut-legend-dot.orange,
.donut-legend-dot.amber,
.donut-legend-dot.purple,
.dash-kpi-bar-fill.gold,
.dash-kpi-bar-fill.amber,
.dash-kpi-bar-fill.orange,
.dash-kpi-bar-fill.purple,
.dash-kpi-bar-fill.pink {
  background: #c59b27 !important;
}

/* --- Dark Theme Adjustments --- */
[data-theme="dark"] .dash-stat-icon.blue,
[data-theme="dark"] .dash-stat-icon.green,
[data-theme="dark"] .dash-stat-icon.cyan,
[data-theme="dark"] .tdash-action-icon.blue,
[data-theme="dark"] .school-icon.blue,
[data-theme="dark"] .school-icon.cyan {
  background: rgba(0, 75, 147, 0.28) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .dash-stat-icon.gold,
[data-theme="dark"] .dash-stat-icon.purple,
[data-theme="dark"] .dash-stat-icon.pink,
[data-theme="dark"] .dash-stat-icon.orange,
[data-theme="dark"] .tdash-action-icon.gold,
[data-theme="dark"] .tdash-action-icon.green,
[data-theme="dark"] .school-icon.gold,
[data-theme="dark"] .school-icon.amber {
  background: rgba(197, 155, 39, 0.22) !important;
  color: #fde047 !important;
  border-color: rgba(197, 155, 39, 0.45) !important;
}

[data-theme="dark"] .dash-trend-pill.blue,
[data-theme="dark"] .dash-trend-pill.green,
[data-theme="dark"] .school-badge.blue,
[data-theme="dark"] .school-badge.green {
  background: rgba(0, 75, 147, 0.28) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .dash-trend-pill.gold,
[data-theme="dark"] .dash-trend-pill.purple,
[data-theme="dark"] .dash-trend-pill.orange,
[data-theme="dark"] .school-badge.gold,
[data-theme="dark"] .school-badge.amber {
  background: rgba(197, 155, 39, 0.22) !important;
  color: #fde047 !important;
  border-color: rgba(197, 155, 39, 0.45) !important;
}


/* ==========================================================================
   DURCHSICHTIGER PWA INSTALL BUTTON (UNTEN RECHTS) & INSTALL-MODAL (iOS/Android)
   ========================================================================== */
.pwa-install-fab {
  position: fixed;
  right: 18px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 100000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-fab:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.pwa-install-fab:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.5);
}

.pwa-install-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 75, 147, 0.12);
  color: #004b93;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .pwa-install-fab {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

[data-theme="dark"] .pwa-install-fab:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .pwa-install-icon {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

@media (min-width: 769px) {
  .pwa-install-fab {
    bottom: 24px;
    right: 24px;
  }
}

@media all and (display-mode: standalone) {
  #pwa-install-btn {
    display: none !important;
  }
}

/* PWA Install Modal Dialog */
.pwa-install-dialog {
  max-width: 440px !important;
  width: 92% !important;
  padding: 24px 20px 20px !important;
  border-radius: 24px !important;
  box-sizing: border-box;
}

.pwa-install-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.pwa-install-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(0, 75, 147, 0.1);
  color: #004b93;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .pwa-install-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.pwa-install-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  line-height: 1.25;
}

.pwa-install-modal-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.35;
}

.pwa-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.pwa-install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.pwa-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #004b93;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 75, 147, 0.35);
}

.pwa-step-body {
  flex: 1;
  text-align: left;
}

.pwa-step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.pwa-step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.pwa-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 11.5px;
  margin: 2px 0;
}


/* ==========================================================================
   MOBILE POLISH V87: ZERO-OVERFLOW & PERFECT RESPONSIVE SIZING
   ========================================================================== */

/* 1. Footer Navigation: Short labels on mobile, never truncated with ellipsis */
@media (max-width: 768px) {
  .footer-nav-label {
    font-size: clamp(9.5px, 2.7vw, 11px) !important;
    letter-spacing: -0.015em !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 100% !important;
    text-align: center !important;
  }
  .bottom-footer-switcher .footer-nav-label {
    font-size: clamp(9.5px, 2.7vw, 11px) !important;
    font-weight: 600 !important;
  }
}

/* 2. Trainer Attendance & PRAE Date Navigator: 100% Zero Overflow */
.tc-date-row {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.tc-date-row .tc-select,
#th-session-date-select,
#trainer-session-select {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 0 !important;
  max-width: 100% !important;
  height: 40px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-default) !important;
  background: var(--bg-surface) !important;
  padding: 0 8px !important;
  font-size: clamp(11.5px, 3.2vw, 13px) !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.tc-date-row .tc-btn-small {
  flex: 0 0 38px !important;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-default) !important;
  background: var(--bg-surface) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  touch-action: manipulation !important;
}

/* 3. Child Status Buttons: Equal 3-column grid & crisp single-line text */
.tc-status-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

.tc-st {
  font-size: clamp(10px, 2.75vw, 12px) !important;
  border-width: 1.5px !important;
  padding: 0 1px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  letter-spacing: -0.025em !important;
}

/* 4. Fullpage scroll clearance above bottom footer bar */
@media (max-width: 768px) {
  .fullpage-scroll-container,
  .tc-wrap {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 24px)) !important;
  }
}

/* 5. School subtabs on mobile */
@media (max-width: 768px) {
  .payments-subtabs#attendance-subtabs .pay-subtab {
    font-size: clamp(10.5px, 2.8vw, 11.5px) !important;
    padding: 7px 8px !important;
  }
}

/* Hide Einklappen Button completely */
.sidebar-hide-btn {
  display: none !important;
}
