* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* BARRA SUPERIOR */
.topbar {
    background: #4a5d23;
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid #6b7f3a;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
}
.logo-area h1 {
    font-size: 1.2rem;
    font-weight: 500;
}
/* Selector de proyectos */
.project-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 8px;
}
.project-selector label {
    font-size: 0.7rem;
    opacity: 0.8;
}
.project-selector select {
    background: transparent;
    color: white;
    border: none;
    font-size: 0.85rem;
    padding: 4px 8px;
    cursor: pointer;
}
.project-selector select option {
    background: #4a5d23;
    color: white;
}
/* MENÚ PRINCIPAL */
.main-menu {
    display: flex;
    padding: 0 20px;
    gap: 4px;
    flex-wrap: wrap;
}
.menu-item {
    position: relative;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    border-radius: 6px 6px 0 0;
}
.menu-item:hover {
    background: #5c7030;
}
.menu-item.active {
    background: white;
    color: #4a5d23;
    font-weight: 500;
}
/* SUBMENU */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    color: #333;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
}
.menu-item:hover .submenu {
    display: block;
}
.submenu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.1s;
}
.submenu-item:hover {
    background: #f0f2f5;
    color: #4a5d23;
}
/* CONTENIDO PRINCIPAL */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #f0f2f5;
}
.page { display: none; animation: fade 0.2s; }
.page.active-page { display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Tarjetas */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
.task-card, .presentation-card, .minutes-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}
.task-card:hover, .presentation-card:hover, .minutes-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #4a5d23; }
.task-title, .presentation-title, .minutes-title { font-weight: 600; font-size: 1rem; margin-bottom: 8px; color: #1a1a1a; }
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.card-actions button {
    padding: 4px 10px;
    font-size: 0.7rem;
    background: #e8e8e8;
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.card-actions button:hover { background: #4a5d23; color: white; }
.tag {
    background: #e8e8e8;
    color: #4a5d23;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.7rem;
    margin: 8px 0;
}
.overdue { border-left: 3px solid #e67e22; }
.soon { border-left: 3px solid #f59e0b; }

/* Cronograma */
.cronograma-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.cronograma-table th, .cronograma-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 8px;
    font-size: 0.8rem;
    text-align: left;
    vertical-align: middle;
}
.cronograma-table th {
    background: #f5f5f5;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.cronograma-table th:hover { background: #e8e8e8; }
.sort-icon { font-size: 10px; margin-left: 6px; opacity: 0.5; }
.progress-bar { background: #e0e0e0; height: 24px; border-radius: 12px; cursor: pointer; overflow: hidden; width: 100px; }
.progress-fill { background: #4a5d23; height: 100%; color: white; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }
.cronograma-table button {
    padding: 4px 8px;
    font-size: 0.7rem;
    margin: 2px;
    background: #e8e8e8; color: #1a1a1a; font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.cronograma-table button:hover { background: #4a5d23; color: white; }

/* Formularios */
.form-card { background: white; border-radius: 16px; padding: 24px; max-width: 800px; border: 1px solid #e0e0e0; margin: auto; }
.form-group { margin-bottom: 18px; }
label { font-weight: 500; display: block; margin-bottom: 6px; font-size: 0.8rem; color: #333; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 0.85rem; }
button { background: #4a5d23; color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; margin-right: 10px; font-size: 0.85rem; }
button:hover { background: #5c7030; }

/* Dashboard */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 12px; padding: 16px; text-align: center; border: 1px solid #e0e0e0; }
.stat-number { font-size: 1.8rem; font-weight: 700; color: #4a5d23; }
.charts-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.chart-card { background: white; border-radius: 12px; padding: 16px; border: 1px solid #e0e0e0; }
canvas { max-width: 100%; height: auto; max-height: 200px; }

/* Calendario */
.calendar-container { background: white; border-radius: 16px; padding: 20px; border: 1px solid #e0e0e0; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.calendar-nav button { background: #e8e8e8; color: #333; padding: 6px 14px; border-radius: 8px; border: none; cursor: pointer; }
.calendar-title { font-size: 1.1rem; font-weight: 600; color: #4a5d23; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 500; padding: 10px 0; border-bottom: 1px solid #e0e0e0; margin-bottom: 8px; font-size: 0.75rem; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-day {
    min-height: 85px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.calendar-day:hover { background: #f0f0f0; }
.calendar-day.empty { background: #f5f5f5; opacity: 0.5; }
.calendar-day.today { background: #e8f0e8; border-color: #4a5d23; }
.day-number { font-weight: 600; font-size: 0.75rem; color: #333; margin-bottom: 6px; }
.calendar-event {
    background: #e0e0e0;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
    font-size: 0.6rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

/* Filtros */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 40px;
    align-items: center;
}
.search-box { flex: 1; padding: 8px 16px; border: 1px solid #ccc; border-radius: 30px; min-width: 150px; }
.filter-btn { background: #e8e8e8; border-radius: 30px; padding: 6px 18px; cursor: pointer; font-size: 0.75rem; white-space: nowrap; }
.filter-btn.active { background: #4a5d23; color: white; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; border-radius: 16px; padding: 24px; max-width: 700px; width: 90%; max-height: 80vh; overflow-y: auto; }
.fullscreen-view { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; z-index: 1000; flex-direction: column; }
.fullscreen-view.active { display: flex; }
.fullscreen-header { padding: 15px 20px; background: #4a5d23; color: white; display: flex; justify-content: space-between; align-items: center; }
.fullscreen-content { flex: 1; padding: 20px; overflow: auto; }
iframe { width: 100%; height: 90%; border: none; }

/* Repositorio */
.folder-container {
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}
.folder-header {
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    background: #fafafa;
    border-radius: 12px 12px 0 0;
}
.folder-header:hover { background: #f0f0f0; }
.folder-content { padding: 16px; display: none; border-top: 1px solid #e0e0e0; }
.folder-content.open { display: block; }
.file-item {
    padding: 8px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agreements-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.agreements-table th, .agreements-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 0.8rem;
}
.agreements-table th { background: #f5f5f5; }

.notification-badge {
    background: #e67e22;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.65rem;
    margin-left: 8px;
}

@media (max-width: 700px) {
    .topbar-main { flex-direction: column; align-items: stretch; }
    .main-menu { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .main-content { padding: 12px; }
    .cards-grid { grid-template-columns: 1fr; }
    .cronograma-table th, .cronograma-table td { padding: 6px 4px; font-size: 0.7rem; }
    .cronograma-table button { padding: 2px 6px; font-size: 0.6rem; }
}
