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

:root {
  --bg-body: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --bg-input: #0f1a2e;
  --bg-nav: #0f1629;
  --text-primary: #e8e8e8;
  --text-secondary: #c8d0e0;
  --text-muted: #a0abbe;
  --green: #00d4aa;
  --green-dim: rgba(0, 212, 170, 0.15);
  --red: #ff6b6b;
  --red-dim: rgba(255, 107, 107, 0.15);
  --yellow: #ffd93d;
  --yellow-dim: rgba(255, 217, 61, 0.15);
  --blue: #4dabf7;
  --blue-dim: rgba(77, 171, 247, 0.15);
  --border: #2a3550;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 60px;
  --header-height: 56px;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + 16px);
  overflow-x: hidden;
}

/* ─── Header ──────────────────────────────────────────────────────────── */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

#header-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
}

#settings-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  width: 32px;
  height: 32px;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}
#settings-btn svg {
  width: 100%;
  height: 100%;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--red); }

/* ─── Bottom Nav ──────────────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: stretch;
  align-items: center;
  z-index: 100;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.65rem;
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg {
  width: 20px;
  height: 20px;
}
.nav-item.active {
  color: var(--green);
}
.nav-item:active {
  color: var(--blue);
}

/* ─── Content Area ────────────────────────────────────────────────────── */
#content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.card-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-clickable {
  cursor: pointer;
  transition: background 0.2s;
}
.card-clickable:active {
  background: var(--bg-card-hover);
}

/* ─── Stat Cards (Dashboard) ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.yellow { color: var(--yellow); }

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Section Headers ─────────────────────────────────────────────────── */
.section-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 10px;
}

/* ─── Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green {
  background: var(--green-dim);
  color: var(--green);
}
.badge-red {
  background: var(--red-dim);
  color: var(--red);
}
.badge-yellow {
  background: var(--yellow-dim);
  color: var(--yellow);
}
.badge-blue {
  background: var(--blue-dim);
  color: var(--blue);
}
.badge-pay-ok {
  background: var(--green);
  color: #000;
  font-size: 0.6rem;
}
.badge-pay-open {
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
}
.badge-noshow {
  background: var(--yellow);
  color: #000;
  font-size: 0.6rem;
  margin-right: 4px;
}

/* ─── Edit Overlay ─────────────────────────────────────────────────── */
.edit-overlay-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.edit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.edit-row label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 110px;
}
.edit-row select,
.edit-row .edit-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.82rem;
  flex: 1;
  max-width: 160px;
}
.edit-row span {
  font-size: 0.82rem;
  color: var(--text-primary);
}
.edit-order-btn {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2px 4px;
  -webkit-tap-highlight-color: transparent;
}
.edit-order-btn:active {
  color: var(--blue);
}

/* ─── Chips (Date Tags) ──────────────────────────────────────────────── */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.72rem;
  background: var(--bg-body);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ─── Timeline ────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 24px;
  margin: 12px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--bg-card);
}
.timeline-dot.booked {
  background: var(--green);
}
.timeline-dot.failed {
  background: var(--red);
}
.timeline-dot.start,
.timeline-dot.home {
  background: var(--text-muted);
}

.timeline-item-failed {
  opacity: 0.75;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timeline-title {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-top: 2px;
}

.timeline-address {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.timeline-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 12px;
}

/* ─── Profit Display ──────────────────────────────────────────────────── */
.profit {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
}
.profit.negative {
  color: var(--red);
}

.earnings {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ─── Route Card ──────────────────────────────────────────────────────── */
.route-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}

.route-card-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.route-card-header > div:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.route-card-header > div:last-child {
  flex-shrink: 0;
  text-align: right;
}

.route-card-header:active {
  background: var(--bg-card-hover);
}

.route-date {
  font-size: 0.95rem;
  font-weight: 600;
}

.route-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.route-detail {
  padding: 0 16px 16px;
  display: none;
}
.route-detail.open {
  display: block;
}

.route-booked-info {
  margin-top: 12px;
  padding: 10px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--green);
  background: var(--green-dim);
  border-radius: var(--radius-sm);
}

.btn-book-route {
  margin-top: 12px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  width: 100%;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--green);
  color: #1a1a2e;
}
.btn-secondary {
  background: var(--bg-body);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-blue {
  background: var(--blue);
  color: #1a1a2e;
}
.btn-yellow {
  background: var(--yellow);
  color: #1a1a2e;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.78rem;
  min-height: 36px;
  width: auto;
}

.btn-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.btn-group .btn {
  flex: 1;
}

/* ─── Time Select ────────────────────────────────────────────────────── */
.time-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
  min-height: 44px;
}
.time-select:focus {
  outline: none;
  border-color: var(--green);
}

/* ─── Action Buttons (Tasks View) ─────────────────────────────────────── */
.action-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.action-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.action-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ─── Terminal Output ─────────────────────────────────────────────────── */
.terminal {
  background: #0d1117;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
  max-height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.68rem;
  line-height: 1.6;
  color: #8b949e;
  white-space: pre-wrap;
  word-break: break-word;
  display: none;
  -webkit-overflow-scrolling: touch;
}
.terminal.open {
  display: block;
}

/* ─── Task Items ──────────────────────────────────────────────────────── */
.task-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.task-item.task-running {
  border-color: var(--yellow);
  border-width: 1px;
}

.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-type {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Pulse Dot (laufender Task) ─────────────────────────────────────── */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ─── Date Group Headers (Booked View) ────────────────────────────────── */
.date-group {
  margin-bottom: 20px;
}

.date-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.date-group-title {
  font-size: 1rem;
  font-weight: 700;
}

.date-group-title.today {
  color: var(--green);
}

.date-group-earnings {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
}

/* ─── Sort Controls ───────────────────────────────────────────────────── */
.sort-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sort-bar::-webkit-scrollbar { display: none; }

.sort-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sort-btn.active {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green);
}

