/* ── HOY ───────────────────────────────────────────────────── */
.today-widget {
  border-radius: var(--r); padding: 18px; margin-bottom: 14px; color: #fff;
}
.today-date { font-size: .74rem; opacity: .8; margin-bottom: 3px; }
.today-greeting { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.today-items { display: flex; flex-direction: column; gap: 7px; }
.today-item {
  background: rgba(255,255,255,.16); border-radius: 8px;
  padding: 8px 12px; font-size: .8rem;
  display: flex; align-items: center; gap: 8px;
}
.today-item svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; flex-shrink: 0; }

.today-upcoming { margin-top: 14px; }
.upcoming-card {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 12px 15px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-left: 3px solid var(--border);
}
.upcoming-card .info { flex: 1; min-width: 0; }
.upcoming-card .titulo { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-card .asig { font-size: .72rem; color: var(--text3); margin-top: 2px; }
.upcoming-card .fecha { font-size: .72rem; color: var(--text3); white-space: nowrap; }

/* ── ASIGNATURAS ───────────────────────────────────────────── */
.asig-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px)  { .asig-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .asig-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .asig-grid { grid-template-columns: repeat(5, 1fr); } }

/* Tamaño ajustable via JS */
.asig-grid.size-small  { grid-template-columns: repeat(3, 1fr); }
.asig-grid.size-small  { }
@media (min-width: 480px) { .asig-grid.size-small { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .asig-grid.size-small { grid-template-columns: repeat(6, 1fr); } }

.asig-grid.size-large  { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 480px) { .asig-grid.size-large { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .asig-grid.size-large { grid-template-columns: repeat(3, 1fr); } }

.asig-card {
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.asig-card:active { transform: scale(.97); }
@media (hover: hover) { .asig-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); } }

.asig-cover {
  height: 96px; position: relative; overflow: hidden;
}
.asig-cover img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: .55; mix-blend-mode: luminosity; display: block;
}
.asig-cover-overlay {
  position: absolute; inset: 0;
}
.asig-body { padding: 10px 12px; }
.asig-nombre { font-size: .78rem; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.asig-stats { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── DETALLE ASIGNATURA ────────────────────────────────────── */
.asig-detail-head {
  height: 150px; border-radius: var(--r); overflow: hidden;
  position: relative; margin-bottom: 16px;
}
.asig-detail-head .bg { position: absolute; inset: 0; }
.asig-detail-head img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .4; display: block;
}
.asig-detail-head .info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.asig-detail-head h2 { font-size: 1.15rem; font-weight: 700; color: #fff; }
.asig-detail-head .sub { font-size: .74rem; color: rgba(255,255,255,.7); margin-top: 2px; }

/* ── KANBAN ────────────────────────────────────────────────── */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: start;
}
/* En mobile dentro de asignatura, apilamos */
@media (max-width: 500px) {
  .kanban.mobile-stack { grid-template-columns: 1fr; }
}

.kanban-col {
  background: var(--surface2); border-radius: var(--r);
  padding: 10px; min-height: 100px;
}
.kanban-col-head {
  display: flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px; color: var(--text3);
}
.kanban-count {
  background: var(--surface3); color: var(--text3);
  font-size: .62rem; padding: 1px 6px; border-radius: 10px;
}

.kanban-card {
  background: var(--surface); border-radius: var(--r-sm);
  box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 7px;
  cursor: pointer; user-select: none;
  transition: box-shadow .2s, transform .2s;
  touch-action: none; /* necesario para drag en touch */
}
.kanban-card.dragging {
  box-shadow: var(--shadow-md);
  transform: scale(1.03) rotate(1deg);
  opacity: .9;
  z-index: 100;
  position: relative;
}
.kanban-card-title { font-size: .78rem; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.kanban-card-tag {
  font-size: .6rem; padding: 2px 6px; border-radius: 6px;
  font-weight: 500; background: var(--surface2); color: var(--text3);
}
.kanban-card-tag.urgent { background: var(--danger-l); color: var(--danger); }
.kanban-card-tag.colored { color: #fff; }

.kanban-col.drag-over { background: var(--accent-l); }

/* ── HORARIO ───────────────────────────────────────────────── */
.horario-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.horario-table { width: 100%; border-collapse: separate; border-spacing: 3px; }
.hor-th {
  font-size: .62rem; font-weight: 600; color: var(--text3);
  padding: 5px 2px; text-align: center;
}
.hor-hora {
  font-size: .6rem; color: var(--text3); font-weight: 500;
  padding: 2px 4px; text-align: right; white-space: nowrap; vertical-align: middle;
}
.hor-cell {
  min-height: 50px; border-radius: 8px;
  background: var(--surface2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 4px;
  font-size: .6rem; font-weight: 500; line-height: 1.3;
  color: var(--text3); transition: all .15s;
}
.hor-cell.filled { color: #fff; font-weight: 600; font-size: .62rem; }
.hor-cell:active { opacity: .8; }

/* ── AJUSTES ───────────────────────────────────────────────── */
.settings-page-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.settings-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-l); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.settings-avatar svg { width: 28px; height: 28px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.settings-name { font-size: 1rem; font-weight: 700; }
.settings-sub  { font-size: .78rem; color: var(--text3); margin-top: 2px; }

.asig-manage-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
}
.asig-manage-item:last-child { border-bottom: none; }
.asig-manage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.asig-manage-name { flex: 1; font-size: .85rem; font-weight: 500; }
.asig-manage-del {
  background: var(--danger-l); color: var(--danger);
  border: none; border-radius: 6px; padding: 4px 10px;
  font-size: .7rem; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ── PICKER ASIGNATURA (horario) ───────────────────────────── */
.asig-picker {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
  max-height: 320px; overflow-y: auto;
}
.picker-item {
  padding: 10px 12px; border-radius: var(--r-sm);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 2px solid transparent;
  font-size: .8rem; font-weight: 500; transition: all .15s;
}
.picker-item.selected { border-color: currentColor; }
.picker-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.picker-clear {
  grid-column: span 2; text-align: center; padding: 10px;
  color: var(--danger); font-size: .8rem; font-weight: 500; cursor: pointer;
}
