/* ============================================
   FahrDoc v4 — style.css
   All component and layout styles
   v4: Removed map, new skill levels
   ============================================ */

/* ============================================
   APP SHELL
   ============================================ */
#app {
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
  position: relative;
}

.screen {
  display: none !important;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: var(--color-bg);
}
.screen.active {
  display: flex !important;
  z-index: 2;
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  min-height: 56px;
  flex-shrink: 0;
  z-index: var(--z-nav);
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.top-bar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.top-bar-logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.top-bar-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.top-bar-user {
  font-size: var(--text-xs);
  color: var(--color-text);
  display: none;
}
@media (min-width: 480px) {
  .top-bar-user { display: block; }
}

/* ============================================
   ICON BUTTONS
   ============================================ */
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--color-surface-offset); color: var(--color-text); }
.icon-btn:active { background: var(--color-surface-offset-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .notification-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  border: 2px solid var(--color-surface);
}

/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-1) 0;
  padding-bottom: max(var(--space-1), env(safe-area-inset-bottom));
  flex-shrink: 0;
  z-index: var(--z-nav);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-interactive);
  min-width: 56px;
  min-height: 44px;
  justify-content: center;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active {
  color: var(--color-primary);
}

/* ============================================
   SCROLLABLE MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.page-padding {
  padding: var(--space-4);
  max-width: var(--content-wide);
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-body);
  transition: all var(--transition-interactive);
  min-height: 44px;
  border: none;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-active); transform: scale(0.98); }

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-offset); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-primary-highlight); }

.btn-danger {
  background: var(--color-error);
  color: #fff;
}
.btn-danger:hover { background: var(--color-error-hover); }

.btn-full { width: 100%; }
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  min-height: 36px;
}
.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  min-height: 48px;
  font-weight: 600;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}
.form-input, .form-select, .form-textarea {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  min-height: 44px;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
  width: 100%;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--color-text-faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.form-textarea {
  min-height: 88px;
  resize: vertical;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7370' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--space-8);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}
.form-row {
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-border) l c h / 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.card-interactive { cursor: pointer; }
.card-interactive:hover { box-shadow: var(--shadow-md); }
.card-interactive:active { transform: scale(0.99); }

/* Stat cards */
.stat-card-clickable {
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  border: 2px solid transparent;
  user-select: none;
}
.stat-card-clickable:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.stat-card-active {
  border-color: var(--primary) !important;
  background: var(--primary-light, rgba(59,130,246,0.08));
  box-shadow: 0 2px 12px rgba(59,130,246,0.15);
}
.stat-card-active .stat-card-label {
  color: var(--primary);
  font-weight: 600;
}
.stat-card-active .stat-card-value {
  color: var(--primary);
}

/* Invite Code Modal */
.invite-modal-content {
  text-align: center;
}
.invite-code-display {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
  margin-bottom: var(--space-5);
}
.invite-code-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}
.invite-code-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.invite-email-section {
  text-align: left;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.stat-card {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-border) l c h / 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.stat-card-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
}
.stat-card-delta {
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

/* ============================================
   BADGE
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-primary { background: var(--color-primary-highlight); color: var(--color-primary); }
.badge-success { background: var(--color-success-highlight); color: var(--color-success); }
.badge-error { background: var(--color-error-highlight); color: var(--color-error); }
.badge-warning { background: var(--color-warning-highlight); color: var(--color-warning); }
.badge-neutral { background: var(--color-surface-offset); color: var(--color-text-muted); }
.badge-blue { background: var(--color-blue-highlight); color: var(--color-blue); }

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-text-inverse);
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-sm); }

/* ============================================
   LIST ITEMS
   ============================================ */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-interactive);
  cursor: pointer;
  min-height: 64px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--color-surface-offset); }
.list-item:active { background: var(--color-surface-offset-2); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  position: relative;
  margin-bottom: var(--space-3);
}
.search-bar svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--color-text-faint);
  pointer-events: none;
}
.search-bar input {
  padding-left: var(--space-10);
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
.fab {
  position: fixed;
  bottom: calc(72px + var(--space-4) + env(safe-area-inset-bottom));
  right: var(--space-4);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-fab);
  transition: all var(--transition-interactive);
  border: none;
  cursor: pointer;
}
.fab:hover { background: var(--color-primary-hover); transform: scale(1.05); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 24px; height: 24px; }

/* ============================================
   MODAL / OVERLAY
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: var(--z-modal-backdrop);
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 200ms ease;
}
.modal-backdrop.active { display: flex; }

.modal {
  background: var(--color-surface-2);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
  animation: slideUp 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  margin: 0 auto var(--space-4);
}
.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal {
    border-radius: var(--radius-2xl);
    margin: var(--space-4);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ============================================
   WELCOME / AUTH SCREENS
   ============================================ */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-8) var(--space-4);
  text-align: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.auth-logo {
  margin-bottom: var(--space-6);
}
.auth-logo svg { width: 72px; height: 72px; }
.auth-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

.auth-form {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}
.auth-footer {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.auth-footer a, .auth-link {
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 500;
}
.auth-footer a:hover, .auth-link:hover {
  text-decoration: underline;
}

/* Role toggle (3 options) */
.role-toggle {
  display: flex;
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}
.role-toggle-btn {
  flex: 1;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  text-align: center;
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
  cursor: pointer;
  border: none;
  background: none;
  min-height: 40px;
}
.role-toggle-btn.active {
  background: var(--color-surface-2);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* Conditional signup fields */
.signup-conditional-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Verification code input */
.code-input-group {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}
.code-input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 600;
  font-family: var(--font-display);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text);
  transition: border-color var(--transition-interactive);
}
.code-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ============================================
   TRIAL / EXPIRED BANNERS
   ============================================ */
.trial-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  flex-shrink: 0;
}
.trial-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

.expired-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-error-highlight);
  color: var(--color-error);
  font-size: var(--text-xs);
  font-weight: 500;
  flex-shrink: 0;
}
.expired-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================
   CODE MANAGEMENT (school admin)
   ============================================ */
.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
}
.code-row:last-of-type { border-bottom: none; }
.code-value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

/* ============================================
   ABO (Subscription) STYLES
   ============================================ */
.abo-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.abo-plan-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}
.abo-trial-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-primary-highlight);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.abo-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.abo-price-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.abo-price-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   SECTION HEADINGS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.section-action {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 500;
  cursor: pointer;
}

/* ============================================
   WELCOME MESSAGE
   ============================================ */
.welcome-msg {
  margin-bottom: var(--space-4);
}
.welcome-msg h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}
.welcome-msg p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ============================================
   TABS
   ============================================ */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--color-divider);
  gap: 0;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-interactive);
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   RATING CARD (Driving Task Assessment)
   ============================================ */
.rating-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}
.rating-card-label {
  font-size: var(--text-sm);
  font-weight: 500;
}
.rating-cards-grid {
  display: grid;
  gap: var(--space-2);
}

/* ============================================
   SKILL LEVEL SELECTOR (Segment Control)
   ============================================ */
.level-selector {
  display: flex;
  gap: 2px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  padding: 2px;
}
.level-selector-btn {
  flex: 1;
  padding: var(--space-1) var(--space-1);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
  min-height: 32px;
  line-height: 1.2;
}
.level-selector-btn.active {
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.level-selector-btn.active[data-level="1"] { background: var(--color-error); }
.level-selector-btn.active[data-level="2"] { background: var(--color-warning); }
.level-selector-btn.active[data-level="3"] { background: var(--color-blue); }
.level-selector-btn.active[data-level="4"] { background: var(--color-success); }

/* Chart mode toggle — neutral active state */
.chart-mode-btn.active {
  background: var(--color-primary) !important;
  color: #fff !important;
}

/* ============================================
   PROGRESS RING
   ============================================ */
.progress-ring-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.progress-ring-container svg { transform: rotate(-90deg); }
.progress-ring-bg { stroke: var(--color-surface-offset-2); }
.progress-ring-fill { transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1); }
.progress-ring-text {
  position: absolute;
  text-align: center;
}
.progress-ring-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  display: block;
}
.progress-ring-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: block;
}

