/* =================================================================
   DMS Dashboard
   Restrained · professional · alive
   ================================================================= */
:root {
    --d-ink:       #0f172a;
    --d-ink-2:     #334155;
    --d-ink-3:     #64748b;
    --d-ink-4:     #94a3b8;
    --d-bg:        #f8fafc;
    --d-surface:   #ffffff;
    --d-surface-2: #f6f8fb;
    --d-surface-3: #eef2f7;
    --d-border:    rgb(15 23 42 / .07);
    --d-border-2:  rgb(15 23 42 / .12);
    --d-accent:    #1d4ed8;
    --d-accent-2:  #2563eb;
    --d-accent-soft: rgb(29 78 216 / .08);
    --d-success:   #16a34a;
    --d-success-soft: rgb(22 163 74 / .10);
    --d-warning:   #d97706;
    --d-warning-soft: rgb(217 119 6 / .10);
    --d-danger:    #dc2626;
    --d-danger-soft: rgb(220 38 38 / .10);
    --d-mono:      'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --d-radius:    12px;
    --d-radius-sm: 8px;
    --d-shadow-1:  0 1px 2px rgb(15 23 42 / .04), 0 0 0 1px var(--d-border);
    --d-shadow-2:  0 4px 16px -8px rgb(15 23 42 / .12), 0 0 0 1px var(--d-border);
    --d-shadow-3:  0 12px 36px -12px rgb(15 23 42 / .25), 0 0 0 1px rgb(15 23 42 / .08);
}
.dash-page { padding-bottom: 60px; background: var(--d-bg); }

/* ============================
   HERO
   ============================ */
.dash-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--d-border);
}
.dash-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.dash-hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at 70% 0%, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 0%, black 0%, transparent 70%);
}
.dash-hero-glow {
    position: absolute;
    width: 480px; height: 480px; border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
}
.dash-hero-glow-1 {
    top: -160px; right: -80px;
    background: radial-gradient(circle, rgba(29,78,216,.10) 0%, transparent 65%);
    animation: dashGlow 14s ease-in-out infinite alternate;
}
.dash-hero-glow-2 {
    top: -80px; left: 20%;
    background: radial-gradient(circle, rgba(20,184,166,.06) 0%, transparent 65%);
    animation: dashGlow 18s 2s ease-in-out infinite alternate-reverse;
}
@keyframes dashGlow {
    0%   { transform: translate3d(0,0,0) scale(1); opacity: .65; }
    100% { transform: translate3d(-30px,20px,0) scale(1.08); opacity: .85; }
}

.dash-hero-inner {
    position: relative; z-index: 1;
    max-width: 1480px; margin: 0 auto;
    padding: 36px 28px 28px;
    display: grid; grid-template-columns: 1fr auto;
    gap: 28px; align-items: flex-start;
}

.dash-breadcrumb {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--d-ink-4);
    letter-spacing: .04em; text-transform: uppercase; font-weight: 500;
    margin-bottom: 10px;
    animation: dashFadeUp .55s ease both;
}
.dash-breadcrumb-active { color: var(--d-ink-2); font-weight: 600; }

