/* =============================================================================
   Matrícula V3 · Web — Anotaciones (tablón de post-it)
   ============================================================================= */
.an-wrap { background: transparent; }

.an-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.an-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.an-filters button {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  background: var(--panel); color: var(--ink-soft);
}
.an-filters button:hover { background: var(--white); color: var(--ink); }
.an-filters button.active { background: var(--titlebar); color: #fff; border-color: var(--titlebar); }
.an-new-btn {
  margin-left: auto; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--yellow-deep); border-radius: var(--r-sm); padding: 9px 16px;
  background: linear-gradient(180deg, #ffd84a, var(--yellow)); color: #241f00;
}
.an-new-btn:active { transform: translateY(1px); }

/* Composer */
.an-composer {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px;
}
.an-composer[hidden] { display: none; }
.an-composer-row { display: flex; gap: 10px; flex-wrap: wrap; }
.an-select {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px;
}
.an-textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink); line-height: 1.4;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 12px; resize: vertical; outline: none;
}
.an-textarea:focus, .an-select:focus { border-color: var(--yellow-deep); box-shadow: 0 0 0 3px rgba(243,194,10,.22); }
.an-composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.an-mini {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 14px; background: var(--white); color: var(--ink);
}
.an-publish {
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--yellow-deep); border-radius: var(--r-sm); padding: 8px 18px;
  background: linear-gradient(180deg, #ffd84a, var(--yellow)); color: #241f00;
}

/* Tablón masonry */
.an-grid { columns: 4 230px; column-gap: 14px; }
/* El cartel de "sin notas" no debe trocearse entre columnas: que ocupe todo. */
.an-empty { column-span: all; break-inside: avoid; }

.an-card {
  break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 14px;
  border-radius: 5px; padding: 16px 16px 12px; position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.16); color: #2a2410;
  transition: box-shadow .16s, transform .16s;
}
.an-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.24); }

