/* ============================================
   VyntrixMonitor — Design System
   Paleta: Dourado + Preto + Branco
   Premium IPTV Monitoring Dashboard
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* Gold Palette */
    --gold-50: #FFF9E6;
    --gold-100: #FFF0BF;
    --gold-200: #FFE699;
    --gold-300: #FFD966;
    --gold-400: #F4D03F;
    --gold-500: #D4AF37;
    --gold-600: #B8960F;
    --gold-700: #9A7B0A;
    --gold-800: #7C6308;
    --gold-900: #5E4B06;

    /* Primary Gold */
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --gold-dark: #B8860B;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #F4D03F 50%, #D4AF37 100%);
    --gold-gradient-dark: linear-gradient(135deg, #B8860B 0%, #D4AF37 100%);
    --gold-shimmer: linear-gradient(90deg, #D4AF37 0%, #F4D03F 25%, #D4AF37 50%, #F4D03F 75%, #D4AF37 100%);

    /* Backgrounds */
    --bg-primary: #050505;
    --bg-secondary: #0A0A0A;
    --bg-card: #111111;
    --bg-card-hover: #1A1A1A;
    --bg-input: #141414;
    --bg-sidebar: #080808;
    --bg-modal: rgba(0, 0, 0, 0.85);

    /* Glass Effect */
    --glass-bg: rgba(17, 17, 17, 0.7);
    --glass-border: rgba(212, 175, 55, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #666666;
    --text-gold: #D4AF37;

    /* Status Colors */
    --success: #00C853;
    --success-bg: rgba(0, 200, 83, 0.1);
    --danger: #FF1744;
    --danger-bg: rgba(255, 23, 68, 0.1);
    --warning: #FF9100;
    --warning-bg: rgba(255, 145, 0, 0.1);
    --info: #2196F3;
    --info-bg: rgba(33, 150, 243, 0.1);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-gold: rgba(212, 175, 55, 0.3);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 4px 24px rgba(212, 175, 55, 0.2);
    --shadow-gold-lg: 0 8px 40px rgba(212, 175, 55, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 300ms ease;
    --transition-slow: 500ms ease;

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --container-max: 1400px;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-light);
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================
   Scrollbar Custom
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

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

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
    animation: loginBgPulse 15s ease-in-out infinite;
}

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

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
    animation: loginSlideUp 0.6s ease;
}

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

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

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    background: var(--bg-card);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-icon {
    position: relative;
}

.form-input-icon .form-input {
    padding-left: 44px;
}

.form-input-icon .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color var(--transition-fast);
}

.form-input-icon:focus-within .icon {
    color: var(--gold);
}

select.form-input {
    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='%23B0B0B0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-gold {
    background: var(--gold-gradient);
    color: #000;
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    background: var(--gold-gradient-dark);
    box-shadow: var(--shadow-gold-lg);
    transform: translateY(-1px);
    color: #000;
}

.btn-gold-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.btn-gold-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-light);
}

.btn-dark {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-dark:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-gold);
}

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

.btn-danger:hover {
    background: #e0123c;
    box-shadow: 0 4px 16px rgba(255, 23, 68, 0.3);
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    margin-left: 4px;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Layout — Dashboard
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand h2 {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand .sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px;
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(212, 175, 55, 0.06);
    color: var(--gold-light);
}

.nav-link.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--gold-gradient);
    border-radius: 2px;
}

