/* ISC Management. Base: tokens y componentes de ISC-Tesoreria/src/app.css (librea RAL 6005 / 1003,
   Archivo condensada) y el prototipo aprobado en la Fase D (prototipos/): conteos, anillos, celebraciones. */
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url('assets/archivo-latin-wdth-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'Archivo'; font-style: italic; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url('assets/archivo-latin-wdth-italic.woff2') format('woff2-variations'); }

:root {
  color-scheme: light;
  --green: #064229; --green-hover: #0A5434; --green-deep: #04321F; --green-night: #032618;
  --gold: #FFB81D; --gold-tint: #FFF3D6; --gold-ink: #6B4B00; --green-tint: #E2ECE6;
  --bg: #F5F6F4; --surface: #FFFFFF; --surface-2: #F3F5F3; --border: #D9DED9; --field: #C9D0CA; --field-hover: #9AA59C;
  --text: #1F1F1F; --text-2: #404040; --text-3: #595959;
  --ok: #1D6B3F; --ok-bg: #E2ECE6; --warn: #6B4B00; --warn-bg: #FFF3D6; --bad: #B3261E; --bad-bg: #FBE7E5;
  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --body: 'Archivo', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text-2); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--gold); color: var(--green-night); }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lettering { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .08em; }
.display { font-family: var(--display); font-weight: 800; font-stretch: 68%; font-style: italic; text-transform: uppercase; color: var(--green); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: .92; margin: 0; }
.display em { color: var(--text); font-style: italic; }
.display.sm { font-size: 1.9rem; }
.kicker { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .1em; font-size: 12.5px; color: var(--text-3); }
.link { background: none; border: 0; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }


/* Botones (de Tesorería) */
.btn { border: 1.5px solid var(--field); background: var(--surface); color: var(--green); border-radius: 2px; padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-family: var(--display); font-weight: 800; font-stretch: 75%; font-style: italic; text-transform: uppercase; letter-spacing: .05em; font-size: 14px; position: relative; overflow: hidden; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease); }
.btn:hover { background: var(--green); border-color: var(--green); color: #fff; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--gold); border-color: var(--gold); color: var(--green-night); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn.big { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.btn::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); }
.btn:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }

