/* Admin controls stay available without squeezing the workspace. */
.admin-main, .tab-content, .page-header > *, .form-group { min-width: 0; }
.admin-sidebar { overflow-y: auto; }
.page-header, .admin-nav { flex-wrap: wrap; gap: 1rem; }
.table-responsive { max-width: 100%; overscroll-behavior-x: contain; }
.modal-overlay, #adminAuthGate { padding: 1rem; overflow-y: auto; }
.modal-card, .auth-card { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.auth-card { width: min(100%, 420px); }
.modal-card { width: min(100%, 640px); }
button, .btn, .form-input, .form-select { min-height: 42px; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--info); outline-offset: 3px; }
@media (max-width: 1000px) {
  .admin-sidebar { width: 210px; }
  .admin-main { padding: 1.25rem; }
}
@media (max-width: 760px) {
  .admin-nav { position: relative; padding: 1rem; }
  .admin-container { flex-direction: column; height: auto; min-height: 0; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: .75rem;
    border-right: 0; border-bottom: 1px solid var(--border-subtle); gap: .5rem; }
  .admin-sidebar .sidebar-section-title { display: none; }
  .admin-sidebar > * { flex-shrink: 0; }
  .admin-sidebar .nav-tab-btn { width: auto; white-space: nowrap; }
  .admin-main { overflow: visible; padding: 1rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .kpi-card { padding: 1rem; }
  .page-header { align-items: flex-start; }
  .page-title { font-size: 1.2rem; flex-wrap: wrap; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .modal-footer { flex-wrap: wrap; }
  input, select, textarea { font-size: 16px !important; max-width: 100%; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-profile-badge { flex-wrap: wrap; }
  .auth-card { padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
