/* ── Planeador de Clases ──────────────────────────────────────────────
   Para docentes: sobrio, cálido y legible. Verde pizarra + papel crema.
   Incluye hoja imprimible (el profe entrega la planeación a coordinación).
   ------------------------------------------------------------------- */

:root {
  --verde: #124734;
  --verde-2: #1B6349;
  --verde-cl: #E7F1EC;
  --ambar: #C8791A;
  --ink: #1E2A24;
  --ink-2: #4A5C53;
  --muted: #7B8C83;
  --line: #DFE7E2;
  --bg: #F6F8F6;
  --card: #FFFFFF;
  --rojo: #B42318;

  --radius: 14px;
  --shadow: 0 8px 26px rgba(18, 71, 52, .08);
  --fd: 'Fraunces', Georgia, serif;
  --fb: 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--fb); background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--fd); font-weight: 700; line-height: 1.2; }
input, button, textarea, select { font-family: inherit; font-size: 1rem; color: inherit; }
textarea { resize: vertical; }

.container { max-width: 940px; margin: 0 auto; padding: 0 1.1rem; }
.view { padding-bottom: 3rem; }

/* ── Botones ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 600; border: 1.5px solid transparent; border-radius: 10px; padding: .7rem 1.3rem; cursor: pointer; transition: background .18s, border-color .18s, transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-sm { padding: .45rem .85rem; font-size: .87rem; }
.btn-lg { padding: .9rem 1.7rem; font-size: 1.02rem; }
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: var(--verde-2); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.28); color: inherit; }
.view .btn-ghost, .editor-bar .btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.view .btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: #fff; border-color: #F0CFCB; color: var(--rojo); }
.btn-danger:hover { background: #FDF2F1; }

/* ── Header ─────────────────────────────────────────────────────── */
.top { background: var(--verde); color: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.brand { font-size: 1.08rem; display: flex; align-items: center; gap: .5rem; }
.brand-ico { font-size: 1.3rem; }
.top-actions { display: flex; gap: .5rem; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero { padding: 2.2rem 0 1.6rem; }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); margin-bottom: .5rem; }
.hero p { color: var(--ink-2); max-width: 560px; margin-bottom: 1.3rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ── Lista ──────────────────────────────────────────────────────── */
.list-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: .5rem; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .85rem; }
.search span { color: var(--muted); }
.search input { flex: 1; border: none; outline: none; background: none; }
.count { font-size: .85rem; color: var(--muted); }

.plan-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--verde); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: .8rem; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.plan-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(18,71,52,.13); }
.pc-top { display: flex; align-items: flex-start; gap: .8rem; }
.pc-info { flex: 1; min-width: 0; }
.pc-tema { font-family: var(--fd); font-size: 1.12rem; font-weight: 700; }
.pc-meta { font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.pc-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.chip { font-size: .74rem; font-weight: 600; background: var(--verde-cl); color: var(--verde); padding: .18rem .6rem; border-radius: 50px; }
.chip-amb { background: #FBF0E1; color: var(--ambar); }
.pc-acts { display: flex; gap: .35rem; }
.icon-btn { background: #fff; border: 1.5px solid var(--line); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: .9rem; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--verde); }

.vacio { text-align: center; color: var(--muted); background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); padding: 3rem 1.5rem; }
.vacio b { display: block; color: var(--ink); font-family: var(--fd); font-size: 1.1rem; margin-bottom: .3rem; }

/* ── Editor ─────────────────────────────────────────────────────── */
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.bar-right { display: flex; align-items: center; gap: .5rem; }
.saved { font-size: .82rem; color: var(--verde-2); }

.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--verde); padding-bottom: .9rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.inp-title { font-family: var(--fd); font-size: 1.35rem; font-weight: 700; border: none; outline: none; width: 100%; padding: 0; }
.inp-title::placeholder { color: #B9C6BF; }
.sh-sub { font-size: .82rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: .15rem; }
.sh-right label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.sh-right input { border: 1.5px solid var(--line); border-radius: 8px; padding: .45rem .6rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: .9rem; }
.fld { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.fld > span { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.fld input, .fld textarea { border: 1.5px solid var(--line); border-radius: 9px; padding: .6rem .75rem; background: #fff; outline: none; width: 100%; }
.fld input:focus, .fld textarea:focus, .sh-right input:focus { border-color: var(--verde-2); box-shadow: 0 0 0 3px rgba(27,99,73,.09); }

.blk { font-size: 1.05rem; color: var(--verde); margin: 1.6rem 0 .9rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }

/* Momentos de la clase */
.momentos { display: flex; flex-direction: column; gap: .9rem; }
.mom { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; background: #FCFDFC; }
.mom-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.mom-n { width: 24px; height: 24px; border-radius: 50%; background: var(--verde); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.mom-head small { color: var(--muted); font-size: .8rem; }
.mom-t { margin-left: auto; width: 74px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; padding: .3rem; font-size: .85rem; }
.mom textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: .6rem .75rem; outline: none; background: #fff; }
.mom textarea:focus { border-color: var(--verde-2); }

.editor-foot { padding: 1.2rem 0; }
.firmas { display: none; }

/* ── Footer y toast ─────────────────────────────────────────────── */
.foot { background: var(--verde); color: #BBD4C8; padding: 1.6rem 0; text-align: center; font-size: .84rem; }
.foot b { color: #fff; }
.foot-brand { margin-top: .5rem; font-size: .8rem; color: #9CBCAE; }
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 50px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .sheet { padding: 1.2rem; }
}
@media (max-width: 460px) {
  .grid-4 { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1; }
}

/* ── IMPRESIÓN: la planeación sale como documento formal ────────── */
@media print {
  @page { size: letter portrait; margin: 1.4cm; }
  body { background: #fff; font-size: 10.5pt; }
  .no-print, .foot, .toast { display: none !important; }
  .container { max-width: none; padding: 0; }
  .sheet { border: none; box-shadow: none; border-radius: 0; padding: 0; }
  .view { padding: 0; }
  /* Los campos se ven como texto, no como formulario */
  .fld input, .fld textarea, .mom textarea, .sh-right input, .inp-title, .mom-t {
    border: none !important; box-shadow: none !important; padding: 0 !important;
    background: transparent !important; resize: none;
  }
  .fld input, .fld textarea, .mom textarea { border-bottom: 1px solid #CFD9D4 !important; padding-bottom: 2px !important; }
  .fld > span { color: #5A6B62; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .03em; }
  .mom { background: transparent; border: 1px solid #D6E0DA; break-inside: avoid; }
  .blk { break-after: avoid; color: #124734; }
  .print-only { display: block !important; }
  .firmas { display: flex !important; justify-content: space-between; gap: 3rem; margin-top: 2.5cm; break-inside: avoid; }
  .firmas div { flex: 1; text-align: center; font-size: 9pt; color: #4A5C53; }
  .firmas span { display: block; border-top: 1px solid #1E2A24; margin-bottom: .2rem; }
  textarea { overflow: visible; height: auto !important; }
}
