/* MWIT Kundenportal – Gestaltung (Farben wie mwit.tech: Blau #00457f, Rot #d90007) */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/archivo-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/archivo-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --brand: #00457f;
  --brand-hover: #003866;
  --brand-ink: #00457f;
  --brand-50: #eef4fa;
  --brand-100: #dce8f4;
  --red: #d90007;
  --bg: #f4f6fa;
  --card: #ffffff;
  --card-2: #f8fafc;
  --text: #17263b;
  --muted: #56667d;
  --faint: #8794a6;
  --border: #e3e8ef;
  --border-strong: #cdd6e1;
  --input-bg: #ffffff;
  --green: #12704a;
  --green-bg: #e5f5ec;
  --amber: #8f5a00;
  --amber-bg: #fdf2dc;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --blue: #0b5394;
  --blue-bg: #e7f0fb;
  --gray: #4a5568;
  --gray-bg: #edf0f4;
  --bar-good: #22a06b;
  --bar-warn: #e2a400;
  --bar-bad: #d64545;
  --bar-none: #d9dfe7;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 252px;
  --topbar-h: 60px;
  --focus: 0 0 0 3px rgba(0, 69, 127, 0.28);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2f78c4;
    --brand-hover: #3d88d6;
    --brand-ink: #8cc0f2;
    --brand-50: #13263c;
    --brand-100: #1b3452;
    --bg: #0d1520;
    --card: #142030;
    --card-2: #182638;
    --text: #e3eaf3;
    --muted: #a2b2c6;
    --faint: #73859b;
    --border: #22334a;
    --border-strong: #2f4561;
    --input-bg: #101b29;
    --green: #5fd39a;
    --green-bg: #133325;
    --amber: #f0c060;
    --amber-bg: #3a2c10;
    --danger: #ff8a80;
    --danger-bg: #3c1a1a;
    --blue: #8cc0f2;
    --blue-bg: #14304d;
    --gray: #b6c2d1;
    --gray-bg: #223144;
    --bar-none: #2a3a50;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --focus: 0 0 0 3px rgba(110, 170, 235, 0.4);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--brand-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img,
svg {
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.8em;
}
small,
.small {
  font-size: 0.85rem;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}
.justify-center {
  justify-content: center;
}
.mt-0 {
  margin-top: 0 !important;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.gap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}
.spread {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}
.break {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  left: 8px;
}

/* ------------------------------------------------------------------ Symbole */
.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.ic-lg {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------------ Gerüst */
.nav-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-width: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  height: 30px;
  width: auto;
}
.brand-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-left: 1px solid var(--border-strong);
  padding-left: 10px;
  white-space: nowrap;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -6px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}
.nav-btn:hover {
  background: var(--gray-bg);
}
.nav-check:focus-visible ~ .topbar .nav-btn {
  box-shadow: var(--focus);
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.who {
  display: none;
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.who strong {
  color: var(--text);
  font-weight: 600;
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 300px);
  padding: 16px 12px 24px;
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  visibility: hidden;
}
.nav-check:checked ~ .sidebar {
  transform: none;
  visibility: visible;
  box-shadow: var(--shadow-lg);
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(10, 18, 30, 0.45);
}
.nav-check:checked ~ .nav-overlay {
  display: block;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px;
}
.sidebar-head img {
  height: 28px;
  width: auto;
}
.nav-close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}
.nav-section {
  margin: 18px 10px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 9px;
  color: var(--text);
  font-weight: 500;
}
.nav a:hover {
  background: var(--gray-bg);
  text-decoration: none;
}
.nav a[aria-current='page'] {
  background: var(--brand-50);
  color: var(--brand-ink);
  font-weight: 650;
}
.nav a .ic {
  color: var(--muted);
}
.nav a[aria-current='page'] .ic {
  color: var(--brand-ink);
}
.nav .count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 999px;
  padding: 1px 8px;
}

.content {
  padding: 20px 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  max-width: 1240px;
  margin: 0 auto;
  min-width: 0;
}

@media (min-width: 1024px) {
  .nav-btn,
  .nav-close,
  .nav-overlay,
  .sidebar-head {
    display: none !important;
  }
  .sidebar {
    top: var(--topbar-h);
    width: var(--sidebar-w);
    transform: none;
    visibility: visible;
    transition: none;
    z-index: 20;
    box-shadow: none !important;
  }
  .main-wrap {
    margin-left: var(--sidebar-w);
  }
  .content {
    padding: 28px 32px 64px;
  }
  .who {
    display: block;
  }
}

.viewas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px;
  background: var(--amber-bg);
  color: var(--amber);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.92rem;
}
.viewas form {
  margin-left: auto;
}

