/* ============================= */
/* Gofresquina Admin Panel       */
/* Estilos Completos - Refactorizado */
/* ============================= */

/* ============================= */
/* 1. TOKENS / DESIGN SYSTEM     */
/* ============================= */
@import url('tokens.css');

/* ============================= */
/* 2. BASE / RESET               */
/* ============================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Normalización universal entre Windows, Mac, iOS y Android */
.os-windows * {
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.os-mac *,
.os-ios * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.os-android * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: auto;
}

/* Estilos universales para móviles */
.device-mobile *,
.is-mobile * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.device-mobile input,
.device-mobile textarea,
.device-mobile select,
.is-mobile input,
.is-mobile textarea,
.is-mobile select {
    -webkit-user-select: text;
    user-select: text;
    font-size: 16px !important; /* Prevenir zoom en iOS al enfocar inputs */
}

/* Estilos específicos para Windows - Asegurar renderizado correcto */
.os-windows .admin-panel {
    /* Asegurar que el panel se renderice correctamente en Windows */
    display: flex !important;
    width: 100%;
    overflow-x: hidden;
}

.os-windows .sidebar {
    /* Asegurar que el sidebar se vea correctamente en Windows */
    position: fixed !important;
    height: 100vh !important;
    overflow-y: auto;
    /* Mejorar scrollbar en Windows */
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #1a1a1a;
}

.os-windows .sidebar::-webkit-scrollbar {
    width: 8px;
}

.os-windows .sidebar::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.os-windows .sidebar::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 4px;
}

