/* paneles.css — Botones, formularios, tarjeta de acceso, admin, pedidos, pagos, rutas y match */

/* ---------- Botones (píldora, como SportMatch y Cuenta Clara) ---------- */
.btn {
  width: 100%; padding: 12px 18px; border: none; border-radius: var(--r-pill); cursor: pointer;
  background: var(--azul); color: #fff;
  font-family: var(--f-texto); font-weight: 650; font-size: 14px; letter-spacing: -0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: background .15s, transform .1s var(--ease), box-shadow .15s, color .15s;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--azul) 26%, transparent);
}
.btn:hover { background: var(--azul-h); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.green { background: var(--lima); color: var(--lima-txt); box-shadow: 0 6px 16px color-mix(in srgb, var(--lima) 45%, transparent); }
.btn.green:hover { background: color-mix(in srgb, var(--lima) 88%, #000); }
.btn.ghost { background: var(--panel); color: var(--txt); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--tinte); }
.btn .ico { width: 18px; height: 18px; }

/* ---------- Tarjeta de acceso ---------- */
.card {
  width: 400px; max-width: 100%; background: var(--panel); color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px 26px;
  box-shadow: var(--sh-lg); animation: cardIn .45s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--azul); box-shadow: 0 6px 16px color-mix(in srgb, var(--azul) 30%, transparent);
}
.brand h1 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -0.04em; text-transform: lowercase; }
.brand h1::after { content: '.'; color: #84b94b; }
.slogan { font-size: 13.5px; color: var(--mut); margin: 0 0 20px 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--campo); border-radius: var(--r-pill); }
.tabs button {
  flex: 1; padding: 9px; border: none; background: transparent; color: var(--mut);
  border-radius: var(--r-pill); cursor: pointer; font-weight: 650; font-size: 13px; transition: background .15s, color .15s;
}
.tabs button.active { background: var(--panel); color: var(--txt); box-shadow: var(--sh-sm); }

/* ---------- Formularios ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--txt-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select, .sheet-body > input, .sheet-body > select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--campo); color: var(--txt); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--azul); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--azul) 16%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--mut) 75%, transparent); }
.hintline { font-size: 11.5px; color: var(--mut); margin-top: 5px; }
.hintline b { color: var(--azul); }
.err { color: var(--peligro); font-size: 12.5px; min-height: 16px; margin: 2px 0 8px; line-height: 1.45; }

/* ---------- Panel admin ---------- */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button {
  flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--panel); color: var(--txt-2); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.admin-tabs button.on { background: var(--azul); color: #fff; border-color: var(--azul); }
.kyc-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--campo); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; text-align: center; box-shadow: var(--sh-sm); }
.stat-box .sb-num { font-family: var(--f-titulo); font-size: 26px; font-weight: 800; color: var(--azul); }
.stat-box .sb-lbl { font-size: 11.5px; color: var(--mut); }

/* Resumen: tarjetas de cifras y gráfico de registros */
.adm-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (min-width: 560px) { .adm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.adm-kpi {
  text-align: left; font: inherit; color: var(--txt); cursor: default;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 13px; box-shadow: var(--sh-sm);
}
button.adm-kpi { cursor: pointer; transition: border-color .15s var(--ease), transform .15s var(--ease); }
button.adm-kpi:hover { border-color: var(--azul); transform: translateY(-1px); }
.adm-kpi-num { font-family: var(--f-titulo); font-size: 26px; font-weight: 800; color: var(--txt); line-height: 1.1; }
.adm-kpi-lbl { font-size: 12px; font-weight: 700; color: var(--txt-2); margin-top: 2px; }
.adm-kpi-pie { font-size: 11px; color: var(--mut); margin-top: 4px; }
.adm-sube { color: var(--verde); font-weight: 700; }
.adm-baja { color: var(--peligro); font-weight: 600; }
.adm-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin: 10px 0; box-shadow: var(--sh-sm); }
.adm-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.adm-card-h span { font-size: 12px; color: var(--mut); }
.adm-barras { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.adm-barra { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.adm-barra::before { content: ''; display: block; height: max(var(--h), 3px); border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--azul) 55%, transparent); }
.adm-barra.hoy::before { background: var(--lima); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lima-txt) 25%, transparent); }
.adm-barra span { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--h) + 2px); font-size: 9px; color: var(--mut); }
.adm-eje { display: flex; justify-content: space-between; font-size: 11px; color: var(--mut); margin-top: 6px; }

