:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-lighter: #252542;
    --text: #ffffff;
    --text-muted: #a0a0b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255,255,255,0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236,72,153,0.15) 0%, transparent 50%);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background: rgba(15,15,35,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links { 
    display: flex; 
    gap: 1rem; 
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover { 
    color: var(--text); 
}

/* Botones */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(99,102,241,0.6); 
}

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { 
    background: var(--bg-card); 
}

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }

.btn-sm { 
    padding: 0.5rem 1rem; 
    font-size: 0.85rem; 
}

/* Hero */
.hero {
    padding: 3rem 1.5rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, #a0a0b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero p { 
    font-size: 1.1rem; 
    color: var(--text-muted); 
    margin-bottom: 2rem; 
}

/* Grid de planes */
.planes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.plan-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(99,102,241,0.3);
}

.plan-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.badge-pin { background: rgba(16,185,129,0.2); color: var(--success); }
.badge-manual { background: rgba(245,158,11,0.2); color: var(--warning); }

.plan-name { 
    font-size: 1.25rem; 
    font-weight: 700; 
    margin-bottom: 0.5rem; 
}

.plan-diamonds {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 1rem 0;
}

.plan-price { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin-bottom: 1rem; 
}

.plan-stock { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    margin-bottom: 1.5rem; 
}

/* Formularios */
.form-container {
    max-width: 450px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group { 
    margin-bottom: 1.25rem; 
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

/* Dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    flex-shrink: 0;
}

.stat-info h3 { 
    font-size: 1.5rem; 
    font-weight: 700; 
}

.stat-info p { 
    color: var(--text-muted); 
    font-size: 0.85rem; 
}

/* Tabla */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

th {
    background: var(--bg-lighter);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover { 
    background: rgba(255,255,255,0.02); 
}

/* Badges */
.badge {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-pending { background: rgba(245,158,11,0.2); color: var(--warning); }
.badge-approved { background: rgba(16,185,129,0.2); color: var(--success); }
.badge-rejected { background: rgba(239,68,68,0.2); color: var(--danger); }

/* Admin sidebar */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 800;
    padding: 0 1rem 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu { 
    list-style: none; 
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    background: var(--bg-lighter);
    color: var(--text);
}

.admin-content { 
    padding: 2rem; 
    overflow-x: auto; 
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active { 
    display: flex; 
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-lighter); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ========================================
   RESPONSIVE - TABLET (768px)
   ======================================== */
@media (max-width: 768px) {
    .admin-layout { 
        grid-template-columns: 1fr; 
    }
    
    .sidebar { 
        display: none; 
    }
    
    .hero h1 { 
        font-size: 2rem; 
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .navbar { 
        padding: 1rem; 
    }
    
    .nav-links { 
        gap: 0.75rem; 
    }
    
    .nav-links a { 
        font-size: 0.85rem; 
    }
    
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .plan-card {
        padding: 1.25rem;
    }
    
    .plan-name {
        font-size: 1.1rem;
    }
    
    .plan-diamonds {
        font-size: 1.75rem;
    }
    
    .plan-price {
        font-size: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-info h3 {
        font-size: 1.25rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE - MÓVIL (480px)
   ======================================== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .logo {
        justify-content: center;
    }
    
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .planes-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    
    .plan-card {
        padding: 1rem;
    }
    
    .plan-diamonds {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: 1.1rem;
    }
    
    .stat-info p {
        font-size: 0.75rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .btn-sm {
        width: auto;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-container {
        margin: 0.5rem;
        padding: 1.25rem 1rem;
    }
    
    .form-control {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .modal-content {
        padding: 1.25rem;
    }
    
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.875rem 1rem;
    }
}

/* ========================================
   RESPONSIVE - MÓVIL PEQUEÑO (360px)
   ======================================== */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .nav-links a {
        font-size: 0.8rem;
    }
    
    .plan-name {
        font-size: 1rem;
    }
    
    .plan-diamonds {
        font-size: 1.25rem;
    }
}

/* ========================================
   UTILIDADES RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .grid-mobile-1 {
        grid-template-columns: 1fr !important;
    }
    
    .grid-mobile-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mejorar touch en móviles */
@media (pointer: coarse) {
    .btn, 
    .nav-links a,
    .sidebar-menu li a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px;
    }
}