/* ==========================================================
   COMPONENTS.CSS v122
   Componentes globales extraidos desde app.css.
   QA: solo mueve CSS global reutilizable; no cambia lógica, PHP, rutas ni BD.
   ========================================================== */
/* --- alertas centradas --- */
/* ALERTAS CENTRADAS NO BLOQUEANTES FINAL */
.aq-center-notice {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transform: scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

.aq-center-notice.show {
  opacity: 1;
  transform: scale(1);
}

.aq-center-notice.is-blocking {
  pointer-events: auto;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(2px);
}

.aq-center-notice-card {
  width: min(420px, calc(100vw - 34px));
  min-height: 190px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 34%),
    #fff;
  border: 1px solid rgba(148, 163, 184, .20);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 2rem;
  text-align: center;
  pointer-events: none;
}

.aq-center-notice-icon {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  font-size: 2.25rem;
  font-weight: 950;
  box-shadow: 0 18px 40px rgba(34, 197, 94, .28);
}

.aq-center-notice-title {
  margin-top: .3rem;
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 950;
}

.aq-center-notice-message {
  color: #64748b;
  font-size: .98rem;
  line-height: 1.35;
  font-weight: 700;
  max-width: 330px;
}

.aq-center-notice-error .aq-center-notice-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 18px 40px rgba(239, 68, 68, .25);
}

.aq-center-notice-warning .aq-center-notice-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 18px 40px rgba(245, 158, 11, .25);
}

.aq-center-notice-info .aq-center-notice-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 18px 40px rgba(59, 130, 246, .25);
}

@media (max-width: 560px) {
  .aq-center-notice-card {
    min-height: 170px;
    border-radius: 24px;
    padding: 1.5rem;
  }

  .aq-center-notice-icon {
    width: 62px;
    height: 62px;
    font-size: 1.85rem;
  }

  .aq-center-notice-title {
    font-size: 1.15rem;
  }

  .aq-center-notice-message {
    font-size: .9rem;
  }
}
/* END ALERTAS CENTRADAS NO BLOQUEANTES FINAL */

/* --- neutralizar toasts antiguos --- */
/* NEUTRALIZAR TOASTS VIEJOS FINAL */
#app-flash-toast-container,
#toastContainer,
.toast-container,
.app-toast-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.toast-message,
.flash-message,
.alert-success,
.alert-danger,
.alert-warning {
  display: none !important;
}

/* Mantener alertas internas de formulario si no son flash global */
.card .alert,
form .alert,
.login-flash {
  display: block !important;
}
/* END NEUTRALIZAR TOASTS VIEJOS FINAL */

/* --- botones y checks premium globales --- */
/* ==========================================================
   UI_PREMIUM_BUTTONS_CHECKS_GLOBAL_FIX
   QA:
   - Solo CSS.
   - No toca PHP.
   - No toca JS.
   - No toca lógica.
   - No cambia rutas.
   - No cambia formularios.
   ========================================================== */

:root {
    --ui-premium-primary-1: #2563eb;
    --ui-premium-primary-2: #4f46e5;
    --ui-premium-danger-soft: #fff1f2;
    --ui-premium-danger-text: #be123c;
    --ui-premium-danger-border: #fecdd3;
    --ui-premium-neutral-bg: #ffffff;
    --ui-premium-neutral-text: #1f2937;
    --ui-premium-neutral-border: #dbe3ef;
    --ui-premium-shadow: 0 10px 22px rgba(15, 23, 42, .12);
    --ui-premium-shadow-hover: 0 16px 34px rgba(15, 23, 42, .18);
}

/* Botón base global */
.button,
button.button,
a.button,
input[type="submit"].button {
    border-radius: 999px !important;
    min-height: 42px;
    padding: 10px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    font-weight: 750;
    line-height: 1.1;
    text-decoration: none;
    box-shadow: var(--ui-premium-shadow);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        filter .16s ease,
        background .16s ease,
        border-color .16s ease;
    will-change: transform;
}

.button:hover,
button.button:hover,
a.button:hover,
input[type="submit"].button:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-premium-shadow-hover);
    filter: brightness(1.02);
}

