@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #11151c;
    --surface: #1a2029;
    --surface-2: #212938;
    --line: #2b3444;
    --accent: #c98a4b;
    --accent-soft: rgba(201, 138, 75, 0.16);
    --text: #eef1f4;
    --text-muted: #8b93a5;
    --good: #5fae7b;
    --warn: #d9765a;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.eyebrow {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2rem;
    margin: 0 0 1.25rem;
}

/* ---------- Layout ---------- */

.page {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 4rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.topbar-user { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.topbar-user strong { color: var(--text); }

.topbar-nav { display: flex; gap: 1.25rem; font-family: var(--font-mono); font-size: 0.85rem; }
.topbar-nav a { color: var(--text-muted); }
.topbar-nav a:hover { color: var(--accent); }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.grid-single { grid-template-columns: 1fr; max-width: 520px; }
.table-card { grid-column: 1 / -1; }

@media (max-width: 720px) {
    .grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.75rem;
}

/* ---------- Clock ---------- */

.clock-card { display: flex; flex-direction: column; align-items: flex-start; }

.clock-display { margin: 0.5rem 0 1.5rem; }
.clock-time {
    display: block;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 3rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text);
}
[data-state="idle"] .clock-time { color: var(--text-muted); }

.clock-sub { font-size: 0.9rem; color: var(--text-muted); }

.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-clock {
    background: var(--accent);
    color: #1a1206;
    width: 100%;
    font-size: 1.05rem;
}
.btn-clock.is-running { background: var(--surface-2); color: var(--warn); border: 1px solid var(--warn); }

.btn-primary { background: var(--accent); color: #1a1206; }
.btn-danger { background: transparent; color: var(--warn); border: 1px solid var(--warn); }

.hint { min-height: 1.2em; margin: 0.85rem 0 0; font-size: 0.85rem; color: var(--good); }
.hint-small { margin: 0.75rem 0 0; font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.hint-inline { font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }

/* ---------- Wochenrad (Signature-Element) ---------- */

.dial-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.dial { width: 100%; max-width: 320px; height: auto; margin-top: 0.25rem; }

.dial-track { stroke: var(--surface-2); stroke-width: 10; stroke-linecap: round; }
.dial-fill {
    stroke: var(--accent);
    stroke-width: 10;
    stroke-linecap: round;
    transition: d 0.6s ease;
}
.dial-target-mark { fill: var(--bg); stroke: var(--text-muted); stroke-width: 2; }
.tick { stroke: var(--line); stroke-width: 1.5; }
.tick-major { stroke: var(--text-muted); stroke-width: 2; }

.dial-number {
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 600;
    fill: var(--text);
}
.dial-unit { font-family: var(--font-mono); font-size: 0.75rem; fill: var(--text-muted); }

.dial-status { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--warn); }
.dial-status.is-good { color: var(--good); }

/* ---------- Tabellen ---------- */

.entries { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 0.5rem; }
.entries th {
    text-align: left;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--line);
}
.entries td {
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.entries tr:last-child td { border-bottom: none; }
.edit-link { font-family: var(--font-body); font-size: 0.82rem; }
.badge-running { color: var(--accent); font-family: var(--font-body); font-size: 0.8rem; }
.empty { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Formulare ---------- */

.stack { display: flex; flex-direction: column; gap: 1rem; }
.field-row { display: flex; gap: 1rem; }
.field-row label { flex: 1; }

label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="number"] {
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
    color: var(--text);
    font-size: 0.95rem;
}
input:focus { border-color: var(--accent); }

.form-actions { display: flex; gap: 0.75rem; margin-top: 0.25rem; }

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

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 2.25rem;
    width: 100%;
    max-width: 380px;
}

.notice { padding: 0.75rem 0.9rem; border-radius: 8px; font-size: 0.85rem; margin: 0 0 1rem; }
.notice-warn { background: rgba(217, 118, 90, 0.12); color: var(--warn); border: 1px solid rgba(217, 118, 90, 0.3); }
.notice-good { background: rgba(95, 174, 123, 0.12); color: var(--good); border: 1px solid rgba(95, 174, 123, 0.3); }
