/* ================================================================
   PRIME SMS — DESIGN TOKENS
   The single source of truth for colour, type, spacing and motion.
   Nothing below this file should hard-code a hex value.
================================================================ */

:root {

    /* ── BRAND ────────────────────────────────────────────────
       One accent, used for interactive and selected states only.
       Green is NOT a brand colour here — it is reserved for the
       "delivered" semantic so delivery metrics stay readable.     */
    --brand-50:   #EFF6FF;
    --brand-100:  #DBEAFE;
    --brand-200:  #BFDBFE;
    --brand-300:  #93C5FD;
    --brand-400:  #60A5FA;
    --brand-500:  #3B82F6;
    --brand-600:  #2563EB;   /* primary */
    --brand-700:  #1D4ED8;   /* hover   */
    --brand-800:  #1E40AF;   /* active  */

    --primary:        var(--brand-600);
    --primary-hover:  var(--brand-700);
    --primary-active: var(--brand-800);
    --primary-light:  var(--brand-50);
    --primary-border: var(--brand-200);
    --primary-text:   var(--brand-700);

    /* ── NEUTRALS ─────────────────────────────────────────────
       Slate, not pure grey — it carries a hint of the brand hue
       so greys and blue sit in the same family.                  */
    --slate-50:   #F8FAFC;
    --slate-100:  #F1F5F9;
    --slate-200:  #E2E8F0;
    --slate-300:  #CBD5E1;
    --slate-400:  #94A3B8;
    --slate-500:  #64748B;
    --slate-600:  #475569;
    --slate-700:  #334155;
    --slate-800:  #1E293B;
    --slate-900:  #0F172A;

    /* Text ramp — four steps, in descending emphasis.
       Every step below --tx-1 sits one shade darker than a typical
       slate ramp: the lighter greys were legible on a designer's
       monitor and washed out on everything else. --tx-3 in particular
       carries meta text, hints and table timestamps, so it has to stay
       readable rather than merely "quiet". */
    --tx-1: var(--slate-900);   /* headings, primary values      */
    --tx-2: var(--slate-700);   /* body copy, table cells        */
    --tx-3: var(--slate-500);   /* meta, timestamps, hints       */
    --tx-4: var(--slate-400);   /* placeholders, disabled, dashes*/

    /* Surfaces */
    --bg:            var(--slate-50);    /* page canvas   */
    --surface:       #FFFFFF;            /* cards, panels */
    --surface-sunk:  var(--slate-50);    /* table heads   */
    --surface-hover: var(--slate-100);

    /* Lines */
    --border:        var(--slate-200);
    --border-strong: var(--slate-300);
    --border-subtle: var(--slate-100);

    /* ── SEMANTIC ─────────────────────────────────────────────
       Mapped to the delivery funnel: sent → delivered → read,
       with failed as the terminal error state.                   */
    --success:       #16A34A;
    --success-bg:    #F0FDF4;
    --success-border:#BBF7D0;
    --success-text:  #15803D;

    --warning:       #D97706;
    --warning-bg:    #FFFBEB;
    --warning-border:#FDE68A;
    --warning-text:  #B45309;

    --danger:        #DC2626;
    --danger-bg:     #FEF2F2;
    --danger-border: #FECACA;
    --danger-text:   #B91C1C;

    --info:          var(--brand-600);
    --info-bg:       var(--brand-50);
    --info-border:   var(--brand-200);
    --info-text:     var(--brand-700);

    --red: var(--danger);        /* required-field asterisks */

    /* ── TYPE ─────────────────────────────────────────────────
       Two faces, each doing one job:
         display — Plus Jakarta Sans. Geometric and heavy, carries all
                   headings, stat values and brand marks. This is what
                   gives the product a voice instead of a default look.
         sans    — Inter. Body copy, table cells, form fields, numbers.
                   Chosen for legibility at 13–14px and true tabular
                   figures, which a display face does badly.           */
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

    --fs-h1:   1.5625rem; /* 25 — page titles          */
    --fs-h2:   1.125rem;  /* 18 — card / section heads */
    --fs-h3:   1rem;      /* 16 — sub-heads            */
    --fs-body: 0.9375rem; /* 15 — default              */
    --fs-sm:   0.875rem;  /* 14 — meta                 */
    --fs-xs:   0.75rem;   /* 12 — labels, badges       */

    --lh-tight: 1.2;
    --lh-snug:  1.4;
    --lh-body:  1.55;

    --fw-normal:   400;
    --fw-medium:   500;
    --fw-semibold: 600;
    --fw-bold:     700;
    --fw-black:    800;   /* display headings only */

    /* Optical tracking — tighten as size grows, open up for caps. */
    --ls-h1:   -0.025em;
    --ls-h2:   -0.015em;
    --ls-caps:  0.07em;

    /* ── SPACING ──────────────────────────────────────────────
       4px base. Use these, never arbitrary px.                   */
    --sp-1:  0.25rem;   /*  4 */
    --sp-2:  0.5rem;    /*  8 */
    --sp-3:  0.75rem;   /* 12 */
    --sp-4:  1rem;      /* 16 */
    --sp-5:  1.25rem;   /* 20 */
    --sp-6:  1.5rem;    /* 24 */
    --sp-8:  2rem;      /* 32 */
    --sp-10: 2.5rem;    /* 40 */
    --sp-12: 3rem;      /* 48 */
    --sp-16: 4rem;      /* 64 */

    /* ── RADIUS ───────────────────────────────────────────────
       Tighter than a marketing site. Soft, rounded panels read as
       "web page"; a tool reads as crisp.                          */
    --r-xs:   3px;
    --r-sm:   4px;
    --r-md:   6px;
    --r-lg:   8px;
    --r-xl:   10px;
    --r-full: 999px;

    /* ── DENSITY ──────────────────────────────────────────────
       The numbers that decide whether this feels like a data tool
       or a landing page. Change these to retune the whole app.    */
    --row-py:     11px;   /* table cell vertical padding   */
    --row-px:     15px;   /* table cell horizontal padding */
    --head-py:     9px;   /* table header vertical padding */
    --card-pad:   21px;   /* default card inner padding    */
    --control-h:  38px;   /* inputs, buttons, selects      */

    /* ── ELEVATION ────────────────────────────────────────────
       Layered and low-opacity. A CRM should feel flat and calm;
       shadow marks hierarchy, never decoration.                  */
    --sh-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.04),
             0 1px 3px rgba(15, 23, 42, 0.06);
    --sh-md: 0 2px 4px rgba(15, 23, 42, 0.04),
             0 4px 12px rgba(15, 23, 42, 0.06);
    --sh-lg: 0 4px 8px rgba(15, 23, 42, 0.04),
             0 12px 28px rgba(15, 23, 42, 0.10);
    --sh-xl: 0 8px 16px rgba(15, 23, 42, 0.06),
             0 24px 48px rgba(15, 23, 42, 0.14);

    /* Focus ring — one definition, applied to every interactive. */
    --ring: 0 0 0 3px rgba(79, 70, 229, 0.20);
    --ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.18);

    /* ── MOTION ───────────────────────────────────────────────── */
    --ease:    cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out:cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 120ms;
    --dur:      180ms;
    --dur-slow: 280ms;

    /* ── LAYOUT ───────────────────────────────────────────────── */
    --sidebar-w: 244px;
    --topbar-h:  60px;
    --content-max: 1440px;

    /* ── Z-INDEX ──────────────────────────────────────────────── */
    --z-topbar:   100;
    --z-overlay:  150;
    --z-sidebar:  200;
    --z-modal:    300;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --dur-fast: 0ms;
        --dur:      0ms;
        --dur-slow: 0ms;
    }
}
