/* MOTIVA CRM · identidad Motiva FM: rosa #ff007a, negro y blanco. */
:root {
  --pink: #ff007a; --pink-dark: #d10064; --pink-soft: #ffe3f0;
  --ink: #120b14; --ink-2: #2a2230; --muted: #6f6675; --line: #e9e4ec; --bg: #f7f5f8; --white: #fff;
  --ok: #0f8a5f; --ok-soft: #e1f5ec; --warn: #a15c00; --warn-soft: #fff1d6; --bad: #c4183c; --bad-soft: #fde4e9;
  --info: #3c4fd1; --info-soft: #e6e9ff; --radius: 10px;
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; color: var(--ink); font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--pink-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: 0 0 .6rem; font-weight: 900; letter-spacing: -.02em; }
h1 small { font-size: .9rem; color: var(--muted); font-weight: 400; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; font-weight: 800; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
.muted { color: var(--muted); }
.bad-text { color: var(--bad); }
small { font-size: .82rem; }

/* estructura */
body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #f780b8; color: var(--ink); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin-bottom: 22px; text-decoration: none !important; }
.brand img { width: 118px; height: auto; display: block; }
.brand span { font-weight: 900; letter-spacing: .14em; font-size: .95rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { color: var(--ink); padding: 9px 12px; border-radius: 8px; font-weight: 600; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .35); text-decoration: none; }
.sidebar nav a.on { background: var(--ink); color: #fff; }
.nav-title { text-transform: uppercase; font-size: .7rem; letter-spacing: .12em; color: #4a1f38; margin: 18px 12px 6px; }
.me { border-top: 1px solid rgba(18, 11, 20, .2); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.me a { color: var(--ink); display: flex; flex-direction: column; text-decoration: none; }
.me small { color: #4a1f38; }
.content { padding: 28px 34px 60px; max-width: 1280px; width: 100%; }

/* componentes */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .3rem; }
.actions, .inline-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.warn-card { border-color: var(--warn); background: var(--warn-soft); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; align-items: start; }
.span2 { grid-column: span 2; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: .92rem; text-decoration: none !important; font-family: inherit; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.primary:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; }
.btn.small { padding: 5px 12px; font-size: .84rem; }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; color: #9b8fa3; cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: #fff; }
.sidebar button.link { color: #4a1f38; }
.sidebar button.link:hover { color: var(--ink); text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; border: 0; padding: 0; }
.field > span { font-weight: 700; font-size: .86rem; }
.field em { color: var(--pink); font-style: normal; }
.field small { color: var(--muted); }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfc7d4; border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 0; border-color: var(--pink); }
textarea { width: 100%; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: .9rem; white-space: nowrap; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.inline-form .grow { flex: 1; min-width: 220px; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { min-width: 300px; flex: 1; }

.table { width: 100%; border-collapse: collapse; background: #fff; }
.card > .table { margin: 0 -2px; }
body.app > main > .table { border: 1px solid var(--line); border-radius: var(--radius); }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tfoot td { border-bottom: 0; padding: 6px 10px; }
.table .num { text-align: right; white-space: nowrap; }
.table.small td, .table.compact td { padding: 6px 10px; font-size: .9rem; }
.table tr.done td { color: var(--muted); }
.table tr.bad-row td { background: var(--bad-soft); }
.table.lines td { padding: 6px; }
.table.lines select { width: 100%; max-width: 360px; }
.table.lines input[size] { width: auto; }
.surs summary { cursor: pointer; color: var(--pink-dark); font-weight: 700; font-size: .86rem; white-space: nowrap; }
.surs[open] { background: var(--bg); border-radius: 8px; padding: 6px 8px; }
.surs .check { margin-top: 3px; }
.card { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: #eee; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: #efecf1; color: var(--muted); }

.flash, .notice { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; background: var(--info-soft); color: #1f2a7a; border-left: 4px solid var(--info); }
.flash.ok, .notice.ok { background: var(--ok-soft); color: #0b5a3e; border-color: var(--ok); }
.flash.error, .notice.bad { background: var(--bad-soft); color: #8a0f29; border-color: var(--bad); }
.notice { background: var(--warn-soft); color: #6e3f00; border-color: var(--warn); }
.note { background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.secret { font-size: 1.4rem; background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 8px; user-select: all; letter-spacing: .04em; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; text-decoration: none !important; }
.tile b { font-size: 1.8rem; font-weight: 900; letter-spacing: -.02em; }
.tile span { color: var(--muted); font-size: .86rem; }
.tile:hover { border-color: var(--pink); }
.tile.alert { border-color: var(--pink); background: var(--pink-soft); }
.tile.alert b { color: var(--pink-dark); }
.row-line { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-line:last-child { border-bottom: 0; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 34px; gap: 10px; align-items: center; padding: 4px 0; }
.bar-row b { text-align: right; }
meter { width: 100%; height: 12px; }
meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 6px; }
meter::-webkit-meter-optimum-value { background: var(--pink); border-radius: 6px; }
meter.won::-webkit-meter-optimum-value { background: var(--ok); }
meter.lost::-webkit-meter-optimum-value, meter.inactive::-webkit-meter-optimum-value { background: #b9b0bf; }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0 0 12px; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; }
.quote { background: var(--pink-soft); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.quote .table { background: transparent; }
.danger-zone { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 14px; }
.pager { display: flex; gap: 16px; justify-content: center; padding: 14px; }

/* acceso */
body.bare { min-height: 100vh; background: #f780b8; display: grid; place-items: center; }
.bare-main { width: 100%; max-width: 420px; padding: 24px; display: flex; flex-direction: column; align-items: center; }
.bare-logo { width: 190px; height: auto; display: block; margin: 0 auto 24px; }
.login { width: 100%; }
.login h1 { text-align: center; margin-bottom: 0; }
.claim { text-align: center; color: var(--pink); font-weight: 900; margin: 2px 0 18px; font-size: 1.15rem; letter-spacing: -.01em; }
.login-links { text-align: center; margin: 12px 0 6px; font-size: .9rem; }

/* Fase 4: paneles, gráficos, cobros y ofertas */
.notice.info { background: var(--info-soft); color: #1f2a7a; border-color: var(--info); }
.tile.money { border-color: var(--ok); }
.tile.money b { color: var(--ok); }
.tile span small { font-size: .78rem; }
h2.section { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 10px; }
.small { font-size: .85rem; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; font-size: .88rem; }
.chart { width: 100%; height: auto; display: block; font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); }
.chart .val { fill: var(--ink); font-weight: 700; }
.chart .name { fill: var(--ink-2); font-size: 13px; }
.chart.ranking .val { font-size: 13px; }
.chart .bar { fill: var(--pink-dark); }
.chart .hit { fill: transparent; }
.chart .col:hover .bar { fill: var(--pink); }
.chart .col:hover .hit { fill: var(--bg); }
.table-view summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-top: 6px; }
.incident { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.incident:last-child { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.table.activity td { white-space: nowrap; }
.table.activity th { white-space: normal; min-width: 70px; }
.subform { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.subform summary { cursor: pointer; font-weight: 700; color: var(--pink-dark); margin-bottom: 10px; }
.rules { margin: 0; padding-left: 18px; line-height: 1.6; }
.offer-pick { max-width: 640px; }

/* Fase 5: informes */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.filters .field { margin: 0; }
.filters small { grid-column: 1 / -1; }
.filter-actions { display: flex; gap: 8px; }
.goal meter { width: 100%; height: 18px; }
.goal h2 { margin-bottom: 8px; }
.chart-empty { padding: 30px 0; text-align: center; }

/* Tablón de anuncios */
.announcement { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--info); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
.announcement.promo { border-left-color: var(--pink); background: linear-gradient(90deg, var(--pink-soft), #fff 60%); }
.announcement.importante { border-left-color: var(--bad); }
.announcement header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.announcement h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.announcement.promo h3 { font-size: 1.35rem; }
.announcement img { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; margin: 8px 0; }
.announcement .text { line-height: 1.55; }
.badge.promo { background: var(--pink); color: #fff; }
.sidebar nav .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .75rem; text-align: center; }
.sidebar nav a.on .count { background: #fff; color: var(--ink); }
.board-home { margin-bottom: 18px; }

/* Argumentario, condiciones y correo */
.rich { line-height: 1.6; max-width: 900px; }
.rich h2 { margin: 26px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.2rem; }
.rich h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.rich h3 { margin: 16px 0 6px; font-size: 1rem; color: var(--pink-dark); }
.rich blockquote { margin: 8px 0; padding: 10px 14px; background: var(--pink-soft); border-left: 4px solid var(--pink); border-radius: 0 8px 8px 0; font-style: italic; }
.rich ul { margin: 6px 0 10px; padding-left: 20px; }
.editor textarea { font-family: ui-monospace, Menlo, monospace; font-size: .88rem; width: 100%; }
.editor .preview { max-height: 900px; overflow-y: auto; }
.help code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.mail-card { max-width: 720px; }
.btn.big { padding: 14px 26px; font-size: 1.05rem; }

/* Correo */
.mail-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.mail-side { display: flex; flex-direction: column; gap: 12px; }
.mail-side nav { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.mail-side nav a { padding: 7px 10px; border-radius: 8px; color: var(--ink); font-weight: 600; }
.mail-side nav a.on { background: var(--pink-soft); color: var(--pink-dark); }
.mail-side .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: .75rem; text-align: center; }
.mail-table td { padding: 8px 10px; }
.mail-table td.from { width: 30%; white-space: nowrap; }
.mail-table td.when { width: 130px; white-space: nowrap; color: var(--muted); font-size: .85rem; text-align: right; }
.mail-table tr.unread td { font-weight: 700; }
.mail-table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--pink); }
.grid-mail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.mail-subject { font-size: 1.4rem; }
.mail-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mail-body { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .95rem; line-height: 1.5; margin: 10px 0 0; }
.mail-item { border-bottom: 1px solid var(--line); padding: 8px 0; }
.mail-item summary { cursor: pointer; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1100px) { .mail-layout, .grid-mail { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 18px; }
  .facts { grid-template-columns: 1fr; }
}

/* Firma corporativa del correo (vista previa; el correo enviado lleva estilos en línea equivalentes). */
.mail-sig { font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.45; color: var(--ink); border-left: 3px solid var(--pink); padding: 10px 14px; background: #fff; border-radius: 0 8px 8px 0; }
.mail-sig p { margin: 0; }
.mail-sig-slogan, .mail-sig-web { color: var(--pink); }
.mail-sig-slogan { font-weight: 700; }
.mail-sig-tagline { margin: 14px 0 28px !important; max-width: 520px; }
.mail-sig-phone { margin-top: 14px !important; }
.mail-quote { white-space: pre-wrap; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; font-size: .9rem; max-height: 260px; overflow: auto; }

/* Audiencia: informe de Looker Studio insertado */
.embed-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 480px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.city-box .city-line { font-size: 1.05rem; margin: 4px 0; }
.city-box .freq { color: var(--pink); font-weight: 700; }
table.cities input, table.cities select { padding: 5px 7px; font-size: .9rem; max-width: 180px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Asistente IA */
.assistant { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.conv-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.conv-list a small { display: block; color: var(--muted); font-size: .75rem; }
.conv-list a.on, .conv-list a:hover { background: var(--pink-soft); text-decoration: none; }
.chat .msg { display: flex; flex-direction: column; margin-bottom: 14px; }
.chat .msg.user { align-items: flex-end; }
.chat .bubble { max-width: 86%; padding: 10px 14px; border-radius: 12px; background: var(--bg); line-height: 1.5; }
.chat .msg.user .bubble { background: var(--ink); color: #fff; }
.chat .msg-actions { margin-top: 4px; }
.chat-form textarea { width: 100%; }
.chat-empty { color: var(--ink-2); }
table.qa td { vertical-align: top; }
@media (max-width: 900px) { .assistant { grid-template-columns: 1fr; } }
