:root {
    --bg-dark: #0a0b10;
    --bg-surface: #13151e;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    --brand-primary: #6366f1;
    --brand-secondary: #8b5cf6;
    
    --channel-site: #3b82f6;
    --channel-skroutz: #f97316;
    --channel-shopflix: #ec4899;
    --channel-public: #eab308;
    
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.hidden {
    display: none !important;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

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

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

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), transparent);
    border-left: 3px solid var(--brand-primary);
}

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

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.05), transparent 40%);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Period Selector */
.period-selector {
    display: flex;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    color: var(--text-primary);
}

.period-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Glass Card */
.glass-card {
    background: rgba(19, 21, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.gradient-1 { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.gradient-2 { background: linear-gradient(135deg, #10b981, #3b82f6); }
.gradient-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.gradient-4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

.kpi-info h3 {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Charts Area */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.channel-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.channel-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.channel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.channel-dot.site { background-color: var(--channel-site); box-shadow: 0 0 8px var(--channel-site); }
.channel-dot.skroutz { background-color: var(--channel-skroutz); box-shadow: 0 0 8px var(--channel-skroutz); }
.channel-dot.shopflix { background-color: var(--channel-shopflix); box-shadow: 0 0 8px var(--channel-shopflix); }
.channel-dot.public { background-color: var(--channel-public); box-shadow: 0 0 8px var(--channel-public); }
.channel-dot.store_retail { background-color: #10b981; box-shadow: 0 0 8px #10b981; }

.channel-stats-val {
    text-align: right;
}

.channel-rev {
    font-weight: 600;
    font-size: 15px;
}

.channel-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background-color: rgba(255,255,255,0.02);
}

.data-table td {
    font-size: 14px;
    font-weight: 500;
}

.text-right {
    text-align: right !important;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-site { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-skroutz { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.badge-shopflix { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-public { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.badge-store_retail { background: rgba(16, 185, 129, 0.15); color: #10b981; }

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-container p {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: white;
}

.active-filter { background-color: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 12px; margin-left: -12px; margin-right: -12px; border-bottom: none !important; } 
.channel-item:hover { background-color: rgba(255, 255, 255, 0.02); border-radius: 8px; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }

.channel-dot.site_b2b { background-color: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.channel-dot.site_b2c { background-color: #0ea5e9; box-shadow: 0 0 8px #0ea5e9; }
.badge-site_b2b { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-site_b2c { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.badge-clickbytes { background: rgba(249, 115, 22, 0.10); color: #fdba74; }
.badge-clicksimple { background: rgba(249, 115, 22, 0.12); color: #fb923c; }
.badge-klarna { background: rgba(14, 165, 233, 0.10); color: #7dd3fc; }

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background-image: radial-gradient(circle at center, rgba(99, 102, 241, 0.1), transparent 50%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.login-input {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: var(--font-family);
    margin-bottom: 24px;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: var(--brand-primary);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-btn:hover {
    opacity: 0.9;
}

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