/* ═══════════════════════════════════════════════════════════════════
   BBG Portal — Stylesheet
   Outfit Font · Marine-Blau & Signal-Gelb Palette
   Fahrer-freundlich: große Touch-Targets, hoher Kontrast
   ═══════════════════════════════════════════════════════════════════ */

/* ── RESET & VARIABLES ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1a2744;
  --navy-dark:   #111b33;
  --navy-mid:    #243156;
  --navy-light:  #2e3f6e;
  --yellow:      #f5c200;
  --yellow-dark: #d4a800;
  --yellow-light:#fff3b0;
  --white:       #ffffff;
  --gray-50:     #f8f9fb;
  --gray-100:    #eef0f5;
  --gray-200:    #dde1ec;
  --gray-400:    #9aa3bb;
  --gray-600:    #5a6480;
  --gray-800:    #2c3350;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --orange:      #ea580c;
  --orange-light:#ffedd5;
  --blue:        #2563eb;
  --blue-light:  #dbeafe;
  --purple:      #7c3aed;
  --purple-light:#ede9fe;

  --sidebar-w:   260px;
  --topbar-h:    60px;
  --bottom-nav-h:72px;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 2px 16px rgba(26,39,68,.10);
  --shadow-lg:   0 8px 40px rgba(26,39,68,.18);
  --transition:  all .22s cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--navy);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── UTILITIES ──────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-2  { gap: .5rem; }
.gap-3  { gap: .75rem; }
.gap-4  { gap: 1rem; }
.text-sm   { font-size: .875rem; }
.text-xs   { font-size: .75rem; }
.text-muted { color: var(--gray-600); }
.bold   { font-weight: 700; }
.w-full { width: 100%; }

/* ── SCREEN SYSTEM ──────────────────────────────────────────────── */
.screen { min-height: 100dvh; }
.screen.active { display: flex; }
.screen.hidden  { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════ */
#screen-login {
  align-items: center;
  justify-content: center;
  background: var(--navy-dark);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-bus-stripe {
  position: absolute;
  width: 180%;
  height: 80px;
  background: linear-gradient(90deg, transparent, rgba(245,194,0,.07), transparent);
  transform: rotate(-25deg);
  animation: busStripe 6s linear infinite;
  top: 30%;
}
.login-bus-stripe.delay1 { animation-delay: 2s; top: 55%; height: 40px; opacity: .6; }
.login-bus-stripe.delay2 { animation-delay: 4s; top: 72%; height: 25px; opacity: .4; }
@keyframes busStripe {
  from { transform: rotate(-25deg) translateX(-60%); }
  to   { transform: rotate(-25deg) translateX(60%); }
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: min(420px, calc(100vw - 2rem));
  box-shadow: var(--shadow-lg);
  animation: slideUp .5s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
}
.login-logo-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.15));
}
.login-logo-text { display: flex; flex-direction: column; }
.login-logo-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -.02em;
}
.login-logo-sub {
  font-size: .85rem;
  color: var(--gray-600);
  font-weight: 500;
}
.login-company {
  font-size: .8rem;
  color: var(--gray-400);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.login-form { display: flex; flex-direction: column; gap: 1.1rem; }

.form-field { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.form-input {
  width: 100%;
  padding: .85rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--navy);
  background: var(--gray-50);
  transition: var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(26,39,68,.08);
}

.input-pw-wrap { position: relative; }
.input-pw-wrap .form-input { padding-right: 3rem; }
.pw-toggle {
  position: absolute; right: .75rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; opacity: .5;
  transition: opacity .2s;
  padding: .25rem;
}
.pw-toggle:hover { opacity: 1; }

.login-error {
  background: var(--red-light);
  color: var(--red);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid var(--red);
}

.btn-login {
  width: 100%;
  padding: 1rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: .5rem;
}
.btn-login:hover  { background: var(--navy-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,39,68,.25); }
.btn-login:active { transform: translateY(0); }
.btn-login::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--yellow);
}

.login-footer {
  text-align: center;
  font-size: .75rem;
  color: var(--gray-400);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

/* ═══════════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════════ */
#screen-app {
  display: flex;
  flex-direction: row;
  min-height: 100dvh;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100dvh;
  position: fixed;
  left: 0; top: 0;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}
.sidebar-close {
  background: none; border: none;
  color: var(--gray-400); cursor: pointer;
  font-size: 1.1rem; padding: .3rem;
  border-radius: 4px;
  transition: color .2s;
}
.sidebar-close:hover { color: var(--white); }