/* ═════ Inicio de sesión ═════ */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--green-night); position: relative; overflow: hidden; }
.login-art { position: relative; overflow: hidden; background: var(--green); }
.stripe { position: absolute; left: -20%; width: 140%; height: 90px; transform: rotate(-12deg); }
.stripe.s1 { top: 58%; background: var(--gold); animation: slide 1.2s var(--ease) both; }
.stripe.s2 { top: calc(58% + 104px); height: 26px; background: var(--gold); opacity: .55; animation: slide 1.2s .12s var(--ease) both; }
@keyframes slide { from { transform: rotate(-12deg) translateX(-100%); } }
.login-claim { position: absolute; left: 9%; top: 18%; color: #fff; }
.login-claim .lettering { color: var(--gold); font-size: 14px; }
.login-claim strong { display: block; font-family: var(--display); font-weight: 800; font-stretch: 62%; font-style: italic; text-transform: uppercase; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .88; margin-top: 10px; animation: rise .8s .2s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.login-box { align-self: center; justify-self: center; width: min(380px, 88%); color: #fff; padding: 40px 0; animation: rise .7s .1s var(--ease) both; }
.login-emblem { width: 64px; display: block; margin-bottom: 18px; }
.login-box .display { color: #fff; }
.login-box .display em { color: var(--gold); }
.login-box .muted { color: rgba(255,255,255,.7); }
.login-step { margin-top: 26px; display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field span { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: rgba(255,255,255,.75); }
.field input { background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.25); border-radius: 2px; padding: 10px 12px; color: #fff; transition: border-color .2s; }
.field input:focus { border-color: var(--gold); outline: none; }
.step-title { margin: 0; font-weight: 700; }
.otp { display: flex; gap: 8px; align-items: center; }
.otp input { width: 46px; height: 58px; text-align: center; font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 28px; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.25); border-radius: 2px; color: #fff; transition: border-color .15s, transform .15s var(--spring), background .2s; }
.otp input:focus { outline: none; border-color: var(--gold); }
.otp input.filled { border-color: var(--gold); transform: scale(1.06); background: rgba(255,184,29,.12); }
.otp.ok input { border-color: var(--gold); background: var(--gold); color: var(--green-night); transition-delay: calc(var(--i) * 40ms); }
.otp-gap { width: 6px; }
.login-box .link { color: rgba(255,255,255,.8); justify-self: start; }
.login-foot { margin-top: 30px; color: rgba(255,255,255,.5) !important; }

/* ═════ Cabecera ═════ */
header.top { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 10px 24px -14px rgba(0,0,0,.5); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.top-row { display: flex; align-items: center; gap: 12px; padding: 12px 0 10px; }
.brand { display: flex; align-items: center; gap: 16px; margin-right: auto; min-width: 0; }
.lockup { display: flex; align-items: center; gap: 12px; }
.lockup .isc { height: 34px; }
.lockup .div { width: 1px; height: 28px; background: rgba(255,255,255,.4); }
.lockup .crest { height: 28px; }
.brand-text { border-left: 1px solid rgba(255,255,255,.16); padding-left: 16px; }
.brand h1 { margin: 0; color: var(--gold); font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: rgba(255,255,255,.78); }
.search-trigger { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.85); border-radius: 2px; padding: 7px 12px; min-width: 300px; text-align: left; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; transition: background .2s; }
.search-trigger:hover { background: rgba(255,255,255,.14); }
kbd { font: 11px var(--body); border: 1px solid rgba(255,255,255,.3); border-radius: 2px; padding: 0 5px; }
.bell { background: none; border: 0; cursor: pointer; font-size: 18px; position: relative; padding: 4px 6px; }
.bell .badge { position: absolute; top: -2px; right: -4px; }
.bell.ding { animation: ding .6s var(--ease); }
@keyframes ding { 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 2px; font-size: 11px; line-height: 17px; background: var(--gold); color: var(--green-night); font-weight: 800; text-align: center; }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav.tabs button { position: relative; border: 0; background: none; padding: 10px 14px 12px; cursor: pointer; color: rgba(255,255,255,.82); white-space: nowrap; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
nav.tabs button:hover { color: #fff; background: rgba(255,255,255,.07); }
nav.tabs button.on { color: var(--gold); background: rgba(0,0,0,.2); }
nav.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); animation: grow .35s var(--ease); transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* ═════ Vistas ═════ */
.view { padding-top: 26px; padding-bottom: 60px; animation: viewIn .4s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.grid { display: grid; gap: 16px; margin-top: 18px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .05em; font-size: 15px; color: var(--green); }
.card h3 + * { margin-top: 0; }
.card h3:not(:first-child) { margin-top: 18px; }
.view .card { animation: rise .5s var(--ease) both; }
.view .card:nth-child(2) { animation-delay: .06s; }
.view .card:nth-child(3) { animation-delay: .12s; }
.view .card:nth-child(4) { animation-delay: .18s; }

/* Saludo y racha */
.hello { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.streak { display: flex; align-items: center; gap: 10px; background: var(--green); color: #fff; padding: 10px 16px; border-radius: 4px; }
.streak-n { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-style: italic; font-size: 44px; line-height: .8; color: var(--gold); }
.streak-l { font-size: 12px; line-height: 1.15; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.streak-dots { display: flex; gap: 3px; }
.streak-dots i { width: 7px; height: 22px; background: var(--gold); border-radius: 1px; animation: pop .4s var(--spring) both; }
.streak-dots i:nth-child(n) { animation-delay: calc(var(--d, 0) * 1ms); }
.streak-dots i.off { background: rgba(255,255,255,.25); }
@keyframes pop { from { transform: scaleY(0); } }

/* Anillo */
.rings { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--green-tint); stroke-width: 12; }
.ring circle.bar { stroke: var(--c); stroke-linecap: butt; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.2s var(--ease); }
.ring.go circle.bar { stroke-dashoffset: calc(326.7 * (1 - var(--p))); }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-style: italic; font-size: 38px; line-height: .9; color: var(--green); }
.ring span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.ring-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.ring-legend b { color: var(--green); }

/* Listas */
.todo, .notes, .feed, .contacts, .perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.todo li .btn { margin-left: auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--field); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--gold); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 0 rgba(179,38,30,.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(179,38,30,0); } 100% { box-shadow: 0 0 0 0 rgba(179,38,30,0); } }
.notes li { font-size: 13.5px; padding-left: 12px; border-left: 3px solid var(--border); }
.notes li.new { border-left-color: var(--gold); }
.notes time, .comment time { display: block; font-size: 11.5px; color: var(--text-3); }
.meter { height: 8px; background: var(--green-tint); border-radius: 1px; overflow: hidden; margin: 16px 0 6px; }
.meter span { display: block; height: 100%; width: calc(var(--w) * 100%); background: linear-gradient(90deg, var(--green), var(--green-hover)); transform-origin: left; animation: fill 1.1s var(--ease) both; transition: width .5s var(--ease); }
@keyframes fill { from { transform: scaleX(0); } }

.live { margin-top: 16px; }
.feed li { font-size: 13.5px; display: flex; gap: 10px; align-items: baseline; animation: feedIn .5s var(--ease) both; }
.feed li::before { content: ""; width: 6px; height: 6px; background: var(--gold); border-radius: 50%; flex: none; transform: translateY(-2px); }
.feed li.flash { background: linear-gradient(90deg, var(--gold-tint), transparent 70%); }
.feed time { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
@keyframes feedIn { from { opacity: 0; transform: translateX(-12px); } }

/* KPIs verdes (de Tesorería) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--green); border-radius: 4px; overflow: hidden; color: #fff; }
.kpi { padding: 16px 18px 18px; border-right: 1px solid rgba(255,255,255,.14); position: relative; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .label { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: rgba(255,255,255,.78); display: block; }
.kpi .value { display: block; font-family: var(--display); font-weight: 800; font-stretch: 62%; font-style: italic; font-size: 40px; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .value.bump { animation: bump .6s var(--spring); color: var(--gold); }
@keyframes bump { 40% { transform: scale(1.12); } }
.kpi .sub { display: block; font-size: 12.5px; color: rgba(255,255,255,.78); margin-top: 8px; }
.kpi.alert::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--gold); }

/* ═════ Parrilla de Alianzas ═════ */
.board-head { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.board-head .display { margin-right: auto; }
.seg { display: inline-flex; border: 1.5px solid var(--field); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 12px; cursor: pointer; border-right: 1px solid var(--field); font-size: 13.5px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--green); color: #fff; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 10px; min-height: 340px; transition: background .2s, border-color .2s; }
.col.over { background: var(--gold-tint); border-color: var(--gold); }
.col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; color: var(--green); }
.col-head .pos-n { font-style: italic; color: var(--gold-ink); font-size: 18px; font-stretch: 62%; }
.col-head .count { margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 0 6px; font-size: 12px; color: var(--text-3); }
.tcard { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: 3px; padding: 10px; margin-bottom: 8px; cursor: grab; transition: transform .2s var(--ease), box-shadow .2s var(--ease); animation: rise .4s var(--ease) both; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(4,50,31,.45); }
.tcard.dragging { opacity: .45; transform: rotate(-2deg) scale(.98); }
.tcard.landed { animation: land .5s var(--spring); }
@keyframes land { 0% { transform: scale(1.06); box-shadow: 0 0 0 3px var(--gold); } 100% { transform: none; } }
.tcard b { display: block; color: var(--text); font-size: 14px; }
.tcard .meta { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; }
.tcard .proj { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 11px; letter-spacing: .06em; }
.tcard.stale { border-left-color: var(--gold); }
.tcard.stale .meta span:last-child { color: var(--gold-ink); font-weight: 700; }
.col[data-k="firmado"] .tcard { border-left-color: var(--gold); }

/* ═════ Ficha ═════ */
.ficha-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip.tier { background: var(--green); color: var(--gold); border-color: var(--green); font-family: var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: .06em; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.vs { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 14px 18px; display: grid; grid-template-columns: auto 200px auto; gap: 6px 16px; align-items: center; }
.vs .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.vs b { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-style: italic; font-size: 30px; color: var(--green); font-variant-numeric: tabular-nums; }
.vs-bar { height: 10px; background: var(--gold-tint); border-radius: 1px; overflow: hidden; }
.vs-bar span { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--green); animation: fill 1.2s .2s var(--ease) both; transform-origin: left; }
.alert-line { grid-column: 1 / -1; margin: 4px 0 0; font-size: 12.5px; color: var(--bad); font-weight: 700; }
.block { position: relative; padding-top: 30px; }
.block-tag { position: absolute; top: 0; left: 20px; transform: translateY(-50%); background: var(--green); color: var(--gold); font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; padding: 3px 10px; border-radius: 2px; }
.edit-hint { color: #fff; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; margin-left: 6px; opacity: .8; }
.edit-hint.ro { color: rgba(255,255,255,.6); }
.contacts li { font-size: 13.5px; }
.timeline { list-style: none; margin: 0 0 12px; padding: 0 0 0 16px; border-left: 2px solid var(--green-tint); display: grid; gap: 10px; }
.timeline li { font-size: 13px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--green); border-radius: 50%; }
.timeline time { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 700; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.perks li { font-size: 13.5px; }
.perks input { accent-color: var(--green); }
.perks li.done label { color: var(--text-3); }
.comment { font-size: 13px; background: var(--surface-2); border-radius: 3px; padding: 8px 10px; margin-bottom: 6px; }
.comment b { display: block; color: var(--green); font-size: 12px; }

/* ═════ Control Center ═════ */
.cc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.bars .track { height: 14px; background: var(--surface-2); border-radius: 1px; overflow: hidden; }
.bars .track span { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--green); transform-origin: left; animation: fill 1s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.bars li:first-child .track span { background: var(--gold); }
.bars .n { text-align: right; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.sem { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; }
.light { width: 16px; height: 16px; border-radius: 50%; }
.light.warn { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint); }
.placeholder { max-width: 720px; }
.placeholder p { max-width: 60ch; }

/* ═════ Buscador ═════ */
.search-layer { position: fixed; inset: 0; background: rgba(3,38,24,.55); z-index: 50; display: grid; justify-items: center; align-items: start; padding-top: 12vh; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.search-box { width: min(640px, 92vw); background: var(--surface); border-radius: 4px; padding: 14px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); animation: rise .3s var(--ease); }
.search-box input { width: 100%; border: 2px solid var(--green); border-radius: 2px; padding: 12px 14px; font-size: 17px; }
.search-box input:focus { outline: none; border-color: var(--gold); }
#search-results { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 6px; }
#search-results li { border: 1px solid var(--border); border-left: 4px solid var(--field); border-radius: 3px; padding: 10px 12px; animation: feedIn .25s var(--ease) both; }
#search-results li.k-sponsor { border-left-color: var(--gold); }
#search-results li.k-talk { border-left-color: var(--green); }
#search-results li.k-past { border-left-color: var(--text-3); }
#search-results b { color: var(--text); }
#search-results .why { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
#search-results .status { float: right; }

/* Aviso con «Deshacer» */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--green-night); color: #fff; padding: 10px 16px; border-radius: 3px; display: flex; gap: 16px; align-items: center; z-index: 70; box-shadow: 0 16px 30px -12px rgba(0,0,0,.5); animation: toastIn .35s var(--spring); font-size: 14px; }
.toast .link { color: var(--gold); }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); width: 100%; transform-origin: left; animation: drain 5s linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } }

/* Celebración: bandera a cuadros que barre la pantalla */
.celebrate { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: grid; place-items: center; }
.celebrate .checker { position: absolute; top: 40%; left: 0; right: 0; height: 120px; background: repeating-conic-gradient(var(--text) 0 25%, #fff 0 50%) 0 0 / 40px 40px; transform: skewY(-6deg) translateX(-105%); animation: sweep 1.6s var(--ease) forwards; opacity: .95; }
@keyframes sweep { 0% { transform: skewY(-6deg) translateX(-105%); } 35%, 65% { transform: skewY(-6deg) translateX(0); } 100% { transform: skewY(-6deg) translateX(105%); } }
.cel-text { position: relative; background: var(--green); color: #fff; padding: 16px 28px; border-radius: 3px; text-align: center; box-shadow: 0 0 0 4px var(--gold); animation: celIn 1.6s var(--spring) forwards; }
.cel-text .lettering { color: var(--gold); font-size: 13px; display: block; }
.cel-text strong { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-style: italic; text-transform: uppercase; font-size: 44px; line-height: 1; }
@keyframes celIn { 0% { opacity: 0; transform: scale(.6); } 25%, 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.96); } }

/* Solo Presidencia */
body:not(.r-presidente) [data-only="presidente"] { display: none; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-bottom: 1px solid rgba(255,255,255,.14); }
  .board { grid-template-columns: repeat(5, 240px); overflow-x: auto; }
  .top-row { flex-wrap: wrap; }
  .search-trigger { min-width: 0; order: 3; flex: 1 0 100%; }
  .search-trigger kbd, .brand-text p, .lockup .div, .lockup .crest { display: none; }
  .board-head { flex-wrap: wrap; }
  .board-head .display { flex: 1 0 100%; }
  .hello { flex-direction: column; align-items: start; }
  .vs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .celebrate { display: none !important; }
}

/* ═════ Aplicación real (además del prototipo) ═════ */
.login-error { color: #FFB4AB; font-size: 13.5px; margin: 0; min-height: 1.2em; }
.login-step .btn.big:disabled { opacity: .6; cursor: wait; }
.qr { background: #fff; padding: 10px; border-radius: 3px; width: max-content; }
.qr img { display: block; width: 180px; height: 180px; image-rendering: pixelated; }
.secreto { font-family: ui-monospace, Menlo, monospace; letter-spacing: .12em; font-size: 14px; background: rgba(255,255,255,.08); padding: 8px 10px; border-radius: 2px; word-break: break-all; }
.codigos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: #fff; color: var(--text); padding: 12px; border-radius: 3px; }
.normas { max-width: 720px; }
.normas li { margin-bottom: 8px; }
.vacio { color: var(--text-3); font-size: 13.5px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: var(--text-3); padding: 6px 8px; border-bottom: 2px solid var(--border); }
.tabla td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tabla tr.baja td { color: var(--text-3); }
.acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.form-linea { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.campo { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.campo input, .campo select { border: 1.5px solid var(--field); border-radius: 2px; padding: 7px 10px; background: var(--surface); color: var(--text); min-width: 180px; }
.campo input:focus, .campo select:focus { outline: none; border-color: var(--green); }
.campo select[multiple] { min-height: 150px; min-width: 260px; }
.subnav { display: flex; gap: 6px; margin: 18px 0 4px; flex-wrap: wrap; }
.subnav button { border: 1.5px solid var(--field); background: var(--surface); border-radius: 2px; padding: 5px 12px; cursor: pointer; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; color: var(--green); }
.subnav button.on { background: var(--green); color: #fff; border-color: var(--green); }
.enlace-copiar { display: flex; gap: 8px; align-items: center; background: var(--gold-tint); border: 1px solid var(--gold); padding: 10px 12px; border-radius: 3px; margin-top: 12px; font-size: 13px; word-break: break-all; }
.arbol { list-style: none; margin: 0; padding-left: 18px; border-left: 2px solid var(--green-tint); }
.arbol.raiz { padding-left: 0; border-left: 0; }
.arbol li { margin: 6px 0; }
.nodo { display: inline-flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 4px 10px; font-size: 13.5px; }
.nodo.junta { border-left: 4px solid var(--gold); }
.nodo .quien { color: var(--text-3); font-size: 12.5px; }
.nodo .btn { padding: 1px 6px; font-size: 11px; }
.programa-pronto { max-width: 680px; }
.notes li { cursor: default; }
.notes li .leer { font-size: 11.5px; margin-left: 6px; }
.notes li.nivel-urgente { border-left-color: var(--bad); }
.notes li.nivel-aviso { border-left-color: var(--gold); }
.notes li.leida { opacity: .6; }
.sesion-aviso { position: fixed; right: 16px; bottom: 16px; background: var(--surface); border: 2px solid var(--gold); padding: 12px 14px; border-radius: 3px; z-index: 70; max-width: 300px; font-size: 13.5px; box-shadow: 0 16px 30px -12px rgba(0,0,0,.4); }
.ring-legend .vacio { list-style: none; }
.campo > span { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.campo input[type=checkbox] { min-width: 0; accent-color: var(--green); }

/* ═════ Alianzas ═════ */
.buscador { margin-top: 16px; }
.buscador .campo { font-size: 13px; }
.buscador input { font-size: 17px; padding: 11px 14px; border-width: 2px; border-color: var(--green); }
.resultados { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.resultados:empty { display: none; }
.resultados li { border: 1px solid var(--border); border-left: 4px solid var(--field); border-radius: 3px; padding: 10px 12px; animation: feedIn .25s var(--ease) both; }
.resultados li.k-sponsor { border-left-color: var(--gold); }
.resultados li.k-talk { border-left-color: var(--green); }
.resultados li.k-past { border-left-color: var(--text-3); }
.resultados a { color: var(--text); text-decoration: none; }
.resultados a:hover b { text-decoration: underline; }
.resultados .why { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.resultados .status { float: right; }
.aviso-linea { margin-top: 12px; background: var(--gold-tint); border: 1px solid var(--gold); border-radius: 3px; padding: 8px 12px; font-size: 13px; }
.board-head { flex-wrap: wrap; }
.board-head .subnav { margin: 0 auto 0 0; }
.tcard { user-select: none; }
.tcard[draggable="false"] { cursor: pointer; }
.cerradas { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px; }
.cerradas summary { cursor: pointer; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .05em; color: var(--green); font-size: 13px; }
.cerradas ul { margin-top: 10px; }
.ficha .form-linea { margin-bottom: 10px; }
.ficha .campo input, .ficha .campo select { min-width: 0; width: 100%; }
.ficha .form-linea .campo { flex: 1 1 140px; }
.ficha .campo.nota { flex: 3 1 220px; }
.datos { display: grid; gap: 10px; }
.datos textarea, .campo textarea { border: 1.5px solid var(--field); border-radius: 2px; padding: 7px 10px; font: inherit; resize: vertical; }
.tipos { display: grid; gap: 2px; }
.ficha-head .display { font-size: clamp(2rem, 3.6vw, 2.8rem); }
@media (max-width: 900px) { .board-head .subnav { flex: 1 0 100%; } }

/* ═════ Control Center ═════ */
.cc-head { flex-wrap: wrap; }
.fases { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.fase { background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 6px; text-align: center; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.fase b { display: block; font-family: var(--display); font-stretch: 62%; font-style: italic; font-size: 26px; color: var(--green); line-height: 1; }
.light.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.light.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); animation: pulse 1.8s infinite; }
.server .btn, .card > .btn { margin-top: 12px; text-decoration: none; }
@media (max-width: 900px) { .fases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fase { font-size: 10.5px; letter-spacing: .02em; overflow-wrap: anywhere; }
.todo li { align-items: flex-start; }
.todo li .dot { margin-top: 5px; }

/* ───── Marketing ───── */
.chip.cuenta-ig_fs, .chip.cuenta-tt_fs { background: var(--green-tint); color: var(--green); border-color: transparent; }
.chip.cuenta-ig_ms, .chip.cuenta-tt_ms { background: var(--gold-tint); color: var(--gold-ink); border-color: transparent; }
.chip.cuenta-li { background: #E3EAF3; color: #1F3F66; border-color: transparent; }
.tcard { cursor: pointer; }
.tcard .meta.chips-c { justify-content: flex-start; flex-wrap: wrap; gap: 4px; }
.ficha-contenido { margin: 16px 0; border-left: 4px solid var(--gold); }
.ficha-contenido h3 { margin: 2px 0 0; }
.ficha-contenido .form-linea, .ficha-contenido .acciones { margin-top: 12px; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 16px; }
.cal-head h3 { margin: 0; min-width: 12ch; text-align: center; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 14px 0 8px; }
.cal-dia-n { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 12px; color: var(--text-3); text-align: center; }
.cal-dia { min-height: 92px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-dia.hoy { border-color: var(--gold); background: var(--gold-tint); }
.cal-dia .n { font-size: 12px; font-weight: 700; color: var(--text-3); }
.cal-item { all: unset; cursor: pointer; font-size: 11.5px; line-height: 1.25; padding: 2px 4px; border-radius: 2px; border-left: 3px solid var(--green); background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.cuenta-ig_ms, .cal-item.cuenta-tt_ms { border-left-color: var(--gold); }
.cal-item.cuenta-li { border-left-color: #1F3F66; }
.cal-item.e-publicado { background: var(--ok-bg); }
.cal-item.e-hecho { background: var(--warn-bg); }
.cal-item:focus-visible { outline: 2px solid var(--gold); }
.kbar { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kbar li { display: grid; grid-template-columns: minmax(80px, 140px) 1fr; gap: 2px 10px; font-size: 13px; }
.kbar-e { grid-row: span 2; align-self: center; color: var(--text-2); }
.kbar-v { display: grid; grid-template-columns: 1fr 70px; gap: 8px; align-items: center; }
.kbar-v b { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.kbar .track { height: 9px; background: var(--surface-2); border-radius: 1px; overflow: hidden; }
.kbar .track span, .ley { display: block; height: 100%; width: calc(var(--w) * 100%); transform-origin: left; animation: fill 1s var(--ease) both; }
.kbar .fs, .semana .fs, .ley.fs { background: var(--green); }
.kbar .ms, .semana .ms, .ley.ms { background: var(--gold); }
.ley { display: inline-block; width: 10px; height: 10px; animation: none; vertical-align: -1px; }
.semanas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 190px; margin: 10px 0; }
.semana { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.semana .pila { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.semana .pila span { display: block; width: 100%; height: calc(var(--h) * 100%); transform-origin: bottom; animation: subir 1s var(--ease) both; }
.semana .et { font-size: 10px; color: var(--text-3); white-space: nowrap; }
@keyframes subir { from { transform: scaleY(0); } }
.fases.f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2px; }
.display.sm + .chip { margin-left: 4px; }
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .cal-dia { min-height: 60px; }
  .cal-item { font-size: 0; height: 6px; padding: 0; }
  .semana .et { display: none; }
}
