/* ============================================================
   ProfeAcademī · App Calendario de Pruebas — Soft UI claro
   ============================================================ */

.pa-cal-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.6rem 1rem 4rem;
}

.pa-cal-card {
  background: var(--inicio-card-bg, #fff);
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
  border-radius: 20px;
  padding: 1.8rem 2rem;
  box-shadow: 0 18px 50px var(--inicio-shadow, rgba(0,0,0,.08));
  margin-bottom: 1.2rem;
  position: relative;
  overflow: hidden;
}
.pa-cal-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: linear-gradient(180deg, transparent, rgba(167,139,250,.06));
  pointer-events: none;
  border-radius: 0 0 20px 20px;
}
.pa-cal-card > * { position: relative; z-index: 1; }

/* ── Header ── */
.pa-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
}
.pa-cal-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--inicio-text-primary, #1f2937);
}
.pa-cal-title .icon { font-size: 1.95rem; filter: drop-shadow(0 4px 8px rgba(167,139,250,.35)); }

.pa-cal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.pa-cal-select {
  background: white;
  color: var(--inicio-text-primary, #1f2937);
  border: 1.5px solid var(--inicio-card-border, rgba(0,0,0,.12));
  border-radius: 10px;
  padding: .55rem .9rem;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.pa-cal-select:focus { outline: none; border-color: var(--inicio-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

.pa-cal-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  background: var(--inicio-primary, #4f46e5);
  color: white;
  border: 0;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
  box-shadow: 0 4px 12px rgba(79,70,229,.25);
  text-decoration: none;
}
.pa-cal-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,.35); filter: brightness(1.05); }
.pa-cal-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.pa-cal-btn-ghost {
  background: transparent;
  color: var(--inicio-text-secondary, #6b7280);
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.1));
  box-shadow: none;
}
.pa-cal-btn-ghost:hover { background: rgba(99,179,237,.08); color: var(--inicio-primary, #4f46e5); box-shadow: none; }
.pa-cal-btn-success { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.pa-cal-btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.pa-cal-btn-icon {
  padding: .45rem .65rem;
  font-size: .82rem;
  background: white;
  color: #475569;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.pa-cal-btn-icon.danger { color: #b91c1c; border-color: rgba(239,68,68,.3); }
.pa-cal-btn-icon:hover { background: #f9fafb; }

/* ── Navegación de mes ── */
.pa-cal-monthnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.pa-cal-monthnav h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--inicio-text-primary, #1f2937);
  text-transform: capitalize;
  min-width: 220px;
  text-align: center;
}
.pa-cal-nav-btn {
  background: white;
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.1));
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #475569;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.pa-cal-nav-btn:hover { background: rgba(99,179,237,.08); color: var(--inicio-primary, #4f46e5); transform: translateY(-1px); }

/* ── Calendario tipo grid ── */
.pa-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .4rem;
}
.pa-cal-dayhead {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--inicio-text-secondary, #6b7280);
  padding: .55rem 0;
}

.pa-cal-day {
  position: relative;
  min-height: 110px;
  padding: .55rem .55rem .35rem;
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
  border-radius: 12px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.pa-cal-day:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.06); border-color: rgba(167,139,250,.4); }
.pa-cal-day.outside { background: #fafafa; color: #c7c7d1; cursor: default; opacity: .75; }
.pa-cal-day.outside:hover { transform: none; box-shadow: none; border-color: var(--inicio-card-border, rgba(0,0,0,.06)); }
.pa-cal-day.today { border: 2px solid var(--inicio-primary, #4f46e5); }

.pa-cal-day .num {
  font-size: .88rem;
  font-weight: 700;
  color: var(--inicio-text-primary, #1f2937);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pa-cal-day.outside .num { color: #c7c7d1; }
.pa-cal-day .count {
  font-size: .65rem;
  background: rgba(167,139,250,.18);
  color: #6d28d9;
  padding: 1px 7px;
  border-radius: 9px;
  font-weight: 700;
}

/* Pruebas dentro del día (chips compactos) */
.pa-cal-test {
  font-size: .72rem;
  padding: 3px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(99,179,237,.18), rgba(167,139,250,.16));
  border-left: 3px solid var(--inicio-primary, #4f46e5);
  color: var(--inicio-text-primary, #1f2937);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.pa-cal-test.color-1 { border-left-color: #10b981; background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(16,185,129,.08)); color: #047857; }
.pa-cal-test.color-2 { border-left-color: #f59e0b; background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.08)); color: #92400e; }
.pa-cal-test.color-3 { border-left-color: #ef4444; background: linear-gradient(135deg, rgba(239,68,68,.18), rgba(239,68,68,.08)); color: #b91c1c; }
.pa-cal-test.color-4 { border-left-color: #3b82f6; background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(59,130,246,.08)); color: #1d4ed8; }
.pa-cal-test.color-5 { border-left-color: #ec4899; background: linear-gradient(135deg, rgba(236,72,153,.18), rgba(236,72,153,.08)); color: #be185d; }
.pa-cal-more {
  font-size: .68rem;
  color: var(--inicio-text-secondary, #6b7280);
  font-style: italic;
  text-align: center;
  font-weight: 600;
}

/* ── Modal detalle día ── */
.pa-cal-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  padding: 1rem;
}
.pa-cal-modal.open { display: flex; }
.pa-cal-modal-card {
  background: white;
  border-radius: 18px;
  padding: 1.8rem;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.pa-cal-modal-card h3 {
  margin: 0 0 .35rem;
  font-size: 1.25rem;
  color: var(--inicio-text-primary, #1f2937);
  display: flex; align-items: center; gap: .5rem;
}
.pa-cal-modal-sub {
  font-size: .82rem;
  color: var(--inicio-text-secondary, #6b7280);
  margin-bottom: 1rem;
  text-transform: capitalize;
}
.pa-cal-modal-close {
  position: absolute; top: .8rem; right: .8rem;
  background: transparent; border: 0;
  font-size: 1.4rem; color: #9ca3af; cursor: pointer; line-height: 1;
}
.pa-cal-modal-close:hover { color: #1f2937; }

.pa-cal-test-list {
  display: flex; flex-direction: column; gap: .65rem;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: .25rem;
  flex: 1;
}
.pa-cal-test-item {
  background: white;
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.08));
  border-left: 4px solid var(--inicio-primary, #4f46e5);
  border-radius: 12px;
  padding: .9rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: .8rem;
}
.pa-cal-test-item.color-1 { border-left-color: #10b981; }
.pa-cal-test-item.color-2 { border-left-color: #f59e0b; }
.pa-cal-test-item.color-3 { border-left-color: #ef4444; }
.pa-cal-test-item.color-4 { border-left-color: #3b82f6; }
.pa-cal-test-item.color-5 { border-left-color: #ec4899; }

.pa-cal-test-info { flex: 1; min-width: 0; }
.pa-cal-test-info .ttl { font-weight: 700; color: var(--inicio-text-primary, #1f2937); margin-bottom: .15rem; font-size: 1rem; }
.pa-cal-test-info .meta { font-size: .8rem; color: var(--inicio-text-secondary, #6b7280); display: flex; flex-wrap: wrap; gap: .35rem .8rem; }
.pa-cal-test-info .meta strong { color: #475569; font-weight: 600; }
.pa-cal-test-info .desc { font-size: .82rem; color: #475569; margin-top: .35rem; line-height: 1.45; }

.pa-cal-test-actions { display: flex; gap: .35rem; flex-shrink: 0; }

/* ── Form modal (crear/editar) ── */
.pa-cal-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.pa-cal-field label { font-size: .82rem; font-weight: 600; color: var(--inicio-text-secondary, #6b7280); }
.pa-cal-field input,
.pa-cal-field select,
.pa-cal-field textarea {
  width: 100%;
  padding: .55rem .85rem;
  border-radius: 10px;
  border: 1.5px solid var(--inicio-card-border, rgba(0,0,0,.12));
  font-size: .9rem;
  background: white;
  color: var(--inicio-text-primary, #1f2937);
  box-sizing: border-box;
  font-family: inherit;
}
.pa-cal-field input:focus,
.pa-cal-field select:focus,
.pa-cal-field textarea:focus { outline: none; border-color: var(--inicio-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.pa-cal-field textarea { resize: vertical; min-height: 70px; }
.pa-cal-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

.pa-cal-modal-actions {
  display: flex; gap: .6rem; justify-content: flex-end; margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
}

/* ── Empty / loading ── */
.pa-cal-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--inicio-text-secondary, #6b7280);
  font-size: .92rem;
}
.pa-cal-empty .ic { font-size: 2.6rem; margin-bottom: .5rem; }

/* ── Toasts ── */
.pa-cal-toast-container {
  position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: .55rem;
  pointer-events: none; max-width: 95vw;
}
.pa-cal-toast {
  pointer-events: auto;
  padding: .85rem 1.4rem;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(0,0,0,.08);
  border-left: 4px solid var(--inicio-primary, #4f46e5);
  color: #1f2937; font-size: .9rem; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  max-width: 420px;
  animation: paCalToastIn .25s ease;
}
.pa-cal-toast.success { border-left-color: #10b981; }
.pa-cal-toast.error   { border-left-color: #ef4444; }
.pa-cal-toast.info    { border-left-color: #4f46e5; }
@keyframes paCalToastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsivo ── */
@media (max-width: 720px) {
  .pa-cal-card { padding: 1.4rem 1rem; }
  .pa-cal-day { min-height: 70px; padding: .35rem; }
  .pa-cal-day .num { font-size: .78rem; }
  .pa-cal-test { font-size: .65rem; padding: 2px 5px; }
  .pa-cal-monthnav h2 { font-size: 1.1rem; min-width: 0; }
}
@media (max-width: 480px) {
  .pa-cal-grid { gap: .25rem; }
  .pa-cal-day { min-height: 60px; }
  .pa-cal-day .count { display: none; }
  .pa-cal-day .pa-cal-test { display: none; }
}