.dash-title {
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--d-ink);
    font-weight: 600;
    margin: 0 0 10px;
    max-width: 820px;
    animation: dashFadeUp .6s .06s ease both;
}
.dash-accent {
    background: linear-gradient(90deg, var(--d-ink) 0%, var(--d-accent) 110%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-sub {
    color: var(--d-ink-3);
    font-size: 13.5px; line-height: 1.5;
    max-width: 680px;
    margin: 0 0 20px;
    animation: dashFadeUp .65s .12s ease both;
}

/* Live policy strip */
.dash-policy-strip {
    display: inline-flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--d-surface);
    box-shadow: var(--d-shadow-1);
    animation: dashFadeUp .7s .18s ease both;
}
.dash-policy-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
}
.dash-policy-pill-live {
    color: var(--d-success);
    background: var(--d-success-soft);
    box-shadow: inset 0 0 0 1px rgb(22 163 74 / .22);
}
.dash-policy-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--d-success);
    box-shadow: 0 0 0 0 rgb(22 163 74 / .6);
    animation: dashLive 1.8s ease-out infinite;
}
@keyframes dashLive {
    0%   { box-shadow: 0 0 0 0 rgb(22 163 74 / .55); }
    70%  { box-shadow: 0 0 0 7px rgb(22 163 74 / 0); }
    100% { box-shadow: 0 0 0 0 rgb(22 163 74 / 0); }
}
.dash-policy-name {
    display: flex; flex-direction: column; gap: 1px;
    line-height: 1.2;
}
.dash-policy-name strong {
    color: var(--d-ink);
    font-size: 13px; font-weight: 600;
}
.dash-policy-name small {
    color: var(--d-ink-3);
    font-size: 11px;
}
.dash-policy-stats {
    display: inline-flex; align-items: center; gap: 12px;
    font-family: var(--d-mono);
    font-size: 12px; color: var(--d-ink-3);
    padding-left: 14px;
    border-left: 1px solid var(--d-border);
}
.dash-policy-stats strong { color: var(--d-ink); font-weight: 600; }
.dash-policy-sep { width: 1px; height: 14px; background: var(--d-border); }
.dash-policy-sandbox {
    color: var(--d-warning); font-size: 11.5px;
    display: inline-flex; align-items: center; gap: 5px;
}

/* Hero right (clock + CTA) */
.dash-hero-right {
    display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
    animation: dashFadeUp .65s .24s ease both;
}
.dash-clock {
    text-align: right;
    line-height: 1.05;
    padding: 10px 14px;
    background: var(--d-surface);
    border-radius: 10px;
    box-shadow: var(--d-shadow-1);
    min-width: 200px;
}
.dash-clock-label {
    display: block;
    font-size: 10px; color: var(--d-ink-4);
    letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.dash-clock-time {
    display: block;
    font-family: var(--d-mono);
    font-size: 22px; font-weight: 600;
    color: var(--d-ink);
    letter-spacing: -.02em;
    margin: 4px 0 2px;
}
.dash-clock-date { font-size: 11px; color: var(--d-ink-3); font-family: var(--d-mono); }

.dash-hero-cta { display: flex; gap: 10px; }
.dash-btn-primary, .dash-btn-secondary {
    position: relative; overflow: hidden;
    border: 0; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 500; font-size: 13px;
    transition: transform .15s ease, box-shadow .15s ease, color .15s ease;
    text-decoration: none;
}
.dash-btn-primary {
    padding: 10px 14px; border-radius: 10px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(15,23,42,.50), inset 0 0 0 1px rgba(255,255,255,.08);
}
.dash-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(15,23,42,.55), inset 0 0 0 1px rgba(255,255,255,.10); }
.dash-btn-shine {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.16) 50%, transparent 75%);
    transform: translateX(-110%);
    animation: dashShine 3.5s ease-in-out infinite;
}
@keyframes dashShine { 0%, 35% { transform: translateX(-110%); } 65%, 100% { transform: translateX(110%); } }
.dash-btn-primary > i, .dash-btn-primary > span:not(.dash-btn-shine) { position: relative; z-index: 1; }
.dash-btn-secondary {
    padding: 10px 14px; border-radius: 10px;
    background: var(--d-surface); color: var(--d-ink-2);
    box-shadow: var(--d-shadow-1);
}
.dash-btn-secondary:hover { color: var(--d-ink); box-shadow: var(--d-shadow-2); transform: translateY(-1px); }
.dash-btn-secondary i { color: var(--d-ink-4); }
.dash-btn-secondary:hover i { color: var(--d-ink-2); }

@keyframes dashFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dashFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dashSlideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }

/* ============================
   KPI STRIP
   ============================ */
