:root {
  /* Tema A · Blanco de estudio (base) */
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --canvas: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #15171C;
  --muted: #767A83;
  --rule: #ECEDF0;
  --rule-strong: #D5D7DD;
  --accent: #2F5BFF;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8EDFF;
  --rail-bg: #FFFFFF;
  --rail-ink: #15171C;
  --rail-muted: #767A83;
  --rail-active-bg: #15171C;
  --rail-active-ink: #FFFFFF;
  --rail-border: #ECEDF0;
  --col-bg: #F5F6F8;
  --col-border: transparent;
  --card-bg: #FFFFFF;
  --card-shadow: none;
  --auth-bg: #FFFFFF;
  --auth-card-bg: #FFFFFF;
  --auth-card-border: #ECEDF0;
  --auth-ink: #15171C;
  --auth-muted: #767A83;
  --auth-input-bg: #FFFFFF;
  --auth-input-border: #D5D7DD;
  --ok: #1F8A5B;
  --warn: #B45309;
  --radius: 12px;
  --title-weight: 700;
  --rail: 224px;
  font-family: var(--font-body);
  color: var(--ink);
}
/* Tema B · Pizarra */
:root[data-style="b"] {
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --canvas: #F3F4F7; --surface: #FFFFFF; --ink: #1A1C26; --muted: #6E7281; --rule: #E3E5EB; --rule-strong: #C9CCD6;
  --accent: #FF6B4A; --accent-ink: #FFFFFF; --accent-soft: #FFE9E3;
  --rail-bg: #141622; --rail-ink: #E8E9F0; --rail-muted: #9CA0B2; --rail-active-bg: #FF6B4A; --rail-active-ink: #FFFFFF; --rail-border: #1E2130;
  --col-bg: #FFFFFF; --col-border: #E3E5EB; --card-bg: #FAFAFC; --card-shadow: none;
  --auth-bg: #141622; --auth-card-bg: #1B1E2C; --auth-card-border: #2B2F42; --auth-ink: #E8E9F0; --auth-muted: #9CA0B2; --auth-input-bg: #11131C; --auth-input-border: #2B2F42;
  --radius: 8px; --title-weight: 600;
}
/* Tema C · Hoja de calendario */
:root[data-style="c"] {
  --font-display: "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --canvas: #FBFBFC; --surface: #FFFFFF; --ink: #1A1C1F; --muted: #7A7D84; --rule: #E6E7EB; --rule-strong: #CFD1D7;
  --accent: #7C3AED; --accent-ink: #FFFFFF; --accent-soft: #EFE7FD;
  --rail-bg: #FBFBFC; --rail-ink: #1A1C1F; --rail-muted: #7A7D84; --rail-active-bg: #EFE7FD; --rail-active-ink: #4C1D95; --rail-border: #E6E7EB;
  --col-bg: #FFFFFF; --col-border: #E6E7EB; --card-bg: #FFFFFF; --card-shadow: 0 1px 0 rgba(0,0,0,.03);
  --auth-bg: #FBFBFC; --auth-card-bg: #FFFFFF; --auth-card-border: #E6E7EB; --auth-ink: #1A1C1F; --auth-muted: #7A7D84; --auth-input-bg: #FFFFFF; --auth-input-border: #CFD1D7;
  --radius: 6px; --title-weight: 500;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--canvas); }
body { font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- estructura */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px;
  background: var(--rail-bg); border-right: 1px solid var(--rail-border); color: var(--rail-ink);
  display: flex; flex-direction: column; gap: 2px;
}
.rail a { text-decoration: none; padding: 8px 10px; border-radius: var(--radius); color: var(--rail-ink); }
.rail a:hover { background: color-mix(in srgb, var(--rail-ink) 8%, transparent); }
.rail a[aria-current="page"] { background: var(--rail-active-bg); color: var(--rail-active-ink); }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; margin-bottom: 18px; display: flex; align-items: baseline; gap: 2px; }
.brand:hover { background: none !important; }
.brand-mark { color: var(--accent); }
.brand-sub { font-weight: 400; font-size: 13px; color: var(--rail-muted); margin-left: 8px; letter-spacing: 0; }
.rail-foot { margin-top: auto; font-size: 13px; color: var(--rail-muted); padding: 10px; border-top: 1px solid var(--rail-border); }
.rail-foot b { color: var(--rail-ink); }
.main { padding: 36px 44px 80px; max-width: 1240px; width: 100%; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--rail-border); padding: 12px 16px; }
  .brand { margin: 0 12px 0 0; }
  .rail-foot { display: none; }
  .main { padding: 20px 16px 60px; }
}

