* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a202c; }

/* ── 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: #1a202c; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; height: 58px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); position: sticky; top: 0; z-index: 100; }
.nav-left { display: flex; align-items: center; gap: 14px; }
.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; gap: 2px; }
.nav-links a { color: #a0aec0; text-decoration: none; padding: 7px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav-links a:hover { background: #2d3748; color: white; }
.nav-links a.active { background: #2d3748; color: white; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.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; }

/* ── 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; }

/* ── 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; }

/* ── 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: 46px !important;
  max-height: 46px !important;
  width: auto !important;
  max-width: 180px !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: 80px; 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: 32px; max-width: 70px; }
  .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;
}
#mobile-sort-bar button[data-dir] {
  background:#2d3748; border-color:#2d3748; color:#fff;
}
@media (max-width:820px) {
  #mobile-sort-bar { display:flex; }
}
