/*
 * polish.css — shared accessibility + motion baseline.
 * Loaded on every admin view via <link href="<?= ADMIN_URL ?>/polish.css">.
 * Intentionally narrow scope: only fixes that apply globally and are safe to
 * layer on top of each view's inline <style> block without conflicts.
 */

/* ========== Keyboard focus — visible on every interactive element ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Suppress the outline on mouse-click only (keyboard users still get it). */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* ========== Disabled state — consistent, readable, cursor indicates state ========== */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ========== Reduced motion — respect OS preference ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== Screen-reader only utility ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== Skip-to-content link (keyboard users) ========== */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    padding: 8px 14px;
    background: #0ea5e9;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    z-index: 1000;
}
.skip-link:focus {
    left: 8px;
}

/* ========== Print — hide chrome, keep content readable ========== */
@media print {
    .sidebar, .topbar, .sidebar-logo, button, .btn { display: none !important; }
    body { background: #fff !important; }
}
