/* =====================================================================
   Lernraum-Buchung – zentrales Stylesheet (Premium-Design-System)
   Ruhig, hochwertig, near-black als Primärton, Blau nur als feiner Akzent.
   Eine Datei fuer das gesamte Erscheinungsbild (DRY), via kopf.jspf.
   ===================================================================== */

:root {
    --bg:        #f6f7f9;
    --surface:   #ffffff;
    --ink:       #0b1220;   /* fast schwarz – Text & Primaerelemente */
    --ink-2:     #3d4757;
    --muted:     #6b7686;
    --border:    #ecedf1;
    --border-2:  #dcdfe6;
    --accent:    #2563eb;    /* Blau – sparsam als Akzent */
    --accent-d:  #1d4ed8;
    --accent-sf: #eff4ff;
    --ok-bg:#edfcf3; --ok-ink:#067a53; --ok-bd:#b6ebd0;
    --err-bg:#fef2f2; --err-ink:#b42318; --err-bd:#fecdca;
    --sh-sm: 0 1px 2px rgba(16,24,40,.05);
    --sh:    0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
    --sh-lg: 0 16px 40px -12px rgba(16,24,40,.18), 0 6px 16px -8px rgba(16,24,40,.10);
    --r-sm: 8px; --r: 12px; --r-lg: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink); background: var(--bg);
    line-height: 1.6; font-size: 15px;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: #cfe0ff; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.75rem; }

/* ---------- Topbar (hell, luftig) ---------- */
.topbar { background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink);
    text-decoration: none; font-weight: 650; font-size: 1rem; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px;
    border-radius: 8px; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.mainnav { display: flex; gap: .05rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.mainnav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500;
    padding: .45rem .7rem; border-radius: var(--r-sm); transition: color .15s, background .15s; }
.mainnav a:hover { color: var(--ink); }
.mainnav a.active { color: var(--ink); background: #f1f3f6; }
.mainnav a.nav-cta { background: var(--ink); color: #fff; font-weight: 550; margin-left: .4rem;
    box-shadow: var(--sh-sm); }
.mainnav a.nav-cta:hover { background: #1e2635; color: #fff; }
.nav-sep { width: 1px; height: 22px; background: var(--border-2); margin: 0 .45rem; }
.nav-user { color: var(--ink-2); font-size: .88rem; padding: .45rem .3rem .45rem .6rem; font-weight: 550; }
.mainnav a.nav-logout { color: var(--muted); }
.mainnav a.nav-logout:hover { color: var(--ink); }

/* ---------- Layout ---------- */
main.container { padding-top: 2.75rem; padding-bottom: 4rem; }
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { margin: 0 0 .35rem; font-size: 1.65rem; font-weight: 700; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh); padding: 1.4rem; }
.card-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* ---------- Tabellen ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: .93rem; }
table.data th, table.data td { padding: .85rem 1.15rem; text-align: left; }
table.data thead th { background: #fbfbfc; color: var(--muted); font-size: .73rem;
    text-transform: uppercase; letter-spacing: .06em; font-weight: 600; border-bottom: 1px solid var(--border); }
table.data tbody tr { border-bottom: 1px solid var(--border); }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data td { color: var(--ink-2); }
.leer { color: var(--muted); font-style: italic; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .2rem .6rem;
    border-radius: 6px; white-space: nowrap; letter-spacing: .01em; }
