/* ══════════════════════════════════════════════
   Entity Form Layout — Two-Column Sectioned
   Shared across all entity detail edit/create forms
   ══════════════════════════════════════════════ */

/* ── Form Container ── */
.ef-form {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 80px; /* clearance for sticky action bar */
}

/* ── Form Header ── */
.ef-header {
    margin-bottom: 32px;
}

.ef-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text, #212529);
    margin: 0;
}

/* ── Section ── */
.ef-section {
    margin-bottom: 32px;
}

.ef-section:last-of-type {
    margin-bottom: 0;
}

.ef-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-ui, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--color-border-light, #e9ecef);
    padding-bottom: 0.5rem;
    margin-bottom: 24px;
    margin-top: 0;
}

/* ── Fields Grid ── */
.ef-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Single field — occupies one grid column */
.ef-field {
    min-width: 0; /* prevent grid blowout */
}

/* Full-width field — spans both columns */
.ef-field.ef-full {
    grid-column: 1 / -1;
}

/* Three-column sub-row (e.g. City / State / Zip) */
.ef-field.ef-triple {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

/* ── Labels ── */
.ef-form .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-ui, #6c757d);
    margin-bottom: 0.375rem;
}

/* ── Inputs ── */
.ef-form .form-control,
.ef-form .form-select {
    width: 100%;
}

/* ── Sticky Action Bar ── */
.ef-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 0 -20px; /* bleed to edges if inside padded parent */
    background: var(--color-card-bg, #ffffff);
    border-top: 1px solid var(--color-border, #dee2e6);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

/* ── Mobile: Single Column ── */
@media (max-width: 767.98px) {
    .ef-fields {
        grid-template-columns: 1fr;
    }

    .ef-field.ef-full {
        grid-column: 1;
    }

    .ef-field.ef-triple {
        grid-column: 1;
        grid-template-columns: 1fr;
    }

    .ef-actions {
        margin: 0 -12px;
        padding: 12px 16px;
    }
}

/* ══════════════════════════════════════════════
   Dark Theme
   ══════════════════════════════════════════════ */

[data-theme="dark"] .ef-header h3 {
    color: var(--color-text);
}

[data-theme="dark"] .ef-section-title {
    color: var(--color-text-muted);
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] .ef-form .form-label {
    color: var(--color-text-muted);
}

[data-theme="dark"] .ef-actions {
    background: var(--color-surface);
    border-top-color: var(--color-border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}
