/* Modern Dark Theme Dashboard - ALIS Style */

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

:root {
    /* Dark Theme Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Accent Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Borders & Shadows */
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

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

.logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo i {
    font-size: 28px;
    color: var(--primary);
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    padding: 20px 12px;
}

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

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

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

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 16px 8px 16px;
    margin-top: 8px;
}

.nav-section-title:first-child {
    margin-top: 0;
}

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

.last-update {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    background: var(--bg-primary);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-left h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 14px;
}

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

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.btn-primary {
    padding: 12px 24px;
    border-radius: 8px;
    background: var(--primary);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 20px;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-card.primary .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.stat-card.success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card.warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card.danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
}

.stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stat-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-trend {
    font-size: 14px;
    font-weight: 600;
}

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

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

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card, .info-card, .table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary);
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    font-size: 12px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

canvas {
    max-width: 100%;
    height: 250px !important;
}

/* Resource Bars */
.resource-bars {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.resource-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.resource-label i {
    color: var(--primary);
}

.resource-percent {
    margin-left: auto;
    color: var(--text-muted);
}

.progress-bar-modern {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill-modern {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--info));
    border-radius: 6px;
    transition: width 0.3s ease;
}

/* Info Row */
.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: start;
}

.info-item i {
    font-size: 20px;
    color: var(--primary);
    margin-top: 2px;
}

.info-item div {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.status-active {
    color: var(--success);
}

/* Error Logs */
.error-logs {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--danger);
    border-radius: 6px;
    font-size: 13px;
}

.error-item .error-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}

/* Table */
.table-card {
    margin-bottom: 24px;
}

.table-container {
    overflow-x: auto;
}

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

.modern-table thead {
    background: var(--bg-tertiary);
}

.modern-table th {
    text-align: left;
    padding: 16px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.modern-table td {
    padding: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.modern-table tbody tr:hover {
    background: var(--bg-hover);
}

.text-center {
    text-align: center;
}

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

.badge-success {
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
}

.badge-error {
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

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

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

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

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

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-row, .info-row {
        grid-template-columns: 1fr;
    }
}
