:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 40%);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-right: var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--accent-primary);
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.highlight {
    color: var(--accent-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links li i {
    font-size: 1.2rem;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-links li.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.header-titles h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.1);
    border: var(--glass-border);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    background: var(--bg-card-hover);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-card.success .kpi-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.kpi-card.danger .kpi-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.kpi-card.warning .kpi-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.kpi-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.5rem;
}

.glass-card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 350px;
}

.glass-card.span-2 {
    grid-column: span 2;
}

.glass-card.span-3 {
    grid-column: span 3;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: var(--glass-border);
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.card-body {
    padding: 1rem;
    flex: 1;
}

.chart-container {
    position: relative;
}

.chart-container.large {
    min-height: 400px;
}

/* Detail Lists */
.list-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.list-container::-webkit-scrollbar {
    width: 6px;
}
.list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.detail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item .item-name {
    font-weight: 500;
    color: var(--text-main);
}

.detail-item .item-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.detail-item .item-count {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}
