:root {
    --sidebar-w: 260px;
    --sidebar-collapsed: 70px;
    --bg-base: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F1F5F9;
    --border-color: rgba(59,130,246,0.1);
    --text-main: #0F172A;
    --text-muted: #475569;
    --text-dim: #94A3B8;
    --primary: #3B82F6;
    --primary-dim: rgba(59,130,246,0.08);
    --primary-glow: rgba(59,130,246,0.15);
    --primary-hover: #2563EB;
    --success: #10B981;
    --success-dim: rgba(16,185,129,0.08);
    --warning: #F59E0B;
    --warning-dim: rgba(245,158,11,0.08);
    --error: #EF4444;
    --error-dim: rgba(239,68,68,0.08);
    --accent-rs: #3B82F6;
    --accent-adm: #10B981;
    --accent-dp: #8B5CF6;
    --font: 'Outfit', sans-serif;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

body[data-theme="default"] {
    --bg-base: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F1F5F9;
    --border-color: rgba(59,130,246,0.1);
    --text-main: #0F172A;
    --text-muted: #475569;
    --text-dim: #94A3B8;
    --primary: #3B82F6;
    --primary-dim: rgba(59,130,246,0.08);
    --primary-glow: rgba(59,130,246,0.15);
    --primary-hover: #2563EB;
    --success: #10B981;
    --success-dim: rgba(16,185,129,0.08);
    --warning: #F59E0B;
    --warning-dim: rgba(245,158,11,0.08);
    --error: #EF4444;
    --error-dim: rgba(239,68,68,0.08);
    --accent-rs: #3B82F6;
    --accent-adm: #10B981;
    --accent-dp: #8B5CF6;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* ===== THEMES ===== */
body[data-theme="rosa"] {
    --bg-base: #F8F1F3;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #FDF6F8;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F8F1F3;
    --border-color: rgba(230,92,123,0.12);
    --text-main: #1A1A2E;
    --text-muted: #6B5E64;
    --text-dim: #A89298;
    --primary: #E65C7B;
    --primary-dim: rgba(230,92,123,0.08);
    --primary-glow: rgba(230,92,123,0.15);
    --primary-hover: #D14B6A;
    --success: #10B981;
    --success-dim: rgba(16,185,129,0.08);
    --warning: #F59E0B;
    --warning-dim: rgba(245,158,11,0.08);
    --error: #EF4444;
    --error-dim: rgba(239,68,68,0.08);
    --accent-rs: #E65C7B;
    --accent-adm: #E65C7B;
    --accent-dp: #E65C7B;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

body[data-theme="verde"] {
    --bg-base: #F0F6F3;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #F3F9F6;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F0F6F3;
    --border-color: rgba(16,185,129,0.12);
    --text-main: #1A1A2E;
    --text-muted: #5E7A6E;
    --text-dim: #90AA9E;
    --primary: #10B981;
    --primary-dim: rgba(16,185,129,0.08);
    --primary-glow: rgba(16,185,129,0.15);
    --primary-hover: #059669;
    --success: #059669;
    --success-dim: rgba(5,150,105,0.08);
    --warning: #D97706;
    --warning-dim: rgba(217,119,6,0.08);
    --error: #DC2626;
    --error-dim: rgba(220,38,38,0.08);
    --accent-rs: #10B981;
    --accent-adm: #10B981;
    --accent-dp: #10B981;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

body[data-theme="dark"] {
    --bg-base: #0F1117;
    --bg-surface: #1A1D27;
    --bg-surface-2: #232733;
    --bg-sidebar: #1A1D27;
    --bg-input: #232733;
    --border-color: rgba(255,255,255,0.06);
    --text-main: #EDEDEE;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --primary: #3B82F6;
    --primary-dim: rgba(59,130,246,0.1);
    --primary-glow: rgba(59,130,246,0.2);
    --primary-hover: #60A5FA;
    --success: #10B981;
    --success-dim: rgba(16,185,129,0.1);
    --warning: #F59E0B;
    --warning-dim: rgba(245,158,11,0.1);
    --error: #EF4444;
    --error-dim: rgba(239,68,68,0.1);
    --accent-rs: #8B5CF6;
    --accent-adm: #F59E0B;
    --accent-dp: #10B981;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-header h2 span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 14px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--primary-dim);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item .badge-count {
    margin-left: auto;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 14px 14px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--error);
    background: var(--error-dim);
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 24px 32px 40px;
    max-width: calc(100vw - var(--sidebar-w));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #FFF;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface-2);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

#planilhao-pagination .btn {
    padding: 4px 10px;
    background: var(--bg-surface-2);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    min-width: 32px;
    justify-content: center;
}
#planilhao-pagination .btn:hover:not(:disabled) {
    background: var(--accent);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--primary-dim);
}

.btn-success {
    background: var(--success);
    color: #FFF;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--error);
    color: #FFF;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* VIEWS */
.view {
    display: none;
    animation: fadeIn 0.35s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
/* Cards grid (kept for backward compat) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ========== PREMIUM KPI CARDS ========== */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--kpi-accent);
    border-radius: 0 2px 2px 0;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border-color: color-mix(in srgb, var(--kpi-accent) 30%, transparent);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--kpi-accent) 10%, transparent);
    color: var(--kpi-accent);
    margin-bottom: 14px;
}

.kpi-icon svg {
    width: 18px;
    height: 18px;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 6px;
    opacity: 0.8;
}

