/* Grundlagen, Seiten vor dem Login (zentrierte Karte) und der Rahmen mit Seitenmenü nach dem Login. */
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--link); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code { font-family: var(--mono); }

h1 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 .4rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 2rem 0 .7rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; font-weight: 650; }

/* kleine Beschriftungen in Mono */
.label, th, .side-title, label, .tag, .badge, .stat dt {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
}
.brand { font-weight: 700; letter-spacing: .04em; font-size: 1.05rem; display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; }
.brand::before { content: ""; width: 14px; height: 14px; background: var(--accent); border-radius: 3px; }

/* ---- Seiten vor dem Login: zentrierte Karte ---- */
body:not(.app) { padding: 0 16px; }
body:not(.app) main { max-width: 460px; margin: 0 auto; padding: 10vh 0 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.topbar > div { display: flex; gap: .5rem; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.8rem; }

/* ---- Rahmen nach dem Login: Seitenmenü links, Inhalt rechts ---- */
.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: var(--side); display: flex; flex-direction: column; padding: 1.2rem 0; }
.sidebar .brand { padding: 0 1.2rem 1.2rem; border-bottom: 1px solid var(--line); }
.side-title { color: var(--muted); padding: 1.4rem 1.2rem .5rem; margin: 0; }
.sidebar nav { display: flex; flex-direction: column; padding: 0 .6rem; }
.sidebar nav a { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem; color: var(--text);
  text-decoration: none; border-radius: var(--r); border-left: 3px solid transparent; }
.sidebar nav a:hover { background: var(--hover); }
.sidebar nav a.current { background: var(--current); border-left-color: var(--accent); font-weight: 650; }
.sidebar nav a.service { border-left-color: transparent; }
.sidebar nav a.service:hover { border-left-color: var(--svc); }
.sidebar .grow { flex: 1; }
.sidebar .me { border-top: 1px solid var(--line); padding: 1rem 1.2rem 0; display: flex; flex-direction: column; gap: .7rem; }
.svc-name { display: flex; align-items: center; gap: .6rem; }
.svc-swatch { width: .7rem; height: .7rem; border-radius: 2px; background: var(--svc); flex: none; }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); flex: none; }
.dot.down { background: var(--down); }
.dot.unknown { background: var(--line-strong); }

.content { padding: 0 2.2rem 3rem; max-width: 1180px; width: 100%; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.bar h1 { margin: 0; }
.bar .right { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* Kennzahlenleiste, Tabellen, Zeilen */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; margin: 0; }
.stat { padding: .9rem 1.1rem; border-right: 1px solid var(--line); margin: 0; }
.stat:last-child { border-right: 0; }
.stat dt { color: var(--muted); margin-bottom: .5rem; }
.stat dd { margin: 0; font-family: var(--mono); font-size: 1.5rem; }
.stat dd.warn { color: var(--down); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: 0 1.1rem; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: .8rem .8rem .6rem 0; border-bottom: 1px solid var(--line-strong); }
td { padding: .85rem .8rem .85rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.name { font-weight: 650; }
td.name small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
td.mono { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
td.act, th.act { text-align: right; padding-right: 0; }
.rows { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--hover); }
.row b { font-weight: 650; }
.row .val { font-family: var(--mono); font-size: .85rem; color: var(--muted); text-align: right; }
.row .val.ok { color: var(--ok); }
.row .val.down { color: var(--down); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .content { padding: 0 1rem 2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
h2.first { margin-top: 0; }
.content > .card, .content > form.card { margin-bottom: 1rem; max-width: 640px; }
.side-note { padding: 0 .6rem; margin: 0; }
.table-wrap + p { margin-top: .7rem; }
