/* Hostflow Kundenportal — neutrales, weisses Designsystem */
:root {
  --white: #FFFFFF;
  --page: #FAFAFB;
  --ink: #17181A;
  --ink-2: #55585E;
  --muted: #8A8D93;
  --hair: #E8E9EB;
  --grid: #F1F1F3;
  --axis: #D6D7DA;
  --accent: #17181A;          /* neutral: Interaktion in Tinte */
  --focus: #2A78D6;
  --danger: #C2372F;
  --s1: #A85D14;              /* Serie 1 (validiert auf Weiss) */
  --s2: #2A78D6;              /* Serie 2 */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 24, 26, .05), 0 4px 16px rgba(23, 24, 26, .05);
}
* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  background: var(--page); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img.logo { display: block; height: 22px; width: auto; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 2rem 1.25rem;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--white);
  border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.2rem 2rem 2rem;
}
.login-card img.logo { height: 26px; margin-bottom: 1.8rem; }
.login-card h1 { font-size: 1.15rem; font-weight: 650; margin: 0 0 .3rem; letter-spacing: -.01em; }
.login-card .sub { font-size: .85rem; color: var(--muted); margin: 0 0 1.6rem; }
.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 650; margin-bottom: .35rem;
}
.field input {
  width: 100%; border: 1px solid var(--axis); border-radius: 8px;
  padding: .6rem .75rem; font-size: .95rem; background: var(--white);
}
.field input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(42, 120, 214, .15); }
.btn {
  width: 100%; background: var(--accent); color: var(--white);
  border: none; border-radius: 8px; padding: .65rem 1rem;
  font-weight: 650; font-size: .95rem; margin-top: .4rem;
}
.btn:hover { opacity: .88; }
.btn[disabled] { opacity: .5; cursor: default; }
.error { display: none; color: var(--danger); font-size: .82rem; margin: .8rem 0 0; }
.error.show { display: block; }
.login-foot { margin-top: 1.6rem; font-size: .74rem; color: var(--muted); }

/* ---------- Portal ---------- */
.topbar {
  background: var(--white); border-bottom: 1px solid var(--hair);
  position: sticky; top: 0; z-index: 5;
}
.topbar-in {
  max-width: 1040px; margin: 0 auto; padding: .8rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.topbar .client {
  margin-left: auto; text-align: right; font-size: .8rem; color: var(--ink-2);
  display: flex; align-items: center; gap: .9rem;
}
.topbar .client b { color: var(--ink); font-weight: 650; }
.btn-ghost {
  background: none; border: 1px solid var(--axis); border-radius: 7px;
  padding: .32rem .75rem; font-size: .8rem; color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); }
.shell { max-width: 1040px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page-head { margin-bottom: 1.4rem; }
.page-head .eyebrow {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; margin: 0 0 .3rem;
}
.page-head h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; border-bottom: 1px solid var(--hair); margin-bottom: 1.8rem; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: .55rem .9rem; font-size: .88rem; color: var(--ink-2); font-weight: 550;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
.kpi {
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 1rem 1.15rem 1.05rem; box-shadow: var(--shadow);
}
.kpi .lbl { display: block; font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: .3rem; }
.kpi .val { font-size: 1.55rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.kpi .val small { font-size: .8rem; font-weight: 450; color: var(--muted); }
.kpi .cap { display: block; font-size: .73rem; color: var(--muted); margin-top: .25rem; }
.kpi.lead { background: var(--ink); border-color: var(--ink); color: var(--white); }
.kpi.lead .lbl, .kpi.lead .cap, .kpi.lead .val small { color: rgba(255, 255, 255, .65); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
.card {
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.2rem; box-shadow: var(--shadow);
}
.card h2 { font-size: .92rem; font-weight: 650; margin: 0 0 .15rem; }
.card .note { font-size: .75rem; color: var(--muted); margin: 0 0 .8rem; }
.legend { display: flex; gap: 1.1rem; font-size: .74rem; color: var(--ink-2); margin-top: .5rem; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
svg text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; min-width: 540px; }
th {
  text-align: left; font-size: .63rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; padding: .5rem .7rem .5rem 0;
  border-bottom: 1px solid var(--ink);
}
td { padding: .48rem .7rem .48rem 0; border-bottom: 1px solid var(--grid); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sub td { font-weight: 650; }
tr.month td { font-weight: 650; color: var(--ink-2); padding-top: .9rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .45rem; vertical-align: 1px; }
.grand {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem;
  background: var(--ink); color: var(--white); border-radius: var(--radius);
  padding: .95rem 1.25rem; margin-bottom: 1.6rem;
}
.grand .t { font-weight: 650; font-size: .92rem; }
.grand .t small { font-weight: 400; color: rgba(255, 255, 255, .6); font-size: .74rem; }
.grand .v { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
details.bookings { background: var(--white); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 1.25rem; margin-bottom: 1.6rem; }
details.bookings summary { cursor: pointer; font-weight: 650; font-size: .9rem; padding: .95rem 0; }
details.bookings[open] summary { border-bottom: 1px solid var(--hair); margin-bottom: .4rem; }
details.bookings .tablewrap { padding-bottom: 1rem; }
.portal-foot {
  border-top: 1px solid var(--hair); padding-top: 1.1rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .74rem; color: var(--muted);
}
.empty { color: var(--muted); font-size: .9rem; padding: 3rem 0; text-align: center; }
#tip {
  position: fixed; pointer-events: none; z-index: 20; display: none;
  background: var(--ink); color: var(--white); font-size: .76rem;
  padding: .45rem .65rem; border-radius: 5px; max-width: 250px; line-height: 1.45;
}
#tip b { font-variant-numeric: tabular-nums; }
