/* GEMS · línea gráfica (greige / chocolate, editorial) */
/* Tipografías servidas localmente (funcionan sin internet) */
@font-face { font-family: 'Jost'; font-weight: 300; font-style: normal; font-display: swap; src: url('/fonts/jost-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/jost-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/jost-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/jost-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-style: italic; font-display: swap; src: url('/fonts/cormorant-garamond-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-style: italic; font-display: swap; src: url('/fonts/cormorant-garamond-latin-700-italic.woff2') format('woff2'); }

:root {
  --bg: #F3EEE8;
  --paper: #FBF8F4;
  --cream: #EDE5DB;
  --greige: #D6CBBE;
  --sand: #B9A794;
  --taupe: #8A7462;
  --choc: #3A281F;
  --ink: #221712;
  --line: #E3D9CD;
  --ok: #56704F;
  --ok-bg: #E6EDE1;
  --warn: #A9772E;
  --warn-bg: #F5EAD7;
  --bad: #9B3B2F;
  --bad-bg: #F4E1DD;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(58,40,31,.06), 0 8px 24px rgba(58,40,31,.07);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; font-variant-numeric: lining-nums; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--choc); }

/* LOGO OFICIAL: siempre la imagen original (/shared/brand/logo-gems.png), en negro y sobre fondo claro.
   No redibujar, no recolorear, no deformar, no aplicar efectos ni reemplazarlo por texto. */
.gems-logo { display: block; width: auto; max-width: 100%; flex: none; align-self: flex-start; object-fit: contain; object-position: left center; user-select: none; -webkit-user-drag: none; }
.wordmark { font-family: var(--serif); font-weight: 600; letter-spacing: .32em; text-transform: uppercase; line-height: 1; display: inline-flex; align-items: center; gap: .45em; }
.wordmark svg { width: .9em; height: .9em; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--taupe); font-weight: 500; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .01em; }
h1 { font-size: 34px; } h2 { font-size: 26px; } h3 { font-size: 20px; }
.muted { color: var(--taupe); }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* Botones */
.btn { appearance: none; border: 1px solid var(--choc); background: var(--choc); color: var(--paper); border-radius: 999px; padding: 11px 20px; font-weight: 500; letter-spacing: .04em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, background .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--ink); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--choc); border-color: var(--sand); }
.btn.ghost:hover { background: var(--cream); }
.btn.soft { background: var(--cream); border-color: var(--cream); color: var(--choc); }
.btn.soft:hover { background: var(--greige); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.bad { background: transparent; color: var(--bad); border-color: #DDB7AF; }
.btn.bad:hover { background: var(--bad-bg); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.lg { padding: 16px 26px; font-size: 17px; }
.btn.block { width: 100%; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--taupe); }
.input, select.input, textarea.input { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--sand); box-shadow: 0 0 0 4px rgba(185,167,148,.22); }

/* Chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; background: var(--cream); color: var(--choc); border: 1px solid transparent; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.dark { background: var(--choc); color: var(--paper); }
.chip.line { background: transparent; border-color: var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sand); display: inline-block; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 999; max-width: 380px; }
.toast { background: var(--ink); color: var(--paper); padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: tin .25s ease-out; line-height: 1.4; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); } .toast.gold { background: var(--choc); border-left: 4px solid var(--sand); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(34,23,18,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 20px; box-shadow: 0 30px 80px rgba(34,23,18,.35); max-width: 760px; width: 100%; max-height: calc(100vh - 40px); overflow: auto; }
.modal-head { padding: 22px 26px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-body { padding: 8px 26px 22px; }
.modal-foot { padding: 14px 26px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--taupe); cursor: pointer; }
@keyframes fade { from { opacity: 0; } }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--taupe); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--bg); }

/* Matriz talle × color */
.matrix { border-collapse: separate; border-spacing: 5px; }
.matrix th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--taupe); font-weight: 500; padding: 4px 6px; text-align: center; }
.matrix th.row { text-align: left; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 13px; }
.cell { min-width: 58px; border-radius: 10px; padding: 7px 6px; text-align: center; background: var(--bg); border: 1.5px solid transparent; cursor: pointer; line-height: 1.15; }
.cell b { display: block; font-size: 17px; font-weight: 600; }
.cell small { font-size: 10.5px; color: var(--taupe); }
.cell.has { background: var(--ok-bg); } .cell.dep { background: var(--warn-bg); } .cell.none { background: #F1ECE6; color: #BCAE9F; }
.cell.sel { border-color: var(--choc); }

@media print {
  html, body { background: #fff !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; }
}
#print { display: none; }