.button:active,
button.button:active,
a.button:active,
input[type="submit"].button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .14);
}

/* Primario */
.button:not(.danger):not(.secondary):not(.toolbar-clear):not(.button-light):not(.small),
button.button:not(.danger):not(.secondary):not(.toolbar-clear):not(.button-light):not(.small),
a.button:not(.danger):not(.secondary):not(.toolbar-clear):not(.button-light):not(.small) {
    background: linear-gradient(135deg, var(--ui-premium-primary-1), var(--ui-premium-primary-2));
    color: #fff;
}

/* Secundario */
.button.secondary,
.button.toolbar-clear,
.button.button-light,
a.button.secondary,
a.button.toolbar-clear,
a.button.button-light,
button.button.secondary,
button.button.toolbar-clear,
button.button.button-light {
    background: var(--ui-premium-neutral-bg);
    color: var(--ui-premium-neutral-text);
    border-color: var(--ui-premium-neutral-border);
}

/* Peligro */
.button.danger,
button.button.danger,
a.button.danger {
    background: var(--ui-premium-danger-soft);
    color: var(--ui-premium-danger-text);
    border-color: var(--ui-premium-danger-border);
    box-shadow: 0 10px 22px rgba(190, 18, 60, .10);
}

/* Botones pequeños */
.button.small,
button.button.small,
a.button.small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: .86rem;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .10);
}

/* Icono pequeño sin tocar HTML */
.button::before,
button.button::before,
a.button::before {
    content: "•";
    width: 21px;
    height: 21px;
    min-width: 21px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, .24);
    color: currentColor;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.button.danger::before,
button.button.danger::before,
a.button.danger::before {
    content: "×";
    background: #ffe4e6;
}

.button.secondary::before,
.button.toolbar-clear::before,
.button.button-light::before,
a.button.secondary::before,
a.button.toolbar-clear::before,
a.button.button-light::before,
button.button.secondary::before,
button.button.toolbar-clear::before,
button.button.button-light::before {
    content: "←";
    background: #eef2ff;
    color: #3730a3;
}

.aq-primary-action::before {
    content: "+";
}

.toolbar-submit::before {
    content: "✓";
}

.actions .button:not(.danger)::before {
    content: "›";
}

.actions .button.danger::before {
    content: "×";
}

/* Disabled */
.button:disabled,
button.button:disabled,
input[type="submit"].button:disabled,
.button.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(.15);
}

/* Checks premium */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #b8c3d5;
    border-radius: 7px;
    background: #fff;
    display: inline-grid;
    place-content: center;
    vertical-align: middle;
    cursor: pointer;
    transition:
        background .14s ease,
        border-color .14s ease,
        box-shadow .14s ease,
        transform .14s ease;
}

input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform .14s ease;
    background: #fff;
    clip-path: polygon(14% 44%, 0 60%, 42% 100%, 100% 18%, 84% 4%, 39% 67%);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--ui-premium-primary-1), var(--ui-premium-primary-2));
    border-color: var(--ui-premium-primary-1);
    box-shadow: 0 6px 14px rgba(37, 99, 235, .20);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}

label input[type="checkbox"] {
    margin-right: 7px;
}

/* Radios: solo color nativo */
input[type="radio"] {
    accent-color: var(--ui-premium-primary-1);
}

@media (prefers-reduced-motion: reduce) {
    .button,
    button.button,
    a.button,
    input[type="submit"].button,
    input[type="checkbox"] {
        transition: none !important;
    }

    .button:hover,
    button.button:hover,
    a.button:hover,
    input[type="submit"].button:hover,
    input[type="checkbox"]:hover {
        transform: none !important;
    }
}

/* ==========================================================
   END UI_PREMIUM_BUTTONS_CHECKS_GLOBAL_FIX
   ========================================================== */

/* --- colores globales de acciones --- */
/* ==========================================================
   UI_ACTION_COLORS_DISTINCT_SYSTEM_FIX_V2
   Mantiene movimiento + sombra premium.
   Cada función usa color único.
   ========================================================== */

