/* =========================================================
   18. P11 · Cronograma (fases × semanas, primera columna fija, scroll horizontal) · Kanban (4 columnas, arrastre) · diálogos del proyecto
   ========================================================= */
.sched-toolbar, .kb-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0 2px; }
.sched-wrap { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); overflow: hidden; }
.sched { overflow-x: auto; overflow-y: hidden; position: relative; --colw: 104px; --left: 190px; }
.sched-head, .sched-row, .sched-foot { display: flex; align-items: stretch; min-width: max-content; }
.sched-head { border-bottom: 1px solid var(--border); }
.sched-row { border-bottom: 1px solid var(--border); position: relative; }
.sched-row:last-of-type { border-bottom: 0; }
.sched-corner, .sched-phase { position: sticky; left: 0; z-index: 3; width: var(--left); flex: none; background: var(--panel); border-right: 1px solid transparent; }
.sched-corner { height: 46px; }
.sched-weeks { position: relative; display: flex; height: 46px; }
.sched-week { width: var(--colw); flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.sched-week b { font-size: 12.5px; font-weight: 600; }
.sched-week span { font-size: 11px; color: var(--fg-3); }
.sched-phase { padding: 22px 14px 14px 22px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.sched-num { font-family: var(--pj-mono); font-size: 10.5px; color: var(--pj-muted); letter-spacing: .12em; }
.sched-phase h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.sched-phase-tools { display: flex; gap: 2px; margin-top: 8px; opacity: 0; transition: opacity .12s; }
.sched-row:hover .sched-phase-tools, .sched-phase-tools:focus-within { opacity: 1; }
.sched-phase-tools .btn { padding: 2px 8px; font-size: 12px; }
.sched-track { position: relative; flex: none; }
.sched-col { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--border-strong); opacity: .55; pointer-events: none; }
.sched-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #7c6cf2; opacity: .9; pointer-events: none; z-index: 1; }
.sched-today-cap { position: absolute; bottom: -1px; margin-left: -6px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid #7c6cf2; pointer-events: none; }
.sched-today-cap.bottom { bottom: auto; top: 0; border-bottom: 0; border-top: 9px solid #7c6cf2; }
.sched-foot { height: 14px; }
.sched-empty { padding: 36px 24px; color: var(--fg-3); font-size: 13.5px; text-align: center; }
/* Actividad: círculo con siglas (color de la fase), título, línea hasta el fin, descripción */
.act { position: absolute; display: flex; align-items: flex-start; gap: 6px; z-index: 2; cursor: pointer; max-width: 360px; }
.act-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; margin-top: 10px; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.act-body { position: relative; padding-right: 6px; }
.act-title { display: block; font-size: 13.5px; font-weight: 600; line-height: 20px; white-space: nowrap; background: linear-gradient(90deg, var(--panel) 0, var(--panel) 92%, transparent); padding-right: 8px; border-radius: 4px; }
.act-line { position: absolute; left: 0; top: 23px; height: 2px; border-radius: 1px; pointer-events: none; }
.act-line i { position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; }
.act-desc { margin: 9px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--pj-muted); max-width: 240px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act:hover .act-title { text-decoration: underline; }
/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; align-items: start; background: var(--ctr-root-bg); border-radius: 18px; padding: 14px; }
.kb-col { background: var(--panel); border-radius: 14px; padding: 14px 12px; min-height: 420px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .12s; }
.kb-col.over { box-shadow: 0 0 0 2px var(--accent-soft) inset; }
.kb-col header h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.kb-col header p { margin: 2px 0 0; font-size: 11px; line-height: 1.3; }
.kb-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; flex: 1; }
.kb-card { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; cursor: grab; outline: none; transition: transform .1s, box-shadow .12s; }
.kb-card:hover, .kb-card:focus-visible { box-shadow: var(--shadow-md); }
.kb-card.dragging { opacity: .45; cursor: grabbing; }
.kb-title { display: flex; align-items: flex-start; gap: 7px; font-size: 13.5px; line-height: 1.3; }
.kb-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--pj-muted); flex: none; margin-top: 4px; }
.kb-card p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--fg-2); padding-left: 17px; }
.kb-who { font-size: 12px; font-weight: 500; padding-left: 17px; }
.kb-todo header, .kb-todo .kb-who { color: #c2652b; } .kb-todo .kb-card { background: #fff4de; }
.kb-doing header, .kb-doing .kb-who { color: #1d6fc0; } .kb-doing .kb-card { background: #d8ecfb; }
.kb-done header, .kb-done .kb-who { color: #2e8b57; } .kb-done .kb-card { background: #e4f6e8; }
.kb-cancelled header, .kb-cancelled .kb-who { color: #d64545; } .kb-cancelled .kb-card { background: #fde3e3; }
:root[data-theme="dark"] .kb-todo .kb-card { background: #4a3a1f; } :root[data-theme="dark"] .kb-doing .kb-card { background: #1f3a55; }
:root[data-theme="dark"] .kb-done .kb-card { background: #1f4a2e; } :root[data-theme="dark"] .kb-cancelled .kb-card { background: #532626; }
:root[data-theme="dark"] .kb-card p { color: var(--fg); opacity: .8; } :root[data-theme="dark"] .kb-card b { color: #fff; }
/* Diálogos (secciones, actividad, fase, sprints) */
#projectDialog { width: min(640px, calc(100vw - 32px)); }
#projectDialog .field > label .hint { font-weight: 400; color: var(--fg-3); }
#projectDialog .dialog-body > .hint, #projectDialog .dialog-body .field > .hint { font-size: 12px; color: var(--fg-3); line-height: 1.4; }
.pj-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.pj-row { display: flex; gap: 6px; align-items: center; }
.pj-row .pj-cell { flex: 1 1 100px; min-width: 0; }
.pj-row .pj-cell.wide { flex: 2 1 160px; }
.pj-row .pj-cell.narrow { flex: 0 0 64px; }
.pj-row label.pj-cell.narrow { display: grid; place-items: center; flex-basis: 34px; }
.pj-colors { padding: 4px 0; grid-template-columns: repeat(8, 26px); }
.pj-colors button { width: 26px; height: 26px; }
@media (max-width: 960px) { .kanban { grid-template-columns: repeat(2, minmax(200px, 1fr)); } }
@media (max-width: 720px) {
  .kanban { grid-template-columns: 1fr; padding: 10px; } .kb-col { min-height: 160px; }
  .sched { --left: 132px; } .sched-phase { padding: 16px 10px 12px 14px; } .sched-phase h3 { font-size: 14px; } .sched-phase-tools { opacity: 1; flex-wrap: wrap; }
  .pj-row { flex-wrap: wrap; } .pj-row .pj-cell { flex-basis: calc(50% - 6px); } .pj-row .pj-cell.wide { flex-basis: 100%; }
}
