/*
 * ════════════════════════════════════════════════════════════
 *  FLEAXY DESIGN SYSTEM  v2.0
 *  Tokens + base utilities shared across all pages
 * ════════════════════════════════════════════════════════════
 */

/* ── Tokens ──────────────────────────────────────────────── */
:root {

  /* Brand */
  --brand:       #1f4fd1;
  --brand-dark:  #173ca0;
  --brand-soft:  #e8efff;
  --brand-mid:   rgba(31,79,209,.12);

  /* Neutrals */
  --bg:     #f3f3f5;
  --surface:#ffffff;
  --text:   #161616;
  --text-2: #3a3a3f;
  --muted:  #6c6c72;
  --line:   rgba(22,22,22,.08);
  --line-2: rgba(22,22,22,.14);

  /* Status */
  --s-green:     #1e7c3a;
  --s-green-bg:  #dff4e6;
  --s-yellow:    #9a5f00;
  --s-yellow-bg: #fff1cf;
  --s-red:       #c02000;
  --s-red-bg:    #fde4e2;
  --s-blue:      #1f4fd1;
  --s-blue-bg:   #e8efff;

  /* Accent palette — use sparingly */
  --lilac:   #d7b8f0;
  --lime:    #d8ef73;
  --lavender:#d9b9ea;
  --accent-slate: #4d5fd3;
  --accent-coral: #f4663a;

  /* ── Backward-compatible aliases ── */
  --operation:      var(--brand);
  --operation-dark: var(--brand-dark);
  --operation-soft: var(--brand-soft);
  --nav-dark:       var(--brand);
  --panel:          var(--surface);
  --blue:           var(--accent-slate);
  --orange:         var(--accent-coral);
  --green-soft:     var(--s-green-bg);
  --red-soft:       var(--s-red-bg);
  --yellow-soft:    var(--s-yellow-bg);

  /* Radius — unified scale */
  --r-xl:   20px;   /* primary cards */
  --r-lg:   16px;   /* secondary cards, KPIs */
  --r-md:   12px;   /* inputs, small panels */
  --r-sm:    8px;   /* chips, inline tags */
  --r-pill: 999px;  /* buttons, badges */

  /* Aliases */
  --r:         var(--r-xl);      /* landing legacy */
  --radius-xl: var(--r-xl);      /* app legacy */
  --radius-lg: var(--r-lg);
  --radius-md: var(--r-md);
  --radius-sm: var(--r-md);      /* normalised from 14→12px */

  /* Shadow */
  --sh-sm:    0 2px  8px rgba(10,10,10,.04);
  --sh:       0 8px 24px rgba(10,10,10,.06);
  --sh-lg:    0 16px 40px rgba(10,10,10,.08);
  --sh-brand: 0 4px 16px rgba(31,79,209,.20);
  --shadow:   var(--sh);         /* legacy alias */

  /* Type scale */
  --f-disp: clamp(38px, 5.5vw, 60px);
  --f-h1:   clamp(28px, 3.5vw, 44px);
  --f-h2:   clamp(22px, 2.5vw, 34px);
  --f-h3:   22px;
  --f-xl:   18px;
  --f-lg:   16px;
  --f-base: 15px;
  --f-sm:   14px;
  --f-xs:   13px;
  --f-2xs:  12px;
  --f-3xs:  11px;

  /* Weight */
  --fw-thin:   320;
  --fw-light:  360;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;
  --fw-bold:   700;

  /* Letter spacing */
  --ls-tight:   -.06em;
  --ls-snug:    -.03em;
  --ls-wide:    .06em;
  --ls-wider:   .08em;

  /* Layout */
  --max:          1120px;
  --sidebar-w:    248px;
  --bottom-nav-h: 86px;

  /* Motion */
  --t:      .2s  ease;
  --t-fast: .15s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
html  { scroll-behavior: smooth; }
body  { background: var(--bg); color: var(--text); }
a     { text-decoration: none; color: inherit; }
img   { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; cursor: pointer; }

/* ── Container ──────────────────────────────────────────── */
.w {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* ── Loading skeleton ──────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, #f0f0f2 25%, #e8e8ea 50%, #f0f0f2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Buttons ─────────────────────────────────────────────
   Usage:
     <a class="btn btn-primary">CTA</a>
     <button class="btn btn-outline btn-sm">Filtrar</button>
────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: var(--f-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  transition: var(--t);
  cursor: pointer;
  text-decoration: none;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: var(--f-xs); }
.btn-lg { height: 52px; padding: 0 28px; font-size: var(--f-base); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--sh-brand);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: none; }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-2);
}
.btn-outline:hover { border-color: rgba(31,79,209,.3); color: var(--brand); }

.btn-ghost {
  background: transparent;
  color: var(--brand);
}
.btn-ghost:hover { background: var(--brand-soft); }

.btn-dark {
  background: var(--text);
  color: #fff;
  box-shadow: var(--sh);
}
.btn-dark:hover { opacity: .88; }

/* ── Badges / Tags ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--f-3xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}
.badge-green  { background: var(--s-green-bg);  color: var(--s-green); }
.badge-yellow { background: var(--s-yellow-bg); color: var(--s-yellow); }
.badge-red    { background: var(--s-red-bg);    color: var(--s-red); }
.badge-blue   { background: var(--s-blue-bg);   color: var(--s-blue); }
.badge-neutral{ background: #f0f0f2;            color: var(--muted); }

/* ── Inputs / Select ─────────────────────────────────────
   Use .input and .select classes on inputs/selects
────────────────────────────────────────────────────────── */
.input, .select {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: #fafafc;
  color: var(--text);
  font-size: var(--f-base);
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.input:focus, .select:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ── Eyebrow label ──────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--f-3xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--brand);
}

/* ── Card ────────────────────────────────────────────────
   A unified card shell — use for any panel/card
────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh);
}

/* ── Header (shared) ─────────────────────────────────────
   .hdr  → sticky bar
   .hdr-inner → inner flex row
   .logo → brand wordmark
────────────────────────────────────────────────────────── */
.hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(243,243,245,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.hdr-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-size: 22px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-tight);
  line-height: 1;
}

/* ── Section layout helpers ──────────────────────────────
   .section      → standard section padding
   .section-sm   → tighter section
   .section-hd   → section heading group
────────────────────────────────────────────────────────── */
.section    { padding: 72px 0; }
.section-sm { padding: 40px 0; }
.section-hd { margin-bottom: 44px; }
.section-hd .eyebrow { margin-bottom: 10px; display: block; }

.s-title {
  font-size: var(--f-h1);
  font-weight: var(--fw-thin);
  letter-spacing: var(--ls-tight);
  line-height: .94;
  max-width: 640px;
  margin-bottom: 14px;
}
.s-sub {
  font-size: var(--f-lg);
  line-height: 1.8;
  color: var(--muted);
  max-width: 540px;
}

/* ── Chips ───────────────────────────────────────────────
   Small inline pills for statuses or quick metadata
────────────────────────────────────────────────────────── */
.chip {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: var(--f-2xs);
  font-weight: var(--fw-medium);
  border: 1px solid var(--line);
  background: #fafafc;
  color: var(--text-2);
}
.chip-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip-green { background: var(--s-green-bg); color: var(--s-green); border-color: transparent; }

/* ── Divider ─────────────────────────────────────────────*/
.divider {
  border: none;
  border-top: 1px solid var(--line);
}
