:root {
  --page-bg: #eef2f6;
  --navy: #163a6b;
  --title: #1b3a6b;
  --muted: #6b7280;
  --accent: #2563eb;
  --week-bar: #1d4ed8;
  --chevron: #2aa8c4;
  --card-border: #e5e7eb;
  --entregado-bg: #dcfce7;
  --entregado-fg: #166534;
  --pendiente-bg: #fef3c7;
  --pendiente-fg: #92400e;
}

html,
body {
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: #1f2937;
}

.page-wrap {
  max-width: 1180px;
}

.page-title {
  color: var(--title);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.excel-download {
  color: inherit;
  font-weight: 600;
}

.excel-download:hover {
  color: var(--accent);
}

.filter-label {
  color: #374151;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.filter-select {
  min-width: 180px;
  border-color: #d1d5db;
  color: #111827;
  background-color: #fff;
}

.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.semana-block {
  margin-bottom: 1.15rem;
}

.semana-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--week-bar);
  background: #fff;
  color: #111827;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.semana-toggle:hover,
.semana-toggle:focus {
  background: #fff;
  color: #111827;
}

.semana-toggle .bi-chevron-up {
  color: var(--chevron);
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.semana-toggle.collapsed .bi-chevron-up {
  transform: rotate(180deg);
}

.tarea-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 0.7rem;
}

.tarea-card {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.4fr) auto minmax(210px, 0.9fr) auto;
  align-items: center;
  gap: 0.9rem 1.1rem;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tarea-icon {
  color: #9ca3af;
  font-size: 1.45rem;
  line-height: 1;
}

.tarea-curso {
  color: #1f2937;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.08rem;
}

.tarea-tipo {
  color: #6b7280;
  font-size: 0.78rem;
  margin-bottom: 0.12rem;
}

.tarea-desc {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  cursor: pointer;
}

.status-pill:hover {
  filter: brightness(0.97);
}

.status-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status-pill i {
  font-size: 1rem;
}

.status-entregado {
  background: var(--entregado-bg);
  color: var(--entregado-fg);
}

.status-pendiente {
  background: var(--pendiente-bg);
  color: var(--pendiente-fg);
}

.tarea-dates {
  color: #4b5563;
  font-size: 0.82rem;
  line-height: 1.45;
}

.tarea-dates time {
  color: inherit;
}

.btn-actividad {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  padding: 0.45rem 0.85rem;
}

.btn-actividad:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.empty-state {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
}

.estado-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.estado-overlay[hidden] {
  display: none !important;
}

.estado-dialog {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.35rem 1.1rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.estado-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.estado-close:hover,
.estado-close:focus-visible {
  color: #111827;
}

.estado-dialog-text {
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.45;
}

.estado-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

@media (max-width: 991.98px) {
  .tarea-card {
    grid-template-columns: auto 1fr;
  }

  .tarea-status,
  .tarea-dates,
  .tarea-action {
    grid-column: 2;
  }

  .tarea-action {
    justify-self: start;
  }
}

@media (max-width: 575.98px) {
  .page-title {
    font-size: 1.4rem;
  }

  .tarea-card {
    grid-template-columns: 1fr;
  }

  .tarea-status,
  .tarea-dates,
  .tarea-action {
    grid-column: 1;
  }
}