/* ============================================
   SKILL BARS
   ============================================ */
.skill-bar {
  margin-bottom: var(--space-3);
}
.skill-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}
.skill-bar-track {
  height: 8px;
  background: var(--color-surface-offset-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   SCHEDULE — TOOLBAR
   ============================================ */
.schedule-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.schedule-toolbar .form-select {
  flex: 1;
  min-width: 0;
}

/* ============================================
   SCHEDULE — WEEK NAV
   ============================================ */
.schedule-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-2);
}
.schedule-week-label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* ============================================
   SCHEDULE — DAY TABS (Mobile / Instructor)
   ============================================ */
.schedule-day-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-1);
}
.schedule-day-tabs::-webkit-scrollbar { display: none; }
.schedule-day-tab {
  flex: 1;
  min-width: 48px;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  transition: all var(--transition-interactive);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.schedule-day-tab:hover {
  background: var(--color-surface-offset);
}
.schedule-day-tab.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.schedule-day-tab.active .schedule-day-tab-name,
.schedule-day-tab.active .schedule-day-tab-date {
  color: var(--color-text-inverse);
}
.schedule-day-tab.holiday {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
}
.schedule-day-tab.holiday .schedule-day-tab-name,
.schedule-day-tab.holiday .schedule-day-tab-date {
  color: #b91c1c;
}
.schedule-day-tab.holiday.active {
  background: #dc2626;
  border-color: #dc2626;
}
.schedule-day-tab.holiday.active .schedule-day-tab-name,
.schedule-day-tab.holiday.active .schedule-day-tab-date {
  color: #ffffff;
}
.holiday-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  margin: var(--space-2) 0;
  border-left: 3px solid #dc2626;
}
.schedule-day-tab-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}
.schedule-day-tab-date {
  font-size: 10px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.schedule-day-tab-dots {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.schedule-day-tab-dots span {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
}

/* ============================================
   SCHEDULE — DAY HEADER
   ============================================ */
.schedule-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.schedule-day-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}
.schedule-day-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   SCHEDULE — SLOT LIST (Mobile)
   ============================================ */
.schedule-slot-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ============================================
   SCHEDULE — SLOT CARD (Mobile / Instructor)
   ============================================ */
.schedule-slot-card {
  display: flex;
  align-items: stretch;
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-border) l c h / 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  gap: var(--space-3);
  cursor: pointer;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.schedule-slot-card:hover {
  box-shadow: var(--shadow-md);
}
.schedule-slot-card:active {
  transform: scale(0.99);
}
.schedule-slot-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding-right: var(--space-3);
  border-right: 2px solid var(--color-divider);
}
.schedule-slot-card-time {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.schedule-slot-card-end {
  font-size: 10px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.schedule-slot-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.schedule-slot-card-title {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-slot-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Status variants — slot cards */
.schedule-slot-offen {
  border-left: 3px solid var(--color-warning);
  border-style: dashed;
  border-width: 1px;
  border-left-width: 3px;
  border-left-style: solid;
}
.schedule-slot-geplant {
  border-left: 3px solid var(--color-blue);
}
.schedule-slot-bestätigt {
  border-left: 3px solid var(--color-success);
}
.schedule-slot-abgeschlossen {
  border-left: 3px solid var(--color-text-muted);
  opacity: 0.7;
}

/* ============================================
   WEEK GRID — Pixel-Aligned Schedule
   ============================================ */
.week-grid-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}
.week-grid {
  min-width: 700px;
}

/* Header row */
.week-grid-header {
  display: flex;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-offset);
  position: sticky;
  top: 0;
  z-index: 2;
}
.week-grid-header .week-grid-time-gutter {
  width: 52px;
  min-width: 52px;
  border-right: 1px solid var(--color-divider);
}
.week-grid-day-header {
  flex: 1;
  text-align: center;
  padding: var(--space-2) var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  border-right: 1px solid var(--color-divider);
}
.week-grid-day-header:last-child { border-right: none; }
.week-grid-day-header.today {
  background: oklch(from var(--color-primary) l c h / 0.08);
}
.week-grid-day-header.holiday {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}
.week-grid-day-header.holiday.today {
  background: rgba(220, 38, 38, 0.14);
}
.week-grid-day-holiday {
  font-weight: 500;
  font-size: 9px;
  color: #b91c1c;
  margin-top: 2px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.week-grid-day-name {
  font-weight: 600;
  color: var(--color-text);
}
.week-grid-day-header.holiday .week-grid-day-name {
  color: #b91c1c;
}
.week-grid-day-date {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 10px;
}
.week-grid-day-header.holiday .week-grid-day-date {
  color: #b91c1c;
  opacity: 0.85;
}

/* Body — relative container for absolute children */
.week-grid-body {
  position: relative;
  display: flex;
}

/* Time gutter in body */
.week-grid-body > .week-grid-time-gutter {
  position: relative;
  width: 52px;
  min-width: 52px;
  border-right: 1px solid var(--color-divider);
  flex-shrink: 0;
}
.week-grid-time-label {
  position: absolute;
  width: 100%;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  text-align: center;
  padding-top: 2px;
  border-bottom: 1px solid oklch(from var(--color-divider) l c h / 0.3);
  box-sizing: border-box;
}

/* Day columns */
.week-grid-day-col {
  flex: 1;
  position: relative;
  border-right: 1px solid var(--color-divider);
  cursor: pointer;
  transition: background 150ms ease;
}
.week-grid-day-col:last-child { border-right: none; }
.week-grid-day-col:hover {
  background: oklch(from var(--color-primary) l c h / 0.02);
}
.week-grid-day-col.today {
  background: oklch(from var(--color-primary) l c h / 0.04);
}
.week-grid-day-col.holiday {
  background: repeating-linear-gradient(
    -45deg,
    rgba(220, 38, 38, 0.04),
    rgba(220, 38, 38, 0.04) 8px,
    rgba(220, 38, 38, 0.07) 8px,
    rgba(220, 38, 38, 0.07) 16px
  );
}
.week-grid-day-col.today.holiday {
  background:
    oklch(from var(--color-primary) l c h / 0.04),
    repeating-linear-gradient(
      -45deg,
      rgba(220, 38, 38, 0.05),
      rgba(220, 38, 38, 0.05) 8px,
      rgba(220, 38, 38, 0.09) 8px,
      rgba(220, 38, 38, 0.09) 16px
    );
}

/* Hour lines inside day columns */
.week-grid-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid oklch(from var(--color-divider) l c h / 0.3);
}

/* Lesson slots — absolutely positioned by inline style */
.week-grid-slot {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: opacity 150ms ease, box-shadow 150ms ease;
  z-index: 1;
}
.week-grid-slot:hover {
  opacity: 0.85;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.week-grid-slot.slot-draggable {
  cursor: grab;
}
.week-grid-slot.slot-draggable:active {
  cursor: grabbing;
}
.slot-dragging-ghost {
  transform: scale(1.03);
  border-radius: var(--radius-sm);
  opacity: 0.9 !important;
}

/* Slot content */
.week-grid-slot-time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.week-grid-slot-instructor {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}
.week-grid-slot-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.week-grid-slot-type {
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Type-based colors ---- */
/* Übungsfahrt — Green */
.type-uebung {
  background: #d4edda;
  border-left-color: #28a745;
  color: #155724;
}
/* Überlandfahrt — Blue */
.type-ueberland {
  background: #cce5ff;
  border-left-color: #007bff;
  color: #004085;
}
/* Autobahnfahrt — Purple */
.type-autobahn {
  background: #e2d9f3;
  border-left-color: #6f42c1;
  color: #3b1f77;
}
/* Nachtfahrt — Gray */
.type-nacht {
  background: #d6d8db;
  border-left-color: #495057;
  color: #1b1e21;
}
/* Prüfungsvorbereitung — Yellow */
.type-pruefvorb {
  background: #fff3cd;
  border-left-color: #ffc107;
  color: #856404;
}
/* Praktische Prüfung — Red */
.type-prakt-pruef {
  background: #f8d7da;
  border-left-color: #dc3545;
  color: #721c24;
}
/* Theoretische Prüfung — Pink */
.type-theo-pruef {
  background: #fce4ec;
  border-left-color: #e91e63;
  color: #880e4f;
}

/* Open/unassigned slot — Orange dashed */
.slot-offen {
  background: #fff8e1 !important;
  border-left-color: #f0ad4e !important;
  color: #8a6d3b !important;
  border-right: 1px dashed #f0ad4e;
  border-top: 1px dashed #f0ad4e;
  border-bottom: 1px dashed #f0ad4e;
}

/* Prüfung marker */
.slot-pruefung {
  font-weight: 600;
}

/* Time block (Zeitsperre) — Gray striped */
.slot-block {
  background: repeating-linear-gradient(
    -45deg,
    #e0e0e0,
    #e0e0e0 4px,
    #d0d0d0 4px,
    #d0d0d0 8px
  ) !important;
  border-left-color: #757575 !important;
  color: #424242 !important;
  border-right: 1px solid #bdbdbd;
  border-top: 1px solid #bdbdbd;
  border-bottom: 1px solid #bdbdbd;
}
.slot-block .week-grid-slot-time {
  font-weight: 700;
}

/* Unconfirmed slot — dashed border + muted */
.slot-unconfirmed {
  border-right: 2px dashed var(--color-warning, #f0ad4e) !important;
  border-top: 2px dashed var(--color-warning, #f0ad4e) !important;
  border-bottom: 2px dashed var(--color-warning, #f0ad4e) !important;
  opacity: 0.8;
}

/* Green checkmark for confirmed slots */
.slot-confirmed-check {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 14px;
  height: 14px;
  color: #28a745;
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
  z-index: 2;
  pointer-events: none;
}

/* Schedule toolbar with block button */
.schedule-toolbar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

/* Day view: unconfirmed slot card */
.schedule-slot-card.slot-unconfirmed-card {
  border-left: 3px dashed var(--color-warning, #f0ad4e);
  opacity: 0.8;
}
.schedule-slot-card .confirmed-badge {
  color: #28a745;
  font-size: 14px;
  font-weight: 700;
  margin-left: var(--space-1);
}

/* ============================================
   NOTIFICATION PANEL
   ============================================ */
.notif-panel {
  position: fixed;
  top: 56px;
  right: var(--space-3);
  width: min(360px, calc(100vw - var(--space-6)));
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  animation: fadeIn 150ms ease;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.notif-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  transition: background var(--transition-interactive);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover {
  background: var(--color-surface-offset);
}
.notif-unread {
  background: oklch(from var(--color-primary) l c h / 0.06);
}
.notif-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}
.notif-message {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.notif-time {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}
.notif-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.notif-item-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.notif-item-content {
  flex: 1;
  min-width: 0;
}
.notif-type-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-icon-calendar { color: var(--color-primary); }
.notif-icon-confirm { color: var(--color-success); }
.notif-icon-delete { color: var(--color-error); }
.notif-icon-edit { color: var(--color-warning); }
.notif-icon-car { color: #e67e22; }
.notif-icon-block { color: var(--color-text-muted); }
.notif-icon-bell { color: var(--color-primary); }
.notif-icon-default { color: var(--color-text-muted); }

/* Notification badge on bell */
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notif-bell-btn {
  position: relative;
}

/* ============================================
   BTN-SUCCESS (for confirm button)
   ============================================ */
.btn-success {
  background: var(--color-success);
  color: #fff;
}
.btn-success:hover {
  filter: brightness(0.9);
}

/* ============================================
   SHARE CODE
   ============================================ */
.share-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
}
.share-code-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-primary);
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.filter-chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.filter-chip.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

/* ============================================
   STUDENT DETAIL HEADER
   ============================================ */
.student-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.student-header-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}
.student-header-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-1);
}

/* ============================================
   LESSON REVIEW
   ============================================ */
.lesson-detail-panel {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-border) l c h / 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.lesson-detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.lesson-detail-row:last-child { border-bottom: none; }
.lesson-detail-label { color: var(--color-text-muted); }
.lesson-detail-value { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  z-index: var(--z-toast);
  opacity: 0;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-header {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}
.profile-header .avatar { margin: 0 auto var(--space-3); }
.profile-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}
.profile-section {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-4);
  margin-bottom: var(--space-4);
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.profile-row:last-child { border-bottom: none; }
.profile-row-label { color: var(--color-text-muted); font-size: var(--text-xs); }
.profile-row-value { font-weight: 500; text-align: right; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center;
}
.empty-state svg { width: 48px; height: 48px; color: var(--color-text-faint); margin-bottom: var(--space-3); }
.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.empty-state-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   CHECKLIST (Prüfungsvorbereitung)
   ============================================ */
.checklist-card {
  background: var(--color-success-highlight);
  border: 1px solid oklch(from var(--color-success) l c h / 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: opacity var(--transition-interactive);
}
.checklist-item .check-circle {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-success);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-interactive);
}
.checklist-item.checked .check-circle {
  background: var(--color-success);
}
.checklist-item.checked .check-circle svg {
  display: block;
}
.checklist-item .check-circle svg {
  display: none;
  width: 14px;
  height: 14px;
  color: #fff;
}
.checklist-item.checked .checklist-text {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  text-align: center;
  padding: var(--space-8) var(--space-4) var(--space-4);
}
.app-footer a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }

/* Welcome-Screen braucht position:relative als Anker für discreet-Footer */
#screen-welcome { position: relative; }

/* Diskrete Variante: kleiner, dezenter, am unteren Bildschirmrand verankert */
.app-footer-discreet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  text-align: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  pointer-events: auto;
}
.app-footer-discreet:hover { opacity: 0.8; }
.app-footer-discreet a {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--color-text-faint);
  letter-spacing: 0.1px;
  padding: 2px 4px;
  text-decoration: none;
}
.app-footer-discreet a:hover { text-decoration: underline; }
.app-footer-sep {
  font-size: 10px;
  color: var(--color-text-faint);
  opacity: 0.6;
  margin: 0 1px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.tabular-nums { font-variant-numeric: tabular-nums lining-nums; }

/* ============================================
   QUICK ACTION BTN
   ============================================ */
.quick-action-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.quick-action-row .btn { flex: 1; }

/* ============================================
   PWA splash safe-area
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .top-bar {
    padding-top: max(var(--space-3), env(safe-area-inset-top));
  }
}

/* Activity list */
.activity-list {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-border) l c h / 0.4);
  overflow: hidden;
}