/* Base: asegurar que todos los botones de acciones conserven sombra y movimiento */
.actions .button,
.actions a.button,
.actions button.button {
    border-radius: 999px !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .12) !important;
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        filter .16s ease,
        background .16s ease,
        border-color .16s ease !important;
}

.actions .button:hover,
.actions a.button:hover,
.actions button.button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .18) !important;
    filter: brightness(1.02);
}

.actions .button:active,
.actions a.button:active,
.actions button.button:active {
    transform: translateY(0) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .14) !important;
}

/* EDITAR = azul principal */
.actions .button[href*="/editar"],
.actions .button.edit,
.actions .button.action-edit {
    background: linear-gradient(135deg,#2563eb,#4f46e5) !important;
    color:#fff !important;
}

/* HORARIOS = azul turquesa */
.actions .button[href*="horarios"],
.actions .button.action-horarios,
.actions .button.horarios {
    background: linear-gradient(135deg,#0891b2,#06b6d4) !important;
    color:#fff !important;
}

/* BLOQUEOS = morado intermedio */
.actions .button[href*="bloqueos"],
.actions .button.action-bloqueos,
.actions .button.bloqueos {
    background: linear-gradient(135deg,#7c3aed,#a855f7) !important;
    color:#fff !important;
}

/* ACTIVAR = verde jade */
.actions .button[href*="activar"],
.actions .button.activar {
    background: linear-gradient(135deg,#0f766e,#14b8a6) !important;
    color:#fff !important;
}

/* INACTIVAR = rosa fuerte elegante */
.actions .button[href*="inactivar"],
.actions .button.inactivar,
.actions .button.danger {
    background: linear-gradient(135deg,#fb7185,#e11d48) !important;
    color:#fff !important;
}

/* REPORTES = cobre */
.actions .button[href*="reporte"],
.actions .button[href*="reportes"],
.actions .button.reportes,
.actions .button.action-report {
    background: linear-gradient(135deg,#b45309,#d97706) !important;
    color:#fff !important;
}

/* VISTA IMPRIMIBLE = grafito */
.actions .button[href*="imprimir"],
.actions .button[href*="print"],
.actions .button[href*="imprimible"],
.actions .button.print,
.actions .button.action-print {
    background: linear-gradient(135deg,#334155,#475569) !important;
    color:#fff !important;
}

/* EXPORTAR = verde lima premium */
.actions .button[href*="excel"],
.actions .button[href*="export"],
.actions .button.export {
    background: linear-gradient(135deg,#65a30d,#84cc16) !important;
    color:#102000 !important;
}

/* HISTORIAL = vino oscuro */
.actions .button[href*="historial"],
.actions .button.historial {
    background: linear-gradient(135deg,#7f1d1d,#b91c1c) !important;
    color:#fff !important;
}

/* VER / DETALLE = índigo suave */
.actions .button[href*="ver"],
.actions .button[href*="detalle"],
.actions .button.view {
    background: linear-gradient(135deg,#4338ca,#6366f1) !important;
    color:#fff !important;
}

/* Iconos diferenciados */
.actions .button[href*="/editar"]::before { content:"✎" !important; }
.actions .button[href*="horarios"]::before { content:"⏰" !important; }
.actions .button[href*="bloqueos"]::before { content:"◆" !important; }
.actions .button[href*="activar"]::before { content:"✓" !important; }
.actions .button[href*="inactivar"]::before { content:"×" !important; }
.actions .button[href*="reporte"]::before,
.actions .button[href*="reportes"]::before { content:"▣" !important; }
.actions .button[href*="imprimir"]::before,
.actions .button[href*="print"]::before,
.actions .button[href*="imprimible"]::before { content:"⎙" !important; }
.actions .button[href*="excel"]::before,
.actions .button[href*="export"]::before { content:"⇩" !important; }
.actions .button[href*="historial"]::before { content:"◷" !important; }
.actions .button[href*="ver"]::before,
.actions .button[href*="detalle"]::before { content:"›" !important; }

/* Excluir flechas de agenda */
.aq-day-nav::before,
.aq-calendar-arrow::before {
    content: none !important;
}

/* ==========================================================
   END UI_ACTION_COLORS_DISTINCT_SYSTEM_FIX_V2
   ========================================================== */

/* --- componentes reporte/password --- */
/* RESPONSIVE_REPORTES_PASSWORD_V120_CONTROLLED
   Fix quirúrgico: resumen de reportes visible en móvil y un solo ojo por contraseña. */
.report-summary-card {
  overflow: hidden;
}

.report-summary-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.report-summary-table th,
.report-summary-table td {
  vertical-align: middle;
  padding: 11px 8px;
}

.report-summary-table th {
  width: 62%;
  color: #475569;
  font-weight: 700;
  white-space: normal;
}

.report-summary-table td {
  width: 38%;
  text-align: right;
  color: #0f172a;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.password-toggle-wrap {
  position: relative !important;
  display: block !important;
  width: 100% !important;
}

.password-toggle-wrap input {
  width: 100% !important;
  padding-right: 46px !important;
}

.password-toggle-btn {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  transform: translateY(-50%) !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #64748b !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 2 !important;
}

.password-toggle-btn svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  background: #eef2ff !important;
  color: #2563eb !important;
  outline: none !important;
}

@media (max-width: 760px) {
  .report-summary-card h2 {
    margin-bottom: 10px !important;
  }

  .report-summary-table,
  .report-summary-table tbody,
  .report-summary-table tr {
    display: block;
    width: 100%;
  }

  .report-summary-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
  }

  .report-summary-table tr:last-child {
    border-bottom: 0;
  }

  .report-summary-table th,
  .report-summary-table td {
    display: block;
    width: auto !important;
    border-bottom: 0 !important;
    padding: 0 !important;
  }

  .report-summary-table th {
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.25;
  }

  .report-summary-table td {
    justify-self: end;
    max-width: 46vw;
    text-align: right;
    font-size: 13px;
    line-height: 1.25;
  }
}
/* END RESPONSIVE_REPORTES_PASSWORD_V120_CONTROLLED */

/* --- badge base --- */
.badge{display:inline-block;padding:6px 10px;border-radius:999px;background:#eef2ff;font-size:12px}

/* --- botones base inicial --- */
.button{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border:none;border-radius:10px;background:#2563eb;color:#fff;cursor:pointer}
.button.small{padding:7px 10px;font-size:13px}
.button.danger{background:#dc2626}
.button.secondary{background:#64748b}
.alert{padding:12px 14px;border-radius:10px;margin-bottom:16px}
.alert.success{background:#ecfdf5;color:#065f46}
.alert.error{background:#fef2f2;color:#991b1b}

/* --- paginacion --- */
.pagination-wrap{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:16px}
.pagination-summary{color:#6b7280;font-size:14px}
.pagination{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.page-link{display:inline-flex;align-items:center;justify-content:center;min-width:38px;padding:8px 10px;border:1px solid #d1d5db;border-radius:10px;background:#fff;color:#111827;text-decoration:none}
.page-link.active{background:#2563eb;color:#fff;border-color:#2563eb}
.page-link.ellipsis{border-color:transparent;background:transparent;min-width:auto;padding:0 4px}

/* --- checks grid --- */
.checks-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.check-card{display:flex;align-items:center;gap:10px;border:1px solid #e5e7eb;padding:10px 12px;border-radius:10px;background:#fff;cursor:pointer}.check-card span{font-weight:500;line-height:1.3}

/* --- paginacion por pagina --- */
.pagination-per-page{display:flex;align-items:center;gap:8px}
.pagination-per-page label{font-size:14px;color:#6b7280}
.pagination-per-page select{padding:8px 10px;border:1px solid #d1d5db;border-radius:10px;background:#fff}

/* --- badges estados --- */
/* Estados binarios: activo / inactivo */
.badge.status-active{background:#dcfce7 !important;color:#166534 !important;font-weight:700}
.badge.status-inactive{background:#fee2e2 !important;color:#b91c1c !important;font-weight:700}

/* --- inline action form --- */
/* v254 - botones de acceso app como formularios inline */
.inline-action-form{
  display:inline-flex;
  margin:0;
}
.inline-action-form .button{
  white-space:nowrap;
}
