/* ============================================
   LD BARBER — Panel de Administración & Bonos
   Diseño Premium Dark & Gold · Mobile-First Optimizado
   ============================================ */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;
    --bg-card: #151515;
    --bg-card-hover: #1c1c1c;
    --border: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(200, 169, 110, 0.28);

    --accent: #c8a96e;
    --accent-light: #dfc285;
    --accent-dark: #9f8349;
    --accent-glow: rgba(200, 169, 110, 0.2);

    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #666666;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

/* === RESET Y BASE SIN DESBORDAMIENTOS === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    background-color: #070707;
    background: #070707;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

/* === PANTALLA DE ACCESO / LOGIN PIN === */
.login-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #181510 0%, #070707 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    padding-left: calc(env(safe-area-inset-left, 0px) + 1rem);
    padding-right: calc(env(safe-area-inset-right, 0px) + 1rem);
    overflow-y: auto;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    width: 100%;
    max-width: 330px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
}

.login-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    border: 1px solid var(--accent);
    padding: 4px;
    background: #000;
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 0.15rem;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.pin-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
}

.keypad-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.65rem 0.25rem;
    min-height: 48px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keypad-btn:hover {
    border-color: var(--border-gold);
    background: rgba(212, 175, 55, 0.08);
}

.keypad-btn:active {
    background: var(--accent);
    color: #000;
    transform: scale(0.96);
}

.keypad-btn.action {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    min-height: 18px;
}

/* === LAYOUT PRINCIPAL === */
.app-container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
    padding-left: calc(env(safe-area-inset-left, 0px) + 0.85rem);
    padding-right: calc(env(safe-area-inset-right, 0px) + 0.85rem);
}

@media (min-width: 640px) {
    .app-container {
        padding-top: calc(env(safe-area-inset-top, 0px) + 1.75rem);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6rem);
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Header */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.85rem;
    gap: 0.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    padding: 2px;
    background: #000;
}

.header-brand h1 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.header-brand span {
    color: var(--accent);
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.sync-badge.cloud {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.sync-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.user-role-badge.barber {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.user-role-badge.creator {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--accent-light);
}

.icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Selector de Mes */
.month-selector-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.month-display {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: capitalize;
}

.month-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.month-nav-btn:active {
    background: var(--bg-tertiary);
    color: var(--accent);
}

/* Tarjetas KPI de Resumen (Grid 2x2 en móvil) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

@media (min-width: 640px) {
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
}

.kpi-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.65rem 0.65rem 0.75rem;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--border);
}

.kpi-card.gold::before {
    background: var(--accent);
}

.kpi-card.green::before {
    background: var(--success);
}

.kpi-card.red::before {
    background: var(--danger);
}

.kpi-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.kpi-sub {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desglose de Recaudación por Método de Pago */
.revenue-breakdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.85rem;
}

@media (min-width: 640px) {
    .revenue-breakdown-card {
        margin-bottom: 1.25rem;
        padding: 0.85rem 1.15rem;
    }
}

.revenue-breakdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.revenue-breakdown-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.revenue-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .revenue-methods-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
}

.revenue-method-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    transition: all 0.2s ease;
}

.revenue-method-box:hover {
    border-color: var(--border-gold);
}

.method-box-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1;
}

.method-box-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.method-box-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.1;
}

.method-box-amount {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 1px 0;
}

.method-box-count {
    font-size: 0.6rem;
    color: var(--accent);
    letter-spacing: 0.2px;
    opacity: 0.9;
}

/* Barra de Acción Principal */
.action-banner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.action-sub-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .action-banner {
        grid-template-columns: 1.8fr 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .action-sub-buttons {
        display: contents;
    }
}

