/* 369Network Dashboard - Premium Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Core Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-elevated: #1a1a25;
    
    /* Accent Colors - Cyber Gradient */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a855f7;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-card: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    
    /* Borders & Shadows */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(99, 102, 241, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(-1%, 3%) rotate(-1deg); }
    75% { transform: translate(3%, -2%) rotate(0.5deg); }
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: white;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    animation: shimmer 3s infinite;
}

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

.logo-text h1 {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

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

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 22px;
    height: 22px;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

/* User Profile */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
}

.user-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    min-height: 100vh;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    animation: fadeInDown 0.6s ease;
}

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

.page-title h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 6px;
}

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

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-accent);
}

.btn-success {
    background: var(--accent-success);
    color: white;
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

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

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.revenue { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.stat-icon.expense { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.stat-icon.profit { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.stat-icon.clients { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.stat-trend.up { color: var(--accent-success); }
.stat-trend.down { color: var(--accent-danger); }

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeInUp 0.6s ease backwards;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.card-body {
    padding: 24px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    transition: background 0.2s ease;
}

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

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

/* Domain Cell */
.domain-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.domain-favicon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-primary);
}

.domain-name {
    font-weight: 500;
}

.domain-source {
    font-size: 12px;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Money Values */
.money {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.money.positive { color: var(--accent-success); }
.money.negative { color: var(--accent-danger); }

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

.chart-container {
    height: 300px;
    position: relative;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.form-select {
    cursor: pointer;
}

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

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

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

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.modal-body {
    padding: 24px;
}

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

/* Client Cards */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.client-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.client-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.client-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.client-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.client-id {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.client-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.client-stat {
    background: var(--bg-secondary);
    padding: 14px;
    border-radius: var(--radius-md);
}

.client-stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.client-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.client-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.domain-tag {
    background: var(--bg-elevated);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s ease;
}

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

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.tab:hover:not(.active) {
    color: var(--text-primary);
}

/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.month-display {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    min-width: 160px;
    text-align: center;
}

/* Payment History */
.payment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

.payment-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.payment-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.payment-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-icon.incoming {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.payment-icon.outgoing {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

.payment-details h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.payment-details span {
    font-size: 12px;
    color: var(--text-muted);
}

.payment-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
}

/* Traffic Source Tags */
.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.source-tag.facebook { background: rgba(24, 119, 242, 0.15); color: #1877f2; }
.source-tag.google { background: rgba(234, 67, 53, 0.15); color: #ea4335; }
.source-tag.tiktok { background: rgba(0, 0, 0, 0.15); color: #fff; }
.source-tag.native { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.source-tag.adsense { background: rgba(52, 168, 83, 0.15); color: #34a853; }
.source-tag.adx { background: rgba(66, 133, 244, 0.15); color: #4285f4; }
.source-tag.search { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Payment Status Badges - Color coded by status */
.status-badge.received,
.status-badge.paid { 
    background: rgba(16, 185, 129, 0.15); 
    color: #10b981; 
}

.status-badge.pending { 
    background: rgba(245, 158, 11, 0.15); 
    color: #f59e0b; 
}

.status-badge.hold { 
    background: rgba(249, 115, 22, 0.15); 
    color: #f97316; 
}

.status-badge.deducted { 
    background: rgba(139, 92, 246, 0.15); 
    color: #8b5cf6; 
}

.status-badge.disabled,
.status-badge.account_disabled,
.status-badge.not_received { 
    background: rgba(239, 68, 68, 0.15); 
    color: #ef4444; 
}

.status-badge.paused,
.status-badge.inactive { 
    background: rgba(107, 114, 128, 0.15); 
    color: #6b7280; 
}

/* Domain row colors based on payment status */
.data-table tr.status-received td,
.data-table tr.status-paid td {
    border-left: 3px solid #10b981;
}

.data-table tr.status-pending td {
    border-left: 3px solid #f59e0b;
}

.data-table tr.status-hold td {
    border-left: 3px solid #f97316;
    background: rgba(249, 115, 22, 0.03);
}

.data-table tr.status-deducted td {
    border-left: 3px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.03);
}

.data-table tr.status-disabled td,
.data-table tr.status-account_disabled td,
.data-table tr.status-not_received td {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
    opacity: 0.8;
}

/* Domain favicon colors based on status */
.domain-favicon.status-received,
.domain-favicon.status-paid { 
    background: rgba(16, 185, 129, 0.2); 
    color: #10b981; 
}

.domain-favicon.status-pending { 
    background: rgba(245, 158, 11, 0.2); 
    color: #f59e0b; 
}

.domain-favicon.status-hold { 
    background: rgba(249, 115, 22, 0.2); 
    color: #f97316; 
}

.domain-favicon.status-deducted { 
    background: rgba(139, 92, 246, 0.2); 
    color: #8b5cf6; 
}

.domain-favicon.status-disabled,
.domain-favicon.status-not_received { 
    background: rgba(239, 68, 68, 0.2); 
    color: #ef4444; 
}

/* Payment calendar indicator */
.payment-due-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.payment-due-indicator.upcoming {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.payment-due-indicator.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    animation: pulseOverdue 2s infinite;
}

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

/* Deduction badge */
.deduction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Payment timeline */
.payment-timeline {
    position: relative;
    padding-left: 24px;
}

.payment-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-subtle);
}

.timeline-item {
    position: relative;
    padding: 12px 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-card);
}

.timeline-item.received::before { background: #10b981; }
.timeline-item.pending::before { background: #f59e0b; }
.timeline-item.hold::before { background: #f97316; }
.timeline-item.disabled::before { background: #ef4444; }

/* Alert banner for payment status */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.alert-banner.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.alert-banner.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-banner.info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #6366f1;
}

.alert-banner-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-banner-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-banner-content p {
    font-size: 13px;
    opacity: 0.9;
}

/* Profit adjustment indicator */
.profit-adjusted {
    position: relative;
}

.profit-adjusted::after {
    content: '*';
    color: #8b5cf6;
    font-weight: bold;
    margin-left: 2px;
}

.profit-strikethrough {
    text-decoration: line-through;
    opacity: 0.5;
    font-size: 12px;
    margin-right: 8px;
}

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

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    min-width: 320px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success { border-left: 4px solid var(--accent-success); }
.toast.error { border-left: 4px solid var(--accent-danger); }
.toast.warning { border-left: 4px solid var(--accent-warning); }
.toast.info { border-left: 4px solid var(--accent-info); }

.toast-icon {
    width: 24px;
    height: 24px;
}

.toast-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

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

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* Additional Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
