/* ========================================
   STYLES.CSS - SISTEMA TIKTOK COMPLETO
   Versión mejorada con responsive y modales optimizados
   ======================================== */

/* ========== 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;
}

html {
    scroll-behavior: smooth;
}

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;
    overflow-x: hidden;
}

/* ========== NAVBAR ========== */
.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;
    height: auto;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    min-height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

#navLogoContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#navLogoContainer svg,
#navLogoContainer img {
    width: 28px;
    height: 28px;
    fill: white;
    display: block;
    object-fit: contain;
}

#navTextContainer {
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: 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;
    flex-shrink: 0;
}

.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: 11px 11px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 11px 11px;
}

.user-dropdown-item.logout {
    color: var(--danger);
    border-top: 1px solid var(--border);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
    background: transparent;
    border: none;
    z-index: 102;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========== MAIN CONTAINER ========== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: calc(100vh - 64px);
}

.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 ========== */
.card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.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;
}

.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 ========== */
.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 ========== */
.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;
    white-space: nowrap;
}

.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;
    flex-shrink: 0;
}

.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: 11px 11px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 11px 11px;
}

/* ========== TABLE ========== */
.table-container {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: 12px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

tr {
    transition: background 0.1s ease;
}

tr:hover {
    background: var(--bg-secondary);
}

/* Anchos específicos de columnas */
th:nth-child(1), td:nth-child(1) { min-width: 110px; } /* Usuario */
th:nth-child(2), td:nth-child(2) { min-width: 180px; } /* Email */
th:nth-child(3), td:nth-child(3) { min-width: 120px; } /* Pass TikTok */
th:nth-child(4), td:nth-child(4) { min-width: 120px; } /* Pass Email */
th:nth-child(5), td:nth-child(5) { min-width: 100px; } /* Tipo */
th:nth-child(6), td:nth-child(6) { min-width: 90px; } /* País */
th:nth-child(7), td:nth-child(7) { min-width: 110px; } /* Cliente */
th:nth-child(8), td:nth-child(8) { min-width: 100px; } /* Estado */
th:nth-child(9), td:nth-child(9) { min-width: 95px; } /* Fecha */
th:nth-child(10), td:nth-child(10) { min-width: 120px; } /* Notas */
th:nth-child(11), td:nth-child(11) { min-width: 130px; } /* Acciones */

/* Estilos específicos de celdas */
.email-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.password-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.password-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.actions-cell {
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
}

/* Badges */
.username-badge {
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.no-username {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 11px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    white-space: nowrap;
}

.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);
}

.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);
}

.action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.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 MEJORADO ========== */
.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.3s ease;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-primary);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========== FORMS ========== */
.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);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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 ========== */
.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);
    max-width: 400px;
    word-wrap: break-word;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--info);
}

@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;
    flex-shrink: 0;
}

/* ========== ADMINISTRACIÓN ========== */
.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;
}

.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;
}

.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;
}

/* ========== 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;
}

/* ========== 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;
}

.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); }
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 1300px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 12px 16px;
    }

    .hamburger {
        display: flex;
        order: 3;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        max-height: calc(100vh - 64px);
        padding: 16px;
    }

    .nav-link {
        width: 100%;
        padding: 14px 16px;
        text-align: left;
        font-size: 16px;
    }

    .user-menu {
        order: 2;
    }

    .main-container {
        padding: 24px 16px;
    }

    .container {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .search-input {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .stats-container {
        width: 100%;
        overflow-x: auto;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        height: 100%;
    }

    .modal {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 12px 12px;
        gap: 12px;
    }

    .nav-brand {
        font-size: 16px;
        gap: 8px;
    }

    #navLogoContainer svg,
    #navLogoContainer img {
        width: 24px;
        height: 24px;
    }

    #navTextContainer {
        display: none;
    }

    .user-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .user-button span {
        display: none;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .main-container {
        padding: 20px 12px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .dropdown-menu {
        left: auto;
        right: 0;
        min-width: 160px;
    }

    .stats-container {
        flex-direction: column;
        gap: 12px;
    }

    .stats-container .stat-card {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .table-container {
        margin: 0 -12px;
        border-radius: 0;
    }

    th, td {
        padding: 8px 6px;
        font-size: 11px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 2px;
    }

    .action-btn {
        padding: 4px 6px;
        font-size: 11px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .close-btn {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
}

/* ========== CONFIGURACIÓN ADICIONAL ========== */
.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;
}

.preview-navbar {
    background: var(--bg-dark);
    padding: 16px 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
}

.preview-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-logo svg,
.preview-logo img {
    width: 28px;
    height: 28px;
    fill: white;
    object-fit: contain;
}

.preview-text {
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.button-group {
    display: flex;
    gap: 12px;
}

.button-group .btn {
    flex: 1;
}

.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;
}

.list-manager {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.list-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 40px;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.list-item {
    background: var(--accent);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.list-item button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s ease;
}

.list-item button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.add-item-form {
    display: flex;
    gap: 8px;
}

.add-item-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
}

.add-item-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-add {
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.color-picker-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.color-input-group {
    flex: 1;
}

.color-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.color-input-wrapper:hover {
    border-color: var(--accent);
}

.color-input {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hex-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.hex-input:focus {
    outline: none;
    border-color: var(--accent);
}

.preset-colors {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preset-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.actions-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.pt-1 { padding-top: 8px; }
.pt-2 { padding-top: 16px; }
.pt-3 { padding-top: 24px; }

.pb-1 { padding-bottom: 8px; }
.pb-2 { padding-bottom: 16px; }
.pb-3 { padding-bottom: 24px; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }

.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }

.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== TYPE BREAKDOWN (Adicional) ========== */
.type-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.type-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.type-item:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(2px);
}

.type-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.type-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-secondary);
}

/* ========== PRINT ========== */
@media print {
    .navbar,
    .user-menu,
    .toolbar,
    .actions-cell,
    .action-buttons,
    .btn,
    .modal,
    .hamburger,
    .dropdown {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .main-container {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    table {
        font-size: 10pt;
        border: 1px solid #ddd;
    }
    
    th, td {
        border: 1px solid #ddd;
        padding: 8px;
    }
    
    .page-header {
        text-align: center;
        margin-bottom: 20px;
    }
}