.btn-scan-main {
    background: linear-gradient(135deg, var(--accent) 0%, #a88440 100%);
    color: #000;
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.btn-scan-main:active {
    transform: scale(0.98);
}

.btn-scan-main svg {
    width: 22px;
    height: 22px;
}

.btn-add-client {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    width: 100%;
}

.btn-add-client:active {
    background: var(--accent);
    color: #000;
}

.btn-add-client svg {
    width: 17px;
    height: 17px;
}

.btn-raffle {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid var(--border-gold);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-raffle:hover {
    border-color: #ffd700;
    background: rgba(212, 175, 55, 0.2);
}

.btn-raffle:active {
    transform: scale(0.98);
}

/* Buscador y Filtros */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

@media (min-width: 640px) {
    .filter-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 640px) {
    .search-box {
        max-width: 360px;
    }
}

.search-box input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    color: #fff;
    /* 16px font-size para evitar que iOS Safari haga zoom automático */
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 15px;
    height: 15px;
}

.filter-tabs {
    display: flex;
    gap: 0.35rem;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    width: 100%;
}

@media (min-width: 640px) {
    .filter-tabs {
        width: auto;
    }
}

.filter-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--bg-tertiary);
    color: var(--accent);
    font-weight: 600;
}

/* Lista de Clientes */
.clients-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

@media (min-width: 640px) {
    .clients-grid {
        grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
        gap: 0.85rem;
    }
}

.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.client-card.paid {
    border-left: 3px solid var(--success);
}

.client-card.pending {
    border-left: 3px solid var(--danger);
}

