/* Brilla Bonita — panel de revisión
 *
 * Design direction: a copy desk, not a SaaS dashboard.
 *
 * The work this tool exists for is reading Spanish prose critically and
 * deciding whether it is honest. So the reviewed copy is set in a real text
 * serif at a real reading measure, and everything that is *not* the copy --
 * chrome, labels, counters, costs -- is set in a grotesque and a mono so it
 * never competes with it. Structure comes from hairline rules and space rather
 * than from cards and shadows, because a page of boxes turns eighty-three
 * fields into eighty-three things to look at instead of one page to read.
 *
 * Warm paper rather than the usual cool grey: this content ends up on a beauty
 * storefront, and judging its tone against a clinical blue-white background
 * misleads you about how it will read.
 */

@import url("/static/fonts.css");

:root {
  /* Paper and ink */
  --paper:      #faf7f2;
  --paper-sunk: #f2ede4;
  --paper-card: #fffdfa;
  --ink:        #17130f;
  --ink-soft:   #554c42;
  --ink-faint:  #8a8078;
  --rule:       #e2dacd;
  --rule-firm:  #cbc0af;

  /* One accent, used sparingly. A muted oxblood: it belongs to the beauty
     storefront this content is for without cosplaying it, and it is nobody's
     default SaaS blue. */
  --accent:     #7c2f49;
  --accent-lit: #a04562;
  --accent-wash:#f4e9ec;

  /* Semantics. Deliberately not tints of the accent -- an error must not read
     as "brand", and the eye has to separate these at a glance in a dense
     table. */
  --ok:      #2f6b4f;
  --ok-wash: #e7f0ea;
  --warn:      #8f6114;
  --warn-wash: #f7eeda;
  --bad:      #a32c22;
  --bad-wash: #f8e8e6;

  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --rail: 208px;
  --measure: 68ch;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* A very faint paper grain. Costs one inline SVG, no request, and stops the
   large flat areas reading as screen-grey. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-lit); }

/* ------------------------------------------------------------------ rail */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 2;
  padding: 26px 0 18px;
  background: var(--paper-sunk);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

.rail .brand {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 40;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  padding: 0 20px 22px;
  color: var(--ink);
}
.rail .brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 6px;
}

.rail nav { display: flex; flex-direction: column; }
.rail nav a {
  padding: 9px 20px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  border-left: 2px solid transparent;
}
.rail nav a:hover { background: rgba(0,0,0,0.03); color: var(--ink); }
.rail nav a.on {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
  background: rgba(124,47,73,0.05);
}

.rail .foot {
  margin-top: auto;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.7;
}
.rail .foot button {
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--accent); cursor: pointer;
  text-decoration: underline;
}

/* --------------------------------------------------------------- shell */

main {
  position: relative;
  z-index: 1;
  margin-left: var(--rail);
  padding: 30px 34px 80px;
  max-width: 1500px;
}

.pagehead { margin-bottom: 26px; }
.pagehead h1 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 60;
  font-weight: 600;
  font-size: 31px;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.pagehead p { margin: 0; color: var(--ink-soft); font-size: 14px; }

h2.sec {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 34px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
}

/* --------------------------------------------------------------- tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.tile { background: var(--paper-card); padding: 16px 18px 18px; }
.tile .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 9px;
}
.tile .v {
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.tile .v small { font-size: 14px; color: var(--ink-faint); font-weight: 400; }
.tile .sub { font-size: 12px; color: var(--ink-soft); margin-top: 7px; }

/* --------------------------------------------------------------- funnel */

