/* axenda.css — estilos comúns de index.php (axenda) e index_calendario.php. Todo vai baixo .axn para non chocar con css_nuevo.css */
@font-face { font-family: "AxNunito"; src: url("/js/pdf/fonts/Nunito_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AxNunito"; src: url("/js/pdf/fonts/Nunito_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "AxNunito"; src: url("/js/pdf/fonts/Nunito_800ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

.axn {
  --verde: #5E8A12; --verde-claro: #EEF4DC; --lima: #BBD425;
  --azul: #1F6F8B; --laranxa: #C25B1E; --vermello: #C62828;
  --tinta: #1F2933; --suave: #6B7280; --tenue: #9AA3AE;
  --lina: #DDE2E8; --fondo: #F5F6F2; --branco: #fff;
  --raio: 14px;
  font-family: "AxNunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--tinta); background: var(--fondo);
  font-size: 15px; line-height: 1.45;
  padding: 28px 16px 48px; margin-top: 70px;
}
.axn *, .axn *::before, .axn *::after { box-sizing: border-box; }
.axn [hidden] { display: none !important; }
.axn-wrap { max-width: 1280px; margin: 0 auto; }

/* Cabeceira */
.axn-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.axn-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--verde); margin: 0 0 4px; }
.axn h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -.01em; }
.axn-sub { color: var(--suave); margin: 8px 0 0; max-width: 60ch; }
.axn-app { display: flex; align-items: center; gap: 10px; background: var(--branco); border: 1px solid var(--lina); border-radius: 999px; padding: 8px 14px 8px 10px; font-size: 13px; color: var(--suave); text-decoration: none; }
.axn-app b { color: var(--tinta); }
.axn-app-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--verde-claro); display: grid; place-items: center; color: var(--verde); font-weight: 800; }

/* Grella principal */
.axn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 24px; align-items: start; }
@media (max-width: 980px) { .axn-grid { grid-template-columns: minmax(0, 1fr); } }

/* Tarxetas de sección */
.axn-card { background: var(--branco); border: 1px solid var(--lina); border-radius: var(--raio); padding: 20px; margin-bottom: 16px; }
.axn-card > h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.axn-num { width: 26px; height: 26px; border-radius: 8px; background: var(--verde); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.axn-card > .axn-nota { margin: 0 0 14px 36px; }
.axn-nota { color: var(--suave); font-size: 13px; }

/* Campos */
.axn-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 600px) { .axn-fields { grid-template-columns: 1fr; } }
.axn-field label, .axn-lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--suave); margin: 0 0 5px; }
.axn input[type=text], .axn input[type=number], .axn select, .axn textarea {
  width: 100%; font: inherit; color: var(--tinta); background: #fff;
  border: 1.5px solid var(--lina); border-radius: 10px; padding: 9px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.axn input:focus, .axn select:focus, .axn textarea:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(94,138,18,.15); }