/* ------------------------------------------------------------------ Seitenkopf */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  overflow-wrap: anywhere;
}
.page-head .sub {
  margin: 4px 0 0;
  color: var(--muted);
}
.crumbs {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.crumbs a {
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ------------------------------------------------------------------ Karten & Raster */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.content > .card + .card,
.content > .card + .grid,
.content > .grid + .card,
.content > .grid + .grid,
.content > form + .card,
.content > .card + form {
  margin-top: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.grid > *,
.stack > *,
.form > * {
  margin-top: 0;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  margin: 0;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body {
  padding: 16px 18px;
}
.card-body > :last-child {
  margin-bottom: 0;
}
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.card.flush .card-body {
  padding: 0;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.grid-main,
.grid.top {
  align-items: start;
}
@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 1100px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid-main {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.stat {
  padding: 16px 18px;
}
.stat .label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat .value {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .hint {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 2px;
}
.stat.good .value {
  color: var(--green);
}
.stat.bad .value {
  color: var(--danger);
}

/* ------------------------------------------------------------------ Listen */
.dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 16px;
  margin: 0;
}
.dl dt {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 8px;
}
.dl dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}
@media (min-width: 560px) {
  .dl {
    grid-template-columns: minmax(130px, max-content) minmax(0, 1fr);
    gap: 9px 20px;
  }
  .dl dt {
    margin: 0;
  }
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list > li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.list > li:first-child {
  border-top: 0;
}
.list > li.wrap {
  flex-wrap: wrap;
}
.list > li.wrap .grow {
  flex: 1 1 15rem;
}
.nowrap {
  white-space: nowrap;
}
.list .grow {
  flex: 1;
  min-width: 0;
}
.card-warn {
  border-left: 4px solid var(--amber);
}
.list .title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.list .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.features {
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li {
  position: relative;
  padding-left: 24px;
  margin: 5px 0;
}
.features li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

/* ------------------------------------------------------------------ Tabellen (auf dem Handy als Karten) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table tbody tr:hover {
  background: var(--card-2);
}
.table .row-link {
  font-weight: 600;
}
.table td.actions-cell {
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 719px) {
  table.table.stackable thead {
    display: none;
  }
  table.table.stackable,
  .table.stackable tbody,
  .table.stackable tr,
  .table.stackable td {
    display: block;
    width: 100%;
  }
  .table.stackable tr {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
  }
  .table.stackable tr:last-child {
    border-bottom: 0;
  }
  .table.stackable td {
    border: 0;
    padding: 3px 0;
    text-align: right;
  }
  .table.stackable td::before {
    content: attr(data-label);
    float: left;
    margin-right: 14px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.75;
    text-align: left;
  }
  .table.stackable td::after {
    content: '';
    display: block;
    clear: both;
  }
  .table.stackable td.primary {
    font-size: 1rem;
    text-align: left;
    padding-bottom: 6px;
  }
  .table.stackable td.primary::before,
  .table.stackable td:not([data-label])::before {
    content: none;
  }
  .table.stackable td.actions-cell {
    padding-top: 8px;
  }
}

/* ------------------------------------------------------------------ Kennzeichnungen */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.6;
}
.b-green {
  background: var(--green-bg);
  color: var(--green);
}
.b-red {
  background: var(--danger-bg);
  color: var(--danger);
}
.b-amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.b-blue {
  background: var(--blue-bg);
  color: var(--blue);
}
.b-gray {
  background: var(--gray-bg);
  color: var(--gray);
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.dot.up {
  background: var(--bar-good);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.dot.down {
  background: var(--bar-bad);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.dot.unknown {
  background: var(--faint);
}

/* ------------------------------------------------------------------ Hinweise */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 14px;
  font-size: 0.94rem;
}
.alert .ic {
  margin-top: 2px;
}
.alert > div {
  flex: 1;
  min-width: 0;
}
.alert p:last-child {
  margin-bottom: 0;
}
.alert-success {
  background: var(--green-bg);
  color: var(--green);
}
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}
.alert-warn {
  background: var(--amber-bg);
  color: var(--amber);
}
.alert-info {
  background: var(--blue-bg);
  color: var(--blue);
}
.alert a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}
.alert .alert-action {
  white-space: nowrap;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}
.empty .ic {
  width: 30px;
  height: 30px;
  color: var(--faint);
  margin-bottom: 6px;
}

/* ------------------------------------------------------------------ Knöpfe */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--gray-bg);
  text-decoration: none;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.btn-danger {
  background: var(--card);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-bg);
}
.btn-danger-solid {
  background: #c11d1d;
  border-color: #c11d1d;
  color: #fff;
}
.btn-danger-solid:hover {
  background: #a51616;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 0.85rem;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
}
.inline-form {
  display: inline;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--brand-ink);
  cursor: pointer;
}
.link-btn:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ Formulare */
.form {
  display: grid;
  gap: 16px;
}
.form-grid {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .form-grid .span-2 {
    grid-column: span 2;
  }
  .form-grid .span-all {
    grid-column: 1 / -1;
  }
}
@media (min-width: 1100px) {
  .form-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.field {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: start;
}
.field > label,
.field > .label {
  font-weight: 600;
  font-size: 0.9rem;
}
.field .hint {
  font-size: 0.82rem;
  color: var(--muted);
}
.field .error,
.form-error {
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 600;
}
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='url'],
input[type='search'],
input[type='tel'],
input[type='file'],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.45;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}
input[aria-invalid='true'],
select[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: var(--danger);
}
input[type='file'] {
  padding: 7px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--brand);
}
.check span {
  min-width: 0;
}
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-weight: 650;
  padding: 0;
  margin-bottom: 8px;
}
.form-section {
  padding-top: 6px;
}
.form-section h2 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.input-group > * {
  min-width: 0;
}
.card-head .input-group select,
.card-head .input-group input,
.page-head .input-group select,
.page-head .input-group input,
.spread .input-group select {
  width: auto;
}
.input-suffix {
  display: flex;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

/* Rechnungspositionen */
.items {
  display: grid;
  gap: 12px;
}
.item-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
}
.item-row .f-title,
.item-row .f-desc {
  grid-column: 1 / -1;
}
.item-row .f-total {
  font-weight: 700;
  align-self: end;
  padding-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.item-row .f-remove {
  align-self: end;
}
@media (min-width: 900px) {
  .item-row {
    grid-template-columns: minmax(0, 3fr) 90px 110px 130px 110px 40px;
    align-items: start;
  }
  .item-row .f-title {
    grid-column: 1;
  }
  .item-row .f-desc {
    grid-column: 1;
    grid-row: 2;
  }
}
.total-line {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 4px;
}

/* ------------------------------------------------------------------ Reiter */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  padding: 9px 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}
.tabs a[aria-current='page'] {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pills a {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 600;
  background: var(--card);
}
.pills a:hover {
  text-decoration: none;
  color: var(--text);
}
.pills a[aria-current='page'] {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-ink);
}