.client-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.client-id {
    font-family: monospace;
    font-size: 0.68rem;
    color: var(--accent);
    background: rgba(200, 169, 110, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.client-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0.15rem;
}

.client-plan {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
}

.status-badge.paid {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge.pending {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.payment-details {
    margin: 0.5rem 0;
    padding: 0.4rem 0.55rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.method-tag {
    text-transform: capitalize;
    color: var(--accent);
    font-weight: 600;
}

.client-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.btn-pay-toggle {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-pay-toggle.pay {
    background: var(--accent);
    color: #000;
}

.btn-pay-toggle.unpay {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-pay-toggle.edit-pay {
    background: rgba(200, 169, 110, 0.15);
    color: var(--accent);
    border: 1px solid var(--border-gold);
}

.btn-pay-toggle.edit-pay:hover {
    background: rgba(200, 169, 110, 0.28);
}

.action-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.action-icon-btn:active {
    color: var(--accent);
    border-color: var(--accent);
}

/* === MODALES (POP-UPS) OPTIMIZADOS MÓVIL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Modal Escáner QR */
#scannerViewport {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.scanner-hint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Modal de Cobro */
.quick-date-pills {
    display: flex;
    gap: 4px;
}

.btn-pill-date {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-gold);
    color: var(--accent);
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-pill-date:hover, .btn-pill-date:active {
    background: var(--accent);
    color: #000;
}

.pay-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
    margin: 0.85rem 0;
}

.method-choice {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.4rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.method-choice.active {
    border-color: var(--accent);
    background: rgba(200, 169, 110, 0.12);
}

.method-choice .method-icon {
    font-size: 1.35rem;
    display: block;
    margin-bottom: 0.15rem;
}

.method-choice .method-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
}

/* Tarjeta Carnet QR Digital VIP */
.digital-card {
    background: linear-gradient(160deg, #181511 0%, #0c0b09 45%, #050505 100%);
    border: 1.5px solid transparent;
    background-clip: padding-box;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.digital-card::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    background: linear-gradient(135deg, #c59b27, #fcedc5, #8a6519, #ffd978, #a8791e);
    border-radius: var(--radius-lg);
    z-index: -1;
}

.digital-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.emv-chip-mini {
    width: 32px;
    height: 23px;
    background: linear-gradient(135deg, #d8b24a 0%, #fae296 45%, #b48c28 100%);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emv-chip-lines-mini {
    width: 75%;
    height: 60%;
    border: 1px solid rgba(133, 98, 20, 0.6);
    border-radius: 2px;
    position: relative;
}

.emv-chip-lines-mini::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
    background: rgba(133, 98, 20, 0.6);
}

.digital-card-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #000;
    background: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
    padding: 2px 10px;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.card-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 2.5px;
    background: linear-gradient(135deg, #bf953f 0%, #fcf6ba 40%, #b38728 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.15rem;
    font-weight: 800;
}

.card-title-sub {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.card-qr-frame {
    display: inline-block;
    padding: 5px;
    background: linear-gradient(145deg, #332612, #181208);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
    margin-bottom: 0.75rem;
}

.card-qr-box {
    background: #fff;
    padding: 6px;
    border-radius: 8px;
    display: inline-block;
}

.card-qr-box img,
.card-qr-box canvas {
    display: block;
    max-width: 140px;
    max-height: 140px;
}

.card-client-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.card-client-id {
    font-family: monospace;
    color: var(--accent-light);
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

/* Formularios (16px para evitar auto-zoom en iOS Safari) */
.form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    color: #fff;
    font-size: 16px;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
}

.btn-block {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: #fff;
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
}

/* Toast */
.toast-notice {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    text-overflow: ellipsis;
    overflow: hidden;
}

.toast-notice.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Botón Peligro / Eliminar */
.btn-danger {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.6);
    color: #ff6b6b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: rgba(220, 53, 69, 0.25);
    border-color: #dc3545;
    color: #ff8787;
}

.btn-danger:active {
    background: #dc3545;
    color: #fff;
    transform: scale(0.98);
}

/* ================= MODAL DE SORTEOS VIP ================= */
.raffle-modal-container {
    max-width: 480px;
}

.raffle-config-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.85rem;
}

.raffle-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
}

.raffle-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    padding: 0.4rem 0.55rem;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.raffle-radio-label:hover {
    border-color: var(--border-gold);
}

.raffle-radio-label input[type="radio"] {
    accent-color: var(--accent);
}

.raffle-eligible-badge {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
    padding: 0.4rem;
    background: rgba(212, 175, 55, 0.08);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-gold);
}

.raffle-prizes-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.prize-pill {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.prize-pill.gold {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}

.prize-pill.silver {
    border-color: #c0c0c0;
    color: #e0e0e0;
    background: rgba(192, 192, 192, 0.08);
}

.prize-pill.bronze {
    border-color: #cd7f32;
    color: #e49a5b;
    background: rgba(205, 127, 50, 0.08);
}

.btn-raffle-run {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    color: #000;
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 18px rgba(218, 165, 32, 0.4);
    letter-spacing: 0.4px;
    transition: all 0.2s ease;
}

.btn-raffle-run:hover {
    box-shadow: 0 6px 24px rgba(218, 165, 32, 0.6);
    transform: translateY(-1px);
}

.btn-raffle-run:active {
    transform: scale(0.98);
}

.raffle-status-area {
    margin-top: 1rem;
    padding: 1.25rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
}

.raffle-spinner-inner {
    font-size: 2.5rem;
    animation: raffleSpin 0.6s infinite ease-in-out alternate;
}

@keyframes raffleSpin {
    from { transform: scale(0.9) rotate(-10deg); }
    to { transform: scale(1.15) rotate(10deg); }
}

.raffle-shuffle-name {
    margin-top: 0.65rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    min-height: 1.8rem;
    letter-spacing: 0.5px;
}

.raffle-results-area {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.raffle-results-header {
    text-align: center;
    margin-bottom: 0.85rem;
}

.raffle-results-header h4 {
    font-family: var(--font-display);
    color: #ffd700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.raffle-timestamp {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.raffle-podium-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.podium-card {
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.podium-card.gold {
    border-color: #ffd700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.02) 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.podium-card.silver {
    border-color: #c0c0c0;
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, rgba(192, 192, 192, 0.02) 100%);
}

.podium-card.bronze {
    border-color: #cd7f32;
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, rgba(205, 127, 50, 0.02) 100%);
}

.podium-badge {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.podium-card.gold .podium-badge { color: #ffd700; }
.podium-card.silver .podium-badge { color: #e0e0e0; }
.podium-card.bronze .podium-badge { color: #e49a5b; }

.podium-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-align: right;
}

.podium-id {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
}

.raffle-actions-row {
    display: flex;
    gap: 0.5rem;
}
