/* Iberian Yacht Solutions · Cuaderno de escalas — carbón, marfil y champán */
:root {
  --carbon: #1c1b19;
  --carbon-2: #262522;
  --carbon-3: #34322e;
  --ivory: #f5efe3;
  --paper: #fbf8f2;
  --paper-2: #f2ece0;
  --line: #e3dac9;
  --line-2: #cec2aa;
  --ink: #1c1b19;
  --ink-2: #47433c;
  --ink-3: #6f685c;
  --gold: #cdb991;
  --gold-2: #b39b6b;
  --gold-ink: #7a6436;
  --sea: #2b5d61;
  --ok: #3d6a4c;   --ok-bg: #e7efe6;
  --warn: #93560f; --warn-bg: #f7ead4;
  --bad: #963828;  --bad-bg: #f5e1dc;
  --info: #2b5d61; --info-bg: #e2eceb;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 0 rgba(28,27,25,.04), 0 10px 30px -18px rgba(28,27,25,.35);
  --display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 3.2vw, 40px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font: 15px/1.55 var(--ui); font-feature-settings: "tnum" 1;
  overflow-x: hidden; min-width: 0;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sea); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--carbon); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------- cabecera ---------- */
.top { background: var(--carbon); color: var(--ivory); position: sticky; top: 0; z-index: 30; }
.bar { display: flex; align-items: center; gap: 18px; padding: 10px var(--gutter); min-width: 0; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; flex: none; }
.brand img { width: 104px; height: auto; }
.brand-sub { font-family: var(--display); font-size: 21px; font-style: italic; color: var(--gold); border-left: 1px solid var(--carbon-3); padding-left: 14px; white-space: nowrap; }
.demo-flag { flex: 1; min-width: 0; font-size: 12.5px; color: #cfc6b4; display: flex; align-items: center; gap: 8px; justify-content: center; }
.demo-flag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(205,185,145,.18); flex: none; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.who select { background: var(--carbon-2); color: var(--ivory); border: 1px solid var(--carbon-3); border-radius: 999px; padding: 8px 30px 8px 14px; font-size: 13px; max-width: 220px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.tabs { display: flex; border-top: 1px solid var(--carbon-3); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; text-align: center; color: #d7cfbf; text-decoration: none; padding: 13px 16px 12px; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.count { font-size: 11.5px; font-weight: 700; background: var(--gold); color: var(--carbon); border-radius: 999px; padding: 1px 7px; min-width: 20px; }
.count:empty { display: none; }

/* ---------- botones ---------- */
.btn { border: 1px solid transparent; border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--carbon); }
.btn-gold:hover:not(:disabled) { background: #d9c7a1; }
.btn-dark { background: var(--carbon); color: var(--ivory); }
.btn-dark:hover:not(:disabled) { background: var(--carbon-3); }
.btn-line { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-line:hover:not(:disabled) { border-color: var(--ink-3); background: var(--paper); }
.btn-ghost-dark { background: transparent; border-color: var(--carbon-3); color: #d7cfbf; }
.btn-ghost-dark:hover { border-color: var(--gold-2); color: #fff; }
.btn-s { padding: 6px 12px; font-size: 12.5px; }
.linkish { background: none; border: 0; padding: 0; color: var(--sea); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; font-size: inherit; text-align: left; }

/* ---------- ayuda "?" ---------- */
.help { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1px solid currentColor; background: transparent; color: var(--gold-ink); font: 700 11.5px/1 var(--ui); cursor: pointer; display: inline-grid; place-items: center; padding: 0; vertical-align: middle; margin-left: 6px; opacity: .85; }
.top .help { color: var(--gold); }
.help:hover, .help[aria-expanded="true"] { opacity: 1; background: var(--gold); color: var(--carbon); border-color: var(--gold); }
.help::after { content: ""; position: absolute; inset: -12px; }
.help { position: relative; }
.pop { position: fixed; z-index: 80; max-width: min(340px, calc(100vw - 24px)); background: var(--carbon); color: var(--ivory); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; box-shadow: 0 18px 40px -12px rgba(0,0,0,.45); }
.pop strong { color: var(--gold); display: block; font-family: var(--display); font-size: 19px; font-weight: 600; margin-bottom: 4px; }

/* ---------- estructura ---------- */
main { padding: 28px var(--gutter) 120px; max-width: 1560px; margin: 0 auto; min-width: 0; }
main:focus { outline: none; }
#original, #agent, #msgDetail, .notion, .drafts, .composer, .hero, .card { scroll-margin-top: 140px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; display: flex; align-items: center; }
.page-head h1 { font-family: var(--display); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; margin-top: 6px; }
.page-head .lede { color: var(--ink-2); max-width: 70ch; margin-top: 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px 22px; }
.section-title { font-family: var(--display); font-size: 25px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.wrap-any { overflow-wrap: anywhere; word-break: normal; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* píldoras y canales */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.gold { background: #efe5cf; color: var(--gold-ink); }
.pill.dark { background: var(--carbon); color: var(--ivory); }
.pill.line { background: transparent; border-color: var(--line-2); }
.ch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ch svg { width: 15px; height: 15px; flex: none; }
.ch.email svg { color: #2f5d8a; }
.ch.whatsapp svg { color: #2e7d4f; }
.ch.teams svg { color: #5b5fc7; }
.ch.manual svg, .ch.wa-group svg { color: var(--warn); }

/* ---------- inicio ---------- */
.hero { position: relative; border-radius: 20px; overflow: hidden; color: var(--ivory); min-height: 420px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); background: var(--carbon); }
.hero-img { position: absolute; inset: 0; background: url(../assets/brand/anchorage.webp) center 60% / cover no-repeat; }
.hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(20,19,17,.92) 0%, rgba(20,19,17,.72) 45%, rgba(20,19,17,.25) 100%); }
.hero-copy { position: relative; padding: clamp(26px, 4vw, 54px); display: flex; flex-direction: column; justify-content: center; gap: 16px; min-width: 0; }
.hero-copy .eyebrow { color: var(--gold); }
.hero h1 { font-family: var(--display); font-weight: 500; font-size: clamp(38px, 5vw, 66px); line-height: 1; letter-spacing: -.01em; }
.hero h1 em { color: var(--gold); }
.hero p { color: #e6dfd1; max-width: 54ch; font-size: 16px; }
.hero-today { position: relative; align-self: end; margin: clamp(18px, 3vw, 34px); background: rgba(251,248,242,.94); color: var(--ink); border-radius: 16px; padding: 18px 20px; backdrop-filter: blur(6px); min-width: 0; }
.today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.kpi { border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; }
.kpi b { font-family: var(--display); font-size: 36px; line-height: 1; display: block; }
.kpi span { font-size: 12.5px; color: var(--ink-3); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; margin-top: 24px; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.flow li { list-style: none; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; min-width: 0; }
.flow ol { padding: 0; margin: 0; }
.flow .n { font-family: var(--display); font-size: 30px; color: var(--gold-2); line-height: 1; }
.flow h4 { font-size: 14px; margin: 6px 0 4px; display: flex; align-items: center; }
.flow p { font-size: 13px; color: var(--ink-2); }
.keep li { margin: 6px 0; }
.keep { padding-left: 18px; margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }

/* tarjetas de escala */
.escala-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.ecard { overflow: hidden; display: flex; flex-direction: column; cursor: pointer; text-align: left; padding: 0; border: 1px solid var(--line); }
.ecard:hover { border-color: var(--gold-2); }
.ecard-img { height: 140px; background-size: cover; background-position: center; position: relative; }
.ecard-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,19,17,0) 30%, rgba(20,19,17,.78)); }
.ecard-img .t { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1; color: #fff; }
.ecard-img .t small { color: var(--gold); font-weight: 700; letter-spacing: .1em; font-size: 11px; text-transform: uppercase; }
.ecard-img .t h3 { font-family: var(--display); font-size: 27px; line-height: 1.05; overflow-wrap: anywhere; }
.ecard-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.dates b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.bar-prog { height: 5px; border-radius: 9px; background: var(--paper-2); overflow: hidden; }
.bar-prog i { display: block; height: 100%; background: var(--gold-2); }

/* ---------- bandeja ---------- */
.inbox { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.inbox-list { position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow: auto; padding: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--carbon); color: var(--ivory); border-color: var(--carbon); }
.group-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); padding: 14px 16px 6px; display: flex; align-items: center; gap: 6px; }
.group-h .gname { color: var(--gold-ink); text-transform: none; letter-spacing: 0; font-size: 13px; font-family: var(--display); font-size: 17px; }
.mitem { display: grid; gap: 4px; width: 100%; text-align: left; border: 0; border-left: 3px solid transparent; background: transparent; padding: 11px 14px 11px 13px; cursor: pointer; border-bottom: 1px solid var(--line); min-width: 0; }
.mitem:hover { background: #fff; }
.mitem[aria-current="true"] { background: #fff; border-left-color: var(--gold-2); }
.mitem .l1 { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-width: 0; }
.mitem .from { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mitem .time { font-size: 12px; color: var(--ink-3); flex: none; }
.mitem .prev { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mitem .l3 { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inbox-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.original { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.original-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; background: var(--paper); }
.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; font-size: 13px; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.original-subject { font-family: var(--display); font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.original-body { padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; }
.wa .original-body { background: #efeae2; }
.wa-bubble { background: #fff; border-radius: 4px 14px 14px 14px; padding: 10px 14px 8px; max-width: 560px; box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-bubble .ts { display: block; text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.origin-box { background: var(--warn-bg); color: #5c3a0c; border-radius: 10px; padding: 10px 14px; font-size: 13px; overflow-wrap: anywhere; }
.origin-box b { color: var(--warn); }

.agent { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.agent-h { background: var(--carbon); color: var(--ivory); padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agent-h h3 { font-family: var(--display); font-size: 21px; font-weight: 600; display: flex; align-items: center; }
.agent-h .help { color: var(--gold); }
.agent-b { padding: 18px; display: grid; gap: 18px; min-width: 0; }
.notice { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.notice.warn { background: var(--warn-bg); color: #5c3a0c; }
.notice.bad { background: var(--bad-bg); color: #5d2016; }
.notice.info { background: var(--info-bg); color: #1d3f42; }
.notice.ok { background: var(--ok-bg); color: #24432f; }
.notice b { font-weight: 700; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .flabel { font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.field input, .field select, .field textarea, .inp { width: 100%; min-width: 0; border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius-s); padding: 9px 11px; font-size: 14px; }
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--gold-2); outline: 2px solid rgba(179,155,107,.25); outline-offset: 0; }
.field.changed input, .field.changed select { border-color: var(--gold-2); background: #fffaf0; }
.field.missing input, .field.missing select { border-color: var(--warn); background: #fffaf1; }
.delta { font-size: 11.5px; color: var(--gold-ink); font-weight: 600; overflow-wrap: anywhere; }
.dt-pair { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 6px; }

.changes { display: grid; gap: 10px; }
.chg { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; min-width: 0; }
.chg.off { opacity: .55; }
.chg-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chg-h .title { font-weight: 700; flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.chg-q { font-size: 13px; color: var(--ink-2); border-left: 2px solid var(--gold); padding-left: 10px; font-style: italic; overflow-wrap: anywhere; }
.chg-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.lines { display: grid; gap: 6px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 100px auto; gap: 6px; align-items: center; }
.line-row .tag { font-size: 11px; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--carbon); }
.agent-f { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
.result-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.result-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* composer */
.composer { margin-bottom: 22px; }
.composer .card-pad { display: grid; gap: 14px; }
.examples { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- escala detalle ---------- */
.esc-hero { position: relative; border-radius: 18px; overflow: hidden; min-height: 230px; color: #fff; display: flex; align-items: flex-end; background: var(--carbon) center / cover no-repeat; }
.esc-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,19,17,.15), rgba(20,19,17,.86)); }
.esc-hero > div { position: relative; z-index: 1; padding: 24px clamp(18px, 3vw, 32px); width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.esc-hero h1 { font-family: var(--display); font-size: clamp(34px, 4.4vw, 56px); line-height: 1; font-weight: 500; overflow-wrap: anywhere; }
.esc-hero .eyebrow { color: var(--gold); }
.esc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; margin-top: 22px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 14px; }
.fact b { display: flex; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 700; }
.fact span { font-family: var(--display); font-size: 22px; line-height: 1.15; display: block; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; }
.timeline .pin { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-2); margin-top: 7px; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 7px; }
.hist li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.hist time { color: var(--ink-3); font-size: 12px; }
.hist .src { color: var(--ink-3); font-size: 12px; }
details.msg { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details.msg summary { padding: 10px 14px; cursor: pointer; display: grid; gap: 2px; list-style: none; }
details.msg summary::-webkit-details-marker { display: none; }
details.msg .body { padding: 0 14px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; color: var(--ink-2); }

/* ---------- notion ---------- */
.notion { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.notion-h { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notion-h h2 { font-size: 18px; font-family: var(--ui); font-weight: 700; display: flex; align-items: center; }
.notion-f { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.notion-f .field { min-width: 150px; flex: 1; max-width: 240px; }
.ntable { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.ntable th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fdfcf9; }
.ntable td { padding: 10px 12px; border-bottom: 1px solid #efe9dd; vertical-align: top; overflow-wrap: anywhere; }
.ntable tr.flash td { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: #fbefd3; } to { background: transparent; } }
.ntable select, .ntable input { border: 1px solid transparent; background: transparent; padding: 5px 6px; border-radius: 6px; width: 100%; font-size: 13px; min-width: 0; }
.ntable select:hover, .ntable input:hover, .ntable select:focus, .ntable input:focus { border-color: var(--line-2); background: #fff; }
.t-title { font-weight: 700; }
.t-lines { margin: 4px 0 0; padding-left: 16px; color: var(--ink-2); font-size: 12.5px; }
.st { font-weight: 600; }
.st-Pendiente { color: var(--ink-2); }
.st-En-curso { color: var(--info); }
.st-Esperando-proveedor { color: var(--warn); }
.st-Hecha { color: var(--ok); }
.st-Cancelada { color: var(--bad); text-decoration: line-through; }
.late { color: var(--bad); font-weight: 700; font-size: 11.5px; }
tr.hist-row td { background: var(--paper); padding: 12px 18px 14px; }

/* ---------- borradores ---------- */
.drafts { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.draft textarea { width: 100%; min-height: 260px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font: 14px/1.55 var(--ui); background: #fff; resize: vertical; }

/* ---------- conectores ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.conn h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn ul { padding-left: 18px; margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.conn li { margin: 4px 0; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.log li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }

/* ---------- recorrido ---------- */
.tour { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: min(400px, calc(100vw - 24px)); background: var(--carbon); color: var(--ivory); border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); overflow: hidden; }
.tour-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--carbon-3); gap: 8px; }
.tour-top b { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tour-x { background: none; border: 0; color: #cfc6b4; cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 6px; }
.tour-b { padding: 16px; display: grid; gap: 10px; max-height: 46vh; overflow: auto; }
.tour-b h3 { font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1.1; }
.tour-b p { color: #e2dacb; font-size: 14px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 22px; height: 4px; border-radius: 3px; background: var(--carbon-3); }
.tour-dots i.on { background: var(--gold); }
.tour-dots i.done { background: #8d7d5a; }
.tour-f { display: flex; gap: 8px; padding: 12px 16px 16px; flex-wrap: wrap; }
.tour-f .btn-line { color: var(--ivory); border-color: var(--carbon-3); }
.tour-f .btn-line:hover { background: var(--carbon-2); }
.tour-mini { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
.tour-focus { outline: 3px solid var(--gold) !important; outline-offset: 4px; border-radius: 12px; transition: outline-color .3s; }

/* ---------- diálogo / toast ---------- */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.dlg::backdrop { background: rgba(20,19,17,.55); }
.dlg form { padding: 22px 24px; display: grid; gap: 14px; }
.dlg h2 { font-family: var(--display); font-size: 28px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--carbon); color: var(--ivory); padding: 11px 18px; border-radius: 999px; font-size: 14px; z-index: 90; transition: .25s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .demo-flag { display: none; }
  .home-grid, .esc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { position: static; max-height: 420px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-today { align-self: stretch; margin-top: 0; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ntable thead { display: none; }
  .ntable, .ntable tbody, .ntable tr, .ntable td { display: block; width: 100%; }
  .ntable tr.task-row { border-bottom: 1px solid var(--line); padding: 10px 6px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ntable tr.task-row td { border: 0; padding: 5px 8px; }
  .ntable tr.task-row td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
  .ntable tr.task-row td.wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .bar { gap: 10px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
  .brand img { width: 84px; }
  .brand-sub { font-size: 17px; padding-left: 10px; }
  .bar-actions { width: 100%; }
  .who { flex: 1; min-width: 0; }
  .who select { max-width: none; width: 100%; }
  .bar-actions .btn { padding: 8px 12px; }
  .tabs a { flex: 0 0 auto; padding: 11px 12px; }
  main { padding-top: 18px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .line-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .hist li, .log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tour { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .tour-b { max-height: 38vh; }
  .dates { grid-template-columns: minmax(0, 1fr); }
  .ntable tr.task-row { grid-template-columns: minmax(0, 1fr); }
  .ntable tr.task-row td.wide { grid-column: auto; }
  .agent-b { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.esc-hero select { color: var(--ink); background: #fff; }
/* contraste de la tarjeta «Hoy» sobre la fotografía */
.hero-today { background: var(--paper); }
.hero-today .eyebrow { color: var(--ink-2); }
.hero-today .kpi span { color: var(--ink-2); }
.line-row s { color: var(--ink-3); }
/* etiquetas largas: pueden pasar a otra línea */
.composer .pill, .chg-h .pill, .row .pill { white-space: normal; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.composer .row > .section-title { min-width: 0; }
@media (max-width: 640px) {
  .bar-actions .lg { display: none; }
  .bar-actions { gap: 6px; }
  .who select { padding-left: 12px; padding-right: 28px; }
}
/* cifras de inicio como enlaces */
a.kpi { display: block; color: inherit; text-decoration: none; border-radius: 10px; padding: 10px 8px 6px; margin: -2px -8px 0; transition: background .15s; }
a.kpi:hover { background: var(--paper-2); }
a.kpi:hover span:not(.late) { text-decoration: underline; text-underline-offset: 3px; }
a.kpi:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 0; }
.empty { text-align: left; }
.filters-2 { border-bottom: 1px solid var(--line); padding-top: 8px; align-items: center; }
