/* ============================================================
   Jacy Design System — "Vibrant Red" theme
   Tokens, base, components & motion that complement Tailwind.
   See docs/DESIGN.md for the full spec.
   ============================================================ */

:root {
    /* Brand — vibrant red */
    --brand-50:  #fff1f2;
    --brand-100: #ffe1e3;
    --brand-200: #ffc7cb;
    --brand-300: #ff9aa1;
    --brand-400: #ff5e69;
    --brand-500: #f5232e;   /* primary */
    --brand-600: #de1622;
    --brand-700: #b90f1a;
    --brand-800: #991018;
    --brand-900: #7e141a;

    /* Neutrals (ink) */
    --ink-50:  #f8fafc;
    --ink-100: #f1f5f9;
    --ink-200: #e2e8f0;
    --ink-400: #94a3b8;
    --ink-500: #64748b;
    --ink-700: #334155;
    --ink-900: #0f172a;

    /* Semantic */
    --ok:    #10b981;
    --warn:  #f59e0b;
    --info:  #3b82f6;
    --danger:#ef4444;

    /* Effects */
    --ring: 0 0 0 4px rgba(245, 35, 46, .18);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, .15);
    --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .25);
    --shadow-glow: 0 12px 30px -8px rgba(245, 35, 46, .45);
    --radius: 18px;
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink-900);
    background-color: #fbfbfd;
    /* layered red glow mesh */
    background-image:
        radial-gradient(60rem 60rem at 110% -10%, rgba(245, 35, 46, .10), transparent 55%),
        radial-gradient(45rem 45rem at -10% 0%, rgba(255, 94, 105, .10), transparent 50%),
        radial-gradient(40rem 40rem at 50% 120%, rgba(245, 35, 46, .06), transparent 60%);
    background-attachment: fixed;
}

h1, h2, h3, .font-display {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -.02em;
}

/* ---------- Surfaces ---------- */
.card {
    background: #fff;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.card-glass {
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.hover-lift { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ---------- Brand text & accents ---------- */
.text-brand { color: var(--brand-600); }
.brand-gradient-text {
    background: linear-gradient(100deg, var(--brand-500), var(--brand-700));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-bar {
    height: 4px; border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-weight: 600; border-radius: 12px; padding: .6rem 1.1rem;
    transition: transform .15s, box-shadow .2s, background .2s, color .2s;
    cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
    color: #fff;
    background: linear-gradient(120deg, var(--brand-500), var(--brand-700));
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 16px 36px -8px rgba(245,35,46,.55); }
.btn-ghost {
    color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100);
}
.btn-ghost:hover { background: var(--brand-100); }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 9px; }

/* ---------- Inputs ---------- */
.field {
    width: 100%; padding: .8rem 1rem; border-radius: 12px;
    border: 1px solid var(--ink-200); background: #fff; color: var(--ink-900);
    transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--ink-400); }
.field:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .2rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; line-height: 1.2; text-transform: capitalize;
}
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 99px; background: currentColor; opacity: .9; }
.badge-ok      { color: #047857; background: #d1fae5; }
.badge-warn    { color: #b45309; background: #fef3c7; }
.badge-info    { color: #1d4ed8; background: #dbeafe; }
.badge-danger  { color: #b91c1c; background: #fee2e2; }
.badge-muted   { color: var(--ink-500); background: var(--ink-100); }

/* ---------- Nav pills ---------- */
.navpill {
    padding: .5rem .9rem; border-radius: 11px; font-weight: 600; font-size: .9rem;
    color: var(--ink-500); transition: background .15s, color .15s;
}
.navpill:hover { background: var(--ink-100); color: var(--ink-900); }
.navpill-active {
    color: #fff; background: linear-gradient(120deg, var(--brand-500), var(--brand-700));
    box-shadow: var(--shadow-glow);
}

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.tbl thead th {
    text-align: left; padding: .75rem 1rem; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400);
    background: var(--ink-50); border-bottom: 1px solid var(--ink-200);
}
.tbl tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--brand-50); }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* ---------- Misc ---------- */
.kpi-icon {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.25rem;
}
.dot { width: .55rem; height: .55rem; border-radius: 99px; display: inline-block; }
.dot-on  { background: var(--ok);     box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.dot-off { background: var(--ink-400);box-shadow: 0 0 0 4px rgba(148,163,184,.18); }

/* ---------- Motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.anim-up { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }
.anim-up-1 { animation-delay: .05s; }
.anim-up-2 { animation-delay: .10s; }
.anim-up-3 { animation-delay: .15s; }
.anim-up-4 { animation-delay: .20s; }

@keyframes floatPulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.anim-float { animation: floatPulse 4s ease-in-out infinite; }

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

/* Hide scrollbar (used by the horizontally-scrolling nav tab strip). */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-300); }

/* ---------- Responsive ---------- */
/* Wide tables scroll horizontally inside their .overflow-x-auto card wrappers.
   Keep cells on one line so columns stay aligned while scrolling on phones. */
.tbl { -webkit-overflow-scrolling: touch; }
.tbl thead th, .tbl tbody td { white-space: nowrap; }
/* Allow the proof/SMS column to wrap — it holds long free text. */
.tbl td.cell-wrap { white-space: normal; min-width: 12rem; }

@media (max-width: 640px) {
    .tbl { font-size: .8rem; }
    .tbl thead th { padding: .5rem .6rem; font-size: .62rem; }
    .tbl tbody td { padding: .6rem; }
    .navpill { padding: .42rem .7rem; font-size: .82rem; }
    .btn { padding: .5rem .85rem; }
    .btn-sm { padding: .3rem .6rem; }
    .kpi-icon { width: 36px; height: 36px; font-size: 1.05rem; }
}