.nav-link .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-link .badge {
    margin-left: auto;
    background: var(--gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gold-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-status {
    font-size: 0.75rem;
    color: var(--success);
}

.sidebar-user .user-status.expired {
    color: var(--danger);
}

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

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 1.3rem;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Page Content */
.page-content {
    padding: 32px;
    max-width: var(--container-max);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--glass-border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    border-color: var(--glass-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

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

.stat-icon.gold {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-icon.blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-info h4 {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-value .unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 4px;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Progress Bar (Connection Usage)
   ============================================ */
.progress-container {
    margin-top: 12px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.progress-label .label {
    color: var(--text-secondary);
}

.progress-label .value {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gold-gradient);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: progressShimmer 2s ease infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.warning {
    background: linear-gradient(135deg, var(--warning), #FF6D00);
}

.progress-fill.critical {
    background: linear-gradient(135deg, var(--danger), #FF5722);
    animation: progressPulse 1.5s ease infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

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

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

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 23, 68, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(255, 145, 0, 0.2);
}

.badge-gold {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(33, 150, 243, 0.2);
}

/* Live dot animation */
.badge-success::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(0, 200, 83, 0); }
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 10px 20px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.tab-btn.active {
    background: var(--gold-gradient);
    color: #000;
    font-weight: 600;
    box-shadow: var(--shadow-gold);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFade 0.3s ease;
}

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

/* ============================================
   Alerts / Flash Messages
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: alertSlide 0.3s ease;
    border: 1px solid;
}

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

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(0, 200, 83, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(255, 23, 68, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(255, 145, 0, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(33, 150, 243, 0.2);
}

.alert .close-alert {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: opacity var(--transition-fast);
}

.alert .close-alert:hover {
    opacity: 1;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   Updates List
   ============================================ */
.update-list {
    list-style: none;
}

.update-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.update-item:hover {
    background: var(--bg-card-hover);
}

.update-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.update-icon.canais {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info);
}

.update-icon.filmes {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
}

.update-icon.series {
    background: rgba(156, 39, 176, 0.1);
    color: #CE93D8;
}

.update-info {
    flex: 1;
    min-width: 0;
}

.update-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.update-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.update-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============================================
   Countdown Timer
   ============================================ */
.countdown {
    display: flex;
    gap: 12px;
}

.countdown-block {
    text-align: center;
}

.countdown-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 14px;
    min-width: 52px;
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.page-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    flex-direction: column;
    gap: 16px;
}

.page-loader span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .page-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 0 16px;
    }

    .header-left h1 {
        font-size: 1.1rem;
    }

    .countdown {
        gap: 8px;
    }

    .countdown-value {
        font-size: 1.2rem;
        padding: 6px 10px;
        min-width: 44px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .login-card {
        padding: 28px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.4s ease;
}

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

/* Stagger animation for stat cards */
.stat-card:nth-child(1) { animation: slideUp 0.4s ease 0.0s both; }
.stat-card:nth-child(2) { animation: slideUp 0.4s ease 0.1s both; }
.stat-card:nth-child(3) { animation: slideUp 0.4s ease 0.2s both; }
.stat-card:nth-child(4) { animation: slideUp 0.4s ease 0.3s both; }

/* Table row animation */
.data-table tbody tr {
    animation: tableRowFade 0.3s ease both;
}

.data-table tbody tr:nth-child(1) { animation-delay: 0.0s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.03s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.09s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.12s; }
.data-table tbody tr:nth-child(6) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(7) { animation-delay: 0.18s; }
.data-table tbody tr:nth-child(8) { animation-delay: 0.21s; }
.data-table tbody tr:nth-child(9) { animation-delay: 0.24s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.27s; }

@keyframes tableRowFade {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   Install Wizard
   ============================================ */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.install-container {
    width: 100%;
    max-width: 600px;
}

.install-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.install-header {
    padding: 32px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), transparent);
}

.install-header h1 {
    font-size: 1.5rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.install-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.install-step {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    transition: background var(--transition);
}

.install-step.active {
    background: var(--gold);
}

.install-step.done {
    background: var(--success);
}

.install-body {
    padding: 32px;
}

.install-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

/* ============================================
   Admin Sidebar Extension
   ============================================ */
.sidebar.admin-sidebar .nav-link.active {
    background: rgba(212, 175, 55, 0.15);
}

/* ============================================
   Utility Classes
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.hidden { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
