/* Sistema visual compartido de las demos de producto (agente + CRM).
   Tokens de la marca Veredicto llevados a interfaz de producto. */
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url('fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 500; font-display: swap; src: url('fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url('fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 700; font-display: swap; src: url('fonts/instrument-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #F3F2ED;
  --surface: #FFFFFF;
  --surface-2: #F8F7F3;
  --ink: #15201A;
  --ink-2: #3B4A40;
  --muted: #6A786D;
  --line: #E4E2D9;
  --line-2: #D3D0C4;
  --brand: #1C2B1E;
  --accent: #3F6E4D;
  --accent-2: #5C8F69;
  --accent-soft: #E4EEE3;
  --warn: #9A6414;
  --warn-soft: #FBF0DA;
  --danger: #AE4234;
  --danger-soft: #F8E5E1;
  --info: #2D5C86;
  --info-soft: #E3EDF6;
  --wa: #1A9E53;
  --ig: #C1357F;
  --web: #2D5C86;
  --manual: #6A786D;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-1: 0 1px 2px rgba(21,32,26,.05), 0 1px 1px rgba(21,32,26,.03);
  --shadow-2: 0 2px 4px rgba(21,32,26,.04), 0 12px 28px -10px rgba(21,32,26,.18);
  --shadow-3: 0 24px 64px -16px rgba(21,32,26,.35);
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barra de demo */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #E9EEE6; font-size: 12px; padding: 6px max(12px, env(safe-area-inset-left, 0px)); padding-top: calc(6px + env(safe-area-inset-top, 0px)); white-space: nowrap; overflow: hidden; }
.demo-bar a { color: #A9C98D; text-decoration: none; font-weight: 500; }
.demo-bar .x { color: #9FB0A4; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .demo-bar .x { display: none; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #27392A; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(21,32,26,.06); }
.btn.danger { color: var(--danger); border-color: #E7C3BC; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: rgba(21,32,26,.06); }
.icon-btn svg { width: 18px; height: 18px; }

/* Insignias */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge svg { width: 12px; height: 12px; }
.badge.wa { color: var(--wa); background: #E5F5EC; border-color: #CBEBD8; }
.badge.ig { color: var(--ig); background: #FAE7F1; border-color: #F1CDE0; }
.badge.web { color: var(--web); background: var(--info-soft); border-color: #CADCEC; }
.badge.manual { color: var(--manual); }
.badge.ok { color: var(--accent); background: var(--accent-soft); border-color: #CFE0CD; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #F0DDB4; }
.badge.bad { color: var(--danger); background: var(--danger-soft); border-color: #EDCBC4; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.alta { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.media { background: #D49A2A; box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.baja { background: var(--line-2); }

/* Campos */
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
@media (min-width: 900px) { .input, .select, .textarea { font-size: 14px; } }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236A786D' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 300; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--brand); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-3); display: flex; gap: 10px; align-items: center; animation: toastIn .35s var(--ease); pointer-events: auto; }
.toast b { color: #A9C98D; font-weight: 600; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 899px) { .toasts.above-tabs { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

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