/* Adilco Control · hoja de estilos. Libro de obra: papel cálido, tinta, cifras en monoespaciada y un único acento ámbar. */
:root {
  --paper: #f6f4ef; --card: #fffefb; --sunk: #eeebe3; --line: #dcd7cb; --line-2: #c9c2b2;
  --ink: #16181d; --ink-2: #4a4d55; --ink-3: #7a7c82;
  --accent: #c25e00; --accent-ink: #fff; --accent-soft: #fbe9d5;
  --ok: #2b7a4b; --ok-soft: #dcefe3; --warn: #a66a00; --warn-soft: #f8ecc9; --bad: #b3261e; --bad-soft: #f8dcd9; --info: #2c5ea8; --info-soft: #dde7f6;
  --radius: 10px; --shadow: 0 1px 0 rgba(22, 24, 29, .04), 0 8px 24px -12px rgba(22, 24, 29, .18);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121317; --card: #1a1c21; --sunk: #202228; --line: #2e3038; --line-2: #3d404a;
    --ink: #ecebe6; --ink-2: #b4b3ad; --ink-3: #85857f;
    --accent: #f08c00; --accent-ink: #16181d; --accent-soft: #3a2a12;
    --ok: #5cc28a; --ok-soft: #173325; --warn: #e2b04a; --warn-soft: #362b12; --bad: #f2786f; --bad-soft: #3a1c1a; --info: #7fa8ea; --info-soft: #1b2a42;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); font-feature-settings: "tnum" 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--card); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* barra */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 16px; letter-spacing: -.01em; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; padding: 6px 11px; border-radius: 7px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.bar-tools { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-3); }
.sync.is-off { color: var(--bad); }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 650; }
h2 { font-size: 17px; margin: 0; letter-spacing: -.01em; font-weight: 600; }
h3 { font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin: 4px 0 0; color: var(--ink-2); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.stack > * + * { margin-top: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.empty { padding: 18px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 14px; }

/* cifras */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; margin-bottom: 20px; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi b { display: block; font: 500 24px/1.15 var(--mono); letter-spacing: -.02em; margin-top: 4px; }
.kpi small { color: var(--ink-3); font-size: 12px; }

/* botones */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* etiquetas */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag.plain::before { display: none; }
.t-lead, .t-previsto, .t-pendiente { background: var(--sunk); color: var(--ink-2); }
.t-propuesta, .t-en-curso, .t-creado { background: var(--info-soft); color: var(--info); }
.t-activo, .t-hecha, .t-en-producción, .t-entregado { background: var(--ok-soft); color: var(--ok); }
.t-pausado, .t-bloqueada { background: var(--warn-soft); color: var(--warn); }
.t-perdido, .t-retirado, .t-vencida { background: var(--bad-soft); color: var(--bad); }
.t-cerrado { background: var(--sunk); color: var(--ink-3); }

/* tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--sunk) 50%, transparent); }
td.r, th.r { text-align: right; }
tr.child td:first-child { padding-left: 32px; }
tr.child td:first-child::before { content: "└ "; color: var(--ink-3); font-family: var(--mono); }
.tlink { font-weight: 600; text-decoration: none; }
.tlink:hover { text-decoration: underline; text-underline-offset: 3px; }
tfoot td { font-weight: 600; background: var(--sunk); }

/* barra de avance */
.meter { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--sunk); position: relative; overflow: hidden; min-width: 60px; }
.meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ink-2); border-radius: 3px; }
.meter.over i::after { background: var(--bad); }
.meter small { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }

/* listas de tareas */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: 0; }
.tasks .t-title { font-weight: 500; }
.tasks .t-meta { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.tasks li.done .t-title { text-decoration: line-through; color: var(--ink-3); }
.check { width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--card); cursor: pointer; margin-top: 2px; display: grid; place-items: center; padding: 0; }
.check[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 13px; height: 13px; }
.prio-1 .t-title::after { content: " · alta"; color: var(--accent); font-size: 12px; font-weight: 600; }

/* tablero de leads */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--sunk); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col-h { display: flex; justify-content: space-between; padding: 2px 4px 10px; }
.lead { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.lead a { font-weight: 600; text-decoration: none; }
.lead p { margin: 4px 0 8px; font-size: 13px; color: var(--ink-2); }
.lead .row { justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }

/* ficha de proyecto */
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { text-decoration: none; } .crumbs a:hover { text-decoration: underline; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.tabs a small { font: 12px var(--mono); color: var(--ink-3); margin-left: 4px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.code { font: 13px/1.55 var(--mono); background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.callout { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); padding: 10px 14px; border-radius: 8px; font-size: 14px; }

/* metodología */
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(104px, 1fr); gap: 4px; overflow-x: auto; counter-reset: none; }
.phases a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 10px 9px; text-decoration: none; border-radius: 8px; border: 1px solid var(--line); background: var(--card); height: 100%; }
.phases a:hover { border-color: var(--ink-3); }
.phases .n { grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono); background: var(--sunk); color: var(--ink-2); }
.phases .n svg { width: 13px; height: 13px; }
.phases .l { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.phases small { font: 11.5px var(--mono); color: var(--ink-3); min-height: 1em; }
.phases .is-done .n { background: var(--ok); color: #fff; }
.phases .is-current .n { background: var(--accent); color: var(--accent-ink); }
.phases .is-current a { border-color: var(--accent); }
.phases .is-viewing a { background: var(--sunk); box-shadow: inset 0 -2px 0 var(--ink); }
.tasks li.na .t-title { color: var(--ink-3); font-style: italic; }
.bullets { margin: 0; padding-left: 18px; font-size: 14px; }
.bullets li { margin: 3px 0; }
.t-borrador { background: var(--sunk); color: var(--ink-2); }
.t-en-revisión { background: var(--info-soft); color: var(--info); }
.t-aprobado { background: var(--ok-soft); color: var(--ok); }
.doc-edit { font: 13px/1.55 var(--mono); min-height: 56vh; tab-size: 2; }
.doc-view { margin-top: 12px; white-space: pre-wrap; }

/* modelos */
.model { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.model:last-child { border-bottom: 0; }
.model code { font: 500 14px var(--mono); }
.model .why { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.rank { font: 600 12px var(--mono); color: var(--accent); margin-right: 6px; }

/* panel lateral */
.scrim { position: fixed; inset: 0; background: rgba(10, 11, 14, .35); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--card); z-index: 31; box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .35); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer.wide { width: min(880px, 100vw); }
.drawer-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-b { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: space-between; }
form.f { display: grid; gap: 14px; }
.f label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.f .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select, textarea { width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: 8px; padding: 8px 10px; font-size: 14.5px; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; border-color: var(--accent); }
.f .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.inline-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

/* acceso */
.login { max-width: 420px; margin: 8vh auto; }
.login h1 { margin-bottom: 6px; }
.login-who { display: grid; gap: 8px; margin: 18px 0; }
.login-who .btn { justify-content: space-between; padding: 12px 14px; font-size: 15px; }
.login-who .btn.is-off { opacity: .55; }
.code-in { font: 500 28px var(--mono); letter-spacing: .4em; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; z-index: 40; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.feed li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--ink-3); white-space: nowrap; font-size: 12px; }

@media (max-width: 720px) {
  .bar-in { gap: 10px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  main { padding: 18px 16px 80px; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .f .two { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 80vw); }
}
@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: .6; } }
}
