/* Forms + buttons + filter bar. */
.form-control {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-tint);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2364748B' d='M6 8 0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

label { display: block; font-size: 13px; font-weight: 600; color: var(--text-mut); margin-bottom: 6px; }

.form-group { margin-bottom: 16px; }

/* Active/inactive toggle (viewerForm.html) */
.switch-label { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 0; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-slider {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 999px;
    transition: background 0.15s ease;
}
.switch-slider::before {
    content: "";
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: var(--surface);
    border-radius: 50%;
    transition: transform 0.15s ease;
    box-shadow: var(--sh-sm);
}
.switch input:checked + .switch-slider { background: var(--c-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px var(--c-primary-tint); }

.boxCardForm {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 24px 28px;
    box-shadow: var(--sh-sm);
    max-width: 1000px;
}
.boxCardForm-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.boxCardForm-header h2 { margin: 0; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    line-height: 1;
    text-decoration: none;
}
.btn .mdi { font-size: 18px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-sm .mdi { font-size: 16px; }
.btn-icon { gap: 0; padding: 6px; width: 30px; justify-content: center; }

.btn-primary { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-1); border-color: var(--c-primary-1); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--n-100); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }

.btn-link { background: transparent; border: 0; color: var(--text-mut); font-size: 16px; padding: 4px 8px; border-radius: var(--r-xs); }
.btn-link:hover { background: var(--n-100); color: var(--c-ink); }

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.filter-bar input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.filter-bar select.form-control  { flex: 0 0 auto; width: auto; min-width: 160px; }