.funnel { display: flex; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.funnel .step { background: var(--paper-card); padding: 14px 16px; flex: 1; }
.funnel .step .n {
  font-family: var(--font-mono); font-size: 24px; font-weight: 500; line-height: 1;
}
.funnel .step .l {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 8px;
}
/* Publicado stays visibly present but inert until block 6 exists. A column
   that vanishes and reappears later is a column nobody trusts. */
.funnel .step.blocked { background: var(--paper-sunk); color: var(--ink-faint); }
.funnel .step.blocked .n { color: var(--ink-faint); }
.funnel .step.blocked .l::after { content: " · bloqueado"; }

/* ------------------------------------------------------------------ bar */

.bar { height: 5px; background: var(--paper-sunk); border: 1px solid var(--rule); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar.thin { height: 3px; }

/* ---------------------------------------------------------------- table */

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--rule-firm);
  white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data tbody tr:hover { background: var(--paper-card); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }

table.data th.sortable { padding: 0; }
table.data th.sortable a {
  display: block; padding: 0 10px 8px;
  color: inherit; text-decoration: none; white-space: nowrap;
}
table.data th.sortable a:hover { color: var(--accent); }
table.data th.sortable.active a { color: var(--accent); }
table.data th.sortable .arrow { margin-left: 4px; }
table.data th.num.sortable a { text-align: right; }
table.data .sku { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
table.data .title { font-weight: 600; }
table.data .title a { color: var(--ink); text-decoration: none; }
table.data .title a:hover { color: var(--accent); text-decoration: underline; }
table.data img.thumb {
  width: 34px; height: 34px; object-fit: contain;
  background: var(--paper-card); border: 1px solid var(--rule); display: block;
}

/* ---------------------------------------------------------------- chips */

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--rule-firm);
  background: var(--paper-card);
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip.ok     { color: var(--ok);  border-color: var(--ok);  background: var(--ok-wash); }
.chip.warn   { color: var(--warn); border-color: var(--warn); background: var(--warn-wash); }
.chip.error  { color: var(--bad); border-color: var(--bad); background: var(--bad-wash); }
.chip.action { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.chip.muted  { color: var(--ink-faint); }
.chip.fid    { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------- review */

.review { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }

.section { margin-bottom: 30px; }
.section > h3 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule-firm);
}

.field { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.field .head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.field .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
}
.field .head .chip { margin-left: auto; }

/* The value is the product. It gets the serif, the measure and the size --
   everything else on the row is metadata about it. */
.field textarea,
.field input[type="text"],
.field input[type="url"] {
  width: 100%;
  max-width: var(--measure);
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 14;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-left: 2px solid var(--rule);
  padding: 2px 0 2px 12px;
  resize: vertical;
}
.field textarea:focus,
.field input:focus {
  outline: none;
  border-left-color: var(--accent);
  background: var(--paper-card);
}
.field textarea:hover, .field input:hover { border-left-color: var(--rule-firm); }
.field.readonly .val {
  max-width: var(--measure);
  font-family: var(--font-display);
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-faint);
  border-left: 2px solid var(--rule);
  padding-left: 12px;
  font-style: italic;
}
.field .meta {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-top: 6px; padding-left: 14px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint);
}
.field .meta .counter.warn  { color: var(--warn); }
.field .meta .counter.error { color: var(--bad); font-weight: 500; }
.field .problem { color: var(--bad); }
.field .problem.warning { color: var(--warn); }
.field .note { font-style: italic; }
.field .saved { color: var(--ok); opacity: 0; transition: opacity .18s; }
.field.just-saved .saved { opacity: 1; }

.field .bool { display: flex; align-items: center; gap: 9px; padding-left: 14px; }
.field .bool input { width: 15px; height: 15px; accent-color: var(--accent); }

/* --------------------------------------------------------------- aside */

.aside { position: sticky; top: 24px; font-size: 13px; }
.aside .box { border: 1px solid var(--rule); background: var(--paper-card); padding: 15px 16px; margin-bottom: 14px; }
.aside .box h4 {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px; font-weight: 500;
}
.aside dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; }
.aside dt { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; align-self: center; }
.aside dd { margin: 0; font-size: 12.5px; word-break: break-word; }
.aside ul { margin: 0; padding-left: 16px; }
.aside li { margin-bottom: 4px; }
.aside .jump { font-family: var(--font-mono); font-size: 11px; }

/* --------------------------------------------------------------- images */

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.slot { border: 1px solid var(--rule); background: var(--paper-card); padding: 8px; }
.slot.fidelity { border-color: var(--accent); }
.slot img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper-sunk); display: block; }
.slot .cap {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 7px;
  display: flex; justify-content: space-between; gap: 6px; align-items: center;
}
.slot .empty {
  aspect-ratio: 1; display: grid; place-items: center;
  background: var(--paper-sunk); color: var(--ink-faint);
  font-family: var(--font-mono); font-size: 10px; text-align: center; padding: 8px;
}