/* Colores por tipo (igual paleta que el V2) */
.an-card.recordatorio { background: #FFE566; border: 2px solid #C9A800; }
.an-card.aviso        { background: #FF9EBA; border: 2px solid #D94070; }
.an-card.tarea        { background: #85C5F5; border: 2px solid #2E8FC4; }
.an-card.comunicado   { background: #8DE8B0; border: 2px solid #2EAA68; }

.an-card.pinned { border-width: 3px; box-shadow: 0 5px 18px rgba(0,0,0,.28); }
.an-card.pinned::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  border-radius: 4px 4px 0 0; background: rgba(0,0,0,.32);
}
.an-card.completada { opacity: .6; }
.an-card.completada .an-card-text { text-decoration: line-through; color: rgba(0,0,0,.5); }

.an-tipo-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(0,0,0,.18); color: rgba(0,0,0,.7); padding: 3px 8px; border-radius: 4px; margin-bottom: 8px;
}
.an-card-text { font-size: 15px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; font-weight: 500; }

.an-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.an-avatar { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.an-author { font-size: 12.5px; font-weight: 700; color: rgba(0,0,0,.72); }
.an-date { margin-left: auto; font-size: 11px; color: rgba(0,0,0,.55); font-variant-numeric: tabular-nums; }

/* Botones de la nota */
.an-card-btn {
  position: absolute; top: 8px; width: 24px; height: 24px; border: none; cursor: pointer;
  background: rgba(0,0,0,.10); border-radius: 6px; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: rgba(0,0,0,.6); padding: 0;
}
.an-card-btn:hover { background: rgba(0,0,0,.2); }
.an-card-btn.pin { right: 36px; }
.an-card-btn.pin.on { background: rgba(0,0,0,.32); color: #fff; }
.an-card-btn.del { right: 8px; font-size: 18px; }

.an-done-row {
  width: 100%; margin-top: 10px; border: none; cursor: pointer; text-align: left;
  background: rgba(255,255,255,.4); border-radius: 5px; padding: 7px 9px;
  font-family: inherit; font-size: 12px; font-weight: 600; color: rgba(0,0,0,.68);
  display: flex; align-items: center; gap: 7px;
}
.an-done-row:hover { background: rgba(255,255,255,.7); }
.an-done-check {
  width: 16px; height: 16px; border-radius: 4px; border: 2px solid rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent;
}
.an-done-check.on { background: #2a7d2a; border-color: #2a7d2a; color: #fff; }

@media (max-width: 760px) { .an-grid { columns: 2 150px; } .an-new-btn { margin-left: 0; } }

/* =============================================================================
   Anotaciones — sub-vistas (Tablón / Calendario / Historial)
   ============================================================================= */
.an-views { display: inline-flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 18px; }
.an-views button {
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  border: none; background: transparent; color: var(--ink-soft); padding: 7px 16px; border-radius: 999px;
}
.an-views button:hover { color: var(--ink); }
.an-views button.active { background: var(--titlebar); color: #fff; }

/* ---- Calendario ---- */
.cal-layout { display: flex; gap: 14px; align-items: flex-start; }
.cal-main { flex: 1; min-width: 0; }
.cal-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-navbtn { font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer; width: 32px; height: 32px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-sm); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.cal-navbtn.today { width: auto; padding: 0 12px; font-size: 13px; }
.cal-navbtn:hover { background: var(--white); }
.cal-label { font-size: 18px; margin: 0; min-width: 160px; text-align: center; }
.cal-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-stat { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--ink-soft); }
.cal-stat.total { background: var(--titlebar); color: #fff; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.cal-dh { padding: 7px 4px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); background: var(--panel-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 92px; padding: 5px 5px 4px; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.cal-day:hover { background: var(--white); }
.cal-day.other { background: var(--panel-2); opacity: .45; pointer-events: none; }
.cal-day.today { background: #fff7da; }
.cal-day.sel { outline: 2px solid var(--yellow-deep); outline-offset: -2px; }
.cal-num { font-size: 12px; font-weight: 700; color: var(--ink-soft); width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin-bottom: 3px; }
.cal-day.today .cal-num { background: var(--yellow-deep); color: #241f00; }
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-bar { font-size: 10.5px; font-weight: 600; color: rgba(0,0,0,.75); padding: 2px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10px; color: var(--ink-soft); font-weight: 600; padding: 1px 4px; }

.cal-detail { width: 0; flex: 0 0 auto; overflow: hidden; transition: width .2s ease; }
.cal-detail.open { width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.cal-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cal-detail-dow { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.cal-detail-date { font-size: 14px; font-weight: 700; }
.cal-detail-close { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--ink-soft); line-height: 1; }
.cal-detail-body { padding: 10px; display: flex; flex-direction: column; gap: 7px; max-height: 540px; overflow-y: auto; }
.cal-detail-empty { text-align: center; padding: 28px 12px; color: var(--ink-soft); font-size: 13px; }
.cal-inc { background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; }
.cal-inc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.cal-inc-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; }
.cal-inc-done { font-size: 11px; font-weight: 700; color: var(--green); }
.cal-inc-text { font-size: 13px; line-height: 1.4; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.cal-inc-meta { font-size: 11px; color: var(--ink-soft); margin-top: 5px; }

/* ---- Historial ---- */
.an-filters.hist { margin-bottom: 14px; }
.hist-list { display: flex; flex-direction: column; gap: 5px; max-width: 860px; }
.hist-item { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; }
.hist-item.done { opacity: .65; }
.hist-item.done .hist-text { text-decoration: line-through; }
.hist-badge { width: 120px; flex: 0 0 auto; text-align: center; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 4px 6px; border-radius: 5px; color: rgba(0,0,0,.72); }
.hist-badge.recordatorio { background: #FFE566; }
.hist-badge.aviso { background: #FF9EBA; }
.hist-badge.tarea { background: #85C5F5; }
.hist-badge.comunicado { background: #8DE8B0; }
.hist-info { flex: 1; min-width: 0; }
.hist-text { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.hist-done-tag { color: var(--green); font-weight: 800; flex: 0 0 auto; }

@media (max-width: 820px) { .cal-detail.open { width: 240px; } }
