/*
 * Raumdatenbank – öffentlicher Bereich (/public/): Startseite und Serverraum-Abfrage.
 *
 * Optisch angelehnt an das Uni-Layout (tucal4): Uni-Grün #005f50 als Leitfarbe,
 * Helvetica/Arial, grüne Kopfleiste mit weißem Logo, graue Brotkrumenzeile.
 * Bewusst ohne Fremdbibliothek, damit die Seite schlank bleibt.
 */

:root {
    --green: #005f50;
    --green-dark: #00463b;
    --green-deep: #00342c;
    --green-soft: #e5efed;
    --green-line: #b8d3ce;
    --blue: #0075bf;
    --blue-dark: #005a93;
    --blue-soft: #e3f0f9;
    --orange: #c65306;
    --orange-soft: #fbeee4;
    --red: #9d0736;
    --red-soft: #f8e5eb;
    --ink: #1f2423;
    --ink-soft: #4d5554;
    --muted: #6f7070;
    --line: #dfe3e2;
    --page: #f3f5f4;
    --card: #ffffff;
    --radius: 14px;
    --radius-small: 8px;
    --shadow: 0 1px 2px rgba(0, 52, 44, .06), 0 6px 24px rgba(0, 52, 44, .07);
    --shadow-lift: 0 2px 4px rgba(0, 52, 44, .08), 0 18px 48px rgba(0, 52, 44, .16);
    --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --content: 1180px;
}

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

/* Das Attribut `hidden` muss auch gegen display-Regeln einzelner Klassen gewinnen. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

a { color: var(--green); }
a:hover { color: var(--green-dark); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid #f2b400; outline-offset: 2px; border-radius: 4px; }

/* --- Kopf und Fuß im Stil des Uni-Layouts --------------------------------- */

.tuc-head { background: var(--green); color: #fff; }
.tuc-head-inner {
    max-width: var(--content); margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 24px;
}
.tuc-logo img { display: block; height: 52px; width: auto; }
.tuc-site {
    color: #fff; text-decoration: none; border-left: 1px solid rgba(255, 255, 255, .35);
    padding-left: 24px; display: flex; flex-direction: column;
}
.tuc-site:hover { color: #fff; }
.tuc-site-unit { font-size: .8rem; opacity: .8; text-transform: uppercase; letter-spacing: .08em; }
.tuc-site-name { font-size: 1.35rem; font-weight: 700; }
.tuc-user {
    margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .9rem;
    background: rgba(255, 255, 255, .12); padding: 6px 14px 6px 10px; border-radius: 999px;
}
.tuc-user svg { width: 18px; height: 18px; }
a.tuc-user { color: #fff; text-decoration: none; }
a.tuc-user:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.crumbs { background: #fff; border-bottom: 1px solid var(--line); font-size: .85rem; }
.crumbs-inner { max-width: var(--content); margin: 0 auto; padding: 9px 24px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--green); text-decoration: underline; }
.crumbs a + a::before { content: "›"; margin: 0 .55em; color: var(--muted); }
.crumbs a[aria-current] { color: var(--ink); font-weight: 600; }

.tuc-foot { background: #323232; color: #d5d5d5; font-size: .85rem; margin-top: 64px; }
.tuc-foot-inner {
    max-width: var(--content); margin: 0 auto; padding: 28px 24px;
    display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: center;
}
.tuc-foot strong { color: #fff; }
.tuc-foot nav { display: flex; gap: 22px; }
.tuc-foot a { color: #fff; text-decoration: none; }
.tuc-foot a:hover { text-decoration: underline; color: #fff; }

/* --- Meldungen (Django messages) ------------------------------------------ */

/* Schwebend oben rechts: Nach dem Speichern springt die Seite an den bearbeiteten
   Abschnitt zurück, eine Meldung oben im Seitenfluss wäre dann nicht zu sehen. */
.toasts {
    position: fixed; top: 16px; right: 16px; z-index: 60; width: min(420px, calc(100vw - 32px));
    display: grid; gap: 8px;
}
.toast {
    padding: 14px 16px 14px 46px; border-radius: 12px; position: relative;
    background: #fff; color: var(--green-deep); border-left: 5px solid var(--green);
    box-shadow: var(--shadow-lift); animation: toast-in .4s ease-out; transition: opacity .4s, transform .4s;
}
.toast.leaving { opacity: 0; transform: translateX(20px); }
.toast::before {
    content: "✓"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff;
    display: grid; place-items: center; font-size: .75rem; font-weight: 700;
}
.toast-error { color: var(--red); border-left-color: var(--red); }
.toast-error::before { content: "!"; background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

/* --- Bausteine ------------------------------------------------------------ */

.container { max-width: var(--content); margin: 0 auto; padding: 32px 24px 0; }
.container.wide { max-width: 1440px; }

.card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 24px; margin-bottom: 20px;
}
.card > h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }

.eyebrow {
    margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; opacity: .85;
}
.lead { font-size: 1.1rem; max-width: 46em; }

.button {
    display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
    font: inherit; font-weight: 600; text-decoration: none; border-radius: 999px;
    padding: 11px 22px; transition: transform .15s, box-shadow .15s, background .15s;
}
.button svg { width: 18px; height: 18px; }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(0, 95, 80, .35); }
.button.primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.secondary { background: #fff; color: var(--green); box-shadow: inset 0 0 0 2px var(--green-line); }
.button.secondary:hover { box-shadow: inset 0 0 0 2px var(--green); color: var(--green-dark); }

.link-button {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0;
    color: var(--green); font: inherit; font-size: .9rem; cursor: pointer;
}
.link-button svg { width: 16px; height: 16px; }
.link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--red); }

.status-pill {
    display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .03em;
    padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.status-pill.draft { background: var(--orange-soft); color: var(--orange); }
.status-pill.submitted { background: var(--green-soft); color: var(--green); }
.status-pill.new { background: rgba(255, 255, 255, .16); color: #fff; }

.flag {
    display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 700; padding: 1px 7px;
    border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); vertical-align: 1px;
}
.flag.warn { background: var(--orange-soft); color: var(--orange); }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--card); border-radius: var(--radius); border: 2px dashed var(--line); }
.empty svg { width: 56px; height: 56px; color: var(--green-line); }

.alert { background: var(--red-soft); color: var(--red); padding: 12px 16px; border-radius: var(--radius-small); margin-bottom: 16px; }

/* --- Startseite ----------------------------------------------------------- */

.hero {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(1200px 400px at 85% -10%, #0b8a74 0%, transparent 60%),
                linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%);
    padding: 64px 24px 150px;
}
.hero-inner { position: relative; z-index: 1; max-width: var(--content); margin: 0 auto; }
.hero .lead { opacity: .92; }
.hero-grid { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(255, 255, 255, .07); }

.tiles {
    position: relative; z-index: 2; max-width: var(--content); margin: -110px auto 0; padding: 0 24px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px;
}
.tile {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lift);
    color: var(--ink); text-decoration: none;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.tile:hover { transform: translateY(-6px); color: var(--ink); box-shadow: 0 4px 8px rgba(0, 52, 44, .1), 0 30px 70px rgba(0, 52, 44, .22); }
.tile-art { height: 210px; display: grid; place-items: center; position: relative; }
.tile-art svg { width: 78%; max-width: 300px; height: auto; transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.tile:hover .tile-art svg { transform: scale(1.05); }
.tile-body { padding: 26px 30px 30px; display: flex; flex-direction: column; flex: 1; }
.tile-body h2 { font-size: 1.6rem; margin-bottom: .4em; }
.tile-body p { color: var(--ink-soft); margin: 0 0 22px; flex: 1; }
.tile-cta { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.tile-cta svg { width: 22px; height: 22px; transition: transform .25s; }
.tile:hover .tile-cta svg { transform: translateX(6px); }
.tile-badge {
    position: absolute; top: 18px; right: 18px; z-index: 1; background: #f2b400; color: #3b2c00;
    font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 12px; border-radius: 999px;
}

/* Schloss-Schild: zeigt vor dem Klick, dass eine Anmeldung nötig ist */
.tile-lock {
    position: absolute; top: 18px; left: 18px; z-index: 1;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, .85); color: var(--green-deep);
    font-size: .75rem; font-weight: 700; letter-spacing: .03em;
    padding: 4px 12px 4px 9px; border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--green-line);
}
.tile-lock svg { width: 14px; height: 14px; stroke-width: 2.4; }

/* Kachel 1: Serverrack in Uni-Grün */
.tile-server .tile-art { background: linear-gradient(150deg, #eaf3f1 0%, #cfe3df 100%); }
.tile-server .tile-cta { color: var(--green); }
.tile-server .rack { fill: #1e2b29; stroke: none; }
.tile-server .unit { fill: #2f403d; stroke: none; }
.tile-server .slot { fill: #4b5f5b; stroke: none; }
.tile-server .floor { stroke: #9cbfb8; stroke-width: 3; }
.tile-server .wave { stroke: #7fb2a8; stroke-width: 3; opacity: .8; }
.tile-server .led { fill: #2fd39a; stroke: none; animation: led 2.4s infinite; }
.tile-server .led-1 { animation-delay: .3s; }
.tile-server .led-2 { animation-delay: 1.1s; fill: #f2b400; }
.tile-server .led-3 { animation-delay: .7s; }
.tile-server .led-4 { animation-delay: 1.6s; }
.tile-server .led-5 { animation-delay: .2s; fill: #4fb3ff; }
.tile-server .led-6 { animation-delay: 1.9s; }
@keyframes led { 0%, 100% { opacity: 1; } 45% { opacity: .25; } 55% { opacity: 1; } }

/* Kachel 2: Lageplan in Uni-Blau */
.tile-map .tile-art { background: linear-gradient(150deg, #e8f2fa 0%, #cde2f2 100%); }
.tile-map .tile-cta { color: var(--blue); }
.tile-map .map { fill: #fff; stroke: #8fb9d9; }
.tile-map .fold { stroke: #cfe0ee; }
.tile-map .road { stroke: #f2b400; stroke-width: 5; opacity: .75; }
.tile-map .house { fill: #9cc4e2; stroke: none; }
.tile-map .pin path { fill: var(--blue); stroke: none; }
.tile-map .pin-dot { fill: #fff; stroke: none; }
.tile-map .pin { transform-origin: 150px 84px; animation: pin 2.8s ease-in-out infinite; }
@keyframes pin { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.why { max-width: var(--content); margin: 64px auto 0; padding: 0 24px; }
.why > h2 { font-size: 1.5rem; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 20px; }
.why-grid > div { border-top: 3px solid var(--green); padding-top: 16px; }
.why-grid p { color: var(--ink-soft); margin: 0; }
.why-icon {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--green-soft); color: var(--green); font-weight: 800; margin-bottom: 10px;
}

/* --- Band (Kopf der Unterseiten) ------------------------------------------ */

.band {
    color: #fff; padding: 44px 24px 48px;
    background: radial-gradient(900px 300px at 90% -20%, #0b8a74 0%, transparent 60%),
                linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%);
}
.band-inner { max-width: var(--content); margin: 0 auto; }
.band .lead { opacity: .92; }

.steps { list-style: none; padding: 0; margin: 22px 0 28px; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.steps li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.steps span {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: #fff; color: var(--green); font-weight: 800; font-size: .9rem;
}

/* Großes Suchfeld mit Vorschlägen */
.search {
    position: relative; display: flex; align-items: center; max-width: 760px;
    background: #fff; border-radius: 999px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); padding: 6px;
}
.search > svg { width: 24px; height: 24px; color: var(--muted); margin: 0 6px 0 16px; flex: none; }
.search input {
    flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1.15rem; padding: 12px 8px;
    background: transparent; color: var(--ink);
}
.search button {
    border: 0; border-radius: 999px; background: var(--green); color: #fff; font: inherit; font-weight: 700;
    padding: 12px 26px; cursor: pointer;
}
.search button:hover { background: var(--green-dark); }

.suggest-anchor { position: relative; }
.suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; list-style: none; margin: 0;
    padding: 6px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lift);
    max-height: 420px; overflow-y: auto; text-align: left;
}
.suggest li {
    display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.suggest li.active, .suggest li:hover { background: var(--green-soft); }
.suggest-value { font-weight: 700; color: var(--ink); }
.suggest-label { font-size: .85rem; color: var(--muted); }
.suggest-empty { color: var(--muted); padding: 10px 14px; }

/* --- Übersicht ------------------------------------------------------------ */

.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 12px 0 16px; }
.section-head h2 { font-size: 1.4rem; margin: 0; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list a {
    display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line);
    text-decoration: none; color: var(--ink);
}
.result-list a:hover strong { color: var(--green); }

.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.entry-card {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 22px;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    text-decoration: none; color: var(--ink); border-top: 5px solid var(--orange);
    transition: transform .2s, box-shadow .2s;
}
.entry-card.submitted { border-top-color: var(--green); }
.entry-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); color: var(--ink); }
.entry-card .status-pill { align-self: flex-start; margin-bottom: 6px; }
.entry-code { font-size: 1.4rem; font-weight: 800; }
.entry-desc { color: var(--ink-soft); min-height: 1.5em; }
.entry-facts { font-size: .9rem; margin-top: 8px; }
.entry-date { font-size: .8rem; color: var(--muted); }

.admin-link { margin-top: 28px; text-align: right; }

/* --- Raumseite ------------------------------------------------------------ */

.room-head {
    color: #fff; padding: 34px 24px;
    background: linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%);
}
.room-head-inner {
    max-width: 1320px; margin: 0 auto; display: flex; gap: 24px; justify-content: space-between;
    align-items: flex-end; flex-wrap: wrap;
}
.room-head h1 { margin: 0; }
.room-head h1 small { font-size: 1.1rem; font-weight: 400; opacity: .75; margin-left: 12px; }
.room-desc { margin: 6px 0 0; font-size: 1.1rem; opacity: .9; }
.room-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.room-state small { opacity: .8; }

.room-layout {
    max-width: 1320px; margin: 0 auto; padding: 28px 24px 0;
    display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: start;
}
.room-aside { position: sticky; top: 16px; }

.facts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; }

/* Türschild: neue Bezeichnung groß, alte klein – wie Phase 2 an der Tür */
.doorplate {
    background: #fff; border: 1px solid #cfd6d4; border-radius: 6px; padding: 18px 20px 16px;
    border-left: 8px solid var(--green); box-shadow: inset 0 0 0 4px #fafbfb, 0 8px 20px rgba(0, 0, 0, .06);
}
.plate-code { font-size: 1.9rem; font-weight: 800; letter-spacing: .01em; line-height: 1; }
.plate-code small { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); margin-top: 4px; }
.plate-header { margin-top: 12px; font-weight: 700; color: var(--green); font-size: .95rem; }
.plate-function { font-size: .9rem; color: var(--ink-soft); }
.doorplate ul { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.doorplate li { font-weight: 600; padding: 2px 0; }
.doorplate li small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.plate-additional { margin-top: 10px; font-size: .85rem; color: var(--ink-soft); }

/* Formular */
.survey { min-width: 0; padding-bottom: 110px; }

.progress {
    position: sticky; top: 0; z-index: 10; background: rgba(243, 245, 244, .92);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    margin: 0 -8px 16px; padding: 12px 8px 10px;
}
.progress-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar span {
    display: block; height: 100%; width: 0; border-radius: inherit;
    background: linear-gradient(90deg, var(--green), #19a58c); transition: width .4s ease;
}
.progress ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.progress a {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    font-size: .85rem; font-weight: 600; white-space: nowrap; text-decoration: none;
    color: var(--ink-soft); background: #fff; box-shadow: inset 0 0 0 1px var(--line);
}
.progress a::before {
    content: ""; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2px #b9c2c0;
}
.progress a.done::before { background: var(--green); box-shadow: none; }
.progress a.current { color: #fff; background: var(--green); box-shadow: none; }
.progress a.current::before { box-shadow: inset 0 0 0 2px #fff; }
.progress a.current.done::before { background: #fff; }

.step { scroll-margin-top: 90px; }
.step > header { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.step > header h2 { margin: 0; font-size: 1.3rem; }
.step-no {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; flex: none;
    background: var(--green-soft); color: var(--green); font-weight: 800;
}
.step.done .step-no { background: var(--green); color: #fff; }
.intro { color: var(--ink-soft); margin: 4px 0 14px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field > legend { font-weight: 600; font-size: .92rem; padding: 0; }
.field input[type=text], .field input[type=number], .field input[type=search], .field select, .field textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fbfcfc;
    border: 1.5px solid #cdd5d3; border-radius: 10px; padding: 10px 12px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 0; border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(0, 95, 80, .14);
}
.with-unit { position: relative; display: block; }
.with-unit input { padding-right: 72px; }
.with-unit .unit {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .9rem; pointer-events: none;
}
/* Keine Pfeile in Zahlenfeldern: Sie überdecken die Einheit ("Racks", "min").
   Pfeiltasten und Mausrad funktionieren weiterhin. */
.field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.field input[type=number]::-webkit-outer-spin-button,
.field input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Gesperrte Angaben, z. B. Kälteleistung bei "keine Klimatisierung" */
.field.is-off { opacity: .45; }
.field.is-off input, .field.is-off label { cursor: not-allowed; }
.help { color: var(--muted); font-size: .82rem; }
.error { color: var(--red); font-size: .85rem; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }

/* Auswahl als Kacheln: alle Optionen sichtbar, ein Klick genügt */
.choices > div { display: flex; flex-wrap: wrap; gap: 8px; }
.choices > div > div { display: contents; }
.choices label {
    position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 9px 16px 9px 38px; border-radius: 10px; background: #fff; font-size: .92rem;
    box-shadow: inset 0 0 0 1.5px #cdd5d3; transition: box-shadow .15s, background .15s, color .15s;
    user-select: none;
}
.choices label:hover { box-shadow: inset 0 0 0 1.5px var(--green); }
.choices input {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); margin: 0;
    width: 16px; height: 16px; accent-color: var(--green);
}
.choices label:has(input:checked) {
    background: var(--green-soft); color: var(--green-deep); font-weight: 600;
    box-shadow: inset 0 0 0 2px var(--green);
}
.choices.has-error label { box-shadow: inset 0 0 0 1.5px var(--red); background: var(--red-soft); }
.choices label:has(input:focus-visible) { outline: 3px solid #f2b400; outline-offset: 2px; }

/* Systemaufstellung */
.systems { display: grid; gap: 14px; }
.system-row {
    position: relative; border-radius: 12px; padding: 16px 16px 8px; background: #f8faf9;
    box-shadow: inset 0 0 0 1px var(--line); animation: row-in .25s ease-out;
}
.system-row.has-error { box-shadow: inset 0 0 0 2px var(--red); }
.system-row.removing { animation: row-out .2s ease-in forwards; }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes row-out { to { opacity: 0; transform: scale(.98); } }
/* Sieben gleich breite Spalten; breite Felder belegen zwei oder drei davon. */
.system-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px 14px; }
.system-grid > div { min-width: 0; }
.system-grid .span-2 { grid-column: span 2; }
.system-grid .span-3 { grid-column: span 3; }
.system-grid .field > label {
    font-size: .8rem; font-weight: 600; color: var(--ink-soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.system-grid input, .system-grid select { padding: 8px 10px !important; }
.system-actions { display: flex; justify-content: flex-end; gap: 18px; margin-top: 4px; }
.systems-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.systems-total { color: var(--ink-soft); font-weight: 600; }

/* Feste Aktionsleiste */
.actionbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
    padding: 12px max(24px, calc((100vw - 1320px) / 2 + 24px));
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -6px 24px rgba(0, 52, 44, .1);
}
.actionbar-hint { margin-right: auto; color: var(--muted); font-size: .9rem; }
.actionbar-hint.dirty { color: var(--orange); font-weight: 600; }

.danger-zone { padding-top: 0; text-align: right; margin-bottom: 90px; }

/* --- Auswertung ----------------------------------------------------------- */

.kpis { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.kpis > div {
    background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 12px 18px; min-width: 120px;
    display: flex; flex-direction: column;
}
.kpis strong { font-size: 1.7rem; line-height: 1.1; }
.kpis span { font-size: .85rem; opacity: .85; }
.kpis .warn { background: rgba(242, 180, 0, .25); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.segmented { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.segmented a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.segmented a[aria-current] { background: var(--green); color: #fff; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
    position: sticky; top: 0; background: #fff; text-align: left; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px; border-bottom: 2px solid var(--line);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:hover td { background: #f8faf9; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Schmale Bildschirme -------------------------------------------------- */

@media (max-width: 980px) {
    .room-layout { grid-template-columns: 1fr; }
    .room-aside { position: static; }
    .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-grid .span-2, .system-grid .span-3 { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .tuc-head-inner { padding: 12px 16px; gap: 14px; }
    .tuc-logo img { height: 40px; }
    .tuc-site { padding-left: 14px; }
    .tuc-site-name { font-size: 1.1rem; }
    .tuc-user span { display: none; }
    .crumbs-inner, .container, .toasts { padding-left: 16px; padding-right: 16px; }
    .hero { padding: 40px 16px 130px; }
    .tiles { padding: 0 16px; grid-template-columns: 1fr; }
    .band, .room-head { padding-left: 16px; padding-right: 16px; }
    .room-layout { padding: 20px 16px 0; }
    .grid { grid-template-columns: 1fr; }
    .search button { padding: 12px 16px; }
    .actionbar { padding: 10px 16px; }
    .actionbar-hint { display: none; }
    .actionbar .button { flex: 1; justify-content: center; }
}

/* --- Mitbearbeiter (Abschnitt „Zugriff“) und geteilte Meldungen ------------------ */
.people { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.person {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
    padding: 10px 14px; border-radius: 10px; background: #fbfcfc; box-shadow: inset 0 0 0 1.5px #dfe5e3;
}
.person.owner { background: var(--green-soft); box-shadow: none; }
.person.pending { box-shadow: inset 0 0 0 1.5px var(--green); }
.person-name { font-weight: 600; }
.person-meta { color: var(--muted); font-size: .85rem; }
.person-remove, .person-undo { margin-left: auto; font-size: .85rem; color: var(--muted); cursor: pointer; }
.person-remove input { margin-right: 4px; }
.shared-pill {
    align-self: flex-start; font-size: .75rem; font-weight: 600; color: var(--green);
    background: var(--green-soft); border-radius: 999px; padding: 2px 10px;
}
.shared-hint { color: var(--muted); }
.entry-people {
    display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-people svg {
    flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
}
