/* Bitácora · Endurance & Co. Palette and type of the "Firma" direction: midnight, navy cards, cyan pulse; Geist + Geist Mono.
   Dense on purpose (it is a working tool); every text ≥ 12 px; colours checked for WCAG AA on their backgrounds. */
@font-face { font-family: "Geist"; src: url("/assets/geist.a369fcf5.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/geist-mono.fba8f577.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0B1220; --card: #111B2E; --card2: #16233B; --line: #24344F; --line2: #2B3D5C;
  --text: #E8EEF6; --muted: #9AA8BC; --accent: #3FD0FF; --accent-ink: #04202B;
  --ok: #4ADE9B; --warn: #F5C46B; --danger: #FF8A8A;
  --r: 12px; --r-sm: 8px;
  --side: 232px;
  --font: "Geist", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ico { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------------ shell */
.wrap { padding: calc(64px + var(--safe-t)) 14px calc(86px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }
.side { display: none; }
.top { position: fixed; inset: 0 0 auto 0; z-index: 20; background: rgba(11, 18, 32, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: var(--safe-t); }
.topbar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; }
.topbar__mark { display: flex; }
.topbar__t { font-weight: 600; font-size: 16px; flex: 1; }
.topbar__me { color: var(--muted); padding: 8px; border-radius: 50%; display: flex; }
.topbar__me[aria-current=page] { color: var(--accent); }
.tabs { position: fixed; inset: auto 0 0 0; z-index: 20; background: rgba(11, 18, 32, .97); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs__row { display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--muted); font-size: 12px; min-height: 56px; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab[aria-current=page] { color: var(--accent); }
.tab__l { white-space: nowrap; }
@media (max-width: 360px) { .tab__l { font-size: 12px; letter-spacing: -0.02em; } }

@media (min-width: 960px) {
  .side { display: flex; flex-direction: column; gap: 18px; position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 20px 14px; border-right: 1px solid var(--line); background: #0D1526; }
  .top, .tabs { display: none; }
  .wrap { padding: 28px 32px 48px calc(var(--side) + 32px); max-width: calc(1180px + var(--side)); }
  .side__brand { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 4px 6px 12px; border-bottom: 1px solid var(--line); }
  .side__brand:hover { text-decoration: none; }
  .side__name { display: flex; flex-direction: column; }
  .side__app { font-weight: 600; font-size: 17px; }
  .side__co { color: var(--muted); font-size: 12px; font-family: var(--mono); letter-spacing: .04em; }
  .side__list { display: flex; flex-direction: column; gap: 2px; }
  .side__a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 500; }
  .side__a:hover { background: var(--card); color: var(--text); text-decoration: none; }
  .side__a[aria-current=page] { background: var(--card2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
  .side__a[aria-current=page] .ico { color: var(--accent); }
  .side__list li:last-child { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
}

/* ------------------------------------------------------------------ login */
body.is-login .wrap { padding: 0; max-width: none; }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center;
  background: radial-gradient(900px 420px at 50% 0%, rgba(63, 208, 255, .10), transparent 70%), var(--bg); }
.login__mark { margin-bottom: 6px; }
.login__t { font-size: 34px; letter-spacing: -0.03em; }
.login__s { color: var(--muted); font-family: var(--mono); font-size: 13px; letter-spacing: .06em; }
.login__msg { color: var(--warn); max-width: 34ch; }
.login__go { margin-top: 14px; min-width: 200px; justify-content: center; }
.boot { padding: 40px 0; text-align: center; }

/* ------------------------------------------------------------------ building blocks */
.stack { display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-h1 { font-size: 26px; letter-spacing: -0.025em; }
.page-h1:focus { outline: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 820px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row--end { justify-content: flex-end; }
.empty { color: var(--muted); padding: 10px 0; }
.banner { background: #3A2A12; color: #FFE2B0; border: 1px solid #6B4E1F; padding: 10px 12px; border-radius: var(--r-sm); }
.crumbs { font-size: 14px; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }
.link:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--card2);
  color: var(--text); font: 500 14px/1.2 var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3B5279; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--primary:hover { background: #6BDBFF; border-color: #6BDBFF; }
.btn--danger { color: var(--danger); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn .ico { width: 18px; height: 18px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.iconbtn:hover:not(:disabled) { color: var(--text); border-color: var(--line2); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.iconbtn .ico { width: 16px; height: 16px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form__3 { display: grid; gap: 12px; }
@media (min-width: 640px) { .form__3 { grid-template-columns: repeat(3, 1fr); } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__l { font-size: 13px; color: var(--muted); font-weight: 500; }
.field__h { font-size: 12px; color: var(--muted); min-height: 1em; }
.input { width: 100%; background: #0C1628; color: var(--text); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 9px 11px; font: 400 16px/1.4 var(--font); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(63, 208, 255, .18); }
textarea.input { resize: vertical; }
.input--tall { min-height: 280px; font-family: var(--font); }
.input--sm { padding: 5px 8px; font-size: 14px; width: auto; min-height: 34px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=date].input { color-scheme: dark; }
.file { color: var(--muted); font-size: 14px; }
.file::file-selector-button { margin-right: 10px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); border-radius: var(--r-sm); padding: 8px 12px; font: 500 14px var(--font); cursor: pointer; }
.searchbox { display: flex; align-items: center; gap: 8px; background: #0C1628; border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 0 10px; color: var(--muted); }
.searchbox .input { border: 0; background: transparent; padding-left: 0; box-shadow: none; }

/* chips & filters */
.chip { display: inline-block; font: 500 12px/1 var(--mono); padding: 5px 7px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.chip--en_curso { color: var(--accent); border-color: rgba(63, 208, 255, .45); }
.chip--hecho { color: var(--ok); border-color: rgba(74, 222, 155, .4); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font: 500 13px var(--font); cursor: pointer; }
.fchip:hover { color: var(--text); text-decoration: none; }
.fchip[aria-pressed=true], .fchip[aria-current=page] { background: rgba(63, 208, 255, .12); border-color: var(--accent); color: var(--text); }
.fchip__n { font-size: 12px; color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 400 13px var(--mono); cursor: pointer; }
.tag[aria-pressed=true] { color: var(--accent); border-color: var(--accent); }

/* progress */
.progress { display: flex; align-items: center; gap: 10px; }
.progress__bar { flex: 1; height: 6px; background: #0C1628; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.progress__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #8BE6FF); }
.progress__t { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Inicio */
.steps { display: flex; flex-direction: column; }
.steps__row + .steps__row { border-top: 1px solid var(--line); }
.steps__a { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "chip t" ". m"; column-gap: 10px; row-gap: 2px; padding: 9px 2px; color: var(--text); }
.steps__a:hover { text-decoration: none; background: rgba(255, 255, 255, .02); }
.steps__a .chip { grid-area: chip; align-self: start; margin-top: 2px; }
.steps__t { grid-area: t; font-weight: 500; }
.steps__m { grid-area: m; color: var(--muted); font-size: 13px; }
.feed { display: flex; flex-direction: column; }
.feed__row + .feed__row { border-top: 1px solid var(--line); }
.feed__a { display: flex; gap: 10px; padding: 8px 2px; color: var(--text); }
a.feed__a:hover { text-decoration: none; background: rgba(255, 255, 255, .02); }
.feed__ico { color: var(--accent); padding-top: 2px; }
.feed__ico .ico { width: 18px; height: 18px; }
.feed__main { display: flex; flex-direction: column; min-width: 0; }
.feed__what { font-size: 12px; color: var(--muted); font-family: var(--mono); letter-spacing: .02em; }
.feed__title { font-weight: 500; overflow-wrap: anywhere; }
.feed__meta { font-size: 13px; color: var(--muted); }
.feed__row.is-gone .feed__title { text-decoration: line-through; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--line2); }
.stat__n { font-size: 24px; font-weight: 500; color: var(--accent); }
.stat__l { font-size: 13px; color: var(--muted); }

/* Rumbo */
.addbox[hidden] { display: none; }
.hitos { display: flex; flex-direction: column; }
.hito { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.hito__order { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hito__n { font-size: 12px; color: var(--muted); }
.hito__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hito__t { font-size: 16px; overflow-wrap: anywhere; }
.hito--hecho .hito__t { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(154, 168, 188, .6); }
.hito__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.hito__due { font-size: 13px; color: var(--warn); }
.mini { display: inline-flex; align-items: center; gap: 6px; }
.mini__l { font-size: 12px; color: var(--muted); }
.st--en_curso { color: var(--accent); }
.st--hecho { color: var(--ok); }

/* Notas */
.notes { display: grid; gap: 10px; }
@media (min-width: 820px) { .notes { grid-template-columns: 1fr 1fr; } }
.note__a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #0F1829; color: var(--text); }
.note__a:hover { text-decoration: none; border-color: var(--line2); background: var(--card2); }
.note__t { font-size: 15px; }
.note__x { color: #C7D1DF; font-size: 14px; }
.note__m { color: var(--muted); font-size: 13px; }
.note__tags { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.note-full { gap: 10px; }

/* markdown-light */
.md { display: flex; flex-direction: column; gap: 8px; color: #D5DEEA; overflow-wrap: anywhere; }
.md ul, .md ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li::marker { color: var(--muted); }
.md strong { color: var(--text); }
.md code { font-family: var(--mono); font-size: 13px; background: #0C1628; padding: 1px 5px; border-radius: 4px; }
.md blockquote { margin: 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--accent); color: #C7D1DF; }
.md__h { font-size: 16px; margin-top: 6px; color: var(--text); }
.hito .md { font-size: 14px; color: #C7D1DF; }

/* Documentos */
.docs { display: flex; flex-direction: column; }
.doc { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc__kind { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: #0C1628; border: 1px solid var(--line2); color: var(--accent); font-size: 12px; }
.doc__main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc__t { font-weight: 500; overflow-wrap: anywhere; }
.doc__m { color: var(--muted); font-size: 13px; }
.doc__n { font-size: 14px; color: #C7D1DF; }
.doc__acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Propuestas */
.props { display: grid; gap: 12px; }
@media (min-width: 820px) { .props { grid-template-columns: repeat(3, 1fr); } }
.prop { color: var(--text); height: 100%; gap: 6px; }
.prop:hover { text-decoration: none; border-color: var(--accent); }
.prop__t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 16px; }
.prop__t .ico { color: var(--accent); width: 18px; height: 18px; }
.prop__d { color: #C7D1DF; font-size: 14px; }
.prop__u { color: var(--muted); font-size: 12px; margin-top: auto; }
.sheets { display: grid; gap: 14px; }
@media (min-width: 820px) { .sheets { grid-template-columns: 1fr 1fr; } }
.sheet { display: flex; flex-direction: column; gap: 4px; }
.sheet__a { display: block; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #0C1628; }
.sheet__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.sheet__t { font-weight: 500; }

/* Cuenta */
.cuenta__name { font-size: 20px; }
.people { display: flex; flex-direction: column; gap: 10px; }
.people__n { font-weight: 500; }

/* dialogs, toasts */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 16, .72); display: flex; align-items: flex-end; justify-content: center; padding: 12px; overflow-y: auto; }
@media (min-width: 640px) { .overlay { align-items: center; } }
.dialog { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - 24px); overflow-y: auto; }
.dialog--wide { max-width: 640px; }
.dialog__t { font-size: 18px; }
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); background: #E8EEF6; color: #0B1220; padding: 10px 16px; border-radius: 999px; font-weight: 500; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: calc(100vw - 24px); }
.toast--error { background: #FFD9D9; color: #4A0E0E; }
@media (min-width: 960px) { .toast { bottom: 24px; left: calc(50% + var(--side) / 2); } }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .18s ease-out; } @keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } } }
