:root {
    --primary: #00d67a;
    --primary-soft: rgba(0, 214, 122, 0.12);
    --primary-hover: #4df1a6;
    --dark: #050505;
    --card: #0f0f0f;
    --card-hover: #151515;
    --border: rgba(255, 255, 255, 0.06);
    --text: #e0e0e0;
    --text-muted: #888;
    --danger: #ff4d4f;
    --warning: #ffc107;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at top left, #1c1c1c 0%, #050505 40%, #000 100%);
    color: var(--text);
    min-height: 100vh;
}

/* HEADER / NAV */
.header {
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    height: 32px;
    width: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.1;
    color: #fff;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-menu {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.user-menu {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-button:hover {
    border-color: var(--primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 77, 79, 0.1);
}

/* MAIN CONTENT */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* KPI CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: radial-gradient(circle at top, #181818 0%, #0a0a0a 55%, #000 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.kpi-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-icon.visitors {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

.kpi-icon.leads {
    background: rgba(255, 193, 7, 0.15);
    color: var(--warning);
}

.kpi-icon.conversions {
    background: var(--primary-soft);
    color: var(--primary);
}

.kpi-icon.rate {
    background: rgba(138, 43, 226, 0.15);
    color: #ba68c8;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.up {
    color: var(--primary);
}

.kpi-trend.down {
    color: var(--danger);
}

/* CHARTS */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: radial-gradient(circle at top, #181818 0%, #0a0a0a 55%, #000 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.chart-header {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.chart-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    height: 300px;
}

/* TABLES */
.table-card {
    background: radial-gradient(circle at top, #181818 0%, #0a0a0a 55%, #000 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.table-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-filters select {
    background: #050505;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

thead {
    background: #0a0a0a;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.desktop {
    background: rgba(23, 162, 184, 0.12);
    color: var(--info);
}

.badge.mobile {
    background: rgba(255, 193, 7, 0.12);
    color: var(--warning);
}

.badge.new {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge.contacted {
    background: rgba(255, 193, 7, 0.12);
    color: var(--warning);
}

.badge.converted {
    background: rgba(138, 43, 226, 0.12);
    color: #ba68c8;
}

.country-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    margin-right: 6px;
    display: inline-block;
}

/* PAGINATION */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 16px 0;
}

.pagination button {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 12px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    font-size: 0.9rem;
}

/* LOADER */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    th,
    td {
        padding: 8px 10px;
    }
}