.searchbar,
.filter-panel,
form.panel[method='get'] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--panel);
}

.searchbar > *,
.filter-panel > * {
    min-width: 0;
}

.searchbar .primary-button,
.searchbar .ghost-button,
.searchbar .ghost-link {
    min-width: 132px;
}

.searchbar__field,
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
}

.searchbar__field strong {
    color: var(--muted);
    font-size: 12px;
}

.filter-panel__head {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 2px;
}

.filter-panel__head h2,
.section-head h3 {
    margin: 0;
}

.filter-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.filter-field--full {
    grid-column: 1 / -1;
}

.filter-actions {
    grid-column: 1 / -1;
    margin-top: 2px;
}

.filter-actions--spread,
.inline-actions--spread {
    justify-content: space-between;
}

.inline-actions--spaced,
.chip-list--spaced,
.stack-list--spaced {
    margin-bottom: 14px;
}

.stack-list--spaced-top {
    margin-top: 14px;
}

.input-compact {
    width: 120px;
    max-width: 120px;
}

.split-grid--tight {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.subpanel--flat {
    background: transparent;
    box-shadow: none;
}

.quick-links {
    margin-top: 14px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.subform {
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
}


.admin-card {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--panel);
}

.admin-card__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.admin-card h1 {
    margin: 0 0 6px;
}

.admin-form {
    display: grid;
    gap: 14px;
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
}

.admin-form small,
.muted {
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.notice {
    padding: 12px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm, 12px);
}

.notice--success {
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
}

.notice--error {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
}

.dual-input {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ghost-link.is-active-link {
    border-color: var(--border-strong);
    background: rgba(0, 245, 255, 0.08);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

@media (max-width: 720px) {
    .section-head,
    .filter-panel__head {
        flex-direction: column;
    }

    .dual-input,
    .form-grid,
    .filter-grid,
    .searchbar,
    .split-grid {
        grid-template-columns: 1fr;
    }

    .searchbar .primary-button,
    .searchbar .ghost-button,
    .searchbar .ghost-link {
        width: 100%;
    }
}

/* APK light dashboard/forms pass - 2026-05-30 */
:root,
html[data-theme='terrain'] {
    --input-bg: #ffffff;
    --input-bg-strong: #ffffff;
    --input-placeholder: #9aa6b5;
}

.searchbar,
.filter-panel,
form.panel[method='get'] {
    border-color: #e5ebf3;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(26, 32, 44, 0.04);
}

.searchbar input,
.searchbar select,
input,
select,
textarea {
    background: #ffffff;
    border-color: #dce4ee;
    color: #263247;
}

input::placeholder,
textarea::placeholder {
    color: #9aa6b5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #9bb8e8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(87, 125, 190, 0.12);
}

select option {
    background: #ffffff;
    color: #263247;
}

.mini-badge,
.panel-kicker,
.status-chip,
.badge,
.module-card__badge,
.advanced-link__badge {
    border-color: #e5ebf3;
    background: #f8fafc;
    color: #536173;
}

.check-card,
.subform {
    border-color: #e5ebf3;
    background: #f8fafc;
}

.danger-button {
    border-color: #f2c7cf;
    background: #fff1f3;
    color: #a33b4b;
}