.os-windows .main-content {
    /* Asegurar que el contenido principal se ajuste correctamente */
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.os-windows .stat-card,
.os-windows .chart-card,
.os-windows .card {
    /* Asegurar que las tarjetas se rendericen correctamente */
    display: block !important;
    box-sizing: border-box;
}

.os-windows .stats-grid,
.os-windows .charts-grid {
    /* Asegurar que los grids funcionen correctamente en Windows */
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.os-windows .header {
    /* Asegurar que el header se vea correctamente */
    position: sticky !important;
    top: 0;
    z-index: 100;
    background: var(--white) !important;
}

.os-windows .content {
    /* Asegurar que el contenido tenga el padding correcto */
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
}

.os-windows .data-table {
    /* Asegurar que las tablas se rendericen correctamente */
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.os-windows .nav-item {
    /* Asegurar que los items del menú se vean bien */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Asegurar que los elementos se rendericen correctamente en Windows */
.os-windows img {
    max-width: 100%;
    height: auto;
    display: block;
}

.os-windows button,
.os-windows .btn {
    /* Asegurar que los botones funcionen correctamente */
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    /* Normalizar renderizado entre sistemas operativos */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Asegurar consistencia en Windows y Mac */
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo i {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.logo h1 {
    color: var(--dark);
    font-size: 32px;
    margin-bottom: 5px;
}

.logo p {
    color: var(--gray);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-primary {
    width: auto;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFD700 0%, #ffed4e 100%);
    color: #000000;
    border: 2px solid #000000;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4), 0 0 0 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffed4e 0%, #FFD700 100%);
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* ========== ADMIN PANEL ========== */
.admin-panel {
    display: flex;
    min-height: 100vh;
    background: #F5F7FA;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    border-right: 2px solid #FFD700;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Secciones de navegación */
.nav-section {
    margin-bottom: 30px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    padding: 10px 25px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}

/* Items de navegación mejorados */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    margin: 2px 0;
    border-radius: 0 8px 8px 0;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    background: #FFD700;
    border-radius: 0 4px 4px 0;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    padding-left: 30px;
}

.nav-item:hover::before {
    width: 3px;
    height: 60%;
}

.nav-item.active {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
    font-weight: 600;
    padding-left: 30px;
}

.nav-item.active::before {
    width: 4px;
    height: 70%;
    background: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.nav-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover .nav-item-icon {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

.nav-item.active .nav-item-icon {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.nav-item-icon i {
    font-size: 18px;
    color: inherit;
}

.nav-item-text {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(231, 76, 60, 0.2);
    color: var(--white);
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-logout:hover {
    background: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: #F5F7FA;
    min-height: 100vh;
}

.header {
    background: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-toggle {
    display: none;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: #FFD700;
    transform: scale(1.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-selector {
    padding: 8px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    background: var(--white);
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.language-selector:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.language-selector:focus {
    outline: none;
    border-color: var(--primary);
}

/* Language Configuration Section */
.language-config-section {
    margin-top: 20px;
}

/* Language Buttons - Selector Moderno con Paleta Negro/Dorado/Rojo/Blanco */
.language-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.language-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 25px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 3px solid #000000;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 16px;
    font-weight: 700;
    color: #000000;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-btn:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4), 0 0 0 2px rgba(255, 215, 0, 0.2);
    transform: translateY(-4px) scale(1.02);
    background: linear-gradient(135deg, #ffffff 0%, #fffef5 100%);
}

.language-btn:hover::before {
    opacity: 1;
}

.language-btn.active {
    border-color: var(--accent-gold);
    border-width: 4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(231, 76, 60, 0.1) 100%);
    box-shadow: 0 12px 32px rgba(255, 215, 0, 0.5), 0 0 0 6px rgba(255, 215, 0, 0.15), inset 0 0 20px rgba(255, 215, 0, 0.1);
    color: #000000;
    transform: translateY(-2px) scale(1.03);
}

.language-btn.active::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.language-btn .btn-flag {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    z-index: 1;
}

.language-btn:hover .btn-flag {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
}

.language-btn.active .btn-flag {
    transform: scale(1.15);
    filter: drop-shadow(0 6px 12px rgba(255, 215, 0, 0.6));
}

.language-btn .btn-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    z-index: 1;
    transition: all 0.3s ease;
    color: #000000;
}

.language-btn.active .btn-text {
    font-size: 19px;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.5), 0 0 8px rgba(255, 215, 0, 0.3);
    color: #000000;
}

.language-btn .btn-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #ffed4e 100%);
    color: #000000;
    border: 2px solid #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6), 0 0 0 2px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.language-btn.active .btn-check {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: checkPop 0.5s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.language-btn.active .btn-check:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.8), 0 0 0 3px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #ffed4e 0%, var(--accent-gold) 100%);
}

@media (max-width: 768px) {
    .language-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .language-btn {
        padding: 20px 15px;
    }
    
    .language-btn .btn-flag {
        font-size: 40px;
    }
    
    .language-btn .btn-text {
        font-size: 16px;
    }
}

.language-preview {
    border-top: 2px solid #E0E0E0;
    padding-top: 20px;
    margin-top: 30px;
}

.preview-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

.preview-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.header h1 {
    color: var(--dark);
    font-size: 28px;
    margin: 0;
    flex: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
}

.user-info span {
    font-weight: 600;
}

.user-info i {
    font-size: 32px;
    color: var(--primary);
}

/* Content */
.content {
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Stats Grid */
/* ========== DASHBOARD HEADER ========== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #E8E8E8;
}

.dashboard-header-content {
    flex: 1;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-title i {
    color: #FFD700;
    font-size: 28px;
}

.dashboard-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

.btn-refresh {
    padding: 10px 20px;
    height: auto;
    border-radius: 12px;
    background: #F5F7FA;
    border: 2px solid #E8E8E8;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
}

.btn-refresh span {
    display: inline-block;
}

.btn-refresh:hover {
    background: #FFD700;
    border-color: #FFD700;
    color: #000;
    transform: rotate(180deg);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== STATS SECTIONS ========== */
.stats-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #F0F0F0;
}

.section-title i {
    color: #FFD700;
    font-size: 18px;
}

/* ========== STATS GRID PRINCIPAL ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #F0F0F0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card-background {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    opacity: 0.1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: inherit;
}

.stat-card-content {
    padding: 24px;
    position: relative;
    z-index: 1;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label i {
    font-size: 16px;
    opacity: 0.9;
    color: #FFFFFF;
}

.stat-trend {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.stat-trend-up {
    background: rgba(39, 174, 96, 0.1);
    color: #27AE60;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-footer-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.stat-footer i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
    flex-shrink: 0;
}

.stat-change {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    line-height: 1.4;
    flex: 1;
}

.stat-growth,
.stat-percentage {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-top: 4px;
}

.stat-growth i {
    font-size: 11px;
    color: #27AE60;
}

.stat-percentage {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
}

/* Variantes de colores para stat-cards */
.stat-card-primary {
    border-left: 4px solid #3498DB;
}

.stat-card-primary .stat-card-background {
    color: #3498DB;
}

.stat-card-primary .stat-value {
    color: #3498DB;
}

.stat-card-success {
    border-left: 4px solid #27AE60;
}

.stat-card-success .stat-card-background {
    color: #27AE60;
}

.stat-card-success .stat-value {
    color: #27AE60;
}

.stat-card-warning {
    border-left: 4px solid #F39C12;
}

.stat-card-warning .stat-card-background {
    color: #F39C12;
}

.stat-card-warning .stat-value {
    color: #F39C12;
}

.stat-card-info {
    border-left: 4px solid #8E44AD;
}

.stat-card-info .stat-card-background {
    color: #8E44AD;
}

.stat-card-info .stat-value {
    color: #8E44AD;
}

/* ========== STATS SECUNDARIAS (MINI CARDS) ========== */
.stats-secondary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.stat-mini-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.25s;
    border: 1px solid #F5F5F5;
}

.stat-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-mini-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-mini-blue {
    background: rgba(52, 152, 219, 0.1);
    color: #3498DB;
}

.stat-mini-orange {
    background: rgba(243, 156, 18, 0.1);
    color: #F39C12;
}

.stat-mini-purple {
    background: rgba(142, 68, 173, 0.1);
    color: #8E44AD;
}

.stat-mini-red {
    background: rgba(231, 76, 60, 0.1);
    color: #E74C3C;
}

.stat-mini-green {
    background: rgba(39, 174, 96, 0.1);
    color: #27AE60;
}

.stat-mini-teal {
    background: rgba(22, 160, 133, 0.1);
    color: #16A085;
}

.stat-mini-content {
    flex: 1;
    min-width: 0;
}

.stat-mini-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-mini-label {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-mini-label i {
    font-size: 12px;
    opacity: 0.6;
}

.stat-mini-hint {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 4px;
}

/* ========== ANALYTICS SECTION ========== */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.analytics-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #E8E8E8;
    background: #FFFFFF;
    color: #666;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.filter-btn:hover {
    border-color: #FFD700;
    color: #1a1a1a;
    background: #FFFEF5;
}

.filter-btn.active {
    background: #FFD700;
    border-color: #FFD700;
    color: #1a1a1a;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.analytics-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #F0F0F0;
    transition: all 0.3s;
}

.analytics-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.analytics-card-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.analytics-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.analytics-icon-green {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.analytics-icon-blue {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.analytics-icon-purple {
    background: rgba(156, 39, 176, 0.1);
    color: #9C27B0;
}

.analytics-icon-orange {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.analytics-icon-teal {
    background: rgba(22, 160, 133, 0.1);
    color: #16A085;
}

.analytics-icon-pink {
    background: rgba(233, 30, 99, 0.1);
    color: #E91E63;
}

.analytics-card-title h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.analytics-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.analytics-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    font-weight: 600;
}

.summary-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
}

.summary-value-green {
    color: #27AE60;
}

.summary-value-red {
    color: #E74C3C;
}

.analytics-chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.analytics-chart-container canvas {
    max-height: 280px !important;
}

/* ========== CHARTS GRID ========== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.chart-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Normalizar renderizado entre Windows y Mac */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.chart-card canvas {
    /* Asegurar que las gráficas se rendericen igual en Windows y Mac */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    image-rendering: auto;
}

.chart-card h3 {
    color: var(--dark);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #F8F9FA;
    border-radius: 8px;
}

.info-item .label {
    color: var(--gray);
}

.info-item .value {
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}


/* Card */
.card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card h3 {
    color: var(--dark);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--secondary);
    color: var(--white);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #E0E0E0;
}

.data-table tbody tr:hover {
    background: #F8F9FA;
}

.text-center {
    text-align: center !important;
}

.text-success {
    color: var(--success) !important;
    font-weight: 600;
}

.text-danger {
    color: var(--danger) !important;
    font-weight: 600;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success { background: #D4EDDA; color: #155724; }
.badge.warning { background: #FFF3CD; color: #856404; }
.badge.danger { background: #F8D7DA; color: #721C24; }
.badge.info { background: #D1ECF1; color: #0C5460; }

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form */
.form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Grids */
.cards-grid,
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.menu-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.menu-list-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

/* Estilos para acordeón de categorías del menú */
.menu-category-accordion {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.menu-category-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.2s;
}

.menu-category-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.menu-category-icon {
    transition: transform 0.3s ease;
    color: #666;
}

.menu-category-content {
    padding: 15px;
    background: #fafafa;
    transition: display 0.3s ease;
}

.reward-card,
.menu-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.reward-card:hover,
.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.reward-card img,
.menu-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.reward-card-content,
.menu-card-content {
    padding: 20px;
}

.reward-card h4,
.menu-card h4 {
    color: var(--dark);
    margin: 0 0 10px 0;
    font-size: 18px;
}

.reward-card p,
.menu-card p {
    color: var(--gray);
    font-size: 14px;
    margin: 0 0 15px 0;
}

.menu-list-item {
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex !important;
}

.menu-list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

.reward-points {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 15px;
}

.price {
    color: var(--success);
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 15px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--dark);
    color: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: none;
    animation: slideIn 0.3s;
    z-index: 2000;
}

.toast.show {
    display: block;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s;
}

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

.modal {
    background: var(--white);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid #E0E0E0;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 30px;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 25px;
}

/* Banners */
.banners-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.banner-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.banner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.banner-preview {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    height: 100%;
}

.banner-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
}

.banner-info {
    padding: 15px;
    flex: 1;
}

.banner-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.banner-info p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.banner-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.banner-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

.image-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        width: var(--sidebar-width);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 20px;
        order: 2;
        flex: 1 1 100%;
    }
    
    .header-actions {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }
    
    .language-selector {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .user-info span {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .content {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header h2 {
        font-size: 20px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        font-size: 12px;
        min-width: 800px;
    }
    
    .modal {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
    
    .chart-card {
        margin-bottom: 20px;
    }
}

/* ========== RESPONSIVE UNIVERSAL - MÓVILES PEQUEÑOS (iPhone, Android) ========== */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .logo i {
        font-size: 50px;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .content {
        padding: 15px 10px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 28px;
    }
    
    .stat-info p {
        font-size: 13px;
    }
    
    .btn-primary {
        padding: 12px;
        font-size: 14px;
        min-height: 44px; /* Tamaño táctil mínimo */
    }
    
    .nav-item {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Tamaño táctil mínimo */
    }
    
    .nav-item span {
        font-size: 13px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .chart-card h3 {
        font-size: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* Prevenir zoom en iOS */
        min-height: 44px; /* Tamaño táctil mínimo */
    }
    
    .modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
    }
}

/* ========== ESTILOS ESPECÍFICOS PARA iOS ========== */
@supports (-webkit-touch-callout: none) {
    .os-ios .sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    .os-ios .content {
        -webkit-overflow-scrolling: touch;
    }
    
    .os-ios input,
    .os-ios textarea,
    .os-ios select {
        font-size: 16px !important; /* Prevenir zoom automático en iOS */
    }
    
    .os-ios .modal {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========== ESTILOS ESPECÍFICOS PARA ANDROID ========== */
.os-android .sidebar {
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #1a1a1a;
}

.os-android .content {
    scrollbar-width: thin;
}

/* ========== MEJORAS TÁCTILES UNIVERSALES PARA MÓVILES ========== */
.device-mobile .btn,
.is-mobile .btn,
.device-mobile .nav-item,
.is-mobile .nav-item,
.device-mobile button,
.is-mobile button,
.device-mobile .mobile-menu-toggle,
.is-mobile .mobile-menu-toggle {
    min-height: 44px; /* Tamaño mínimo táctil recomendado */
    min-width: 44px;
    touch-action: manipulation; /* Mejorar respuesta táctil */
    -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
}

.device-mobile .stat-card,
.is-mobile .stat-card {
    touch-action: manipulation;
}

/* ========== ORIENTACIÓN LANDSCAPE EN MÓVILES ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .content {
        padding: 15px;
    }
}

/* ========== EVIDENCE PANEL ========== */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.filter-buttons .btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-buttons .btn.active {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.evidence-card {
    background: var(--white);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid var(--gray);
}

.evidence-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.evidence-card.pending {
    border-left-color: var(--warning);
}

.evidence-card.approved {
    border-left-color: var(--success);
}

.evidence-card.rejected {
    border-left-color: var(--danger);
}

.evidence-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.evidence-info h4 {
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 18px;
}

.evidence-info p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 4px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #FFF3CD;
    color: #856404;
}

.status-badge.approved {
    background: #D4EDDA;
    color: #155724;
}

.status-badge.rejected {
    background: #F8D7DA;
    color: #721C24;
}

.evidence-content {
    margin-bottom: 15px;
}

.evidence-image {
    margin-bottom: 15px;
}

.evidence-image img {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.evidence-image img:hover {
    transform: scale(1.05);
}

.evidence-text {
    background: #F8F9FA;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.evidence-text p {
    color: var(--dark);
    margin-top: 8px;
    line-height: 1.5;
}

.admin-notes {
    background: #E3F2FD;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
}

.admin-notes p {
    color: var(--dark);
    margin-top: 8px;
    font-style: italic;
}

.evidence-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.evidence-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    font-size: 14px;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state i {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.modal-overlay.evidence-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-overlay.evidence-modal.show {
    display: flex;
}

.modal-overlay .modal-content {
    background: var(--white);
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

.modal-overlay .modal-close:hover {
    color: var(--danger);
}

.modal-overlay .modal-body {
    padding: 20px;
    text-align: center;
}

/* Social Media Icons */
.social-icon {
    font-size: 16px;
    margin-right: 8px;
    display: inline-block;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .evidence-grid {
        grid-template-columns: 1fr;
    }
    
    .evidence-actions {
        flex-direction: column;
    }
    
    .evidence-actions .btn {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* ========== AUDIT PAGE STYLES ========== */
.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 36px;
    line-height: 1;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.action-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.action-success {
    background: #d4edda;
    color: #155724;
}

.action-danger {
    background: #f8d7da;
    color: #721c24;
}

.action-warning {
    background: #fff3cd;
    color: #856404;
}

.action-info {
    background: #d1ecf1;
    color: #0c5460;
}

.filters-panel h4 {
    color: var(--dark);
    font-size: 16px;
    font-weight: 600;
}

/* ========== GIFT CARDS STYLES ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card--success {
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%) !important;
}

.stat-card--primary {
    background: linear-gradient(135deg, #3498DB 0%, #2874A6 100%) !important;
}

.stat-card--warning {
    background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%) !important;
}

.stat-card--info {
    background: linear-gradient(135deg, #16A085 0%, #138D75 100%) !important;
}

.stat-card--secondary {
    background: linear-gradient(135deg, #8E44AD 0%, #7D3C98 100%) !important;
}

/* ========== NIVELES Y BADGES - TABLAS MEJORADAS ========== */
#levelsTableBody tr:hover,
#badgesTableBody tr:hover {
    background: linear-gradient(to right, #f8f9fa, #ffffff) !important;
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#levelsTableBody td,
#badgesTableBody td {
    vertical-align: middle !important;
    padding: 16px 12px !important;
}

/* Animación suave para los botones de acción */
#levelsTableBody .btn,
#badgesTableBody .btn {
    transition: all 0.2s ease;
}

#levelsTableBody .btn:hover,
#badgesTableBody .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mejorar los tabs */
.tab-button {
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background: rgba(255, 215, 0, 0.1);
}

.tab-button.active {
    color: #FFD700 !important;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700 0%, #ffed4e 100%);
    border-radius: 2px 2px 0 0;
}

/* ========== MEJORAS UNIVERSALES ADICIONALES ========== */

/* Prevenir selección de texto en elementos interactivos móviles */
.device-mobile .nav-item,
.is-mobile .nav-item,
.device-mobile .btn,
.is-mobile .btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mejorar scroll en todos los dispositivos */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.5) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.8);
}

/* Asegurar que las imágenes se adapten en todos los dispositivos */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Mejorar inputs en móviles */
.device-mobile input[type="text"],
.device-mobile input[type="email"],
.device-mobile input[type="password"],
.device-mobile input[type="number"],
.device-mobile textarea,
.device-mobile select,
.is-mobile input[type="text"],
.is-mobile input[type="email"],
.is-mobile input[type="password"],
.is-mobile input[type="number"],
.is-mobile textarea,
.is-mobile select {
    font-size: 16px !important; /* Prevenir zoom en iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 8px;
}

/* Mejorar botones en todos los dispositivos */
button,
.btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

button:focus,
.btn:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Asegurar que los modales funcionen bien en móviles */
.device-mobile .modal-overlay,
.is-mobile .modal-overlay {
    padding: 10px;
    align-items: flex-end; /* En móviles, modal desde abajo */
}

.device-mobile .modal,
.is-mobile .modal {
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    animation: slideUpMobile 0.3s ease;
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Mejorar tablas en móviles - vista de tarjetas */
@media (max-width: 480px) {
    .data-table {
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: block;
    }
    
    .data-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #E0E0E0;
        border-radius: 8px;
        padding: 15px;
        background: var(--white);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        text-align: right;
    }
    
    .data-table td:before {
        content: attr(data-label) ': ';
        font-weight: 600;
        color: var(--dark);
        text-align: left;
        margin-right: 10px;
    }
}

/* Safe area para iPhone X y superiores */
@supports (padding: max(0px)) {
    .os-ios .header,
    .os-ios .sidebar-footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .os-ios .content {
        padding-bottom: max(30px, env(safe-area-inset-bottom));
    }
}


/* ============================= */
/* MÉTRICAS EXTENDIDAS           */
/* ============================= */

.metrics-filters {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label i {
    color: #FFD700;
}

.filter-select,
.filter-input {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range-inputs span {
    color: #999;
    font-size: 13px;
}

.metrics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #FFD700;
}

.summary-content {
    flex: 1;
}

.summary-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.summary-value {
    font-size: 32px;
    font-weight: 900;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.2;
}

.summary-change {
    font-size: 13px;
    margin-top: 6px;
    font-weight: 600;
}

.summary-change.positive {
    color: #4CAF50;
}

.summary-change.negative {
    color: #F44336;
}

.metrics-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h3 i {
    color: #FFD700;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chart-action-btn:hover {
    border-color: #FFD700;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.metrics-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
}

.table-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-header h3 i {
    color: #FFD700;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-small:hover {
    border-color: #FFD700;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f8f8;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.data-table tbody tr:hover {
    background: #f8f8f8;
}

.data-table .loading,
.data-table .empty,
.data-table .error {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.data-table .error {
    color: #F44336;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive para métricas */
@media (max-width: 768px) {
    .metrics-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }

    .metrics-summary {
        grid-template-columns: 1fr;
    }

    .metrics-charts {
        grid-template-columns: 1fr;
    }

    .metrics-tables {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }
}
