/* Sistema de diseño de la plataforma de Mercadotecnia. Sin compilación: se sirve tal cual. */
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF; }

:root {
  --brand: #3B3FBF; --brand-soft: #ECEDFB; --brand-ink: #2A2D93;
  --ink: #171A23; --soft: #5A6172; --mute: #8A91A0; --line: #E6E8EE; --line-2: #F0F1F5;
  --bg: #F6F7FA; --panel: #fff; --side: #12141D; --side-2: #1C1F2B; --side-ink: #A8AEBD;
  --ok: #17835A; --ok-s: #E3F5EC; --warn: #B26A00; --warn-s: #FDF1DC; --bad: #C92F2F; --bad-s: #FCE8E8; --info: #2563B8; --info-s: #E5EEFB; --vio: #6D3FC0; --vio-s: #F0E9FB;
  --r: 12px; --r-s: 8px; --sh: 0 1px 2px rgb(20 24 40 / 5%), 0 1px 1px rgb(20 24 40 / 3%); --sh-l: 0 12px 34px rgb(20 24 40 / 16%);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; --side-w: 244px;
}
[data-company="procon"] { --brand: #007856; --brand-soft: #E6F4EF; --brand-ink: #00593F; }
[data-company="concreplus"] { --brand: #D97800; --brand-soft: #FDF1E0; --brand-ink: #9A5500; }
[data-company="testco"] { --brand: #1C52A6; --brand-soft: #E7EEF8; --brand-ink: #143C7A; }

.m-body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.m-body *, .m-body *::before, .m-body *::after { box-sizing: border-box; }
:where(.m-body) a { color: inherit; text-decoration: none; }
:where(.m-body) :where(h1, h2, h3) { margin: 0; letter-spacing: -.012em; line-height: 1.2; font-weight: 700; }
.m-ico { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* Estructura */
.m-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.m-side { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; overflow-y: auto; z-index: 40; }
.m-logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 800; letter-spacing: -.01em; }
.m-logo i { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 13px; transition: background .2s; }
.m-logo small { display: block; font-weight: 500; font-size: 11px; color: var(--side-ink); }
.m-nav { padding: 4px 10px 12px; flex: 1; }
.m-nav h4 { margin: 14px 10px 4px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6A7183; font-weight: 700; }
.m-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; }
.m-nav a:hover { background: var(--side-2); color: #fff; }
.m-nav a.on { background: var(--brand); color: #fff; }
.m-nav .cnt { margin-left: auto; background: rgb(255 255 255 / 14%); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 99px; }
.m-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid #262A38; font-size: 13px; }
.m-user b { color: #fff; display: block; font-size: 12.5px; line-height: 1.2; }
.m-user button { margin-left: auto; background: none; border: 0; color: var(--side-ink); cursor: pointer; padding: 6px; border-radius: 6px; }
.m-user button:hover { color: #fff; background: var(--side-2); }
.m-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: inline-grid; place-items: center; font-weight: 700; font-size: 11.5px; flex: none; }

.m-main { min-width: 0; display: flex; flex-direction: column; }
.m-top { position: sticky; top: 0; z-index: 30; background: rgb(255 255 255 / 92%); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 22px; }
.m-burger { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer; }
.m-brands { display: flex; gap: 2px; background: var(--line-2); padding: 3px; border-radius: 10px; }
.m-brands button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; font: 600 12.5px var(--font); color: var(--soft); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.m-brands button i { width: 8px; height: 8px; border-radius: 50%; }
.m-brands button.on { background: #fff; color: var(--ink); box-shadow: var(--sh); }
.m-search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.m-search input { width: 100%; height: 36px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 0 12px 0 34px; font: 500 13px var(--font); color: var(--ink); }
.m-search input:focus { outline: 2px solid var(--brand); outline-offset: -1px; background: #fff; }
.m-search .m-ico { position: absolute; left: 10px; top: 9px; color: var(--mute); }
.m-results { position: absolute; top: 42px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-l); max-height: 380px; overflow: auto; padding: 6px; z-index: 50; }
.m-results a { display: block; padding: 7px 9px; border-radius: 7px; font-size: 13px; }
.m-results a:hover { background: var(--bg); }
.m-results small { color: var(--mute); display: block; font-size: 11.5px; }
.m-icon-btn { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 9px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--soft); }
.m-icon-btn b { position: absolute; top: -5px; right: -5px; background: var(--bad); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; }
.m-pop { position: absolute; right: 0; top: 42px; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-l); z-index: 50; overflow: hidden; }
.m-pop header { padding: 10px 12px; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.m-pop a.n { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.m-pop a.n:hover { background: var(--bg); }
.m-pop a.n.new { background: var(--brand-soft); }
.m-pop small { color: var(--soft); display: block; }
.m-rel { position: relative; }

.m-content { padding: 22px; flex: 1; max-width: 1500px; width: 100%; margin: 0 auto; }
.m-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 22px 12px; color: var(--mute); font-size: 11.5px; }
.m-foot code { font-family: ui-monospace, Consolas, monospace; background: var(--line-2); padding: 1px 6px; border-radius: 5px; color: var(--soft); }
.m-demo { background: var(--warn-s); color: var(--warn); font-size: 12px; font-weight: 600; text-align: center; padding: 4px 10px; }

.m-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.m-head h1 { font-size: 23px; font-weight: 800; }
.m-head p { margin: 3px 0 0; color: var(--soft); }
.m-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Componentes */
.m-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; min-width: 0; }
.m-card > h2, .m-card-h { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-card-h a, .m-link { color: var(--brand-ink); font-size: 12.5px; font-weight: 700; }
.m-grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.m-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.m-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; display: block; box-shadow: var(--sh); transition: transform .15s, border-color .15s; }
a.m-kpi:hover { transform: translateY(-2px); border-color: var(--brand); }
.m-kpi span { color: var(--soft); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.m-kpi b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.m-kpi.bad b { color: var(--bad); } .m-kpi.warn b { color: var(--warn); } .m-kpi.ok b { color: var(--ok); }
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 9px; font: 700 13px var(--font); border: 1px solid transparent; background: var(--brand); color: #fff !important; cursor: pointer; white-space: nowrap; transition: filter .15s; }
.m-btn:hover { filter: brightness(.93); }
.m-btn.alt { background: #fff; border-color: var(--line); color: var(--ink) !important; }
.m-btn.alt:hover { background: var(--bg); filter: none; }
.m-btn.bad { background: var(--bad); } .m-btn.ok { background: var(--ok); }
.m-btn.s { height: 30px; font-size: 12px; padding: 0 10px; border-radius: 7px; }
.m-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--soft); white-space: nowrap; }
.b-ok { background: var(--ok-s); color: var(--ok); } .b-warn { background: var(--warn-s); color: var(--warn); } .b-bad { background: var(--bad-s); color: var(--bad); } .b-info { background: var(--info-s); color: var(--info); } .b-vio { background: var(--vio-s); color: var(--vio); }
.m-co { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; }
.m-co i { width: 8px; height: 8px; border-radius: 50%; }
.m-list { list-style: none; margin: 0; padding: 0; }
.m-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line-2); min-width: 0; }
.m-list li:first-child.m-row, .m-row:first-child { border-top: 0; }
.m-row .t { min-width: 0; flex: 1; }
.m-row .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row .t small { color: var(--soft); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.m-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.m-empty { text-align: center; color: var(--soft); padding: 22px 12px; font-size: 13px; }
.m-empty .m-ico { display: block; margin: 0 auto 6px; color: var(--mute); width: 24px; height: 24px; }
.m-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.m-table th { text-align: left; color: var(--soft); font-size: 12px; font-weight: 700; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.m-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.m-table tr:last-child td { border-bottom: 0; }
.m-table tbody tr:hover { background: #FAFBFD; }
.m-scroll { overflow-x: auto; }
.m-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.m-tabs a { padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--soft); }
.m-tabs a.on { background: var(--brand-soft); color: var(--brand-ink); }
.m-tabs a:hover:not(.on) { background: var(--line-2); }
.m-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.m-filters select, .m-filters input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: #fff; font: 500 13px var(--font); color: var(--ink); max-width: 100%; }

/* Formularios */
.m-form { display: grid; gap: 13px; }
.m-form .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.m-f label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.m-f .req { color: var(--bad); }
.m-f input:not([type=checkbox]):not([type=file]), .m-f select, .m-f textarea { width: 100%; min-height: 38px; border: 1px solid #D5D8E0; border-radius: 8px; padding: 7px 10px; font: 500 13.5px var(--font); color: var(--ink); background: #fff; }
.m-f textarea { min-height: 84px; resize: vertical; }
.m-f input:focus, .m-f select:focus, .m-f textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.m-f small { color: var(--soft); font-size: 12px; }
.m-err { color: var(--bad); font-size: 12px; font-weight: 600; display: block; margin-top: 2px; }
.m-alert { padding: 10px 13px; border-radius: 9px; font-weight: 600; font-size: 13px; margin-bottom: 14px; }
.m-alert.ok { background: var(--ok-s); color: var(--ok); } .m-alert.bad { background: var(--bad-s); color: var(--bad); }
.m-opts { display: flex; gap: 7px; flex-wrap: wrap; }
.m-opts label { margin: 0; cursor: pointer; position: relative; }
.m-opts input { position: absolute; opacity: 0; }
.m-opts span { display: inline-block; padding: 7px 13px; border: 1px solid #D5D8E0; border-radius: 8px; font-weight: 600; font-size: 13px; }
.m-opts input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.m-opts input:focus-visible + span { outline: 2px solid var(--brand); }

/* Catálogo */
.m-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.m-cat a { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: transform .15s, border-color .15s, box-shadow .15s; box-shadow: var(--sh); }
.m-cat a:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--sh-l); }
.m-cat i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.m-cat b { font-size: 14px; } .m-cat small { color: var(--soft); font-size: 12.5px; line-height: 1.35; }

/* Línea de flujo */
.m-steps { display: flex; gap: 3px; margin-bottom: 8px; }
.m-steps span { flex: 1; font-size: 10.5px; font-weight: 700; color: var(--mute); text-align: center; padding-top: 7px; border-top: 4px solid var(--line); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-steps span.on { border-color: var(--brand); color: var(--brand-ink); }
.m-tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 11px; }
.m-tl li { position: relative; font-size: 13px; }
.m-tl li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.m-tl small { color: var(--soft); display: block; }

/* Kanban */
.m-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(235px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.m-col { background: #EFF1F5; border-radius: var(--r); padding: 9px; min-height: 200px; }
.m-col.drop { outline: 2px dashed var(--brand); }
.m-col h3 { font-size: 12.5px; padding: 3px 4px 8px; display: flex; justify-content: space-between; color: var(--soft); }
.m-tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 7px; cursor: grab; box-shadow: var(--sh); font-size: 13px; }
.m-tile.drag { opacity: .45; }
.m-tile b { font-weight: 600; display: block; margin-bottom: 4px; }
.m-tile .meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; color: var(--soft); font-size: 11.5px; }

/* Calendario */
.m-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.m-cal .dow { background: #fff; padding: 6px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--soft); }
.m-cal .day { background: #fff; min-height: 104px; padding: 5px; min-width: 0; }
.m-cal .day.out { background: #FAFAFC; } .m-cal .day.out .n { color: var(--mute); }
.m-cal .day .n { font-size: 12px; font-weight: 700; margin-bottom: 3px; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.m-cal .day.today .n { background: var(--brand); color: #fff; }
.m-ev { display: block; font-size: 11px; font-weight: 600; padding: 2px 5px; border-radius: 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c, var(--brand)); background: var(--cs, var(--brand-soft)); color: var(--ink); }
.m-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.m-year a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; display: block; }
.m-gantt { display: grid; gap: 5px; min-width: 760px; }
.m-gantt .r { display: grid; grid-template-columns: 210px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.m-gantt .r > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.m-gantt .lane { position: relative; height: 22px; background: var(--line-2); border-radius: 6px; }
.m-gantt .lane i { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: var(--c, var(--brand)); min-width: 6px; }
.m-gantt .lane u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); }

/* Login */
.m-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.m-auth-art { background: var(--side); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.m-auth-art::after { content: ""; position: absolute; right: -130px; bottom: -130px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ED8300, #1C52A6 55%, #007856); opacity: .55; filter: blur(4px); }
.m-auth-art h1 { font-size: 34px; font-weight: 800; max-width: 15em; color: #fff; }
.m-auth-art p { color: var(--side-ink); max-width: 30em; }
.m-auth-logos { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.m-auth-logos span { background: #fff; border-radius: 9px; padding: 7px 11px; display: grid; place-items: center; height: 42px; }
.m-auth-logos img { max-height: 25px; max-width: 110px; display: block; }
.m-auth-form { display: grid; place-items: center; padding: 28px 18px; }
.m-auth-form > div { width: 100%; max-width: 360px; }

/* Pantallas heredadas del CRM dentro del shell */
.m-legacy { min-width: 0; }

.m-scrim { display: none; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .m-app { grid-template-columns: minmax(0, 1fr); }
  .m-side { position: fixed; left: 0; top: 0; width: 262px; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--sh-l); }
  .m-side.open { transform: none; }
  .m-scrim.open { display: block; position: fixed; inset: 0; background: rgb(12 14 22 / 45%); z-index: 35; }
  .m-burger { display: grid; place-items: center; }
  .m-top { flex-wrap: wrap; padding: 8px 12px; }
  .m-search { order: 5; flex: 1 1 100%; max-width: none; }
  .m-brands { overflow-x: auto; order: 4; flex: 1 1 100%; }
  .m-tools { margin-left: auto; }
  .m-content { padding: 14px 12px; }
  .g2, .g3, .g4, .m-form .two { grid-template-columns: minmax(0, 1fr); }
  .m-auth { grid-template-columns: minmax(0, 1fr); }
  .m-auth-art { padding: 26px 20px; }
  .m-auth-art h1 { font-size: 24px; }
  .m-auth-art::after { display: none; }
  .m-cal .day { min-height: 66px; }
  .m-pop { position: fixed; left: 10px; right: 10px; top: 56px; width: auto; }
  .m-foot { padding: 8px 12px 12px; }
  .m-legacy header .flex { flex-wrap: wrap; }
  .m-legacy table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { .m-body * { transition: none !important; } }

/* Mapa del sitio */
.m-map-group{font-size:13px;letter-spacing:.02em;color:var(--soft);margin:18px 0 8px;font-weight:700}
.m-map{align-items:start}
.m-map summary{display:flex;gap:12px;justify-content:space-between;align-items:flex-start;cursor:pointer;list-style:none}
.m-map summary::-webkit-details-marker{display:none}
.m-map summary .t{min-width:0}.m-map summary small{display:block;color:var(--soft);font-weight:400}
.m-map-meta{text-align:right;flex:none}
.m-map-state{display:inline-block;font:600 11.5px var(--font);padding:2px 8px;border-radius:99px;background:var(--line);color:var(--soft)}
.m-map-state.ok{background:#e4f4ec;color:#176b43}.m-map-state.warn{background:#fdf1e0;color:#8f5300}
.m-map-rel{margin:8px 0 0;color:var(--soft);font-size:12.5px}
.m-map details[open] .m-scroll,.m-map .m-scroll{margin-top:8px}
.m-map code{font-size:12px;word-break:break-all}
.m-map-bad{margin:4px 0;color:#b3261e;font-size:13px}
.m-map-good{display:flex;gap:8px;align-items:center;color:#176b43;font-size:13.5px}
.m-map-good svg{flex:none;width:18px;height:18px}

/* Presupuesto */
.m-seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--panel,#fff)}
.m-seg a{padding:7px 12px;font:600 12.5px var(--font);color:var(--soft);white-space:nowrap}
.m-seg a.on{background:var(--brand,#3B3FBF);color:#fff}
.m-tabs{display:flex;gap:4px;overflow-x:auto;margin-bottom:14px;border-bottom:1px solid var(--line)}
.m-tabs a{padding:9px 14px;font:600 13.5px var(--font);color:var(--soft);border-bottom:2px solid transparent;white-space:nowrap}
.m-tabs a.on{color:var(--brand,#3B3FBF);border-bottom-color:currentColor}
.m-tabs .cnt{margin-left:6px;background:#fdf1e0;color:#8f5300;border-radius:99px;padding:0 6px;font-size:11px}
.m-budget-line{margin:8px 0 0;color:var(--soft);font-size:12.5px}
.m-budget{font-size:12.5px}
.m-budget th{white-space:nowrap}.m-budget th.grp{text-align:center;border-bottom:1px solid var(--line)}
.m-budget td.n,.m-expenses td.n{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.m-budget tr.l1 td{font-weight:700;background:#eef1f7}
.m-budget tr.l2 td{font-weight:600}
.m-budget tr.l3 td.name{padding-left:20px}
.m-budget td.name{min-width:220px}
.b-ok{color:#176b43}.b-warn{color:#8f5300;font-weight:600}.b-over{color:#b3261e;font-weight:700}.b-none{color:#6a3fb5;font-weight:700}
.m-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;margin-bottom:8px}
.m-filters{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));align-items:end}
.m-filters .m-f{margin:0}.m-filters .m-actions{flex-wrap:wrap}
.m-expenses small{color:var(--soft)}
.m-expenses tr.saldo td{background:#fffaf0}
.m-rowact summary{cursor:pointer;font:600 12.5px var(--font);color:var(--brand,#3B3FBF)}
.m-rowact>div{display:grid;gap:12px;padding:10px 0;min-width:230px}
.m-rowact form{display:grid;gap:6px}
.m-rowact input,.m-rowact select{border:1px solid var(--line);border-radius:6px;padding:6px 8px;font:13px var(--font);width:100%}
.m-issues{margin:8px 0;padding-left:18px;font-size:13px;display:grid;gap:4px}
.m-issues li.error{color:#b3261e}
.m-kpi.bad b{color:#b3261e}

/* Facturas y proveedores */
.m-drop{border:2px dashed var(--line);border-radius:12px;padding:34px 16px;text-align:center;color:var(--soft);display:grid;gap:10px;justify-items:center}
.m-drop.over{border-color:var(--brand,#3B3FBF);background:#f1f2fd}
.m-drop b{color:var(--ink,#14202e);font-size:15px}
.m-defs{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px 18px;margin:0}
.m-defs div{min-width:0}.m-defs dt{color:var(--soft);font-size:12px}.m-defs dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.m-review select{border:1px solid var(--line);border-radius:6px;padding:5px;font:13px var(--font);max-width:220px}
.m-note-warn{background:#fdf1e0;color:#8f5300;border-radius:8px;padding:9px 12px;font-size:13px;margin:0 0 12px}

/* Reportes institucionales */
.r-doc{background:var(--panel,#fff);border:1px solid var(--line);border-radius:12px;padding:18px;color:#0E2841}
.r-banner{background:#003B79;color:#fff;padding:14px 18px;font-size:19px;font-weight:700;border-radius:6px}
.r-banner small{display:block;font-size:12.5px;font-weight:500;opacity:.85;margin-top:3px}
.r-h{color:#E97132;font-size:16px;margin:20px 0 8px}
.r-text{width:100%;min-height:96px;border:1px solid var(--line);border-radius:8px;padding:9px;font:14px/1.5 var(--font)}
.r-table{width:100%;border-collapse:collapse;font-size:13px}
.r-table th{background:#DCE3EE;color:#003B79;text-align:left;padding:7px 8px;white-space:nowrap}
.r-table td{padding:7px 8px;border-bottom:1px solid #DCE3EE}
.r-total td{font-weight:700;background:#F1F4F9}
.r-evidence{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.r-evidence figure{margin:0}.r-evidence img{width:100%;border-radius:6px}.r-evidence figcaption{font-size:12px;margin:4px 0}

/* =====================================================================
   Sistema visual v2 (sesión 5): gráficas, modales, avisos, menús,
   tablas apilables, barra inferior móvil, galerías y tarjetas.
   ===================================================================== */
:root { --r: 14px; --sh: 0 1px 2px rgb(20 24 40 / 6%), 0 2px 8px rgb(20 24 40 / 4%); --sh-l: 0 18px 44px rgb(20 24 40 / 18%); --ease: cubic-bezier(.2,.7,.2,1); }
.m-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m-body :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Navegación: grupos plegables */
.m-group { margin-top: 6px; }
.m-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin: 8px 10px 3px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6A7183; font-weight: 700; user-select: none; }
.m-group summary::-webkit-details-marker { display: none; }
.m-group summary:hover { color: #C9CEDA; }
.m-caret { width: 13px; height: 13px; transition: transform .18s var(--ease); }
.m-group[open] .m-caret { transform: rotate(90deg); }
.m-nav a { margin: 1px 0; }
.m-nav a .m-ico { opacity: .85; }
.m-nav a.on .m-ico { opacity: 1; }

/* Menú contextual y creación rápida */
.m-menu { width: 220px; padding: 6px; }
.m-menu a, .m-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font: 600 13px var(--font); color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; }
.m-menu a:hover, .m-menu button:hover { background: var(--bg); }
.m-menu .m-ico { color: var(--soft); }
.m-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 2px; }
.m-menu .danger { color: var(--bad); } .m-menu .danger .m-ico { color: var(--bad); }
.m-pop-body { max-height: 60vh; overflow: auto; }
.m-more { background: none; border: 1px solid transparent; border-radius: 8px; width: 30px; height: 30px; display: inline-grid; place-items: center; color: var(--soft); cursor: pointer; }
.m-more:hover { background: var(--line-2); border-color: var(--line); }

/* Encabezado de página y pestañas de vista con ícono */
.m-head h1 { display: flex; align-items: center; gap: 10px; }
.m-head h1 .m-hico { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); display: inline-grid; place-items: center; flex: none; }
.m-views { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; padding: 4px; background: var(--line-2); border-radius: 11px; margin-bottom: 14px; scrollbar-width: none; }
.m-views::-webkit-scrollbar { display: none; }
.m-views a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; font: 700 12.5px var(--font); color: var(--soft); white-space: nowrap; transition: background .15s, color .15s; }
.m-views a:hover { color: var(--ink); }
.m-views a.on { background: #fff; color: var(--ink); box-shadow: var(--sh); }
.m-views a .cnt { background: var(--line); color: var(--soft); font-size: 10.5px; border-radius: 99px; padding: 0 6px; }
.m-views a.on .cnt { background: var(--brand-soft); color: var(--brand-ink); }
.m-views .sep { width: 1px; background: var(--line); margin: 4px 2px; flex: none; }

/* Indicadores con ícono */
.m-kpi { position: relative; overflow: hidden; }
.m-kpi .ic { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.m-kpi.bad .ic { background: var(--bad-s); color: var(--bad); } .m-kpi.warn .ic { background: var(--warn-s); color: var(--warn); } .m-kpi.ok .ic { background: var(--ok-s); color: var(--ok); }
.m-kpi .sub { display: block; color: var(--mute); font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.m-kpi span:first-child { padding-right: 38px; }

/* Gráficas */
.c-card { display: flex; flex-direction: column; gap: 10px; }
.c-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.c-head h2 { font-size: 14.5px; font-weight: 750; display: flex; align-items: center; gap: 7px; }
.c-head h2 .m-ico { color: var(--brand-ink); width: 17px; height: 17px; }
.c-head p { margin: 2px 0 0; color: var(--mute); font-size: 12px; font-weight: 600; }
.c-head .m-link { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.c-head .m-link .m-ico { width: 14px; height: 14px; }
.c-note { margin: 0; color: var(--mute); font-size: 11.5px; }
.c-empty { padding: 26px 10px; }
.c-donut-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
.c-donut-box { position: relative; width: 150px; height: 150px; }
.c-donut { width: 100%; height: 100%; transform: rotate(0deg); }
.c-donut .seg circle { transition: opacity .15s, stroke-width .15s; cursor: pointer; }
.c-donut:hover .seg circle { opacity: .45; }
.c-donut .seg:hover circle, .c-donut .seg:focus circle { opacity: 1; stroke-width: 7.4; }
.c-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.c-center b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.c-center small { color: var(--mute); font-size: 11px; font-weight: 600; }
.c-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; min-width: 0; }
.c-legend a, .c-legend .c-li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 38px; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 7px; font-size: 12.5px; }
.c-legend a:hover { background: var(--bg); }
.c-legend i { width: 10px; height: 10px; border-radius: 3px; }
.c-legend span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 600; }
.c-legend b { font-variant-numeric: tabular-nums; font-weight: 700; }
.c-legend small { color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
.c-legend.row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.c-legend.row li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--soft); font-weight: 600; }
.c-legend.row b { color: var(--ink); }
.c-bars { display: grid; gap: 4px; }
.c-brow { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 7px; font-size: 12.5px; }
a.c-brow:hover { background: var(--bg); }
.c-bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.c-bt { height: 12px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.c-bt i { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .5s var(--ease); }
.c-bv { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.c-line { padding: 6px 4px 0 38px; }
.c-plot { position: relative; height: 170px; }
.c-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.c-gl { position: absolute; left: 0; right: 0; border-top: 1px solid #ECEDF1; }
.c-gl em { position: absolute; right: calc(100% + 6px); top: -8px; font: 600 10.5px var(--font); color: var(--mute); font-style: normal; white-space: nowrap; }
.c-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 6%); transition: transform .12s; }
.c-dot::after { content: ""; position: absolute; inset: -8px; }
.c-dot:hover, .c-dot:focus { transform: scale(1.5); }
.c-axis { position: relative; height: 22px; margin-top: 4px; }
.c-axis span { position: absolute; transform: translateX(-50%); font: 600 10.5px var(--font); color: var(--mute); white-space: nowrap; top: 4px; }
.c-split { display: flex; gap: 2px; height: 16px; border-radius: 5px; overflow: hidden; margin: 4px 0 6px; }
.c-sp { display: block; min-width: 3px; transition: filter .15s; }
.c-sp:hover { filter: brightness(.9); }
.m-tip { position: fixed; z-index: 90; pointer-events: none; background: #171A23; color: #fff; font: 600 12px var(--font); padding: 6px 9px; border-radius: 7px; box-shadow: var(--sh-l); max-width: 260px; }

/* Ventanas modales */
.m-modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--sh-l); color: var(--ink); font: 14px/1.5 var(--font); }
.m-modal.s { width: min(420px, calc(100vw - 24px)); }
.m-modal.l { width: min(1040px, calc(100vw - 24px)); }
.m-modal::backdrop { background: rgb(14 16 26 / 48%); backdrop-filter: blur(2px); }
.m-modal[open] { animation: m-in .18s var(--ease); }
@keyframes m-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.m-modal > form, .m-modal > div, .m-modal-body { padding: 20px; }
.m-modal h2 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.m-modal p { color: var(--soft); margin: 0 0 14px; }
.m-modal-x { position: absolute; right: 10px; top: 10px; z-index: 2; background: #fff; border: 1px solid var(--line); border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--soft); }
.m-modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.m-modal-h h2 { margin: 0; }
.m-actions.end { justify-content: flex-end; }

/* Avisos flotantes y estados de carga */
.m-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 95; display: grid; gap: 8px; }
.m-toast { display: flex; align-items: center; gap: 9px; background: #171A23; color: #fff; padding: 11px 14px; border-radius: 11px; box-shadow: var(--sh-l); font: 600 13px var(--font); max-width: 380px; animation: m-in .2s var(--ease); }
.m-toast .m-ico { color: #6EE7B7; }
.m-toast.bad .m-ico { color: #FCA5A5; }
.m-toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; left: calc(50% - 8px); top: calc(50% - 8px); border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: m-spin .7s linear infinite; }
.m-btn.alt.is-loading::after { border-color: var(--brand) var(--brand) transparent transparent; }
@keyframes m-spin { to { transform: rotate(360deg); } }
.m-skel { background: linear-gradient(90deg, var(--line-2), #fff, var(--line-2)); background-size: 200% 100%; animation: m-sk 1.2s infinite; border-radius: 8px; min-height: 120px; }
@keyframes m-sk { to { background-position: -200% 0; } }

/* Tablas con búsqueda, orden y paginación */
.m-tt { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.m-tt input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px 0 32px; font: 500 13px var(--font); min-width: 220px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A91A0' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 10px center / 15px; }
.m-tt small { color: var(--mute); font-weight: 600; }
.m-table th[data-sort] { cursor: pointer; user-select: none; }
.m-table th[data-sort]::after { content: "↕"; margin-left: 5px; color: var(--line); font-size: 11px; }
.m-table th[data-sort="asc"]::after { content: "↑"; color: var(--brand); }
.m-table th[data-sort="desc"]::after { content: "↓"; color: var(--brand); }
.m-pager { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.m-pager button { min-width: 32px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font: 700 12px var(--font); cursor: pointer; color: var(--soft); }
.m-pager button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.m-pager button:disabled { opacity: .4; cursor: default; }

/* Ficha de plataforma y chips */
.m-pf { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--pf) 14%, #fff); color: var(--pf); flex: none; }
.m-pf .m-ico { width: 15px; height: 15px; }
.m-pf.l { width: 40px; height: 40px; border-radius: 12px; } .m-pf.l .m-ico { width: 21px; height: 21px; }
.m-pf.xs { width: 20px; height: 20px; border-radius: 6px; } .m-pf.xs .m-ico { width: 12px; height: 12px; }
.m-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--soft); font: 700 11.5px var(--font); white-space: nowrap; }
.m-chip .m-ico { width: 13px; height: 13px; }
.m-chip.on { background: var(--brand-soft); color: var(--brand-ink); }
.m-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--mute)); flex: none; }

/* Galería y tarjetas visuales */
.m-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.m-gcard { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--sh); display: flex; flex-direction: column; transition: transform .15s var(--ease), box-shadow .15s; position: relative; min-width: 0; }
.m-gcard:hover { transform: translateY(-2px); box-shadow: var(--sh-l); }
.m-thumb { aspect-ratio: 4 / 3; background: #EEF0F4 center / cover no-repeat; display: grid; place-items: center; color: var(--mute); position: relative; overflow: hidden; }
.m-thumb img, .m-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-thumb > .m-ico { width: 34px; height: 34px; }
.m-thumb .play { position: absolute; inset: auto 8px 8px auto; background: rgb(0 0 0 / 60%); color: #fff; border-radius: 99px; padding: 2px 8px; font: 700 11px var(--font); display: inline-flex; gap: 4px; align-items: center; }
.m-thumb .play .m-ico { width: 13px; height: 13px; }
.m-gcard .body { padding: 10px 12px 12px; display: grid; gap: 5px; min-width: 0; }
.m-gcard .body b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-gcard .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--soft); font-size: 11.5px; }
.m-gcard .sel { position: absolute; left: 8px; top: 8px; z-index: 2; width: 20px; height: 20px; accent-color: var(--brand); }
.m-gcard .tl { position: absolute; right: 8px; top: 8px; z-index: 2; display: flex; gap: 4px; }
.m-gcard.selected { outline: 2px solid var(--brand); }
.m-gcard a.cover { position: absolute; inset: 0; z-index: 1; }

/* Diseño con filtros laterales */
.m-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.m-aside { position: sticky; top: 70px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 14px; }
.m-aside h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); margin-bottom: 4px; }
.m-aside a { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--soft); }
.m-aside a:hover { background: var(--bg); color: var(--ink); }
.m-aside a.on { background: var(--brand-soft); color: var(--brand-ink); }
.m-aside a small { color: var(--mute); font-weight: 700; }

/* Barra de carga de archivos */
.m-progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.m-progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.m-uploads { display: grid; gap: 8px; margin-top: 10px; }
.m-uploads .u { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 12.5px; }
.m-uploads .u .m-progress { grid-column: 1 / -1; }

/* Estado de sincronización */
.m-sync { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--font); padding: 5px 10px; border-radius: 99px; }
.m-sync.ok { background: var(--ok-s); color: var(--ok); }
.m-sync.wait { background: var(--warn-s); color: var(--warn); }
.m-sync.sim { background: var(--vio-s); color: var(--vio); }
.m-sync.bad { background: var(--bad-s); color: var(--bad); }
.m-sync .m-ico { width: 14px; height: 14px; }

/* Barra inferior en el teléfono */
.m-bnav { display: none; }
.m-burger-b { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }

@media (max-width: 1100px) { .m-layout { grid-template-columns: minmax(0, 1fr); } .m-aside { position: static; } }
@media (max-width: 860px) {
  .m-bnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 38; background: rgb(255 255 255 / 96%); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .m-bnav a, .m-bnav button { display: grid; justify-items: center; gap: 1px; padding: 6px 2px; border-radius: 9px; font: 700 10.5px var(--font); color: var(--soft); min-height: 48px; }
  .m-bnav a span, .m-bnav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .m-bnav a.on { color: var(--brand-ink); background: var(--brand-soft); }
  .m-main { padding-bottom: 64px; }
  .m-toasts { left: 12px; right: 12px; bottom: 76px; }
  .m-burger { display: none; }
  .m-top { gap: 8px; }
  .m-tools .m-btn span { display: none; }
  .m-tools .m-btn { width: 36px; padding: 0; }
  .c-donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .c-donut-wrap .c-legend { width: 100%; }
  .m-head h1 { font-size: 20px; }
  .m-head h1 .m-hico { width: 30px; height: 30px; }
  .m-head .m-actions { width: 100%; }
  .m-head .m-actions .m-btn { flex: 1 1 auto; }
  /* Tablas: en el teléfono cada fila se vuelve una tarjeta */
  .m-table.m-stack thead { display: none; }
  .m-table.m-stack, .m-table.m-stack tbody, .m-table.m-stack tr, .m-table.m-stack td { display: block; width: 100%; }
  .m-table.m-stack tr { border: 1px solid var(--line); border-radius: 11px; padding: 6px 10px; margin-bottom: 8px; background: #fff; }
  .m-table.m-stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .m-table.m-stack td::before { content: attr(data-label); color: var(--mute); font-size: 11.5px; font-weight: 700; text-align: left; flex: none; max-width: 45%; }
  .m-table.m-stack td[data-label=""]::before { display: none; }
  .m-table.m-stack td:first-child { font-weight: 700; }
  .m-scroll:has(> .m-table.m-stack) { overflow: visible; }
  .m-tt input { min-width: 0; flex: 1; }
  .m-modal { max-height: calc(100vh - 16px); }
  .m-modal.l { width: calc(100vw - 12px); }
  .m-gal { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 400px) { .m-gal.big { grid-template-columns: minmax(0, 1fr); } }
@media print { .m-side, .m-top, .m-bnav, .m-foot, .m-demo { display: none !important; } .m-app { display: block; } }
@media (max-width: 860px) { .m-app:not(:has(.m-bnav)) .m-burger { display: grid; place-items: center; } }

/* ===== Componentes de módulos (sesión 5) ===== */
.m-ico-s { width: 14px; height: 14px; vertical-align: -2px; }
.m-muted { color: var(--soft); font-size: 13px; margin: 6px 0; }
.m-crumb { margin: 0 0 4px; color: var(--mute); font-size: 12.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.m-crumb a:hover { color: var(--brand-ink); }
.m-subh { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 14px 0 6px; display: flex; gap: 6px; align-items: center; }
.m-subh .m-ico { width: 14px; height: 14px; }
.m-hint { display: flex; gap: 7px; align-items: center; color: var(--soft); font-size: 12.5px; margin: 0 0 10px; }
.m-hint .m-ico { width: 15px; height: 15px; color: var(--mute); }
.m-ok { color: var(--ok); display: flex; gap: 4px; align-items: center; font-weight: 700; }
.m-copy { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.m-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.m-inline select, .m-inline input { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: 500 13px var(--font); background: #fff; max-width: 100%; min-width: 0; }
.m-check { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.m-check input { accent-color: var(--brand); width: 16px; height: 16px; }
.m-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.m-fs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.m-fs legend { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding: 0 6px; }
.m-more-form { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.m-more-form > summary { cursor: pointer; font: 700 13px var(--font); color: var(--brand-ink); display: flex; gap: 6px; align-items: center; list-style: none; padding: 4px 0; }
.m-more-form > summary::-webkit-details-marker { display: none; }
.m-more-form > summary .m-ico { width: 15px; height: 15px; }
.m-more-form[open] > summary { margin-bottom: 8px; }
.m-filterbox { margin-bottom: 14px; padding: 10px 14px; }
.m-filterbox > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13px; }
.m-filterbox > summary::-webkit-details-marker { display: none; }
.m-filterbox[open] > summary { margin-bottom: 10px; }
.m-filters-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.m-filters-inline .m-f { margin: 0; }
.m-filters-inline select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: #fff; font: 500 13px var(--font); max-width: 100%; }

/* Flujo de producción de contenidos */
.m-flow { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: thin; }
.m-flow a { flex: 1 0 92px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 10px; padding: 7px 9px; display: grid; gap: 1px; transition: transform .15s; }
.m-flow a:hover, .m-flow a.on { transform: translateY(-2px); box-shadow: var(--sh); }
.m-flow b { font-size: 18px; font-weight: 800; line-height: 1.1; }
.m-flow span { font-size: 11.5px; color: var(--soft); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stepper { display: flex; gap: 3px; margin-bottom: 16px; overflow-x: auto; }
.m-stepper span { flex: 1 0 auto; font: 700 11px var(--font); color: var(--mute); padding: 7px 8px 0; border-top: 4px solid var(--line); white-space: nowrap; text-align: center; }
.m-stepper span.done { border-color: color-mix(in srgb, var(--c) 45%, #fff); color: var(--soft); }
.m-stepper span.on { border-color: var(--c); color: var(--ink); }

/* Tarjetas del tablero de contenidos */
.ct-board { grid-auto-columns: minmax(210px, 1fr); }
.ct-tile { display: grid; gap: 5px; }
.ct-img { display: block; margin: -9px -10px 2px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px 9px 0 0; background: #EEF0F4; }
.ct-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-top { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.ct-tile .meta span { display: inline-flex; gap: 3px; align-items: center; }
.m-col h3 span { display: inline-flex; gap: 6px; align-items: center; }

/* Calendarios */
.m-calhead { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.m-calhead h2 { font-size: 16px; font-weight: 800; min-width: 150px; text-align: center; }
.ed-cal .day { min-height: 118px; }
.ce { display: flex; gap: 4px; align-items: center; padding: 2px 4px; border-radius: 6px; border-left: 3px solid var(--c); background: #F6F7FA; margin-bottom: 3px; font-size: 11px; font-weight: 600; min-width: 0; }
.ce:hover { background: var(--brand-soft); }
.ce img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex: none; }
.ce span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.ce .m-dot { width: 7px; height: 7px; }
.ce.more { border-left-color: transparent; color: var(--brand-ink); }

/* Vista previa por plataforma */
.pv-wrap { display: grid; place-items: center; background: var(--bg); border-radius: 12px; padding: 16px 10px; }
.pv { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--sh); font-size: 13px; }
.pv-v { max-width: 290px; }
.pv-h { display: flex; gap: 9px; align-items: center; padding: 10px 12px; }
.pv-h > span:nth-child(2) { flex: 1; min-width: 0; }
.pv-h b { display: block; font-size: 13px; }
.pv-h small { color: var(--mute); font-size: 11.5px; }
.pv-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.pv-media { background: #101218; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; }
.pv-v .pv-media { aspect-ratio: 9 / 16; }
.pv-linkedin .pv-media, .pv-youtube .pv-media, .pv-sitio_web .pv-media, .pv-blog .pv-media { aspect-ratio: 16 / 9; }
.pv-media img, .pv-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-empty { display: grid; justify-items: center; gap: 6px; color: #8A91A0; font-size: 12px; padding: 30px; }
.pv-empty .m-ico { width: 30px; height: 30px; }
.pv-copy { margin: 0; padding: 10px 12px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.pv-cta { margin: 0 12px 12px; background: var(--line-2); border-radius: 8px; padding: 8px; text-align: center; font-weight: 800; font-size: 12.5px; }

/* Vista rápida */
.qv { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); min-height: 380px; }
.qv-media { background: #101218; display: grid; place-items: center; min-height: 320px; position: relative; }
.qv-media img, .qv-media video { max-width: 100%; max-height: 72vh; display: block; }
.qv-media iframe { width: 100%; height: 70vh; border: 0; background: #fff; }
.qv-media .m-empty { color: #A8AEBD; }
.qv-strip { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.qv-strip .m-thumb { width: 54px; aspect-ratio: 1; border-radius: 6px; border: 2px solid #fff; }
.qv-info { padding: 22px 20px; display: grid; gap: 10px; align-content: start; overflow: auto; max-height: calc(100vh - 60px); }
.qv-info h2 { font-size: 19px; font-weight: 800; padding-right: 30px; }
.m-viewer { padding: 0; overflow: hidden; background: #101218; display: grid; place-items: center; min-height: 300px; }
.m-viewer img, .m-viewer video { max-width: 100%; max-height: 70vh; display: block; }
.m-viewer iframe { width: 100%; height: 72vh; border: 0; background: #fff; }
.m-viewer .m-empty { color: #A8AEBD; }

/* Ideas */
.m-ideas { display: grid; gap: 8px; }
.m-idea { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 11px; padding: 11px 13px; flex-wrap: wrap; }
.m-idea.convertida { border-left-color: var(--ok); opacity: .8; }
.m-idea.descartada { border-left-color: var(--line); opacity: .55; }
.m-idea .t { flex: 1 1 260px; min-width: 0; }
.m-idea p { margin: 3px 0 6px; color: var(--soft); font-size: 13px; }
.m-idea .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.m-idea .meta small { color: var(--mute); }

/* Publicaciones y métricas */
.m-pub { border-top: 1px solid var(--line-2); padding: 6px 0; }
.m-pub:first-of-type { border-top: 0; }
.m-metrics { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.m-metrics span { background: var(--bg); border-radius: 8px; padding: 4px 9px; font-size: 11.5px; color: var(--soft); display: grid; }
.m-metrics b { color: var(--ink); font-size: 14px; }
.m-pick .m-gcard { cursor: pointer; }
.m-pick .m-gcard:has(input:checked) { outline: 2px solid var(--brand); }

/* Biblioteca */
.m-asearch { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font: 500 13px var(--font); }
.m-aselect { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: 500 13px var(--font); background: #fff; }
.m-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.m-aside .m-tags a { display: inline-flex; padding: 2px 9px; }
.m-bulkbar { position: sticky; top: 62px; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; box-shadow: var(--sh-l); }
.m-bulkbar select, .m-bulkbar input { height: 30px; border-radius: 7px; border: 0; padding: 0 8px; font: 500 12.5px var(--font); }
.m-sortbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; color: var(--soft); }
.m-sortbar a { margin-left: 8px; font-weight: 700; color: var(--mute); }
.m-sortbar a.on { color: var(--brand-ink); }
.m-pages { margin-top: 12px; }
.m-uploader .two { margin-bottom: 12px; }
.m-uploads .u.ok small { color: var(--ok); }
.m-uploads .u.bad small { color: var(--bad); }

/* Accesos */
.m-acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 18px; }
.m-acc { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--pf); border-radius: 14px; padding: 14px; display: grid; gap: 10px; box-shadow: var(--sh); min-width: 0; }
.m-acc header { display: flex; gap: 10px; align-items: center; }
.m-acc header .t { flex: 1; min-width: 0; }
.m-acc header b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-acc header small { color: var(--soft); font-size: 12px; }
.m-acc-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.m-acc-defs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; font-size: 12.5px; }
.m-acc-defs dt { color: var(--mute); font-size: 11px; font-weight: 700; }
.m-acc-defs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.m-acc footer { display: flex; gap: 6px; flex-wrap: wrap; }
.m-acc footer .m-btn { flex: 1 1 auto; height: 34px; }

/* Configuración */
.m-taxrow { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.m-taxrow.off { opacity: .55; }
.m-taxrow input[name=label] { flex: 1 1 160px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; font: 600 13px var(--font); min-width: 0; }
.m-taxrow input[type=number] { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; }
.m-taxrow input[type=color] { width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.m-taxrow code { font-size: 11px; color: var(--mute); background: var(--line-2); border-radius: 5px; padding: 2px 6px; }
.m-steps-list { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; }
.m-steps-list small { color: var(--mute); margin-left: 4px; }

/* Campañas */
.m-camp .meta { color: var(--soft); font-size: 12.5px; margin-bottom: 10px; }
.m-camp-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.m-camp-links a, .m-camp-links span { background: var(--bg); border-radius: 10px; padding: 8px; display: grid; text-align: center; font-size: 11.5px; color: var(--soft); font-weight: 600; }
.m-camp-links a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.m-camp-links b { font-size: 17px; color: var(--ink); }

/* Inicio: alertas, gráficas y próximas publicaciones */
.m-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.m-alertcard { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 12px; background: var(--warn-s); color: var(--warn); }
.m-alertcard.bad { background: var(--bad-s); color: var(--bad); }
.m-alertcard span { flex: 1; min-width: 0; }
.m-alertcard b { display: block; font-size: 13px; color: var(--ink); }
.m-alertcard small { color: var(--soft); font-size: 12px; }
.m-alertcard:hover { filter: brightness(.97); }
.c-grid { margin-bottom: 14px; align-items: stretch; }
.m-uprow .t b { font-size: 13px; }
.m-upthumb { position: relative; width: 40px; height: 40px; border-radius: 9px; background: #EEF0F4; overflow: hidden; flex: none; display: grid; place-items: center; }
.m-upthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-upthumb .m-pf { position: relative; z-index: 1; box-shadow: 0 0 0 2px #fff; }
.m-upthumb img + .m-pf { position: absolute; right: 1px; bottom: 1px; }

/* Planner: filas de tareas, carga y ficha */
.m-trow { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-top: 1px solid var(--line-2); min-width: 0; }
.m-trow:first-of-type { border-top: 0; }
.m-trow .t { flex: 1; min-width: 0; }
.m-trow .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-trow .t small { color: var(--soft); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-trow.done .t b { color: var(--mute); text-decoration: line-through; }
.m-trow-meta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.m-checkbtn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; transition: .15s; padding: 0; }
.m-checkbtn .m-ico { width: 14px; height: 14px; }
button.m-checkbtn:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-s); }
.m-checkbtn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.m-checkbtn.off { color: var(--mute); border-style: dashed; cursor: default; }
.m-quickmenu { width: 260px; padding: 10px; }
.m-quickmenu form { display: grid; gap: 4px; margin-bottom: 8px; }
.m-quickmenu label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.m-quickmenu .m-inline { margin: 0; flex-wrap: nowrap; }
.m-quickmenu .m-inline select, .m-quickmenu .m-inline input { flex: 1; }
.m-taskgroup { margin-bottom: 12px; }
.m-taskgroup.bad { border-left: 4px solid var(--bad); }
.m-load { display: grid; gap: 10px; align-content: start; }
.m-load-h { display: flex; gap: 10px; align-items: center; }
.m-load-h b { flex: 1; }
.m-load-n { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.m-load-n span { background: var(--bg); border-radius: 9px; padding: 6px; text-align: center; font-size: 11px; color: var(--soft); font-weight: 600; display: grid; }
.m-load-n span.bad { background: var(--bad-s); color: var(--bad); }
.m-load-n b { font-size: 17px; color: var(--ink); }
.tk { display: grid; gap: 10px; }
.tk-title { font-size: 20px; font-weight: 800; padding-right: 30px; }
.tk-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: var(--bg); border-radius: 12px; padding: 10px; }
.tk-actions .m-inline { margin: 0; }
.tk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 22px; }

@media (max-width: 860px) {
  .qv { grid-template-columns: minmax(0, 1fr); }
  .qv-media { min-height: 220px; }
  .qv-info { max-height: none; }
  .tk-grid { grid-template-columns: minmax(0, 1fr); }
  .m-camp-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-acc-grid { grid-template-columns: minmax(0, 1fr); }
  .m-board { grid-auto-columns: minmax(78vw, 1fr); scroll-snap-type: x mandatory; }
  .m-col { scroll-snap-align: start; }
  .ed-cal .day, .m-cal .day { min-height: 64px; padding: 3px; }
  .ce span, .m-cal .m-ev { font-size: 0; }
  .ce { padding: 2px; justify-content: center; }
  .ce .m-dot { display: none; }
  .m-cal .m-ev { height: 6px; padding: 0; border-left-width: 6px; }
  .m-trow { flex-wrap: wrap; }
  .m-trow .t { flex-basis: calc(100% - 80px); }
  .m-trow-meta { width: 100%; justify-content: flex-start; padding-left: 36px; }
  .m-bulkbar { top: 108px; }
  .m-load-n { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Correcciones de desborde en el teléfono (verificación en navegador, sesión 5) */
.m-sr { left: 0; top: 0; max-width: 1px; max-height: 1px; }
table.m-sr { display: block; }
.m-pf, .m-tile, .m-gcard, .c-card, .m-col, .m-trow { position: relative; }
.m-acc { grid-template-columns: minmax(0, 1fr); }
.m-acc > * { min-width: 0; }
.m-acc .m-badge { white-space: normal; }
@media (max-width: 860px) { .m-card-h { flex-wrap: wrap; } .m-card-h > span { min-width: 0 !important; max-width: 100%; } }

/* Pulido visual tras revisar capturas (sesión 5) */
.m-card-h { justify-content: flex-start; }
.m-card-h > .m-ico:first-child { color: var(--brand-ink); }
.m-card-h > :is(a, span, button, form, nav, small, .m-actions):last-child:not(:first-child) { margin-left: auto; }
.c-card { container-type: inline-size; }
@container (max-width: 430px) {
  .c-donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .c-donut-wrap .c-legend { width: 100%; }
}

/* ===== Asistente (sesión 6) ===== */
.ai-robot { color: var(--brand); flex: none; }
.ai-robot .ai-antenna { animation: ai-blink 3.2s infinite; }
@keyframes ai-blink { 0%, 90%, 100% { opacity: 1; } 95% { opacity: .35; } }
.ai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 60px; height: 60px; border-radius: 20px; border: 0; background: #fff; box-shadow: var(--sh-l); display: grid; place-items: center; cursor: pointer; transition: transform .18s var(--ease); }
.ai-fab:hover { transform: translateY(-3px) rotate(-3deg); }
.ai-fab-robot { width: 44px; height: 44px; }
.ai-fab-dot { position: absolute; right: 6px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); border: 2px solid #fff; }
.ai-fab-dot.ok { background: var(--ok); }
.ai-panel { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: min(440px, calc(100vw - 24px)); height: min(680px, calc(100vh - 40px)); background: #fff; border-radius: 18px; box-shadow: 0 24px 64px rgb(20 24 40 / 28%); overflow: hidden; display: flex; animation: m-in .2s var(--ease); }
.ai-panel .ai-chat { flex: 1; }
.ai-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fff; }
.ai-chat.page { height: calc(100vh - 220px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.ai-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--brand-soft), #fff); }
.ai-head .t { flex: 1; min-width: 0; }
.ai-head b { display: block; font-size: 14px; }
.ai-logo { width: 34px; height: 34px; }
.ai-status { font-size: 11.5px; color: var(--warn); font-weight: 700; }
.ai-status.ok { color: var(--ok); }
.ai-history { border-bottom: 1px solid var(--line); max-height: 45%; overflow: auto; padding: 6px; background: var(--bg); }
.ai-history a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; font-size: 13px; }
.ai-history a:hover { background: #fff; }
.ai-history small { color: var(--mute); white-space: nowrap; }
.ai-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.ai-welcome { text-align: center; padding: 10px 6px; display: grid; justify-items: center; gap: 6px; }
.ai-welcome h3 { font-size: 17px; font-weight: 800; }
.ai-welcome p { color: var(--soft); font-size: 13px; margin: 0; max-width: 34em; }
.ai-hero { width: 76px; height: 76px; animation: ai-float 3s ease-in-out infinite; }
@keyframes ai-float { 50% { transform: translateY(-4px); } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.ai-chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 11px; font: 600 12.5px var(--font); color: var(--ink); cursor: pointer; transition: .15s; }
.ai-chip:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.ai-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.ai-msg.me { justify-content: flex-end; }
.ai-msg.me .ai-bubble { background: var(--brand); color: #fff; border-radius: 16px 16px 4px 16px; max-width: 85%; }
.ai-msg.bot .ai-bubble { background: var(--bg); border-radius: 16px 16px 16px 4px; max-width: calc(100% - 40px); }
.ai-avatar { width: 30px; height: 30px; }
.ai-bubble { padding: 9px 12px; font-size: 13.5px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.ai-att { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; opacity: .85; margin-left: 6px; }
.ai-md p { margin: 0 0 6px; } .ai-md p:last-child { margin: 0; }
.ai-md ul, .ai-md ol { margin: 4px 0 6px; padding-left: 18px; }
.ai-md table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.ai-md th, .ai-md td { border: 1px solid var(--line); padding: 3px 6px; }
.ai-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 11px; color: var(--mute); }
.ai-speak { background: none; border: 0; cursor: pointer; color: var(--mute); padding: 2px; }
.ai-speak:hover { color: var(--brand); }
.ai-msg.tool { flex-direction: column; align-items: stretch; padding-left: 38px; }
.ai-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-step { display: inline-flex; gap: 4px; align-items: center; font: 700 11px var(--font); color: var(--ok); background: var(--ok-s); border-radius: 99px; padding: 2px 8px; }
.ai-step.bad { color: var(--bad); background: var(--bad-s); }
.ai-msg.notice { flex-direction: column; align-items: stretch; }
.ai-msg.notice .ai-bubble { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-s); color: #6b4300; border-radius: 12px; }
.ai-msg.notice.bad .ai-bubble { background: var(--bad-s); color: var(--bad); }
.ai-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; min-width: 0; }
.ai-card-t { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 6px; }
.ai-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.ai-kpis span { background: var(--bg); border-radius: 9px; padding: 6px 8px; display: grid; }
.ai-kpis small { color: var(--mute); font-size: 11px; font-weight: 700; }
.ai-kpis b { font-size: 14px; }
.ai-card .c-donut-wrap { grid-template-columns: 110px minmax(0, 1fr); }
.ai-card .c-donut-box { width: 110px; height: 110px; }
.ai-table { font-size: 12px; } .ai-table td, .ai-table th { padding: 5px 6px; }
.ai-contents { display: grid; gap: 4px; }
.ai-contents a { display: flex; gap: 8px; align-items: center; padding: 5px; border-radius: 8px; }
.ai-contents a:hover { background: var(--bg); }
.ai-contents .t { flex: 1; min-width: 0; } .ai-contents .t b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ai-contents .t small { color: var(--soft); font-size: 11.5px; }
.ai-thumb { position: relative; width: 42px; height: 42px; border-radius: 8px; background: #EEF0F4; overflow: hidden; display: grid; place-items: center; flex: none; }
.ai-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ai-thumb .m-pf { position: absolute; right: 1px; bottom: 1px; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 6px; font-size: 11.5px; }
.ai-sources a { color: var(--brand-ink); font-weight: 700; }
.ai-action { border-left: 4px solid var(--brand); }
.ai-action.lvl4 { border-left-color: var(--warn); }
.ai-action ul { margin: 0 0 8px; padding-left: 18px; font-size: 12.5px; }
.ai-action-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ai-typing { display: flex; gap: 6px; align-items: center; padding: 0 14px 6px; font-size: 12px; color: var(--soft); }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: ai-dot 1s infinite; }
.ai-typing i:nth-child(4) { animation-delay: .15s; } .ai-typing i:nth-child(5) { animation-delay: .3s; }
@keyframes ai-dot { 50% { opacity: .2; transform: translateY(-2px); } }
.ai-composer { border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); display: grid; gap: 6px; background: #fff; }
.ai-composer textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; font: 500 14px var(--font); max-height: 160px; min-height: 42px; }
.ai-composer textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.ai-tools { display: flex; gap: 4px; align-items: center; }
.ai-tools label.m-more { cursor: pointer; }
.ai-tts { display: inline-flex; gap: 3px; align-items: center; font-size: 11px; color: var(--mute); margin-left: 4px; cursor: pointer; }
.ai-send { margin-left: auto; width: 42px; padding: 0; border-radius: 12px; }
.ai-mic-on { color: var(--bad) !important; background: var(--bad-s) !important; }
.ai-attachments { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-attachments span { display: inline-flex; gap: 4px; align-items: center; background: var(--bg); border-radius: 99px; padding: 2px 8px; font-size: 11.5px; }
.ai-recorder { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bad-s); border-radius: 10px; padding: 6px 8px; font-size: 12px; }
.ai-recorder audio { height: 32px; max-width: 100%; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: ai-blink 1s infinite; }
.ai-page { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.ai-convs { display: grid; gap: 4px; max-height: calc(100vh - 220px); overflow: auto; }
.ai-conv { display: grid; padding: 7px 9px; border-radius: 8px; font-size: 13px; }
.ai-conv b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-conv small { color: var(--mute); }
.ai-conv:hover, .ai-conv.on { background: var(--brand-soft); }
.ai-h1 { width: 40px; height: 40px; }
.ai-log { border-top: 1px solid var(--line-2); padding: 8px 0; }
.ai-log summary { display: flex; gap: 10px; align-items: center; cursor: pointer; list-style: none; flex-wrap: wrap; }
.ai-log summary .t { flex: 1; min-width: 200px; } .ai-log summary b { display: block; } .ai-log summary small { color: var(--soft); }
.ai-json { background: var(--bg); border-radius: 8px; padding: 8px; font-size: 11.5px; overflow: auto; max-height: 220px; white-space: pre-wrap; }

/* ===== Presupuesto visual (sesión 6) ===== */
.bd-states { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bd-state { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--sh); transition: transform .15s; }
a.bd-state:hover { transform: translateY(-2px); border-color: var(--brand); }
.bd-state .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--line-2); color: var(--soft); flex: none; }
.bd-state.info .ic { background: var(--info-s); color: var(--info); } .bd-state.ok .ic { background: var(--ok-s); color: var(--ok); } .bd-state.bad .ic { background: var(--bad-s); color: var(--bad); }
.bd-state small { display: block; color: var(--soft); font-size: 12px; font-weight: 700; }
.bd-state b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.bd-state em { display: block; font-style: normal; color: var(--mute); font-size: 11px; }
.bd-periods { margin-top: 4px; }
.bd-cats, .bd-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bd-cat, .bd-org { display: grid; gap: 6px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; padding: 12px; box-shadow: var(--sh); transition: transform .15s; min-width: 0; }
.bd-cat:hover, .bd-org:hover { transform: translateY(-2px); box-shadow: var(--sh-l); }
.bd-cat .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.bd-num { font-weight: 800; font-size: 16px; } .bd-num small { color: var(--mute); font-weight: 600; font-size: 12px; }
.bd-cat > small, .bd-org > small { color: var(--soft); font-size: 12px; display: flex; gap: 4px; align-items: center; }
.bd-cat > small.bad, .bd-org > small.bad, .bad { color: var(--bad); font-weight: 700; }
.bd-org { grid-template-columns: 44px minmax(0, 1fr); align-items: center; }
.bd-org .logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); overflow: hidden; }
.bd-org .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bd-org .t b { display: block; } .bd-org .t small { color: var(--soft); font-size: 12px; }
.bd-org .bd-num, .bd-org .m-bar, .bd-org > small { grid-column: 1 / -1; }
.bd-logo { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); overflow: hidden; flex: none; vertical-align: middle; margin-right: 6px; }
.bd-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bd-logo.s { width: 28px; height: 28px; border-radius: 8px; }
.bd-over { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line-2); }
.bd-over span { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; align-items: center; color: var(--bad); }
.bd-over b { color: var(--ink); } .bd-over small { grid-column: 2; color: var(--soft); }
.c-compare { display: grid; gap: 4px; }
.c-crow { display: grid; grid-template-columns: minmax(80px, 32%) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; font-size: 12.5px; }
a.c-crow:hover { background: var(--bg); }
.c-cl { display: flex; gap: 5px; align-items: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-ct { position: relative; height: 16px; }
.c-ct i { position: absolute; left: 0; border-radius: 0 4px 4px 0; display: block; }
.c-ct i.b { top: 0; height: 16px; background: #D9DCE3; }
.c-ct i.s { top: 4px; height: 8px; }
.c-cv { display: grid; text-align: right; line-height: 1.2; min-width: 70px; }
.c-cv small { color: var(--mute); font-size: 11px; }
.c-crow.over .c-cv small { color: var(--bad); font-weight: 700; }
.c-warn { color: var(--bad); width: 14px; height: 14px; }
.m-note-ok { background: var(--ok-s); color: var(--ok); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin: 0 0 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Factura: «Encontré esta información» */
.inv-suggest { border: 2px solid var(--brand); margin-bottom: 14px; }
.inv-suggest.low { border-color: var(--warn); }
.inv-suggest-h { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.inv-suggest-h > div { flex: 1; } .inv-suggest-h h2 { font-size: 16px; font-weight: 800; } .inv-suggest-h p { margin: 2px 0 0; color: var(--soft); font-size: 13px; }
.inv-conf { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; border: 5px solid var(--ok); text-align: center; flex: none; }
.inv-conf b { font-size: 17px; line-height: 1; } .inv-conf small { font-size: 10px; color: var(--mute); }
.inv-conf.mid { border-color: var(--info); } .inv-conf.lo { border-color: var(--warn); }
.inv-reasons { margin: 8px 0; padding-left: 18px; font-size: 12.5px; color: var(--soft); display: grid; gap: 2px; }

@media (max-width: 860px) {
  .ai-fab { bottom: 76px; right: 12px; width: 54px; height: 54px; }
  .ai-panel { inset: 0 0 64px 0; width: auto; height: auto; border-radius: 0; }
  .ai-page { grid-template-columns: minmax(0, 1fr); }
  .ai-convs { max-height: 180px; }
  .ai-chat.page { height: calc(100vh - 250px); }
  .ai-msg.tool { padding-left: 0; }
  .inv-suggest-h { flex-wrap: wrap; }
}
@media print { .ai-fab, .ai-panel { display: none !important; } }

/* Mapa: estados reales por función (sesión 7) */
.map-states { display: flex; flex-wrap: wrap; gap: 6px; }
.map-fn { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.map-fn li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12.5px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.m-map-state.info { background: var(--info-s); color: var(--info); } .m-map-state.bad { background: var(--bad-s); color: var(--bad); } .m-map-state.muted { background: var(--line-2); color: var(--mute); }

/* Centro de Mejoras (sesión 7) */
.imp-row { display: flex; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line-2); }
.imp-row:first-child { border-top: 0; }
.imp-row .t { flex: 1; min-width: 0; } .imp-row .t > b { display: block; }
.imp-row .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; } .imp-row .meta small { color: var(--mute); }
.imp-row p { margin: 6px 0 0; color: var(--soft); font-size: 13px; }
.imp-answer { background: var(--brand-soft); color: var(--brand-ink) !important; border-radius: 8px; padding: 6px 9px; }
.imp-vote { display: grid; justify-items: center; width: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--soft); }
.imp-vote.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.imp-up { transform: rotate(-90deg); }
.imp-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.imp-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--sh); }
.imp-card .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; }
.imp-card .t { display: grid; gap: 2px; } .imp-card .t small { color: var(--soft); font-size: 12px; display: flex; gap: 4px; align-items: center; }
.imp-side { display: grid; gap: 3px; justify-items: end; text-align: right; } .imp-side small { color: var(--mute); font-size: 11.5px; }
.imp-card em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--warn); }
@media (max-width: 860px) { .imp-card { grid-template-columns: 40px minmax(0, 1fr); } .imp-side { grid-column: 1 / -1; justify-items: start; text-align: left; } }

/* Documentos institucionales */
.m-back { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); font-size: 13px; text-decoration: none; margin-bottom: 4px; }
.m-back:hover { color: var(--brand); }
.m-flip { transform: scaleX(-1); }
.m-dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 14px; margin: 0; padding: 4px 16px 12px; }
.m-dl dt { color: var(--mute); font-size: 13px; }
.m-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.doc-q { flex: 1 1 260px; }
.doc-q input { width: 100%; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 14px; }
.doc-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; }
.doc-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(20, 24, 40, .06); }
.doc-card .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.doc-card b { overflow-wrap: anywhere; }
.doc-card small { color: var(--soft); }
.doc-card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.doc-ic.c-certificado { background: var(--ok-s); color: var(--ok); }
.doc-ic.c-ficha_tecnica { background: var(--info-s); color: var(--info); }
.doc-ic.c-catalogo { background: var(--warn-s); color: var(--warn); }
.doc-ic.c-contrato { background: var(--bad-s); color: var(--bad); }
.doc-tags { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.doc-tags i { font-style: normal; font-size: 12px; color: var(--info); }
.doc-tags a { text-decoration: none; }
.doc-desc { margin: 0; padding: 0 16px 14px; color: var(--soft); white-space: pre-line; }
/* Centro ejecutivo de Dirección */
.ex-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.ex-attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ex-attn-i { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; text-decoration: none; font-weight: 600; background: var(--info-s); color: var(--info); }
.ex-attn-i span { flex: 1; min-width: 0; }
.ex-attn-i.warn { background: var(--warn-s); color: var(--warn); }
.ex-attn-i.bad { background: var(--bad-s); color: var(--bad); }
.ex-bar { width: 90px; flex: none; }
.ex-bar .m-bar { display: block; }
.ex-more { display: inline-flex; padding: 10px 16px; }
.ex-day h3 { margin: 0; padding: 10px 16px 4px; font-size: 13px; color: var(--mute); text-transform: none; }
.ex-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ex-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ex-gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ex-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line-2); }
.ex-gallery figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-gallery b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-gallery small { color: var(--soft); font-size: 12px; }
@media (max-width: 640px) { .ex-bar { width: 56px; } }
.ex-company { margin: 0; min-width: 220px; }
.ex-company select { width: 100%; }
@media (max-width: 640px) { .ex-company { min-width: 0; width: 100%; } }

/* Etiquetas sugeridas en la biblioteca */
.lib-suggest { border-top: 1px solid var(--line); margin-top: 14px; padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 10px; }
.lib-suggest-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chips form { margin: 0; }
.lib-chip { cursor: pointer; border: 1px dashed var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.lib-chip:hover { border-style: solid; }
.lib-suggest .m-actions form { margin: 0; }
.lib-suggest { padding: 12px 0 4px; }

/* Ficha de campaña */
.cp-name { color: inherit; text-decoration: none; }
.cp-name:hover { color: var(--brand); text-decoration: underline; }
.cp-objective { margin: -6px 0 14px; color: var(--soft); display: flex; gap: 6px; align-items: center; }
.cp-time { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; }
.cp-time .m-bar { flex: 1; display: block; }
.cp-time small { color: var(--mute); white-space: nowrap; }
.cp-flow { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.cp-flow .m-chip { border: 1px solid; }
.cp-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; padding: 0 16px 14px; }
.cp-media img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--line-2); }
.cp-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Formularios oficiales de solicitudes (teléfono primero) */
.of-form { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.of-q { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.of-q[hidden] { display: none; }
.of-q.has-error { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-s); }
.of-l { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.of-l .req { color: var(--bad); }
.of-n { flex: none; min-width: 22px; height: 22px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; display: inline-grid; place-items: center; }
.of-help { margin: 0; color: var(--mute); font-size: 13px; }
.of-err { margin: 0; color: var(--bad); font-size: 13px; font-weight: 600; }
.of-warn { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-s); color: var(--warn); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.of-q input:not([type=radio]):not([type=checkbox]), .of-q textarea, .of-q select { width: 100%; font-size: 16px; }
.of-readonly { background: var(--line-2); color: var(--soft); }
.of-opts { display: flex; flex-direction: column; gap: 6px; }
.of-opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 44px; }
.of-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.of-opt input[type=radio], .of-opt input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.of-otro input:not([type=radio]) { flex: 1; min-width: 0; }
.of-client { position: relative; }
.of-sug { position: absolute; z-index: 20; left: 0; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 24, 40, .12); max-height: 280px; overflow: auto; }
.of-sug-i { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.of-sug-i:hover, .of-sug-i:focus { background: var(--brand-soft); }
.of-sug-i small { color: var(--mute); }
.of-items { display: flex; flex-direction: column; gap: 8px; }
.of-item { display: grid; grid-template-columns: 1.3fr 1fr .7fr 1.4fr auto; gap: 6px; align-items: center; }
.of-item [data-item-otro][hidden] { display: none; }
.of-submit { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding-bottom: 80px; }
.of-send { justify-content: center; min-height: 48px; font-size: 16px; }
.of-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.of-steps b { display: flex; gap: 6px; align-items: center; }
.of-done { max-width: 620px; margin: 10px auto; padding: 28px 22px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.of-done h1 { margin: 0; }
.of-done-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-s); color: var(--ok); }
.of-done-ic svg { width: 34px; height: 34px; }
.of-folio { font-size: 18px; margin: 0; }
.of-folio b { font-size: 22px; letter-spacing: .5px; }
.of-done-dl { text-align: left; width: 100%; }
.of-done-actions { justify-content: center; flex-wrap: wrap; }
.of-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.of-quick-i { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 14px; background: var(--brand); color: #fff; text-decoration: none; }
.of-quick-i i { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; }
.of-quick-i span { display: flex; flex-direction: column; gap: 2px; }
.of-quick-i small { opacity: .85; }
.of-items-t { margin: 8px 0; }
.sf-body { display: flex; gap: 16px; padding: 0 16px 16px; align-items: flex-start; flex-wrap: wrap; }
.sf-qr { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.sf-links { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.sf-links input { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .of-item { grid-template-columns: 1fr 1fr; }
  .of-item [data-item-remove] { justify-self: end; }
  .of-q { padding: 14px 12px; }
}
/* Primeros pasos */
/* Asistente de bienvenida y configuración: ventana amplia en escritorio, pantalla completa en teléfono, sin desplazamiento horizontal. */
.ob-modal { width: min(940px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); max-height: none; overflow: hidden; }
.ob-modal > div[data-help-body] { padding: 0; height: 100%; }
.ob-modal .m-modal-x { top: 14px; right: 14px; }
.obw { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100%; min-width: 0; }
.obw-loading, .obw-msg { padding: 32px; color: var(--soft); }
.obw-rail { background: var(--bg); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.obw-rail-t { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); padding: 0 8px; }
.obw-rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.obw-rail button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 9px; background: none; font: 600 13px/1.3 var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.obw-rail button:hover { background: #fff; }
.obw-rail button.on { background: #fff; box-shadow: var(--sh); color: var(--brand); }
.obw-rail i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 11.5px var(--font); font-style: normal; background: #fff; border: 1px solid var(--line); color: var(--soft); }
.obw-rail i .m-ico { width: 14px; height: 14px; }
.obw-rail .st-hecho i { background: var(--ok); border-color: var(--ok); color: #fff; }
.obw-rail .st-omitido span { color: var(--soft); text-decoration: line-through; }
.obw-rail button.on i { border-color: var(--brand); color: var(--brand); }
.obw-rail-n { margin-top: auto; padding: 0 8px; color: var(--soft); }
.obw-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 22px 28px 18px; }
.obw-progress { display: flex; align-items: center; gap: 12px; padding-right: 44px; color: var(--soft); font-size: 12.5px; font-weight: 600; }
.obw-progress .m-bar { flex: 1; display: block; }
.obw-step { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 2px 8px; }
.obw-step h2 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; outline: none; }
.obw-lead { color: var(--soft); font-size: 14.5px; margin: 6px 0 16px; max-width: 62ch; }
.obw-h { display: flex; gap: 14px; align-items: center; }
.obw-h .m-badge { margin-top: 2px; }
.obw-ic, .obw-logo { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.obw-ic .m-ico, .obw-logo .m-ico { width: 24px; height: 24px; }
.obw-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 6px; }
.obw-hero h2 { font-size: 26px; margin-top: 10px; }
.obw-feats { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; width: 100%; }
.obw-feats li { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 13px; min-width: 0; }
.obw-feats li .m-ico { color: var(--brand); flex: none; }
.obw-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.obw-note { display: flex; gap: 8px; align-items: flex-start; color: var(--soft); font-size: 13px; margin-top: 14px; }
.obw-note .m-ico { flex: none; margin-top: 2px; }
.obw-note > span { flex: 1; min-width: 0; }
.obw h2[tabindex='-1']:focus, .obw h2[tabindex='-1']:focus-visible { outline: none; box-shadow: none; }
.obw-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.obw-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s, transform .15s; }
.obw-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.obw-card .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.obw-card small { color: var(--soft); }
.obw-card-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); color: var(--brand); }
.obw-go { flex: none; color: var(--soft); }
.obw-done { margin-top: 14px; }
.obw-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.obw-spacer { flex: 1; }
.ob-resume { position: fixed; left: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; box-shadow: var(--sh-l); font: 700 13px var(--font); color: var(--brand); cursor: pointer; max-width: calc(100vw - 110px); }
@media (max-width: 760px) {
  .ob-modal { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border-radius: 0; }
  .obw { grid-template-columns: minmax(0, 1fr); }
  .obw-rail { display: none; }
  .obw-main { padding: 16px 16px 14px; }
  .obw-hero h2 { font-size: 22px; }
  .obw-feats { grid-template-columns: minmax(0, 1fr); }
  .obw-actions { grid-template-columns: minmax(0, 1fr); }
  .obw-nav .m-btn { flex: 1 1 auto; }
  .obw-spacer { display: none; }
  .ob-resume { left: 12px; bottom: 12px; font-size: 12px; }
}
/* MKT MANAGER: demostración y marca */
.m-demo-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: #ED8300; color: #fff; font: 800 11px var(--font); letter-spacing: .14em; }
.m-demo-switch { white-space: nowrap; }
.obw-brand { display: block; font: 800 11.5px var(--font); letter-spacing: .16em; color: var(--brand); margin: 2px 0 4px; }
@media (max-width: 760px) { .m-demo-switch span { display: none; } .m-demo-switch { padding: 0 10px; } }
/* ===== Blocky: personaje, estados y llamada ===== */
.blocky { overflow: visible; }
.blocky .blocky-senal, .blocky .blocky-boca, .blocky .blocky-boca-o { opacity: 0; transition: opacity .2s; }
.blocky .blocky-parpado { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); animation: blocky-parpadeo 4.2s infinite; }
.blocky .blocky-cuerpo { transform-box: fill-box; transform-origin: center bottom; }
.ai-fab .blocky-busto, .ai-logo.blocky-busto { width: 44px; height: 41px; }
.ai-logo.blocky-busto { width: 36px; height: 34px; }
.ai-hero.blocky-full { width: 96px; height: 117px; }
.ai-fab { width: auto; min-width: 60px; padding: 0 12px 0 8px; gap: 6px; grid-auto-flow: column; }
.ai-fab-label { font: 800 13px var(--font); color: var(--ink); }
.ai-call-btn { gap: 5px; }
[data-blocky-state="escuchando"] .blocky .senal-ondas, [data-state="escuchando"] .blocky .senal-ondas { opacity: 1; animation: blocky-pulso 1.1s infinite; }
[data-blocky-state="pensando"] .blocky .senal-puntos, [data-blocky-state="consultando"] .blocky .senal-puntos { opacity: 1; animation: blocky-pulso .9s infinite; }
[data-blocky-state="pensando"] .blocky .blocky-boca-o, [data-blocky-state="consultando"] .blocky .blocky-boca-o { opacity: 1; }
[data-blocky-state="pensando"] .blocky .blocky-sonrisa, [data-blocky-state="consultando"] .blocky .blocky-sonrisa { opacity: 0; }
[data-blocky-state="consultando"] .blocky .blocky-pupilas { animation: blocky-mirar 1.2s ease-in-out infinite; transform-box: fill-box; }
[data-blocky-state="hablando"] .blocky .blocky-boca { opacity: 1; transform-box: fill-box; transform-origin: center top; transform: scaleY(var(--boca, .6)); }
[data-blocky-state="hablando"] .blocky .blocky-sonrisa { opacity: 0; }
[data-blocky-state="hablando"] .blocky .blocky-cuerpo { animation: blocky-rebote .5s ease-in-out infinite; }
[data-blocky-state="confirmando"] .blocky .senal-brillos { opacity: 1; animation: blocky-pulso 1.4s infinite; }
[data-blocky-state="error"] .blocky .senal-alerta { opacity: 1; }
.ai-chat[data-blocky-state="error"] .ai-status { color: var(--bad); }
.ai-chat[data-blocky-state="confirmando"] .ai-status { color: var(--warn); }
.ai-list { margin: 6px 0 0 18px; display: grid; gap: 4px; font-size: 13px; }
.blocky-call { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: linear-gradient(180deg, #12141D, #1C1F2B); color: #fff; flex: 1; min-height: 0; overflow: auto; }
.ai-chat.in-call .ai-body, .ai-chat.in-call .ai-typing { display: none; }
.blocky-call-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px; }
.blocky-call-avatar.blocky-full { width: 150px; height: 183px; filter: drop-shadow(0 14px 30px rgb(0 0 0 / 35%)); }
.blocky-call-state { font: 800 15px var(--font); letter-spacing: .04em; text-transform: uppercase; color: #FDD20B; }
.blocky-call-ctx { color: #A8AEBD; font-size: 12px; text-align: center; }
.blocky-call-log { flex: 1; min-height: 70px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.blocky-call-log p { margin: 0; padding: 7px 10px; border-radius: 10px; max-width: 88%; line-height: 1.4; }
.blocky-call-log p.me { align-self: flex-end; background: rgb(255 255 255 / 12%); }
.blocky-call-log p.bot { align-self: flex-start; background: rgb(253 210 11 / 16%); }
.blocky-call-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.blocky-call-bar .m-btn.bad { background: var(--bad); color: #fff; }
.blocky-diag { font-size: 12px; color: #C9CEDB; }
.blocky-diag summary { cursor: pointer; }
.blocky-diag ol { margin: 6px 0 0 16px; display: grid; gap: 2px; }
.blocky-diag li.ok { color: #7DDBA9; } .blocky-diag li.bad { color: #FF9C9C; }
.blocky-brief { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 16px; background: linear-gradient(120deg, var(--brand-soft), #fff 70%); border: 1px solid var(--line); }
.blocky-brief .blocky-busto { width: 64px; height: 60px; flex: none; }
.blocky-brief .t { flex: 1; min-width: 0; }
.blocky-brief .t b { display: block; font-size: 15px; }
.blocky-brief .t small { display: block; color: var(--soft); margin-top: 3px; }
.blocky-brief .acts { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes blocky-parpadeo { 0%, 92%, 100% { transform: scaleY(0); } 95% { transform: scaleY(1); } }
@keyframes blocky-pulso { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes blocky-mirar { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes blocky-rebote { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (max-width: 760px) { .ai-fab-label { display: none; } .ai-fab { min-width: 54px; padding: 0; } .blocky-brief { flex-wrap: wrap; } .blocky-brief .acts { width: 100%; } .blocky-call-avatar.blocky-full { width: 120px; height: 146px; } }
@media (prefers-reduced-motion: reduce) { .blocky *, .blocky { animation: none !important; } }
/* ===== Comentarios internos ===== */
.cm-btn { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 0; background: transparent; color: var(--mute); cursor: pointer; vertical-align: middle; }
.cm-btn:hover, .cm-btn:focus-visible { background: var(--line-2); color: var(--ink); }
.cm-btn svg { width: 16px; height: 16px; }
.cm-btn.has { color: var(--brand); }
.cm-btn b { position: absolute; top: -3px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 9.5px; line-height: 15px; }
.cm-modal { width: min(520px, calc(100vw - 24px)); }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-head h2 { font-size: 17px; margin: 0; }
.cm-list { display: grid; gap: 10px; margin-top: 10px; max-height: min(60vh, 520px); overflow: auto; }
.cm-hint { font-size: 12px; margin: 0; }
.cm-item { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: grid; gap: 4px; }
.cm-item header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.cm-item header small { color: var(--mute); }
.cm-body { margin: 0; white-space: pre-wrap; font-size: 13.5px; }
.cm-rev { font-size: 12px; color: var(--soft); }
.cm-edit { width: 100%; font: inherit; }
@media (max-width: 760px) { .cm-modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; } .cm-btn { width: 32px; height: 32px; } }
.bd-cat-wrap { position: relative; display: grid; }
.bd-cat-wrap > .cm-btn { position: absolute; top: 8px; right: 8px; z-index: 1; background: rgb(255 255 255 / 85%); }

.fiscal-form { display: grid; gap: 10px; }
.fiscal-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; display: grid; gap: 6px; }
.fiscal-row legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.fiscal-detected { display: grid; gap: 2px; font-size: 12.5px; }

/* ===== Redes sociales ===== */
.so-widget { display: grid; gap: 10px; }
.so-w-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.so-w-head > b { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; margin-right: auto; }
.so-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.so-filters select { height: 30px; font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: #fff; }
.so-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.so-track > div { scroll-snap-align: start; }
.so-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.so-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-rows: 120px auto; width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.so-card:hover, .so-card:focus-visible { border-color: var(--brand); box-shadow: var(--sh); }
.so-thumb { position: relative; display: grid; place-items: center; background: var(--line-2); color: var(--mute); overflow: hidden; }
.so-thumb img { width: 100%; height: 100%; object-fit: cover; }
.so-pf { position: absolute; left: 8px; top: 8px; width: 26px; height: 26px; border-radius: 8px; background: #fff; display: grid; place-items: center; color: var(--ink); }
.so-pf svg { width: 15px; height: 15px; }
.so-body { display: grid; gap: 4px; padding: 9px 10px 10px; font-size: 12.5px; min-width: 0; }
.so-body small { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-body b { font-weight: 600; line-height: 1.35; }
.so-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--soft); font-size: 11.5px; }
.so-empty { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.so-empty p { width: 100%; margin: 4px 0 0; font-size: 13px; }
.so-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--line-2); }
.so-st.conectada { background: var(--ok-s); color: var(--ok); } .so-st.vencida { background: var(--warn-s); color: var(--warn); }
.so-st svg { width: 14px; height: 14px; }
.so-detail { display: grid; gap: 10px; }
.so-detail-img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; background: var(--line-2); }
@media (max-width: 760px) { .so-track { grid-auto-columns: 78%; } }