/* Capa UX transversal: accesibilidad, estados asíncronos y responsive tablet. */
:focus:not(:focus-visible) { outline: none; }

:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #075cc9;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff;
}

.sidebar :is(button, [tabindex]):focus-visible {
  outline-color: #ffcf4a;
  box-shadow: 0 0 0 2px #07111d;
}

.view-context { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.view-context:empty { display: none; }

.badge.gray { color: #344054; background: #e4e7ec; }
.badge.green, .status-completed, .status.ok { color: #0b5b3d; background: #d9f2e7; }
.status-started { color: #174b9a; background: #dce9ff; }
.status-pending, .status.pending { color: #704d00; background: #fff0c7; }

form[aria-busy="true"] { cursor: wait; }
form[aria-busy="true"] :is(button, input, select, textarea) { cursor: wait; }
.form-error {
  grid-column: 1 / -1;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid #b42335;
  border-left-width: 5px;
  border-radius: 10px;
  background: #fff1f3;
  color: #751522;
  font-weight: 600;
}
.form-error[hidden] { display: none; }
.field-error { border-color: #b42335 !important; }

.table-scroll-hint { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.table-box { position: relative; }
.table-box:focus-visible { outline-offset: 4px; }
.empty h2 { margin: 0 0 8px; font-size: 20px; }
.empty p { margin: 0; color: var(--ink-soft); }

.online-requirement {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: -14px !important;
  color: #68131e !important;
  font-size: 14px;
  font-weight: 600;
}

.online-requirement span { color: var(--brand-red); }
.install-app { margin-top: 10px; }
.install-app[hidden] { display: none; }

.network-gate {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(7, 17, 29, .96);
  min-height: 100vh;
  min-height: 100dvh;
  height: var(--visual-viewport-height, 100dvh);
}

.network-gate[hidden] { display: none; }

.network-gate-panel {
  width: min(520px, 100%);
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid rgba(255, 255, 255, .2);
  border-top: 5px solid #d32b40;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  text-align: center;
}

.network-gate-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-red);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.network-gate-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.15;
}

.network-gate-panel > p:not(.eyebrow) { color: var(--ink-soft); }
.network-gate-detail { font-weight: 600; }
.network-gate-panel .btn { margin-top: 8px; }

body.network-blocked { overflow: hidden; }

@media (max-width: 760px) {
  .network-gate {
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .network-gate-panel { padding: 22px 16px; border-radius: 14px; }
  .network-gate-mark { width: 52px; height: 52px; margin-bottom: 14px; }
  .network-gate-panel .btn { width: 100%; min-height: 48px; }
}

@media (max-width: 1100px) {
  .app:not(.hidden) { display: block !important; }
  .app.hidden { display: none !important; }
  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1200 !important;
    width: min(300px, calc(100vw - 28px)) !important;
    transform: translateX(-100%) !important;
    transition: transform .2s ease !important;
  }
  .sidebar.open { transform: translateX(0) !important; }
  .menu, .sidebar-overlay.show { display: inline-flex !important; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    border: 0;
    background: rgba(13, 17, 23, .58);
  }
}

@media (max-width: 760px) {
  .table-box {
    background-image: linear-gradient(to left, rgba(13, 17, 23, .14), transparent 18px);
    background-position: right center;
    background-repeat: no-repeat;
  }
}
