/*
 * Die Akte einer Arbeitsstelle.
 *
 * Vier Fächer – Antrag, Genehmigung, Verkehrszeichenplan, Sonstiges –, darin
 * je eine Zeile pro Dokument. Wer die Akte öffnet, sucht meist ein bestimmtes
 * Blatt; deshalb die Gliederung und keine lange Liste.
 *
 * Struktur, keine Gestaltung: Farben und Rundungen gehören in app.css.
 */

dialog.dokumente-dialog {
    width: min(64rem, 96vw);
    max-width: 96vw;
    max-height: 92vh;
    overflow: auto;
}

.dokumente-dialog .app-dialog-kopf {
    align-items: flex-start;
    gap: .8rem;
    background: #1b242a !important;
}

/* Der Schließen-Knopf gehört nach rechts außen, nicht hinter den Titel. */
.dokumente-dialog .app-dialog-kopf > button {
    margin-left: auto;
}

.dokumente-fach + .dokumente-fach {
    margin-top: 1.1rem;
}

.dokumente-fach > strong {
    display: block;
    margin-bottom: .35rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid rgba(128, 128, 128, .22);
}

.dokumente-zeile {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
}

.dokumente-zeile + .dokumente-zeile {
    border-top: 1px solid rgba(128, 128, 128, .12);
}

/* Der Name darf wachsen, die Knöpfe bleiben, wo sie sind. */
.dokumente-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.dokumente-text > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dokumente-text > small {
    opacity: .75;
}

/* Das Hochladen steht unter der Akte und ist deutlich abgesetzt – es ist
   eine andere Handlung als das Nachschlagen. */
.dokumente-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 128, 128, .28);
}

.dokumente-form .breit,
.dokumente-form .fehler,
.dokumente-form .reihe-knoepfe {
    grid-column: 1 / -1;
}

.dokumente-form label {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}

@media (max-width: 34rem) {
    .dokumente-form { grid-template-columns: minmax(0, 1fr); }
}

/* ── Unterlagen in der Projektliste ──
 *
 * Zwei Angaben je Zeile: liegt die Anordnung vor, gibt es einen Plan. Sie
 * stehen untereinander, damit die Spalte schmal bleibt – die Liste hat
 * schon genug Spalten.
 */

.unterlagen {
    white-space: nowrap;
}

.unterlage {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    line-height: 1.5;
}

/* Feste Breite, damit die beiden Beschriftungen untereinander fluchten –
   ein Haken ist schmaler als ein Strich. */
.unterlage-zeichen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    font-weight: 700;
}

/* Was fehlt, tritt zurück: es ist ein offener Punkt, kein Fehler. */
.unterlage.fehlt {
    opacity: .5;
}

/* ── Antrag auf verkehrsrechtliche Anordnung ──
 *
 * Steht unter der Akte, weil er dorthin gehört: wer die Genehmigung sucht,
 * sucht auch den Antrag, mit dem sie erwirkt wurde.
 */

.vrao {
    margin-top: 1.6rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 128, 128, .28);
}

.vrao-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .4rem;
}

/* Das Gespräch bekommt eine feste Höhe: es soll den Dialog nicht immer
   weiter aufblähen, während man mit dem Assistenten hin und her geht. */
.vrao-gespraech {
    max-height: 24rem;
    overflow-y: auto;
    margin: .8rem 0;
    padding: .75rem;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 10px;
    background: rgba(8, 14, 18, .18);
    scrollbar-color: #4c5960 transparent;
}