.dash-kpis {
    max-width: 1480px; margin: 22px auto 0;
    padding: 0 28px;
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
.dash-kpi {
    position: relative;
    background: var(--d-surface);
    border-radius: var(--d-radius);
    box-shadow: var(--d-shadow-1);
    padding: 14px 14px 6px;
    overflow: hidden;
    animation: dashFadeUp .55s calc(.05s + var(--i, 0) * .04s) ease both;
    transition: transform .15s ease, box-shadow .15s ease;
}
.dash-kpi:hover { transform: translateY(-2px); box-shadow: var(--d-shadow-2); }
.dash-kpi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dash-kpi-icon {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px;
    box-shadow: inset 0 0 0 1px rgb(29 78 216 / .12);
}
.dash-kpi-label {
    font-size: 11px; color: var(--d-ink-3);
    font-weight: 500;
    letter-spacing: -.005em;
}
.dash-kpi-body { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.dash-kpi-value {
    font-family: var(--d-mono);
    font-size: 22px; font-weight: 600;
    color: var(--d-ink);
    letter-spacing: -.025em;
    line-height: 1.1;
}
.dash-kpi-delta {
    display: inline-flex; align-items: center; gap: 3px;
    font-family: var(--d-mono);
    font-size: 10.5px; font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
}
.dash-kpi-delta.up   { color: var(--d-success); background: var(--d-success-soft); }
.dash-kpi-delta.down { color: var(--d-danger);  background: var(--d-danger-soft); }
.dash-kpi-delta i { font-size: 8px; }
.dash-kpi-spark {
    width: 100%; height: 32px;
    margin-top: 6px;
    overflow: visible;
}
.dash-kpi-spark .spark-line {
    fill: none;
    stroke: var(--d-accent);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: dashDraw 1.6s .35s cubic-bezier(.4,0,.2,1) forwards;
}
.dash-kpi-spark .spark-area {
    fill: rgba(29,78,216,.08);
    opacity: 0;
    animation: dashFadeIn .8s .9s ease forwards;
}
.dash-kpi-spark .spark-dot {
    fill: var(--d-accent);
    opacity: 0;
    animation: dashFadeIn .4s 1.6s ease forwards;
}
@keyframes dashDraw { to { stroke-dashoffset: 0; } }

/* ============================
   GRID
   ============================ */
.dash-grid {
    max-width: 1480px; margin: 18px auto 0;
    padding: 0 28px;
    display: grid; grid-template-columns: minmax(0, 1fr) 380px;
    gap: 16px;
    align-items: start;
}
.dash-col-main { display: flex; flex-direction: column; gap: 14px; }
.dash-col-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.dash-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ============================
   GENERIC CARD
   ============================ */
.dash-card {
    background: var(--d-surface);
    border-radius: var(--d-radius);
    box-shadow: var(--d-shadow-1);
    overflow: hidden;
    animation: dashFadeUp .55s ease both;
}
.dash-card-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--d-border);
}
.dash-card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dash-card-eyebrow {
    font-size: 10.5px; color: var(--d-ink-4);
    letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
    margin-bottom: 3px;
    display: inline-flex; align-items: center; gap: 6px;
}
.dash-card-title {
    font-size: 15px; font-weight: 600; color: var(--d-ink);
    letter-spacing: -.018em;
}
.dash-card-sub {
    font-size: 12px; color: var(--d-ink-3);
    margin-top: 3px;
}
.dash-card-link {
    font-size: 11.5px;
    color: var(--d-ink-3);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px;
    border-radius: 6px;
    transition: all .15s ease;
}
.dash-card-link:hover { background: var(--d-accent-soft); color: var(--d-accent); }
.dash-mini-btn {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    background: var(--d-surface-2);
    border: 0; cursor: pointer;
    font-size: 10px; color: var(--d-ink-3);
    transition: all .15s ease;
}
.dash-mini-btn:hover { background: var(--d-surface-3); color: var(--d-ink); }

/* ============================
   FUNNEL
   ============================ */