.gridrow { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.gridrow .ref img { width: 100%; border: 1px solid var(--rule); background: var(--paper-card); }
.gridrow .ref .lbl { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin-top: 6px; }

/* -------------------------------------------------------------- preview */

.preview { max-width: 74ch; font-family: var(--font-display); }
.preview h2 {
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 60;
  font-size: 27px; font-weight: 600; letter-spacing: -0.015em;
  margin: 44px 0 12px; line-height: 1.2;
}
.preview h3 { font-size: 19px; font-weight: 600; margin: 26px 0 8px; }
.preview p { font-size: 16.5px; line-height: 1.68; margin: 0 0 14px; }
.preview .lead { font-size: 18.5px; line-height: 1.6; color: var(--ink); }
.preview img { width: 100%; max-width: 380px; border: 1px solid var(--rule); display: block; margin: 18px 0; }
.preview .blockmark {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-top: 40px;
  padding-bottom: 5px; border-bottom: 1px solid var(--rule);
}
.preview .gap { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-faint); font-style: italic; }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  padding: 8px 15px; border: 1px solid var(--ink); background: var(--ink);
  color: var(--paper); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn[disabled], .btn.off { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn.small { font-size: 11.5px; padding: 5px 10px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input[type="search"], .toolbar select {
  font-family: var(--font-ui); font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--rule-firm); background: var(--paper-card); color: var(--ink);
}
.toolbar input[type="search"]:focus, .toolbar select:focus { outline: 1px solid var(--accent); }

/* --------------------------------------------------------------- notice */

.notice { border-left: 3px solid var(--accent); background: var(--accent-wash); padding: 12px 15px; margin-bottom: 18px; font-size: 13.5px; }
.notice.bad { border-left-color: var(--bad); background: var(--bad-wash); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-wash); }
.notice h4 { margin: 0 0 5px; font-size: 13.5px; }
.notice p, .notice ul { margin: 0; }

pre.log {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55;
  background: var(--ink); color: #ded5c8; padding: 14px 16px;
  overflow-x: auto; max-height: 460px; margin: 0;
}

/* ---------------------------------------------------------------- login */

.login { display: grid; place-items: center; min-height: 100vh; margin: 0; }
.login form { width: 320px; }
.login .brand { font-family: var(--font-display); font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60; font-size: 30px; font-weight: 600; margin-bottom: 4px; }
.login .sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 26px; }
.login input {
  width: 100%; font-family: var(--font-ui); font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--rule-firm); background: var(--paper-card); margin-bottom: 12px;
}
.login input:focus { outline: 1px solid var(--accent); }
.login .btn { width: 100%; }

.htmx-request { opacity: 0.55; transition: opacity .1s; }

/* ------------------------------------------------------------- worklist */

.worklist {
  display: grid; grid-template-columns: 230px 1fr; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: start;
}
.worklist .who { display: flex; gap: 10px; align-items: center; }
.worklist .who img {
  width: 44px; height: 44px; object-fit: contain;
  border: 1px solid var(--rule); background: var(--paper-card); flex: none;
}
.worklist .who a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.worklist .who a:hover { color: var(--accent); text-decoration: underline; }
.worklist .who .sku { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.worklist .boxes { display: grid; gap: 6px; }
.worklist .box-row { display: flex; align-items: center; gap: 10px; }
.worklist .box-row label {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
  width: 12px; flex: none;
}
.worklist .box-row input {
  flex: 1; max-width: 520px;
  font-family: var(--font-mono); font-size: 12px; padding: 6px 9px;
  border: 1px solid var(--rule); background: var(--paper-card); color: var(--ink);
}
.worklist .box-row input:focus { outline: none; border-color: var(--accent); }

button.linkish {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline;
}
button.linkish:hover { color: var(--accent-lit); }

/* Confirming a fidelity image is the one gate on approval, so it gets weight
   the lifestyle slots do not. */
.slot .confirm { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.slot .confirm label { font-family: var(--font-mono); font-size: 10px; cursor: pointer; }
.slot.confirmed { border-color: var(--ok); background: var(--ok-wash); }
.slot.confirmed .cap { color: var(--ok); }

.queuenav {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 34px 0 0; padding-top: 16px; border-top: 1px solid var(--rule-firm);
}
.queuenav .pos { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.queuenav kbd {
  font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--rule-firm);
  border-bottom-width: 2px; padding: 1px 5px; background: var(--paper-card);
}

/* The compact copy sits under the page head, where it is reachable without
   scrolling past eighty-three fields. */
.queuenav.compact {
  margin: 0 0 20px;
  padding: 0 0 12px;
  border-top: 0;
  border-bottom: 1px solid var(--rule);
}
