/* Core Styling Resets variables */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

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

/* Left Navigation Sidebar styling rules */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    padding: 24px;
    transition: all 0.3s ease;
}

.sidebar-brand h2 {
    font-size: 1.5rem;
    margin-bottom: 40px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 12px;
}

.sidebar-menu a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
}

.sidebar-menu li.active a, .sidebar-menu a:hover {
    background-color: var(--accent-color);
    color: var(--text-main);
}

/* Main Canvas Content styling elements */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Structural Grids configuration Rules */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
}

.metric-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.metric-delta {
    font-size: 0.85rem;
}

.metric-delta.positive { color: var(--success); }
.metric-delta.negative { color: var(--danger); }

/* Graphs layout containers mapping */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
}

.chart-container h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Tabular UI list specifications rules */
.table-container {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
}

.table-container h3 { margin-bottom: 20px; }

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 14px;
    border-bottom: 1px solid #334155;
}

th {
    color: var(--text-muted);
    font-weight: 600;
}

.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status.completed { background-color: rgba(16, 185, 129, 0.2); color: var(--success); }
.status.pending { background-color: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Responsive adjustments breaking down grid parameters */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container { flex-direction: column; }
    .sidebar { width: 100%; display: none; }
    .sidebar.active { display: block; }
    .toggle-btn { display: block; }
}

/* --- Add these styles at the very bottom of your style.css --- */

/* Control views for Single Page Navigation switching */
.dashboard-page {
    display: none; /* Hide all pages by default */
    animation: fadeIn 0.3s ease-in-out;
}

.dashboard-page.active-page {
    display: block; /* Show only the active page container */
}

/* Generic layout module for non-overview placeholder views */
.placeholder-card {
    background-color: var(--bg-secondary);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 2px dashed #334155;
}

.placeholder-card h2 {
    margin-bottom: 12px;
    color: var(--text-main);
}

.placeholder-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Smooth page change animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Add these styles at the very bottom of your style.css --- */

/* Parent element wrappers configuration */
.dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    user-select: none;
}

.dropdown-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Arrow indicator rotation styling */
.arrow-icon {
    font-size: 0.75rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-dropdown.open .arrow-icon {
    transform: rotate(180deg); /* Flips arrow upward exactly like your image */
}

/* Submenu items list structural rendering */
.submenu {
    list-style: none;
    padding-left: 24px;  /* Left indent line padding match */
    border-left: 1px solid #334155; /* Subtle alignment line indicator */
    margin-left: 18px;
    margin-top: 4px;
    display: none; /* Collapsed state hidden by default */
}

/* Visible display trigger controlled by class injector toggles */
.has-dropdown.open .submenu {
    display: block;
}

/* Submenu target click lines sizing spacing */
.submenu li {
    margin-bottom: 4px;
}

.submenu a {
    font-size: 0.95rem;
    padding: 8px 12px !important;
    color: var(--text-muted);
}

.submenu li.active a, .submenu a:hover {
    color: var(--text-main) !important;
    background: none !important; /* No heavy backgrounds on small links */
}
