/* ========================================
   ASSINATURAS CSS
   ======================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --accent-primary: #e74c3c;
    --accent-secondary: #ff6b5b;
    --accent-gradient: linear-gradient(135deg, #e74c3c 0%, #ff6b5b 100%);
    --text-primary: #ffffff;
    --text-secondary: #8a8a9a;
    --text-muted: #5a5a6a;
    --success: #00d4aa;
    --warning: #ffc107;
    --danger: #ff4757;
    --info: #3498db;
    --purple: #a855f7;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(231, 76, 60, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* LOADING */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 20px;
}
.loading-screen.hidden { display: none; }
.loading-spinner {
    width: 50px; height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-text { color: var(--text-secondary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* LAYOUT */
.dashboard-container { display: flex; min-height: 100vh; }
.dashboard-container.hidden { display: none; }

/* SIDEBAR */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo { display: flex; align-items: center; gap: 12px; padding-bottom: 30px; border-bottom: 1px solid var(--border-color); margin-bottom: 30px; }
.logo-icon { width: 45px; height: 45px; background: var(--accent-gradient); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: var(--shadow-glow); }
.logo-text { font-size: 18px; font-weight: 700; }
.logo-text span { color: var(--accent-primary); }

.nav-section { margin-bottom: 30px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 15px; padding-left: 15px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; color: var(--text-secondary); font-weight: 500; margin-bottom: 5px; text-decoration: none; }
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent-gradient); color: white; box-shadow: var(--shadow-glow); }
.nav-icon { font-size: 20px; width: 24px; text-align: center; }

/* MAIN CONTENT */
.main-content { flex: 1; margin-left: 260px; padding: 30px 40px; width: calc(100% - 260px); }

/* HEADER */
.header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.header-left h1 { font-size: 28px; font-weight: 700; margin-bottom: 5px; }
.header-left p { color: var(--text-secondary); font-size: 15px; }
.header-right { display: flex; flex-direction: row; align-items: center; gap: 15px; }

.btn-primary { background: var(--accent-gradient); border: none; color: white; padding: 12px 24px; border-radius: 10px; font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.3s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-logout { background: rgba(255, 71, 87, 0.1); border: 1px solid rgba(255, 71, 87, 0.3); color: var(--danger); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 500; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; }
.btn-logout:hover { background: var(--danger); color: white; }

/* STATS */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--bg-card); border-radius: 16px; padding: 25px; border: 1px solid var(--border-color); transition: all 0.3s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.stat-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.stat-icon { width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); }
.stat-icon.green { background: rgba(0, 212, 170, 0.15); }
.stat-icon.orange { background: rgba(255, 193, 7, 0.15); }
.stat-icon.red { background: rgba(255, 71, 87, 0.15); }
.stat-trend { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.stat-trend.up { color: var(--success); background: rgba(0, 212, 170, 0.1); }
.stat-trend.down { color: var(--danger); background: rgba(255, 71, 87, 0.1); }
.stat-value { font-size: 32px; font-weight: 800; font-family: 'Space Mono', monospace; margin-bottom: 5px; }
.stat-label { color: var(--text-secondary); font-size: 14px; }

/* PLAN CARDS */
.plans-section { margin-bottom: 30px; }
.section-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.plan-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.plan-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.plan-card.featured { border-color: var(--accent-primary); }
.plan-card.featured::before {
    content: '⭐ MAIS POPULAR';
    position: absolute;
    top: 15px;
    right: -35px;
    background: var(--accent-gradient);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 40px;
    transform: rotate(45deg);
}

.plan-header { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.plan-icon { font-size: 48px; margin-bottom: 15px; }
.plan-name { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.plan-card.basic .plan-name { color: var(--text-secondary); }
.plan-card.premium .plan-name { color: var(--accent-primary); }
.plan-card.family .plan-name { color: var(--success); }
.plan-price { font-size: 36px; font-weight: 800; font-family: 'Space Mono', monospace; }
.plan-price span { font-size: 16px; font-weight: 400; color: var(--text-muted); }

.plan-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.plan-stat { text-align: center; padding: 15px; background: var(--bg-secondary); border-radius: 12px; }
.plan-stat-value { font-size: 24px; font-weight: 700; font-family: 'Space Mono', monospace; }
.plan-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.plan-features { margin-bottom: 20px; }
.plan-feature { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--text-secondary); font-size: 14px; }
.plan-feature span:first-child { color: var(--success); }

.plan-btn { width: 100%; padding: 15px; border-radius: 12px; border: none; font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.plan-btn.outline { background: transparent; border: 2px solid var(--border-color); color: var(--text-secondary); }
.plan-btn.outline:hover { border-color: var(--text-primary); color: var(--text-primary); }
.plan-btn.primary { background: var(--accent-gradient); color: white; }
.plan-btn.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

/* CHARTS */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.chart-card { background: var(--bg-card); border-radius: 16px; padding: 25px; border: 1px solid var(--border-color); }
.chart-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-title { font-size: 18px; font-weight: 600; }
.chart-container { height: 250px; position: relative; }

/* TABLE */
.table-card { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; }
.table-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid var(--border-color); }
.table-header h3 { font-size: 18px; font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 15px 25px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); font-weight: 600; background: var(--bg-secondary); }
.data-table td { padding: 20px 25px; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.data-table tbody tr { transition: background 0.3s ease; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }

.user-cell { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-gradient); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }

.plan-badge { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.plan-badge.basic { background: rgba(138, 138, 154, 0.15); color: var(--text-secondary); }
.plan-badge.premium { background: rgba(231, 76, 60, 0.15); color: var(--accent-primary); }
.plan-badge.family { background: rgba(0, 212, 170, 0.15); color: var(--success); }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-badge.active { background: rgba(0, 212, 170, 0.15); color: var(--success); }
.status-badge.expiring { background: rgba(255, 193, 7, 0.15); color: var(--warning); }
.status-badge.expired { background: rgba(255, 71, 87, 0.15); color: var(--danger); }
.status-badge.cancelled { background: rgba(138, 138, 154, 0.15); color: var(--text-secondary); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-badge.active .status-dot { background: var(--success); }
.status-badge.expiring .status-dot { background: var(--warning); }
.status-badge.expired .status-dot { background: var(--danger); }
.status-badge.cancelled .status-dot { background: var(--text-secondary); }

.actions-cell { display: flex; flex-direction: row; gap: 8px; }
.action-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.3s ease; }
.action-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

/* RESPONSIVIDADE */
@media (max-width: 1400px) { 
    .stats-row { grid-template-columns: repeat(2, 1fr); } 
    .plans-grid { grid-template-columns: 1fr; } 
}
@media (max-width: 1200px) { 
    .charts-row { grid-template-columns: 1fr; } 
}
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    .header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .stats-row { grid-template-columns: 1fr; }
}

/* ANIMATIONS */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.stat-card, .plan-card, .chart-card, .table-card { animation: fadeInUp 0.5s ease forwards; }