:root {
    --navy: #181831;
    --ink: #20203b;
    --muted: #706f83;
    --line: #e8e7f1;
    --line-strong: #d8d5e5;
    --paper: #fbfbfe;
    --surface: #ffffff;
    --cyan: #18bcc4;
    --blue: #5067ca;
    --purple: #9928c3;
    --green: #167653;
    --green-soft: #e7f7f0;
    --blue-soft: #eff8fb;
    --amber: #9a6411;
    --amber-soft: #fff7df;
    --red: #b3382c;
    --red-soft: #fff0ed;
    --gradient: linear-gradient(90deg, var(--cyan), #4976d5 54%, var(--purple));
    --hero-gradient: linear-gradient(120deg, rgba(232, 251, 250, .96), rgba(246, 243, 255, .98) 58%, rgba(252, 239, 255, .96));
    --shadow: 0 18px 55px rgba(45, 37, 96, .09);
    --card-shadow: 0 10px 30px rgba(44, 38, 85, .055);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 5% 0%, rgba(24, 188, 196, .08), transparent 25rem),
        radial-gradient(circle at 100% 30%, rgba(153, 40, 195, .07), transparent 28rem),
        var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ Login */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(440px, 100%); }
.login-brand { margin-bottom: 22px; text-align: center; }
.login-brand img { width: 300px; max-width: 80%; height: auto; }
.login-card {
    padding: 30px 30px 32px;
    border: 1px solid #e3e0f0;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.login-card h1 { margin: 4px 0 6px; font-size: 24px; letter-spacing: -.02em; color: var(--navy); }
.login-card .muted { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--navy); }
.login-card input {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
}
.login-card input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.eyebrow {
    margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: var(--blue);
}

/* --------------------------------------------------------------- Kopfzeile */

.topbar {
    min-height: 92px;
    padding: 10px max(20px, calc((100vw - 1240px) / 2));
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(229, 227, 239, .86);
    backdrop-filter: blur(16px);
    position: sticky; top: 0; z-index: 10;
}
.header-brand { min-width: 0; display: flex; align-items: center; gap: 24px; }
.brand { width: 300px; max-width: 46vw; }
.brand-strip { display: block; width: 100%; height: auto; }
.app-identity { padding-left: 24px; border-left: 1px solid var(--line); }
.app-identity strong, .app-identity span { display: block; }
.app-identity strong { color: var(--navy); font-size: 14px; letter-spacing: -.01em; }
.app-identity span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.logout {
    flex: 0 0 auto; padding: 9px 13px; color: var(--navy);
    border: 1px solid var(--line); border-radius: 11px; background: #fff;
    text-decoration: none; font-size: 13px; font-weight: 750;
}
.logout:hover { border-color: #a9a3c8; background: #faf9ff; }

.shell { width: min(1240px, calc(100% - 32px)); margin: 26px auto 64px; }

/* ------------------------------------------------------------------ Tabs */

.tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.tab {
    padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px;
    background: #fff; color: var(--muted); font-size: 13px; font-weight: 750; cursor: pointer;
}
.tab.is-active { color: #fff; border-color: transparent; background: var(--navy); cursor: default; }
.tab.is-soon { border-style: dashed; background: transparent; cursor: default; font-weight: 600; }

/* ------------------------------------------------------------------ Hero */

.hero {
    position: relative; overflow: hidden;
    padding: 30px 32px 32px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
    gap: 32px; align-items: end;
    color: var(--navy);
    border: 1px solid #e3e0f0; border-radius: 22px;
    background: var(--hero-gradient); box-shadow: var(--shadow);
}
.hero::after {
    content: ""; position: absolute; right: -95px; bottom: -150px;
    width: 340px; height: 340px; border: 50px solid rgba(124, 73, 201, .065);
    border-radius: 50%; pointer-events: none;
}
.hero h1 { margin: 8px 0 8px; font-size: 27px; line-height: 1.2; letter-spacing: -.025em; }
.hero p:last-child { margin: 0; max-width: 46ch; color: #4a4866; font-size: 14px; line-height: 1.55; }
.stat-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
    padding: 14px 14px 12px; border: 1px solid #e2dff1; border-radius: 15px;
    background: rgba(255, 255, 255, .82); box-shadow: var(--card-shadow);
}
.stat span { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--navy); }
.stat small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.stat.green span { color: var(--green); }
.stat.blue span { color: var(--blue); }

/* --------------------------------------------------------------- Toolbar */

.toolbar {
    margin: 22px 0 14px; display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
}
.search { flex: 1 1 260px; min-width: 220px; }
.search input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--line-strong);
    border-radius: 12px; background: #fff;
}
.search input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.toolbar-actions { display: flex; gap: 9px; }

