/* Semilla dashboard. Tokens from the approved mockup; no inline styles anywhere. */
@font-face { font-family: 'Betm'; src: url('fonts/Betm-Light.otf'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Betm'; src: url('fonts/Betm-Regular.otf'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Betm'; src: url('fonts/Betm-Bold.otf'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4efe4;
  --surface: #fffdf8;
  --surface-2: #faf4e8;
  --ink: #102621;
  --ink-2: #4e502a;
  --muted: #6c7068;
  --line: #e2d6bf;
  --accent: #a87f45;
  --accent-soft: #f0e4cc;
  --side: #102621;
  --side-ink: #e9e2d2;
  --good: #2f7a5b;
  --warn: #a8701c;
  --bad: #9b2c1f;
  --font: 'Betm', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1915; --surface: #11241f; --surface-2: #0e1f1a; --ink: #f1e9da; --ink-2: #cfcfaa; --muted: #9ba49b;
    --line: #24413a; --accent: #d2ae7b; --accent-soft: #2b2a1c; --side: #07130f; --side-ink: #e9e2d2;
    --good: #6cc39a; --warn: #e0a64a; --bad: #e07a6c; color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 300; font-size: 15px; line-height: 1.6; }
h1, h2, h3 { margin: 0 0 .4em; font-weight: 700; letter-spacing: .02em; line-height: 1.25; }
h1 { font-size: 22px; }
p { margin: 0 0 .8em; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); min-width: 0; }

/* ---------- login ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 16px; display: grid; gap: 20px; }
.auth-card { padding: 28px 24px 24px; }
/* The logo PNG has a cream background: keep it on cream in both themes. */
.auth-logo { display: flex; justify-content: center; margin: -8px auto 18px; padding: 6px 12px; border-radius: 10px; background: #f7f3e6; width: fit-content; }
.auth-logo img { display: block; width: 160px; height: auto; }
.auth h1 { text-align: center; }
.muted { color: var(--muted); font-size: 13.5px; text-align: center; }
.alert { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--bad); font-size: 14px; text-align: center; }
.form { display: grid; gap: 6px; }
.form label { font-size: 13px; font-weight: 400; color: var(--ink-2); margin-top: 8px; }
.form input[type='email'], .form input[type='password'], .form input[type='text'] {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 400;
}
.form input:focus { outline: 2px solid #c09762; outline-offset: 1px; }
.btn {
  display: block; width: 100%; min-height: 46px; margin-top: 18px; padding: 12px; border: 0; border-radius: 10px;
  background: #102621; color: #fffdf8; font: inherit; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.btn:hover { background: #1d3d35; }
.btn:focus-visible { outline: 2px solid #c09762; outline-offset: 2px; }
@media (prefers-color-scheme: dark) {
  .btn { background: #c09762; color: #102621; }
  .btn:hover { background: #d2ae7b; }
}

/* ---------- app shell: forest sidebar + cream content ---------- */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { font-weight: 700; letter-spacing: .22em; font-size: 14px; padding: 4px 10px 16px; }
.side .brand small { display: block; font-weight: 300; letter-spacing: .14em; font-size: 9.5px; opacity: .7; }
.side nav { display: grid; gap: 4px; }
.side nav a { padding: 8px 10px; border-radius: 7px; font-size: 13.5px; opacity: .78; color: inherit; text-decoration: none; }
.side nav a:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.side nav a[aria-current="page"] { opacity: 1; background: rgba(192, 151, 98, .22); font-weight: 400; }
.side :focus-visible { outline-color: #c09762; }
.who { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12px; display: grid; gap: 2px; }
.who-email { opacity: .85; overflow-wrap: anywhere; }
.who-role { opacity: .6; }
.who form { margin: 6px 0 0; }
.link { all: unset; cursor: pointer; font-size: 12px; text-decoration: underline; opacity: .8; }
.link:hover { opacity: 1; }
.link:focus-visible { outline: 2px solid #c09762; outline-offset: 2px; }
.pane { padding: 22px 24px 30px; display: grid; gap: 18px; align-content: start; min-width: 0; }

@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
  .side .brand { padding: 0 8px 0 0; }
  .side nav { display: flex; flex-wrap: wrap; }
  .who { margin-top: 0; border-top: 0; margin-left: auto; }
  .pane { padding: 16px; }
}

/* ---------- team ---------- */
.lead { color: var(--muted); margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.flash { margin: 0; padding: 10px 14px; border-radius: 8px; font-size: 14px; border: 1px solid var(--line); }
.flash-ok { background: var(--surface-2); color: var(--good); }
.flash-err { background: var(--accent-soft); color: var(--bad); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.chip-good { color: var(--good); }
.chip-bad { color: var(--bad); }
.chip-off { color: var(--muted); }
.muted-cell { color: var(--muted); font-size: 13px; }
.actions { display: grid; gap: 8px; min-width: 220px; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.form select, .inline select {
  min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 400;
}
.form-wide { max-width: 420px; }
.btn-auto { width: auto; justify-self: start; padding-inline: 22px; }
.btn-sm {
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 400; cursor: pointer; margin-top: 8px;
}
.inline .btn-sm { margin-top: 0; }
.btn-sm:hover { border-color: var(--accent); }
details summary { cursor: pointer; font-size: 13px; text-decoration: underline; padding: 4px 0; }
details[open] summary { margin-bottom: 4px; }

@media (max-width: 720px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 4px 6px; }
  .table td::before { content: attr(data-label) ': '; font-weight: 700; font-size: 12px; color: var(--ink-2); }
  .table td[data-label="Acciones"]::before { display: block; }
}

/* ---------- control panel ---------- */
.pane-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pane-head h1 { margin: 0; }
.period { color: var(--muted); font-size: 13px; margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.filter { display: block; }
.sel { min-height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 400; max-width: 100%; }
.filters .btn-sm { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; background: var(--surface); min-width: 0; }
.kpi .k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .v-lt5 { font-size: 18px; color: var(--muted); font-weight: 400; padding: 5px 0; }
.kpi .d { font-size: 12px; color: var(--muted); min-height: 1.6em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.card-h { font-size: 14px; letter-spacing: .02em; display: flex; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.card-h span { font-weight: 300; color: var(--muted); font-size: 12px; }
.card-h-2 { margin-top: 16px; }
.note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.note-lg { color: var(--ink-2); font-size: 14px; margin: 0; }
.chart, .heat { display: block; width: 100%; height: auto; }
.heat { max-width: 760px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax, .heat .ax { fill: var(--muted); font-size: 9px; font-family: var(--font); }
.chart .area { fill: var(--accent-soft); stroke: none; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--accent); }
.heat .cell { fill: var(--accent); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(70px, 96px) minmax(0, 1fr) minmax(54px, auto); gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow-wrap: anywhere; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar .track svg { display: block; width: 100%; height: 100%; }
.fill-ink { fill: var(--ink); }
.fill-gold { fill: var(--accent); }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bar .n-lt5 { color: var(--muted); font-size: 12px; white-space: nowrap; }
.legend { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); display: inline-block; }
.legend .l1 { opacity: .12; } .legend .l2 { opacity: .4; } .legend .l3 { opacity: .7; }
.stack { display: block; width: 100%; height: 14px; border-radius: 99px; border: 1px solid var(--line); overflow: hidden; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.keys i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.s0 { fill: var(--ink); background: var(--ink); }
.s1 { fill: var(--accent); background: var(--accent); }
.s2 { fill: var(--ink-2); background: var(--ink-2); }
.s3 { fill: var(--line); background: var(--line); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill.ally { color: var(--accent); border-color: var(--accent); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .table td.num { text-align: left; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 24px; }
  .sel { max-width: 100%; }
}

/* ---------- partners and audiences ---------- */
.form input[type='number'], .form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 400;
}
.form textarea { min-height: 96px; resize: vertical; }
.form select[multiple] { min-height: 150px; width: 100%; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 10px 0 0; min-width: 0; }
.fieldset legend { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 0 6px; }
.fieldset .check, .form .check { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.form .check input { width: auto; min-height: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field-err { color: var(--bad); font-size: 13px; margin: 2px 0 0; }
.big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- pieces ---------- */
.form input[type='url'], .form input[type='tel'], .form input[type='date'], .form input[type='file'] {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 400;
}
.form .note { margin: 10px 0 0; }
.pair > div > label { display: block; }
.pair > div > select { width: 100%; }
.btn-link { display: inline-block; margin-top: 0; text-align: center; text-decoration: none; }
.piece-actions-bar { gap: 8px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.editor-main { display: grid; gap: 18px; min-width: 0; }
.editor-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; text-decoration: none; background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.reach { margin: 0; padding: 14px 16px; border-radius: 10px; background: #f0e4cc; color: #102621; font-size: 14px; }
.reach strong { font-weight: 700; }
.thumb { display: block; width: 54px; height: 68px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.thumb-semilla { background: #102621; }
.thumb-partner { background: #f0e4cc; }

/* The phone frame around the piece card: the card itself is styled by piece.css with the portal's tokens. */
.phone {
  --color-forest-800: #102621; --color-gold-100: #f0e4cc; --color-gold-500: #c09762; --radius-lg: 16px;
  width: 100%; max-width: 320px; justify-self: center; padding: 12px; border-radius: 36px; background: #102621;
  box-shadow: 0 10px 30px rgba(16, 38, 33, .18);
}
.phone-screen { border-radius: 26px; background: #f7f3e6; color: #102621; padding: 22px 14px 18px; display: grid; gap: 4px; }
.phone-hello { margin: 0 0 10px; text-align: center; font-weight: 700; font-size: 16px; }
.phone .piece { margin-bottom: 10px; padding: 18px; }
.phone .piece--image { padding: 0; }
.phone .piece-title { font-size: 1.2rem; }
.phone-actions { display: grid; gap: 8px; }
.phone-btn { display: block; padding: 11px; border-radius: 10px; text-align: center; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: #102621; color: #fffdf8; }
.phone-btn-plain { background: transparent; color: #102621; border: 1px solid #102621; }

@media (max-width: 960px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; }
}
