:root {
    /* Alcaldía de Girardota Light Theme Tokens */
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --panel-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #e2e8f0;
    
    /* Institutional Green Palette */
    --primary-color: #0f5132; /* Dark green */
    --primary-hover: #15803d;
    --primary-light: #dcfce7; /* Light background for hover */
    --accent-color: #84cc16; /* Lime accent */
    --gradient-primary: linear-gradient(135deg, #0f5132 0%, #84cc16 100%);
    --slogan-bg: #84cc16;
    --slogan-text: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --folder-color: #eab308;
    --file-color: #64748b;
}

[data-theme="dark"] {
    /* Dark Theme based on Dark Green */
    --bg-color: #022c22; /* Very dark green background */
    --sidebar-bg: #064e3b; /* Slightly lighter dark green */
    --panel-bg: #064e3b;
    --text-main: #f8fafc;
    --text-muted: #a7f3d0;
    --border-color: #065f46;
    
    --primary-color: #a3e635; /* Lime green for text readability */
    --primary-hover: #bef264;
    --primary-light: #022c22; /* Dark bg for active states */
    --accent-color: #a3e635;
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #bef264 100%);
    --slogan-bg: #0f5132;
    --slogan-text: #bef264;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    
    --folder-color: #fde047;
    --file-color: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .main-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.logo-text .sub-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1;
}

.slogan-container {
    padding: 16px 24px 0;
}

.slogan-badge {
    background-color: var(--slogan-bg);
    color: var(--slogan-text);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.slogan-badge i {
    color: var(--slogan-text);
    font-size: 1.1rem;
    margin-left: 4px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.sector-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-weight: 600;
    gap: 12px;
}

.sector-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sector-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sector-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: 80px;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.header-title p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.theme-toggle {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: rotate(15deg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease;
}

.welcome-icon-container {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.welcome-message i {
    font-size: 3.5rem;
    color: white;
}

.welcome-message h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.welcome-message p {
    font-weight: 500;
    max-width: 500px;
}

/* Exercises Grid */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    animation: slideUp 0.4s ease;
}

.exercise-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.exercise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exercise-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.exercise-card:hover::before {
    opacity: 1;
}

.exercise-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.exercise-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    flex: 1;
}

.exercise-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
}

.exercise-card .card-footer i {
    transition: transform 0.2s ease;
}

.exercise-card:hover .card-footer i {
    transform: translateX(4px);
}

/* Modal for Folders */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--panel-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    padding-right: 32px;
    line-height: 1.3;
}

.modal-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* Folder Browser */
.folder-browser {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.tree-node {
    margin: 4px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: default;
    transition: background-color 0.2s;
    user-select: none;
}

.tree-item:hover {
    background-color: var(--primary-light);
}

.tree-item i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.tree-item i.fa-folder {
    color: var(--folder-color);
}

.tree-item i.fa-folder-open {
    color: var(--folder-color);
}

.tree-item i.fa-file-lines,
.tree-item i.fa-file-pdf,
.tree-item i.fa-file-video {
    color: var(--file-color);
}

.tree-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.tree-children {
    padding-left: 28px;
    border-left: 1px dashed var(--border-color);
    margin-left: 22px;
    margin-top: 4px;
}

.collapsible {
    cursor: pointer;
}

.collapsible .chevron {
    margin-right: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    width: 12px;
}

.collapsible.open .chevron {
    transform: rotate(90deg);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Logo Image ── */
.logo-img {
    width: 100%;
    max-width: 260px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ══════════════════════════════════════
   DASHBOARD – Power BI inspired
══════════════════════════════════════ */
.dashboard { animation: fadeIn 0.5s ease; }

.dashboard-header { margin-bottom: 24px; }
.dashboard-header h2 {
    font-size: 1.5rem; font-weight: 800;
    color: var(--text-main);
    display: flex; align-items: center; gap: 10px;
}
.dashboard-header h2 i { color: var(--primary-color); }
.dashboard-header p {
    color: var(--text-muted); font-weight: 500;
    margin-top: 6px; font-size: 0.875rem;
}
.dash-date {
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); margin-top: 2px;
}

/* ── KPI Row ── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-sm);
}
.kpi-card::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 100%; height: 4px;
    background: var(--gradient-primary);
}
.kpi-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.kpi-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--primary-light); color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 14px;
}
.kpi-value {
    font-size: 2rem; font-weight: 800;
    color: var(--text-main); line-height: 1; margin-bottom: 4px;
    display: flex; align-items: baseline; gap: 4px;
}
.kpi-unit { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.kpi-trend {
    display: flex; align-items: center; gap: 4px;
    margin-top: 10px; font-size: 0.75rem; font-weight: 700;
    padding: 3px 8px; border-radius: 100px; width: fit-content;
}
.kpi-trend.up   { background: #dcfce7; color: #15803d; }
.kpi-trend.neutral { background: var(--primary-light); color: var(--primary-color); }
[data-theme="dark"] .kpi-trend.up { background: rgba(22,163,74,.2); color: #4ade80; }
[data-theme="dark"] .kpi-trend.neutral { background: rgba(163,230,53,.15); color: #a3e635; }

/* ── Grid layout ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ── Panel ── */
.dashboard-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease;
    overflow: hidden;
}
.dashboard-panel:hover { box-shadow: var(--shadow-md); }
.panel-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 18px;
}
.panel-header h3 {
    font-size: 0.95rem; font-weight: 700;
    color: var(--text-main);
    display: flex; align-items: center; gap: 8px;
}
.panel-header h3 i { color: var(--primary-color); font-size: 0.9rem; }
.panel-badge {
    font-size: 0.68rem; padding: 4px 10px;
    border-radius: 100px;
    background: var(--primary-light); color: var(--primary-color);
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}

