/* Reset y Variables CSS - Tema Oscuro */
:root {
    --primary-color: #3b82f6;
    --primary-rgb: 59, 130, 246;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Fondos Oscuros */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-dark: #0f172a;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    /* Textos para tema oscuro */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    --text-muted: #64748b;
    
    /* Bordes para tema oscuro */
    --border-color: #334155;
    --border-light: #475569;
    --border-dark: #1e293b;
    
    /* Sombras para tema oscuro */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius: 0.75rem;
    
    --sidebar-width: 280px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Tema oscuro solo para la página de login */
body.login-page {
    background-color: #212125;
    color: #ffffff;
}

/* Layout Principal */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0f172a 100%);
    color: var(--text-white);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 0.25rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.sidebar-nav li.active a {
    background: var(--primary-color);
    color: var(--text-white);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.sidebar-nav a i {
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-info i {
    font-size: 1.5rem;
    color: var(--text-light);
}

.user-info strong {
    display: block;
    font-size: 0.875rem;
    color: var(--text-white);
}

.user-info small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: capitalize;
}

.logout-btn {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

/* Contenido Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Asegurar tema claro para el panel interno */
.content-wrapper {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.card, .stats-card, .activity-card {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.table {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.table th {
    background-color: var(--bg-tertiary);
    color: var(--text-white);
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
}

.table td {
    color: var(--text-white);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.content-header {
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-header h1 {
    color: var(--text-primary);
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-header h1 i {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Contenido */
.content-body {
    padding: 2rem;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-dark);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
    border-color: #475569;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
    transform: translateY(-1px);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-white);
    border-color: #d97706;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error-color);
    color: var(--text-white);
    border-color: #dc2626;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

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

.btn-info:hover:not(:disabled) {
    background: #0891b2;
    transform: translateY(-1px);
}

/* Alertas */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    border: 1px solid;
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.alert i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(34, 197, 94, 0.1));
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-success i {
    color: var(--success-color);
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.1));
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.alert-error i {
    color: var(--error-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-warning i {
    color: var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(34, 211, 238, 0.1));
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.3);
}

.alert-info i {
    color: var(--info-color);
}

/* Cards */
.card {
    background: #2a2a2a;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #404040;
    overflow: hidden;
    color: #ffffff;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #404040;
    background: #1f1f1f;
    color: #ffffff;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #404040;
    background: #1f1f1f;
    color: #ffffff;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 20px rgba(var(--primary-rgb), 0.15);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.stat-card:active {
    transform: translateY(-1px) scale(1.01);
    transition: all 0.1s ease;
}

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

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-icon,
.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-card:hover .stat-card-icon,
.stat-card:hover .stat-icon {
    transform: scale(1.1);
    text-shadow: 0 0 10px currentColor;
}

.stat-card-icon.primary,
.stat-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-card-icon.purple {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-card-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.stat-card-value,
.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-card:hover .stat-card-value,
.stat-card:hover .stat-content h3 {
    font-weight: 800;
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.3);
}

.stat-content {
    position: relative;
    z-index: 1;
}

.stat-content p {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-card:hover .stat-content p {
    font-weight: 600;
}

.stat-card-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-change.positive {
    color: var(--success-color);
}

.stat-card-change.negative {
    color: var(--error-color);
}

/* Estilos para tarjetas de estadísticas activas e inactivas */
.stat-card.purple {
    background: rgba(147, 51, 234, 0.08);
    border-color: rgba(147, 51, 234, 0.25);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.1);
}

.stat-card.purple .stat-icon {
    background: rgba(147, 51, 234, 0.15);
    color: #9333ea;
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.2);
}

.stat-card.purple:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 30px rgba(147, 51, 234, 0.2), 0 0 25px rgba(147, 51, 234, 0.15);
    border-color: rgba(147, 51, 234, 0.4);
    background: rgba(147, 51, 234, 0.12);
}

.stat-card.blue {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.stat-card.blue .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.stat-card.blue:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.2), 0 0 25px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.12);
}

.stat-card.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.stat-card.active .stat-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.stat-card.active:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.2), 0 0 25px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
}

