/* ==========================================================================
   JD CAPITAL CRM — base.css
   Design tokens, reset y tipografia.
   ========================================================================== */

:root {
  /* Superficies */
  --bg:            #F4F6F9;
  --surface:       #FFFFFF;
  --surface-2:     #FAFBFD;
  --surface-3:     #F0F3F7;

  /* Navegacion (navy corporativo) */
  --navy-900:      #0A1420;
  --navy-800:      #0F1D2E;
  --navy-700:      #16293E;
  --navy-600:      #1E3752;
  --navy-line:     rgba(255,255,255,.08);

  /* Texto */
  --ink:           #131C26;
  --ink-2:         #3A4859;
  --muted:         #6B7A8C;
  --muted-2:       #93A0AF;
  --on-navy:       #E8EDF3;
  --on-navy-dim:   #8FA1B5;

  /* Lineas */
  --line:          #E2E7EE;
  --line-strong:   #CFD7E1;

  /* Acento */
  --accent:        #A8823C;
  --accent-2:      #C7A055;
  --accent-soft:   #F6F1E6;

  /* Semanticos */
  --pos:           #0E7B58;
  --pos-soft:      #E7F4EF;
  --neg:           #B23A2E;
  --neg-soft:      #FBECEA;
  --warn:          #A9761A;
  --warn-soft:     #FCF3E2;
  --info:          #2A5D8F;
  --info-soft:     #EAF1F8;

  /* Paleta de series para graficos */
  --s1: #1E3752;  --s2: #A8823C;  --s3: #2A7F76;  --s4: #7A5C8E;
  --s5: #B2683C;  --s6: #4A6E93;  --s7: #8C9AA8;  --s8: #5E7D3F;

  /* Formas */
  --r-sm: 4px;
  --r:    7px;
  --r-lg: 11px;

  --sh-1: 0 1px 2px rgba(16,29,46,.05), 0 1px 3px rgba(16,29,46,.04);
  --sh-2: 0 2px 4px rgba(16,29,46,.06), 0 6px 16px rgba(16,29,46,.07);
  --sh-3: 0 12px 40px rgba(10,20,32,.20);

  --sidebar-w: 244px;
  --topbar-h:  60px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
p  { margin: 0 0 10px; }

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Numeros alineados en tablas y KPIs */
.num, table td.num, table th.num, .kpi-value, .money {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.num, td.num, th.num { text-align: right; }

.mono { font-family: var(--mono); font-size: .92em; }

/* Utilidades */
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.neutral { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.strong { font-weight: 600; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.center { text-align: center; }
.right { text-align: right; }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.row-b   { display: flex; align-items: center; justify-content: space-between; }
.wrap    { flex-wrap: wrap; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }

.mt-0{margin-top:0}.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}
.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mt-24{margin-top:24px}
.mb-0{margin-bottom:0}.mb-4{margin-bottom:4px}.mb-8{margin-bottom:8px}
.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-20{margin-bottom:20px}

/* Scrollbars discretos */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C8D1DC; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #AEBAC8; }

::selection { background: rgba(168,130,60,.22); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

@media print {
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  .app-main { margin: 0 !important; }
  body { background: #fff; }
}
