/* admin.css — extensiones sobre envivo.css para el panel del negocio */

.back-link {
    color: #94a3b8;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: none;
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 100px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
}
.back-link:hover { color: var(--gold); border-color: rgba(212,175,55,0.3); }
.back-link.is-active {
    color: var(--gold);
    border-color: rgba(212,175,55,0.5);
    background: rgba(212,175,55,0.10);
}
.back-link.back-link-danger {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.25);
}
.back-link.back-link-danger:hover {
    background: rgba(252, 165, 165, 0.10);
    border-color: rgba(252, 165, 165, 0.5);
    color: #fecaca;
}
.admin-nav-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* PIN gate */
.pin-gate {
    margin: 32px 16px;
    padding: 28px 22px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    text-align: center;
}
.pin-gate h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 16px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 6px;
}
.pin-gate p { font-size: 12px; color: #94a3b8; margin: 0 0 18px; }
.pin-input {
    width: 100%;
    text-align: center;
    background: #0f172a !important;
    border: 2px solid var(--glass-border);
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 0.6em;
    padding: 14px;
    border-radius: 14px;
    color-scheme: dark;
    -moz-appearance: textfield;
}
.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pin-input:focus { outline: none; border-color: var(--gold); }
.pin-input.error { border-color: var(--rose); animation: shake 0.4s; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Scanner */
.scanner-block {
    margin: 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 18px;
    overflow: hidden;
}
.scanner-block .ttl {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 12px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 12px;
    text-align: center;
}
#qr-reader {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: black;
}
#qr-reader video { border-radius: 14px; }
.scanner-help {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}
.manual-input {
    margin-top: 18px;
    border-top: 1px solid var(--glass-border);
    padding-top: 18px;
}
.manual-input label {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    margin-bottom: 6px;
}
.manual-input input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--glass-border);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    padding: 10px;
    border-radius: 10px;
}
.manual-input input:focus { outline: none; border-color: var(--gold); }

/* Resultado del escaneo */
.scan-result {
    margin: 16px;
    padding: 22px;
    border-radius: 22px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.3s;
}
.scan-result.exact { border: 2px solid rgba(212, 175, 55, 0.5); background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.03)); }
.scan-result.received {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.06);
}
.scan-result.expired,
.scan-result.error {
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.06);
}
.scan-result h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 14px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 14px;
}
.scan-result.received h3 { color: #6ee7b7; }
.scan-result.expired h3, .scan-result.error h3 { color: #fca5a5; }
.scan-result .row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 13px;
}
.scan-result .row:last-of-type { border-bottom: none; }
.scan-result .row .lbl {
    font-size: 9px; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.15em; font-weight: 800;
}
.scan-result .row .val { font-weight: 700; color: white; }
.scan-result .match-mini {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    margin: 10px 0;
}
.scan-result .match-mini img { width: 30px; height: 20px; border-radius: 3px; object-fit: cover; }
.scan-result .match-mini .score {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 18px;
    color: var(--gold);
}
.scan-result .actions {
    display: flex; gap: 10px;
    margin-top: 16px;
}
.scan-result .actions button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
}
.scan-result .actions .btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #020617;
}
.scan-result .actions .btn-secondary {
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
    border: 1px solid var(--glass-border);
}
.scan-result .actions .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.scan-result .pending-confirmation {
    margin-top: 14px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    text-align: center;
    font-size: 12px;
    color: #93c5fd;
}
.scan-result .pending-confirmation .spinner-blue {
    width: 14px; height: 14px;
    border: 2px solid rgba(147, 197, 253, 0.3);
    border-top-color: #93c5fd;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* PIN settings shortcut visible */
.cfg-link { display: flex !important; }

/* ============================================================
   Usuarios del negocio (usuarios.html)
============================================================ */
.usuarios-wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.usuarios-intro {
    font-size: 12.5px; color: #cbd5e1; line-height: 1.5;
    background: rgba(212,175,55,0.07);
    border-left: 3px solid var(--gold, #D4AF37);
    padding: 12px 14px; border-radius: 8px; margin-bottom: 16px;
}
.usuarios-intro strong { color: var(--gold, #D4AF37); }
.usuarios-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.usuarios-toolbar .stat { font-size: 13px; color: #cbd5e1; }
.usuarios-toolbar .stat strong { color: var(--gold, #D4AF37); font-size: 16px; }
.btn-add-user {
    background: linear-gradient(135deg, var(--gold, #D4AF37), #B8860B);
    color: #020617; font-family: 'Montserrat', sans-serif; font-weight: 900;
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 10px 18px; border: none; border-radius: 100px; cursor: pointer;
}
.btn-add-user:active { transform: scale(0.97); }

.usuarios-list { display: flex; flex-direction: column; gap: 10px; }
.usuario-row {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 12px 14px;
}
.usuario-row.inactivo { opacity: 0.55; }
.usuario-row .u-ini {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 50%; background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.4);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Montserrat', sans-serif; font-weight: 900;
    color: var(--gold, #D4AF37); font-size: 17px;
}
.usuario-row .u-body { flex: 1; min-width: 0; }
.usuario-row .u-nombre {
    font-weight: 700; color: #f1f5f9; font-size: 14px;
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.usuario-row .u-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.usuario-row .u-meta strong { color: #cbd5e1; }
.u-rol-chip {
    font-family: 'Montserrat', sans-serif; font-weight: 800;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 6px;
}
.u-rol-admin    { background: rgba(212,175,55,0.18); color: var(--gold, #D4AF37); border: 1px solid rgba(212,175,55,0.4); }
.u-rol-operador { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.4); }
.u-inactivo-chip {
    font-size: 9px; font-weight: 800; text-transform: uppercase;
    color: #fca5a5; background: rgba(244,63,94,0.12);
    padding: 2px 7px; border-radius: 6px;
}
.usuario-row .u-actions { display: flex; gap: 5px; flex-shrink: 0; }
.u-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    color: #cbd5e1; border-radius: 8px; cursor: pointer;
    width: 34px; height: 34px; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.u-btn:hover { background: rgba(255,255,255,0.1); }
.u-btn.danger { color: #fca5a5; border-color: rgba(244,63,94,0.3); }

/* ============================================================
   Modal de formulario (usado en usuarios.html y otros)
============================================================ */
.bp-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, 0.85);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s;
}
.bp-modal {
    background: #0f172a;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}
.bp-modal h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 16px;
    color: var(--gold, #D4AF37);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 18px;
    text-align: center;
}
.bp-field { margin-bottom: 14px; }
.bp-field label {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
    margin-bottom: 6px;
}
.bp-field label small {
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
    color: #64748b;
}
.bp-field input,
.bp-field select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 11px 13px;
    border-radius: 11px;
    box-sizing: border-box;
}
.bp-field input:focus,
.bp-field select:focus { outline: none; border-color: var(--gold, #D4AF37); }
.bp-field input:disabled { opacity: 0.55; cursor: not-allowed; }
.bp-field select { cursor: pointer; }
.bp-field select option { background: #0f172a; color: #f1f5f9; }

.bp-error {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fca5a5;
    font-size: 12px;
    margin-bottom: 12px;
}

.bp-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.bp-modal-actions .btn { flex: 1; }

/* Botones genéricos del modal */
.btn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold {
    background: linear-gradient(135deg, var(--gold, #D4AF37), #B8860B);
    color: #020617;
}
.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
}
