/* floorplan.css - styles of the openPlan3D area (/private/floorplan)
   Used by templates/floorplan/*.html together with static/js/floorplan.js.
   Colours come from the design tokens of quantix-style.css. */

/* --- shell: Werkzeugleiste unter der festen Hauptnavigation, Editor darunter -
   Die Navigation aus templates/base.html ist `position: fixed` und deckt den
   oberen Rand des Fensters ab.  Ohne den Abstand lägen die Bedienelemente
   ("Meine Pläne", "Grundriss-Editor", "Serverplan", ...) darunter. ------- */
.fp-shell {
    --fp-nav-offset: calc(var(--nav-height, 104px) + 14px);
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    /* oben der Platz der Navigation, unten 14px Luft: der Editor füllt den
       Rest des Fensters (100vh - var(--fp-nav-offset) - 14px) */
    padding: var(--fp-nav-offset) 16px 0;
    height: calc(100vh - 14px);
}

.fp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.fp-toolbar-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 6px;
}

.fp-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.fp-select select {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    padding: 6px 8px;
    max-width: 260px;
}

.fp-frame-wrap {
    flex: 1 1 auto;
    margin-top: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
}

.fp-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 480px;
    border: 0;
}

.fp-hint {
    margin: 10px 2px 0;
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.fp-not-built { padding: 8px 2px 24px; }

/* --- status line ------------------------------------------------------- */
.fp-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.fp-status.is-error { color: var(--rose); }
.fp-status-wide { display: block; margin-top: 14px; }

/* --- overview: summary, upload, table --------------------------------- */
.fp-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    margin: 18px 0 26px;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.fp-stat { display: flex; flex-direction: column; min-width: 120px; }
.fp-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.fp-stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fp-stat-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.fp-stat-actions form { margin: 0; }

.fp-section-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 26px 0 6px;
}

.fp-upload {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr);
    gap: 12px 16px;
    align-items: end;
    padding: 16px 18px;
    margin-top: 10px;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.fp-upload .hint-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }

.fp-table-wrap { overflow-x: auto; margin-top: 12px; }
.fp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-danger { color: var(--rose) !important; }

.fp-revisions summary { cursor: pointer; color: var(--text-secondary); font-size: 0.85rem; }
.fp-revision-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; min-width: 180px; }
.fp-revision { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-secondary); }

/* --- login / instruction pages ---------------------------------------- */
.fp-login-card {
    max-width: 460px;
    padding: 20px 22px;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.fp-login-card .contact-form { display: flex; flex-direction: column; gap: 14px; }

.fp-steps { color: var(--text-secondary); line-height: 1.7; }
.fp-steps code,
.fp-not-built code,
.alert code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86em;
    background: var(--surface-3);
    color: var(--text-primary);
    padding: 1px 5px;
    border-radius: var(--radius-xs);
}

.fp-logout { margin: 0; }

@media (max-width: 780px) {
    .fp-shell { height: auto; }
    .fp-upload { grid-template-columns: 1fr; }
    .fp-stat-actions { margin-left: 0; width: 100%; }
    .fp-frame { min-height: 420px; }
}
