/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #0f1117;
    --bg-card:     #1a1c25;
    --bg-sidebar:  #151720;
    --text:        #e0e0e0;
    --text-muted:  #8b8fa3;
    --accent:      #4361ee;
    --accent-alt:  #f72585;
    --border:      #2a2d3a;
    --success:     #2a9d8f;
    --warning:     #f77f00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem 1.25rem;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.sidebar-header .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 2rem;
}

.nav-links { list-style: none; }

.nav-links li { margin-bottom: 0.25rem; }

.nav-links a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    font-size: 0.95rem;
}

.nav-links a:hover { background: rgba(67,97,238,0.1); color: #fff; }

.nav-links a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* ===== Main content ===== */
.content {
    margin-left: 260px;
    padding: 2rem 3rem;
    flex: 1;
    max-width: 1200px;
}

h1 { font-size: 1.75rem; margin-bottom: 1.5rem; color: #fff; }
h2 { font-size: 1.3rem;  margin: 1.5rem 0 1rem; color: #fff; }

/* ===== Metric cards ===== */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.metric-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

/* ===== Charts ===== */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* ===== Forms ===== */
textarea, input[type="text"] {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-info    { background: rgba(67,97,238,0.15); border: 1px solid rgba(67,97,238,0.3); }
.alert-warning { background: rgba(247,127,0,0.15); border: 1px solid rgba(247,127,0,0.3); }

/* ===== Result cards ===== */
.result-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.result-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.2rem;
}

.tag-male    { background: rgba(67,97,238,0.2); color: #4361ee; }
.tag-female  { background: rgba(247,37,133,0.2); color: #f72585; }
.tag-neutral { background: rgba(173,181,189,0.2); color: #adb5bd; }
.tag-urban   { background: rgba(247,127,0,0.2);  color: #f77f00; }
.tag-rural   { background: rgba(82,183,136,0.2); color: #52b788; }

/* ===== About page ===== */
.about-content { line-height: 1.7; max-width: 800px; }
.about-content h2 { margin-top: 2rem; }
.about-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}
.about-content ol, .about-content ul { padding-left: 1.5rem; margin: 0.5rem 0; }
.about-content li { margin-bottom: 0.35rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem; }
    .sidebar-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
    .sidebar-header .subtitle { margin-bottom: 0; }
    .nav-links { display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .content { margin-left: 0; padding: 1.5rem; }
    body { flex-direction: column; }
    .metrics-row { grid-template-columns: repeat(2, 1fr); }
}
