/* CRM · El Negocio Invisible — tokens, reset, tipografía, botones y formularios */
:root {
  /* Marca (de El Atajo) */
  --papel: #F2EFEB;
  --papel-2: #EAE5DF;
  --papel-3: #E1DBD3;
  --superficie: #FFFDFB;
  --tinta: #1C1714;
  --tinta-2: #5E5550;
  --tinta-3: #8C827C;
  --tinta-4: #B4ABA5;
  --rojo: #FF3131;
  --naranja: #FF914D;
  --acento: #F0442B;          /* punto medio del degradado, para texto y líneas finas */
  --acento-suave: #FFE9E2;
  --marca: linear-gradient(90deg, #FF3131, #FF914D);
  --noche: #170C0A;
  --noche-2: #221411;
  --noche-3: #2F1D19;
  --noche-tinta: #EDE4DE;
  --noche-tinta-2: #A8968D;
  --linea: rgba(28, 23, 20, .08);
  --linea-2: rgba(28, 23, 20, .14);

  /* Estados: bueno = verde, en curso = gris, problema = rojo */
  --bien: #1C7C46;
  --bien-fondo: #E4F2E8;
  --curso: #6F6762;
  --curso-fondo: #ECE8E4;
  --mal: #C8281C;
  --mal-fondo: #FCE6E2;
  --aviso: #A86400;
  --aviso-fondo: #FAEFD9;

  --f: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --sombra: 0 1px 2px rgba(60, 30, 15, .05), 0 6px 20px -8px rgba(60, 30, 15, .14);
  --sombra-alta: 0 2px 4px rgba(60, 30, 15, .06), 0 18px 40px -12px rgba(60, 30, 15, .28);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t: 160ms;
  --lateral: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--papel); color: var(--tinta);
  font-family: var(--f); font-size: 15px; line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: #FFD3C2; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: 26px; font-variation-settings: "wdth" 88; letter-spacing: -0.03em; }
h2 { font-size: 16px; font-weight: 750; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; letter-spacing: 0; }
.num, .tab-num { font-variant-numeric: tabular-nums; }
.cifra {
  font-variant-numeric: tabular-nums; font-weight: 820; font-variation-settings: "wdth" 82;
  letter-spacing: -0.035em; line-height: 1;
}
.suave { color: var(--tinta-2); }
.tenue { color: var(--tinta-3); }
.peque { font-size: 13px; }
.mini { font-size: 12px; }
.etiqueta { font-size: 12px; font-weight: 650; color: var(--tinta-3); letter-spacing: .02em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
strong, b { font-weight: 700; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid transparent;
  background: var(--tinta); color: var(--papel); text-decoration: none; white-space: nowrap;
  font-weight: 650; font-size: 14px; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform 90ms var(--ease), box-shadow var(--t) var(--ease), opacity var(--t);
}
.btn:hover { background: #2E2622; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: default; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-marca { background: var(--marca); color: #fff; box-shadow: 0 4px 14px -6px rgba(240, 68, 43, .7); }
.btn-marca:hover { background: linear-gradient(90deg, #F2281F, #FF8540); }
.btn-claro { background: var(--superficie); color: var(--tinta); border-color: var(--linea-2); }
.btn-claro:hover { background: #fff; border-color: rgba(28, 23, 20, .26); }
.btn-fantasma { background: transparent; color: var(--tinta-2); }
.btn-fantasma:hover { background: rgba(28, 23, 20, .06); color: var(--tinta); }
.btn-peligro { background: transparent; color: var(--mal); border-color: rgba(200, 40, 28, .3); }
.btn-peligro:hover { background: var(--mal-fondo); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icono { width: 32px; padding: 0; }

/* ---------- Formularios ---------- */
.campo { display: grid; gap: 6px; }
.campo > label, .campo > .etiqueta-campo { font-size: 13px; font-weight: 650; color: var(--tinta); }
.campo .ayuda { font-size: 12.5px; color: var(--tinta-3); line-height: 1.4; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-s);
  border: 1px solid var(--linea-2); background: #fff; color: var(--tinta);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select.input { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238C827C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input:hover { border-color: rgba(28, 23, 20, .26); }
.input:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgba(240, 68, 43, .14); }
.input[aria-invalid="true"] { border-color: var(--mal); }
.input::placeholder { color: var(--tinta-4); }
.input-buscar { padding-left: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238C827C' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.6'/%3E%3Cpath d='m10.5 10.5 3 3'/%3E%3C/svg%3E") no-repeat 11px center; }

/* Interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .pista { width: 34px; height: 20px; border-radius: 99px; background: var(--papel-3); position: relative; flex: none;
  transition: background var(--t) var(--ease); }
.switch .pista::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform var(--t) var(--ease); }
.switch input:checked + .pista { background: var(--bien); }
.switch input:checked + .pista::after { transform: translateX(14px); }
.switch input:focus-visible + .pista { outline: 2px solid var(--acento); outline-offset: 2px; }

/* Control segmentado */
.segmento { display: inline-flex; padding: 3px; gap: 2px; background: var(--papel-2); border-radius: 10px; flex-wrap: wrap; }
.segmento button {
  height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--tinta-2); white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.segmento button:hover { color: var(--tinta); }
.segmento button[aria-pressed="true"] { background: var(--superficie); color: var(--tinta); box-shadow: 0 1px 2px rgba(60, 30, 15, .12), 0 0 0 1px rgba(28, 23, 20, .04); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