.badge.admin   { background: #fdf2e3; color: #9a5b09; }
.badge.student { background: var(--accent-sf); color: #1e40af; }
.badge.equip   { background: #f4f5f7; color: #3d4757; border: 1px solid var(--border); margin: .1rem .15rem 0 0; font-weight: 500; }
.badge.soft    { background: #f4f5f7; color: #4a5464; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent;
    cursor: pointer; text-decoration: none; font-size: .9rem; font-weight: 550; padding: .6rem 1.15rem;
    border-radius: var(--r-sm); transition: background .15s, border-color .15s, color .15s, transform .05s;
    letter-spacing: .005em; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: #1e2635; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border-2); }
.btn-ghost:hover { background: #fafbfc; border-color: #c3c9d3; }
.btn-danger-sm { background: #fff; color: #b42318; border: 1px solid var(--border-2);
    font-size: .82rem; font-weight: 600; padding: .35rem .75rem; border-radius: 7px; cursor: pointer; transition: .15s; }
.btn-danger-sm:hover { background: #fef2f2; border-color: #fda29b; }

/* ---------- Formulare ---------- */
form.stack { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh); padding: 1.6rem; max-width: 480px; }
form.stack label { display: block; margin: 1rem 0 .4rem; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
form.stack label:first-child { margin-top: 0; }
form.stack select, form.stack input { width: 100%; padding: .62rem .8rem; font-size: .95rem; color: var(--ink);
    border: 1px solid var(--border-2); border-radius: var(--r-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
form.stack select:focus, form.stack input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(37,99,235,.13); }
.form-actions { margin-top: 1.5rem; display: flex; gap: .6rem; align-items: center; }
.readonly-field { padding: .62rem .8rem; border: 1px solid var(--border); border-radius: var(--r-sm);
    background: #f8f9fb; color: var(--ink-2); font-weight: 550; }

/* ---------- Alerts ---------- */
.alert { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1.35rem; font-weight: 500;
    font-size: .92rem; border: 1px solid transparent; }
.alert.success { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-bd); }
.alert.error   { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-bd); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.count-pill { color: var(--muted); font-size: .88rem; }

/* ---------- Hero (Startseite) ---------- */
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 3.5rem 3rem; box-shadow: var(--sh); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0;
    background: radial-gradient(120% 120% at 100% 0%, rgba(37,99,235,.06), transparent 45%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; position: relative; }
.hero-copy { min-width: 0; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; margin: 0 0 1.1rem; }
.hero h1 { margin: 0 0 1rem; font-size: 2.7rem; font-weight: 730; letter-spacing: -.04em; line-height: 1.06; color: var(--ink); }
.hero .lead { margin: 0 0 2rem; color: var(--muted); font-size: 1.12rem; max-width: 46ch; line-height: 1.6; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Hero-Mockup (angedeutete App-Vorschau) */
.hero-visual { position: relative; }
.mock { background: #fff; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-lg);
    padding: 1rem 1.1rem 1.2rem; }
.mock-head { display: flex; align-items: center; gap: .4rem; padding-bottom: .85rem; margin-bottom: .5rem;
    border-bottom: 1px solid var(--border); }
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: #e2e5ea; }
.mock-title { margin-left: .5rem; font-size: .8rem; font-weight: 650; color: var(--ink-2); letter-spacing: -.01em; }
.mock-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem;
    padding: .6rem .2rem; border-bottom: 1px solid var(--border); font-size: .84rem; }
.mock-row:last-child { border-bottom: none; }
.mock-row .mock-badge { background: #f4f5f7; color: #3d4757; font-size: .72rem; font-weight: 600;
    padding: .15rem .5rem; border-radius: 6px; }
.mock-row .mock-time { color: var(--muted); font-size: .78rem; }
.mock-row.mock-new { color: var(--accent); font-weight: 600; margin-top: .3rem; }

/* ---------- Sektionen ---------- */
.section { margin-top: 4.5rem; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { margin: 0 0 .35rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); }

/* ---------- Nummerierte Schritte ---------- */
.steps-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); }
.step .num { display: block; font-size: 2.3rem; font-weight: 780; color: var(--border-2);
    letter-spacing: -.04em; line-height: 1; margin-bottom: .7rem; }
.step h3 { margin: 0 0 .45rem; font-size: 1.1rem; font-weight: 660; letter-spacing: -.015em; }
.step p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.6; }

/* ---------- Highlight-Karten ---------- */
.feature-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    padding: 1.65rem; box-shadow: var(--sh); transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-sf);
    color: var(--accent); display: grid; place-items: center; margin-bottom: 1rem; }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 .4rem; font-size: 1.03rem; font-weight: 660; letter-spacing: -.015em; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }

/* ---------- Room-Card ---------- */
.room-card { display: flex; flex-direction: column; gap: .8rem; transition: transform .18s ease, box-shadow .18s ease; }
.room-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.room-card .room-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.room-card h3 { margin: 0; font-size: 1.1rem; font-weight: 660; letter-spacing: -.015em; }
.room-card .cap { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.room-card .equip { display: flex; flex-wrap: wrap; gap: .25rem; min-height: 1.6rem; }
.room-card .room-actions { margin-top: auto; padding-top: .4rem; }

/* ---------- Admin-Steuerelemente ---------- */
.badge.removable { display: inline-flex; align-items: center; gap: .3rem; padding-right: .35rem; }
.badge-x { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 1rem;
    line-height: 1; padding: 0 .1rem; opacity: .5; transition: opacity .15s; }
.badge-x:hover { opacity: 1; }
.inline-add { display: flex; gap: .4rem; margin-top: .1rem; }
.inline-add input { flex: 1; padding: .48rem .68rem; border: 1px solid var(--border-2); border-radius: var(--r-sm); font-size: .88rem; }
.inline-add input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.13); }
.btn-sm { font-size: .84rem; padding: .48rem .8rem; border-radius: var(--r-sm); white-space: nowrap; }
.admin-form-row { display: flex; gap: .9rem; align-items: flex-end; flex-wrap: wrap; }
.admin-form-row .field { display: flex; flex-direction: column; gap: .35rem; }
.admin-form-row .field label { font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.admin-form-row .field input { padding: .58rem .75rem; border: 1px solid var(--border-2); border-radius: var(--r-sm); font-size: .95rem; }
.admin-form-row .field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.13); }
.section-title { margin: 2.25rem 0 1.1rem; font-size: 1.08rem; font-weight: 680; letter-spacing: -.02em; }

