/* Hewitech Cockpit – Farben aus dem Erscheinungsbild von hewitech.de */
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap;
  src: url("vendor/open-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap;
  src: url("vendor/open-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap;
  src: url("vendor/open-sans-700.woff2") format("woff2"); }

:root {
  --blue: #1b4a92;
  --blue-dark: #15458f;
  --blue-light: #8ca2c7;
  --blue-pale: #e8edf5;
  --text: #303030;
  --muted: #6b6b6b;
  --line: #dfe3e8;
  --bg: #f1f1f1;
  --card: #ffffff;
  --good: #2e7d32;
  --bad: #c00000;
  --warn: #b25e00;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; font-weight: 600; color: var(--blue-dark); }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; font-weight: 600; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Kopfzeile */
.top { background: var(--card); border-bottom: 3px solid var(--blue); }
.top-inner, .nav-inner, main, footer { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 12px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; display: block; }
.brand span { font-size: 1.05rem; color: var(--muted); border-left: 1px solid var(--line);
  padding-left: 14px; }
.stand { font-size: .85rem; color: var(--muted); text-align: right; }
.demo-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px;
  background: #fff4e0; color: var(--warn); font-weight: 600; font-size: .8rem; }

.nav-inner { display: flex; align-items: center; gap: 24px; padding-bottom: 10px; flex-wrap: wrap; }
.views { display: inline-flex; border: 1px solid var(--blue); border-radius: var(--radius);
  overflow: hidden; }
.views a { padding: 8px 18px; font-weight: 600; color: var(--blue); }
.views a + a { border-left: 1px solid var(--blue); }
.views a.active { background: var(--blue); color: #fff; }
.views a:hover { text-decoration: none; background: var(--blue-pale); }
.views a.active:hover { background: var(--blue); }
.areas { display: flex; gap: 4px; flex-wrap: wrap; }
.areas a { padding: 6px 10px; border-radius: var(--radius); color: var(--text); font-size: .95rem; }
.areas a.active { background: var(--blue-pale); color: var(--blue-dark); font-weight: 600; }
.areas a:hover { text-decoration: none; background: var(--blue-pale); }

main { padding-top: 20px; padding-bottom: 32px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); }
.back { display: inline-block; margin-bottom: 8px; font-size: .9rem; }

/* Kacheln */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { position: relative; display: block; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius);
  padding: 16px 18px 14px; }
.tile:hover { text-decoration: none; border-color: var(--blue-light); border-left-color: var(--blue);
  box-shadow: 0 2px 8px rgba(27, 74, 146, .12); }
.tile.warn { border-left-color: var(--warn); }
.tile-title { font-size: .9rem; color: var(--muted); font-weight: 600; padding-right: 22px; }
.tile-value { font-size: 2rem; font-weight: 700; color: var(--blue-dark); line-height: 1.2;
  margin: 4px 0 2px; white-space: nowrap; }
.tile-sub { font-size: .95rem; }
.tile-note { font-size: .9rem; color: var(--muted); margin-top: 2px; }
.tile.warn .tile-note { color: var(--warn); font-weight: 600; }
.tile-delta { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--muted); }
.tile-go { position: absolute; right: 14px; top: 12px; color: var(--blue-light); font-size: 1.3rem;
  line-height: 1; }
.tile .info { cursor: help; color: var(--blue-light); font-weight: 400; }
.up, .down { font-weight: 700; }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* Karten und Raster */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px; }
.grid.wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.grid > .card { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.chart-box { position: relative; width: 100%; }
.legend-note { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.kpi-line { font-size: 1.05rem; margin: 0 0 10px; }
.kpi-line strong { color: var(--blue-dark); }

/* Hinweise */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { border-top: 1px solid var(--line); }
.attention li:first-child { border-top: 0; }
.attention a { display: flex; gap: 12px; align-items: center; padding: 10px 2px; color: var(--text); }
.attention a:hover { text-decoration: none; background: var(--blue-pale); }
.dot { flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.dot.good { background: var(--good); }
.attention .go { margin-left: auto; color: var(--blue-light); }

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem;
  border-bottom: 2px solid var(--line); padding: 8px 10px; white-space: nowrap; cursor: pointer;
  user-select: none; }
th.num, td.num { text-align: right; }
th[aria-sort]::after { content: " ▾"; color: var(--blue-light); }
th[aria-sort="ascending"]::after { content: " ▴"; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--blue-pale); }
tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.table-actions { display: flex; gap: 16px; justify-content: space-between; align-items: center;
  margin-top: 10px; font-size: .9rem; flex-wrap: wrap; }

/* Zeitraum und Filter */
.picker { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 12px 20px; flex-wrap: wrap;
  align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; color: var(--text);
  background: #fff; font-size: .92rem; white-space: nowrap; }
.chip:hover { text-decoration: none; border-color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.picker form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.picker details.custom summary { cursor: pointer; color: var(--blue); font-size: .95rem;
  padding: 6px 0; }
.picker details.custom[open] summary { margin-bottom: 8px; }
.picker details.custom { flex: 1 1 100%; }
input, select, button { font: inherit; font-size: .95rem; }
input[type=date], input[type=search], select { padding: 6px 8px; border: 1px solid #c8ced6;
  border-radius: var(--radius); background: #fff; color: var(--text); min-height: 38px; }
button { padding: 7px 16px; border: 0; border-radius: var(--radius); background: var(--blue);
  color: #fff; font-weight: 600; cursor: pointer; min-height: 38px; }
button:hover { background: var(--blue-dark); }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.active-filters .chip { background: var(--blue-pale); border-color: var(--blue-pale); }

/* Belegkette */
.chain { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chain a, .chain span.cur { padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px;
  font-size: .92rem; }
.chain span.cur { background: var(--blue); color: #fff; border-color: var(--blue); }
.chain .arrow { color: var(--blue-light); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

details.method { margin-top: 12px; font-size: .9rem; color: var(--muted); }
details.method summary { cursor: pointer; color: var(--blue); }
details.method ul { margin: 8px 0 0; padding-left: 20px; }

footer { color: var(--muted); font-size: .85rem; padding-bottom: 24px; }

@media (max-width: 1100px) {
  .tiles, .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid, .grid.wide-left { grid-template-columns: minmax(0, 1fr); }
  .grid > .first-sm { order: -1; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .top-inner, .nav-inner, main, footer { padding-left: 12px; padding-right: 12px; }
  .brand img { height: 30px; }
  .stand { text-align: left; width: 100%; }
  .nav-inner { gap: 10px; }
  .views { display: flex; width: 100%; }
  .views a { flex: 1; text-align: center; padding: 10px 6px; }
  .areas { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px;
    scrollbar-width: none; }
  .areas a { white-space: nowrap; background: var(--bg); }
  .tiles, .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 10px 10px 11px; border-left-width: 3px; }
  .tile-title { font-size: .8rem; padding-right: 12px; line-height: 1.3; }
  .tile-go { right: 8px; top: 8px; font-size: 1.1rem; }
  .tile-value { font-size: 1.3rem; margin: 4px 0 2px; }
  .tile-sub, .tile-note, .tile-delta { font-size: .8rem; line-height: 1.35; }
  .tile-delta { margin-top: 6px; padding-top: 6px; }
  .card { padding: 12px; }
  .hide-sm { display: none; }
  td, th { padding: 8px 6px; }
  h1 { font-size: 1.3rem; }
}
@media (max-width: 350px) {
  .tiles, .tiles.four { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .top nav, .picker, .table-actions, footer, .tile-go { display: none; }
  body { background: #fff; }
  .tile, .card { break-inside: avoid; box-shadow: none; }
}
