/**
 * StreamVault Admin Panel - Estilos Profesionales
 * Diseño moderno con tema oscuro/claro
 */

/* ========== VARIABLES Y TEMAS ========== */
:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --info: #74B9FF;

    /* Dark Theme (default) */
    --bg-primary: #0F0F1A;
    --bg-secondary: #1A1A2E;
    --bg-tertiary: #16213E;
    --bg-card: #1E1E32;
    --bg-hover: #2A2A45;
    --bg-input: #252540;
    --text-primary: #EAEAEA;
    --text-secondary: #A0A0B8;
    --text-muted: #6C6C80;
    --border-color: #2D2D45;
    --shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --glass: rgba(30, 30, 50, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);

    /* Layout */
    --sidebar-width: 270px;
    --sidebar-collapsed: 70px;
    --topbar-height: 65px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #F0F2F5;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-hover: #F0F0F5;
    --bg-input: #F5F5FA;
    --text-primary: #1A1A2E;
    --text-secondary: #6C6C80;
    --text-muted: #A0A0B8;
    --border-color: #E0E0E8;
    --shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.05);
}

/* ========== RESET Y BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ========== APP WRAPPER ========== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== TOP NAVBAR ========== */
.top-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition: var(--transition);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-toggle {
    font-size: 1.5rem;
    color: var(--text-primary);
    padding: 4px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px;
    width: 300px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.search-box i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 10px 0;
    width: 100%;
    font-size: 0.875rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.notification-btn, .theme-toggle {
    position: relative;
    font-size: 1.25rem;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
}

.notification-btn:hover, .theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 20px;
    min-width: 16px;
    text-align: center;
}

.navbar-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 8px;
}

.user-dropdown .btn-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 10px;
    transition: var(--transition);
}

.user-dropdown .btn-link:hover {
    background: var(--bg-hover);
}

.user-avatar i {
    font-size: 1.8rem;
    color: var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.dropdown-item {
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.875rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--topbar-height);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo i {
    font-size: 1.8rem;
    color: var(--primary);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 3px var(--primary)); }
    50% { filter: drop-shadow(0 0 15px var(--primary)); }
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.menu-section {
    margin-bottom: 8px;
}

.menu-label {
    display: block;
    padding: 12px 24px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    margin: 2px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-item a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active a {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.nav-item a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.credit-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(0, 206, 201, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
}

.credit-icon {
    font-size: 1.5rem;
    color: var(--warning);
}

.credit-info {
    display: flex;
    flex-direction: column;
}

.credit-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--warning);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.online-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    flex: 1;
    min-width: 0;
    transition: var(--transition);
}

.content-wrapper {
    padding: 30px;
    width: 100%;
}

/* ========== PAGE HEADER ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-breadcrumb a {
    color: var(--primary);
}

.page-breadcrumb .separator {
    color: var(--text-muted);
}

/* ========== STAT CARDS ========== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.purple { background: rgba(108, 92, 231, 0.15); color: var(--primary); }
.stat-icon.teal { background: rgba(0, 206, 201, 0.15); color: var(--secondary); }
.stat-icon.pink { background: rgba(253, 121, 168, 0.15); color: var(--accent); }
.stat-icon.green { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.stat-icon.orange { background: rgba(225, 112, 85, 0.15); color: var(--danger); }
.stat-icon.blue { background: rgba(116, 185, 255, 0.15); color: var(--info); }
.stat-icon.yellow { background: rgba(253, 203, 110, 0.15); color: var(--warning); }

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.stat-change.positive { background: rgba(0, 184, 148, 0.1); color: var(--success); }
.stat-change.negative { background: rgba(225, 112, 85, 0.1); color: var(--danger); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== CARDS ========== */
.sv-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.sv-card:hover {
    box-shadow: var(--shadow);
}

.sv-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sv-card-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sv-card-title i {
    color: var(--primary);
}

.sv-card-body {
    padding: 24px;
    overflow-x: auto;
}