/* ---------- KPI-Kacheln (Dashboard) ---------- */
.kpi-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(175px,1fr)); margin-bottom: 1.9rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--sh); padding: 1.35rem 1.45rem; position: relative; }
.kpi::before { content: ""; position: absolute; left: 0; top: 1.35rem; bottom: 1.35rem; width: 3px;
    border-radius: 3px; background: var(--accent); }
.kpi .num { font-size: 2rem; font-weight: 740; letter-spacing: -.035em; line-height: 1.05; }
.kpi .label { color: var(--muted); font-size: .77rem; text-transform: uppercase; letter-spacing: .07em; margin-top: .35rem; }

/* ---------- Balkendiagramm ---------- */
.bars { display: flex; flex-direction: column; gap: 1rem; }
.bar-row { display: grid; grid-template-columns: 145px 1fr auto; align-items: center; gap: 1rem; }
.bar-row .bar-label { font-weight: 600; font-size: .9rem; }
.bar-track { background: #eef0f4; border-radius: 6px; height: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2563eb, #1d4ed8); min-width: 2px; transition: width .4s ease; }
.bar-row .bar-val { color: var(--muted); font-size: .85rem; white-space: nowrap; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 100px 1fr; } .bar-row .bar-val { grid-column: 2; } }

/* ---------- Auth (Login) ---------- */
.auth { max-width: 420px; margin: 2rem auto; }
.auth .stack { max-width: none; }
.auth code { background: #f4f5f7; padding: .13rem .42rem; border-radius: 5px; font-size: .85em;
    color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; padding: 2rem 0; margin-top: 1.5rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

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

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
    .hero-visual { display: none; }
    .hero { padding: 2.75rem 1.75rem; }
    .hero h1 { font-size: 2.1rem; }
}
@media (max-width: 560px) {
    .topbar-inner { min-height: 0; padding: .6rem 0; }
    .mainnav { margin-left: 0; width: 100%; }
    .nav-sep { display: none; }
}