/* ============================================
   LOADING OVERLAY & SPINNER
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.loading-overlay.hidden {
  display: none;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   NEW STUDENTS WIDGET (Admin Dashboard)
   ============================================ */
.new-students-widget {
  background: linear-gradient(135deg, var(--color-primary), oklch(from var(--color-primary) calc(l + 0.08) c h));
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.new-students-widget::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}
.new-students-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.new-students-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.new-students-icon-wrap svg {
  width: 24px;
  height: 24px;
  color: #fff;
}
.new-students-text {
  flex: 1;
}
.new-students-count {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
}
.new-students-label {
  font-size: var(--text-xs);
  opacity: 0.85;
  font-weight: 500;
  margin-top: 2px;
}
.new-students-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.new-student-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 4px;
  font-size: var(--text-xs);
  font-weight: 500;
}
.new-student-chip .avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.new-students-empty {
  font-size: var(--text-xs);
  opacity: 0.7;
}

/* ============================================
   VIEW TOGGLE (Instructor Day/Week)
   ============================================ */
.view-toggle-row {
  display: flex;
  gap: var(--space-2);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-3);
}
.view-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.view-toggle-btn:hover {
  color: var(--color-text);
  background: var(--color-surface);
}
.view-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.view-toggle-btn svg {
  flex-shrink: 0;
}