.sidebar-user {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-user-name { color: var(--white); font-weight: 600; font-size: .95rem; }
.sidebar-user-role {
  display: inline-block;
  margin-top: .3rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  background: rgba(245,194,0,.2);
  color: var(--yellow);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .8rem 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-section { padding: .5rem 1.2rem .2rem; }
.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.2rem;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: .92rem;
  font-weight: 500;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--white); }
.nav-item.active {
  background: rgba(245,194,0,.1);
  color: var(--yellow);
  border-left-color: var(--yellow);
}
.nav-item-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; flex-shrink: 0; }
.nav-item-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-bottom {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-logout {
  width: 100%;
  padding: .75rem;
  background: rgba(220,38,38,.12);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,.2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.sidebar-logout:hover { background: rgba(220,38,38,.25); color: var(--white); }

/* ── MAIN AREA ───────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: var(--bottom-nav-h);
}

/* ── TOPBAR ──────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--yellow);
  flex-shrink: 0;
}
.topbar-menu {
  background: none; border: none;
  color: var(--white); font-size: 1.4rem;
  cursor: pointer; padding: .4rem;
  border-radius: var(--radius-sm);
  transition: background .2s;
  line-height: 1;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.topbar-menu:hover { background: rgba(255,255,255,.1); }
.topbar-title {
  flex: 1;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.topbar-bell {
  position: relative;
  background: none; border: none;
  color: rgba(255,255,255,.8); font-size: 1.3rem;
  cursor: pointer; padding: .4rem;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.topbar-bell:hover { background: rgba(255,255,255,.1); color: var(--white); }
.bell-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--red);
  color: white; font-size: .6rem; font-weight: 700;
  padding: .1rem .3rem; border-radius: 10px;
  min-width: 16px; text-align: center;
  border: 2px solid var(--navy-dark);
}
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── PAGE CONTENT ────────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 1.25rem 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── BOTTOM NAV (Mobile / Fahrer) ────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 150;
  border-top: 2px solid var(--yellow);
  padding: 0 .5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .25rem;
  flex: 1;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: .5rem .25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 56px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bnav-item:active { transform: scale(.92); }
.bnav-item.active { color: var(--yellow); }
.bnav-icon { font-size: 1.5rem; line-height: 1; }
.bnav-item.active .bnav-icon { filter: drop-shadow(0 0 8px rgba(245,194,0,.5)); }

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════ */
.dashboard-greeting {
  margin-bottom: 1.5rem;
}
.dashboard-greeting h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.dashboard-greeting p {
  color: var(--gray-600);
  font-size: .95rem;
  margin-top: .25rem;
}

/* Fahrer-Schnellzugriff (große Kacheln) */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .875rem;
  margin-bottom: 1.5rem;
}
.quick-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  min-height: 120px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.quick-card:active { transform: scale(.96); }
.quick-card:hover { border-color: var(--navy-light); box-shadow: var(--shadow-lg); }
.quick-card.accent { background: var(--navy); color: var(--white); border-color: var(--navy); }
.quick-card.urgent { background: var(--red); color: var(--white); border-color: var(--red); animation: pulse 2s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}
.quick-card-icon { font-size: 2.2rem; line-height: 1; }
.quick-card-label { font-size: .9rem; font-weight: 700; }
.quick-card-sub   { font-size: .75rem; opacity: .7; }

/* Status-Karten */
.status-row {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  scrollbar-width: none;
}
.status-row::-webkit-scrollbar { display: none; }
.status-chip {
  flex-shrink: 0;
  background: var(--white);
  border-radius: 30px;
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
}
.status-chip .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green  { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.dot-red    { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-blue   { background: var(--blue); }

/* Neuigkeiten-Widget */
.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title-more {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  background: none; border: none;
  font-family: inherit;
  padding: .2rem .5rem;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.section-title-more:hover { background: var(--blue-light); }

/* News-Karten */
.news-list { display: flex; flex-direction: column; gap: .75rem; }
.news-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  display: flex;
  gap: .75rem;
  position: relative;
  overflow: hidden;
}
.news-card.unread::after {
  content: '';
  position: absolute;
  top: .75rem; right: .75rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
}
.news-card.urgent { border-left-color: var(--red); }
.news-card.pinned { border-left-color: var(--yellow-dark); background: #fffdf0; }
.news-card:hover { transform: translateX(3px); box-shadow: var(--shadow-lg); }
.news-card-body { flex: 1; min-width: 0; }
.news-card-cat {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-600);
  margin-bottom: .3rem;
}
.news-card-title {
  font-size: .97rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-meta {
  font-size: .75rem;
  color: var(--gray-400);
  margin-top: .4rem;
  display: flex;
  gap: .75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   NEWS PAGE
   ═══════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 800; }
.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.1rem;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.1rem;
  background: var(--gray-100);
  color: var(--navy);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { background: var(--gray-200); }

.filter-row {
  display: flex; gap: .5rem;
  overflow-x: auto; padding-bottom: .5rem;
  margin-bottom: 1rem;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: .45rem .9rem;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-family: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; color: var(--gray-600);
  transition: var(--transition);
}
.filter-chip.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

.news-detail {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.news-detail h1 { font-size: 1.4rem; font-weight: 800; line-height: 1.3; margin-bottom: .75rem; }
.news-detail-meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--gray-600);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.news-detail-content { line-height: 1.75; font-size: .97rem; }
.news-detail-content p { margin-bottom: 1rem; }
.news-detail-content h2,h3 { margin: 1.25rem 0 .5rem; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════
   SCHADENSMELDUNG
   ═══════════════════════════════════════════════════════════════════ */
.damage-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.damage-form h2 {
  font-size: 1.2rem; font-weight: 800;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--yellow);
}

.form-grid { display: grid; gap: 1rem; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--gray-600); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .97rem;
  color: var(--navy);
  background: var(--gray-50);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(26,39,68,.08);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* Severity-Auswahl */
.severity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
}
.severity-btn {
  padding: .75rem .5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: inherit;
}
.severity-btn span { display: block; font-size: 1.3rem; }
.severity-btn small { font-size: .7rem; font-weight: 600; color: var(--gray-600); }
.severity-btn.active-low    { border-color: var(--blue);   background: var(--blue-light); }
.severity-btn.active-medium { border-color: var(--orange); background: var(--orange-light); }
.severity-btn.active-high   { border-color: var(--red);    background: var(--red-light); }
.severity-btn.active-critical{ border-color: #7f1d1d; background: #fef2f2; animation: pulse 1.5s infinite; }

/* Ticket-Liste */
.ticket-list { display: flex; flex-direction: column; gap: .75rem; }
.ticket-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-left: 4px solid var(--gray-200);
}
.ticket-card:hover { transform: translateX(3px); box-shadow: var(--shadow-lg); }
.ticket-card.sev-low      { border-left-color: var(--blue); }
.ticket-card.sev-medium   { border-left-color: var(--orange); }
.ticket-card.sev-high     { border-left-color: var(--red); }
.ticket-card.sev-critical { border-left-color: #7f1d1d; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-number { font-size: .72rem; font-weight: 700; color: var(--gray-400); font-family: monospace; }
.ticket-title  { font-weight: 700; font-size: .97rem; margin: .2rem 0; }
.ticket-meta   { font-size: .78rem; color: var(--gray-600); display: flex; gap: .75rem; flex-wrap: wrap; }

.status-badge {
  display: inline-flex; align-items: center;
  padding: .25rem .6rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.badge-open        { background: var(--blue-light);   color: var(--blue); }
.badge-in_progress { background: var(--orange-light); color: var(--orange); }
.badge-waiting     { background: var(--yellow-light); color: var(--yellow-dark); }
.badge-resolved    { background: var(--green-light);  color: var(--green); }
.badge-closed      { background: var(--gray-100);     color: var(--gray-600); }

/* ═══════════════════════════════════════════════════════════════════
   KARTE
   ═══════════════════════════════════════════════════════════════════ */
#map-container {
  height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h) - 1rem);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
#map { width: 100%; height: 100%; }

.map-controls {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.map-ctrl-btn {
  width: 44px; height: 44px;
  background: var(--white);
  border: none; border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.map-ctrl-btn:hover { background: var(--navy); color: var(--white); }
.map-ctrl-btn.active { background: var(--navy); color: var(--yellow); }

.map-layer-panel {
  position: absolute;
  top: 1rem; left: 1rem;
  z-index: 400;
  background: var(--white);
  border-radius: var(--radius);
  padding: .75rem;
  box-shadow: var(--shadow-lg);
  max-width: 200px;
}
.map-layer-panel h4 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-600);
  margin-bottom: .6rem;
}
.layer-toggle {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem 0;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
}
.layer-toggle input { cursor: pointer; }
.layer-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN / TABELLEN
   ═══════════════════════════════════════════════════════════════════ */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: var(--navy-dark); }
.data-table th {
  padding: .875rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.7);
}
.data-table td {
  padding: .875rem 1rem;
  font-size: .9rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--navy);
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.search-bar {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}
.search-bar input {
  flex: 1;
  border: none; outline: none;
  font-family: inherit;
  font-size: .95rem;
  color: var(--navy);
  background: transparent;
}

/* ═══════════════════════════════════════════════════════════════════
   PERMISSION MATRIX
   ═══════════════════════════════════════════════════════════════════ */
.perm-matrix { overflow-x: auto; }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td {
  padding: .6rem .75rem;
  border: 1px solid var(--gray-200);
  text-align: center;
  font-size: .82rem;
}
.perm-table th { background: var(--navy-dark); color: var(--white); font-weight: 600; }
.perm-table td:first-child { text-align: left; font-weight: 600; background: var(--gray-50); }
.perm-check {
  width: 20px; height: 20px;
  cursor: pointer;
  accent-color: var(--navy);
}

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed;
  top: var(--topbar-h); right: 0;
  width: min(360px, 100vw);
  max-height: calc(100dvh - var(--topbar-h));
  background: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--gray-200);
  animation: slideLeft .22s ease;
}
@keyframes slideLeft {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 299;
}
.notif-header {
  display: flex; align-items: center; gap: .5rem;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 700;
}
.notif-header button {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .82rem;
  color: var(--blue); padding: .25rem .5rem;
  border-radius: var(--radius-sm);
}
.notif-header button:last-child { color: var(--gray-600); margin-left: auto; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .2s;
  display: flex; gap: .75rem;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--blue-light); }