.stat-card.inactive {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.stat-card.inactive .stat-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.stat-card.inactive:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.2), 0 0 25px rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
}

/* Tablas */

.stream-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stream-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
}

.stream-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.25), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stream-card:hover::after {
    opacity: 1;
}

.stream-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.stream-card strong {
    font-size: 1.5rem;
    color: var(--text-white);
    display: block;
}

.stream-card small,
.stream-card .card-label {
    color: var(--text-light);
    display: block;
    font-size: 0.85rem;
}

.stream-card.primary .card-icon { color: var(--primary-color); }
.stream-card.success .card-icon { color: var(--success-color); }
.stream-card.warning .card-icon { color: var(--warning-color); }
.stream-card.info .card-icon { color: var(--info-color); }

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(18px);
}

.streams-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.streams-table th {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.35), rgba(15, 23, 42, 0.9));
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-white);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.streams-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    vertical-align: middle;
    color: var(--text-white);
    background: rgba(15, 23, 42, 0.6);
    font-weight: 500;
    transition: all 0.3s ease;
}

.streams-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.15);
    transform: scale(1.005);
}

.streams-table tbody tr {
    transition: all 0.3s ease;
}

.streams-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-white);
    font-weight: 500;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
}

/* Test Results */
.test-result {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.test-success {
    color: var(--success-color);
}

.test-error {
    color: var(--error-color);
}

.test-pending {
    color: var(--text-secondary);
}

/* Stream URL */
.stream-url {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    background: var(--bg-primary);
    color: var(--text-white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* Filtros */
.filters-bar {
    background: var(--bg-primary);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-white);
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    color: var(--text-white);
    font-weight: 500;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.filter-group input[type="text"] {
    min-width: 200px;
}

.filter-actions {
    margin-left: auto;
}

/* Paginación */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-top: 1.5rem;
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Formularios */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #000000;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #404040;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 5% auto;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
    color: #000000;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(248, 250, 252, 0.8);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000000;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal form {
    padding: 1.5rem;
}

/* Login Page */
.login-page {
    margin: 0;
    padding: 0;
    background: #121212;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}



.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    padding: 3rem 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    border: none;
    transition: none;
}



.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 3rem;
    color: rgba(46, 130, 75, 0.253);
    margin-bottom: 1.5rem;
    display: block;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-header p {
    color: #b3b3b3;
    font-size: 1rem;
    font-weight: 400;
}

.login-form {
    margin-bottom: 2rem;
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 2rem;
    position: relative;
}

.login-form label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.login-form label i {
    margin-right: 0.75rem;
    color: rgba(29, 185, 84, 0.4);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.login-form input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid #333333;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: #2a2a2a;
    color: #ffffff;
    font-weight: 400;
}

.login-form input::placeholder {
    color: #737373;
    font-weight: 400;
}

.login-form input:focus {
    outline: none;
    border-color: rgba(29, 185, 84, 0.4);
    background-color: #2a2a2a;
}

.login-form input:hover {
    border-color: #404040;
}

.btn-login {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    background: rgba(29, 185, 84, 0.4);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background: rgba(30, 215, 96, 0.6);
}

.btn-login:active {
    background: rgba(26, 163, 74, 0.6);
}

.btn-login i {
    font-size: 1.1rem;
}

.login-footer {
    margin-top: 2.5rem;
    padding-top: 1rem;
    text-align: center;
}



.version-info {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header {
        padding: 1rem 1.5rem;
    }
    
    .content-body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-actions {
        margin-left: 0;
    }
    
    .streams-table {
        font-size: 0.75rem;
    }
    
    .streams-table th,
    .streams-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .login-card {
        padding: 1.5rem;
    }
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

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

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in-up {
    animation: slideInUp 0.3s ease;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Dashboard Grid y Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: var(--text-primary);
    backdrop-filter: blur(10px);

}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dashboard-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mejorar legibilidad de textos en dashboard */
.dashboard-card p,
.dashboard-card .description,
.dashboard-card .text-content {
    color: var(--text-white) !important;
    font-weight: 500;
}

.dashboard-card small,
.dashboard-card .text-muted {
    color: var(--text-light) !important;
    font-weight: 400;
}

.dashboard-card h3 i {
    color: var(--primary-color);
}

/* Estilos para el gráfico */
#streamsChart {
    max-width: 100%;
    height: 300px !important;
    width: 100% !important;
}

.dashboard-card canvas {
    display: block;
    margin: 0 auto;
}

/* Actividad */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.activity-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-white);
    font-weight: 500;
}