/* ── Bar Chart (pure CSS) ── */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.78rem;
}
.bar-label {
    width: 130px; min-width: 130px;
    font-weight: 600; color: var(--text-muted);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; text-align: right;
}
.bar-track {
    flex: 1; height: 22px;
    background: var(--border-color);
    border-radius: 6px; overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 6px;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 8px;
}
.bar-fill span {
    font-size: 0.7rem; font-weight: 700; color: #fff;
    white-space: nowrap;
}
.bar-num {
    min-width: 28px; text-align: right;
    font-weight: 700; color: var(--text-main); font-size: 0.78rem;
}

/* ── Donut Chart (SVG) ── */
.donut-wrapper {
    display: flex; flex-direction: column; align-items: center;
}
.donut-svg-container {
    position: relative; width: 160px; height: 160px;
    margin: 0 auto;
}
.donut-center-text {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.donut-center-text .big-num {
    font-size: 1.8rem; font-weight: 800;
    color: var(--text-main); line-height: 1;
}
.donut-center-text .small-lbl {
    font-size: 0.65rem; font-weight: 600;
    color: var(--text-muted); margin-top: 2px;
}
.donut-legend {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 6px; margin-top: 14px; width: 100%;
}
.legend-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
}
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 3px; flex-shrink: 0;
}
.legend-value {
    margin-left: auto; font-weight: 700;
    color: var(--text-main);
}

/* ── Data Table ── */
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: separate;
    border-spacing: 0;
}
.data-table th {
    text-align: left; font-size: 0.68rem;
    font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border-color);
}
.data-table td {
    padding: 11px 12px; font-size: 0.8rem;
    font-weight: 500; color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-bar-bg {
    flex: 1; height: 7px;
    background: var(--border-color);
    border-radius: 100px; overflow: hidden; min-width: 50px;
}
.progress-bar-fill {
    height: 100%; border-radius: 100px;
    background: var(--gradient-primary);
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
    width: 0%;
}
.progress-text {
    font-size: 0.72rem; font-weight: 700;
    color: var(--primary-color); min-width: 32px; text-align: right;
}

/* ── Status badges ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 100px;
    font-size: 0.68rem; font-weight: 700; white-space: nowrap;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-badge.completed  { background: #dcfce7; color: #15803d; }
.status-badge.in-progress{ background: #fef3c7; color: #b45309; }
.status-badge.planned    { background: #dbeafe; color: #1d4ed8; }
.status-badge.completed  .status-dot { background: #16a34a; }
.status-badge.in-progress .status-dot { background: #f59e0b; }
.status-badge.planned    .status-dot { background: #3b82f6; }
[data-theme="dark"] .status-badge.completed   { background: rgba(22,163,74,.2);  color: #4ade80; }
[data-theme="dark"] .status-badge.in-progress { background: rgba(245,158,11,.2); color: #fbbf24; }
[data-theme="dark"] .status-badge.planned     { background: rgba(59,130,246,.2); color: #60a5fa; }
[data-theme="dark"] .status-badge.completed  .status-dot { background: #4ade80; }
[data-theme="dark"] .status-badge.in-progress .status-dot { background: #fbbf24; }
[data-theme="dark"] .status-badge.planned    .status-dot { background: #60a5fa; }

/* ── Activity Feed ── */
.activity-feed { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px; border-radius: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, transform 0.2s;
}
.activity-item:hover { border-color: var(--primary-color); transform: translateX(4px); }
.activity-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; flex-shrink: 0;
}
.activity-icon.green { background: #dcfce7; color: #15803d; }
.activity-icon.amber { background: #fef3c7; color: #b45309; }
.activity-icon.blue  { background: #dbeafe; color: #1d4ed8; }
[data-theme="dark"] .activity-icon.green { background: rgba(22,163,74,.2);  color: #4ade80; }
[data-theme="dark"] .activity-icon.amber { background: rgba(245,158,11,.2); color: #fbbf24; }
[data-theme="dark"] .activity-icon.blue  { background: rgba(59,130,246,.2); color: #60a5fa; }
.activity-info h4 { font-size: 0.8rem; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.activity-info p  { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 1200px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .kpi-row { grid-template-columns: 1fr; }
}


/* Upload Button and File Items */
.btn-upload-small { background: #16a34a; color: white; border: none; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0.8; transition: opacity 0.2s, transform 0.2s; margin-left: 10px; }
.btn-upload-small:hover { opacity: 1; transform: scale(1.1); }
.empty-folder-msg { color: #94a3b8; font-style: italic; font-size: 0.85rem; padding: 5px 10px 5px 35px; }
.file-item { color: #475569; }
.file-item:hover { color: var(--primary-color); }
