/* ---------------------------------------------------------------------------
   The grant project page
   Order is Paul's: calendario, gastos, anexo. Eraman only -- Human Spaces has
   no convocatoria templates and a differently shaped Milestones.
   --------------------------------------------------------------------------- */

.gr { display: flex; flex-direction: column; gap: 10px; }

.gr-head { padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.gr-htop { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.gr-name { font-size: 19px; font-weight: 700; }
.gr-chip {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid currentColor; padding: 0 4px; color: var(--muted);
}
.gr-chip.kind { color: var(--dep-projects); }
.gr-figs > div.is-link { cursor: pointer; }
.gr-in.is-hand { background: #FFF4C2; }
.gr-hmeta {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px;
  font-size: 11.5px; color: var(--muted);
}

.gr-figs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--hairline); background: var(--card);
}
.gr-figs > div {
  padding: 9px 12px; border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 2px;
}
.gr-figs > div:last-child { border-right: 0; }
.gr-figs b {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gr-figs .g { color: var(--paul); }
/* Unattributed spend gets its own tint. It is the number a justification
   cannot afford to lose, so it is not allowed to look like the others. */
.gr-figs > div.warn { background: #FBF3F1; }
.gr-figs > div.warn b, .gr-figs > div.warn .micro { color: var(--accent-red, #9c4a3d); }

.gr-h { font-size: 14px; margin: 10px 0 2px; }
.gr-hrow { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.gr-hrow .np-create { margin-left: auto; }
.gr-leg { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 4px; }
.gr-leg i { display: inline-block; vertical-align: middle; }
.lg-span { width: 20px; height: 7px; background: #B9B2A0; }
.lg-due { width: 3px; height: 12px; background: var(--muted); }
.lg-pay { width: 7px; height: 7px; background: #8B7355; }
.lg-dia { width: 8px; height: 8px; background: var(--ink); transform: rotate(45deg); }

/* ---- cronograma, from GanttCandidate1 ----------------------------------- */
/* Measurements are the artboard's, not chosen here. */

.gr-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.gr-legend > span { display: flex; align-items: center; gap: 6px; }
.gr-sw { width: 14px; height: 14px; display: inline-block; background: var(--faint); opacity: 0.55; }
.gr-sw.att { background: transparent; opacity: 1; border: 1px dashed var(--ink); }
.gr-chip {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  border: 1px solid var(--ink); padding: 1px 5px;
}
.gr-dia { width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); }
.gr-dia.risk { background: transparent; border: 1.5px solid var(--ink); }

.gr-gantt { border: 1px solid var(--hairline); background: var(--card); }
.gr-grow { display: grid; align-items: center; }
.gr-ghead {
  background: var(--surface-2); border-bottom: 1px solid var(--hairline);
}
.gr-ghead > .gr-gm { padding: 8px 0; text-align: center; min-width: 0; white-space: nowrap; }
.gr-gblank { padding: 8px 12px; }

/* An epigrafe header: the funder's own grouping, so it gets weight. */
.gr-gep {
  background: var(--epi-bg); border-bottom: 1px solid var(--rule);
}
.gr-gep > span:first-child { padding: 8px 12px; font-weight: 700; font-size: 13px; }

.gr-gline { border-bottom: 1px solid var(--rule); min-height: 34px; }
.gr-gline:last-of-type { border-bottom: 1px solid var(--hairline); }
.gr-gname {
  padding: 6px 12px 6px 24px; font-size: 13px;
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.gr-gname > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 9px, smaller than .gr-chip: it sits inside a 13px line of text. */
.gr-tag {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  border: 1px solid var(--ink); padding: 0 4px; flex: 0 0 auto;
}

/* The three treatments. Opacity is what carries the meaning. */
.gr-gbar { height: 16px; background: var(--faint); opacity: 0.4; }
.gr-gbar.sub { opacity: 0.55; border: 1px solid var(--ink); }
.gr-gbar.att { opacity: 0.7; border: 1px dashed var(--ink); }
/* Taken from the milestone, not from committed payments: lighter, so a
   planned span never reads as money with a date on it. */
.gr-gbar.soft { opacity: 0.22; }

.gr-ghitos {
  background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  min-height: 30px;
}
.gr-ghitos > span:first-child { padding: 6px 12px; }
.gr-gdia { display: flex; justify-content: center; }

.gr-gtot { background: var(--surface-3); min-height: 30px; }
.gr-gtot > span:first-child { padding: 6px 12px; font-weight: 700; font-size: 12px; }
.gr-gtotv {
  text-align: right; padding-right: 12px; font-weight: 700; font-size: 13px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

.gr-gfoot { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.gr-gfoot > span { display: flex; align-items: center; gap: 6px; }

/* ---- the milestone list, below the cronograma -------------------------- */
/* A milestone is the parent task; under it sit plain tasks, costtasks that
   fire on a payment date and incometasks that fire on an income date. */
.gr-cal { border: 1px solid var(--hairline); background: var(--card); }
.gr-msrow {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  border-bottom: 1px solid var(--rule); cursor: pointer; align-items: center;
  min-height: 34px;
}
.gr-msrow:hover { background: var(--epi-bg); }
.gr-msrow.open { background: var(--epi-bg); }
.gr-msname { padding: 6px 12px; min-width: 0; }
.gr-msttl { font-size: 13px; font-weight: 700; }
.gr-cv {
  display: inline-block; width: 11px; color: var(--faint);
  transition: transform 0.12s;
}
.gr-msrow.open .gr-cv, .gr-aep.open .gr-cv { transform: rotate(90deg); }
.gr-msmeta, .gr-msmoney {
  font-family: var(--mono); font-size: 11px; color: var(--muted); padding-left: 11px;
}
.gr-msrow.late { border-left: 3px solid var(--office); }
.gr-msrow.late .gr-msmeta { color: var(--office); }
.gr-lbl-late {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--office);
  border: 1px solid currentColor; padding: 0 4px;
}
.gr-nohito { background: #fbf3f1; cursor: default; }
.gr-nohito .gr-msttl, .gr-nohito .gr-msmeta { color: var(--office); }

.gr-mskids { border-bottom: 1px solid var(--rule); }
.gr-trow {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  border-top: 1px solid var(--rule); align-items: center; min-height: 30px;
}
.gr-trow.done { color: var(--faint); }
.gr-trow.done .gr-ttl { text-decoration: line-through; }
.gr-tname { padding: 4px 12px 4px 26px; min-width: 0; }
.gr-tick { font-size: 11px; color: var(--faint); margin-right: 5px; }
.gr-clk { cursor: pointer; }
.gr-clk:hover { color: var(--ink); }
.gr-ttl { font-size: 12.5px; }
.gr-tmeta {
  font-family: var(--mono); font-size: 11px; color: var(--muted); padding-left: 16px;
}
/* A costtask. Same row shape as a task -- it IS one -- with the tag saying
   which kind, so the eye can skip the money when reading the work. */
.gr-payrow .gr-tname { padding-left: 42px; }
.gr-kind {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  border: 1px solid var(--rule); padding: 0 4px; margin-left: 6px;
}
.gr-subhead {
  padding: 4px 12px 4px 26px; font-size: 11px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  background: var(--surface-2); border-top: 1px solid var(--rule);
}
.gr-none { padding: 10px 12px; margin: 0; color: var(--muted); }
.gr-track { position: relative; }
.gr-bar { position: absolute; }
.gr-span { top: 10px; height: 8px; background: var(--faint); opacity: 0.55; }
.gr-span.sub { top: 11px; height: 6px; opacity: 0.4; }
.gr-due { position: absolute; top: 7px; width: 3px; height: 16px; background: var(--muted); }
.gr-pay { position: absolute; top: 11px; width: 7px; height: 7px; background: var(--faint); }
.gr-diamond {
  position: absolute; top: 6px; width: 9px; height: 9px;
  background: var(--ink); transform: rotate(45deg);
}
.gr-diamond.late { background: var(--office); }

/* ---- tables ------------------------------------------------------------ */
.gr-table { border: 1px solid var(--hairline); background: var(--card); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gr-table .r { text-align: right; }
.gr-table .g { color: var(--paul); }
.gr-table .over { color: var(--accent-red, #9c4a3d); }

.gr-erow {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 190px 150px 96px 62px 58px;
  align-items: center; gap: 6px; padding: 4px 8px;
  border-bottom: 1px solid var(--hairline); font-size: 12px;
}
.gr-erow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-ehead { background: var(--surface-2); font-size: 11px; color: var(--muted); }
.gr-erow.warn { background: #FBF3F1; }
.gr-erow.warn .micro { color: var(--accent-red, #9c4a3d); }

.gr-arow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 168px 52px 98px 100px 94px 92px 40px;
  align-items: center; gap: 5px; padding: 3px 8px;
  border-bottom: 1px solid var(--hairline); font-size: 12px;
}
.gr-arow > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-ahead { background: var(--surface-2); font-size: 11px; color: var(--muted); }
.gr-asec {
  padding: 5px 8px; font-size: 11px; color: var(--muted);
  background: var(--paper); border-bottom: 1px solid var(--hairline);
  letter-spacing: 0.03em;
}
.gr-asec.warn { color: var(--accent-red, #9c4a3d); background: #FBF3F1; }
.gr-aep { cursor: pointer; background: #FBFAF6; }
.gr-aep:hover { background: var(--surface-2); }
.gr-aep .gr-eptl { font-weight: 700; }
.gr-aep.empty .gr-eptl { font-weight: 400; color: var(--muted); }
/* A total is computed from what it covers, so it gets weight and no input.
   Three depths of grey are the tree. */
.gr-atot { background: var(--surface-2); font-weight: 700; }
.gr-atot.grand { background: #E8E3D7; font-size: 13px; }
.gr-ader { color: var(--muted); }
.gr-line { background: var(--card); }
.gr-addline { background: #FBFAF6; }

.gr-in {
  font: inherit; font-size: 11.5px; padding: 2px 5px; min-width: 0; width: 100%;
  border: 1px solid var(--hairline); background: var(--paper); color: inherit;
}
.gr-in-n, .gr-in-r { text-align: right; font-family: var(--mono); }
.gr-pill {
  font: inherit; font-size: 11px; padding: 1px 4px; width: 100%; min-width: 0;
  border: 1px solid var(--hairline); background: var(--paper); color: var(--muted);
}
.gr-mini {
  font: inherit; font-size: 11px; padding: 2px 6px; cursor: pointer;
  border: 1px solid var(--hairline); background: transparent; color: var(--muted);
}
.gr-mini:hover { color: var(--paul); border-color: var(--paul); }
.gr-mini.gr-go { color: var(--paul); border-color: var(--paul); }
.gr-mini.gr-del:hover { color: var(--accent-red, #9c4a3d); border-color: currentColor; }

.gr-bym {
  border: 1px solid var(--hairline); background: var(--card);
  padding: 8px 10px; margin-top: -1px;
}
.gr-bym > .micro { margin: 0 0 5px; color: var(--muted); }
.gr-bymrow {
  display: grid; grid-template-columns: minmax(0, 1fr) 98px 100px 94px;
  gap: 5px; padding: 2px 0; font-size: 12px;
}
.gr-bymrow.faint { color: var(--faint); }
.gr-bymrow .r { text-align: right; }
.gr-bymrow .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gr-bymrow .g { color: var(--paul); }
.gr-bymrow .over { color: var(--accent-red, #9c4a3d); }

.gr-gate {
  border: 1px solid var(--hairline); background: var(--card); padding: 12px 14px;
}
.gr-gate p { margin: 0 0 6px; }
.gr-gaterow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.gr-gaterow .gr-in { width: auto; min-width: 190px; }
.gr-gaterow .gr-in-r { min-width: 56px; }

/* ---- the expense dialog ------------------------------------------------ */
/* Not position:fixed -- the page locks its own height on `full` routes and a
   fixed overlay would escape the pane. This sits in flow at the end. */
.gr-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(20, 20, 19, 0.42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 16px; overflow-y: auto;
}
.gr { position: relative; }
.gr-dlg {
  width: 100%; max-width: 660px; background: var(--paper);
  border: 1px solid var(--line, #E4E0D6);
}
.gr-dlghead {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--hairline);
}
.gr-dlgt { font-size: 14px; font-weight: 700; }
.gr-dlgbody {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; padding: 12px 14px 6px;
}
.gr-dlgbody label { display: flex; flex-direction: column; gap: 3px; }
.gr-derived {
  font-size: 11.5px; padding: 3px 5px; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--hairline);
}
.gr-dlgpay { display: flex; align-items: center; gap: 9px; padding: 4px 14px 10px; }
.gr-sched { margin: 0 14px 10px; border: 1px solid var(--hairline); background: var(--card); }
.gr-srow {
  display: grid; grid-template-columns: 26px 128px minmax(0, 1fr) 100px 34px;
  gap: 5px; align-items: center; padding: 3px 6px;
  border-bottom: 1px solid var(--hairline); font-size: 12px;
}
.gr-srow .r { text-align: right; }
.gr-shead { background: var(--surface-2); font-size: 11px; color: var(--muted); }
.gr-sfoot { background: #F1F5F0; border-bottom: 0; }
.gr-sfoot .ok { color: var(--paul); }
.gr-sfoot .over { color: var(--accent-red, #9c4a3d); }
.gr-dlgfoot {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: var(--card); border-top: 1px solid var(--hairline);
}
.gr-dlgfoot .micro { margin-right: auto; }

@media (max-width: 1100px) {
  .gr-figs { grid-template-columns: repeat(3, 1fr); }
  .gr-msrow, .gr-trow { grid-template-columns: 200px minmax(0, 1fr); }
  .gr-arow { grid-template-columns: 40px minmax(0, 1fr) 120px 44px 88px 90px 84px 84px 34px; }
  .gr-erow { grid-template-columns: 84px minmax(0, 1fr) 150px 120px 88px 56px 54px; }
  .gr-dlgbody { grid-template-columns: 1fr; }
}

/* On a phone the expense table scrolls inside its own box instead of widening the page (Paul, 2026-11-05). */
@media (max-width: 600px) {
  .gr-table, .gr-gantt { overflow-x: auto; }
  .gr-arow { width: max-content; min-width: 100%; grid-template-columns: 40px 180px 120px 44px 88px 90px 84px 84px 34px; }
  .gr-figs { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-erow { width: max-content; min-width: 100%; grid-template-columns: 84px 160px 150px 120px 88px 56px 54px; }
}