.dash-funnel-summary { text-align: right; }
.dash-funnel-summary-num {
    display: block;
    font-family: var(--d-mono);
    font-size: 22px; font-weight: 600;
    color: var(--d-ink);
    letter-spacing: -.02em;
    line-height: 1;
}
.dash-funnel-summary-lbl {
    font-size: 10px; color: var(--d-ink-4);
    letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.dash-funnel {
    padding: 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.dash-funnel-row {
    display: grid;
    grid-template-columns: 180px 1fr 90px 70px;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    animation: dashSlideIn .55s calc(.1s + var(--i, 0) * .07s) ease both;
}
.dash-funnel-label {
    font-size: 12.5px; color: var(--d-ink-2);
    font-weight: 500;
}
.dash-funnel-bar-wrap {
    position: relative;
    height: 24px;
    background: var(--d-surface-2);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--d-border);
}
.dash-funnel-bar {
    position: absolute; inset: 0 auto 0 0;
    width: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--c1), var(--c2));
    transition: width 1.1s cubic-bezier(.2,.7,.2,1);
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 8px;
}
.dash-funnel-bar::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.25) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: dashShine 2.8s ease-in-out infinite;
    animation-delay: calc(.6s + var(--i, 0) * .08s);
}
.dash-funnel-count {
    font-family: var(--d-mono);
    font-size: 13px; font-weight: 600;
    color: var(--d-ink);
    text-align: right;
}
.dash-funnel-pct {
    font-family: var(--d-mono);
    font-size: 11px; color: var(--d-ink-3);
    text-align: right;
    padding: 2px 8px;
    background: var(--d-surface-2);
    border-radius: 999px;
    display: inline-flex; justify-content: center;
}

/* ============================
   HISTOGRAM (SCORE BANDS)
   ============================ */