.notif-item.unread:hover { background: #bfdbfe; }
.notif-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: .1rem; }
.notif-content { flex: 1; }
.notif-title   { font-weight: 700; font-size: .9rem; }
.notif-message { font-size: .82rem; color: var(--gray-600); margin-top: .2rem; }
.notif-time    { font-size: .72rem; color: var(--gray-400); margin-top: .3rem; }

/* ═══════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 1rem);
  left: 50%; transform: translateX(-50%);
  z-index: 500;
  display: flex; flex-direction: column;
  align-items: center; gap: .5rem;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.25rem;
  background: var(--navy-dark);
  color: var(--white);
  border-radius: 30px;
  font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--orange); }

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  display: flex; align-items: flex-end;
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; justify-content: center; }
}
.modal {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 1.5rem;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius);
    width: min(560px, calc(100vw - 2rem));
    max-height: 80dvh;
  }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--gray-100);
}
.modal-title { font-size: 1.15rem; font-weight: 800; }
.modal-close {
  background: var(--gray-100); border: none; border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .9rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); }

/* ═══════════════════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════════════════ */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-line { height: 1rem; margin-bottom: .5rem; }
.skeleton-card { height: 80px; }

/* ── EMPTY STATE ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-600); margin-bottom: .5rem; }
.empty-state p  { font-size: .9rem; }

/* ── DISPATCH / LEITSTELLE ───────────────────────────────────────── */
.dispatch-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--blue);
  margin-bottom: .75rem;
  position: relative;
}
.dispatch-card.prio-urgent { border-left-color: var(--red); background: #fff5f5; animation: pulse 2s infinite; }
.dispatch-card.prio-high   { border-left-color: var(--orange); }
.dispatch-card.prio-normal { border-left-color: var(--blue); }
.dispatch-card.prio-low    { border-left-color: var(--gray-400); }
.dispatch-prio {
  font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .3rem;
}
.dispatch-card.prio-urgent .dispatch-prio { color: var(--red); }
.dispatch-card.prio-high   .dispatch-prio { color: var(--orange); }
.dispatch-title { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.dispatch-msg   { font-size: .9rem; color: var(--gray-600); line-height: 1.5; }
.dispatch-meta  { font-size: .75rem; color: var(--gray-400); margin-top: .6rem; }
.dispatch-ack-btn {
  margin-top: .75rem;
  padding: .6rem 1rem;
  background: var(--green);
  color: white; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: .4rem;
}
.dispatch-ack-btn.acked { background: var(--gray-200); color: var(--gray-600); cursor: default; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .sidebar { transform: translateX(0); }
  .sidebar-close { display: none; }
  .sidebar-overlay { display: none !important; }
  .app-main { margin-left: var(--sidebar-w); }
  .topbar-menu { display: none; }
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .severity-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .severity-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 1rem .75rem; }
}

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }
