/* =========================================================
   4smile Campus – Designsprache (CRM-Palette)
   Navy-Sidebar + warmer Canvas, chunky Pill-Buttons,
   Einsatzreife-Ampel, KPI-Kacheln, Kompetenzmatrix.
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --brand-50:  #f8f5f3;
    --brand-100: #f2dfdc;
    --brand-200: #ecc9c3;
    --brand-300: #d8ecec;
    --brand-400: #b4ddde;
    --brand-500: #b5c4db;
    --brand-600: #627596;
    --brand-700: #2d4267;
    --brand-800: #192946;
    --brand-900: #121f36;

    --accent: #ecc9c3;
    --mint:   #b4ddde;
    --steel:  #b5c4db;
    --canvas: #fffdfa;
    --ink:    #1d1d1b;

    --line:   #e9e2df;
    --shadow: 0 4px 20px rgba(25, 41, 70, .06);
    --shadow-nav: 0 20px 60px rgba(25, 41, 70, .14);

    --gruen:   #2f6b57;  --gruen-bg:  #e7f1ec;
    --gelb:    #8a6425;  --gelb-bg:   #f6efe0;
    --rot:     #a63f3f;  --rot-bg:    #f8e8e6;

    --ok:      #2f6b57;  --ok-bg:     #e7f1ec;
    --danger:  #a63f3f;  --danger-bg: #f8e8e6;
    --warn:    #8a6425;  --warn-bg:   #f6efe0;
    --info:    #2d4267;  --info-bg:   #e6ecf5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-700); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; }

/* ---------- Kopfleiste ---------- */
.navtoggle { display: none; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px 2px; }
.app-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--brand-600); }
.nav-burger { display: none; font-size: 20px; cursor: pointer; line-height: 1; border: 2px solid var(--brand-800); border-radius: 14px; padding: 5px 11px; background: #fff; }

/* ---------- Rumpf: Sidebar + Inhalt ---------- */
.shell { display: flex; align-items: flex-start; gap: 22px; padding: 8px 26px 40px; }

.sidebar {
    width: 258px; flex: none;
    background: var(--brand-800); color: #fff;
    border-radius: 24px; box-shadow: var(--shadow-nav);
    padding: 14px; position: sticky; top: 14px;
    max-height: calc(100vh - 28px); overflow-y: auto; z-index: 20;
    display: flex; flex-direction: column;
}
.logo-box { background: #fff; border-radius: 18px; padding: 14px; display: flex; justify-content: center; margin-bottom: 8px; }
.logo-box img { width: 100%; max-width: 150px; height: auto; display: block; }
.app-tag {
    text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .28em;
    text-transform: uppercase; color: var(--mint); margin-bottom: 14px;
}
.app-tag--dark { color: var(--brand-600); margin-top: 4px; }

.mainnav { display: flex; flex-direction: column; gap: 5px; }
.mainnav a {
    display: block; border-radius: 999px; border: 1.5px solid transparent;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.92);
    padding: 9px 15px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.mainnav a:hover { background: var(--accent); color: var(--brand-800); text-decoration: none; }
.mainnav a.aktiv { background: var(--mint); color: var(--brand-800); border-color: var(--brand-400); }
.nav-overlay { display: none; }

.nav-group { margin-top: 2px; }
.nav-group > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 999px; border: 1.5px solid transparent;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.92);
    padding: 9px 15px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▸'; font-size: 10px; opacity: .7; transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(90deg); }
.nav-group > summary:hover { background: var(--accent); color: var(--brand-800); }
.nav-sub { display: flex; flex-direction: column; gap: 4px; margin: 5px 0 2px 10px; padding-left: 8px; border-left: 2px solid rgba(255,255,255,.12); }
.nav-sub a {
    display: block; border-radius: 999px; background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.88); padding: 8px 13px; font-size: 10.5px;
    font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.nav-sub a:hover { background: var(--accent); color: var(--brand-800); text-decoration: none; }
.nav-sub a.aktiv { background: var(--mint); color: var(--brand-800); }

.session-card { margin-top: 16px; padding: 13px 14px; border-radius: 18px; background: rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 10px; }
.session-card .uname { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; font-weight: 700; color: #fff; }
.session-card .uname small { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: rgba(255,255,255,.6); }
.logout {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 14px; border-radius: 999px;
    border: 1.5px solid var(--brand-400); background: var(--mint); color: var(--brand-800);
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.logout:hover { background: var(--brand-300); text-decoration: none; }

.content { flex: 1; min-width: 0; max-width: 1200px; }
.seitentitel {
    display: inline-block; margin: 0 0 18px;
    background: var(--accent); color: var(--brand-800);
    padding: 5px 12px; border-radius: 6px;
    font-size: 22px; font-weight: 700; line-height: 1.15;
}
.site-footer { color: var(--brand-600); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; padding: 22px 0 4px; }

/* ---------- Karten ---------- */
.card {
    border: 1px solid var(--line); border-radius: 16px; background: #fff;
    box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-700); }
.card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--brand-700); }
.card.schmal { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.hervorgehoben { border-color: var(--brand-400); box-shadow: var(--shadow), 0 0 0 3px rgba(180,221,222,.5); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.hint { color: var(--brand-600); font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 42px; padding: 0 18px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid transparent; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; transition: background .12s, border-color .12s;
    font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }
.btn-primary:hover:not(:disabled) { background: var(--brand-300); }
.btn-secondary { background: var(--accent); border-color: var(--brand-800); color: var(--brand-800); }
.btn-secondary:hover:not(:disabled) { background: var(--brand-100); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--brand-700); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 10px; }
.btn-block { width: 100%; }

/* ---------- Formulare ---------- */
label { display: block; margin: 11px 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-600); }
label.check { display: flex; align-items: center; gap: 9px; text-transform: none; letter-spacing: normal; font-size: 13.5px; font-weight: 500; color: var(--ink); margin: 7px 0; }
label.check input { width: auto; margin: 0; }
input, select, textarea {
    display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
    border: 1.5px solid var(--brand-800); border-radius: 12px; background: #fff;
    font-family: inherit; font-size: 14px; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-300); }
