:root {
    --bg-color: #f4f7f6;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);

    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --error-color: #e74c3c;

    --border-color: #e0e6ed;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, #e8f4f8 0%, transparent 40%),
        radial-gradient(circle at bottom left, #f3e5f5 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    text-align: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.outline-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.outline-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.small-btn {
    padding: 6px 12px;
    font-size: 13px;
}

/* Login Page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.login-form .btn {
    width: 100%;
}

.alert.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Dashboard Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    margin: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    max-width: 140px;
    height: auto;
    margin: 0 auto 30px auto;
    display: block;
}

.nav-section {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

#heatmap-selector {
    list-style: none;
}

#heatmap-selector li {
    margin-bottom: 8px;
}

.heatmap-link {
    display: block;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.heatmap-link:hover,
.heatmap-link.active {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.sidebar-footer {
    margin-top: auto;
    text-align: center;
}

.content {
    flex: 1;
    padding: 34px 40px 20px 0;
    display: flex;
    flex-direction: column;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.last-refresh {
    font-size: 13px;
    color: var(--text-muted);
}

.card {
    padding: 24px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Spinner */
.loading-container {
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Heatmap Table */
.table-wrapper {
    overflow-x: auto;
}

.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 13px;
}

.heatmap-table th,
.heatmap-table td {
    padding: 10px;
    text-align: center;
    border-radius: 4px;
}

.heatmap-table th {
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
}

.col-cohort {
    width: 100px;
    text-align: left !important;
}

.col-size {
    width: 60px;
}

.col-weight {
    width: 60px;
}

.col-months-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.heatmap-table tbody th,
.heatmap-table tfoot th {
    text-align: left;
    color: var(--text-main);
    font-weight: 500;
}

.heatmap-table td {
    min-width: 50px;
    color: #111;
    font-weight: 500;
}

.cell-empty {
    background-color: transparent !important;
}

#heatmap-footer th,
#heatmap-footer td {
    margin-top: 10px;
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}