:root {
    --primary: #1a3628; /* Forest Green */
    --primary-light: #2d5a27;
    --accent: #4ade80; /* Bright Green */
    --bg-main: #f0f2f5;
    --sidebar-bg: #1a3628;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --glass: rgba(255, 255, 255, 0.9);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Sarabun', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

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

.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Header & Tabs */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(45, 90, 39, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.filter-bar {
    display: flex;
    gap: 1rem;
    background: var(--white);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

select, input {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Sections */
.dashboard-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.dashboard-section.active-section {
    display: block;
}

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

.section-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    opacity: 0.8;
}

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

.grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Hero Item */
.hero-banner {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--primary) 0%, #2d5a27 100%);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.hero-img {
    max-width: 300px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.stat-card {
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
    margin-top: 0.25rem;
}

/* Alerts */
.alert-box {
    border-left: 5px solid var(--danger);
    background: #fef2f2;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.alert-title {
    color: #991b1b;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.alert-content {
    font-size: 0.85rem;
    color: #b91c1c;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid #f1f5f9;
}

td {
    padding: 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
}

.status-highlight {
    background: #fee2e2;
    color: #ef4444;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Gauges & Charts */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

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

/* Heatmap Grid */
.heatmap-matrix {
    display: grid;
    grid-template-columns: 100px repeat(4, 1fr);
    gap: 4px;
}

.heatmap-cell {
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

.heatmap-label {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.usage-low { background-color: #dcfce7; color: #166534; }
.usage-med { background-color: #4ade80; color: #064e3b; }
.usage-high { background-color: #166534; color: white; }

/* Responsive */
@media (max-width: 1200px) {
    .grid-main {
        grid-template-columns: 1fr;
    }
}