/* Legacy stat-card kept for compatibility */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .card-icon {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.stat-card .card-icon svg {
    width: 22px;
    height: 22px;
}

.card-info .card-value { color: var(--primary); }
.card-info .card-icon { background: var(--primary-dim); color: var(--primary); }
.card-primary .card-value { color: var(--primary); }
.card-primary .card-icon { background: var(--primary-dim); color: var(--primary); }
.card-success .card-value { color: var(--success); }
.card-success .card-icon { background: var(--success-dim); color: var(--success); }
.card-warning .card-value { color: var(--warning); }
.card-warning .card-icon { background: var(--warning-dim); color: var(--warning); }
.card-error .card-value { color: var(--error); }
.card-error .card-icon { background: var(--error-dim); color: var(--error); }
.card-neutral .card-value { color: var(--text-muted); }
.card-neutral .card-icon { background: var(--bg-surface-2); color: var(--text-muted); }

/* ========== PREMIUM CHART CARDS ========== */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .chart-grid { grid-template-columns: 1fr; }
}

.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 0;
}

.chart-card-header h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.chart-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--primary-dim);
    color: var(--primary);
    white-space: nowrap;
}

.chart-card-body {
    padding: 12px 16px 16px;
}

.echart-container {
    width: 100%;
    height: 280px;
}

/* GLASS PANEL (legacy) */
.glass-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.glass-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.etapas-card {
    padding: 16px 20px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.etapas-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* CHARTS (legacy) */
.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* TABLE */
.table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 12px 14px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.cell-editable {
    cursor: text;
    border-radius: 4px;
    transition: background 0.15s, box-shadow 0.15s;
    position: relative;
}
.cell-editable:hover {
    background: rgba(255,255,255,0.05);
    box-shadow: inset 0 0 0 1px var(--border-color);
}
.cell-editable:focus {
    background: var(--bg-card);
    box-shadow: inset 0 0 0 2px var(--primary);
    outline: none;
}
.cell-editable.saving {
    opacity: 0.5;
    pointer-events: none;
}
.cell-editable.saved {
    animation: flashSave 0.6s ease;
}
@keyframes flashSave {
    0% { background: var(--success); }
    100% { background: transparent; }
}

.cell-empty {
    color: var(--text-dim);
    opacity: 0.4;
    font-size: 0.85em;
}

.cell-cpf-masked {
    color: var(--text-muted);
    font-size: 0.85em;
    letter-spacing: 0.5px;
    cursor: help;
}

.cell-cpf-masked strong {
    color: var(--text);
    letter-spacing: 0;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--primary-dim);
}

/* STATUS BADGE */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-error { background: var(--error-dim); color: var(--error); }
.badge-info { background: var(--primary-dim); color: var(--primary); }
.badge-neutral { background: var(--bg-surface-2); color: var(--text-muted); border: 1px solid var(--border-color); }

/* FILTERS BAR */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filters-bar input,
.filters-bar select {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.filters-bar input:focus,
.filters-bar select:focus {
    border-color: var(--primary);
}

.filters-bar input { min-width: 200px; flex: 1; }
.filters-bar select { min-width: 140px; }

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.pagination span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* LOADING */
.loading-overlay {
    display: none;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* SEARCH */
.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-dim);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover { color: var(--text-main); }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* FORM */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-dim);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 0.85rem;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    .sidebar .nav-item span,
    .sidebar .nav-section-title,
    .sidebar .badge-count,
    .sidebar .user-info,
    .sidebar-header h2 {
        display: none;
    }
    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .sidebar-footer {
        padding: 10px;
    }
    .sidebar-user {
        justify-content: center;
    }
    .main-content {
        margin-left: var(--sidebar-collapsed);
        padding: 16px;
    }
}

.hidden { display: none !important; }

/* TIMELINE */
.progress-bar {
    width: 100%;
}

.timeline-steps {
    background: var(--bg-surface-2);
    border-radius: 8px;
}

.timeline-card {
    transition: var(--transition);
    border-left: 3px solid var(--primary);
}

.timeline-card:hover {
    border-color: var(--primary-hover);
    background: var(--primary-dim);
}

/* Theme switcher */
.theme-switcher {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
}

.theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.theme-btn:hover {
    transform: scale(1.15);
}

.theme-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.theme-btn-dark {
    background: #334155 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
}

.theme-btn-dark.active {
    background: var(--primary) !important;
    color: #fff;
    border-color: var(--primary);
}

.theme-btn-dark svg {
    width: 14px;
    height: 14px;
}

/* Macro-stage cards */
.etapas-card {
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    padding: 28px 24px !important;
}

.etapas-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.etapas-card .card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.etapas-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.etapas-card .status-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}

.etapas-card .status-badge {
    padding: 6px 16px;
    border-radius: 24px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--bg-surface-2);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
}

.etapas-card .status-badge .count {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.95rem;
    min-width: 20px;
    text-align: center;
}

.etapas-card .status-badge.rs {
    background: rgba(59,130,246,0.12);
    color: #93C5FD;
    border-color: rgba(59,130,246,0.2);
}
.etapas-card .status-badge.rs .count { color: #60A5FA; }

.etapas-card .status-badge.adm {
    background: rgba(16,185,129,0.12);
    color: #6EE7B7;
    border-color: rgba(16,185,129,0.2);
}
.etapas-card .status-badge.adm .count { color: #34D399; }

.etapas-card .status-badge.dp {
    background: rgba(139,92,246,0.12);
    color: #C4B5FD;
    border-color: rgba(139,92,246,0.2);
}
.etapas-card .status-badge.dp .count { color: #A78BFA; }

.etapas-card .status-badge.featured {
    padding: 8px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    border-width: 2px;
}
.etapas-card .status-badge.featured .count {
    font-size: 1.1rem;
}
