/*
 * DAGM Design Tokens — shared by Manage and Sandbox
 * ticket 0125 — design-system-minimo
 *
 * Import BEFORE any app-level stylesheet.
 * App identity overrides --color-primary via .page-manage / .page-sandbox.
 */

:root {
  /* ── Typography scale ─────────────────────────────────────────────────── */
  --font-display-size: 2rem;
  --font-display-weight: 700;
  --font-heading-size: 1.25rem;
  --font-heading-weight: 600;
  --font-body-size: 1rem;
  --font-body-weight: 400;
  --font-caption-size: 0.75rem;
  --font-caption-weight: 400;

  /* ── Spacing scale ────────────────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* ── Semantic colors — shared baseline ───────────────────────────────── */
  /*
   * --color-primary is intentionally NOT set here at :root level.
   * It is set per-app below (.page-manage / .page-sandbox) to preserve
   * the Manage (blue/navy) vs Sandbox (violet) identity distinction.
   */

  /* Status / badge semantics */
  --color-success: #3dd68c;   /* badge GREEN, engine-match, review saved */
  --color-warn:    #f5a623;   /* badge AMBER, Argentina exhibit, informational amber */
  --color-error:   #f07178;   /* badge RED / SUPER RED */

  /* Destructive action (buttons only: Delete plan, Delete client) */
  --color-danger: #cc4444;

  /* Surfaces */
  --color-surface:        #0f1419;   /* page background (Manage default) */
  --color-surface-raised: #1a2332;   /* card / panel */
  --color-border:         #2d3a4f;

  /* Text */
  --color-text:       #e7ecf3;
  --color-text-muted: #8b9cb3;
  /* Text on dark/accent backgrounds */
  --color-on-accent: #ffffff;

  /* Secondary surface for buttons / chips */
  --color-secondary-surface: transparent;
}

/* ── Manage: blue/navy identity ───────────────────────────────────────────── */
.page-manage {
  --color-primary: #3d8bfd;
}

/* ── Sandbox: violet identity ─────────────────────────────────────────────── */
.page-sandbox {
  --color-primary: #8b5cf6;
  /* Sandbox has darker surfaces */
  --color-surface:        #120f1a;
  --color-surface-raised: #1e1830;
  --color-border:         #3d2f5c;
  --color-text:           #ece8f5;
  --color-text-muted:     #a89bc4;
  --color-success:        #34d399;  /* sandbox green is slightly different shade */
}

/* ── Light theme — ticket 0137 ────────────────────────────────────────────── */
/*
 * Palette from design/client-app/mock_home_cliente.html:
 *   carta #F5F6F2 · card #FFFFFF · inchiostro #1C2B33 · ink-soft #5A6A72
 *   line  #E3E6E0 · navy (brand) #24425E
 *   green #2E7D5B · amber #C08A2D · red #B0503F
 *
 * Per-app identities stay in [data-theme="light"] .page-* below.
 */
[data-theme="light"] {
  --color-surface:        #F5F6F2;
  --color-surface-raised: #FFFFFF;
  --color-border:         #E3E6E0;
  --color-text:           #1C2B33;
  --color-text-muted:     #5A6A72;
  --color-on-accent:      #FFFFFF;
  --color-secondary-surface: rgba(0, 0, 0, 0.04);
  /* Badge / status — soft, accessible on light bg */
  --color-success: #2E7D5B;
  --color-warn:    #C08A2D;
  --color-error:   #B0503F;
  --color-danger:  #9A2020;
}

/* Light Manage: navy identity */
[data-theme="light"] .page-manage {
  --color-primary: #24425E;
}

/* Light Sandbox: violet identity (adjusted for light bg) */
[data-theme="light"] .page-sandbox {
  --color-primary:        #6D3FD4;
  --color-surface:        #F2EFF8;
  --color-surface-raised: #FEFCFF;
  --color-border:         #D8D0EE;
  --color-text:           #1A1030;
  --color-text-muted:     #6A5A88;
  --color-success:        #1A7A4A;
}

/*
 * Badge semantic helpers — used by dossier, governance, history snap
 * Align to --color-success / warn / error.
 */
.token-badge-success { color: var(--color-success); border-color: var(--color-success); }
.token-badge-warn    { color: var(--color-warn);    border-color: var(--color-warn);    }
.token-badge-error   { color: var(--color-error);   border-color: var(--color-error);   }
