* { box-sizing: border-box; margin: 0; padding: 0; }
html { overscroll-behavior-y: auto; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a202c; overscroll-behavior-y: auto; }
dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
body.dashboard-cockpit-body { background: linear-gradient(180deg,#eef1f7 0%,#f6f7fb 420px,#f1f3f8 100%); }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a202c; }
.login-box { background: white; padding: 48px 40px; border-radius: 16px; width: 380px; box-shadow: 0 25px 60px rgba(0,0,0,0.4); text-align: center; }
.login-logo { width: 64px; height: 64px; background: #e53e3e; border-radius: 50%; color: white; font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.login-logo-img { max-width: 200px; height: auto; margin: 0 auto 20px; display: block; mix-blend-mode: multiply; }
.login-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 28px; color: #1a202c; }
.login-box input { width: 100%; padding: 12px 16px; margin-bottom: 14px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 15px; transition: border-color 0.15s; }
.login-box input:focus { outline: none; border-color: #e53e3e; }
.login-box button { width: 100%; padding: 13px; background: #e53e3e; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.login-box button:hover { background: #c53030; }
.error-msg { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }

/* ── Navbar ── */
.navbar { background: #171c2d; padding: 0 18px; display: flex; align-items: center; gap: 18px; height: 62px; box-shadow: 0 10px 28px rgba(15,23,42,.18); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-left { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.nav-logo { background: #e53e3e; color: white; width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.nav-brand { color: white; text-decoration: none; font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.nav-links { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; justify-content: center; min-width: 360px; }
.nav-links a { color: #a9b2c7; text-decoration: none; padding: 10px 13px; border-radius: 10px; font-size: 14px; font-weight: 800; transition: background 0.15s, color 0.15s, box-shadow .15s; white-space: nowrap; }
.nav-links a:hover { background: rgba(255,255,255,.07); color: white; }
.nav-links a.active { background: #2d3654; color: white; box-shadow: inset 0 -2px 0 #6f82ff; }
.nav-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav-user { color: #718096; font-size: 14px; }
.btn-logout { color: #a0aec0; text-decoration: none; font-size: 13px; padding: 6px 12px; border: 1px solid #4a5568; border-radius: 6px; transition: color 0.15s, border-color 0.15s; }
.btn-logout-red { color: #fc8181 !important; border-color: #e53e3e !important; }
.btn-logout-red:hover { color: white !important; background: #e53e3e; border-color: #c53030 !important; }
.btn-logout:hover { color: white; border-color: #718096; }
.nav-dashboard-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.nav-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 3px;
  border-radius: 12px;
  background: linear-gradient(135deg,#253057,#1c2444);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 12px 26px rgba(0,0,0,.18);
}
.nav-date-pill a {
  display: inline-flex;
  align-items: center;
  color: #dbe4ff;
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}
.nav-date-pill a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-date-form { display: inline-flex; align-items: center; margin: 0; }
.nav-date-current {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 142px;
  padding: 0 34px 0 14px;
  border-radius: 9px;
  background: #ffffff;
  color: #071022;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .01em;
  box-shadow: inset 0 -1px 0 rgba(15,23,42,.08);
  cursor: pointer;
}
.nav-date-current:after {
  content: "▦";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #586174;
  font-size: 12px;
  pointer-events: none;
}
.nav-date-current input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.nav-view-toggle {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  height: 38px;
  border-radius: 11px;
  border: 1px solid #5666ae;
  background: #111827;
}
.nav-view-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  color: #c8d2f2;
  text-decoration: none;
  font-size: 12px;
  font-weight: 950;
}
.nav-view-toggle a.active { background: #4353a3; color: #fff; }
.nav-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.18);
  background: #2b335a;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 950;
}
.nav-tool-btn.active { background: #4353a3; border-color: #4353a3; }
.dashboard-cockpit-body .main-content { max-width: 1680px; padding-top: 24px; }

/* ── Main content ── */
.main-content { padding: 32px 36px; max-width: 1400px; margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-header h2 { font-size: 24px; font-weight: 700; }

/* ── Fahrer Mobile Bottom Navigation ── */
body.fahrer-mobile-nav { padding-bottom: 84px; }
.navbar.navbar-driver { min-height: 64px; height: auto; padding-top: 8px; padding-bottom: 8px; gap: 12px; flex-wrap: nowrap; }
.navbar.navbar-driver .nav-left { min-width: 0; flex: 1 1 auto; }
.navbar.navbar-driver .nav-left .nav-brand { display: none !important; }
.navbar.navbar-driver .nav-brand { white-space: normal; line-height: 1.15; }
.driver-header-tank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #c53030;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(197,48,48,.28);
}
.driver-header-tank:hover { background: #9b2c2c; color: #fff; }
.fahrer-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 300;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(203,213,224,.9);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(15,23,42,.22);
  backdrop-filter: blur(14px);
}
.fahrer-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  gap: 2px;
  border-radius: 16px;
  text-decoration: none;
  color: #64748b;
  font-weight: 900;
  transition: background .15s, color .15s, transform .15s;
}
.fahrer-bottom-nav a span { font-size: 18px; line-height: 1; }
.fahrer-bottom-nav a small { font-size: 10px; line-height: 1; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fahrer-bottom-nav a.active { background: #eaf2ff; color: #2b4a8a; }
.fahrer-bottom-nav a.logout { color: #c53030; }
.staff-bottom-nav { display: none; }
@media (min-width: 900px) {
  .fahrer-bottom-nav { left: 50%; right: auto; width: min(520px, calc(100vw - 24px)); transform: translateX(-50%); }
}
@media (max-width: 760px) {
  body.fahrer-mobile-nav .main-content { padding: 22px 12px 20px; }
  body.fahrer-mobile-nav .page-header { margin-bottom: 14px; align-items: center; }
  body.fahrer-mobile-nav .page-header h2 { font-size: 22px; line-height: 1.12; }
  .navbar.navbar-driver { padding-left: 18px; padding-right: 18px; }
  .navbar.navbar-driver .nav-logo-img { max-width: min(190px, 58vw); }
  .navbar.navbar-driver .nav-brand { font-size: 14px; }
  .driver-header-tank { padding: 6px 9px; font-size: 11px; border-radius: 10px; }
  body.staff-mobile-nav {
    padding-bottom: 82px;
  }
  body.staff-mobile-nav .navbar {
    min-height: 56px;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
    align-items: center;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .navbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  body.staff-mobile-nav .nav-left {
    width: auto;
    min-width: 0;
    height: auto;
    flex: 1 1 auto;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-left {
    flex: 0 0 auto;
    overflow: visible;
    min-width: max-content;
  }
  body.staff-mobile-nav .nav-logo-img {
    max-width: 90px !important;
    max-height: 28px !important;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-logo-img {
    max-width: 74px !important;
  }
  body.staff-mobile-nav .nav-links {
    display: none !important;
  }
  body.staff-mobile-nav .nav-right {
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-right {
    display: none;
  }
  body.staff-mobile-nav .nav-user {
    display: none;
  }
  body.staff-mobile-nav .btn-logout {
    padding: 7px 9px;
    font-size: 11px;
    border-radius: 9px;
  }
  body.staff-mobile-nav .nav-dashboard-tools {
    display: none !important;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-dashboard-tools {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-content: flex-start;
    display: flex !important;
    width: 100%;
    overflow-x: auto;
    padding-top: 0;
    -webkit-overflow-scrolling: touch;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-dashboard-tools::-webkit-scrollbar {
    display: none;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-date-pill {
    flex: 0 0 auto;
    max-width: 100%;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-date-pill > a,
  body.dashboard-cockpit-body.staff-mobile-nav .nav-tool-btn {
    display: none;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-date-current {
    min-width: 118px;
    padding-left: 10px;
    padding-right: 28px;
    font-size: 11px;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-view-toggle a.active {
    display: none;
  }
  body.dashboard-cockpit-body.staff-mobile-nav .nav-view-toggle a {
    min-width: 44px;
    padding: 0 12px;
  }
  .staff-bottom-nav::-webkit-scrollbar {
    display: none;
  }
  body.staff-mobile-nav .main-content {
    padding-bottom: 92px !important;
  }
  .staff-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 320;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 7px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(203,213,224,.9);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15,23,42,.22);
    backdrop-filter: blur(14px);
    -webkit-overflow-scrolling: touch;
  }
  .staff-bottom-nav a {
    flex: 1 0 58px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 15px;
    color: #64748b;
    text-decoration: none;
    font-weight: 900;
  }
  .staff-bottom-nav a span {
    font-size: 17px;
    line-height: 1;
  }
  .staff-bottom-nav a small {
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1;
  }
  .staff-bottom-nav a.active {
    background: #eaf2ff;
    color: #2b4a8a;
  }
}

/* ── Dashboard cards ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { background: white; border-radius: 14px; padding: 28px 24px; text-decoration: none; color: inherit; box-shadow: 0 1px 4px rgba(0,0,0,0.08); transition: transform 0.15s, box-shadow 0.15s; border: 1px solid #e8ecf0; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.card-icon { font-size: 36px; margin-bottom: 14px; }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.card-sub { font-size: 13px; color: #718096; }

/* ── Admin ── */
.admin-form { background: white; padding: 28px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); max-width: 700px; margin-bottom: 28px; border: 1px solid #e8ecf0; }
.admin-form h3 { font-size: 17px; font-weight: 700; margin-bottom: 20px; color: #2d3748; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.admin-form input, .admin-form select { width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; transition: border-color 0.15s; }
.admin-form input:focus, .admin-form select:focus { outline: none; border-color: #e53e3e; }
.btn-primary { background: #e53e3e; color: white; padding: 10px 22px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-block; transition: background 0.15s; }
.btn-primary:hover { background: #c53030; }
.btn-small { padding: 5px 12px; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.btn-danger { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.btn-danger:hover { background: #fed7d7; }
.btn-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.btn-success:hover { background: #c6f6d5; }

.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; }
.admin-table th { background: #2d3748; color: white; padding: 13px 18px; text-align: left; font-size: 13px; font-weight: 600; }
.admin-table td { padding: 12px 18px; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbfc; }
.row-inaktiv td { opacity: 0.5; }

.rolle-badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.rolle-master { background: #fff5f5; color: #c53030; }
.rolle-buero { background: #ebf8ff; color: #2b6cb0; }
.rolle-dispatcher { background: #f0fff4; color: #276749; }
.rolle-fahrer { background: #faf5ff; color: #6b46c1; }
.rolle-onboarding { background: #fffaf0; color: #b7791f; }

/* ── Station Tabs ── */
.station-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.station-tab { padding: 8px 20px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; color: #4a5568; background: white; border: 1.5px solid #e2e8f0; transition: all 0.15s; }
.station-tab:hover { border-color: #e53e3e; color: #e53e3e; }
.station-tab.active { background: #e53e3e; color: white; border-color: #e53e3e; }

/* ── Ansicht Toggle ── */
.ansicht-toggle { display: flex; gap: 4px; background: #e8ecf0; padding: 4px; border-radius: 8px; }
.toggle-btn { padding: 6px 16px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 600; color: #4a5568; transition: all 0.15s; }
.toggle-btn.active { background: white; color: #1a202c; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ── Filter Bar ── */
.filter-bar { background: white; padding: 14px 20px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #e8ecf0; }

/* ── KPI Karten ── */
.kpi-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.kpi-card { background: white; border-radius: 12px; padding: 18px 24px; flex: 1; min-width: 140px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; border-left: 4px solid #cbd5e0; }
.kpi-card.kpi-rot { border-left-color: #e53e3e; }
.kpi-card.kpi-gruen { border-left-color: #38a169; }
.kpi-card.kpi-orange { border-left-color: #dd6b20; }
.kpi-val { font-size: 32px; font-weight: 800; color: #1a202c; line-height: 1; margin-bottom: 6px; }
.kpi-label { font-size: 13px; color: #718096; font-weight: 500; }

/* ── Data Table ── */
.table-wrap { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #2d3748; color: white; padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; }
.data-table th.tc { text-align: center; }
.data-table td { padding: 10px 16px; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.data-table td.tc { text-align: center; }
.data-table td.fw { font-weight: 700; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.row-ok:hover td { background: #f0fff4; }
.data-table tr.row-fehler:hover td { background: #fff5f5; }
.data-table tr.row-fehler td { background: #fffafa; }

.fahrer-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.dot-rot { width: 8px; height: 8px; border-radius: 50%; background: #e53e3e; flex-shrink: 0; }
.dot-gruen { width: 8px; height: 8px; border-radius: 50%; background: #38a169; flex-shrink: 0; }

.proz-badge { padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.proz-gut { background: #f0fff4; color: #276749; }
.proz-mittel { background: #fffbeb; color: #92400e; }
.proz-schlecht { background: #fff5f5; color: #c53030; }

.table-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.sortierbar { cursor: pointer; user-select: none; }
.sortierbar:hover { background: #3d4f63; }
.sort-icon { opacity: 0.5; font-size: 11px; }

/* ── IADC spezifisch ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sh-left { display: flex; align-items: center; gap: 16px; }
.sh-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.sh-sub { font-size: 13px; font-weight: 500; color: #718096; background: #e8ecf0; padding: 3px 10px; border-radius: 20px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.datum-select { padding: 8px 14px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; background: white; }

.kpi-leiste { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; background: #1a202c; border-radius: 12px; padding: 18px 24px; }
.kpi-item { flex: 1; min-width: 100px; text-align: center; padding: 0 12px; border-right: 1px solid #2d3748; }
.kpi-item:last-child { border-right: none; }
.kpi-big { font-size: 28px; font-weight: 800; color: white; line-height: 1; }
.kpi-lbl { font-size: 11px; color: #718096; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-warn .kpi-big { color: #f6ad55; }
.kpi-danger .kpi-big { color: #fc8181; }

.iadc-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.iadc-table-col { min-width: 0; }
.iadc-analyse-col { display: flex; flex-direction: column; gap: 16px; }

.suche-input { padding: 8px 14px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; width: 200px; }
.filter-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4a5568; cursor: pointer; }
.anzahl-info { font-size: 12px; color: #a0aec0; margin-left: auto; }

.rank-cell { width: 40px; }
.rank-badge { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: white; }
.rank-1 { background: #c53030; }
.rank-2 { background: #c05621; }
.rank-3 { background: #b7791f; }
.rank-n { background: #4a5568; }
.rank-ok { color: #38a169; font-size: 14px; font-weight: 700; }

.row-kritisch td { background: #fff5f5; }
.row-kritisch:hover td { background: #fed7d7; }
.kein-bonus-tag { background: #c53030; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 8px; font-weight: 600; }

.fp-wert { font-weight: 700; font-size: 13px; }
.fp-rot { color: #c53030; }
.fp-gelb { color: #b7791f; }
.fp-gruen { color: #276749; }
.zahl-rot { color: #c53030; font-weight: 700; }
.zahl-orange { color: #c05621; font-weight: 700; }

.analyse-card { background: white; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; }
.analyse-titel { font-size: 14px; font-weight: 700; color: #2d3748; margin-bottom: 14px; }
.analyse-gesamt { font-size: 12px; color: #718096; margin-bottom: 10px; }
.analyse-zeile { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.analyse-grund { font-size: 12px; color: #4a5568; width: 110px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analyse-bar-wrap { flex: 1; background: #e8ecf0; border-radius: 4px; height: 8px; }
.analyse-bar { background: #e53e3e; border-radius: 4px; height: 8px; min-width: 4px; }
.analyse-anzahl { font-size: 12px; font-weight: 700; color: #2d3748; width: 30px; text-align: right; }

.top-zeile { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.top-badge { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
.top-1 { background: #c53030; }
.top-2 { background: #c05621; }
.top-3 { background: #b7791f; }
.top-4, .top-5 { background: #4a5568; }
.top-name { font-size: 13px; color: #2d3748; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-val { font-size: 14px; font-weight: 700; color: #c53030; }

@media (max-width: 900px) {
  .iadc-layout { grid-template-columns: 1fr; }
}

@keyframes flashHighlight {
  0% { background: #fef3c7; }
  70% { background: #fef3c7; }
  100% { background: inherit; }
}
.highlight-flash td { animation: flashHighlight 2s ease forwards; }

/* ── POD / CC Tabellenkopf ── */
.pod-th { white-space: normal; line-height: 1.3; min-width: 80px; vertical-align: bottom; padding-bottom: 10px; }

/* ── Flag Tags (Scorecard) ── */
.flag-tag { padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; margin-right: 3px; }
.flag-sc { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.flag-con { background: #fffbeb; color: #92400e; border: 1px solid #fef3c7; }
.flag-dsc { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }

/* ── Info Card (IADC Regeln, PHR Regeln) ── */
.info-card { background: white; border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; overflow: hidden; }
.info-header { background: linear-gradient(135deg, #2b4a8a, #3d6bb5); padding: 20px 24px; }
.info-header-title { font-size: 18px; font-weight: 700; color: white; margin-bottom: 4px; }
.info-header-sub { font-size: 13px; color: rgba(255,255,255,0.8); }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th { background: #3d6bb5; color: white; padding: 10px 18px; text-align: left; font-size: 13px; font-weight: 600; }
.info-table td { padding: 12px 18px; border-bottom: 1px solid #f0f2f5; font-size: 13px; color: #2d3748; vertical-align: top; }
.info-table td:first-child { width: 240px; }
.info-table tr:last-child td { border-bottom: none; }
.info-note { background: #ebf8ff; border-left: 4px solid #3182ce; padding: 14px 18px; font-size: 13px; color: #2c5282; margin: 4px 0; }
.info-konsequenz-header { background: #2d3748; color: white; padding: 10px 18px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.info-konsequenz-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #f0f2f5; font-size: 13px; color: #2d3748; }
.info-konsequenz-item.info-rot { border-left: 4px solid #e53e3e; }
.info-konsequenz-item.info-orange { border-left: 4px solid #dd6b20; }
.info-konsequenz-item.info-gelb { border-left: 4px solid #d69e2e; }
.info-tag { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0; color: white; }
.tag-rot { background: #e53e3e; }
.tag-orange { background: #dd6b20; }
.tag-dunkel { background: #744210; }
.info-footer { padding: 16px 18px; font-size: 13px; color: #4a5568; border-top: 1px solid #e8ecf0; margin: 0; line-height: 1.6; }

/* ── PHR Regel-Karte ── */
.info-rule-text { font-size: 13px; color: #2d3748; line-height: 1.6; }
.info-rule-list { margin: 8px 0 12px 18px; }
.info-rule-list li { margin-bottom: 4px; font-size: 13px; }
.info-rule-steps { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.info-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #2d3748; }
.info-step-nr { background: #3d6bb5; color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.info-rule-threshold { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.threshold-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.threshold-ziel { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.threshold-warn { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }

/* ── DSC / Concession ── */
.dsc-header-card { background: linear-gradient(135deg, #1a2744, #2b4a8a); border-radius: 12px; padding: 18px 24px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dsc-hc-left { display: flex; align-items: center; gap: 14px; }
.dsc-station-badge { background: white; color: #1a2744; font-size: 18px; font-weight: 800; padding: 6px 16px; border-radius: 8px; letter-spacing: 1px; }
.dsc-kw-text { color: rgba(255,255,255,0.9); font-size: 16px; font-weight: 600; }
.dsc-hc-sub { color: rgba(255,255,255,0.75); font-size: 14px; }

.dsc-filter-bar { display: flex; align-items: center; gap: 16px; background: white; border-radius: 10px; padding: 12px 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #e8ecf0; flex-wrap: wrap; }
.dsc-chip-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dsc-chip-label { font-size: 10px; font-weight: 700; color: #a0aec0; letter-spacing: 1px; text-transform: uppercase; margin-right: 4px; white-space: nowrap; }
.dsc-chip { padding: 5px 12px; border-radius: 20px; border: 1.5px solid #e2e8f0; background: white; color: #4a5568; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.dsc-chip:hover { border-color: #2b4a8a; color: #2b4a8a; }
.dsc-chip.active { background: #2b4a8a; border-color: #2b4a8a; color: white; }

.dsc-layout { display: grid; grid-template-columns: 1fr 440px; gap: 20px; align-items: start; }
.dsc-table-col { min-width: 0; }
.dsc-analyse-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }

.dsc-row td { font-size: 13px; padding: 8px 14px; }
.dsc-ok td { background: white; }
.dsc-ok:hover td { background: #f0fff4; }
.dsc-fehler td { background: #fff8f8; }
.dsc-fehler:hover td { background: #fff0f0; }
.dsc-schwer td { background: #fff8f0; }
.dsc-schwer:hover td { background: #ffedd5; }

.dsc-dat-main { font-size: 13px; font-weight: 600; color: #2d3748; }
.dsc-dat-sub { font-size: 11px; color: #a0aec0; margin-top: 2px; }

.dsc-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.dsc-ic-ok { background: #c6f6d5; color: #276749; }
.dsc-ic-fehler { background: #e53e3e; color: #fff; }
.dsc-ic-schwer { background: #ed8936; color: #fff; }

.dsc-nm-fehler { color: #e53e3e; font-weight: 700; }
.dsc-td-fehler { color: #e53e3e; font-weight: 700; }
.dsc-td-schwer { color: #c05621; font-weight: 700; }

.dsc-scan-ok { color: #38a169; font-weight: 700; font-size: 15px; }
.dsc-scan-bad { color: #e53e3e; font-weight: 700; font-size: 15px; }
.dsc-adresse { font-size: 12px; color: #4a5568; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dsc-panel { border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.dsc-panel-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.dsc-panel-schwer { background: #c53030; }
.dsc-panel-schwer .dsc-panel-title { color: white; }
.dsc-panel-scan { background: #dd6b20; }
.dsc-panel-scan .dsc-panel-title { color: white; }

.dsc-panel-item { background: rgba(255,255,255,0.15); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.dsc-panel-item:last-child { margin-bottom: 0; }
.dsc-pi-name { font-size: 13px; font-weight: 700; color: white; margin-bottom: 3px; }
.dsc-pi-detail { font-size: 11px; color: rgba(255,255,255,0.85); }

@media (max-width: 900px) {
  .dsc-layout { grid-template-columns: 1fr; }
}

/* ── POD Training ── */
.training-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.training-card { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 20px 16px; text-align: center; text-decoration: none; color: inherit; transition: all 0.15s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.training-card:hover { border-color: #2b4a8a; background: #eef3fb; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(43,74,138,0.12); }
.training-flag { font-size: 32px; }
.training-name { font-size: 14px; font-weight: 700; color: #2d3748; }
.training-btn { font-size: 12px; color: #2b4a8a; font-weight: 600; margin-top: 4px; }

/* ── Placeholder pages ── */
.placeholder { text-align: center; padding: 80px 40px; color: #a0aec0; }
.placeholder h3 { font-size: 20px; margin-bottom: 12px; color: #4a5568; }
.placeholder p { font-size: 15px; }

/* ── Upload ── */
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.upload-card { background: white; border-radius: 12px; border: 1.5px solid #e2e8f0; padding: 24px 28px; }
.upload-card-title { font-size: 16px; font-weight: 700; color: #2d3748; margin-bottom: 8px; }
.upload-card-desc { font-size: 13px; color: #718096; margin-bottom: 16px; line-height: 1.6; }
.upload-card-desc code { background: #f0f2f5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.upload-form { display: flex; flex-direction: column; gap: 10px; }
.upload-input { padding: 8px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; }
.upload-btn { padding: 10px 20px; background: #2b4a8a; color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; align-self: flex-start; }
.upload-btn:hover { background: #1e3570; }
.upload-success { background: #f0fff4; border: 1.5px solid #68d391; border-radius: 10px; padding: 14px 18px; color: #276749; font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.upload-error { background: #fff5f5; border: 1.5px solid #fc8181; border-radius: 10px; padding: 14px 18px; color: #c53030; font-size: 14px; margin-bottom: 20px; }
/* ── Planung ── */
.planung-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.planung-card { background: white; border-radius: 12px; border: 1.5px solid #e2e8f0; padding: 16px 20px; }
.planung-card-mentee { border-color: #f6ad55; }
.planung-card-title { font-size: 15px; font-weight: 700; color: #2d3748; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.planung-badge { background: #2b4a8a; color: white; border-radius: 20px; padding: 2px 10px; font-size: 13px; }
.planung-card-mentee .planung-badge { background: #ed8936; }
.planung-name { font-size: 13px; color: #4a5568; padding: 4px 0; border-bottom: 1px solid #f0f2f5; }
.planung-name:last-child { border-bottom: none; }
@media (max-width: 900px) { .planung-grid { grid-template-columns: 1fr; } }
/* ── Nav Dropdown ── */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: #1a202c; border-radius: 8px; min-width: 160px; z-index: 999; padding: 4px 0; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 8px 16px; color: #a0aec0; font-size: 13px; white-space: nowrap; }
.nav-dropdown-menu a:hover { color: white; background: #2d3748; }

/* Logo in Topbar kleiner und sauber */
.topbar-logo,
.nav-logo,
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: #fff;
  min-width: 170px;
  max-width: 190px;
  height: 58px;
  overflow: hidden;
}

.topbar-logo img,
.nav-logo img,
.brand-logo img {
  max-height: 42px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* Navbar Logo korrekt begrenzen */
.nav-logo-img {
  height: 30px !important;
  max-height: 30px !important;
  width: auto !important;
  max-width: 110px !important;
  object-fit: contain !important;
  display: block !important;
}

.nav-left {
  height: 58px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Responsive / Mobile ── */
@media (max-width: 768px) {
  .navbar { flex-wrap: wrap; padding: 0 12px; gap: 4px; }
  .nav-logo-img { max-width: 60px; height: auto; }
  .nav-brand { font-size: 13px; }
  .nav-links { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; order: 3; width: 100%; padding: 6px 0; }
  .nav-links a { padding: 4px 8px; }
  .nav-right { font-size: 12px; }
  .main-content { padding: 12px; }
  .card-grid { grid-template-columns: 1fr !important; }
  .kpi-leiste { grid-template-columns: repeat(2, 1fr) !important; flex-wrap: wrap; }
  .kpi-item { min-width: 0; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 500px; }
  .iadc-layout, .dsc-layout { grid-template-columns: 1fr !important; }
  .iadc-table-col, .dsc-table-col, .iadc-analyse-col, .dsc-analyse-col { min-width: 0; }
  .planung-grid { grid-template-columns: 1fr !important; }
  .upload-grid { grid-template-columns: 1fr !important; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .station-tabs { flex-wrap: wrap; }
  .datum-select { max-width: 140px; }
  .section-header { flex-direction: column; gap: 8px; }
  .analyse-card { min-width: 0; }
  .fleet-form-grid { grid-template-columns: 1fr !important; }
  .btn-logout { font-size: 11px; padding: 4px 8px; }
  .top-zeile { font-size: 12px; }
  div[style*="grid-template-columns: 1fr 300px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: 1fr 280px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2,1fr) !important; }
}

/* ── Mobile responsive update ── */
@media (max-width: 768px) {
  .main-content { padding: 10px !important; }
  .navbar { min-height: 48px; gap: 6px; padding: 0 10px; }
  .nav-logo-img { max-height: 26px; max-width: 55px; }
  .nav-brand { font-size: 12px !important; }
  .nav-links { gap: 2px; font-size: 11px; }
  .nav-links a { padding: 3px 6px !important; }
  .page-header { flex-direction: column; gap: 8px; }
  .card-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .upload-grid { grid-template-columns: 1fr !important; }
  .kpi-leiste { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }
  .kpi-big { font-size: 22px !important; }
  .table-wrap { overflow-x: auto !important; }
  .data-table { min-width: 420px; font-size: 12px; }
  .section-header { flex-direction: column; gap: 6px; }
  .toolbar { flex-wrap: wrap; gap: 6px; }
  .station-tabs { flex-wrap: wrap; gap: 4px; }
  .station-tab { padding: 5px 10px !important; font-size: 12px; }
  .analyse-card { min-width: 0; }
  .iadc-layout, .dsc-layout { grid-template-columns: 1fr !important; }
  .planung-grid { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: 1fr 300px"],
  div[style*="grid-template-columns: 1fr 280px"],
  div[style*="grid-template-columns: 1fr 440px"] { grid-template-columns: 1fr !important; }
  div[style*="repeat(4,1fr)"],
  div[style*="repeat(4, 1fr)"] { grid-template-columns: repeat(2,1fr) !important; }
  .btn-logout { padding: 4px 8px !important; font-size: 11px; }
}

/* Login Logo größer anzeigen */
.login-logo {
  max-width: 360px !important;
  max-height: 150px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto 18px auto !important;
}

@media (max-width: 768px) {
  .login-logo {
    max-width: 260px !important;
    max-height: 110px !important;
  }
}

/* Login Logo sichtbar größer */
.login-box {
  width: 460px !important;
  max-width: calc(100vw - 32px) !important;
}

.login-logo {
  display: block !important;
  width: 360px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  margin: 0 auto 16px auto !important;
}

@media (max-width: 768px) {
  .login-box {
    width: 92vw !important;
  }

  .login-logo {
    width: 280px !important;
    max-width: 100% !important;
  }
}

/* Login etwas kompakter, Logo bleibt sichtbar */
.login-box {
  width: 400px !important;
  max-width: calc(100vw - 32px) !important;
}

.login-logo {
  width: 320px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 120px !important;
  object-fit: contain !important;
  margin: 0 auto 14px auto !important;
}

.login-box input,
.login-box button {
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .login-box {
    width: 92vw !important;
  }

  .login-logo {
    width: 260px !important;
    max-height: 100px !important;
  }
}

/* Final Login Logo */
.login-logo {
  width: 300px !important;
  max-width: 100% !important;
  max-height: 110px !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto 16px auto !important;
}

@media (max-width: 768px) {
  .login-logo {
    width: 240px !important;
    max-height: 90px !important;
  }
}
/* Login-Logo ohne roten Rand */
.login-logo,
.login-box img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
/* Wegner/Satteo Login Logo minimal kleiner */
.login-logo {
  width: 285px !important;
}

/* Brand logos are real images, not badge circles. */
.login-box img.login-logo {
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: inherit !important;
}

/* IADC Fahrer Detail – Erklärungskarte */
.iadc-driver-info {
  margin-top: 24px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.iadc-driver-info-head {
  background: linear-gradient(135deg, #344b9a, #5369b8);
  color: white;
  padding: 18px 22px;
}

.iadc-driver-info-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.iadc-driver-info-sub {
  font-size: 12px;
  opacity: 0.92;
  margin-top: 4px;
}

.iadc-driver-info-body {
  padding: 20px 22px 22px;
  font-size: 13px;
  color: #4a5568;
  line-height: 1.6;
}

.iadc-driver-info-body p {
  margin: 0 0 12px 0;
}

.iadc-rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.iadc-rule-chips span {
  background: #eef3ff;
  color: #2b4a8a;
  border: 1px solid #c9d7f5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.iadc-important {
  background: #fffaf0;
  border-left: 4px solid #ed8936;
  color: #7b341e;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}

.iadc-success-note {
  background: #f0fff4;
  border-left: 4px solid #38a169;
  color: #276749;
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.iadc-table-explain {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 13px 15px;
  color: #4a5568;
}

.iadc-table-explain-title {
  color: #2d3748;
  font-weight: 800;
  margin-bottom: 6px;
}

@media (max-width: 768px) {
  .iadc-driver-info-head,
  .iadc-driver-info-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .iadc-rule-chips span {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* Mobile app polish */
@media (max-width: 640px) {
  body { background: #f4f6f9; }
  .navbar {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .nav-left { width: 100%; min-width: 0; }
  .nav-brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-links {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px !important;
    padding: 4px 0 2px !important;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 10px !important;
    border-radius: 8px;
  }
  .nav-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px !important;
  }
  .main-content { padding: 14px 10px 24px !important; }
  .page-header,
  .section-header {
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .page-header h2,
  .sh-title {
    font-size: 21px !important;
    line-height: 1.2;
    flex-wrap: wrap;
  }
  .toolbar {
    align-items: stretch !important;
    gap: 10px !important;
  }
  .station-tabs {
    width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px !important;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .station-tab {
    flex: 0 0 auto;
    padding: 9px 16px !important;
    min-width: 64px;
    text-align: center;
  }
  .datum-select,
  input[type="date"],
  input[type="month"],
  select,
  input,
  textarea {
    min-height: 40px;
    max-width: 100%;
  }
  .kpi-leiste {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 10px !important;
  }
  .kpi-leiste a { min-width: 0; }
  .kpi-item {
    border-right: 0 !important;
    border-radius: 8px;
    padding: 8px 6px !important;
    min-height: 58px;
  }
  .kpi-big { font-size: 24px !important; }
  .kpi-lbl { font-size: 10px !important; letter-spacing: 0; }
  .card {
    border-radius: 10px !important;
    padding: 20px 18px !important;
  }
  .table-controls {
    align-items: stretch !important;
    gap: 8px !important;
  }
  .suche-input {
    width: 100% !important;
    min-height: 40px;
  }
  .table-wrap {
    border-radius: 10px !important;
    overflow-x: auto !important;
  }
  .data-table th,
  .data-table td {
    padding: 9px 10px !important;
    font-size: 12px !important;
  }
  details form,
  form[style*="display:flex"] {
    flex-wrap: wrap !important;
  }
  button,
  .upload-btn,
  .btn-primary,
  .btn-secondary {
    min-height: 40px;
  }
  div[style*="minmax(280px"],
  div[style*="minmax(420px"],
  div[style*="grid-template-columns:minmax"] {
    grid-template-columns: 1fr !important;
  }
}


/* ═══════════════════════════════════════════════════════════
   Kennzeichenliste — Mobile Card View + UI Polish
   ═══════════════════════════════════════════════════════════ */

/* ── Desktop: nicer table rows ─────────────────────────────── */
#kz-table.kz-fixed-table td {
  padding: 11px 14px !important;
  vertical-align: middle;
}
#kz-table.kz-fixed-table th {
  padding: 11px 14px !important;
  letter-spacing: .3px;
}
#kz-table.kz-fixed-table tbody tr:hover td {
  background: #f7fafd !important;
}

/* ── Dropdown keeps z-index above table ─────────────────────── */
.kzact { vertical-align: middle; }
.kzact-menu { z-index: 600 !important; }

/* ══ MOBILE: full card layout (no-date variant) ══════════════ */
@media (max-width: 820px) {

  /* Remove table scroll container chrome */
  .table-wrap {
    overflow-x: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  /* table → block, transparent */
  #kz-table.kz-fixed-table:not(.show-date) {
    min-width: 0 !important;
    display: block !important;
    background: transparent;
    border-collapse: separate;
  }
  #kz-table.kz-fixed-table:not(.show-date) colgroup { display: none; }
  #kz-table.kz-fixed-table:not(.show-date) thead  { display: none; }

  /* tbody → vertical list */
  #kz-table.kz-fixed-table:not(.show-date) tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* each row → white card */
  #kz-table.kz-fixed-table:not(.show-date) tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    background: white !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    box-shadow: 0 1px 5px rgba(0,0,0,.09) !important;
    border: 1px solid #e8ecf0 !important;
    position: relative;
  }
  #kz-table.kz-fixed-table:not(.show-date) tr.kzact-open {
    z-index: 300 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.18) !important;
  }

  /* reset all td defaults */
  #kz-table.kz-fixed-table:not(.show-date) td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: 13px !important;
  }

  /* 1 — Status badge: top-left */
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(1) {
    order: 1;
    flex: 0 0 auto;
    margin-right: 8px;
    margin-bottom: 8px;
  }

  /* 3 — KZ/VIN: top-right (push with margin-left:auto) */
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(3) {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
    margin-bottom: 8px;
    text-align: right;
    font-size: 12px !important;
  }

  /* 2 — Fahrer: full-width second row, larger */
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(2) {
    order: 3;
    flex: 1 1 100%;
    font-size: 15px !important;
    font-weight: 700;
    padding-bottom: 6px !important;
    line-height: 1.3;
  }

  /* 4,5,6 — App-Zeiten & Dauer: hidden on mobile */
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(4),
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(5),
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(6) {
    display: none !important;
  }

  /* 7 — Zustand (werkstatt/VIN): subtle row below fahrer */
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(7) {
    order: 4;
    flex: 1 1 100%;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    border-top: 1px solid #f0f0f0 !important;
    margin-top: 2px;
    font-size: 12px !important;
  }

  /* 8 — Aktionen-Dropdown: full width at bottom, button rechts */
  #kz-table.kz-fixed-table:not(.show-date) td:nth-child(8) {
    order: 5;
    flex: 1 1 100%;
    padding-top: 8px !important;
    border-top: 1px solid #f0f0f0 !important;
    margin-top: 2px;
    display: flex !important;
    justify-content: flex-end !important;
  }

  /* Dropdown opens upward on mobile if near bottom, keep width */
  .kzact-menu {
    min-width: 240px !important;
    right: 0 !important;
    left: auto !important;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* Nav-stat numbers: 2-per-row grid on mobile */
  .kpi-leiste {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Search bar full width + taller tap target */
  .suche-input {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
  }

  /* Table-controls stack vertically */
  .table-controls {
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Station tabs: horizontal scroll, comfortable size */
  .station-tabs {
    gap: 6px !important;
    padding: 0 0 4px !important;
  }
  .station-tab {
    padding: 10px 16px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    min-width: 60px;
  }

  /* Aktionen button taller for touch */
  .kzact button {
    min-height: 38px !important;
    padding: 7px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Status nav (Tour/Frei/etc.) pill wraps cleanly */
  div[style*="display:flex"][style*="align-items:center"][style*="gap:0"] {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

}

/* Mobile Sort-Bar */
#mobile-sort-bar { display:none; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
#mobile-sort-bar span { font-size:12px; color:#718096; font-weight:700; white-space:nowrap; }
#mobile-sort-bar button {
  background:#f7fafc; border:1.5px solid #cbd5e0; border-radius:20px;
  padding:4px 12px; font-size:12px; font-weight:700; color:#4a5568;
  cursor:pointer; white-space:nowrap;
}

/* ── Dashboard: offene Scorecard-Aufgaben ── */
.dashboard-scorecard-tasks {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1.5px solid #fc8181;
  border-radius: 12px;
  background: #fff5f5;
}
.dashboard-scorecard-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #9b2c2c;
}
.dashboard-scorecard-title > span { font-size: 20px; line-height: 1; }
.dashboard-scorecard-title strong { display: block; font-size: 14px; }
.dashboard-scorecard-title small {
  display: block;
  margin-top: 2px;
  color: #742a2a;
  font-size: 11px;
  font-weight: 600;
}
.dashboard-scorecard-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.dashboard-scorecard-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 320px;
  flex: 1;
  padding: 9px 12px;
  color: #742a2a;
  text-decoration: none;
  background: white;
  border: 1px solid #feb2b2;
  border-radius: 9px;
}
.dashboard-scorecard-kw { font-weight: 900; white-space: nowrap; }
.dashboard-scorecard-missing { font-size: 12px; }
.dashboard-scorecard-action {
  color: #2b4a8a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* ── Zeiterfassung: strukturierte Desktop-/Mobile-Ansicht ── */
.ze-toolbar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.ze-toolbar-card {
  min-width: 300px;
  padding: 16px 20px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
}
.ze-upload-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ze-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}
.ze-station-filter,
.ze-warning-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ze-warning-filters { margin-bottom: 10px; }
.ze-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 160px));
  gap: 10px;
  margin-bottom: 14px;
}
.ze-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 8px 14px;
  color: inherit;
  text-decoration: none;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
}
.ze-summary-danger {
  background: #fff5f5;
  border-color: #fc8181;
}
.ze-desktop-table {
  overflow: hidden;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
}
.ze-mobile-list { display: none; }
.ze-month-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.ze-month-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .dashboard-scorecard-tasks { padding: 12px; }
  .dashboard-scorecard-list { flex-direction: column; }
  .dashboard-scorecard-task {
    grid-template-columns: 1fr auto;
    min-width: 0;
    width: 100%;
  }
  .dashboard-scorecard-missing {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .ze-page .page-header { margin-bottom: 16px; }
  .ze-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .ze-toolbar-card {
    min-width: 0;
    width: 100%;
    padding: 14px;
  }
  .ze-upload-fields {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .ze-upload-fields select,
  .ze-upload-fields input,
  .ze-upload-fields button { width: 100%; }
  .ze-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f4f6f9;
  }
  .ze-tabs a {
    flex: 1;
    padding-left: 8px !important;
    padding-right: 8px !important;
    text-align: center;
  }
  .ze-station-filter,
  .ze-warning-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .ze-station-filter > *,
  .ze-warning-filters > * { flex: 0 0 auto; }
  .ze-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .ze-summary-card { min-height: 66px; }
  .ze-desktop-table { display: none; }
  .ze-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .ze-mobile-card {
    overflow: hidden;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .ze-mobile-card.has-warning { border-color: #feb2b2; }
  .ze-mobile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
  }
  .ze-mobile-card-head a,
  .ze-mobile-card-head strong {
    display: block;
    color: #1e40af;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
  }
  .ze-mobile-card-head small {
    display: block;
    margin-top: 3px;
    color: #718096;
    font-size: 10px;
  }
  .ze-mobile-status {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
  }
  .ze-mobile-status.ok { background: #c6f6d5; color: #276749; }
  .ze-mobile-status.warning { background: #fef3c7; color: #92400e; }
  .ze-mobile-status.missing { background: #fed7d7; color: #c53030; }
  .ze-mobile-status.absent { background: #e9d8fd; color: #553c9a; }
  .ze-mobile-block {
    padding: 10px 14px 12px;
    border-top: 1px solid #edf2f7;
  }
  .ze-mobile-block.ts { background: #f8fdff; }
  .ze-mobile-block.app { background: #f6fffa; }
  .ze-mobile-block > strong {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .ze-mobile-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    color: #2d3748;
    font-size: 13px;
    font-weight: 800;
  }
  .ze-mobile-values small {
    display: block;
    margin-bottom: 2px;
    color: #718096;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .ze-mobile-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 9px 14px;
    background: #fff5f5;
    border-top: 1px solid #fed7d7;
  }
  .ze-mobile-alerts span {
    padding: 3px 7px;
    color: #c53030;
    background: white;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
  }
  .ze-mobile-foot {
    padding: 8px 14px;
    color: #4a5568;
    background: #f7fafc;
    border-top: 1px solid #edf2f7;
    font-size: 11px;
    font-weight: 700;
  }
  .ze-mobile-foot.warning { color: #c05621; background: #fffbeb; }
  .ze-month-table table { min-width: 650px; }
}

@media (max-width: 420px) {
  .ze-mobile-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 10px;
  }
}
#mobile-sort-bar button[data-dir] {
  background:#2d3748; border-color:#2d3748; color:#fff;
}
@media (max-width:820px) {
  #mobile-sort-bar { display:flex; }
}

/* ── Dashboard responsive grids ── */
.dash-grid-34 { display:grid; grid-template-columns:3fr 1fr; gap:14px; margin-bottom:14px; }
.dash-grid-half { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
@media (max-width:640px) {
  .dash-grid-34, .dash-grid-half { grid-template-columns:1fr; }
}
.fahrerzeit-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.fahrerzeit-title{font-size:22px;font-weight:900;color:#111827}.fahrerzeit-person{display:flex;gap:8px;align-items:center;margin-top:4px;color:#64748b;font-size:13px}.fahrerzeit-person strong,.fahrerzeit-person span{background:#f1f5f9;border-radius:999px;padding:4px 10px}.fahrerzeit-nav{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.fahrerzeit-nav form{margin:0}.fahrerzeit-nav input[type=month]{padding:8px 10px;border:1px solid #d9e1ec;border-radius:8px;font-size:13px}.fahrerzeit-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}.fahrerzeit-kpi{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:15px 18px;box-shadow:0 1px 2px rgba(15,23,42,.03)}.fahrerzeit-kpi strong{display:block;font-size:26px;line-height:1.1;color:#1e293b}.fahrerzeit-kpi span{display:block;margin-top:5px;font-size:10px;font-weight:800;text-transform:uppercase;color:#64748b}.fahrerzeit-kpi.worked{border-color:#bbf7d0}.fahrerzeit-kpi.worked strong{color:#15803d}.fahrerzeit-kpi.time{border-color:#bfdbfe}.fahrerzeit-kpi.time strong{color:#1d4ed8}.fahrerzeit-kpi.warning{border-color:#fecaca}.fahrerzeit-kpi.warning strong{color:#dc2626}.fahrerzeit-desktop{overflow-x:auto;background:#fff;border:1px solid #e2e8f0;border-radius:12px}.fahrerzeit-desktop table{width:100%;border-collapse:collapse;font-size:12px}.fahrerzeit-desktop th{padding:10px 12px;text-align:left;background:#30384d;color:#fff;white-space:nowrap}.fahrerzeit-desktop td{padding:10px 12px;border-bottom:1px solid #edf2f7;color:#1e293b;vertical-align:middle}.fahrerzeit-desktop tbody tr:last-child td{border-bottom:0}.fahrerzeit-desktop td small{display:block;margin-top:2px;color:#64748b;font-size:10px}.fahrerzeit-desktop td>a{font-weight:800;color:#1e40af}.fahrerzeit-vin{font-family:monospace;color:#64748b}.fahrerzeit-status,.fahrerzeit-note{display:inline-flex;border-radius:999px;padding:4px 9px;font-size:10px;font-weight:800;white-space:nowrap}.fahrerzeit-status.worked,.fahrerzeit-note.ok{background:#ecfdf5;color:#15803d}.fahrerzeit-status.missing,.fahrerzeit-note.warning{background:#fef2f2;color:#dc2626}.fahrerzeit-status.planned{background:#f1f5f9;color:#475569}.fahrerzeit-note.info{background:#eef2ff;color:#4338ca}.fahrerzeit-ts-link{display:block;text-decoration:none}.fahrerzeit-ts-link:hover strong{text-decoration:underline}.fahrerzeit-mobile{display:none}
@media(max-width:760px){.fahrerzeit-header{align-items:flex-start;flex-direction:column}.fahrerzeit-title{font-size:20px}.fahrerzeit-nav{width:100%;display:grid;grid-template-columns:auto 1fr auto}.fahrerzeit-nav>a:first-child{grid-column:1/-1;width:max-content}.fahrerzeit-nav form{min-width:0}.fahrerzeit-nav input[type=month]{width:100%;box-sizing:border-box}.fahrerzeit-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.fahrerzeit-kpi{padding:12px}.fahrerzeit-kpi strong{font-size:22px}.fahrerzeit-desktop{display:none}.fahrerzeit-mobile{display:grid;gap:10px}.fahrerzeit-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden}.fahrerzeit-card header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:12px}.fahrerzeit-card header>div>strong{display:block;font-size:14px;color:#0f172a}.fahrerzeit-card header>div>span{display:block;margin-top:3px;font-size:12px;font-weight:800;color:#4338ca}.fahrerzeit-card-meta{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#e2e8f0;border-top:1px solid #e2e8f0}.fahrerzeit-card-meta>span{background:#fff;padding:10px;font-size:12px;font-weight:800;color:#1e293b}.fahrerzeit-card-meta small{display:block;margin-bottom:3px;color:#64748b;font-size:9px;text-transform:uppercase}.fahrerzeit-card footer{padding:7px 12px;font-size:11px;font-weight:800}.fahrerzeit-card footer.info{background:#eef2ff;color:#4338ca}.fahrerzeit-card footer.warning{background:#fef2f2;color:#dc2626}}

/* Einheitliche moderne Dateiauswahl fuer native Upload-Felder. */
input[type="file"] {
  box-sizing: border-box;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-radius: 9px;
  padding: 5px;
  font-weight: 700;
}
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  color: #fff;
  background: #34458d;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #2b3978; }