.sv-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ========== TABLES ========== */
.sv-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sv-table thead th {
    background: var(--bg-tertiary);
    padding: 14px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.sv-table tbody td {
    padding: 14px 20px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.sv-table tbody tr {
    transition: var(--transition);
}

.sv-table tbody tr:hover {
    background: var(--bg-hover);
}

.sv-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== BUTTONS ========== */
.btn-sv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-sv-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-sv-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
    color: white;
}

.btn-sv-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-sv-secondary:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sv-success {
    background: linear-gradient(135deg, var(--success), #00A383);
    color: white;
}

.btn-sv-danger {
    background: linear-gradient(135deg, var(--danger), #D63031);
    color: white;
}

.btn-sv-warning {
    background: linear-gradient(135deg, var(--warning), #E5B85C);
    color: #1A1A2E;
}

.btn-sv-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sv-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
}

.btn-icon.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(225, 112, 85, 0.1);
}

/* ========== FORMS ========== */
.sv-form-group {
    margin-bottom: 20px;
}

.sv-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sv-form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
}

.sv-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.sv-form-control::placeholder {
    color: var(--text-muted);
}

.sv-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C6C80' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ========== BADGES ========== */
.sv-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.sv-badge-success { background: rgba(0, 184, 148, 0.12); color: var(--success); }
.sv-badge-danger { background: rgba(225, 112, 85, 0.12); color: var(--danger); }
.sv-badge-warning { background: rgba(253, 203, 110, 0.12); color: var(--warning); }
.sv-badge-info { background: rgba(116, 185, 255, 0.12); color: var(--info); }
.sv-badge-primary { background: rgba(108, 92, 231, 0.12); color: var(--primary); }
.sv-badge-secondary { background: var(--bg-hover); color: var(--text-secondary); }

.sv-badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ========== SERVER TYPE BADGES ========== */
.server-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-type.emby {
    background: linear-gradient(135deg, rgba(82, 181, 68, 0.15), rgba(82, 181, 68, 0.05));
    color: #52B544;
    border: 1px solid rgba(82, 181, 68, 0.2);
}

.server-type.jellyfin {
    background: linear-gradient(135deg, rgba(0, 164, 220, 0.15), rgba(0, 164, 220, 0.05));
    color: #00A4DC;
    border: 1px solid rgba(0, 164, 220, 0.2);
}

.server-type.plex {
    background: linear-gradient(135deg, rgba(229, 167, 58, 0.15), rgba(229, 167, 58, 0.05));
    color: #E5A73A;
    border: 1px solid rgba(229, 167, 58, 0.2);
}

/* ========== MODALS ========== */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

.btn-close {
    filter: var(--text-primary);
}

/* ========== ALERTS ========== */
.sv-alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    border-left: 4px solid;
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sv-alert-success { background: rgba(0, 184, 148, 0.08); border-color: var(--success); color: var(--success); }
.sv-alert-danger { background: rgba(225, 112, 85, 0.08); border-color: var(--danger); color: var(--danger); }
.sv-alert-warning { background: rgba(253, 203, 110, 0.08); border-color: var(--warning); color: var(--warning); }
.sv-alert-info { background: rgba(116, 185, 255, 0.08); border-color: var(--info); color: var(--info); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-state i {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* ========== LOADING ========== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ========== SERVER STATUS INDICATOR ========== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: status-pulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--danger);
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== LOGIN PAGE ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15), transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 206, 201, 0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-brand i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 16px;
    display: block;
    animation: pulse-glow 2s ease-in-out infinite;
}

.login-brand h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

.login-error {
    background: rgba(225, 112, 85, 0.1);
    border: 1px solid rgba(225, 112, 85, 0.2);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.875rem;
    text-align: center;
}

/* ========== ACTIVITY LIST ========== */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
}

.activity-text {
    font-size: 0.875rem;
    line-height: 1.4;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .top-navbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }
}

/* ========== ANIMATIONS ========== */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== CHART PLACEHOLDER ========== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ========== PAGINATION ========== */
.sv-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.sv-pagination a, .sv-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.sv-pagination a {
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.sv-pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.sv-pagination .active-page {
    background: var(--primary);
    color: white;
    border: none;
}

/* ========== TOOLTIP ========== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ========== DROPDOWN MENUS (Bootstrap override for dark theme) ========== */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: 0.82rem;
    z-index: 1050;
}

