/* JARVIS Übersicht (Reiter „Übersicht“). Lädt nach style.css und orb.css und nutzt deren
   Variablen (--panel, --line, --accent, --ok, --warn, --bad, --hud-mono). Nur lokale Quellen. */

#tab-dashboard {
  display: block;
  overflow-y: auto;
  max-width: 1180px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.dash-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dash-head h2 {
  margin: 0;
  font-size: 18px;
  font-family: var(--hud-mono, monospace);
  letter-spacing: .12em;
  color: var(--accent);
  text-shadow: 0 0 12px var(--hud-glow, transparent);
}
.dash-stand {
  font-family: var(--hud-mono, monospace);
  font-size: 12px;
  color: var(--muted);
  margin-right: auto;
}

/* ---------------------------------------------------------------- Kennzahlen */

.dash-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dash-kpi {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 195, 247, .18);
  border-radius: 10px;
  background: var(--hud-faint, rgba(79, 195, 247, .08));
}
.dash-kpi strong {
  font-family: var(--hud-mono, monospace);
  font-size: 24px;
  line-height: 1.1;
  color: var(--text);
}
.dash-kpi span { font-size: 12px; color: var(--muted); }
.dash-kpi-link { cursor: pointer; }
.dash-kpi-link:hover, .dash-kpi-link:focus-visible { border-color: var(--accent); outline: none; }

/* ---------------------------------------------------------------- Raster und Karten */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}
.dash-card { padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.dash-wide { grid-column: 1 / -1; }
.dash-card-head { display: flex; align-items: center; gap: 8px; }
.dash-card-head h3 {
  margin: 0;
  margin-right: auto;
  font-size: 13px;
  font-family: var(--hud-mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(79, 195, 247, .85);
}
.dash-card h4 {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
}
.dash-card p { margin: 0; }

.dash-pill {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-family: var(--hud-mono, monospace);
  white-space: nowrap;
}
.dash-ok { color: var(--ok); border-color: var(--ok); }
.dash-teilweise { color: var(--warn); border-color: var(--warn); }
.dash-fehler { color: var(--bad); border-color: var(--bad); }
.dash-folgt, .dash-aus { color: var(--muted); }
.dash-estimate { color: var(--warn); border-color: rgba(224, 165, 58, .6); }

.dash-error { color: var(--bad); font-size: 13px; }
.dash-free { color: var(--muted); font-size: 13px; }
.dash-hot { color: var(--accent); }
.dash-bad { color: var(--bad); }
.dash-hint { font-size: 12px; }

.dash-chip {
  --chip: #4fc3f7;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 10px;
  color: #fff;
  background: var(--chip);
  white-space: nowrap;
}
.dash-chip-bad { opacity: .55; text-decoration: line-through; }
.dash-chip-flag { font-weight: 400; text-decoration: none; }
.dash-legend { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Termine */

.dash-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.dash-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  align-content: start;
  background: rgba(0, 0, 0, .18);
}
.dash-day h4 { margin: 0; font-family: var(--hud-mono, monospace); }
.dash-today { border-color: rgba(79, 195, 247, .45); box-shadow: 0 0 12px rgba(79, 195, 247, .08); }
.dash-today h4 { color: var(--accent); }
.dash-event {
  --brand: #4fc3f7;
  display: grid;
  gap: 1px;
  padding: 3px 0 3px 8px;
  border-left: 3px solid var(--brand);
  font-size: 13px;
}
.dash-event-time { font-family: var(--hud-mono, monospace); font-size: 12px; color: var(--muted); }
.dash-event-main { display: grid; min-width: 0; }
.dash-event-title { overflow-wrap: anywhere; }
.dash-event-meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.dash-past { opacity: .5; }
.dash-private .dash-event-title { font-style: italic; color: var(--muted); }

/* ---------------------------------------------------------------- Mail, Listen */

.dash-inbox { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.dash-inbox:first-of-type { border-top: 0; padding-top: 0; }
.dash-inbox-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-inbox-nums { font-size: 12px; color: var(--muted); }
.dash-inbox-nums strong { color: var(--text); }
.dash-inbox-nums strong.dash-hot { color: var(--accent); }

.dash-mails, .dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-mails li, .dash-list li {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .2);
  min-width: 0;
}
.dash-unread { box-shadow: inset 2px 0 0 var(--accent); }
.dash-unread .dash-mail-from { font-weight: 600; color: var(--text); }
.dash-mail-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.dash-mail-from {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dash-mail-time { font-family: var(--hud-mono, monospace); font-size: 11px; color: var(--muted); white-space: nowrap; }
.dash-mail-subject { font-size: 13px; overflow-wrap: anywhere; }

.dash-big { font-size: 13px; color: var(--muted); }
.dash-big strong { font-family: var(--hud-mono, monospace); font-size: 28px; color: var(--text); }
.dash-big strong.dash-hot { color: var(--warn); }
.dash-nums { font-size: 13px; color: var(--muted); }
.dash-nums strong { color: var(--text); font-family: var(--hud-mono, monospace); }
.dash-nums strong.dash-bad { color: var(--bad); }
.dash-link-btn { justify-self: start; }

.dash-task { --brand: #4fc3f7; border-left: 3px solid var(--brand); }
.dash-task .dash-mail-from { white-space: normal; overflow-wrap: anywhere; }
.dash-task .dash-mail-time { text-align: right; }
.dash-task-ueberfaellig .dash-mail-time { color: var(--bad); }
.dash-task-heute .dash-mail-time { color: var(--warn); }

/* ---------------------------------------------------------------- Tabellen, Status */

.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th, .dash-table td { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.dash-table td:not(:first-child), .dash-table tr:first-child th:not(:first-child) { text-align: right; }
.dash-table tr:first-child th { font-size: 11px; color: var(--muted); font-weight: 500; }
.dash-table td { font-family: var(--hud-mono, monospace); font-size: 12px; }
.dash-small { font-size: 12px; margin-top: 6px; }
.dash-conn td:not(:first-child) { text-align: left; }
.dash-conn tr:first-child th:not(:first-child) { text-align: left; }
.dash-details summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.dash-details[open] summary { margin-bottom: 4px; }

.dash-sys-row { display: grid; grid-template-columns: 12px 120px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
.dash-sys-label { color: var(--muted); }
.dash-sys-text { overflow-wrap: anywhere; }
.dash-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.dash-dot-ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dash-dot-fehler { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.dash-dot-teilweise { background: var(--warn); }

/* ---------------------------------------------------------------- Schnellzugriffe */

.dash-quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-quick {
  --chip: #4fc3f7;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(79, 195, 247, .35);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: rgba(79, 195, 247, .06);
}
.dash-quick:hover, .dash-quick:focus-visible { background: rgba(79, 195, 247, .16); outline: none; }
.dash-quick-brand { color: #fff; border-color: var(--chip); background: var(--chip); }
.dash-quick-brand:hover, .dash-quick-brand:focus-visible { filter: brightness(1.15); background: var(--chip); }

/* ---------------------------------------------------------------- Mobil */

@media (max-width: 600px) {
  .dash-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-kpi strong { font-size: 20px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dash-days { grid-template-columns: minmax(0, 1fr); }
  .dash-sys-row { grid-template-columns: 12px 100px minmax(0, 1fr); }
  .dash-card { padding: 12px; }
}