/* ============================================
   IMAGE UPLOAD (Lesson Notes)
   ============================================ */
.image-upload-area {
  margin-top: var(--space-3);
}
.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.image-preview-item {
  position: relative;
  width: 72px;
  text-align: center;
}
.image-preview-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
.image-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  border: none;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.image-preview-name {
  font-size: 9px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   LESSON IMAGES GRID (Student Detail View)
   ============================================ */
.lesson-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.lesson-image-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lesson-image-item:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.lesson-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */
.lang-selector-wrapper {
  position: relative;
}
.lang-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: fadeIn 150ms ease;
}
.lang-dropdown.hidden {
  display: none;
}
.lang-dropdown button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition-interactive);
}
.lang-dropdown button:hover {
  background: var(--color-surface-offset);
}
.lang-dropdown button.active {
  font-weight: 600;
  color: var(--color-primary);
}
.lang-dropdown button .lang-check {
  margin-left: auto;
  opacity: 0;
}
.lang-dropdown button.active .lang-check {
  opacity: 1;
}

/* ============================================
   RTL SUPPORT (Arabic)
   ============================================ */
html[dir="rtl"] .top-bar-left {
  order: 2;
}
html[dir="rtl"] .top-bar-right {
  order: 1;
  flex-direction: row-reverse;
}
html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}
html[dir="rtl"] .lang-dropdown button {
  text-align: right;
  flex-direction: row-reverse;
}
html[dir="rtl"] .lang-dropdown button .lang-check {
  margin-left: 0;
  margin-right: auto;
}
html[dir="rtl"] .bottom-nav {
  direction: rtl;
}
html[dir="rtl"] .week-grid-slot {
  border-left: none;
  border-right: 3px solid transparent;
}
html[dir="rtl"] .schedule-slot-geplant,
html[dir="rtl"] .schedule-slot-bestätigt,
html[dir="rtl"] .schedule-slot-abgeschlossen {
  border-left: none;
  border-right: 3px solid;
}
html[dir="rtl"] .card {
  text-align: right;
}
html[dir="rtl"] .form-label {
  text-align: right;
}
html[dir="rtl"] .lesson-detail-row {
  flex-direction: row-reverse;
}
html[dir="rtl"] .skill-bar-header {
  flex-direction: row-reverse;
}
html[dir="rtl"] .notif-panel {
  right: auto;
  left: var(--space-3);
}

/* ============================================
   ROUTE TRACKING
   ============================================ */
#lesson-map { width: 100%; }
#lesson-map-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  padding: var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
  z-index: 10;
}
[data-theme="dark"] #lesson-map-panel {
  background: rgba(30,30,30,0.95);
}
.lesson-stats-row { display: flex; justify-content: space-around; margin-bottom: var(--space-3); }
.lesson-stat { text-align: center; }
.lesson-stat-value { font-weight: 600; font-size: var(--text-sm); display: block; }
.lesson-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }

/* Lesson tracking action buttons - prevent overflow on narrow screens */
.lesson-actions-row {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}
.lesson-action-btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-action-icon {
  flex: 0 0 auto;
  line-height: 1;
}
.lesson-action-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Narrow screens: shorten 'Markierung setzen' to fit */
@media (max-width: 480px) {
  .lesson-action-btn {
    font-size: var(--text-sm);
    padding-left: var(--space-1);
    padding-right: var(--space-1);
  }
}
@media (max-width: 380px) {
  .lesson-action-btn .lesson-action-label { font-size: 0.78rem; }
}

/* GPS Status indicator */
.gps-status {
  position: absolute; top: var(--space-2); right: var(--space-2);
  background: rgba(0,0,0,0.7); color: #fff;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full); font-size: var(--text-xs);
  display: flex; align-items: center; gap: var(--space-1);
  z-index: 11;
}
.gps-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-warning);
  display: inline-block;
}
.gps-status.active .gps-status-dot {
  background: var(--color-success);
  animation: gps-pulse 2s ease-in-out infinite;
}

/* Route review */
.route-stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-3); text-align: center; }
.route-stat-value { font-weight: 600; font-size: var(--text-sm); display: block; }
.route-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.route-markers-list { display: flex; flex-direction: column; gap: var(--space-2); }
.route-marker-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--color-bg); border-radius: var(--radius-md); cursor: pointer; transition: background 0.15s; }
.route-marker-item:hover { background: var(--color-bg-hover, var(--color-surface-2)); }
.route-marker-num { width: 28px; height: 28px; border-radius: 50%; background: var(--color-danger, #c53030); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--text-xs); flex-shrink: 0; }
.route-marker-info { flex: 1; }
.route-marker-time { font-size: var(--text-xs); color: var(--color-text-muted); }
.route-marker-note { font-size: var(--text-sm); font-weight: 500; }
.route-marker-sv-icon { font-size: var(--text-xs); color: var(--color-primary); white-space: nowrap; }

/* Street View modal */
.streetview-container { width: 100%; height: 60vh; border-radius: var(--radius-md); overflow: hidden; }
.streetview-note { background: rgba(0,0,0,0.8); color: #fff; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); margin-top: var(--space-3); }
.streetview-note-label { font-size: var(--text-xs); color: var(--color-warning); font-weight: 600; text-transform: uppercase; margin-bottom: var(--space-1); }

/* GPS pulse animation */
@keyframes gps-pulse { 0%{transform:scale(1);opacity:1} 50%{transform:scale(2);opacity:0.3} 100%{transform:scale(1);opacity:1} }

/* ── DSGVO Consent Banner ── */
#dsgvo-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 10000;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  padding: var(--space-4);
  animation: dsgvo-slide-up 0.3s ease-out;
}
@keyframes dsgvo-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.dsgvo-banner-inner {
  max-width: 600px; margin: 0 auto;
}
.dsgvo-text {
  font-size: var(--text-sm); color: var(--color-text-muted);
  line-height: 1.5; margin-bottom: var(--space-3);
}
.dsgvo-text strong { color: var(--color-text); font-size: var(--text-base); }
.dsgvo-actions {
  display: flex; gap: var(--space-2);
}
.dsgvo-actions .btn { flex: 1; }

/* ============================================
   GANTT TIMELINE (Fahrzeugbelegungsübersicht)
   ============================================ */
.gantt-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.gantt-date-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  min-width: 200px;
  text-align: center;
}
.gantt-filter-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.gantt-container {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: var(--color-surface);
}
.gantt-header {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.gantt-label-cell {
  min-width: 100px;
  max-width: 100px;
  padding: var(--space-2);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
}
.gantt-timeline-header {
  display: flex;
  flex: 1;
  min-width: 624px; /* 12 hours * 52px */
}
.gantt-hour-label {
  flex: 1;
  min-width: 52px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
  border-left: 1px solid var(--color-divider);
}
.gantt-hour-label:first-child {
  border-left: none;
}
.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--color-divider);
  min-height: 48px;
}
.gantt-row:last-child {
  border-bottom: none;
}
.gantt-timeline-row {
  flex: 1;
  min-width: 624px;
  position: relative;
  background-image: repeating-linear-gradient(
    to right,
    var(--color-divider) 0,
    var(--color-divider) 1px,
    transparent 1px,
    transparent 52px
  );
  background-size: 52px 100%;
}
.gantt-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
  opacity: 0.9;
  transition: opacity var(--transition-interactive);
}
.gantt-block:hover {
  opacity: 1;
}
.gantt-block-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-top: var(--space-2);
}
.gantt-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.gantt-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ============================================
   VEHICLE MANAGEMENT (Fahrzeugverwaltung)
   ============================================ */