.activity-content small {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 400;
}

.no-activity {
    text-align: center;
    color: var(--text-primary);
    font-style: italic;
    font-weight: 500;
    padding: 2rem;
}

/* Acciones rápidas */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.quick-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.quick-action:hover::before {
    left: 100%;
}

.quick-action:hover {
    background: rgba(33, 82, 188, 0.15);
    border-color: rgba(33, 82, 188, 0.4);
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 20px rgba(33, 82, 188, 0.2);
}

.quick-action:active {
    transform: translateY(-1px) scale(1.01);
    transition: all 0.1s ease;
}

.quick-action i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.quick-action:hover i {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(33, 82, 188, 0.3);
}

.quick-action span {
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.quick-action:hover span {
    font-weight: 600;
}

.quick-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Mejoras globales de legibilidad para tema oscuro */
.stats-card p,
.stats-card .stat-number,
.stats-card .stat-label,
.card-body p,
.card-body span,
.card-body div {
    color: var(--text-white) !important;
    font-weight: 500;
}

.stats-card small,
.card-body small,
.text-secondary {
    color: var(--text-light) !important;
}

/* Mejorar contraste de textos en elementos específicos */
.stream-url,
.code,
pre,
.monospace {
    background: var(--bg-primary) !important;
    color: var(--text-white) !important;
    border: 1px solid var(--border-color) !important;
}

/* Mejoras específicas para manage-streams.php */
.streams-table td strong {
    color: var(--text-white) !important;
    font-weight: 600;
}

.streams-table td small {
    color: var(--text-light) !important;
    font-weight: 400;
}

.table-container td,
.table-container th,
.table-container p,
.table-container span {
    color: var(--text-white) !important;
}

.table-container small {
    color: var(--text-light) !important;
}

/* Sistema de Notificaciones */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}

.notification {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--info-color);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    overflow: hidden;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

.notification-success {
    border-left-color: var(--success-color);
}

.notification-error {
    border-left-color: var(--error-color);
}

.notification-warning {
    border-left-color: var(--warning-color);
}

.notification-info {
    border-left-color: var(--info-color);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
}

.notification-content i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-success .notification-content i {
    color: var(--success-color);
}

.notification-error .notification-content i {
    color: var(--error-color);
}

.notification-warning .notification-content i {
    color: var(--warning-color);
}

.notification-info .notification-content i {
    color: var(--info-color);
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Mejoras para alertas del servidor */
.alert {
    position: relative;
    transition: all 0.3s ease;
}

.alert-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal de Confirmación */

/* Modal de Confirmación Moderno */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirmation-modal.show {
    opacity: 1;
}

.confirmation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.confirmation-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.7) translateY(-50px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirmation-modal.show .confirmation-modal-content {
    transform: scale(1) translateY(0);
}

.confirmation-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.confirmation-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.confirmation-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.confirmation-modal-body {
    padding: 1.5rem 2rem;
    text-align: center;
}

.confirmation-modal-body p {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #666;
    line-height: 1.5;
}

.confirmation-details {
    margin-top: 1rem;
    text-align: left;
}

.confirmation-details .alert {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
}

.confirmation-modal-footer {
    padding: 1.5rem 2rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid #e9ecef;
}

.confirmation-modal-footer .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.confirmation-modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.confirmation-modal-footer .btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
}

.confirmation-modal-footer .btn-danger:hover {
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .confirmation-modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .confirmation-modal-footer {
        flex-direction: column;
    }
    
    .confirmation-modal-footer .btn {
        width: 100%;
    }
}

