/* ========================================
   STYLES.CSS - Sistema TikTok OPTIMIZADO Y CORREGIDO
   CSS compartido para toda la aplicación
   ======================================== */

/* ========== VARIABLES CSS ========== */
:root {
    --primary: #1e1b4b;
    --accent: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e1b4b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== NAVBAR FIJA (CORREGIDA - No crece con el logo) ========== */
.navbar {
    background: var(--bg-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 64px !important;
    max-height: 64px !important;
    height: 64px !important;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px !important;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    min-height: 64px !important;
    max-height: 64px !important;
    height: 64px !important;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 18px;
    padding: 8px 0;
}

#navLogoContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-height: 56px;
    overflow: visible;
}

#navLogoContainer svg,
#navLogoContainer img {
    width: 28px;
    height: 28px;
    fill: white;
    display: block;
    object-fit: contain;
    transition: all 0.2s ease;
    max-height: 56px !important;
}

#navTextContainer {
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.15s ease;
    display: inline-block;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.user-menu {
    position: relative;
    margin-left: auto;
}

.user-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s ease;
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.15s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.user-dropdown-item:hover {
    background: var(--bg-secondary);
}

.user-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.user-dropdown-item.logout {
    color: var(--danger);
    border-top: 1px solid var(--border);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========== MAIN CONTAINER ========== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ========== PAGE HEADER ========== */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ========== CARDS (Optimizado) ========== */
.card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
    will-change: transform;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== STATS CARDS (Optimizado) ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    will-change: transform;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-footer {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-change {
    font-weight: 600;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ========== CHARTS ========== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* ========== ACTIVITY CARD ========== */
.activity-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.activity-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    transition: background 0.15s ease;
    margin-bottom: 8px;
}

.activity-item:hover {
    background: var(--bg-secondary);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== HEADER (Panel) ========== */
.header {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.stats-container {
    display: flex;
    gap: 24px;
}

.stats-container .stat-card {
    min-width: 120px;
    padding: 16px;
    text-align: center;
    margin: 0;
}

.stats-container .stat-value {
    font-size: 28px;
    margin-bottom: 4px;
}

.stats-container .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== TOOLBAR ========== */
.toolbar {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.toolbar-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input {
    position: relative;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    pointer-events: none;
}

.search-input input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.15s ease;
    background: var(--bg-secondary);
}

.search-input input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 160px;
}

.filter-select:hover {
    border-color: var(--accent);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

/* ========== BUTTONS (Optimizado) ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    will-change: transform;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btn-dropdown {
    position: relative;
}

.btn-dropdown::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 4px;
}

/* ========== DROPDOWN ========== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.15s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

/* ========== TABLE (Optimizado) ========== */
.table-container {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
}

tr {
    transition: background 0.1s ease;
}

tr:hover {
    background: var(--bg-secondary);
}

.password-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-toggle {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
    font-size: 16px;
}

.password-toggle:hover {
    background: var(--bg-secondary);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-disponible {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-vendida {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-reservada {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-desactivada {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
}

.action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.action-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ========== MODAL (Optimizado) ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* ========== FORM ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.15s ease;
    background: var(--bg-secondary);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    flex: 1;
}

/* ========== CLIENTS ========== */
.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 8px;
}

.client-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== TOAST (Optimizado) ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.2s ease-out;
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== ICONS ========== */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ========== ADMINISTRACIÓN ========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.live-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.live-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-number {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.live-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.alert {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--info);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
}

.alert-icon {
    flex-shrink: 0;
    color: var(--info);
}

.alert-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== CONFIGURACIÓN ========== */
.config-card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.config-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.config-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.config-body {
    padding: 24px;
}

.config-section {
    margin-bottom: 32px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.config-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.color-option {
    cursor: pointer;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.15s ease;
    text-align: center;
}

.color-option:hover {
    border-color: var(--border);
    background: var(--bg-secondary);
}

.color-option.active {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.color-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.color-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.logo-upload-area:hover,
.logo-upload-area.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.logo-preview {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.logo-preview svg,
.logo-preview img {
    max-width: 60px;
    max-height: 60px;
    fill: var(--accent);
}

.logo-preview img {
    object-fit: contain;
}

.upload-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.switch-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.2s ease;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.2s ease;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.preview-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ========== VISTA PREVIA DE NAVBAR (CORREGIDA) ========== */
.preview-navbar {
    background: var(--bg-dark);
    padding: 16px 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px !important;
    max-height: 64px !important;
    height: 64px !important;
}

.preview-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-height: 56px;
}

.preview-logo svg,
.preview-logo img {
    width: 28px;
    height: 28px;
    fill: white;
    object-fit: contain;
    transition: all 0.2s ease;
    max-width: 100%;
    max-height: 56px !important;
}

.preview-text {
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.button-group {
    display: flex;
    gap: 12px;
}

.button-group .btn {
    flex: 1;
}

/* ========== SLIDER DE TAMAÑO DE LOGO (MEJORADO) ========== */
.logo-size-container {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
}

.size-label {
    font-size: 14px;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    color: var(--text-secondary);
}

.slider-wrapper {
    flex: 1;
    position: relative;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) 50%, var(--border) 50%, var(--border) 100%);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.size-value {
    font-weight: 700;
    color: var(--accent);
    min-width: 60px;
    text-align: center;
    font-size: 18px;
}

.size-presets {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

/* ========== LOGIN PAGE ========== */
.login-page {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-container {
    background: var(--bg-primary);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 48px 32px;
    text-align: center;
    color: white;
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.brand-logo svg,
.brand-logo img {
    width: 48px;
    height: 48px;
    fill: white;
}

.brand-logo img {
    object-fit: contain;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 15px;
    opacity: 0.9;
}

.login-body {
    padding: 32px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    pointer-events: none;
}

.input-wrapper .form-control {
    padding-left: 48px;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.password-toggle:hover {
    background: var(--bg-secondary);
}

.password-toggle .icon {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.checkbox-wrapper label {
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.login-body .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    justify-content: center;
}

.footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.loading {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-container {
        padding: 12px 16px !important;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-container {
        width: 100%;
        overflow-x: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 800px;
    }

    .main-container,
    .container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 24px;
    }

    .header h1 {
        font-size: 24px;
    }

    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .button-group {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .login-container {
        border-radius: 16px;
    }

    .login-header {
        padding: 32px 24px;
    }

    .login-body {
        padding: 24px;
    }
}