/* ── Sub-Navigation ── */
.veh-subnav {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-1);
}
.veh-subnav-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.veh-subnav-btn:hover {
  color: var(--color-text);
}
.veh-subnav-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ── Vehicle Card ── */
.veh-card {
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.15s, opacity 0.15s;
}
.veh-card:hover {
  box-shadow: var(--shadow-md);
}
.veh-card-inactive {
  opacity: 0.6;
}
.veh-card-inactive:hover {
  opacity: 0.8;
}

.veh-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.veh-icon-inactive {
  opacity: 0.5;
}

/* ── Status Badge ── */
.veh-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
  flex-shrink: 0;
}
.veh-status-badge:hover {
  filter: brightness(0.92);
}
.veh-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.veh-status-aktiv {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
.veh-status-aktiv .veh-status-dot { background: #22c55e; }
.veh-status-werkstatt {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.veh-status-werkstatt .veh-status-dot { background: #f59e0b; }
.veh-status-ausser {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.veh-status-ausser .veh-status-dot { background: #ef4444; }

/* ── Status Dropdown ── */
.veh-status-dropdown {
  display: none;
  position: absolute;
  right: var(--space-3);
  top: calc(100% + 4px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  min-width: 180px;
  padding: var(--space-1) 0;
  overflow: visible;
}
.veh-status-dropdown.open {
  display: block;
}
.veh-dd-option {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: background 0.1s;
}
.veh-dd-option:hover {
  background: var(--color-surface-2);
}
.veh-dd-option.active {
  font-weight: 600;
  background: var(--color-surface-2);
}
.veh-dd-date {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-divider);
  margin-top: var(--space-1);
}

/* ── Detail Page Header ── */
.veh-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ── Utilization Grid ── */
.veh-util-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
@media (max-width: 768px) {
  .veh-util-grid { grid-template-columns: 1fr; }
}
.veh-util-big {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.veh-util-pct {
  font-size: 40px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}
.veh-util-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.veh-util-sub {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}
.veh-util-sub-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.veh-util-sub-val {
  font-weight: 700;
  font-size: var(--text-lg);
}
.veh-util-sub-lbl {
  font-size: 11px;
  color: var(--color-text-muted);
}
.veh-util-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.veh-util-chart-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.veh-util-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  height: 160px;
  padding-top: var(--space-4);
}
.veh-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.veh-bar-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.veh-bar {
  width: 100%;
  max-width: 36px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--color-surface-2);
  transition: height 0.3s ease;
}
.veh-bar-label {
  font-size: 10px;
  color: var(--color-text-muted);
}
.veh-bar-label.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Maintenance Grid ── */
.veh-maint-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
@media (max-width: 768px) {
  .veh-maint-grid { grid-template-columns: 1fr; }
}

/* ── History Table ── */
.veh-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.veh-hist-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}
.veh-hist-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  vertical-align: middle;
  white-space: nowrap;
}
.veh-hist-table tr:last-child td {
  border-bottom: none;
}
.veh-inst-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ── Week View ── */
.veh-week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.veh-week-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  min-width: 240px;
  text-align: center;
}

/* Vehicle Tabs */
.veh-tabs-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}
.veh-tab {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  min-width: 100px;
  flex-shrink: 0;
}
.veh-tab:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-2);
}
.veh-tab.active {
  border-color: var(--color-primary);
  background: rgba(13, 148, 136, 0.08);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.veh-tab-brand {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.veh-tab-plate {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* Week Calendar Grid */
.veh-week-grid {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.veh-week-header {
  display: flex;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.veh-week-time-col {
  min-width: 70px;
  max-width: 70px;
  padding: var(--space-2);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
}
.veh-week-day-col {
  flex: 1;
  text-align: center;
  padding: var(--space-2);
  border-right: 1px solid var(--color-divider);
}
.veh-week-day-col:last-child {
  border-right: none;
}
.veh-week-day-name {
  font-weight: 600;
  font-size: var(--text-xs);
}
.veh-week-day-date {
  font-size: 10px;
  color: var(--color-text-muted);
}
.veh-week-body {
  max-height: 576px; /* 12h * 48px */
  overflow-y: auto;
}
.veh-week-row {
  display: flex;
  min-height: 48px;
  border-bottom: 1px solid var(--color-divider);
}
.veh-week-row:last-child {
  border-bottom: none;
}
.veh-week-time-cell {
  min-width: 70px;
  max-width: 70px;
  padding: var(--space-2) var(--space-1);
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.veh-week-day-cell {
  flex: 1;
  position: relative;
  border-right: 1px solid var(--color-divider);
  min-height: 48px;
  padding: 1px;
}
.veh-week-day-cell:last-child {
  border-right: none;
}

/* Booking Block */
.veh-week-block {
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 3px 6px;
  font-size: 10px;
  overflow: hidden;
  cursor: default;
  position: relative;
  z-index: 1;
}
.veh-week-block-time {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.veh-week-block-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}
.veh-week-block-student {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.75;
  font-size: 9px;
}

/* ══ Password Toggle ══ */
.password-input-wrapper{position:relative;display:flex;align-items:center}
.password-input-wrapper .form-input{padding-right:44px;width:100%}
.password-toggle-btn{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;padding:4px;color:var(--text-muted);display:flex;align-items:center;justify-content:center}
.password-toggle-btn:hover{color:var(--text-primary)}
.password-toggle-btn svg{width:20px;height:20px}

/* ══ Sunset Line ══ */
.sunset-line{position:absolute;left:0;right:0;height:0;border-top:2px dashed #f59e0b;z-index:2;pointer-events:none}
.sunset-label{position:absolute;right:4px;top:-18px;font-size:10px;color:#f59e0b;white-space:nowrap;background:var(--bg-primary);padding:0 4px;border-radius:4px}

/* ══ Rest Zone ══ */
.rest-zone{position:absolute;left:0;right:0;background:rgba(239,68,68,0.08);z-index:1;pointer-events:none;border-top:1px dashed rgba(239,68,68,0.3);border-bottom:1px dashed rgba(239,68,68,0.3)}
.rest-zone-label{position:absolute;left:4px;top:2px;font-size:9px;color:#ef4444;white-space:nowrap}
.rest-warning-banner{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 14px;margin-bottom:12px;font-size:13px;color:#991b1b;display:none}
.rest-warning-banner.visible{display:block}

/* ══ Lesson Pause ══ */
.btn-warning{background:#f59e0b;color:#fff;border:none}
.btn-warning:hover{background:#d97706}
.lesson-paused-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:10;display:none;align-items:center;justify-content:center;flex-direction:column}
.lesson-paused-overlay.visible{display:flex}
.lesson-paused-badge{background:#f59e0b;color:#fff;font-size:24px;font-weight:700;padding:20px 40px;border-radius:16px;font-family:var(--font-display)}

/* ══ Change Password Section ══ */
.change-password-card{background:var(--bg-secondary);border-radius:12px;padding:20px;margin-top:20px}
.change-password-card h4{margin:0 0 16px 0;font-size:var(--text-base);font-weight:600}

/* ══ Recurring Appointments ══ */
.recurring-toggle{display:flex;align-items:center;gap:8px;padding:10px 0;cursor:pointer;user-select:none}
.recurring-toggle input[type="checkbox"]{width:18px;height:18px;accent-color:var(--color-primary);cursor:pointer}
.recurring-toggle label{font-size:var(--text-sm);font-weight:500;cursor:pointer;color:var(--color-text)}
.recurring-options{display:none;background:var(--bg-secondary);border-radius:var(--radius-sm);padding:12px;margin-bottom:12px;border:1px solid var(--color-border)}
.recurring-options.visible{display:block}
.recurring-conflicts{margin-top:10px;max-height:180px;overflow-y:auto;font-size:var(--text-sm)}
.recurring-conflict-item{display:flex;align-items:center;gap:6px;padding:4px 0;border-bottom:1px solid var(--color-border)}
.recurring-conflict-item:last-child{border-bottom:none}
.recurring-conflict-ok{color:#16a34a;font-weight:500}
.recurring-conflict-bad{color:#dc2626;font-weight:500}
.recurring-badge{display:inline-flex;align-items:center;font-size:10px;margin-left:4px;opacity:0.7}
.recurring-delete-popup{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:1000;display:flex;align-items:center;justify-content:center}
.recurring-delete-dialog{background:var(--bg-primary);border-radius:var(--radius-md);padding:24px;max-width:360px;width:90%;box-shadow:0 8px 32px rgba(0,0,0,0.2)}
.recurring-delete-dialog h4{margin:0 0 16px 0;font-size:var(--text-base);font-weight:600}
.recurring-delete-dialog .btn{width:100%;margin-bottom:8px;text-align:center}
.recurring-delete-dialog .btn:last-child{margin-bottom:0}
/* ══════════════════════════════════════════ */
/* THEORY PLANNING                           */
/* ══════════════════════════════════════════ */

/* Theory Management View */
.theory-section{margin-bottom:var(--space-8)}
.theory-section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4)}
.theory-section-header .section-title{margin:0}

/* Room Cards */
.theory-room-card{display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);margin-bottom:var(--space-2)}
.theory-room-info{display:flex;align-items:center;gap:var(--space-3)}
.theory-room-icon{width:36px;height:36px;border-radius:var(--radius-md);background:var(--color-purple-highlight);color:var(--color-purple);display:flex;align-items:center;justify-content:center}
.theory-room-icon svg{width:18px;height:18px}
.theory-room-name{font-weight:600;font-size:var(--text-sm)}
.theory-room-seats{font-size:var(--text-xs);color:var(--color-text-muted)}
.theory-room-actions{display:flex;gap:var(--space-2)}

/* Room Form */
.theory-room-form{display:flex;gap:var(--space-2);align-items:flex-end;padding:var(--space-3);background:var(--color-surface-offset);border-radius:var(--radius-md);margin-bottom:var(--space-3)}
.theory-room-form .form-group{margin-bottom:0;flex:1}
.theory-room-form .form-group:last-of-type{flex:0 0 100px}

/* Topic List */
.theory-topic-list{display:flex;flex-direction:column;gap:var(--space-1)}
.theory-topic-item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);font-size:var(--text-sm)}
.theory-topic-number{width:28px;height:28px;border-radius:var(--radius-full);background:var(--color-purple);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;flex-shrink:0}
.theory-topic-title{flex:1;font-size:var(--text-sm)}
.theory-topic-badge{font-size:10px;padding:2px 8px;border-radius:var(--radius-full);font-weight:600}
.theory-topic-badge.basic{background:var(--color-primary-highlight);color:var(--color-primary)}
.theory-topic-badge.additional{background:var(--color-purple-highlight);color:var(--color-purple)}

/* Rotation Form */
.theory-rotation-form{padding:var(--space-4);background:var(--color-surface-offset);border-radius:var(--radius-md);margin-bottom:var(--space-4)}
.theory-rotation-form .form-group{margin-bottom:var(--space-3)}
.theory-rotation-days{display:flex;gap:var(--space-2);flex-wrap:wrap}
.theory-day-check{display:flex;align-items:center;gap:var(--space-1);cursor:pointer;padding:var(--space-1) var(--space-2);border:1px solid var(--color-border);border-radius:var(--radius-md);font-size:var(--text-sm);transition:var(--transition-interactive);user-select:none}
.theory-day-check:hover{border-color:var(--color-purple)}
.theory-day-check.selected{background:var(--color-purple);color:#fff;border-color:var(--color-purple)}
.theory-rotation-times{display:flex;gap:var(--space-3);align-items:flex-end}
.theory-rotation-times .form-group{margin-bottom:0;flex:1}
.theory-rotation-current{padding:var(--space-3);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);font-size:var(--text-sm);margin-bottom:var(--space-3)}

/* Theory Week Grid Blocks */
.week-grid-slot.theory-slot{background:#f0e6ff;border:2px dashed #8b5cf6;color:#5b21b6;cursor:pointer}
.week-grid-slot.theory-slot:hover{background:#e4d4fb}
.week-grid-slot.theory-slot .theory-slot-label{color:#5b21b6;font-weight:700}
.week-grid-slot.theory-slot .theory-slot-time{color:#6d28d9}
.week-grid-slot.theory-slot-assigned{background:#6d28d9;border:2px solid #5b21b6;color:#fff;cursor:pointer}
.week-grid-slot.theory-slot-assigned:hover{background:#7c3aed}
.week-grid-slot.theory-slot-assigned .theory-slot-label,
.week-grid-slot.theory-slot-assigned .theory-slot-time{color:#fff;opacity:1;font-weight:600}
.week-grid-slot.theory-slot-assigned .week-grid-slot-student{color:rgba(255,255,255,0.9)}
.theory-slot-label{font-size:10px;font-weight:600;line-height:1.2}
.theory-slot-time{font-size:9px;opacity:0.8}

/* Theory Detail Modal */
.theory-detail-header{display:flex;align-items:center;gap:var(--space-3);margin-bottom:var(--space-4);padding-bottom:var(--space-3);border-bottom:1px solid var(--color-divider)}
.theory-detail-topic-num{width:40px;height:40px;border-radius:var(--radius-full);background:var(--color-purple);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;flex-shrink:0}
.theory-detail-info h4{margin:0;font-size:var(--text-base);font-weight:600}
.theory-detail-info p{margin:2px 0 0;font-size:var(--text-xs);color:var(--color-text-muted)}
.theory-detail-row{display:flex;align-items:center;justify-content:space-between;padding:var(--space-2) 0;border-bottom:1px solid var(--color-divider);font-size:var(--text-sm)}
.theory-detail-row:last-child{border-bottom:none}
.theory-detail-label{color:var(--color-text-muted);font-size:var(--text-xs)}
.theory-detail-value{font-weight:500}
.theory-assign-row{display:flex;align-items:center;gap:var(--space-2);margin:var(--space-3) 0}
.theory-assign-row select{flex:1}

/* Attendance Section */
.theory-attendance-section{margin-top:var(--space-4);padding-top:var(--space-3);border-top:1px solid var(--color-divider)}
.theory-attendance-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-3)}
.theory-attendance-counter{font-size:var(--text-sm);font-weight:600;color:var(--color-purple)}
.theory-attendance-list{max-height:300px;overflow-y:auto}
.theory-attendance-item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) 0;border-bottom:1px solid var(--color-divider);font-size:var(--text-sm)}
.theory-attendance-item:last-child{border-bottom:none}
.theory-attendance-item label{display:flex;align-items:center;gap:var(--space-2);cursor:pointer;flex:1}
.theory-attendance-item input[type="checkbox"]{width:18px;height:18px;accent-color:var(--color-purple)}

/* Theory Progress Grid */
.theory-progress-section{margin-top:var(--space-4)}
.theory-progress-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--space-2);margin-bottom:var(--space-3)}
.theory-progress-box{width:100%;aspect-ratio:1;border-radius:var(--radius-md);display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:12px;font-weight:700;border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);transition:var(--transition-interactive)}
.theory-progress-box.attended{background:var(--color-success);color:#fff;border-color:var(--color-success)}
.theory-progress-box .topic-num{font-size:14px;line-height:1}
.theory-progress-box .topic-check{font-size:10px;margin-top:2px}
.theory-progress-summary{font-size:var(--text-sm);color:var(--color-text-muted);text-align:center;font-weight:500}

/* Multi View */
/* Multi-view: 2 or 3 instructor panels side by side */
.multi-view-container{display:flex;gap:var(--space-3);width:100%}
.multi-view-panel{flex:1;min-width:0;overflow:hidden}
.multi-view-select{font-size:var(--text-sm);padding:var(--space-1) var(--space-2)}
.multi-view-panel .week-grid{font-size:11px}
.multi-view-panel .week-grid-day-name{font-size:10px}
.multi-view-panel .week-grid-day-date{font-size:10px}
.multi-view-panel .week-grid-time-label{font-size:9px}
.multi-view-panel .theory-slot-label{font-size:8px}
.multi-view-panel .theory-slot-time{font-size:7px}
.multi-view-panel .week-grid-scroll-wrapper{overflow-x:auto}
.multi-view-panel .week-grid-header{user-select:none}
/* 3-panel: even smaller text */
.multi-view-3 .multi-view-panel .week-grid{font-size:10px}
.multi-view-3 .multi-view-panel .week-grid-day-name{font-size:9px}
.multi-view-3 .multi-view-panel .week-grid-day-date{font-size:9px}
.multi-view-3 .multi-view-panel .week-grid-time-label{font-size:8px}
.multi-view-3 .multi-view-panel .week-grid-slot{font-size:9px}
/* Full width in multi-view */
.multi-view-active{max-width:100%!important;padding-left:var(--space-2)!important;padding-right:var(--space-2)!important}
/* Active view toggle button */
.btn-active-view{background:var(--color-primary)!important;color:#fff!important;border-color:var(--color-primary)!important}
@media(max-width:900px){.multi-view-container{flex-direction:column}}

/* Dashboard Search */
.dashboard-search-wrapper{position:relative;margin-bottom:var(--space-4)}
.dashboard-search-input{width:100%;padding:var(--space-3) var(--space-4);padding-left:40px;border:1px solid var(--color-border);border-radius:var(--radius-lg);font-size:var(--text-sm);background:var(--color-surface);transition:var(--transition-interactive)}
.dashboard-search-input:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(20,184,166,0.15)}
.dashboard-search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--color-text-muted);pointer-events:none}
.dashboard-search-results{position:absolute;top:100%;left:0;right:0;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);z-index:var(--z-dropdown);max-height:300px;overflow-y:auto;display:none}
.dashboard-search-results.visible{display:block}
.dashboard-search-item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);cursor:pointer;transition:var(--transition-interactive)}
.dashboard-search-item:hover{background:var(--color-surface-alt)}
.dashboard-search-item-name{font-weight:600;font-size:var(--text-sm)}
.dashboard-search-item-role{font-size:var(--text-xs);color:var(--color-text-muted)}
.dashboard-search-no-results{padding:var(--space-4);text-align:center;color:var(--color-text-muted);font-size:var(--text-sm)}

/* ══════════════════════════════════════════
   SLOT OFFER (Termine anbieten)
   ══════════════════════════════════════════ */
.btn-active-offer{background:var(--color-info)!important;color:#fff!important;border-color:var(--color-info)!important}
.slot-offer-hint{background:rgba(59,130,246,0.08);border:1px solid rgba(59,130,246,0.2);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);margin-bottom:var(--space-3);font-size:var(--text-sm);color:var(--color-info);display:flex;align-items:center;gap:var(--space-2)}
.slot-offer-hint svg{flex-shrink:0}

/* Selected slot chip in calendar */
.week-grid-slot-offer-selected{position:absolute;left:2px;right:2px;border-radius:var(--radius-sm);background:rgba(59,130,246,0.15);border:2px solid var(--color-info);z-index:5;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:var(--text-xs);color:var(--color-info);font-weight:600;transition:var(--transition-interactive)}
.week-grid-slot-offer-selected:hover{background:rgba(59,130,246,0.25)}

/* Offer mode overlay on grid cells - cursor changes */
.week-grid-offer-mode .week-grid-day-col{cursor:crosshair}

/* Pending slot offer in calendar - dashed border, blass Füllung */
.week-grid-slot.slot-offer-pending{
  background:rgba(5,150,105,0.08) !important;
  border:2px dashed var(--color-primary) !important;
  color:var(--color-primary) !important;
  opacity:0.85;
}
.week-grid-slot.slot-offer-pending .week-grid-slot-time,
.week-grid-slot.slot-offer-pending .week-grid-slot-name,
.week-grid-slot.slot-offer-pending .week-grid-slot-instructor,
.week-grid-slot.slot-offer-pending .week-grid-slot-type{
  color:var(--color-primary) !important;
  font-style:italic;
}
.week-grid-slot.slot-offer-pending:hover{
  background:rgba(5,150,105,0.15) !important;
  opacity:1;
}

/* Slot offer dialog */
.slot-offer-dialog{padding:var(--space-4);max-width:500px;margin:0 auto}
.slot-offer-dialog h3{font-size:var(--text-lg);font-weight:700;color:var(--color-text)}
.slot-offer-slots-list{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-bottom:var(--space-3)}
.slot-offer-chip{background:rgba(59,130,246,0.1);border:1px solid rgba(59,130,246,0.3);color:var(--color-info);border-radius:var(--radius-full);padding:var(--space-1) var(--space-3);font-size:var(--text-xs);font-weight:500;white-space:nowrap}

/* Student selection list in dialog */
.slot-offer-student-list{max-height:200px;overflow-y:auto;border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-2)}
.slot-offer-student-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2);border-radius:var(--radius-sm);cursor:pointer;font-size:var(--text-sm);transition:var(--transition-interactive)}
.slot-offer-student-row:hover{background:var(--color-surface-alt)}
.slot-offer-student-row input[type="checkbox"]{accent-color:var(--color-info);width:16px;height:16px;flex-shrink:0}

/* ── Student view: Open Offers ── */
.offer-card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-4);margin-bottom:var(--space-3);transition:var(--transition-interactive)}
.offer-card:hover{border-color:var(--color-info);box-shadow:0 2px 8px rgba(59,130,246,0.1)}
.offer-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space-3)}
.offer-card-instructor{font-weight:600;font-size:var(--text-sm);color:var(--color-text)}
.offer-card-expires{font-size:var(--text-xs);color:var(--color-text-muted)}
.offer-card-slots{display:flex;flex-direction:column;gap:var(--space-2)}
.offer-slot-row{display:flex;align-items:center;justify-content:space-between;background:var(--color-surface-alt);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3)}
.offer-slot-time{font-size:var(--text-sm);font-weight:500}
.offer-slot-status{font-size:var(--text-xs)}
.offer-slot-status.booked{color:var(--color-warning)}
.offer-slot-status.available{color:var(--color-success)}
.offer-slot-status.expired{color:var(--color-text-muted)}
.offer-slot-actions{display:flex;gap:var(--space-1);margin-left:var(--space-2)}
.btn-icon{background:transparent;border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:4px 8px;cursor:pointer;font-size:14px;line-height:1;transition:var(--transition-interactive);display:inline-flex;align-items:center;justify-content:center}
.btn-icon:hover{background:var(--color-surface-alt);border-color:var(--color-text-muted)}
.btn-icon-edit:hover{border-color:var(--color-info);background:rgba(59,130,246,0.08)}
.btn-icon-delete:hover{border-color:var(--color-danger);background:rgba(239,68,68,0.08)}
.offer-card-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin-top:var(--space-3);padding-top:var(--space-3);border-top:1px solid var(--color-border)}
.btn-danger-outline{background:transparent;color:var(--color-danger);border:1px solid var(--color-danger);padding:var(--space-1) var(--space-3);border-radius:var(--radius-md);font-size:var(--text-xs);font-weight:500;cursor:pointer;transition:var(--transition-interactive)}
.btn-danger-outline:hover{background:var(--color-danger);color:#fff}

/* Student fahrstunden tabs */
.student-fahrstunden-tabs{display:flex;gap:var(--space-1);background:var(--color-surface-alt);border-radius:var(--radius-lg);padding:var(--space-1);margin-bottom:var(--space-4)}
.student-fahrstunden-tab{flex:1;text-align:center;padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);font-size:var(--text-sm);font-weight:500;cursor:pointer;transition:var(--transition-interactive);color:var(--color-text-muted);border:none;background:transparent}
.student-fahrstunden-tab.active{background:var(--color-surface);color:var(--color-text);box-shadow:var(--shadow-sm)}

