/* ==============================
   Gesundheitsdashboard – Styles
   ============================== */

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

:root {
    --bg:       #0f1117;
    --bg2:      #1a1d27;
    --bg3:      #22263a;
    --accent:   #4f8ef7;
    --accent2:  #7c5cfc;
    --text:     #e8eaf0;
    --text2:    #8890a8;
    --ok:       #3ecf8e;
    --warn:     #f7914f;
    --danger:   #f74f4f;
    --border:   #2d3150;
    --radius:   10px;
    --shadow:   0 2px 16px rgba(0,0,0,.4);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 56px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
header span { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
nav { display: flex; gap: 1.2rem; }
nav a {
    color: var(--text2);
    text-decoration: none;
    font-size: .9rem;
    padding: .3rem .7rem;
    border-radius: 6px;
    transition: background .2s, color .2s;
}
nav a:hover { background: var(--bg3); color: var(--text); }

/* Main */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--text2); }

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow);
}
.card-label { font-size: .8rem; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
.card-value { font-size: 1.8rem; font-weight: 700; }
.card-sub { font-size: .8rem; color: var(--text2); margin-top: .2rem; }
.val-high { color: var(--danger); }

/* Charts */
.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.chart-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg2);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
th {
    background: var(--bg3);
    color: var(--text2);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .7rem 1rem;
    text-align: left;
}
td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
tr:last-child td { border-bottom: none; }
.row-auffaellig td { color: var(--warn); }
.blut-section { margin-top: 2rem; }

/* Alerts */
.alert {
    padding: .8rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    font-size: .9rem;
}
.alert-ok    { background: #1a3d2e; border: 1px solid var(--ok);    color: var(--ok); }
.alert-error { background: #3d1a1a; border: 1px solid var(--danger); color: var(--danger); }

/* Forms */
.form-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 480px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .88rem;
    color: var(--text2);
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"] {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: .55rem .8rem;
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}
input:focus { border-color: var(--accent); }

button[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: .65rem 1.4rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: opacity .2s;
}
button[type="submit"]:hover { opacity: .85; }

/* Tabs */
.tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.2rem;
}
.tab-btn {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 7px;
    padding: .45rem 1.1rem;
    font-size: .9rem;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Param pills */
.param-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.pill {
    text-decoration: none;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 20px;
    padding: .3rem .85rem;
    font-size: .82rem;
    transition: background .2s, color .2s;
}
.pill:hover { background: var(--bg3); color: var(--text); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.login-box h1 { text-align: center; font-size: 1.4rem; }
.login-box form { display: flex; flex-direction: column; gap: 1rem; }
.login-box button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: .65rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.login-box button:hover { opacity: .85; }

/* Responsive */
@media (max-width: 600px) {
    .charts { grid-template-columns: 1fr; }
    header { padding: 0 1rem; }
    main { padding: 1.2rem 1rem 3rem; }
}

/* ── Akkordeon ── */
.accordion { margin-bottom: .5rem; }
.accordion-btn {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: .85rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-size: .95rem;
    text-align: left;
    transition: background .15s;
}
.accordion-btn:hover { background: var(--bg3); }
.acc-meta { margin-left: auto; color: var(--text2); font-size: .82rem; display: flex; align-items: center; gap: .6rem; }
.acc-arrow { color: var(--text2); font-size: .9rem; transition: transform .2s; }
.accordion-btn[aria-expanded="true"] .acc-arrow { transform: rotate(90deg); }
.accordion-panel { padding: .5rem 0 1rem; }
.badge-warn {
    background: #3d2a0a;
    border: 1px solid var(--warn);
    color: var(--warn);
    border-radius: 20px;
    padding: .15rem .6rem;
    font-size: .75rem;
}

/* ── Chart header mit Dropdown ── */
.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .8rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.chart-select {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: .3rem .6rem;
    font-size: .82rem;
    cursor: pointer;
    max-width: 220px;
}

/* ── Import ── */
.import-hint {
    background: var(--bg3);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: .8rem 1rem;
    margin-bottom: 1.2rem;
    font-size: .88rem;
    color: var(--text2);
    line-height: 1.6;
}
.pdf-status {
    font-size: .88rem;
    color: var(--text2);
    min-height: 1.4rem;
}
.pdf-status.ok { color: var(--ok); }