/* ─── Empty State ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}
.empty-state-text {
  font-size: 0.9rem;
}

/* ─── Loading Spinner ─────────────────────────────────────────────────── */
.loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Quick Actions (Dashboard) ──────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

/* ─── Collapsible ─────────────────────────────────────────────────────── */
.collapse-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.collapse-arrow {
  transition: transform 0.2s;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.collapse-arrow.open {
  transform: rotate(90deg);
}

/* ─── Fee display in order cards ──────────────────────────────────────── */
.fee-display {
  text-align: right;
}
.fee-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
}
.fee-breakdown {
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.fee-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ─── Distance pill ───────────────────────────────────────────────────── */
.distance {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── View transition ─────────────────────────────────────────────────── */
.view-enter {
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Overlay ─────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay.hidden {
  display: none;
}
.overlay-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  max-width: 90vw;
  width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}
.overlay-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
}
.overlay-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ─── Overlay Booking List ─────────────────────────────────────────────── */
.booking-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.booking-order-item:last-child {
  border-bottom: none;
}
.booking-order-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.booking-order-icon.pending { color: var(--text-muted); }
.booking-order-icon.booking { color: var(--yellow); }
.booking-order-icon.booked { color: var(--green); }
.booking-order-icon.failed { color: var(--red); }
.booking-order-info {
  flex: 1;
  min-width: 0;
}
.booking-order-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.booking-order-address {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.booking-order-error {
  font-size: 0.7rem;
  color: var(--red);
  margin-top: 2px;
}
.booking-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Month Groups (Completed View) ──────────────────────────────────── */
.month-group {
  margin-bottom: 4px;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.month-header:active {
  background: var(--bg-card-hover);
}

.month-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.month-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.month-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: right;
}

.month-net {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green);
}

.month-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.month-body {
  display: none;
  padding: 8px 0 12px;
}
.month-body.open {
  display: block;
}

/* ─── Chip clickable ──────────────────────────────────────────────────── */
.chip-clickable {
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.chip-clickable:active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

/* ─── Plus-Route (Erweiterungsvorschlaege) ────────────────────────────── */
.plus-match-list {
  margin-top: 10px;
}

.plus-match-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 6px;
  background: var(--green-dim);
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
  transition: opacity 0.2s;
  flex-wrap: wrap;
}
.plus-match-banner:active {
  opacity: 0.7;
}

.plus-icon {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.plus-travel-info {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-left: auto;
  font-weight: 400;
}
.plus-travel-info.estimated {
  font-style: italic;
  opacity: 0.85;
}

.plus-match-detail {
  display: none;
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.plus-match-detail.open {
  display: block;
}

.timeline-item.plus-new .timeline-title {
  color: var(--green);
}
.timeline-item.plus-new .timeline-time {
  color: var(--green);
  opacity: 0.85;
}
.timeline-item.plus-new .timeline-address {
  color: var(--green);
  opacity: 0.75;
}

.timeline-dot.plus {
  background: var(--green);
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.5);
}

/* Extension-Route Card im Routen-Tab */
.route-card-extension {
  border-color: rgba(0, 212, 170, 0.3);
}

/* Idle-Route Card im Routen-Tab */
.route-card-idle {
  border-color: rgba(255, 217, 61, 0.3);
}

/* Idle-Route Badge im Routen-Tab */
.route-idle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--yellow-dim);
  color: var(--yellow);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

/* Timeline Idle Marker */
.timeline-idle {
  position: relative;
  padding: 6px 0 6px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline-idle-line {
  position: absolute;
  left: -17px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--yellow) 0px,
    var(--yellow) 4px,
    transparent 4px,
    transparent 8px
  );
}
.timeline-idle-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--yellow);
  background: var(--yellow-dim);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Extension-Route Badge im Routen-Tab */
.route-plus-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--green-dim);
  color: var(--green);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

/* ─── Maps Button (Route Header) ─────────────────────────────────────── */
.maps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px;
  -webkit-tap-highlight-color: transparent;
}
.maps-btn:active {
  opacity: 0.6;
}

/* ─── Settings Form ──────────────────────────────────────────────────── */
.settings-form {
  padding: 4px 0;
}
.settings-group {
  margin-bottom: 16px;
}
.settings-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.settings-group input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
}
.settings-group input[type="number"]:focus {
  outline: none;
  border-color: var(--green);
}
.time-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time-range .time-select {
  flex: 1;
}
.time-range-sep {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Report Button ──────────────────────────────────────────────────── */
.btn-report {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
}
.btn-report:hover { background: var(--bg-card-hover); }

/* ─── Monatsreport ───────────────────────────────────────────────────── */
.report-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.report-type-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.report-type-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.report-type-total {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green);
}
.report-type-details {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.report-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 16px 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-order-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.report-order-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  border-left: 2px solid var(--border);
}
.report-order-name {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.report-order-detail {
  color: var(--text-muted);
  font-size: 0.7rem;
  flex: 1;
  min-width: 0;
}
.report-order-netto {
  font-weight: 700;
  white-space: nowrap;
  margin-left: auto;
}

.report-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 16px;
}
.report-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.report-summary-row:last-child { border-bottom: none; }
.report-summary-row.highlight {
  font-weight: 700;
  font-size: 0.88rem;
}
.report-summary-row.check.ok {
  color: var(--green);
  font-weight: 700;
}
.report-summary-row.check.error {
  color: var(--red);
  font-weight: 700;
}
.report-summary-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 0 4px 0;
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  #content {
    padding: 20px;
  }
  .stats-grid {
    gap: 12px;
  }
}