.vrao-zug {
    max-width: min(90%, 52rem);
    padding: .8rem 1rem;
    border-radius: 10px;
    color: #e7ebed;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.vrao-zug p { margin: 0; }
.vrao-zug p + p { margin-top: .8rem; }
.vrao-zug strong { color: #fff; font-weight: 700; }

.vrao-zug + .vrao-zug {
    margin-top: .4rem;
}

/* Wer gerade spricht, muss auf einen Blick klar sein. */
.vrao-ich {
    margin-left: auto;
    background: rgba(255, 159, 10, .1);
    border: 1px solid rgba(255, 159, 10, .18);
}

.vrao-assistent {
    margin-right: auto;
    background: #20292f;
    border: 1px solid rgba(255, 255, 255, .07);
}

.vrao-fehler {
    color: #ef6a5e;
}

.vrao-frage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .6rem;
    margin: .7rem 0;
}

.vrao-frage input {
    flex: 1 1 auto;
    min-width: 0;
}

.vrao-vorschlag {
    margin-top: .9rem;
    padding: 1rem;
    border: 1px solid rgba(255, 159, 10, .22);
    border-radius: 10px;
    background: linear-gradient(120deg, rgba(255, 159, 10, .055), rgba(10, 17, 21, .16));
}

.vrao-vorschlag > strong {
    display: block;
    margin-bottom: .75rem;
    color: #f2f4f5;
    font-size: 13px;
}

.vrao-behoerde-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.vrao-behoerde-details > div {
    min-width: 0;
    padding: .65rem .75rem;
    background: #192228;
}

.vrao-behoerde-details span,
.vrao-behoerde-details strong { display: block; }
.vrao-behoerde-details span {
    margin-bottom: .15rem;
    color: #849097;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.vrao-behoerde-details strong {
    color: #e7ebed;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.vrao-vorschlag > .reihe-knoepfe { margin-top: .75rem; }

.vrao-vorschlag label {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-bottom: .5rem;
}

.vrao-vorschlag textarea {
    width: 100%;
    font-family: inherit;
    line-height: 1.5;
}

/* Der fertige Antrag wird in klaren Arbeitsschritten dargestellt. */
.vrao-vorschlag[data-vrao-entwurf] {
    padding: 1.1rem;
    background: linear-gradient(135deg, rgba(255,159,10,.055), rgba(13,20,24,.42));
}

.vrao-vorschlag[data-vrao-entwurf] > .reihe-knoepfe {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .85rem 0 .45rem;
}

.vrao-vorschlag[data-vrao-entwurf] > small {
    display: block;
    padding: .65rem .75rem;
    border-left: 2px solid rgba(255,159,10,.55);
    border-radius: 0 7px 7px 0;
    background: rgba(255,159,10,.045);
    color: #aeb8bd;
    line-height: 1.5;
}

.vrao-vorschlag .protokoll-unterschrift,
.vrao-vorschlag .vrao-versand {
    margin: 1rem 0 0;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    background: rgba(8,14,18,.2);
}

.vrao-vorschlag .feld-titel {
    display: block;
    margin-bottom: .65rem;
    color: #f1f3f4;
    font-size: .92rem;
    font-weight: 700;
}

/* Am Desktop reicht eine kompakte Schreibzeile. Die interne Canvas-Aufloesung
 * bleibt hoch, nur die sichtbare Flaeche wird ruhiger. */
.vrao-vorschlag .unterschrift-feld {
    height: 112px;
    border: 1px dashed rgba(255,159,10,.5);
    border-radius: 8px;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.18);
}

.vrao-vorschlag .protokoll-unterschrift > .reihe-knoepfe {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .15rem;
}

.vrao-vorschlag .protokoll-unterschrift > small {
    color: #aab4b9;
    font-size: .72rem;
    line-height: 1.45;
}

.vrao-versand > label { margin-bottom: .85rem; }

.vrao-anlagen {
    margin: .15rem 0 .9rem;
    padding: .8rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
}

.vrao-anlagen > [data-vrao-anlagen] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.vrao-anlagen .haken {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: .6rem;
    min-height: 44px;
    margin: 0;
    padding: .6rem .7rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 7px;
    background: #182127;
    cursor: pointer;
}

.vrao-anlagen .haken:hover { border-color: rgba(255,159,10,.4); }

.vrao-anlagen .haken input[type="checkbox"] {
    display: grid;
    place-items: center;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
}

.vrao-anlagen .haken > span {
    min-width: 0;
    margin: 0;
    color: #d6dcdf;
    font-size: .76rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.vrao-anlagen > small {
    display: block;
    margin-top: .55rem;
    color: #929da3;
    font-size: .7rem;
}

.vrao-versand > .reihe-knoepfe {
    display: flex;
    justify-content: flex-end;
    margin-top: .75rem;
}

.vrao-versand > small:last-child {
    display: block;
    margin-top: .65rem;
    color: #98a3a8;
    font-size: .7rem;
    line-height: 1.45;
    text-align: right;
}

@media (max-width: 620px) {
    .vrao-kopf { align-items: flex-start; flex-direction: column; }
    .vrao-kopf .knopf { width: 100%; }
    .vrao-gespraech { max-height: 60vh; padding: .45rem; }
    .vrao-zug { max-width: 100%; padding: .7rem .75rem; font-size: 12px; }
    .vrao-frage { grid-template-columns: 1fr; }
    .vrao-frage .knopf { width: 100%; }
    .vrao-behoerde-details { grid-template-columns: 1fr; }
    .vrao-vorschlag { padding: .75rem; }
    .vrao-vorschlag .protokoll-unterschrift,
    .vrao-vorschlag .vrao-versand { padding: .75rem; }
    .vrao-vorschlag .unterschrift-feld { height: 135px; }
    .vrao-anlagen > [data-vrao-anlagen] { grid-template-columns: 1fr; }
    .vrao-vorschlag[data-vrao-entwurf] > .reihe-knoepfe .knopf,
    .vrao-vorschlag .protokoll-unterschrift > .reihe-knoepfe .knopf,
    .vrao-versand > .reihe-knoepfe .knopf { flex: 1 1 100%; width: 100%; }
    .vrao-versand > small:last-child { text-align: left; }
}
