/* Layout Grid Structure */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* SPA Router — page visibility toggle */
.page-section {
    width: 100%;
}

.page-hidden {
    display: none !important;
}

.page-active {
    display: block;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
    border-right: var(--glass-border);
}

.brand {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Headers */
.top-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top-header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-disk-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #f59e0b;
    opacity: 0.8;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

/* Shared Stat Bar (5 blocks) */
.page-stat-bar {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    gap: 0;
}

/* Metrics Grid - 3 Columns (kept for legacy if needed) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

.large-span {
    grid-column: 1 / -1;
}

.chart-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 350px;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Timeline chart header with right-aligned range buttons */
.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    padding-bottom: 8px;
}

.chart-range-btns {
    display: flex;
    gap: 4px;
}

.range-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #94a3b8);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.15s;
    font-family: inherit;
}

.range-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.range-btn.active {
    background: rgba(245,158,11,0.18);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Stats subheader below chart title */
.timeline-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-stat-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.tsh-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

.tsh-delta {
    font-size: 0.8rem;
    font-weight: 600;
}

.tsh-up   { color: #10b981; }
.tsh-down { color: #f43f5e; }

.canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px;
}

/* Timeline chart taller */
.large-span .canvas-wrapper {
    min-height: 340px;
}