button.primary, button.ghost {
    padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 750; cursor: pointer;
    border: 1px solid transparent;
}
button.primary { color: #fff; background: var(--navy); }
button.primary:hover { background: #2a2a52; }
button.full { width: 100%; margin-top: 22px; padding: 12px; }
button.ghost { color: var(--navy); border-color: var(--line-strong); background: #fff; }
button.ghost:hover { border-color: #a9a3c8; background: #faf9ff; }

/* ------------------------------------------------------------ Eingabeform */

.add-form {
    margin-bottom: 18px; padding: 20px 22px;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px;
    border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
    box-shadow: var(--card-shadow);
}
.add-form .field.wide { grid-column: span 2; }
.add-form label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 750; color: var(--navy); }
.add-form input, .add-form select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong);
    border-radius: 11px; background: #fff;
}
.add-form input:focus-visible, .add-form select:focus-visible {
    outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue);
}
.form-actions { grid-column: span 2; display: flex; justify-content: flex-end; gap: 9px; }

/* --------------------------------------------------------------- Tabelle */

.table-wrap {
    overflow-x: auto; border: 1px solid var(--line); border-radius: 18px;
    background: var(--surface); box-shadow: var(--card-shadow);
}
table.links { width: 100%; border-collapse: collapse; font-size: 14px; }
table.links th, table.links td {
    padding: 13px 16px; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--line);
}
table.links thead th {
    position: sticky; top: 92px; z-index: 1;
    background: #f7f6fc; color: var(--muted);
    font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    white-space: nowrap;
}
table.links tbody tr:last-child td { border-bottom: 0; }
table.links tbody tr:hover { background: #fafaff; }
.col-date, .col-time { width: 1%; white-space: nowrap; }
.col-site { width: 190px; }
.col-status { width: 110px; }
td.cell-date { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); }
td.cell-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.link-title { display: block; font-weight: 700; color: var(--navy); line-height: 1.35; }
.link-url {
    display: inline-block; margin-top: 3px; color: var(--blue);
    font-size: 12.5px; word-break: break-all; text-decoration: none;
}
.link-url:hover { text-decoration: underline; }
.link-note { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.site-chip {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    background: var(--blue-soft); color: #2c4f8a; font-size: 12px; font-weight: 700;
}
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 750;
}
.badge.online { background: var(--green-soft); color: var(--green); }
.badge.entwurf { background: var(--amber-soft); color: var(--amber); }
.badge.geplant { background: var(--blue-soft); color: var(--blue); }
.badge.offline { background: var(--red-soft); color: var(--red); }
tr.is-today td { background: linear-gradient(90deg, rgba(24, 188, 196, .07), transparent 40%); }
tr.is-today td.cell-date::after {
    content: "heute"; display: inline-block; margin-left: 7px; padding: 1px 7px;
    border-radius: 999px; background: var(--cyan); color: #06333a;
    font-size: 10.5px; font-weight: 800; letter-spacing: .03em; vertical-align: 1px;
}
tr.empty td { padding: 34px 16px; color: var(--muted); text-align: center; }
.table-foot {
    margin-top: 12px; display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
}
.table-note { margin: 0 2px; color: var(--muted); font-size: 12.5px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.page-btn {
    min-width: 36px; padding: 7px 11px; border: 1px solid var(--line-strong);
    border-radius: 10px; background: #fff; color: var(--navy);
    font-size: 13px; font-weight: 750; cursor: pointer;
}
.page-btn:hover:not(:disabled) { border-color: #a9a3c8; background: #faf9ff; }
.page-btn:disabled { color: #b6b3c8; cursor: default; }
.page-btn.is-current {
    color: #fff; border-color: transparent; background: var(--navy);
}

/* --------------------------------------------------------- Meldungen */

.alert {
    margin-bottom: 14px; padding: 11px 14px; border-radius: 12px;
    background: var(--red-soft); color: var(--red); font-size: 13.5px; font-weight: 650;
}
.alert.block { margin: 18px 0 0; }
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    padding: 11px 18px; border-radius: 12px; background: var(--navy); color: #fff;
    font-size: 13.5px; font-weight: 650; box-shadow: var(--shadow); z-index: 50;
}

@media (max-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-identity { display: none; }
    .add-form { grid-template-columns: minmax(0, 1fr); }
    .add-form .field.wide, .form-actions { grid-column: span 1; }
    table.links thead th { top: 0; }
}

.hint {
    align-self: center; color: var(--muted); font-size: 12.5px; font-weight: 650;
    padding: 9px 13px; border: 1px dashed var(--line-strong); border-radius: 12px;
}
