/* ============================================================================
   AGENCIA WAYNAPICCHU - app-admin.css
   Estilos de la pagina de administracion del App Mobile
   ============================================================================ */

.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 14px 0 10px 0;
}

.tab {
  background: var(--panel-alt, #2a313f);
  color: var(--text-muted, #94a3b8);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px 8px 0 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}

.tab:hover {
  color: var(--text, #e5e7eb);
  background: var(--panel, #1e2430);
}

.tab.active {
  background: var(--accent, #6366f1);
  color: #fff;
  border-color: var(--accent, #6366f1);
}

.tab .badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  text-align: center;
}

.tab:not(.active) .badge {
  background: var(--accent, #6366f1);
  color: #fff;
}

.filtro-estado {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.filtro-estado select {
  background: var(--panel-alt, #2a313f);
  color: var(--text, #e5e7eb);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

.btn-refresh {
  background: var(--panel-alt, #2a313f);
  border: 1px solid var(--border, #2a2a2a);
  color: var(--text, #e5e7eb);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
}
.btn-refresh:hover { background: var(--accent, #6366f1); color: #fff; }

.pane {
  background: var(--panel, #1e2430);
  border-radius: 0 8px 8px 8px;
  padding: 12px;
  min-height: 500px;
  border: 1px solid var(--border, #2a2a2a);
}

.grid-tabla {
  overflow-x: auto;
}

.grid-tabla table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.grid-tabla th {
  background: var(--panel-alt, #2a313f);
  color: var(--text-muted, #94a3b8);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border, #2a2a2a);
}

.grid-tabla th.num { text-align: right; }

.grid-tabla td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  color: var(--text, #e5e7eb);
  vertical-align: middle;
}

.grid-tabla td.num { text-align: right; font-weight: 700; }

.grid-tabla tr:hover td { background: rgba(99, 102, 241, 0.08); }

.grid-tabla td.empty {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 40px;
  font-style: italic;
}

.col-acciones { white-space: nowrap; width: 1%; }

.estado {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.estado.PENDIENTE { background: #f59e0b22; color: #f59e0b; }
.estado.APROBADO  { background: #10b98122; color: #10b981; }
.estado.RECHAZADO { background: #ef444422; color: #ef4444; }
.estado.CANCELADO { background: #6b728022; color: #9ca3af; }
.estado.PAGADO    { background: #10b98122; color: #10b981; }

.btn-action {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
  transition: opacity .15s;
}
.btn-action:hover { opacity: 0.85; }
.btn-aprobar  { background: #10b981; color: #fff; }
.btn-rechazar { background: #ef4444; color: #fff; }
.btn-detalle  { background: var(--accent, #6366f1); color: #fff; }
.btn-pago-ok  { background: #7c1bb0; color: #fff; }
.btn-pago-no  { background: #6b7280; color: #fff; }

.estado.PENDIENTE_VERIFICACION { background: #3b82f622; color: #3b82f6; }
.estado.VERIFICADO             { background: #10b98122; color: #10b981; }

/* ─── Tab Configuración ──────────────────────────────────────────────── */
.config-card {
  background: var(--panel-alt, #2a313f);
  border-radius: 10px;
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
}
.config-card h3 {
  color: var(--text, #e5e7eb);
  font-size: 18px;
  margin-bottom: 4px;
}
.cfg-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #2a2a2a);
}
.cfg-section h4 {
  color: var(--text, #e5e7eb);
  font-size: 14px;
  margin: 0 0 12px 0;
}
.cfg-field {
  margin-bottom: 14px;
}
.cfg-field label {
  display: block;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cfg-field input {
  width: 100%;
  background: var(--panel, #1e2430);
  color: var(--text, #e5e7eb);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 15px;
  box-sizing: border-box;
}
.cfg-field input:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.cfg-field small {
  display: block;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  margin-top: 4px;
  font-style: italic;
}

/* Sub-tabs de pasarelas (dentro del tab Configuración) */
.pasarela-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 14px 0;
  border-bottom: 1px solid var(--border, #2a2a2a);
  flex-wrap: wrap;
}
.pas-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #94a3b8);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.pas-tab:hover { color: var(--text, #e5e7eb); }
.pas-tab.active {
  color: var(--accent, #6366f1);
  border-bottom-color: var(--accent, #6366f1);
}

.pasarela-pane { padding-top: 8px; }

/* Toggle row */
.cfg-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 12px;
  background: var(--panel, #1e2430);
  border-radius: 8px;
}
.switch-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #e5e7eb);
}
.switch-status {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}
.switch-status.on { color: #10b981; }

/* Switch ON/OFF */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #555;
  border-radius: 26px;
  transition: .25s;
}
.slider:before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .25s;
}
.switch input:checked + .slider { background: var(--accent, #6366f1); }
.switch input:checked + .slider:before { transform: translateX(24px); }

/* Grid de campos (2 columnas) */
.cfg-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  transition: opacity .25s;
}
.cfg-fields-grid.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.cfg-field-full { grid-column: 1 / -1; }

@media (max-width:600px) {
  .cfg-fields-grid { grid-template-columns: 1fr; }
}

/* Upload QR */
.qr-upload {
  width: 180px;
  height: 180px;
  border: 2px dashed var(--border, #2a2a2a);
  border-radius: 10px;
  background: var(--panel, #1e2430);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s;
  overflow: hidden;
}
.qr-upload:hover { border-color: var(--accent, #6366f1); }
.qr-placeholder {
  text-align: center;
  font-size: 36px;
  color: var(--text-muted, #94a3b8);
  font-weight: 300;
}
.qr-placeholder small {
  display: block;
  font-size: 11px;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.qr-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 8px;
}

/* Selector Manual / API */
.modo-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--panel, #1e2430);
  padding: 6px;
  border-radius: 8px;
}
.modo-pill {
  flex: 1;
  position: relative;
  cursor: pointer;
  text-align: center;
  padding: 10px 8px;
  border-radius: 6px;
  transition: all .15s;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 700;
}
.modo-pill input { display: none; }
.modo-pill small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.8;
}
.modo-pill:has(input:checked) {
  background: var(--accent, #6366f1);
  color: #fff;
}

/* Caja de info (instrucciones API) */
.api-info {
  background: rgba(124, 27, 176, 0.1);
  border-left: 3px solid #7c1bb0;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text, #e5e7eb);
  line-height: 1.5;
}
.api-info a { text-decoration: none; font-weight: 700; }

/* Inputs readonly (webhook URL) */
.readonly-input {
  background: var(--panel, #1e2430) !important;
  color: var(--text-muted, #94a3b8) !important;
  font-family: monospace;
  font-size: 12px !important;
  cursor: text;
}

/* ─── Modales ─────────────────────────────────────────────────────────── */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--panel, #1e2430);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  padding: 24px;
  min-width: 380px;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  color: var(--text, #e5e7eb);
}

.modal h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--text, #e5e7eb);
}

.modal-info {
  background: var(--panel-alt, #2a313f);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-form label {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.modal-form select,
.modal-form textarea,
.modal-form input[type="text"] {
  background: var(--panel-alt, #2a313f);
  color: var(--text, #e5e7eb);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-ok, .btn-cancel {
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-ok     { background: #10b981; color: #fff; }
.btn-cancel { background: var(--panel-alt, #2a313f); color: var(--text, #e5e7eb); border: 1px solid var(--border, #2a2a2a); }
.btn-ok:hover, .btn-cancel:hover { opacity: 0.85; }

/* Detalle de pedido */
.detalle-section {
  margin-bottom: 14px;
}
.detalle-section h4 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detalle-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
}
.detalle-row .lbl { color: var(--text-muted, #94a3b8); }
.detalle-row .val { color: var(--text, #e5e7eb); font-weight: 600; }
