:root {
  --blue: #0074c8;
  --blue-light: #36b4e5;
  --green: #3dae2b;
  --blue-dark: #003764;
  --navy: var(--blue-dark);
  --ink: #1d252c;
  --text: #1d252c;
  --muted: #5b6670;
  --slate: var(--muted);
  --line: #d8dee3;
  --white: #ffffff;
  --card: #ffffff;
  --bg: #f5f7f9;
  --danger: #b42318;
  --amber: #f2a900;
  --amber-soft: #fff8e6;
  --radius: 8px;
  --radius-card: 14px;
  --shadow: 0 2px 14px rgba(0, 55, 100, 0.06);
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --z-app: 1;
  --z-drawer: 40;
  --z-backdrop: 35;
  --z-dialog: 80;
  --z-toast: 60;
  --z-busy: 90;
  --z-login: 70;
  font-family: Montserrat, Avenir, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; min-height: 100dvh; }
html { overflow-x: clip; }
body { background: var(--bg); color: var(--text); overflow-x: clip; }
:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }
.hidden { display: none !important; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { color: var(--navy); letter-spacing: -0.025em; }
h1 { font-size: clamp(24px, 2.6vw, 34px); margin-bottom: 6px; }
h2 { font-size: 18px; margin-bottom: 8px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

button, .btn {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  font-weight: 800;
}
button:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--navy); }
button.primary:hover, .btn.primary:hover { background: var(--blue); }
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
button.secondary:hover, .btn.secondary:hover { border-color: var(--blue); color: var(--blue); }
button.danger, .btn.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f0c7c3;
}
button.danger:hover, .btn.danger:hover { background: #fff5f4; }
.btn-sm, .card-actions button { min-height: 32px; padding: 6px 10px; font-size: 12px; }

label, .field {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8e0;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 88px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 116, 200, 0.12);
}
input:disabled, select:disabled, textarea:disabled { background: #eef3f7; color: #8a94a3; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.check input { width: auto; min-height: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted, .lede { color: var(--muted); margin: 0; line-height: 1.45; }
.lede { max-width: 62ch; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 8px;
}
.error { color: var(--danger); min-height: 18px; margin: 0; font-size: 13px; font-weight: 600; }
.auth-success { color: var(--green); min-height: 18px; margin: 0; font-size: 13px; font-weight: 600; }
.empty, .empty-state { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.code { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }

.password-field { position: relative; display: block; min-width: 0; }
.password-field input { width: 100%; padding-right: 78px; }
.password-field .password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}
.password-field .password-toggle:hover { background: rgba(0, 116, 200, 0.08); text-decoration: underline; }

html[data-route="login"] #landing,
html[data-route="login"] #mine,
html[data-route="login"] .public-topbar,
html[data-route="login"] #gestor,
html[data-route="gestor"] #landing,
html[data-route="gestor"] #mine,
html[data-route="gestor"] #login,
html[data-route="gestor"] .public-topbar,
html[data-route="landing"] #login,
html[data-route="landing"] #mine,
html[data-route="landing"] #gestor,
html[data-route="mine"] #landing,
html[data-route="mine"] #login,
html[data-route="mine"] #gestor { display: none !important; }

.public-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: #fff;
  border-bottom: 3px solid var(--blue-light);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { height: 32px; width: auto; }
.brand span { font-weight: 800; line-height: 1.15; color: var(--navy); }
.corner { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.public-actions { display: flex; align-items: center; gap: 8px; }
.public-actions .request-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  text-decoration: none;
}
.public-actions .request-link:hover { background: var(--navy); }
.corner a.solid,
.corner button.solid {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  text-decoration: none;
}
.corner a.solid:hover,
.corner button.solid:hover { background: var(--blue); }
.corner a.quiet,
.corner button.quiet {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  text-decoration: none;
}
.corner a.quiet:hover,
.corner button.quiet:hover { border-color: var(--blue); color: var(--blue); }
.corner a.is-current { box-shadow: inset 0 0 0 2px var(--sky); }

#mine.app-shell { display: none; }
html[data-route="mine"] #mine.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100dvh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow: hidden;
}
.alert-list { display: grid; gap: 10px; }
.alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.alert-row.is-unread { box-shadow: inset 3px 0 0 var(--amber); }
.alert-row h2 { margin: 0; font-size: 15px; color: var(--navy); }
.alert-row p { margin: 4px 0 0; }
.alert-row time { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mine-lists-tools { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.mine-lede { max-width: 62ch; margin: 0; color: var(--muted); }
.mine-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mine-search label { flex: 1; margin: 0; }
.mine-search input { width: 100%; }
.mine-section { margin-top: 18px; }
.mine-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mine-section-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
.mine-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e7eef3;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}
.mine-section-head .secondary { margin-left: auto; }
.mine-table.mine-requests .list-head,
.mine-table.mine-requests .list-row {
  grid-template-columns: 110px minmax(0, 1.6fr) minmax(120px, 1fr) 120px 140px;
}
.mine-table.mine-projects .list-head,
.mine-table.mine-projects .list-row {
  grid-template-columns: 132px minmax(0, 1.4fr) 180px 168px;
}
.list-row.is-link { cursor: pointer; }
.list-row.is-link:hover { background: #f3f7fa; }
.list-row.is-link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.mine-title { display: grid; gap: 2px; min-width: 0; }
.mine-title strong { color: var(--navy); }
.mine-title .request-meta {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mine-quiet { color: var(--muted); font-size: 12px; font-weight: 700; }
.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f3fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}
.mine-facts { margin-top: 14px; }
.mine-history-label {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}
.mine-timeline { margin-top: 16px; }

#landing {
  padding: 20px clamp(16px, 3vw, 28px) max(24px, env(safe-area-inset-bottom));
  max-width: 1240px;
  margin: 0 auto;
}
html[data-route="landing"],
html[data-route="landing"] body {
  height: 100dvh;
  overflow: hidden;
}
html[data-route="landing"] body { display: flex; flex-direction: column; }
html[data-route="landing"] .public-topbar { position: static; flex: 0 0 auto; }
html[data-route="landing"] #landing {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 12px;
  padding-bottom: 12px;
}
html[data-route="landing"] #loadStory { margin: 8px 0; }
html[data-route="landing"] #board {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
[data-view="canvas"] .gantt,
[data-view="canvas"] .gantt-undated,
[data-view="canvas"] .cal-layout,
[data-view="canvas"] .day-agenda,
[data-view="canvas"] .list-table,
[data-view="list"] .kanban,
[data-view="list"] .card-grid,
[data-view="list"] .gantt,
[data-view="list"] .gantt-undated,
[data-view="list"] .cal-layout,
[data-view="list"] .day-agenda,
[data-view="calendar"] .kanban,
[data-view="calendar"] .card-grid,
[data-view="calendar"] .gantt,
[data-view="calendar"] .gantt-undated,
[data-view="calendar"] .list-table,
[data-view="calendar"] .horizon,
[data-view="schedule"] .kanban,
[data-view="schedule"] .card-grid,
[data-view="schedule"] .cal-layout,
[data-view="schedule"] .day-agenda,
[data-view="schedule"] .list-table,
[data-view="schedule"] .horizon,
html[data-route="landing"] #landing > .gantt,
html[data-route="landing"] #landing > .gantt-undated,
html[data-route="landing"] #landing > .cal-layout,
html[data-route="landing"] #landing > .day-agenda,
html[data-route="landing"] #publicViews .gantt,
html[data-route="landing"] #publicViews .gantt-undated,
html[data-route="landing"] #publicViews .cal-layout,
html[data-route="landing"] #publicViews .day-agenda {
  display: none !important;
}
.hero { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.hero-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hero-actions .request-link,
button.request-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  text-decoration: none;
}
.hero-actions .request-link:hover,
button.request-link:hover { background: var(--navy); }
.hero h1 { margin: 0; font-size: 26px; }