/* ------------------------------------------------------------------ Diagramme */
.uptime-bars {
  display: block;
  width: 100%;
  height: 34px;
}
.uptime-bars .bar.good {
  fill: var(--bar-good);
}
.uptime-bars .bar.warn {
  fill: var(--bar-warn);
}
.uptime-bars .bar.bad {
  fill: var(--bar-bad);
}
.uptime-bars .bar.nodata {
  fill: var(--bar-none);
}
.bars-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 6px;
}
.chart-box {
  position: relative;
}
.rt-chart {
  display: block;
  width: 100%;
  height: 170px;
}
.rt-chart .grid {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.rt-chart .area {
  fill: color-mix(in srgb, var(--brand) 14%, transparent);
}
.rt-chart .line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 4px;
}
.chart-max {
  position: absolute;
  top: -2px;
  left: 0;
  font-size: 0.75rem;
  color: var(--faint);
  background: var(--card);
  padding-right: 6px;
}

.windows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 560px) {
  .windows {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.window {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
}
.window .w-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.window .w-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.status-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}
.status-hero .big-dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.status-hero .big-dot.up {
  background: var(--green-bg);
  color: var(--green);
}
.status-hero .big-dot.down {
  background: var(--danger-bg);
  color: var(--danger);
}
.status-hero .big-dot.unknown {
  background: var(--gray-bg);
  color: var(--gray);
}
.status-hero .s-title {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Sicherungs-/Auftragsprotokoll */
.log {
  margin: 0;
  padding: 14px 16px;
  background: #0f1a28;
  color: #d5e2f0;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 520px;
  overflow: auto;
}
.keybox {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.keybox code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* Anmeldung */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
}
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}
.auth-logo img {
  height: 44px;
  width: auto;
}
.auth-logo span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.auth-card h1 {
  font-size: 1.3rem;
  text-align: center;
}
.auth-foot {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--faint);
  text-align: center;
}
.auth-foot a {
  color: var(--muted);
}
.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  padding: 12px;
  background: var(--card-2);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}
.qr {
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  width: 200px;
  height: 200px;
}

.contact-card .row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

hr.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

details.more > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-ink);
  list-style: none;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more > summary::before {
  content: '▸ ';
}
details.more[open] > summary::before {
  content: '▾ ';
}

@media print {
  .topbar,
  .sidebar,
  .actions,
  .nav-overlay {
    display: none !important;
  }
  .main-wrap {
    margin: 0 !important;
  }
  body {
    background: #fff;
  }
}

/* Fußzeile im angemeldeten Bereich */
.page-foot {
  padding: 8px 24px 24px;
  color: var(--muted);
  font-size: 0.8rem;
}
.page-foot a {
  color: inherit;
}

/* Datumsangaben und Beträge in Tabellen nie mitten in der Zahl umbrechen */
td[data-label="Datum"],
td[data-label="Fällig"],
td[data-label="Fällig am"],
td[data-label="Beginn"],
td[data-label="Ende"],
td[data-label="Termin"],
td[data-label="Betrag"],
td[data-label="Gesamt"],
td[data-label="Einzelpreis"] {
  white-space: nowrap;
}