.dropdown-menu .dropdown-item {
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-menu .dropdown-item i {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
}

.dropdown-menu .dropdown-divider {
    border-color: var(--border-color);
    margin: 4px 0;
}

.dropdown-menu .dropdown-item.text-danger { color: var(--danger) !important; }
.dropdown-menu .dropdown-item.text-warning { color: var(--warning) !important; }
.dropdown-menu .dropdown-item.text-danger:hover { background: rgba(214,48,49,0.1); }
.dropdown-menu .dropdown-item.text-warning:hover { background: rgba(253,203,110,0.1); }

/* Fix dropdowns inside tables: use fixed strategy so they aren't clipped */
.sv-table .dropdown-menu {
    position: fixed !important;
    z-index: 1080;
}

/* Compact table rows for servers */
.sv-table.sv-table-compact tbody td {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.sv-table.sv-table-compact thead th {
    padding: 8px 12px;
    font-size: 0.7rem;
}

/* ========== PACKAGE CARDS (Create Line Modal) ========== */
.pkg-card {
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.pkg-card:hover:not(.pkg-disabled) {
    border-color: var(--primary);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}
.pkg-card.pkg-selected {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    box-shadow: 0 0 0 1px var(--primary);
}
.pkg-card.pkg-disabled {
    opacity: 0.45;
}
.pkg-card.pkg-promo {
    border-color: var(--warning);
}
.pkg-card.pkg-promo.pkg-selected {
    border-color: var(--primary);
}
.pkg-promo-tag {
    position: absolute;
    top: 0;
    right: 12px;
    background: var(--warning);
    color: #1a1a2e;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pkg-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.2;
}
.pkg-card-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.pkg-card-price {
    text-align: right;
    flex-shrink: 0;
    margin-left: 10px;
}
.pkg-card-cost {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--warning);
    line-height: 1;
}
.pkg-card-unit {
    font-size: 0.6rem;
    color: var(--text-muted);
}
.pkg-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}
.pkg-tag {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════
   SEMÁFORO / EXPIRY ALERT SYSTEM
   ══════════════════════════════════════════════ */

/* Dots indicadores */
.expiry-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.expiry-dot.expiry-red {
    background: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
}
.expiry-dot.expiry-yellow {
    background: #f39c12;
    box-shadow: 0 0 6px rgba(243, 156, 18, 0.4);
}
.expiry-dot.expiry-green {
    background: #27ae60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.4);
}

/* Badges de expiración */
.expiry-badge-red {
    background: rgba(231, 76, 60, 0.15) !important;
    color: #e74c3c !important;
    border: 1px solid rgba(231, 76, 60, 0.25);
}
.expiry-badge-yellow {
    background: rgba(243, 156, 18, 0.15) !important;
    color: #f39c12 !important;
    border: 1px solid rgba(243, 156, 18, 0.25);
}
.expiry-badge-green {
    background: rgba(39, 174, 96, 0.15) !important;
    color: #27ae60 !important;
    border: 1px solid rgba(39, 174, 96, 0.25);
}

/* Filas de tabla con semáforo */
.expiry-row-red {
    background: rgba(231, 76, 60, 0.06) !important;
    border-left: 3px solid #e74c3c;
}
.expiry-row-red:hover {
    background: rgba(231, 76, 60, 0.12) !important;
}
.expiry-row-yellow {
    background: rgba(243, 156, 18, 0.05) !important;
    border-left: 3px solid #f39c12;
}
.expiry-row-yellow:hover {
    background: rgba(243, 156, 18, 0.10) !important;
}

/* Card de alerta */
.expiry-alert-card {
    border: 1px solid rgba(231, 76, 60, 0.25) !important;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.08);
}
.expiry-alert-card .sv-card-header {
    background: rgba(231, 76, 60, 0.04);
}

/* Animación shake para la campana */
@keyframes bellShake {
    0%   { transform: rotate(0); }
    15%  { transform: rotate(14deg); }
    30%  { transform: rotate(-12deg); }
    45%  { transform: rotate(10deg); }
    60%  { transform: rotate(-8deg); }
    75%  { transform: rotate(4deg); }
    100% { transform: rotate(0); }
}
.expiry-bell-shake {
    animation: bellShake 0.8s ease-in-out;
    animation-iteration-count: 3;
    transform-origin: top center;
}

/* Campana con alertas */
.notif-has-alerts {
    color: #e74c3c !important;
    position: relative;
}
.notif-has-alerts i {
    font-size: 1.15rem;
}
.notification-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.6rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--bg-primary);
    line-height: 1;
}

/* Pulse en el dot rojo */
.expiry-dot.expiry-red {
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(231, 76, 60, 0.4); }
    50%      { box-shadow: 0 0 12px rgba(231, 76, 60, 0.8); }
}