/* Usuarios: filtros, filas y acciones */
.adm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.adm-chips button {
  padding: 7px 11px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--panel);
  color: var(--txt-2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.adm-chips button b { color: var(--mut); font-weight: 700; margin-left: 2px; }
.adm-chips button.on { background: var(--marca-suave); border-color: var(--azul); color: var(--azul); }
.adm-chips button.on b { color: var(--azul); }
.adm-lista { display: flex; flex-direction: column; }
.adm-user { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px; border-top: 1px solid var(--line); font-size: 13.5px; }
.adm-lista .adm-user:first-child { border-top: 0; }
.adm-av { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--f-titulo); object-fit: cover; }
.adm-info { flex: 1; min-width: 0; }
.adm-info .who { overflow-wrap: anywhere; }
.adm-nombre { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.adm-rol { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; padding: 2px 7px; border-radius: var(--r-pill); }
.adm-rol.admin { background: var(--lima); color: var(--lima-txt); }
.adm-rol.mod { background: var(--marca-suave); color: var(--azul); }
.adm-rol.verif { background: var(--exito-suave); color: var(--verde); }
.adm-rol.susp { background: var(--peligro-suave); color: var(--peligro); }
.adm-susp { margin-top: 6px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--peligro-suave); color: var(--peligro); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.adm-acciones { display: flex; flex-direction: column; gap: 5px; align-items: stretch; flex: 0 0 auto; }
.adm-mini { width: auto; padding: 6px 10px; font-size: 11.5px; border-radius: var(--r-pill); }
.adm-select { border: 1px solid var(--line-2); background: var(--campo); color: var(--txt); max-width: 150px; }
.btn.adm-peligro { color: var(--peligro); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--peligro) 45%, transparent); }
.btn.adm-ok { background: var(--marca-suave); color: var(--azul); }
.btn.adm-btn-peligro { background: var(--peligro); color: #fff; }
.adm-check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 2px 6px; font-size: 13px; cursor: pointer; }
.adm-check input { margin-top: 3px; accent-color: var(--azul); }
.adm-check .muted { font-size: 12px; }
.adm-aviso { background: var(--aviso-suave); color: var(--aviso); border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.5; }
.adm-input { padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--campo); color: var(--txt); font-size: 13px; }
.adm-credenciales { margin-top: 12px; padding: 12px; border-radius: var(--r-md); background: var(--exito-suave); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.adm-credenciales code { background: var(--panel); padding: 1px 6px; border-radius: 6px; }
.adm-roles > div:not(.adm-card-h) { font-size: 12.5px; color: var(--txt-2); margin: 7px 0; line-height: 1.5; }
.adm-log { display: flex; gap: 10px; align-items: flex-start; }
.adm-log-ico { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--campo); font-size: 14px; }
@media (max-width: 420px) {
  .adm-user { flex-wrap: wrap; }
  .adm-acciones { flex-direction: row; flex-wrap: wrap; width: 100%; padding-left: 48px; }
}

/* ---------- Aviso emergente de nuevo pedido (repartidor) ---------- */
.new-order-pop { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 95; width: 360px; max-width: 92vw; animation: nopIn .35s cubic-bezier(.34, 1.56, .64, 1); }
.nop-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--verde) 45%, transparent); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--sh-lg); color: var(--txt); }
@keyframes nopIn { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- Método de pago ---------- */
.pay-opts { display: flex; gap: 8px; }
.pay-opt { flex: 1; display: flex; align-items: center; gap: 8px; padding: 11px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--panel); font-size: 13px; }
.pay-opt:has(input:checked) { border-color: var(--azul); background: var(--marca-suave); }
.pay-opt input { accent-color: var(--azul); }

/* ---------- Cobro, rutas y repartidor ---------- */
.cobro { margin: 8px 0; padding: 9px 12px; border-radius: 12px; font-size: 13px; }
.cobro.cash { background: var(--aviso-suave); border: 1px solid color-mix(in srgb, var(--aviso) 35%, transparent); color: var(--aviso); }
.cobro.paid { background: var(--exito-suave); border: 1px solid color-mix(in srgb, var(--verde) 35%, transparent); color: var(--verde); }
.route-summary { background: var(--campo); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-weight: 650; text-align: center; }
.courier-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; background: var(--panel-2); box-shadow: var(--sh-sm); }
.courier-card.active { border-color: color-mix(in srgb, var(--azul) 45%, transparent); background: linear-gradient(135deg, var(--marca-suave), var(--panel-2)); }
.route-step { display: flex; gap: 12px; align-items: flex-start; }
.route-step .rs-num { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.route-line { width: 2px; height: 22px; background: var(--line-2); margin-left: 13px; }
.route-nav { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--azul); text-decoration: none; padding: 6px 12px; border: 1px solid var(--azul); border-radius: var(--r-pill); font-weight: 600; }
.route-nav:hover { background: var(--azul); color: #fff; }
.courier-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; border-radius: var(--r-md); margin-bottom: 6px; background: var(--panel-2); border: 1px solid var(--line);
}
.courier-toggle.on { background: linear-gradient(135deg, var(--exito-suave), var(--marca-suave)); border-color: color-mix(in srgb, var(--verde) 40%, transparent); }

/* ---------- Match ---------- */
.match-banner {
  margin: 10px 0; padding: 10px 14px; border-radius: 12px; text-align: center; font-weight: 700;
  background: color-mix(in srgb, var(--violeta) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--violeta) 35%, transparent); color: var(--violeta);
}
.match-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--violeta) 35%, transparent), rgba(12, 19, 16, .75));
  animation: fadeIn .3s ease;
}
.match-card {
  width: 360px; max-width: 100%; text-align: center; color: var(--txt); padding: 28px 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); animation: cardIn .45s cubic-bezier(.34, 1.56, .64, 1);
}
.match-card h2 { font-size: 30px; margin: 6px 0; color: var(--violeta); }
.match-card p { color: var(--mut); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.match-card .btn { margin-top: 8px; }
.match-hearts { font-size: 46px; animation: pulse 1.4s ease-in-out infinite; }