.axn input::placeholder, .axn textarea::placeholder { color: #B5BCC5; }

/* Opcións en tarxetiñas (radio/checkbox) */
.axn-opts { display: grid; gap: 10px; }
.axn-opts.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.axn-opts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .axn-opts.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.axn-opt { position: relative; display: block; cursor: pointer; }
.axn-opt input { position: absolute; opacity: 0; pointer-events: none; }
.axn-opt > span { display: flex; flex-direction: column; gap: 6px; height: 100%; border: 1.5px solid var(--lina); border-radius: 12px; padding: 10px 12px; background: #fff; transition: border-color .15s, background .15s; font-size: 13.5px; }
.axn-opt > span small { color: var(--suave); font-size: 12px; }
.axn-opt:hover > span { border-color: #C4CBD3; }
.axn-opt input:checked + span { border-color: var(--verde); background: var(--verde-claro); box-shadow: inset 0 0 0 1px var(--verde); }
.axn-opt input:focus-visible + span { outline: 3px solid rgba(94,138,18,.35); outline-offset: 2px; }

/* Mini folla para "días por folla" */
.axn-mini { height: 58px; border-radius: 6px; background: #fff; border: 1px solid var(--lina); padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.axn-mini i { flex: 1; border-radius: 3px; background: repeating-linear-gradient(to bottom, transparent 0 4px, #E3E7EC 4px 5px); border: 1px solid #E3E7EC; }
.axn-opt input:checked + span .axn-mini { border-color: var(--verde); }

/* Fondos */
.axn-fondos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.axn-fondo { height: 100%; }
.axn-fondo > span { padding: 6px; gap: 5px; align-items: center; text-align: center; font-size: 11.5px; justify-content: flex-start; }
.axn-fondo .axn-nome { min-height: 2.6em; line-height: 1.3; display: flex; align-items: center; justify-content: center; }
.axn-fondo .axn-sw { width: 100%; aspect-ratio: 1; border-radius: 8px; background: #fff center / 160% repeat; border: 1px solid var(--lina); }
.axn-fondo .axn-sw.sen { background: repeating-linear-gradient(135deg, #fff 0 8px, #F2F4F6 8px 16px); }

/* Chips (meses e partes) */
.axn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.axn-chip { position: relative; cursor: pointer; }
.axn-chip input { position: absolute; opacity: 0; pointer-events: none; }
.axn-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--lina); background: #fff; font-size: 13px; font-weight: 700; color: var(--suave); transition: all .15s; user-select: none; }
.axn-chip input:checked + span { background: var(--verde); border-color: var(--verde); color: #fff; }
.axn-chip input:focus-visible + span { outline: 3px solid rgba(94,138,18,.35); outline-offset: 2px; }
.axn-chip.t1 input:checked + span { background: var(--verde); border-color: var(--verde); }
.axn-chip.t2 input:checked + span { background: var(--azul); border-color: var(--azul); }
.axn-chip.t3 input:checked + span { background: var(--laranxa); border-color: var(--laranxa); }
.axn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.axn-link { background: none; border: 0; padding: 0; color: var(--verde); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Interruptor */
.axn-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 700; }
.axn-switch input { position: absolute; opacity: 0; }
.axn-switch i { width: 40px; height: 24px; border-radius: 999px; background: #D5DAE0; position: relative; transition: background .15s; flex: none; }
.axn-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.axn-switch input:checked + i { background: var(--verde); }
.axn-switch input:checked + i::after { transform: translateX(16px); }
.axn-switch input:focus-visible + i { outline: 3px solid rgba(94,138,18,.35); outline-offset: 2px; }

/* Horario */
.axn-hscroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.axn-horario { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 5px; }
.axn-horario th { font-size: 12px; font-weight: 800; color: #fff; background: var(--verde); border-radius: 8px; padding: 6px 4px; }
.axn-horario th:first-child { background: var(--tenue); width: 92px; }
.axn-horario td { padding: 0; }
.axn-horario textarea { resize: none; height: 46px; padding: 6px 7px; font-size: 13px; line-height: 1.25; text-align: center; border-radius: 8px; }
.axn-horario td:first-child textarea { background: #F7F8FA; font-weight: 700; color: var(--suave); }

/* Follas adicionais */
.axn-extra { display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 170px) 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 600px) { .axn-extra { grid-template-columns: minmax(0, 1fr) 70px 36px; } .axn-extra select { grid-column: 1 / 3; } }
.axn-del { width: 36px; height: 38px; border: 1.5px solid var(--lina); border-radius: 10px; background: #fff; color: var(--suave); cursor: pointer; font-size: 18px; line-height: 1; }
.axn-del:hover { border-color: var(--vermello); color: var(--vermello); }
.axn-add { border: 1.5px dashed #C4CBD3; background: transparent; border-radius: 10px; padding: 9px 14px; color: var(--verde); font: inherit; font-weight: 700; cursor: pointer; }
.axn-add:hover { border-color: var(--verde); background: var(--verde-claro); }

/* Columna dereita: vista previa + botón */
.axn-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 980px) { .axn-side { position: static; } }
.axn-prev { background: var(--branco); border: 1px solid var(--lina); border-radius: var(--raio); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
@media (max-width: 980px) { .axn-prev { height: 70vh; } }
.axn-prev-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--lina); font-size: 12.5px; color: var(--suave); }
.axn-prev-head b { color: var(--tinta); font-size: 13px; }
.axn-prev iframe { flex: 1; width: 100%; border: 0; background: #E9ECEF; }
.axn-prev-msg { flex: 1; display: grid; place-items: center; color: var(--tenue); font-size: 13px; text-align: center; padding: 20px; }

.axn-go { width: 100%; border: 0; border-radius: 14px; background: var(--verde); color: #fff; font: inherit; font-size: 17px; font-weight: 800; padding: 15px 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .05s, background .15s; }
.axn-go:hover { background: #4F7610; }
.axn-go:active { transform: translateY(1px); }
.axn-go:disabled { background: #93A86E; cursor: progress; }
.axn-go svg { width: 20px; height: 20px; }
.axn-progress { height: 6px; border-radius: 999px; background: #E3E7EC; overflow: hidden; display: none; }
.axn-progress i { display: block; height: 100%; width: 0; background: var(--lima); transition: width .2s; }
.axn-status { font-size: 13px; color: var(--suave); min-height: 1.4em; text-align: center; }
.axn-status a { color: var(--verde); font-weight: 800; }
.axn-status.erro { color: var(--vermello); }

.axn-info { font-size: 12.5px; color: var(--suave); background: var(--branco); border: 1px solid var(--lina); border-radius: var(--raio); padding: 12px 14px; }
.axn-info b { color: var(--tinta); }
.axn-info a { color: var(--verde); }
.axn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Ano do curso: campo numérico + ano de fin calculado */
.axn-ano { display: flex; align-items: center; gap: 10px; }
.axn .axn-ano input { width: 120px; font-weight: 800; font-size: 17px; }
.axn-ano-fin { font-size: 17px; font-weight: 800; color: var(--suave); }
.axn input.axn-mal, .axn input.axn-mal:focus { border-color: var(--vermello); box-shadow: 0 0 0 3px rgba(198,40,40,.15); }