.dash-hist {
    padding: 18px 16px 18px;
    display: flex; align-items: flex-end; gap: 8px;
    height: 220px;
}
.dash-hist-col {
    flex: 1;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    min-width: 0;
    cursor: pointer;
    position: relative;
}
.dash-hist-bar-wrap {
    flex: 1;
    display: flex; align-items: flex-end;
    position: relative;
}
.dash-hist-bar {
    width: 100%;
    height: 0%;
    border-radius: 6px 6px 0 0;
    background: var(--bar-color, var(--d-accent));
    transition: height 1.1s cubic-bezier(.2,.7,.2,1), transform .15s ease, filter .15s ease;
    position: relative;
}
.dash-hist-col:hover .dash-hist-bar { transform: scaleY(1.02); transform-origin: bottom; filter: brightness(1.08); }
.dash-hist-bar[data-tone="accent"]  { --bar-color: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.dash-hist-bar[data-tone="success"] { --bar-color: linear-gradient(180deg, #34d399, #16a34a); }
.dash-hist-bar[data-tone="warning"] { --bar-color: linear-gradient(180deg, #fbbf24, #d97706); }
.dash-hist-bar[data-tone="danger"]  { --bar-color: linear-gradient(180deg, #f87171, #dc2626); }
.dash-hist-bar[data-tone="neutral"] { --bar-color: linear-gradient(180deg, #94a3b8, #64748b); }
.dash-hist-bar { background: var(--bar-color, var(--d-accent)); }
.dash-hist-count {
    font-family: var(--d-mono);
    font-size: 11px; font-weight: 600;
    color: var(--d-ink);
    text-align: center;
    opacity: 0;
    animation: dashFadeIn .35s 1.0s ease forwards;
}
.dash-hist-label {
    font-family: var(--d-mono);
    font-size: 10px; color: var(--d-ink-4);
    text-align: center;
    letter-spacing: -.02em;
}

/* ============================
   DONUT
   ============================ */
.dash-donut-wrap {
    position: relative;
    width: 200px; height: 200px;
    margin: 14px auto 6px;
}
.dash-donut { width: 100%; height: 100%; }
.dash-donut-slice {
    fill: none;
    stroke-width: 14;
    transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1), stroke-width .2s ease;
    transform-origin: center;
}
.dash-donut-slice:hover { stroke-width: 18; }
.dash-donut-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    pointer-events: none;
}
.dash-donut-num {
    font-family: var(--d-mono);
    font-size: 26px; font-weight: 600;
    color: var(--d-ink);
    letter-spacing: -.02em;
    line-height: 1;
}
.dash-donut-lbl {
    font-size: 10.5px; color: var(--d-ink-3);
    letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
    margin-top: 4px;
}
.dash-donut-legend {
    padding: 0 16px 16px;
    list-style: none;
    margin: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.dash-donut-legend-item {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    gap: 8px; align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background .15s ease;
    animation: dashSlideIn .5s calc(.4s + var(--i, 0) * .08s) ease both;
}
.dash-donut-legend-item:hover { background: var(--d-surface-2); }
.dash-donut-swatch {
    width: 10px; height: 10px; border-radius: 3px;
}
.dash-donut-name {
    font-size: 12.5px; font-weight: 600; color: var(--d-ink);
}
.dash-donut-meta {
    font-size: 11px; color: var(--d-ink-4);
    font-family: var(--d-mono);
}
.dash-donut-count {
    font-family: var(--d-mono);
    font-size: 13px; font-weight: 600;
    color: var(--d-ink);
    min-width: 50px; text-align: right;
}

/* ============================
   DECLINE REASONS
   ============================ */
.dash-reasons {
    padding: 12px 16px 16px;
    margin: 0; list-style: none;
    display: flex; flex-direction: column; gap: 8px;
}
.dash-reason {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
    animation: dashSlideIn .5s calc(.1s + var(--i, 0) * .06s) ease both;
}
.dash-reason-code {
    font-family: var(--d-mono);
    font-size: 11px; font-weight: 600;
    color: var(--d-ink);
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--d-surface-2);
    text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-reason-bar-wrap {
    height: 18px;
    background: var(--d-surface-2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 0 1px var(--d-border);
}
.dash-reason-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: var(--c, var(--d-accent));
    transition: width 1.1s cubic-bezier(.2,.7,.2,1);
    display: flex; align-items: center; padding-left: 8px;
    color: #fff;
    font-size: 10.5px; font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(15,23,42,.20);
}
.dash-reason-bar[data-tone="warning"] { --c: linear-gradient(90deg, #fbbf24, #d97706); }
.dash-reason-bar[data-tone="danger"]  { --c: linear-gradient(90deg, #f87171, #dc2626); }
.dash-reason-count {
    font-family: var(--d-mono);
    font-size: 12.5px; font-weight: 600;
    color: var(--d-ink);
    text-align: right;
}

/* ============================
   TICKER (Live decisions)
   ============================ */
.dash-ticker-card { display: flex; flex-direction: column; max-height: 480px; }
.dash-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--d-success);
    animation: dashLive 1.8s ease-out infinite;
}
.dash-ticker {
    list-style: none; margin: 0;
    padding: 6px 6px 10px;
    overflow-y: auto;
    flex: 1;
    max-height: 380px;
}
.dash-ticker::-webkit-scrollbar { width: 8px; }
.dash-ticker::-webkit-scrollbar-track { background: transparent; }
.dash-ticker::-webkit-scrollbar-thumb { background: var(--d-border-2); border-radius: 4px; }
.dash-ticker-item {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 10px; align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    margin: 2px 0;
    transition: background .15s ease;
    animation: dashTickerEnter .45s cubic-bezier(.2,.7,.2,1) both;
}
.dash-ticker-item:hover { background: var(--d-surface-2); }
@keyframes dashTickerEnter {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dash-ticker-icon {
    width: 22px; height: 22px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px;
    color: #fff;
}
.dash-ticker-icon[data-decision="APPROVED"] { background: linear-gradient(135deg, #34d399, #16a34a); }
.dash-ticker-icon[data-decision="DECLINED"] { background: linear-gradient(135deg, #f87171, #dc2626); }
.dash-ticker-icon[data-decision="REFERRED"] { background: linear-gradient(135deg, #fbbf24, #d97706); }
.dash-ticker-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-ticker-app {
    font-family: var(--d-mono);
    font-size: 11.5px; font-weight: 600;
    color: var(--d-ink);
}
.dash-ticker-meta {
    font-family: var(--d-mono);
    font-size: 10.5px; color: var(--d-ink-3);
    display: flex; gap: 6px;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.dash-ticker-meta strong { color: var(--d-ink-2); font-weight: 500; }
.dash-ticker-when {
    font-family: var(--d-mono);
    font-size: 10px;
    color: var(--d-ink-4);
    text-align: right;
    white-space: nowrap;
}

/* ============================
   SYSTEM PULSE
   ============================ */
.dash-pulse {
    padding: 14px 16px 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.dash-pulse-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 8px 4px;
    border-radius: 8px;
    background: var(--d-surface-2);
    box-shadow: inset 0 0 0 1px var(--d-border);
    transition: transform .15s ease, box-shadow .15s ease;
}
.dash-pulse-item:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--d-border-2), 0 2px 8px -4px rgba(15,23,42,.10); }
.dash-pulse-ring {
    width: 60px; height: 60px;
    transform: rotate(-90deg);
}
.dash-pulse-track {
    fill: none; stroke: var(--d-surface-3); stroke-width: 4;
}
.dash-pulse-arc {
    fill: none;
    stroke: var(--d-accent);
    stroke-width: 4; stroke-linecap: round;
    transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1), stroke .25s ease;
    filter: drop-shadow(0 0 4px rgba(29,78,216,.25));
}
.dash-pulse-arc[data-good-state="good"]    { stroke: var(--d-success); filter: drop-shadow(0 0 4px rgba(22,163,74,.25)); }
.dash-pulse-arc[data-good-state="warning"] { stroke: var(--d-warning); }
.dash-pulse-arc[data-good-state="bad"]     { stroke: var(--d-danger); }
.dash-pulse-meta {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dash-pulse-label {
    font-size: 10px; color: var(--d-ink-3);
    display: inline-flex; align-items: center; gap: 5px;
}
.dash-pulse-label i { color: var(--d-ink-4); font-size: 9px; }
.dash-pulse-val {
    font-family: var(--d-mono);
    font-size: 14px; font-weight: 600;
    color: var(--d-ink);
    letter-spacing: -.02em;
}

/* ============================
   ACTIVITY
   ============================ */
.dash-activity {
    margin: 0; padding: 8px 14px 14px;
    list-style: none;
    position: relative;
}
.dash-activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 12px;
    padding: 8px 0;
    animation: dashSlideIn .5s calc(.1s + var(--i, 0) * .06s) ease both;
}
.dash-activity-rail {
    position: absolute;
    left: 12px; top: 32px; bottom: -8px;
    width: 1px;
    background: var(--d-border);
}
.dash-activity-item:last-child .dash-activity-rail { display: none; }
.dash-activity-icon {
    z-index: 1;
    width: 26px; height: 26px;
    border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px;
    background: var(--d-surface);
    box-shadow: inset 0 0 0 1px var(--d-border);
}
.dash-activity-item[data-tone="success"] .dash-activity-icon { color: var(--d-success); background: var(--d-success-soft); box-shadow: inset 0 0 0 1px rgb(22 163 74 / .22); }
.dash-activity-item[data-tone="accent"]  .dash-activity-icon { color: var(--d-accent);  background: var(--d-accent-soft);  box-shadow: inset 0 0 0 1px rgb(29 78 216 / .22); }
.dash-activity-item[data-tone="warning"] .dash-activity-icon { color: var(--d-warning); background: var(--d-warning-soft); box-shadow: inset 0 0 0 1px rgb(217 119 6 / .22); }
.dash-activity-item[data-tone="neutral"] .dash-activity-icon { color: var(--d-ink-3); }
.dash-activity-body { padding-top: 2px; }
.dash-activity-msg {
    font-size: 12.5px; color: var(--d-ink-2);
    line-height: 1.45;
}
.dash-activity-msg strong { color: var(--d-ink); font-weight: 600; }
.dash-activity-msg code {
    font-family: var(--d-mono);
    font-size: 11px;
    background: var(--d-surface-2);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--d-ink);
    box-shadow: inset 0 0 0 1px var(--d-border);
}
.dash-activity-when {
    font-family: var(--d-mono);
    font-size: 10.5px;
    color: var(--d-ink-4);
    margin-top: 2px;
}

/* ============================
   MODULE TILES
   ============================ */
.dash-modules {
    max-width: 1480px; margin: 18px auto 0;
    padding: 0 28px;
}
.dash-modules-head { margin: 8px 0 14px; }
.dash-modules-title {
    font-size: 18px; font-weight: 600; color: var(--d-ink);
    letter-spacing: -.02em; margin: 0;
}
.dash-modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.dash-mod {
    background: var(--d-surface);
    border-radius: var(--d-radius);
    box-shadow: var(--d-shadow-1);
    padding: 16px;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
    overflow: hidden;
    animation: dashFadeUp .55s calc(.1s + var(--i, 0) * .05s) ease both;
}
.dash-mod::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--g);
    filter: blur(40px);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.dash-mod[data-tone="sapphire"] { --g: radial-gradient(circle, rgba(29,78,216,.20) 0%, transparent 70%); }
.dash-mod[data-tone="indigo"]   { --g: radial-gradient(circle, rgba(99,102,241,.20) 0%, transparent 70%); }
.dash-mod[data-tone="violet"]   { --g: radial-gradient(circle, rgba(139,92,246,.20) 0%, transparent 70%); }
.dash-mod[data-tone="teal"]     { --g: radial-gradient(circle, rgba(20,184,166,.20) 0%, transparent 70%); }
.dash-mod[data-tone="amber"]    { --g: radial-gradient(circle, rgba(245,158,11,.20) 0%, transparent 70%); }
.dash-mod[data-tone="emerald"]  { --g: radial-gradient(circle, rgba(16,185,129,.20) 0%, transparent 70%); }
.dash-mod:hover { transform: translateY(-3px); box-shadow: var(--d-shadow-2); }
.dash-mod:hover::before { opacity: 1; }
.dash-mod-head {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px; align-items: center;
    margin-bottom: 12px;
    position: relative; z-index: 1;
}
.dash-mod-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 14px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    box-shadow: 0 4px 12px -4px var(--c1);
}
.dash-mod[data-tone="sapphire"] .dash-mod-icon { --c1: #3b82f6; --c2: #1d4ed8; }
.dash-mod[data-tone="indigo"]   .dash-mod-icon { --c1: #6366f1; --c2: #4338ca; }
.dash-mod[data-tone="violet"]   .dash-mod-icon { --c1: #a78bfa; --c2: #7c3aed; }
.dash-mod[data-tone="teal"]     .dash-mod-icon { --c1: #2dd4bf; --c2: #0d9488; }
.dash-mod[data-tone="amber"]    .dash-mod-icon { --c1: #fbbf24; --c2: #d97706; }
.dash-mod[data-tone="emerald"]  .dash-mod-icon { --c1: #34d399; --c2: #059669; }
.dash-mod-name {
    font-size: 14px; font-weight: 600; color: var(--d-ink);
    letter-spacing: -.015em;
}
.dash-mod-desc {
    font-size: 11.5px; color: var(--d-ink-3);
    margin-top: 1px;
}
.dash-mod-arrow {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--d-ink-4);
    background: var(--d-surface-2);
    transition: transform .2s ease, color .2s ease, background .2s ease;
}
.dash-mod:hover .dash-mod-arrow { transform: translateX(2px); color: var(--d-ink); background: var(--d-surface-3); }
.dash-mod-spark {
    width: 100%; height: 38px;
    margin-bottom: 8px;
    position: relative; z-index: 1;
}
.dash-mod-spark .mod-spark-line {
    fill: none;
    stroke: var(--d-accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: dashDraw 1.8s .4s cubic-bezier(.4,0,.2,1) forwards;
}
.dash-mod[data-tone="sapphire"] .mod-spark-line { stroke: #1d4ed8; }
.dash-mod[data-tone="indigo"]   .mod-spark-line { stroke: #4338ca; }
.dash-mod[data-tone="violet"]   .mod-spark-line { stroke: #7c3aed; }
.dash-mod[data-tone="teal"]     .mod-spark-line { stroke: #0d9488; }
.dash-mod[data-tone="amber"]    .mod-spark-line { stroke: #d97706; }
.dash-mod[data-tone="emerald"]  .mod-spark-line { stroke: #059669; }
.dash-mod-spark .mod-spark-area { opacity: 0; animation: dashFadeIn .8s 1s ease forwards; }
.dash-mod[data-tone="sapphire"] .mod-spark-area { fill: rgba(29,78,216,.10); }
.dash-mod[data-tone="indigo"]   .mod-spark-area { fill: rgba(99,102,241,.10); }
.dash-mod[data-tone="violet"]   .mod-spark-area { fill: rgba(139,92,246,.10); }
.dash-mod[data-tone="teal"]     .mod-spark-area { fill: rgba(20,184,166,.10); }
.dash-mod[data-tone="amber"]    .mod-spark-area { fill: rgba(245,158,11,.10); }
.dash-mod[data-tone="emerald"]  .mod-spark-area { fill: rgba(16,185,129,.10); }
.dash-mod-foot {
    display: flex; gap: 18px;
    border-top: 1px solid var(--d-border);
    padding-top: 10px;
    position: relative; z-index: 1;
}
.dash-mod-foot > span {
    display: flex; flex-direction: column; gap: 1px;
}
.dash-mod-foot small {
    font-size: 10px; color: var(--d-ink-4);
    letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.dash-mod-foot strong {
    font-family: var(--d-mono);
    font-size: 14px; color: var(--d-ink);
    font-weight: 600; letter-spacing: -.02em;
}

/* ============================
   TOAST
   ============================ */
.dash-toast-stack {
    position: fixed; bottom: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 70;
    pointer-events: none;
}
.dash-toast {
    pointer-events: auto;
    background: var(--d-surface);
    border-radius: 10px;
    box-shadow: var(--d-shadow-3);
    padding: 12px 14px;
    display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 380px;
    font-size: 13px; color: var(--d-ink);
    transform: translateY(20px); opacity: 0;
    transition: transform .3s cubic-bezier(.2,.7,.3,1.05), opacity .3s ease;
}
.dash-toast.show { transform: translateY(0); opacity: 1; }
.dash-toast i { color: var(--d-accent); font-size: 14px; }
.dash-toast[data-tone="success"] i { color: var(--d-success); }
.dash-toast[data-tone="error"]   i { color: var(--d-danger); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1280px) {
    .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-modules-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-col-side { position: static; }
    .dash-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .dash-hero-inner { grid-template-columns: 1fr; }
    .dash-hero-right { align-items: stretch; }
    .dash-clock { text-align: left; min-width: 0; }
    .dash-kpis { grid-template-columns: repeat(2, 1fr); padding: 0 16px; }
    .dash-grid, .dash-modules { padding: 0 16px; }
    .dash-modules-grid { grid-template-columns: 1fr; }
    .dash-funnel-row { grid-template-columns: 110px 1fr 60px; }
    .dash-funnel-row .dash-funnel-pct { display: none; }
    .dash-policy-strip { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dash-policy-stats { padding-left: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .dash-hero-glow, .dash-policy-dot, .dash-live-dot,
    .dash-btn-shine, .dash-funnel-bar::after,
    .dash-kpi-spark .spark-line, .dash-mod-spark .mod-spark-line {
        animation: none !important;
    }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