.load-story {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.meter { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #e7eef3; }
.meter span { display: block; height: 100%; min-width: 0; }
.meter .recibido { background: #9aabba; }
.meter .aceptado { background: #7eb6df; }
.meter .en_ejecucion { background: var(--blue); }
.meter .entregado { background: #8fce84; }
.meter .rechazado { background: #e3b4b0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; vertical-align: baseline; }
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.team-card, .history-item, .list-row, .kcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}
.kpi {
  padding: 2px 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-left: 1px solid var(--line);
}
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.kpi span i { width: 7px; height: 7px; border-radius: 99px; flex: 0 0 auto; }
.kpi i.recibido { background: #9aabba; }
.kpi i.aceptado { background: #7eb6df; }
.kpi i.en_ejecucion { background: var(--blue); }
.kpi i.entregado { background: #8fce84; }
.kpi i.rechazado { background: #e3b4b0; }
.badge.solicitud-abierta { background: #fff4d6; color: #6b5424; }
.badge.solicitud-aceptada { background: #e8f6e4; color: #14532d; }
.badge.solicitud-rechazada { background: #fdecec; color: var(--danger); }
.load-figures {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 12px;
  align-items: stretch;
  margin: 10px 0 12px;
}
button.kpi.kpi-requests {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  min-height: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--amber-soft);
  box-shadow: none;
  text-align: left;
}
button.kpi.kpi-requests:hover { background: #fff4d6; }
.kpi-requests small { color: var(--muted); font-size: 11px; font-weight: 700; }
.pie-chart {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.pie-chart svg { width: 180px; height: 180px; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pie-legend li { display: flex; align-items: baseline; gap: 8px; color: var(--ink); font-size: 14px; }
.pie-legend i { width: 10px; height: 10px; border-radius: 99px; flex: 0 0 auto; }
.pie-legend strong { color: var(--navy); font-size: 18px; }
.kpi strong { display: block; margin-top: 1px; font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; }
.kpi strong.hot { color: var(--blue); }
button.kpi {
  width: 100%;
  min-height: 0;
  padding: 2px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: inherit;
  cursor: pointer;
}
button.kpi:hover { background: #f3f8fc; }
button.text-link, button.team-link, button.legend-item {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
button.text-link { color: var(--navy); font-weight: 800; }
button.team-link { color: var(--muted); font-size: 13px; font-weight: 700; }
button.text-link:hover, button.team-link:hover, button.legend-item:hover { color: var(--blue); }
.kcard .text-link, .gantt-label .text-link, .list-row .text-link, .agenda-card .text-link { display: block; }
.kcard .text-link { margin: 4px 0; font-size: 15px; }
.is-clickable { cursor: pointer; }
.kcard.is-clickable:hover, .agenda-card.is-clickable:hover, .list-row.is-clickable:hover, .gantt-row.is-clickable:hover { background: #f3f8fc; }
.meter button { min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; cursor: pointer; }
.legend-item { color: var(--muted); font-size: 12px; font-weight: 700; }
.legend-item i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }
.legend-item i.recibido { background: #9aabba; }
.legend-item i.aceptado { background: #7eb6df; }
.legend-item i.en_ejecucion { background: var(--blue); }
.legend-item i.entregado { background: #8fce84; }
.legend-item i.rechazado { background: #e3b4b0; }
.info-body { display: grid; gap: 12px; margin-top: 12px; }
.info-head { display: flex; align-items: center; gap: 8px; }
.info-kicker { margin: 4px 0 0; font-size: 13px; }
.info-summary { margin: 0; line-height: 1.5; }
.info-facts { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.info-facts dt { margin: 0; color: var(--muted); font-weight: 700; }
.info-facts dd { margin: 0; }
.info-people { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sponsor-line { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.sponsor-hint { margin: -4px 0 0; font-size: 12px; }
a.mail-link { color: var(--navy); font-weight: 700; text-decoration: none; }
a.mail-link:hover { color: var(--blue); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment-list li { border-top: 1px solid var(--line); padding-top: 8px; }
.comment-list p { margin: 4px 0 0; }
.comment-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.comment-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.comment-meta strong { color: var(--navy); font-size: 13px; }
.comment-meta time { color: var(--muted); font-size: 12px; font-weight: 700; }
.dialog form.comment-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.dialog form.request-form { margin-top: 12px; }
.request-form input[readonly] { background: #f3f7fa; color: var(--ink); }
.dialog form.request-form input[type="file"] { padding: 8px; }
.request-panel { margin-top: 14px; }
.request-settings { max-width: 720px; }
.request-list { display: grid; gap: 10px; }
.request-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.request-card h2 { margin: 0; font-size: 16px; }
.request-card time { color: var(--muted); font-size: 12px; font-weight: 800; }
.request-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.request-card p { margin: 6px 0 0; }
.request-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  justify-content: space-between;
  margin-top: 10px;
}
.request-team { max-width: 280px; margin-top: 10px; }
.request-foot .request-team { margin-top: 0; flex: 1 1 220px; }
.request-foot .request-meta { margin: 0; flex: 1 1 240px; }
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.public-requests { margin: 4px 0 18px; }
.public-requests > h2 { margin: 0; font-size: 16px; }
.public-requests > .muted { margin: 4px 0 10px; }
.request-team select { width: 100%; min-height: 34px; }
.wizard-steps {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.wizard-steps li {
  flex: 1;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.wizard-steps li[aria-current="step"] { color: var(--navy); border-bottom-color: var(--navy); }
.wizard-body { margin-top: 14px; }
.choice-list, .choice-block, .choice-extra { display: grid; gap: 8px; }
button.choice {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}
button.choice strong { color: var(--navy); font-size: 14px; }
button.choice span { color: var(--muted); font-size: 13px; font-weight: 600; }
button.choice:hover { border-color: var(--blue); }
button.choice[aria-pressed="true"] {
  border-color: var(--navy);
  background: #f4f8fb;
  box-shadow: inset 0 0 0 1px var(--navy);
}
.choice-extra { padding-left: 14px; }
.review-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 14px;
}
.review-grid dt { margin: 0; color: var(--muted); font-weight: 700; }
.review-grid dd { margin: 0; }
.dialog-actions .wizard-back { margin-right: auto; }
.dialog-backdrop[data-wizard-pop] { z-index: calc(var(--z-dialog) + 5); }
.request-panel button.secondary[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.comment-form textarea { min-height: 72px; }
.comment-form .primary { justify-self: end; }
.info-list { display: grid; gap: 8px; }
button.info-row {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
button.info-row strong { color: var(--navy); }
button.info-row:hover { border-color: var(--blue); background: #f3f8fc; }
button.gantt-bar { min-height: 0; padding: 0; border: 0; cursor: pointer; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-areas: "search views" "filters filters";
  align-items: end;
  gap: 14px 16px;
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.search-cluster { grid-area: search; display: flex; align-items: center; gap: 10px; min-width: 0; }
.search-box { width: 100%; max-width: none; flex: 1 1 auto; }
.search-count { font-size: 12px; font-weight: 700; white-space: nowrap; }
.filter-chips { grid-area: filters; }
.view-bar {
  grid-area: views;
  justify-self: end;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.view-bar button.secondary {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  padding: 6px 12px;
}
.view-bar button.secondary:last-child { border-right: 0; }
.view-bar button.secondary:hover { background: #f3f8fc; color: var(--navy); }
.view-bar button.secondary[aria-pressed="true"],
.view-bar button.secondary[aria-pressed="true"]:hover { background: var(--navy); color: #fff; }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban[data-cols="1"] { grid-template-columns: minmax(0, 480px); }
.kanban[data-cols="2"] { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.kanban[data-cols="3"] { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
.horizon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 12px; }
.horizon-note { margin: 0; flex: 1 1 260px; font-size: 13px; }
.history-lanes { display: grid; gap: 10px; margin-top: 16px; }
.history-lanes p { margin: 0; }
.history-lane-row { display: grid; gap: 10px; }
.history-lane { min-width: 132px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; }
.history-lane.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.history-lane strong { display: block; color: var(--navy); font-size: 13px; }
.kanban-col { background: #f7fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 120px; }
.kanban-col header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0 2px; font-weight: 800; color: var(--navy); }
.kanban-col header em { font-style: normal; background: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.kcard { padding: 12px; margin-bottom: 8px; }
.kcard h3 { margin: 4px 0; font-size: 15px; color: var(--navy); }
.kcard p { margin: 0; color: var(--muted); font-size: 13px; }
.kcard.dragging { opacity: 0.45; }
.team-name { color: var(--muted); font-size: 13px; font-weight: 700; }
.team-detail { margin: 2px 0 0; }
.team-detail summary { cursor: pointer; list-style: none; width: fit-content; }
.team-detail summary::-webkit-details-marker { display: none; }
.team-detail summary::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: #8aa0b4;
  transform: translateY(1px);
}
.team-detail[open] summary::after { border-top-color: transparent; border-bottom-color: var(--blue); transform: translateY(-2px); }
.team-people { margin: 6px 0 0; padding: 0 0 0 2px; list-style: none; }
.team-people li { color: var(--ink); font-size: 12px; line-height: 1.45; }
.gantt { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 100%; }
.gantt-scroll { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.gantt-scale, .gantt-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); width: max-content; min-width: 100%; }
.gantt-label, .gantt-scale-pad { position: sticky; left: 0; z-index: 2; background: #fff; }
.gantt-scale-pad { background: #f7fafc; z-index: 3; }
.gantt-scale { background: #f7fafc; border-bottom: 1px solid var(--line); }
.gantt-months { position: relative; min-height: 34px; }
.gantt-months span {
  position: absolute;
  top: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.gantt-row { min-height: 48px; border-top: 1px solid var(--line); }
.gantt-row:first-of-type { border-top: 0; }
.gantt-label { padding: 6px 12px; min-width: 0; }
.gantt-label strong { display: block; color: var(--navy); font-size: 13px; }
.gantt-track { position: relative; min-height: 48px; }
.gantt-tick, .gantt-today { position: absolute; top: 0; bottom: 0; width: 1px; pointer-events: none; }
.gantt-tick { background: #e7eef3; }
.gantt-today { width: 2px; background: var(--navy); z-index: 1; }
.gantt-bar { position: absolute; top: 50%; height: 10px; margin-top: -5px; border-radius: 99px; min-width: 6px; }
.gantt-bar.recibido { background: #9aabba; }
.gantt-bar.aceptado { background: #7eb6df; }
.gantt-bar.en_ejecucion { background: var(--blue); }
.gantt-bar.entregado { background: #8fce84; }
.gantt-bar.rechazado { background: #e3b4b0; }
.gantt-undated { margin-top: 14px; }
.gantt-undated h2 { font-size: 15px; }
.scope-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.scope-switch button.secondary {
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  min-height: 32px;
  padding: 6px 12px;
}
.scope-switch button.secondary:last-child { border-right: 0; }
.scope-switch button.secondary:hover { background: #f3f8fc; color: var(--navy); border-right-color: var(--line); }
.scope-switch button.secondary[aria-pressed="true"],
.scope-switch button.secondary[aria-pressed="true"]:hover {
  background: var(--navy);
  color: #fff;
  border-right-color: var(--navy);
}
.scope-switch button.secondary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--blue-light); z-index: 1; }
.time-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; margin: 16px 0 8px; }
.cal-layout .time-tools { margin-top: 0; }
.time-cluster { display: inline-flex; align-items: center; gap: 8px; }
.time-cluster + .time-cluster { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.time-move {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.time-move button.secondary {
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--navy);
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 16px;
  line-height: 1;
}
.time-move button.secondary:hover { background: #f3f8fc; color: var(--navy); }
.time-move button.secondary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--blue-light); }
.time-zoom button.zoom-label {
  min-width: 58px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}
.time-zoom button.secondary:disabled:hover { background: #fff; color: var(--navy); }
.time-move strong {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.time-jump { display: inline-flex; align-items: center; gap: 8px; }
.time-jump select { min-height: 32px; width: auto; padding-right: 28px; }
button.undated-ref {
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}
button.undated-ref:hover { background: #f3f8fc; color: var(--navy); border-color: var(--line); }
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.gantt-window { color: var(--navy); font-size: 14px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-col { min-height: 160px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.week-col.is-today { box-shadow: inset 0 0 0 2px var(--navy); }
.week-col.is-selected { background: #f3f8fc; }
.week-col header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
button.week-chip, button.week-more, button.year-month {
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: #f7fafc;
  color: var(--navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
button.week-chip, button.week-more { display: block; width: 100%; padding: 3px 6px; font-size: 11px; font-weight: 800; }
button.week-chip { border-left: 3px solid var(--blue); }
button.week-chip.recibido { border-left-color: #9aabba; }
button.week-chip.aceptado { border-left-color: #7eb6df; }
button.week-chip.en_ejecucion { border-left-color: var(--blue); }
button.week-chip.entregado { border-left-color: #8fce84; }
button.week-chip.rechazado { border-left-color: #e3b4b0; }
button.week-more { background: transparent; color: var(--muted); padding: 0; }
.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
button.year-month { display: grid; gap: 8px; width: 100%; padding: 10px; border: 1px solid var(--line); background: #fff; }
button.year-month:hover { border-color: var(--blue); }
.year-month header { display: flex; justify-content: space-between; font-weight: 800; color: var(--navy); }
.year-month header em { font-style: normal; color: var(--muted); font-size: 12px; }
.year-heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.year-heat i { display: block; height: 8px; border-radius: 2px; background: #e7eef3; }
.year-heat i.is-pad { background: transparent; }
.year-heat i.on { background: #9ec9e8; }
.year-heat i.hot { background: var(--blue); }
.gantt-bar.is-clip-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.gantt-bar.is-clip-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.column-more { width: 100%; margin-top: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; align-content: start; }
.table-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; }
.table-pager-meta { margin: 0; color: var(--muted); font-size: 13px; }
.table-pager-controls { display: flex; align-items: center; gap: 8px; }
.table-pager select { width: auto; min-height: 34px; }
.table-page-indicator { color: var(--navy); font-size: 13px; font-weight: 800; min-width: 3.2em; text-align: center; }
.column-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.column-pager .muted { font-size: 12px; }
.team-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.team-directory-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f7fafc; }
.team-directory-card .text-link { font-size: 16px; }
.kanban-col.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; }
button.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  line-height: 0;
}
button.row-action:hover { border-color: var(--blue); color: var(--blue); background: #fff; }
button.row-action.danger { color: var(--danger); background: #fff; }
button.row-action.danger:hover { border-color: var(--danger); background: #fff5f5; color: var(--danger); }
button.row-action svg { width: 14px; height: 14px; display: block; pointer-events: none; }
.kcard .section-head { align-items: center; }
.kcard .section-head .publication-check { margin-right: auto; }
.kcard .section-head .row-actions { margin-left: auto; }
.publication-check { margin: 0; cursor: pointer; }
.list-col-when { justify-self: start; white-space: nowrap; }
.list-col-public { justify-self: center; text-align: center; }
.list-row .publication-check { justify-self: center; }
.list-col-actions, .list-row .row-actions { justify-self: end; }
.request-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.request-title h2 { margin: 0; }

.list-table {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.list-head, .list-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 196px;
  column-gap: 16px;
  align-items: center;
  padding-right: 16px;
  padding-left: 16px;
  border: 0;
}
.list-head.has-public, .list-row.has-public {
  grid-template-columns: 132px minmax(0, 1fr) 196px 120px 132px;
}
.list-head {
  padding-top: 8px;
  padding-bottom: 8px;
  background: #f3f7fa;
  border-bottom: 2px solid var(--line);
  color: var(--slate);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.list-head .is-sorted { color: var(--blue); }
.list-row { padding-top: 12px; padding-bottom: 12px; margin: 0; background: #fff; border-bottom: 1px solid var(--line); }
.list-table .list-row:last-child { border-bottom: 0; }
button.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
}
button.th-sort-btn:hover,
button.th-sort-btn.is-active { background: transparent; color: var(--blue); }
.th-sort-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.th-sort-icons {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 2px;
}
.th-sort-chevron { display: block; width: 12px; height: 8px; color: #9aa8b8; opacity: 0.55; }
button.th-sort-btn:hover .th-sort-chevron { opacity: 0.85; color: var(--slate); }
.th-sort-chevron.is-on { color: var(--blue); opacity: 1; }
.th-sort-icons.is-sorted .th-sort-chevron:not(.is-on) { opacity: 0.22; }
button.th-sort-btn.is-active .th-sort-chevron.is-on { filter: drop-shadow(0 0 0.5px var(--blue)); }
.list-col-public button.th-sort-btn { justify-content: center; }
.request-table .list-head,
.request-table .list-row {
  grid-template-columns: 110px minmax(180px, 1.6fr) minmax(150px, 1fr) 120px 168px 112px;
}
.request-table select { width: 100%; min-height: 32px; }
.request-row .request-title { display: grid; gap: 2px; min-width: 0; }
.request-row .request-title strong { color: var(--navy); }
.request-row .request-meta {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.request-table time { color: var(--muted); font-size: 12px; font-weight: 700; }
.list-row strong { color: var(--navy); }
.badge {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #eef1f4;
  color: #44515e;
}
.badge.aceptado { background: #e8f3fb; color: var(--navy); }
.badge.en_ejecucion { background: #e7f4fb; color: #075a86; }
.badge.entregado { background: #e8f6e4; color: #14532d; }
.badge.rechazado { background: #fdecec; color: var(--danger); }
.badge.cancelado { background: #f8f1e3; color: #6b5424; }
.meter .cancelado, .kpi i.cancelado, .legend-item i.cancelado, .gantt-bar.cancelado, .month-dots .cancelado { background: #c4b48a; }
button.week-chip.cancelado { border-left-color: #c4b48a; }

.filter-shell { display: grid; gap: 12px; }
.workspace > .filter-shell { margin-bottom: 12px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; flex: 1 1 auto; min-width: 0; }
label.filter-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  padding: 4px 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  min-width: 132px;
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--navy);
}
label.filter-chip.is-active {
  border-color: rgba(0, 116, 200, 0.45);
  background: #f3f9fd;
  box-shadow: 0 0 0 3px rgba(0, 116, 200, 0.08);
}
.filter-chip-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}
select.filter-chip-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; flex: 1 1 auto; }
.filter-bar label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-bar select { min-height: 34px; width: auto; min-width: 0; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; margin-top: 16px; }
.cal-board { min-width: 0; }
.cal-summary { margin: 0 0 10px; font-size: 13px; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: #e3ebf1;
  border: 1px solid #e3ebf1;
  border-radius: 12px;
  overflow: hidden;
}
.month-dow {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f7fafc;
  padding: 8px;
}
.month-day {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.month-day.is-pad { background: #f7fafc; min-height: 52px; pointer-events: none; }
.month-day.is-weekend { background: #fbfcfd; }
.month-day.is-today .month-num { background: var(--navy); color: #fff; }
.month-day.is-selected { background: #f3f8fc; }
.month-day-head { display: flex; align-items: center; gap: 6px; }
.month-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.month-load { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.month-dots { display: flex; gap: 4px; min-height: 8px; }
.month-dots i { width: 8px; height: 8px; border-radius: 99px; display: block; }
.month-dots .recibido { background: #9aabba; }
.month-dots .aceptado { background: #7eb6df; }
.month-dots .en_ejecucion { background: var(--blue); }
.month-dots .entregado { background: var(--green); }
.month-dots .rechazado { background: #e3b4b0; }
.day-agenda {
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: 0;
  padding-top: 58px;
}
.day-agenda h2 { margin: 0; font-size: 15px; }
.agenda-card {
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: none;
}
.agenda-card strong { color: var(--navy); font-size: 13px; }
.agenda-card p { margin: 0; }

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: none;
  grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
  background: #fff;
}
html[data-route="login"] .login-shell { display: grid; }
.login-brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  background: linear-gradient(145deg, #003764 5%, #07548c 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.login-brand-mark {
  width: min(240px, 78%);
  height: auto;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
}
.login-brand-copy { max-width: 16ch; }
.login-brand-panel p {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
  color: #9eddf3;
}
.login-brand-panel strong {
  display: block;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #fff;
}
.login-form-pane {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  overflow: auto;
}
.login-card {
  width: min(460px, 100%);
  margin: auto;
  padding: clamp(8px, 2vw, 12px);
  background: transparent;
  border: 0;
  box-shadow: none;
}
.brand-logo { display: block; width: min(190px, 70%); height: auto; margin-bottom: 28px; }
.login-card h1 { font-size: clamp(24px, 4vw, 28px); }
.login-card .muted { margin: 8px 0 0; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.login-card label { margin: 0; }
.login-card button[type="submit"] { width: 100%; }
.login-card button.secondary { width: 100%; background: #fff; }
.auth-link {
  margin-top: 8px;
  padding: 0;
  min-height: auto;
  background: none;
  color: var(--blue);
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#gestor.app-shell { display: none; }
html[data-route="gestor"] #gestor.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}
.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  z-index: var(--z-drawer);
}
.sidebar-brand {
  display: block;
  padding: 10px 6px 16px;
  color: #fff;
  text-decoration: none;
}
.sidebar-brand img {
  display: block;
  width: 160px;
  max-width: 100%;
  height: auto;
  background: transparent;
  padding: 0;
}
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-weight: 700;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item.is-active { background: var(--blue); box-shadow: inset 4px 0 0 var(--green); color: #fff; }
.nav .nav-count {
  font-size: 11px;
  font-weight: 800;
  min-width: 1.5rem;
  text-align: center;
  background: var(--amber);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--navy);
  flex-shrink: 0;
}
.nav-item.is-active .nav-count { background: #fff4cc; color: var(--navy); }
.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.who-name { margin: 0; font-weight: 800; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-email { margin: 0; font-size: 11px; color: rgba(255, 255, 255, 0.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot button.secondary { width: 100%; background: #fff; }
.board-link { color: #fff; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.main-pane { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: #fff;
  border-bottom: 3px solid var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-weight: 800; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(280px, 36vw); }
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 9px;
  flex-direction: column;
  justify-content: space-between;
}
.menu-toggle span { display: block; height: 2px; width: 100%; background: var(--navy); border-radius: 2px; }
.sidebar-backdrop { display: none; }
.workspace {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: clamp(14px, 2.5vw, 28px);
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.team-card { padding: 16px; }
.team-card h2 { margin: 0; font-size: 18px; }
.person { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sponsor-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.sponsor-grid .section-head { margin-bottom: 4px; align-items: center; }
.sponsor-empty { margin: 8px 0 0; }
.person-id { display: grid; min-width: 0; }
.person-id strong { font-weight: 700; }
.person-id span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-add { margin-top: 10px; }
.history-screen { display: grid; gap: 12px; }
.history-facets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
button.history-facet {
  min-height: 0;
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 700;
}
button.history-facet strong { font-size: 22px; color: var(--navy); letter-spacing: -0.03em; }
button.history-facet span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
button.history-facet:hover { border-color: #9dbce0; background: #fff; color: var(--ink); }
button.history-facet[aria-pressed="true"] {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
  background: #fff;
  color: var(--ink);
}
.history-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-shell > .history-tools {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  grid-template-areas: "search filters";
  gap: 14px 16px;
  align-items: end;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.filter-shell > .history-tools > .search-cluster { max-width: 100%; overflow: hidden; }
.history-tools input[type="search"] { width: 220px; min-height: 34px; flex: 0 1 220px; }
.filter-shell > .history-tools input[type="search"] { width: auto; min-width: 0; max-width: 100%; flex: 1 1 140px; }
.history-tools select { width: auto; min-width: 150px; min-height: 34px; }
.history-tools select.filter-chip-select { width: 100%; max-width: 100%; min-width: 0; min-height: 28px; }
.history-dates { display: flex; flex-wrap: wrap; gap: 8px; }
.history-date {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.history-date input { width: auto; min-height: 34px; }
.history-summary-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.history-summary-row strong { color: var(--navy); font-size: 14px; }
.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
button.history-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #e8f3fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}
button.history-chip:hover { background: #d7ebf8; color: var(--navy); }
.history-chip-x { font-size: 14px; line-height: 1; }
.timeline { display: grid; gap: 0; max-width: 920px; }
.history-day {
  margin: 14px 0 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  padding-bottom: 14px;
}
.timeline-day .timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline-marker {
  width: 14px;
  height: 14px;
  margin-top: 16px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  z-index: 1;
}
.timeline-marker.is-new { background: var(--green); }
.timeline-marker.is-danger { background: var(--danger); }
.timeline-marker.is-note { background: var(--blue-light); }
.timeline-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.timeline-card.is-new { border-color: #b7e0c4; background: linear-gradient(180deg, #f7fff5 0%, #fff 52%); }
.timeline-card.is-danger { border-color: #f0c8c4; background: linear-gradient(180deg, #fff8f7 0%, #fff 52%); }
.timeline-card.is-note { border-color: #b9e3f2; background: linear-gradient(180deg, #f5fbff 0%, #fff 52%); }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timeline-meta time { color: var(--muted); font-size: 12px; font-weight: 800; }
.timeline-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f1f8;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}
.timeline-pill.is-new { background: #e8f6e4; color: #14532d; }
.timeline-pill.is-danger { background: #fdecec; color: var(--danger); }
.timeline-pill.is-note { background: #e7f6fb; color: #075a86; }
.timeline-domain {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.timeline-title { margin: 8px 0 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.timeline-actor { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }
@media (max-width: 900px) {
  .history-facets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .history-facets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-tools input[type="search"], .history-tools select { width: 100%; flex-basis: 100%; }
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-dialog);
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(3, 22, 40, 0.45);
  overflow: auto;
}
.dialog {
  width: min(440px, 100%);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 55, 100, 0.22);
}
.dialog.dialog-wide { width: min(720px, 100%); }
.dialog h2 { margin: 0 0 4px; font-size: clamp(18px, 4vw, 22px); }
.dialog-message { margin: 8px 0 0; color: #3a4557; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialog-actions a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  font-weight: 800;
  text-decoration: none;
}
.dialog-actions a.primary:hover { background: var(--blue); }
.dialog form, .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-top: 12px; }
.form-grid .wide, .dialog form .wide { grid-column: 1 / -1; }

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-busy);
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 22, 40, 0.55);
}
body.busy-locked { overflow: hidden; }
.busy-card {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 55, 100, 0.28);
}
.busy-title { margin: 14px 0 6px; color: var(--navy); font-size: 18px; }
.busy-message { margin: 0; color: #475569; font-size: 14px; line-height: 1.45; }
.busy-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid #e2e8f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: gestor-busy-spin 0.75s linear infinite;
}
.busy-check {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e8f6e6;
  color: #14532d;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
}
.busy-check::before { content: "✓"; }
.busy-card-success .busy-title { color: #14532d; }
@keyframes gestor-busy-spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  max-width: min(360px, calc(100vw - 40px));
  background: #1f2937;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .day-agenda { position: static; padding-top: 4px; }
  .toolbar, .filter-shell > .history-tools { grid-template-columns: 1fr; grid-template-areas: "search" "views" "filters"; }
  .view-bar { justify-self: start; }
  .list-head, .list-row,
  .list-head.has-public, .list-row.has-public { grid-template-columns: 110px minmax(0, 1fr) auto; }
  .list-col-when, .list-col-public { display: none; }
  .request-table .list-head,
  .request-table .list-row { grid-template-columns: 100px minmax(0, 1.4fr) minmax(140px, 1fr) auto; }
  .request-table .list-col-country,
  .request-table .list-col-when { display: none; }
  .mine-table.mine-requests .list-head,
  .mine-table.mine-requests .list-row { grid-template-columns: 110px minmax(0, 1.4fr) minmax(120px, 1fr); }
  .mine-table.mine-requests .list-col-country,
  .mine-table.mine-requests .list-col-when { display: none; }
  .mine-table.mine-projects .list-head,
  .mine-table.mine-projects .list-row { grid-template-columns: 120px minmax(0, 1.4fr) minmax(140px, 1fr); }
  .mine-table.mine-projects .list-col-when { display: none; }
  .alert-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  html[data-route="landing"],
  html[data-route="landing"] body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  html[data-route="landing"] body { display: block; }
  html[data-route="landing"] #landing,
  html[data-route="landing"] #board { display: block; height: auto; overflow: visible; }
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-brand-panel { display: none; }
  .login-form-pane { background: linear-gradient(160deg, #003764 0%, #07548c 42%, #f5f7f9 42%); }
  html[data-route="gestor"] #gestor.app-shell,
  html[data-route="mine"] #mine.app-shell { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  aside.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 88vw);
    height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.25);
    z-index: calc(var(--z-backdrop) + 5);
  }
  aside.sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: var(--z-backdrop);
  }
  .form-grid, .dialog form { grid-template-columns: minmax(0, 1fr); }
  .form-grid .wide, .dialog form .wide { grid-column: auto; }
  .month-day, .month-day.is-pad { min-height: 48px; padding: 4px; }
  .month-num { width: 20px; height: 20px; font-size: 11px; }
  .month-dots { flex-wrap: wrap; gap: 3px; }
  .month-dots i { width: 6px; height: 6px; }
}

@media (max-width: 640px) {
  .login-form-pane { background: #f5f7f9; }
  .list-head, .list-row,
  .list-head.has-public, .list-row.has-public { grid-template-columns: minmax(0, 1fr); }
  .list-head { display: none; }
  .request-table { overflow-x: auto; }
  .request-table .list-head { display: grid; }
  .request-table .list-head,
  .request-table .list-row {
    grid-template-columns: 110px minmax(180px, 1.6fr) minmax(150px, 1fr) 120px 168px 112px;
    min-width: 860px;
  }
  .request-table .list-col-country,
  .request-table .list-col-when { display: block; }
  .mine-table { overflow-x: auto; }
  .mine-table .list-head { display: grid; }
  .mine-table.mine-requests .list-head,
  .mine-table.mine-requests .list-row {
    grid-template-columns: 110px minmax(180px, 1.6fr) minmax(140px, 1fr) 120px 140px;
    min-width: 760px;
  }
  .mine-table.mine-requests .list-col-country,
  .mine-table.mine-requests .list-col-when { display: block; }
  .mine-table.mine-projects .list-head,
  .mine-table.mine-projects .list-row {
    grid-template-columns: 132px minmax(180px, 1.4fr) 160px 160px;
    min-width: 700px;
  }
  .mine-table.mine-projects .list-col-when { display: block; }
  .public-topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .brand span { font-size: 14px; }
  .topbar-user { display: none; }
  .toast { left: 16px; right: 16px; max-width: none; }
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .load-figures, .pie-chart { grid-template-columns: minmax(0, 1fr); }
  .pie-chart svg { width: 160px; height: 160px; }
  .kpi { border-left: 0; padding: 6px 8px 0; }
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gantt-scale, .gantt-row { grid-template-columns: 168px minmax(0, 1fr); }
  .gantt-track { min-height: 36px; }
  .search-cluster { flex: 1 1 100%; width: 100%; }
  .search-box { max-width: none; width: 100%; }
  .time-cluster + .time-cluster { margin-left: 0; padding-left: 0; border-left: 0; }
  .time-tools { gap: 8px; }
  .time-move strong { white-space: normal; text-align: center; }
}
