/* =========================================================
   My Account — Dashboard
   Scoped entirely under .sh-dashboard.
   Token aliases map design vars to the theme's existing
   --spiderhouse-* custom properties.
   ========================================================= */

.sh-dashboard {
    /* Design-token aliases */
    --sh-ink:        var(--spiderhouse-ink,       #13354E);
    --sh-secondary:  var(--spiderhouse-secondary, #f37432);
    --sh-tertiary:   var(--spiderhouse-tertiary,  #AED473);
    --sh-paper:      var(--spiderhouse-paper,     #ffffff);
    --sh-accent:     #ECECEC;
    --sh-accent-2:   #4F4F4F;
    --sh-radius-xl:  22px;
    --sh-radius-lg:  16px;
    --sh-radius-md:  10px;
    --sh-radius-sm:  6px;
    --sh-shadow-card: 0 4px 24px rgba(19,53,78,0.09), 0 1px 3px rgba(19,53,78,0.05);
    --sh-dur:        140ms;
    --sh-dur-slow:   320ms;
    --sh-ease:       cubic-bezier(0.25, 0.1, 0.25, 1);

    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── Greeting ─────────────────────────────────────────── */

.sh-dashboard .greet {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sh-dashboard .greet-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sh-secondary);
}

.sh-dashboard .greet-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--sh-ink);
    margin: 0;
}

.sh-dashboard .greet-title .sh-emph {
    font-style: italic;
}

.sh-dashboard .greet-meta {
    font-size: 16px;
    font-weight: 400;
    color: var(--sh-accent-2);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

.sh-dashboard .greet-meta .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sh-accent-2);
    opacity: 0.5;
    flex-shrink: 0;
}

/* ── At-a-glance 3-col grid ───────────────────────────── */

.sh-dashboard .glance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* ── Stat card ────────────────────────────────────────── */

.sh-dashboard .stat {
    border-radius: var(--sh-radius-lg);
    background: var(--sh-paper);
    box-shadow: 0 0 0 1px var(--sh-accent) inset;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 200px;
}

.sh-dashboard .stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sh-dashboard .stat-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sh-accent-2);
}

.sh-dashboard .stat-body {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.sh-dashboard .stat-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.sh-dashboard .stat-headline {
    font-size: 17px;
    font-weight: 600;
    color: var(--sh-ink);
    line-height: 1.35;
    margin: 0;
}

.sh-dashboard .stat-sub {
    font-size: 14px;
    color: var(--sh-accent-2);
    line-height: 1.5;
    margin: 0;
}

.sh-dashboard .stat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--sh-accent);
    margin-top: auto;
}

/* Empty state variant — no body content, just centred text */
.sh-dashboard .stat--empty .stat-body {
    align-items: flex-start;
}

.sh-dashboard .stat--empty .stat-headline {
    color: var(--sh-accent-2);
    font-weight: 500;
}

/* ── Donut chart ──────────────────────────────────────── */

.sh-dashboard .donut {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    position: relative;
}

.sh-dashboard .donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    display: block;
}

.sh-dashboard .donut-track {
    fill: none;
    stroke: var(--sh-accent);
    stroke-width: 10;
}

.sh-dashboard .donut-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dasharray var(--sh-dur-slow) var(--sh-ease);
    stroke: var(--sh-secondary);
}

.sh-dashboard .donut-fill--plenty   { stroke: var(--sh-ink); }
.sh-dashboard .donut-fill--warning  { stroke: var(--sh-secondary); }
.sh-dashboard .donut-fill--critical { stroke: var(--sh-tertiary); }

.sh-dashboard .donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sh-dashboard .donut-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--sh-ink);
    line-height: 1;
}

.sh-dashboard .donut-num .of {
    color: var(--sh-accent-2);
    font-weight: 400;
    font-size: 16px;
}

.sh-dashboard .donut-cap {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sh-accent-2);
    margin-top: 4px;
}

/* ── Count bubble ─────────────────────────────────────── */

.sh-dashboard .count-bubble {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border-radius: var(--sh-radius-lg);
    background: rgba(20, 127, 206, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.sh-dashboard .count-bubble .num {
    font-size: 38px;
    font-weight: 700;
    color: #0F5D96;
    line-height: 1;
    font-feature-settings: "tnum";
}

.sh-dashboard .count-bubble .lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0F5D96;
}

/* "all good" variant — green tint */
.sh-dashboard .count-bubble--ok {
    background: rgba(174, 212, 115, 0.18);
}

.sh-dashboard .count-bubble--ok .num {
    font-size: 32px;
    color: #4F7A1F;
}

/* "needs attention" variant — orange tint */
.sh-dashboard .count-bubble--alert {
    background: rgba(243, 116, 50, 0.10);
}

.sh-dashboard .count-bubble--alert .num {
    color: var(--sh-secondary);
}

.sh-dashboard .count-bubble--alert .lbl {
    color: var(--sh-secondary);
}

/* ── Ghost link (card footer CTAs) ───────────────────── */

.sh-dashboard .ghost-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sh-ink);
    text-decoration: none;
    transition: color var(--sh-dur) var(--sh-ease), gap var(--sh-dur) var(--sh-ease);
}

