/* DarkCrypto Analytics - Styles */

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

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-900);
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    text-align: center;
    padding: 40px;
    max-width: 320px;
}

.login-title {
    margin-bottom: 8px;
    color: #111827;
    font-size: 20px;
}

.login-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.login-btn:hover {
    background: #1d4ed8;
}

.login-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

/* Header - Clean & Minimal */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.header-date {
    font-size: 13px;
    color: var(--gray-500);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* KPI Cards Row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.kpi-value.blue { color: var(--primary); }
.kpi-value.green { color: var(--success); }
.kpi-value.yellow { color: var(--warning); }
.kpi-value.purple { color: var(--purple); }

.kpi-label {
    font-size: 13px;
    color: var(--gray-500);
}

.kpi-sub {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
    width: fit-content;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.tab-btn.active { background: var(--primary); color: white; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Section Cards */
.section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 16px;
    overflow: hidden;
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.section-body { padding: 20px; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat-item {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-value.green { color: var(--success); }
.stat-value.yellow { color: var(--warning); }
.stat-value.red { color: var(--danger); }
.stat-value.blue { color: var(--primary); }
.stat-value.purple { color: var(--purple); }

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Table */
.table-controls {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: var(--gray-700);
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-count {
    margin-right: auto;
    font-size: 13px;
    color: var(--gray-500);
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 1px solid var(--gray-200);
}

th:hover { background: var(--gray-100); }

td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}

tbody tr:hover { background: var(--gray-50); }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge.green { background: #d1fae5; color: #065f46; }
.badge.yellow { background: #fef3c7; color: #92400e; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.gray { background: var(--gray-100); color: var(--gray-500); }
.badge.purple { background: #ede9fe; color: #5b21b6; }
.badge.blue { background: #dbeafe; color: #1e40af; }

/* Pagination */
.pagination {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    color: var(--gray-700);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Progress Bar */
.progress-row {
    margin-bottom: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.progress-label { color: var(--gray-700); }
.progress-value { color: var(--gray-500); font-weight: 500; }

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.progress-fill.green { background: var(--success); }

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

.chart-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 20px;
}

.chart-card canvas {
    max-height: 300px;
}

.chart-card.full { grid-column: span 2; }

.chart-card.full canvas {
    max-height: 250px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
}

/* Mentor List */
.mentor-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.mentor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 6px;
}

.mentor-name { font-size: 13px; color: var(--gray-700); }
.mentor-count { font-size: 14px; font-weight: 600; color: var(--primary); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-card { padding: 16px; }
    .kpi-value { font-size: 24px; }
    .charts-grid { grid-template-columns: 1fr; gap: 12px; }
    .chart-card { padding: 16px; }
    .chart-card.full { grid-column: span 1; }
    .chart-card canvas { max-height: 220px !important; }
    .chart-card.full canvas { max-height: 200px !important; }
    .chart-title { font-size: 13px; margin-bottom: 12px; }
    .tabs { width: 100%; overflow-x: auto; }
    .tab-btn { padding: 10px 16px; white-space: nowrap; font-size: 13px; }
    .container { padding: 12px; }
    .filter-input, .filter-select { flex: 1; min-width: 120px; }
    .table-controls { padding: 12px; }
    td, th { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .header { padding: 12px 16px; }
    .logo-text { font-size: 16px; }
    .kpi-card { padding: 14px; }
    .kpi-value { font-size: 22px; }
    .kpi-label { font-size: 12px; }
    .stat-value { font-size: 20px; }
}

/* Print */
@media print {
    .header { position: relative; }
    .tabs, .table-controls, .pagination { display: none; }
    .tab-content { display: block !important; page-break-inside: avoid; }
    .login-overlay { display: none !important; }
}