input:disabled { background: var(--brand-50); color: var(--brand-600); border-color: var(--line); }
textarea { min-height: 90px; resize: vertical; }
.form-actions { margin-top: 16px; }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-input { width: auto; min-width: 220px; margin-top: 0; flex: 1; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; margin: 8px 0 14px; }

/* ---------- Flash ---------- */
.flash { padding: 11px 15px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-fehler { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: var(--info-bg); color: var(--info); }

/* ---------- Badges ---------- */
.badge { display: inline-block; border-radius: 999px; background: var(--brand-50); border: 1px solid var(--line); padding: 3px 10px; font-size: 10.5px; font-weight: 700; color: var(--brand-700); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-inv-non { background: var(--gruen-bg); color: var(--gruen); border-color: transparent; }
.badge-inv-mini { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-inv-inv { background: var(--rot-bg); color: var(--rot); border-color: transparent; }

/* ---------- Ampel ---------- */
.ampel { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: middle; margin-right: 6px; border: 1.5px solid rgba(0,0,0,.08); }
.ampel-gruen { background: #3f9d6f; }
.ampel-gelb  { background: #e0b040; }
.ampel-rot   { background: #cf6a5f; }

/* ---------- KPI-Kacheln ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; border-left: 5px solid var(--brand-500); }
.kpi-gruen { border-left-color: #3f9d6f; }
.kpi-gelb  { border-left-color: #e0b040; }
.kpi-rot   { border-left-color: #cf6a5f; }
.kpi-wert { font-size: 32px; font-weight: 700; color: var(--brand-800); line-height: 1; }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-700); margin-top: 6px; }
.kpi-sub { font-size: 11px; color: var(--brand-600); margin-top: 2px; }

/* ---------- Baustein-Liste ---------- */
.baustein-liste { list-style: none; margin: 0; padding: 0; }
.baustein-liste li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--brand-50); flex-wrap: wrap; }
.baustein-liste li:last-child { border-bottom: none; }
.baustein-liste .meta { margin-left: auto; font-size: 11px; color: var(--brand-600); }

/* ---------- Tabellen ---------- */
table.liste, table.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
table.liste thead th {
    background: var(--brand-800); color: #fff; text-align: left; padding: 9px 10px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 2px solid var(--accent);
}
table.liste thead th:first-child { border-top-left-radius: 10px; }
table.liste thead th:last-child { border-top-right-radius: 10px; }
table.liste tbody td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.liste tbody tr:nth-child(even) { background: var(--brand-50); }

/* ---------- Kompetenzmatrix ---------- */
.matrix-scroll { overflow-x: auto; }
table.matrix { font-size: 12px; }
table.matrix th, table.matrix td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line); }
table.matrix thead th { background: var(--brand-800); color: #fff; position: sticky; top: 0; border-bottom: 2px solid var(--accent); }
.matrix-name { text-align: left !important; min-width: 170px; position: sticky; left: 0; background: #fff; z-index: 2; }
thead .matrix-name { background: var(--brand-800); z-index: 3; }
.matrix-name a { display: block; }
.matrix-name small { display: block; font-size: 10px; color: var(--brand-600); font-weight: 500; }
.matrix-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: .02em; }
.matrix-col { height: 90px; }
.matrix-cell { width: 30px; }
.matrix-cell .ampel { margin: 0; }
.matrix-bilanz { white-space: nowrap; }
.mini { display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 6px; font-size: 11px; font-weight: 700; margin-right: 2px; }
.mini.gruen { background: var(--gruen-bg); color: var(--gruen); }
.mini.gelb  { background: var(--gelb-bg);  color: var(--gelb); }
.mini.rot   { background: var(--rot-bg);   color: var(--rot); }

/* ---------- Detail-Kopf ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.eyebrow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--brand-600); }
.detail-titel { margin: 4px 0 8px; font-size: 26px; font-weight: 700; color: var(--brand-800); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inhalt { font-size: 14.5px; }
.inhalt ul { padding-left: 20px; }
.inhalt h2, .inhalt h3 { text-transform: none; letter-spacing: normal; color: var(--ink); }

/* ---------- Stand / Ampel-Karte ---------- */
.ampel-card-gruen { border-color: #3f9d6f; }
.ampel-card-gelb  { border-color: #e0b040; }
.ampel-card-rot   { border-color: #cf6a5f; }
.stand-ampel { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 12px; }
.stand-ampel .ampel { width: 16px; height: 16px; }
.stand-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 13.5px; }
.stand-dl dt { font-weight: 700; color: var(--brand-600); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; align-self: center; }
.stand-dl dd { margin: 0; }
.stand-dl-inline { grid-template-columns: repeat(3, auto); gap: 4px 24px; }
.stand-aktion { border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- Test ---------- */
.testform .frage-card { border-left: 4px solid var(--brand-400); }
.frage-titel { font-weight: 700; margin: 0 0 10px; font-size: 14.5px; }
.antwort-opt { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: normal; font-weight: 500; font-size: 14px; color: var(--ink); margin: 6px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.antwort-opt:hover { background: var(--brand-50); }
.antwort-opt input { width: auto; margin: 0; }
.result { display: flex; align-items: center; gap: 20px; }
.result-score { font-size: 44px; font-weight: 700; color: var(--brand-800); }
.result-ok { border-color: #3f9d6f; background: var(--gruen-bg); }
.result-fail { border-color: #cf6a5f; background: var(--rot-bg); }
.aufloesung { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.aufloesung.a-ok { background: var(--gruen-bg); }
.aufloesung.a-fail { background: var(--rot-bg); }
.af-frage { font-weight: 700; margin: 0 0 8px; }
.af-antw { list-style: none; margin: 0; padding: 0; }
.af-antw li { padding: 4px 8px; border-radius: 8px; font-size: 13.5px; }
.af-antw li.korrekt { background: rgba(63,157,111,.18); font-weight: 600; }
.af-antw li.falsch { background: rgba(207,106,95,.18); text-decoration: line-through; }
.af-antw .mark { font-weight: 700; }
.af-erkl { margin: 8px 0 0; font-size: 13px; color: var(--brand-700); }

/* ---------- Ampel-Spalten (Einsatzreife) ---------- */
.ampel-spalten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ampel-spalte h3 { display: flex; align-items: center; gap: 6px; }
.ampel-spalte .count { margin-left: auto; background: var(--brand-50); border-radius: 8px; padding: 1px 8px; font-size: 13px; }
.ampel-spalte-gruen { border-top: 4px solid #3f9d6f; }
.ampel-spalte-gelb  { border-top: 4px solid #e0b040; }
.ampel-spalte-rot   { border-top: 4px solid #cf6a5f; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; background: var(--brand-50); border: 1px solid var(--line); }
.chip-gruen { background: var(--gruen-bg); color: var(--gruen); border-color: transparent; }
.person-karte .card-head { margin-bottom: 10px; }
.bilanz-mini { white-space: nowrap; }

/* ---------- Admin-Fragen / Log ---------- */
.frage-admin { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.antwort-zeile { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.antwort-zeile .check { margin: 0; }
.antwort-zeile input[type=text] { margin-top: 0; }
.log-liste { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log-liste li { padding: 6px 0; border-bottom: 1px solid var(--brand-50); color: var(--brand-700); }

/* ---------- Filterleiste ---------- */
.filterbar { padding: 12px 18px; }
.filterform { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filterform label { margin: 0; }
.filterform select { margin-top: 4px; }
.legende { margin-left: auto; font-size: 11.5px; color: var(--brand-600); display: flex; align-items: center; gap: 4px; }
.legende .ampel { margin: 0 2px 0 10px; }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-wrap { width: 100%; max-width: 380px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-nav); padding: 28px 26px; }
.login-card h1 { text-align: center; font-size: 22px; color: var(--brand-800); margin: 6px 0 18px; }
.login-hint { text-align: center; font-size: 11.5px; color: var(--brand-600); margin-top: 14px; }
.login-card .logo-box { background: var(--brand-800); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .grid-2, .ampel-spalten { grid-template-columns: 1fr; }
    .nav-burger { display: inline-block; }
    .shell { padding: 8px 14px 40px; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 270px; border-radius: 0 24px 24px 0;
        transform: translateX(-100%); transition: transform .2s;
    }
    .navtoggle:checked ~ .shell .sidebar { transform: translateX(0); }
    .navtoggle:checked ~ .shell .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 15; }

    /* Tabelle → Karten (außer Matrix, die scrollt). */
    table.liste thead { display: none; }
    table.liste, table.liste tbody, table.liste tr, table.liste td { display: block; width: 100%; }
    table.liste tr { border: 1px solid var(--brand-800); border-radius: 14px; margin-bottom: 10px; padding: 6px 10px; background: #fff; }
    table.liste tbody tr:nth-child(even) { background: #fff; }
    table.liste td { border: none; display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
    table.liste td::before { content: attr(data-label); font-weight: 700; color: var(--brand-600); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
}

/* =========================================================
   4smile Flow – Projektmanagement (Gantt, Fortschritt, Projekte)
   ========================================================= */

/* Aktiver Verwaltungs-Parent in der Sidebar */
.nav-parent.aktiv { background: var(--mint); color: var(--brand-800); }

.tar { text-align: right; white-space: nowrap; }
h2.abschnitt { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-700); margin: 22px 0 10px; }

/* ---------- Fortschrittsbalken ---------- */
.fortschritt { height: 9px; border-radius: 999px; background: var(--brand-100); overflow: hidden; min-width: 90px; }
.fortschritt-fill { height: 100%; background: linear-gradient(90deg, var(--brand-600), var(--brand-400)); border-radius: 999px; }
.fortschritt-sm { height: 7px; min-width: 70px; display: inline-block; width: 90px; vertical-align: middle; }

/* ---------- Projektliste (Dashboard) ---------- */
.proj-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.proj-liste { display: flex; flex-direction: column; gap: 10px; }
.proj-item {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    border: 1px solid var(--line); border-radius: 16px; background: #fff;
    color: inherit; font-weight: 400; transition: border-color .12s, box-shadow .12s;
}
.proj-item:hover { border-color: var(--brand-400); box-shadow: var(--shadow); text-decoration: none; }
.proj-farbe { width: 6px; align-self: stretch; border-radius: 6px; flex: none; }
.proj-main { flex: 1; min-width: 0; }
.proj-titel { font-size: 15px; font-weight: 700; color: var(--brand-800); margin-bottom: 3px; }
.proj-meta { font-size: 12px; color: var(--brand-600); margin-bottom: 8px; }
.proj-prozent { font-size: 20px; font-weight: 700; color: var(--brand-700); flex: none; min-width: 56px; text-align: right; }

/* ---------- Statusbadges ---------- */
.badge-status-aktiv        { background: var(--mint); color: var(--brand-800); border-color: transparent; }
.badge-status-geplant      { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge-status-pausiert     { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-status-abgeschlossen{ background: var(--gruen-bg); color: var(--gruen); border-color: transparent; }
.badge-ok { background: var(--gruen-bg); color: var(--gruen); border-color: transparent; }

.ms-mark { color: var(--brand-700); }

/* ---------- Farbwahl (Projektformular) ---------- */
.farbwahl { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.farbe-opt { margin: 0; cursor: pointer; }
.farbe-opt input { display: none; }
.farbe-opt span { display: block; width: 30px; height: 30px; border-radius: 9px; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.farbe-opt input:checked + span { border-color: var(--brand-800); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 0 0 2px var(--mint); }

/* ---------- Gantt ---------- */
.gantt-wrap { padding: 14px 14px 6px; }
.gantt-legende { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 11px; color: var(--brand-700); }
.gantt-legende span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legende .lg-bar { width: 20px; height: 10px; border-radius: 3px; }
.gantt-legende .lg-offen  { background: #7f93b5; }
.gantt-legende .lg-arbeit { background: #c98a3f; }
.gantt-legende .lg-fertig { background: #3f9d6f; }
.gantt-legende .lg-ms { width: 11px; height: 11px; background: var(--brand-800); transform: rotate(45deg); }
.gantt-legende .lg-heute { width: 0; height: 14px; border-left: 2px solid #cf6a5f; }

.gantt-scroll { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 12px; }
.gantt { position: relative; }

.g-head { display: flex; background: var(--brand-800); }
.g-head-label {
    position: sticky; left: 0; z-index: 6; flex: none;
    background: var(--brand-800); color: #fff; padding: 8px 12px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    display: flex; align-items: flex-end; border-bottom: 2px solid var(--accent);
}
.g-head-time { flex: none; border-bottom: 2px solid var(--accent); }
.g-months { display: flex; }
.g-month { flex: none; padding: 5px 6px; font-size: 10px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .05em; border-left: 1px solid rgba(255,255,255,.18); overflow: hidden; white-space: nowrap; }
.g-weeks { display: flex; }
.g-week { flex: none; padding: 3px 4px; font-size: 9.5px; color: rgba(255,255,255,.75); border-left: 1px solid rgba(255,255,255,.1); white-space: nowrap; overflow: hidden; }

.g-rows { position: relative; }
.g-links { position: absolute; top: 0; z-index: 3; pointer-events: none; overflow: visible; }
.g-link { fill: none; stroke: #627596; stroke-width: 1.5; }

.g-row { display: flex; align-items: stretch; }
.g-row:nth-child(even) .g-row-label { background: var(--brand-50); }
.g-row-label {
    position: sticky; left: 0; z-index: 4; flex: none;
    background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 5px 16px; display: flex; flex-direction: column; justify-content: center; line-height: 1.2;
}
.g-row-label a {
    font-size: 12px; font-weight: 600; color: var(--brand-800); line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.g-row-label small { font-size: 10px; color: var(--brand-600); font-weight: 500; margin-top: 2px; line-height: 1.15; }
.g-lbl-ms { color: var(--brand-700); }

.g-track { position: relative; flex: none; border-bottom: 1px solid var(--line); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #cf6a5f; z-index: 1; }

.g-bar {
    position: absolute; top: 50%; transform: translateY(-50%); height: 20px;
    border: 1.5px solid; border-radius: 6px; overflow: hidden; z-index: 2;
    display: flex; align-items: center; min-width: 6px;
}
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; opacity: .55; }
.g-bar-text { position: relative; z-index: 1; font-size: 9.5px; font-weight: 700; color: var(--brand-900); padding-left: 6px; white-space: nowrap; }

.g-milestone { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.g-ms-diamond { display: block; width: 15px; height: 15px; background: var(--brand-800); transform: rotate(45deg); border: 1.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* ---------- Anträge / Workflow ---------- */
.nav-badge { display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: var(--brand-800); font-size: 10px; font-weight: 800; text-align: center; }
.badge-rot  { background: var(--rot-bg);  color: var(--rot);  border-color: transparent; }
.badge-grau { background: var(--brand-50); color: var(--brand-600); border-color: var(--line); }

/* Meilenstein-Eingabezeilen im Antragsformular */
.ms-row { display: grid; grid-template-columns: 1.4fr 150px 1.6fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.ms-row input { margin-top: 0; }
.ms-row .ms-del { min-height: 38px; padding: 0 12px; }
@media (max-width: 640px) {
    .ms-row { grid-template-columns: 1fr 1fr; }
    .ms-row .ms-del { grid-column: 2; justify-self: end; }
}

/* Steckbrief (Antragsansicht) */
.steckbrief-h { margin: 14px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-700); }
.steckbrief-h:first-child { margin-top: 0; }
.steckbrief-t { margin: 0 0 6px; font-size: 14px; color: var(--ink); max-width: 720px; }

/* ---------- Öffentliche Antrags-Link-Seite ---------- */
.public-body { background: var(--canvas); }
.public-wrap { max-width: 780px; margin: 0 auto; padding: 26px 18px 48px; }
.public-head { text-align: center; margin-bottom: 20px; }
.public-head .logo-box { display: inline-flex; background: #fff; border-radius: 18px; padding: 12px 18px; box-shadow: var(--shadow); }
.public-head .logo-box img { max-width: 150px; height: auto; }
.public-head .app-tag { margin-top: 8px; }

/* Kopierbarer Link */
.link-box { display: flex; gap: 8px; align-items: center; }
.link-box input { margin-top: 0; font-size: 13px; background: var(--brand-50); }
.link-box .btn { flex: none; }
@media (max-width: 520px) { .link-box { flex-direction: column; align-items: stretch; } }

/* ---------- Ressourcenposten (Antragsformular) ---------- */
.posten-head, .posten-row { display: grid; grid-template-columns: 150px 1fr 140px 40px; gap: 8px; align-items: center; }
.posten-head { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-600); font-weight: 700; margin-bottom: 6px; }
.posten-head span:nth-child(3) { text-align: right; }
.posten-row { margin-bottom: 8px; }
.posten-row input, .posten-row select { margin-top: 0; }
.posten-row .posten-betrag { text-align: right; }
.posten-row .posten-del { min-height: 38px; padding: 0 10px; }
.posten-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 12px; }
.posten-summe-zeile { font-size: 13px; font-weight: 700; color: var(--brand-700); }
#posten-summe { font-size: 17px; color: var(--brand-800); margin-left: 6px; }
@media (max-width: 640px) {
    .posten-head { display: none; }
    .posten-row { grid-template-columns: 1fr 1fr; }
    .posten-row input[name="posten_bezeichnung[]"] { grid-column: 1 / 3; }
}

/* ---------- Gantt: Tageszeile (Wochenansicht) + Ansichtsumschalter ---------- */
.g-days { display: flex; }
.g-day { flex: none; padding: 2px 0; text-align: center; font-size: 9px; color: rgba(255,255,255,.72); border-left: 1px solid rgba(255,255,255,.08); }
.g-day-we { background: rgba(255,255,255,.06); color: rgba(255,255,255,.45); }

.gantt-ansicht { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.gantt-ansicht a { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-700); }
.gantt-ansicht a:hover { background: var(--brand-50); text-decoration: none; }
.gantt-ansicht a.aktiv { background: var(--mint); color: var(--brand-800); }
.zeitplan-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.zeitplan-kopf .abschnitt { margin: 0; }

/* ---------- Drag & Drop: Aufgabenreihenfolge ---------- */
.drag-col { width: 34px; text-align: center; }
.drag-handle { cursor: grab; color: var(--brand-500); font-size: 16px; user-select: none; line-height: 1; }
.drag-handle:active { cursor: grabbing; }
table.liste tbody tr[draggable="true"] { transition: background .1s; }
table.liste tbody tr.drag-aktiv { opacity: .5; background: var(--mint) !important; }
@media (max-width: 900px) {
    /* Drag-Spalte in der mobilen Kartenansicht ausblenden (Touch-Sortierung folgt später). */
    .drag-col { display: none !important; }
}

/* ---------- Gantt: Teilprojekte/Phasen, Profi-Elemente ---------- */
.zeitplan-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gantt-profi.aktiv { background: var(--mint); border-color: var(--brand-400); color: var(--brand-800); }

.g-row-phase .g-track { background: rgba(25,41,70,.03) !important; }
.g-label-phase { background: var(--brand-50) !important; flex-direction: row !important; align-items: center !important; gap: 6px; }
.g-phase-toggle { font-size: 13px; color: var(--brand-700); text-decoration: none; width: 16px; text-align: center; }
.g-phase-toggle:hover { text-decoration: none; }
.g-phase-name { font-size: 12.5px; font-weight: 800; color: var(--brand-800); text-transform: uppercase; letter-spacing: .03em; }
.g-label-phase small { font-size: 10px; color: var(--brand-600); font-weight: 600; }
.g-label-child { padding-left: 30px !important; }

.g-summary { position: absolute; top: 50%; transform: translateY(-50%); height: 9px; background: var(--brand-800); border-radius: 2px; z-index: 2; }
.g-summary::before, .g-summary::after { content: ''; position: absolute; bottom: -4px; border: 5px solid transparent; border-top-color: var(--brand-800); }
.g-summary::before { left: 0; } .g-summary::after { right: 0; }

.g-slack { position: absolute; top: 50%; transform: translateY(-50%); height: 16px; z-index: 1; border-radius: 3px;
    background: repeating-linear-gradient(45deg, rgba(98,117,150,.28) 0 4px, transparent 4px 8px);
    border: 1px dashed rgba(98,117,150,.5); }
.g-bar-crit { box-shadow: 0 0 0 1px #cf3a3a; }
.g-milestone.g-crit .g-ms-diamond { background: #cf3a3a; }
.g-bar-res { position: absolute; top: 50%; transform: translateY(-50%); font-size: 9px; font-weight: 800;
    color: var(--brand-700); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 5px; z-index: 3; white-space: nowrap; }

.g-link-crit { stroke: #cf3a3a; stroke-width: 2; }
.g-link-label { font-size: 9px; font-weight: 700; fill: var(--brand-700); }

.gantt-legende .lg-krit { width: 20px; height: 3px; background: #cf3a3a; }
.gantt-legende .lg-slack { width: 20px; height: 10px; border-radius: 2px;
    background: repeating-linear-gradient(45deg, rgba(98,117,150,.35) 0 3px, transparent 3px 6px); border: 1px dashed rgba(98,117,150,.6); }

/* Vorgänger-Zeilen im Aufgabenformular */
.vorg-head, .vorg-row { display: grid; grid-template-columns: 1fr 110px 90px 40px; gap: 8px; align-items: center; }
.vorg-head { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-600); font-weight: 700; margin-bottom: 6px; }
.vorg-row { margin-bottom: 8px; }
.vorg-row select, .vorg-row input { margin-top: 0; }
.vorg-row .vorg-del { min-height: 38px; padding: 0 10px; }
@media (max-width: 640px) {
    .vorg-head { display: none; }
    .vorg-row { grid-template-columns: 1fr 1fr; }
    .vorg-row select[name="vorg_id[]"] { grid-column: 1 / 3; }
}
.teilprojekt-summary { cursor: pointer; }

/* ---------- Gantt: Phasen-Roll-up + kritische Kette (Feinschliff) ---------- */
.g-phase-col { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.g-summary { position: relative; overflow: visible; }
.g-summary-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(180,221,222,.6); border-radius: 2px 0 0 2px; }
.g-bar-crit { box-shadow: 0 0 0 1.5px #cf3a3a; }
.g-bar-res { border-width: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* ---------- Kommentare & Aktivitätsverlauf ---------- */
.komm-form textarea { min-height: 54px; }
.aktiv-liste { list-style: none; margin: 14px 0 0; padding: 0; }
.aktiv-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--brand-50); }
.aktiv-item:last-child { border-bottom: none; }
.aktiv-icon { flex: none; width: 20px; text-align: center; color: var(--brand-500); font-size: 13px; line-height: 1.5; }
.aktiv-komm .aktiv-icon { color: var(--brand-700); }
.aktiv-body { min-width: 0; }
.aktiv-text { font-size: 13.5px; color: var(--ink); }
.aktiv-komm .aktiv-text { background: var(--brand-50); border-radius: 10px; padding: 6px 10px; }
.aktiv-meta { font-size: 10.5px; color: var(--brand-600); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Teilprojekt-/Phasen-Verwaltung (eine Zeile je Phase) ---------- */
.phase-zeile { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.phase-zeile.drag-aktiv { opacity: .5; }
.phase-drag { flex: none; cursor: grab; color: var(--brand-500); font-size: 16px; }
.phase-drag:active { cursor: grabbing; }
.phase-form { display: flex; flex: 1; gap: 8px; align-items: center; margin: 0; min-width: 0; }
.phase-input { flex: 1; margin-top: 0; min-width: 0; }
.phase-form .btn, .phase-del-form .btn { flex: none; }
.phase-del-form { margin: 0; flex: none; }
@media (max-width: 640px) {
    .phase-zeile { flex-wrap: wrap; }
    .phase-form { flex: 1 1 100%; }
}

/* ---------- Phasen-Kopfzeile: klar & klickbar ---------- */
.g-label-phase { text-decoration: none !important; color: inherit; cursor: pointer;
    background: var(--brand-50) !important; border-bottom: 1px solid var(--line) !important; }
.g-label-phase:hover { background: #eaeef4 !important; text-decoration: none !important; }
.g-phase-toggle { font-size: 15px; color: var(--brand-700); width: 18px; text-align: center; flex: none; }
.g-summary::before, .g-summary::after { display: none; }
.g-summary-fill { background: rgba(255,255,255,.55); }

/* ---------- Gantt-Label als Inhaltsverzeichnis (bündig, feste Markierungsspalte) ---------- */
.g-label-toc { flex-direction: row !important; align-items: center; justify-content: flex-start !important; gap: 0; }
.g-toc-mark { flex: none; width: 24px; text-align: center; color: var(--brand-600); font-size: 14px; line-height: 1; }
.g-label-phase .g-toc-mark { color: var(--brand-700); font-size: 22px; font-weight: 700; }
.g-lbl-content { display: flex; flex-direction: column; min-width: 0; }
.g-label-child { padding-left: 34px !important; }   /* Kinder eingerückt (Inhaltsverzeichnis) */

/* ---------- Gantt: Projektstart-/Projektende-Linien (gestrichelt) ---------- */
.g-projline { position: absolute; top: 0; bottom: 0; width: 0; z-index: 1; border-left: 2px dashed; }
.g-projstart { border-left-color: #3f9d6f; }
.g-projende { border-left-color: #8a6425; }
.gantt-legende .lg-pstart { width: 0; height: 14px; border-left: 2px dashed #3f9d6f; }
.gantt-legende .lg-pende { width: 0; height: 14px; border-left: 2px dashed #8a6425; }

/* Aktivitätsfilter: nur Kommentare */
.aktiv-liste.nur-komm-an .aktiv-item:not(.aktiv-komm) { display: none; }
.komm-filter { font-size: 12px; text-transform: none; letter-spacing: normal; color: var(--brand-700); }

/* Verantwortlich-Auswahl je Teilprojekt (Verwaltungskarte) – alles in einer Zeile */
.phase-form { flex-wrap: nowrap; }
.phase-input:not(.phase-verantw) { flex: 2 1 0; }
.phase-verantw { flex: 1 1 0; min-width: 140px; }