.sh-dashboard .ghost-link:hover {
    color: var(--sh-secondary);
    gap: 10px;
    text-decoration: none;
}

.sh-dashboard .ghost-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform var(--sh-dur) var(--sh-ease);
}

.sh-dashboard .ghost-link:hover svg {
    transform: translateX(2px);
}

/* ── sh-btn system (used by updates list + CF7 form) ───── */

.sh-dashboard .sh-btn{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 99px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition:
        background var(--sh-dur) var(--sh-ease),
        box-shadow var(--sh-dur) var(--sh-ease),
        transform var(--sh-dur) var(--sh-ease),
        color var(--sh-dur) var(--sh-ease);
    -webkit-appearance: none;
    appearance: none;
}

.sh-dashboard .sh-btn.is-sm {
    padding: 10px 18px;
    font-size: 14px;
}

.sh-dashboard .sh-btn.is-xs {
    padding: 8px 14px;
    font-size: 13px;
}

/* Primary */
.sh-dashboard .sh-btn--primary {
    background: var(--sh-secondary);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(243, 116, 50, 0.28);
}

.sh-dashboard .sh-btn--primary:hover {
    background: #e06620;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(243, 116, 50, 0.36);
    color: #ffffff;
    text-decoration: none;
}

.sh-dashboard .sh-btn--primary:focus-visible {
    outline: 2px solid var(--sh-secondary);
    outline-offset: 3px;
}

/* Secondary (outlined / subtle) */
.sh-dashboard .sh-btn--secondary {
    background: rgba(19, 53, 78, 0.06);
    color: var(--sh-ink);
    box-shadow: 0 0 0 1px var(--sh-accent) inset;
}

.sh-dashboard .sh-btn--secondary:hover {
    background: rgba(19, 53, 78, 0.11);
    transform: translateY(-1px);
    color: var(--sh-ink);
    text-decoration: none;
}

/* Ghost (transparent border) */
.sh-btn--ghost {
    background: transparent;
    color: var(--sh-ink);
    box-shadow: 0 0 0 1px var(--sh-accent) inset;
}

.sh-btn--ghost:hover {
    background: rgba(19, 53, 78, 0.05);
    color: var(--sh-ink);
    text-decoration: none;
}

/* ── Updates list ─────────────────────────────────────── */

.sh-dashboard .updates {
    border-radius: var(--sh-radius-lg);
    background: var(--sh-paper);
    box-shadow: 0 0 0 1px var(--sh-accent) inset;
    overflow: hidden;
}

.sh-dashboard .updates-head {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sh-accent);
}

.sh-dashboard .updates-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--sh-ink);
    flex: 1;
    margin: 0;
}

.sh-dashboard .updates-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--sh-accent-2);
}

.sh-dashboard .updates-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px 24px;
}

.sh-dashboard .updates-row + .updates-row {
    border-top: 1px solid var(--sh-accent);
}

.sh-dashboard .updates-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--sh-radius-sm);
    background: #FEEEDF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sh-secondary);
    flex-shrink: 0;
}

.sh-dashboard .updates-icon svg {
    width: 20px;
    height: 20px;
}

.sh-dashboard .updates-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--sh-ink);
    line-height: 1.3;
}

.sh-dashboard .updates-ver {
    font-size: 13px;
    color: var(--sh-accent-2);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.sh-dashboard .updates-ver .arrow {
    color: var(--sh-accent-2);
}

.sh-dashboard .updates-ver .new {
    color: var(--sh-secondary);
    font-weight: 600;
}

.sh-dashboard .updates-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}


/* ── Responsive ───────────────────────────────────────── */


@media (max-width: 900px) {
    .sh-dashboard .greet-title {
        font-size: 26px;
    }

    .sh-dashboard .updates-row {
        grid-template-columns: 40px 1fr;
    }

    .sh-dashboard .updates-actions {
        grid-column: 2;
        flex-wrap: wrap;
    }
}

@media (max-width: 700px) {
    .sh-dashboard .glance {
        grid-template-columns: 1fr;
    }

    .sh-dashboard .greet-title {
        font-size: 22px;
    }

    .sh-dashboard .stat {
        min-height: 0;
    }

    .sh-dashboard .sh-btn {
        width: 100%;
        justify-content: center;
    }

    .sh-dashboard .updates-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sh-dashboard .updates-icon {
        display: none;
    }

    .sh-dashboard .updates-actions {
        grid-column: 1;
    }
}