/* ---------- tipografía y cabeceras de página */
h1 { font-family: var(--font-display); font-size: 30px; font-weight: var(--title-weight); letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 36px 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 28px; max-width: 64ch; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .lede { margin-bottom: 0; }

/* ---------- flujo de etapas: el elemento distintivo */
.flow { display: flex; gap: 0; margin: 8px 0 8px; overflow-x: auto; padding-bottom: 6px; }
.flow-stage { position: relative; min-width: 96px; flex: 1; padding: 12px 10px 10px 12px; border-top: 4px solid var(--rule-strong); }
.flow-stage + .flow-stage::before { content: ""; position: absolute; left: 0; top: -4px; width: 1px; height: calc(100% + 4px); background: var(--surface); }
.flow-stage b { display: block; font-weight: 600; font-size: 14px; }
.flow-stage span { color: var(--muted); font-size: 13px; }
.flow-stage.special { border-top-style: dashed; }
.flow-note { color: var(--muted); font-size: 13px; margin: 0 0 24px; }

/* ---------- cifras */
.figures { display: flex; gap: 40px; flex-wrap: wrap; margin: 0 0 8px; }
.figure b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.figure span { color: var(--muted); font-size: 14px; }

/* ---------- tablas */
.table-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; background: color-mix(in srgb, var(--canvas) 60%, var(--surface)); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FBFBFC; }
tr.is-disabled td { color: var(--muted); }
td .sub { display: block; color: var(--muted); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- etiquetas */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; background: var(--canvas); color: var(--ink); margin: 2px 4px 2px 0; white-space: nowrap; }
.pill.admin { background: var(--ink); color: #fff; }
.pill.off { background: transparent; border: 1px solid var(--rule-strong); color: var(--muted); }
.pill.client { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.perm { font-size: 12.5px; color: var(--muted); }
.perm.on { color: var(--ink); }

/* ---------- botones y formularios */
.btn { border: 1px solid var(--rule-strong); background: var(--surface); padding: 8px 14px; border-radius: var(--radius); cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #BE2A5F; }
.btn.danger { color: #B42318; }
.btn.danger:hover { border-color: #B42318; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="search"] { padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); min-width: 260px; background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="date"], .field select {
  padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); width: 100%;
}
.field .hint { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.member-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.member-row select { padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.error { color: #B42318; font-size: 14px; margin: 0 0 12px; }

/* ---------- panel lateral (drawer) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(28,30,38,.35); }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100%); background: var(--surface);
  border-left: 1px solid var(--rule); padding: 28px 32px; overflow: auto; box-shadow: -8px 0 24px rgba(0,0,0,.06);
  transform: translateX(0); animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer h2 { margin: 0 0 4px; font-size: 22px; }
.drawer .lede { margin-bottom: 22px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); }

/* ---------- estados */
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 14px; transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- detalle de cliente */
.project { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 14px; }
.project .meta { color: var(--muted); font-size: 13.5px; margin: 2px 0 12px; }
.project .flow { margin: 10px 0 4px; }
.project .flow-stage { min-width: 96px; padding: 8px 8px 6px 10px; }
.project .flow-stage b { font-size: 13px; }

/* ---------- ficha de cliente (estilo GestorABCD) */
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; }
.ficha { background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 18px 24px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.ficha h1 { font-size: 26px; margin: 0 0 4px; }
.ficha-meta { margin: 0; color: var(--muted); font-size: 14px; }
.code { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 22px; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.seg .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.seg .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); position: relative; }
.filters { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filters input[type="search"] { flex: 1 1 240px; padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.filters select { padding: 9px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.count-total { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* tablero */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.column { flex: 0 0 300px; background: var(--col-bg); border: 1px solid var(--col-border); border-top: 4px solid var(--stage); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.column.special { border-top-style: dashed; }
.column header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 6px; }
.column header b { font-size: 15px; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.funcional { display: block; padding: 0 14px 10px; }
.funcional select { width: 100%; font-size: 13px; padding: 5px 8px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.funcional select:not([value=""]):has(option:checked:not([value=""])) { color: var(--ink); border-style: solid; }
.column-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; border-top: 1px solid var(--rule); padding-top: 10px; }
.empty-col { color: var(--muted); padding: 24px 6px; margin: 0; font-size: 14px; }
.card { background: var(--card-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; box-shadow: var(--card-shadow); }
.card:hover, .card:focus-visible { border-color: var(--ink); }
.card b { display: block; font-weight: 500; margin: 2px 0 4px; }
.card-meta { color: var(--muted); font-size: 13px; }
.pill.prio-urgent { background: #FEE2E2; color: #991B1B; }
.pill.prio-high { background: #FFEDD5; color: #9A3412; }
.pill.prio-low { background: var(--canvas); color: var(--muted); }

/* lista plegable (vista Lista y pantallas angostas) */
.stage-list { display: flex; flex-direction: column; gap: 8px; }
.stage-row { background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--stage); border-radius: var(--radius); }
.stage-row summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 16px; }
.stage-row summary::-webkit-details-marker { display: none; }
.stage-row summary::before { content: "▸"; color: var(--muted); font-size: 13px; transition: transform .15s; }
.stage-row[open] summary::before { transform: rotate(90deg); }
.stage-row summary b { font-weight: 600; }
.stage-row summary .sub { margin-left: auto; font-size: 13px; }
.stage-row-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.stage-row-body .funcional { padding: 0; max-width: 320px; }

@media (max-width: 860px) {
  .seg { display: none; }   /* en pantallas angostas siempre se muestra la lista plegable */
  .stage-row summary { font-size: 15px; }
  .ficha { flex-direction: column; }
  .section-head .actions { width: 100%; }
}

/* ---------- autenticación */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--auth-bg); color: var(--auth-ink); }
.auth-card { width: min(440px, 100%); background: var(--auth-card-bg); border: 1px solid var(--auth-card-border); border-radius: var(--radius); padding: 32px 36px; color: var(--auth-ink); }
.auth-card .lede, .auth-card .hint, .auth-foot { color: var(--auth-muted); }
.auth-card .field input { background: var(--auth-input-bg); border-color: var(--auth-input-border); color: var(--auth-ink); }
.auth-card .brand { color: var(--auth-ink); }
.auth-card .pw-eye { color: var(--auth-muted); }
.auth-card a { color: var(--auth-ink); }
.auth-card h1 { font-size: 24px; }
:root[data-style="c"] .auth-card h1 { font-size: 28px; }
.auth-card .lede { margin-bottom: 20px; }
.auth-foot { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.btn.wide { width: 100%; padding: 11px; }
.form-narrow { max-width: 440px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 24px; }
.rail-foot select { width: 100%; padding: 6px 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); font-size: 13px; }
.rail-user { margin-top: 8px; }
.rail-user a { padding: 0; }
.rail-user a:hover { background: none; text-decoration: underline; }

/* ---------- ojito de contraseña */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; border-radius: var(--radius); cursor: pointer; display: inline-flex; }
.pw-eye:hover { color: var(--ink); background: var(--canvas); }

/* ---------- selector de estilo visual */
.style-switch { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--rail-muted); }
.style-switch button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rail-border); background: transparent; color: var(--rail-ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.style-switch button[aria-pressed="true"] { background: var(--rail-active-bg); color: var(--rail-active-ink); border-color: transparent; }
.auth .style-switch { justify-content: center; margin-top: 16px; width: 100%; color: var(--auth-muted); }
.auth .style-switch button { border-color: var(--auth-card-border); color: var(--auth-ink); }
.auth .style-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.rail .style-switch { margin-top: 10px; }

/* ---------- recuadros de cifras (Resumen) */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 4px 0 8px; }
@media (max-width: 1180px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 14px 14px; min-width: 0; text-decoration: none; color: var(--ink);
  background: var(--tile-bg, var(--surface)); border: 1px solid var(--tile-border, var(--rule)); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--tile-shadow, none); position: relative; overflow: hidden; transition: transform .12s ease, border-color .12s ease; }
.tile::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: 0; transition: opacity .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--rule-strong); }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.tile-icon svg { width: 20px; height: 20px; }
.tile b { font-family: var(--font-display); font-size: 34px; font-weight: var(--title-weight); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 14px; font-weight: 600; margin-top: 6px; }
.tile-hint { font-size: 12.5px; color: var(--muted); }
:root[data-style="a"] .tile, :root:not([data-style]) .tile { --tile-bg: var(--col-bg); --tile-border: transparent; }
:root[data-style="b"] .tile { --tile-bg: #FFFFFF; --tile-border: var(--rule); --tile-shadow: 0 1px 2px rgba(20,22,34,.04); }
:root[data-style="c"] .tile { --tile-bg: #FFFFFF; --tile-border: var(--rule); }
@media (prefers-reduced-motion: reduce) { .tile, .tile::after { transition: none; } .tile:hover { transform: none; } }

/* ---------- conversación y adjuntos */
.thread { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule); }
.thread h3 { font-family: var(--font-display); font-size: 16px; margin: 0 0 10px; }
.thread-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.msg { background: var(--col-bg, var(--canvas)); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; }
.msg.mine { background: var(--accent-soft); border-color: transparent; }
.msg header { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.msg header b { color: var(--ink); font-size: 13.5px; }
.msg p { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pill.stage { border-left: 3px solid var(--stage); background: var(--surface); }
.msg-del { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1; padding: 0 4px; }
.msg-del:hover { color: #B42318; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: calc(var(--radius) - 2px); background: var(--surface); overflow: hidden; }
.att-img { padding: 0; }
.att-img img { display: block; width: 160px; height: 120px; object-fit: cover; }
.att-file { padding: 8px 10px; font-size: 13px; }
.att-file svg { width: 18px; height: 18px; color: var(--muted); }
.att-file small { color: var(--muted); }
.att:hover { border-color: var(--ink); }
.composer { margin-top: 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.composer textarea { width: 100%; border: 0; background: transparent; padding: 10px 12px; resize: vertical; min-height: 56px; font: inherit; color: var(--ink); }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.composer-bar .hint { font-size: 12px; flex: 1; }
.composer-bar label.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.composer-bar label.btn svg { width: 16px; height: 16px; }
.c-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.c-files:empty { display: none; }
.c-file { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; background: var(--canvas); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 6px 3px 3px; }
.c-file img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.c-file svg { width: 16px; height: 16px; color: var(--muted); margin-left: 4px; }
.c-file button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.card-counts { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.card-counts svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; background: rgba(12,14,20,.86); display: grid; place-items: center; z-index: 50; padding: 24px; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); text-align: center; color: #fff; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox figcaption { margin-top: 10px; font-size: 13px; color: #D8DAE0; }
.lightbox figcaption a { color: #fff; }
.lb-close { position: absolute; top: 14px; right: 18px; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 24px; cursor: pointer; }
.drawer { width: min(640px, 100%); }

/* ---------- permisos por rol (desplegable) */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }
.perm-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); padding: 4px 0; }
.perm-row.on { color: var(--ink); }
.perm-row small { display: block; font-size: 11.5px; color: var(--muted); }
.perm-mark { width: 18px; text-align: center; font-weight: 600; color: var(--ok); }
.perm-row:not(.on) .perm-mark { color: var(--rule-strong); }
.stage-row-body .table-wrap { margin: 0; }

/* ---------- edición de catálogos y roles */
.row-actions { margin-bottom: 12px; }
.stage-row.is-hidden summary b { color: var(--muted); text-decoration: line-through; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check-row { cursor: pointer; }
.check-row input { accent-color: var(--accent); margin-top: 3px; }
.field input[type="color"] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }
.field input[type="number"] { padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); width: 100%; }
.drawer h3 { margin: 6px 0 8px; }

/* ---------- planes y cobros */
.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
@media (max-width: 1180px) { .tiles-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bs.ok { color: var(--ok); } .bs.warn { color: var(--warn); } .bs.bad { color: #B42318; }
.pill.ok { background: #DCFCE7; color: #166534; }
.pill.warn { background: #FEF3C7; color: #92400E; }
.banner { grid-column: 2; padding: 10px 44px; font-size: 14px; border-bottom: 1px solid var(--rule); }
.banner.warn { background: #FEF3C7; color: #92400E; } .banner.bad { background: #FEE2E2; color: #991B1B; }
.banner a { color: inherit; font-weight: 600; }
.app { grid-template-rows: auto 1fr; }
.rail { grid-row: 1 / 3; }
@media (max-width: 860px) { .banner { grid-column: 1; padding: 10px 16px; } .rail { grid-row: auto; } }
.plan-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: calc(var(--radius) + 4px); padding: 20px 24px; max-width: 900px; }
.plan-card.blocked { border-color: #FCA5A5; }
.plan-name { font-family: var(--font-display); font-size: 22px; font-weight: var(--title-weight); }
.plan-main p { margin: 6px 0 0; }
.usage { margin-bottom: 10px; }
.usage-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.usage-bar { height: 8px; background: var(--canvas); border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.usage-bar.unlimited { background: repeating-linear-gradient(90deg, var(--rule) 0 6px, transparent 6px 12px); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; max-width: 900px; margin-top: 14px; }
.plan-opt { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.plan-opt.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plan-opt b { font-family: var(--font-display); font-size: 16px; }
.plan-price { font-family: var(--font-display); font-size: 22px; font-weight: var(--title-weight); letter-spacing: -0.02em; }
.plan-price small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.plan-opt ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 760px) { .plan-card { grid-template-columns: 1fr; } }
.field textarea { padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); width: 100%; font: inherit; }

/* ---------- ayuda y recorrido guiado */
.info-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--muted); cursor: pointer; vertical-align: middle; margin-left: 4px; padding: 0; }
.info-btn svg { width: 15px; height: 15px; }
.info-btn:hover { color: var(--accent); border-color: var(--accent); }
.help-rail { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; width: 100%; justify-content: center; color: var(--rail-ink); border-color: var(--rail-border); background: transparent; }
.help-rail svg { width: 15px; height: 15px; }
.help-rail:hover { border-color: var(--rail-ink); }
.drawer.help p { font-size: 15px; }
.help-tips { padding-left: 18px; color: var(--ink); font-size: 14px; line-height: 1.5; }
.help-tips li { margin-bottom: 6px; }
.help-index { display: flex; flex-wrap: wrap; gap: 6px; }
.help-index .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
#tour { position: fixed; inset: 0; z-index: 60; }
.tour-mask { position: absolute; inset: 0; }
.tour-spot { position: absolute; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(12,14,20,.62), 0 0 0 3px var(--accent); transition: all .25s ease; pointer-events: none; }
.tour-spot[hidden] { display: none; }
#tour:has(.tour-spot[hidden]) .tour-mask { background: rgba(12,14,20,.62); }
.tour-tip { position: absolute; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 16px 18px; box-shadow: 0 16px 48px rgba(0,0,0,.3); transition: left .25s ease, top .25s ease; }
.tour-step { font-size: 12px; color: var(--muted); }
.tour-tip h3 { font-family: var(--font-display); font-size: 17px; margin: 4px 0 6px; }
.tour-tip p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.tour-nav { display: flex; gap: 6px; align-items: center; }
.tour-nav span { flex: 1; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-tip { transition: none; } }

/* ---------- pestañas de plataforma */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: -8px 0 20px; }
.tabs a { text-decoration: none; color: var(--muted); padding: 8px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .tiles-3, .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filters input[type="month"] { padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); }

/* ---- Mi día, bandeja, tareas, papelera, menciones y reacciones (0008) */
.rail .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #E11D48; color: #fff; font-size: 11.5px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.day-list { display: grid; gap: 8px; }
.day-group h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day-item { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px 10px 10px; cursor: pointer; }
.day-item:hover { border-color: var(--rule-strong); }
.day-item .bar { width: 6px; align-self: stretch; border-radius: 3px; background: var(--stage, var(--rule-strong)); }
.day-item b { display: block; font-size: 15px; }
.day-item .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.day-item .when { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.day-item .when.late { color: #B42318; font-weight: 600; }
.day-item .when.today { color: var(--accent); font-weight: 600; }
.pill.kind-task { background: #FEF3C7; color: #92400E; }
.pill.kind-post { background: var(--accent-soft); color: var(--accent); }
.inbox-tabs { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.inbox-tabs .seg { display: inline-flex; gap: 2px; }
.inbox-tabs .seg .btn.on { background: var(--ink); color: #fff; }
.inbox-tabs .lbl { font-size: 13px; color: var(--muted); }
.inbox-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.inbox-item.unread { border-left: 4px solid var(--accent); }
.inbox-item .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.inbox-item .txt b { font-weight: 600; }
.inbox-item .txt .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.inbox-item .txt .excerpt { margin: 6px 0 0; font-size: 14px; background: var(--canvas); border-radius: 8px; padding: 6px 10px; }
.inbox-item .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.task-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.task-row:last-child { border-bottom: 0; }
.task-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.task-row.done b { text-decoration: line-through; color: var(--muted); }
.task-row .meta { font-size: 12.5px; color: var(--muted); }
.task-row .meta .late { color: #B42318; font-weight: 600; }
.tasks-box { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin-top: 20px; }
.tasks-box summary { padding: 12px 14px; cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.tasks-box summary .count { font-size: 12px; background: var(--canvas); border-radius: 999px; padding: 1px 8px; }
.tasks-box summary .btn { margin-left: auto; }
.trash-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.trash-item .sub { display: block; color: var(--muted); font-size: 13px; }
.trash-log { margin-top: 24px; }
.trash-log li { margin-bottom: 8px; font-size: 14px; }
.trash-log li .sub { color: var(--muted); font-size: 13px; }
.mention-box { position: relative; }
.mention-list { position: absolute; left: 0; bottom: 100%; z-index: 5; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 220px; max-height: 180px; overflow: auto; }
.mention-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; font: inherit; }
.mention-list button:hover, .mention-list button.on { background: var(--accent-soft); }
.msg .mention { color: var(--accent); font-weight: 600; }
.reactions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.reactions button { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; line-height: 1.5; }
.reactions button.on { border-color: var(--accent); background: var(--accent-soft); }
.reactions button.add { opacity: .6; }
.reactions button.add:hover { opacity: 1; }
.drawer .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
@media (max-width: 700px) { .drawer .grid3 { grid-template-columns: 1fr; } .day-item { grid-template-columns: 6px 1fr; } .day-item .when { text-align: left; } }

/* ---- publicación completa (0009) */
.drawer.wide { width: min(880px, 100%); }
.title-input { width: 100%; font-family: var(--font-display); font-size: 22px; font-weight: var(--title-weight); border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 -6px 4px; background: transparent; color: var(--ink); }
.title-input:hover, .title-input:focus { border-color: var(--rule-strong); background: var(--surface); outline: none; }
.banner-inline { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; margin: 0 0 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner-inline.warn { background: #FEF3C7; color: #92400E; }
.banner-inline.approval { background: var(--accent-soft); color: var(--ink); }
.sec { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin: 0 0 10px; }
.sec > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sec > summary .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.sec > summary .sub.warn { color: #B42318; }
.sec > summary .count { font-size: 12px; background: var(--canvas); border-radius: 999px; padding: 1px 8px; }
.sec > summary .btn { margin-left: auto; }
.sec > *:not(summary) { margin-left: 14px; margin-right: 14px; }
.sec > textarea { width: calc(100% - 28px); margin-bottom: 10px; font: inherit; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 8px; resize: vertical; background: var(--surface); color: var(--ink); }
.sec > .hint, .sec > .lbl { margin-bottom: 10px; }
.sec > .lbl { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 14px 4px; }
.sec > ul { list-style: none; padding: 0; margin-top: 4px; }
.slides { display: grid; gap: 8px; margin-bottom: 10px; }
.slide { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--rule); border-radius: 8px; padding: 6px; }
.slide img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; background: var(--canvas); }
.slide-file { width: 72px; height: 72px; display: grid; place-items: center; background: var(--canvas); border-radius: 6px; color: var(--muted); }
.slide-info { display: grid; gap: 2px; font-size: 13px; min-width: 0; }
.slide-info b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-info span { color: var(--muted); }
.slide-info .ok { color: var(--ok); } .slide-info .warn { color: #B42318; }
.slide-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sec > label.btn { display: inline-flex; margin-bottom: 12px; }
.links li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.links li:last-child { border-bottom: 0; }
.links li > span:first-child, .links li > a:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.links li .sub { color: var(--muted); font-size: 12.5px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links li.hint { border: 0; }
.inline-add { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.inline-add input, .inline-add select { flex: 1 1 160px; padding: 7px 10px; border: 1px solid var(--rule-strong); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.timeline li { padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .sub { color: var(--muted); font-size: 12.5px; }
.timeline .excerpt { margin: 4px 0 0; background: var(--canvas); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; }
.card-counts .pill { margin: 0; }

/* ---- grilla: calendario, tabla, feed (bloque 4) */
.seg .btn.on { background: var(--ink); color: #fff; }
.cal-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.cal-head b { font-size: 18px; text-transform: capitalize; margin: 0 6px; }
.cal-head .sub { margin-left: auto; color: var(--muted); font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; letter-spacing: .04em; }
.cal-cell { min-height: 96px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.other { opacity: .5; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 2px; }
.cal-add { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; padding: 0 3px; border-radius: 4px; }
.cal-cell:hover .cal-add { opacity: 1; } .cal-add:hover { background: var(--accent-soft); color: var(--accent); }
.cal-item { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--stage); background: var(--canvas); border-radius: 4px; padding: 3px 6px; cursor: pointer; font: inherit; color: var(--ink); }
.cal-item span { display: block; font-size: 12px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-item small { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .04em; margin-top: 1px; }
.cal-item:hover { background: var(--accent-soft); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.table-edit table td { padding: 6px 8px; vertical-align: middle; }
.table-edit select, .table-edit input[type="date"] { padding: 5px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); max-width: 170px; }
.table-edit select:hover, .table-edit input:hover, .table-edit select:focus, .table-edit input:focus { border-color: var(--rule-strong); background: var(--surface); outline: none; }
.table-edit select[data-f="stage_id"] { border-left: 3px solid var(--stage); }
.cell-title { display: block; width: 100%; min-width: 220px; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font: inherit; font-weight: 600; background: transparent; color: var(--ink); }
.cell-title:hover, .cell-title:focus { border-color: var(--rule-strong); background: var(--surface); outline: none; }
.table-edit .code { display: block; font-size: 11px; }
.cols-menu { position: relative; }
.cols-menu > summary { list-style: none; display: inline-block; }
.cols-menu > summary::-webkit-details-marker { display: none; }
.cols-menu > div { position: absolute; z-index: 6; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 10px 12px; min-width: 240px; display: grid; gap: 6px; font-size: 14px; }
.cols-menu label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.cols-menu .hint { margin: 4px 0 0; max-width: 320px; }
.feed { max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.feed-head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.feed-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 20px; border: 2px solid var(--accent); }
.feed-head .sub { display: block; color: var(--muted); font-size: 13px; }
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--rule); }
.feed-cell { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--canvas); cursor: pointer; overflow: hidden; }
.feed-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-cell:hover img { filter: brightness(.85); }
.feed-empty { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 10px; text-align: center; gap: 4px; }
.feed-empty b { font-size: 12.5px; line-height: 1.25; } .feed-empty small { font-size: 11px; color: var(--muted); }
.feed-badge { position: absolute; top: 6px; right: 8px; color: #fff; font-style: normal; text-shadow: 0 1px 3px rgba(0,0,0,.6); font-size: 14px; }
@media (max-width: 860px) { .cal-grid { gap: 2px; } .cal-cell { min-height: 64px; } .cal-item small { display: none; } .seg { flex-wrap: wrap; } }

/* ---- editor de etapas (0010) */
.st-list { display: grid; gap: 6px; }
.st-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--stage); border-radius: 8px; padding: 8px 10px; }
.st-row.fixed { background: var(--canvas); }
.st-row input[type="color"] { width: 32px; height: 28px; border: 1px solid var(--rule); border-radius: 6px; padding: 0; background: none; cursor: pointer; }
.st-main { flex: 1 1 200px; min-width: 0; }
.st-main input { width: 100%; font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: transparent; color: var(--ink); }
.st-main input:hover:not(:disabled), .st-main input:focus { border-color: var(--rule-strong); background: var(--surface); outline: none; }
.st-main .sub { display: block; color: var(--muted); font-size: 12.5px; padding-left: 6px; }
.st-num { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.st-num input { width: 52px; font: inherit; padding: 4px 6px; border: 1px solid var(--rule-strong); border-radius: 6px; margin: 0 2px; text-align: right; background: var(--surface); color: var(--ink); }
.st-row select { font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 160px; }
.st-acts { display: flex; gap: 3px; }
.st-h { font-size: 14px; color: var(--muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 760px) { .st-acts { width: 100%; } }

/* ---- dashboards (bloque 9) */
.tabs { display: flex; gap: 4px; margin: -8px 0 18px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.kpi b { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi.accent b { color: var(--accent); } .kpi.warn b { color: #B45309; } .kpi.bad b { color: #B42318; }
.kpi-label { font-size: 13.5px; font-weight: 600; } .kpi-hint { font-size: 12.5px; color: var(--muted); }
.dash-grid { gap: 14px; margin-bottom: 14px; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px 12px; margin-bottom: 14px; min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 15px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel h3 .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.panel .table-wrap { margin: 0; }
.panel .bars { background: none; border: 0; padding: 12px 8px 26px; margin-bottom: 4px; height: 170px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 140px; padding: 12px 16px 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 20px; position: relative; }
.bar { position: relative; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; text-decoration: none; }
.bar:hover { opacity: 1; }
.bar.muted { background: var(--rule-strong); }
.bar.within { background: var(--ok); } .bar.over { background: #DC2626; }
.bar b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink); white-space: nowrap; }
.bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.bar em { position: absolute; left: -3px; right: -3px; height: 2px; background: var(--ink); opacity: .7; }
.bars.dual .bar-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-items: end; height: 100%; }
.bars.dual .bar-pair > span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars.stacked .bar-stack { position: relative; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: visible; min-height: 2px; }
.bars.stacked .bar-stack i { display: block; min-height: 2px; }
.bars.stacked .bar-stack b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; }
.bars.stacked .bar-stack span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.legend { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); margin-right: 4px; vertical-align: -2px; }
.sw.muted { background: var(--rule-strong); } .sw.within { background: var(--ok); } .sw.over { background: #DC2626; }
.progress { height: 8px; background: var(--canvas); border-radius: 999px; overflow: hidden; width: 140px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); }
.progress i.ok { background: var(--ok); } .progress i.low { background: #DC2626; }
td.bad { color: #B42318; font-weight: 600; }
.sortable th[data-sort] { cursor: pointer; text-decoration: underline dotted; }
.custom-range { display: inline-flex; gap: 6px; }
.custom-range input { padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); font: inherit; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: 1fr; } }

/* ---- feedback flotante y portal del cliente (0011) */
.fb-float { position: fixed; right: 0; top: 45%; transform: rotate(-90deg) translate(50%, -100%); transform-origin: right top; z-index: 40; background: var(--accent); color: #fff; border: 0; border-radius: 8px 8px 0 0; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 -2px 10px rgba(0,0,0,.15); }
.fb-float:hover { filter: brightness(1.08); }
.auth.portal { align-items: flex-start; padding: 24px 16px; overflow: auto; }
.portal-wrap { width: min(760px, 100%); margin: 0 auto; color: var(--auth-ink); }
.portal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.portal-head .sub { display: block; color: var(--auth-muted); font-size: 13px; }
.portal-wrap h1 { font-size: 26px; margin: 0 0 6px; } .portal-wrap h2 { font-size: 18px; margin: 28px 0 10px; }
.portal-wrap .lede { color: var(--auth-muted); }
.portal-list { display: grid; gap: 14px; }
.portal-card { background: var(--auth-card-bg); border: 1px solid var(--auth-card-border); border-radius: var(--radius); padding: 16px 18px; }
.portal-card header { display: grid; gap: 2px; margin-bottom: 10px; } .portal-card header b { font-size: 17px; } .portal-card header .sub { color: var(--auth-muted); font-size: 13px; }
.portal-assets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.portal-assets a { flex: 0 0 auto; } .portal-assets img { width: 180px; height: 180px; object-fit: cover; border-radius: 8px; display: block; background: var(--canvas); }
.portal-copy { white-space: pre-wrap; background: var(--canvas); border-radius: 8px; padding: 10px 12px; font-size: 14.5px; margin: 0 0 12px; color: var(--ink); }
.portal-actions textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--auth-input-border); border-radius: 8px; background: var(--auth-input-bg); color: var(--auth-ink); margin-bottom: 8px; resize: vertical; }
.portal-actions .actions { display: flex; gap: 8px; justify-content: flex-end; }
.portal-wrap .table-wrap, .portal-wrap .timeline { color: var(--ink); }
.portal-wrap .timeline { list-style: none; padding: 0; background: var(--auth-card-bg); border: 1px solid var(--auth-card-border); border-radius: var(--radius); }
.portal-wrap .timeline li { padding: 8px 14px; color: var(--auth-ink); }
.inbox-item .acts select { padding: 6px 8px; border: 1px solid var(--rule-strong); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }

p.hint { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