/* Lesson card (student upcoming/past) */
.lesson-card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-3) var(--space-4);margin-bottom:var(--space-2);display:flex;align-items:center;justify-content:space-between}
.lesson-card-info{display:flex;flex-direction:column;gap:2px}
.lesson-card-date{font-weight:600;font-size:var(--text-sm)}
.lesson-card-detail{font-size:var(--text-xs);color:var(--color-text-muted)}
.lesson-card-action{flex-shrink:0}

/* ════════════════════════════════════════════
   TAGESÜBERSICHT — Print-Layout & Helpers
   ════════════════════════════════════════════ */
.daily-row-done { opacity: .5; text-decoration: line-through; }
.daily-row-done td { background: #f3f4f6 !important; }
.print-only { display: none !important; }

@media print {
  body { background: #fff !important; color: #000 !important; }
  /* Alles ausblenden außer Tagesübersicht */
  .bottom-nav, .top-header, #school-trial-banner, #notification-bell-wrap,
  .no-print, button, input, select { display: none !important; }
  #daily-summary-view input, #daily-summary-view select { display: none !important; }
  #school-main { padding: 0 !important; margin: 0 !important; }
  #daily-summary-view { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .print-only { display: block !important; }
  .daily-table { font-size: 11px !important; width: 100% !important; }
  .daily-table th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .daily-table td, .daily-table th { padding: 4px 6px !important; border-bottom: 1px solid #ccc !important; }
  .daily-row-done { opacity: 1; text-decoration: none; }
  .daily-row-done td { background: #fff !important; }
  @page { size: A4 landscape; margin: 1cm; }
}

/* ════════════════════════════════════════════
   PWA-INSTALL-KARTE
   "Zum Home-Bildschirm hinzufügen" — Floating Card
   ════════════════════════════════════════════ */
.pwa-install-card {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  overflow: hidden;
  z-index: 9000;
  opacity: 0;
  transform: translateY(20px) scale(.95);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
  font-family: inherit;
}
.pwa-install-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
/* Collapsed-Modus: nur Header sichtbar, Tabs/Steps/Footer ausgeblendet */
.pwa-install-card.collapsed .pwa-card-tabs,
.pwa-install-card.collapsed .pwa-card-steps,
.pwa-install-card.collapsed .pwa-card-footer {
  display: none;
}
.pwa-install-card.collapsed .pwa-card-header {
  border-bottom: none;
  cursor: pointer;
}
.pwa-install-card.collapsed .pwa-card-expand {
  display: flex;
}
.pwa-card-expand {
  display: none;
  width: 28px; height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
}
.pwa-install-card:not(.collapsed) .pwa-card-expand { display: none; }
.pwa-install-card.collapsed .pwa-card-close { display: none; }
.pwa-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.pwa-card-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.02em;
}
.pwa-card-title { flex: 1; min-width: 0; }
.pwa-card-title strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-default, #0f172a);
}
.pwa-card-title span {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}
.pwa-card-close {
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pwa-card-close:hover { background: #f1f5f9; color: var(--text-default, #0f172a); }

.pwa-card-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.pwa-card-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.pwa-card-tab.active {
  color: #0d9488;
  background: #fff;
  border-bottom-color: #0d9488;
}
.pwa-platform-icon { display: inline-block; margin-right: 4px; vertical-align: -2px; }

.pwa-card-steps { padding: 14px; display: none; }
.pwa-card-steps.active { display: block; }
.pwa-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.pwa-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 100%;
  width: 1px;
  height: 8px;
  background: var(--border-color, #e2e8f0);
}
.pwa-step-num {
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #0d9488;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.pwa-step-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d9488;
}
.pwa-step-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-default, #0f172a);
  line-height: 1.4;
}
.pwa-step-text strong { font-weight: 700; }
.pwa-step-text small {
  display: block;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  margin-top: 2px;
}
.pwa-card-footer {
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color, #e2e8f0);
  font-size: 11px;
  color: var(--text-muted, #64748b);
  text-align: center;
}
.pwa-card-footer span { color: #0d9488; font-weight: 600; }

@media (max-width: 480px) {
  .pwa-install-card {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .pwa-install-card { background: #1e293b; border-color: #334155; }
  .pwa-card-header, .pwa-card-tabs, .pwa-card-footer { border-color: #334155; }
  .pwa-card-tabs, .pwa-card-footer { background: #0f172a; }
  .pwa-card-tab.active { background: #1e293b; }
  .pwa-card-title strong { color: #f1f5f9; }
  .pwa-card-close:hover { background: #334155; color: #f1f5f9; }
  .pwa-step-icon { background: #0f172a; border-color: #334155; }
  .pwa-step-text { color: #f1f5f9; }
  .pwa-step:not(:last-child)::after { background: #334155; }
}

/* ============================================
   SIGNUP TRIAL-PROMO — 14 Tage gratis (nur Fahrschule, eigener Namespace)
   ============================================ */
.signup-trial-promo {
  display: block;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  text-align: left;
  background: linear-gradient(135deg, var(--color-primary-highlight) 0%, oklch(from var(--color-primary) l c h / 0.08) 100%);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: 0 0 var(--space-4) 0;
  animation: signupTrialPromoIn 0.35s ease-out;
}
.signup-trial-promo.hidden { display: none; }

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

.signup-trial-promo-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.signup-trial-promo-badge {
  background: var(--color-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-block;
}
.signup-trial-promo-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.signup-trial-promo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.signup-trial-promo-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--color-text);
  line-height: 1.4;
}
.signup-trial-promo-list li svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-success);
}

/* ============================================
   WELCOME-MODAL nach Erstregistrierung
   ============================================ */
.welcome-modal-body {
  padding: 0 2px;
}
.welcome-modal-lead {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
}
.welcome-modal-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--color-text-muted, var(--color-text));
  margin: 0 0 var(--space-4) 0;
}
.welcome-modal-text strong {
  color: var(--color-text);
  font-weight: 600;
}
.welcome-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
