/* HRHS Dashboard Styles — v1.1.0 */

/* ─── GRID LAYOUT ─────────────────────────────────────────────── */
.hrhs-dashboard-grid {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 24px;
    align-items: start;
}
.hrhs-sidebar { position: sticky; top: 88px; }
.hrhs-sidebar-card {
    background: var(--hrhs-white);
    border: 1px solid var(--hrhs-border);
    border-radius: var(--hrhs-radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--hrhs-shadow);
}

/* ─── STAT BOXES ──────────────────────────────────────────────── */
.hrhs-stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.hrhs-stat-box {
    flex: 1; min-width: 100px;
    background: var(--hrhs-white);
    border: 1px solid var(--hrhs-border);
    border-radius: var(--hrhs-radius-lg);
    padding: 18px 20px;
    box-shadow: var(--hrhs-shadow);
    position: relative; overflow: hidden;
}
.hrhs-stat-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--hrhs-primary), #c04055);
}
.hrhs-stat-box__num   { font-size: 2rem; font-weight: 800; color: var(--hrhs-dark); letter-spacing: -0.04em; line-height: 1; }
.hrhs-stat-box__label { font-size: 0.72rem; color: var(--hrhs-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 5px; }
.hrhs-stat-box--accent::before { background: linear-gradient(90deg, var(--hrhs-accent-dk), var(--hrhs-accent)); }
.hrhs-stat-box--dark::before   { background: linear-gradient(90deg, var(--hrhs-dark), var(--hrhs-dark-lt)); }

/* ─── TWO COLUMN GRID ─────────────────────────────────────────── */
.hrhs-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hrhs-two-col--wide { grid-template-columns: 3fr 2fr; }

/* ─── PROFILE COMPLETION WIDGET ───────────────────────────────── */
.hrhs-completion-widget { padding: 20px 24px; }
.hrhs-completion-widget__label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.875rem; font-weight: 600; color: var(--hrhs-dark); margin-bottom: 10px;
}
.hrhs-completion-widget__pct { color: var(--hrhs-primary); font-weight: 800; font-size: 1rem; }
.hrhs-completion-widget p { font-size: 0.8rem; color: var(--hrhs-muted); margin: 10px 0 0; }
.hrhs-completion-widget p a { color: var(--hrhs-primary); font-weight: 600; }

/* ─── PROVIDER HEADER STRIP ───────────────────────────────────── */
.hrhs-provider-header-strip {
    background: linear-gradient(135deg, var(--hrhs-dark) 0%, #083a5a 100%);
    border-radius: var(--hrhs-radius-xl);
    padding: 28px 32px;
    margin-bottom: 24px;
    color: var(--hrhs-white);
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    position: relative; overflow: hidden;
}
.hrhs-provider-header-strip::after {
    content: '';
    position: absolute; bottom: -30px; right: -30px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(11,255,132,0.07); pointer-events: none;
}
.hrhs-provider-header-strip__name { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.hrhs-provider-header-strip__sub  { font-size: 0.875rem; color: rgba(255,255,255,0.6); }
.hrhs-provider-header-strip__stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.1); }
.hrhs-phs__stat-num   { font-size: 1.5rem; font-weight: 800; color: var(--hrhs-accent); letter-spacing: -0.03em; }
.hrhs-phs__stat-label { font-size: 0.72rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* ─── JOB ROW (compact) ───────────────────────────────────────── */
.hrhs-job-row {
    display: flex; align-items: center; gap: 14px; padding: 13px 0;
    border-bottom: 1px solid var(--hrhs-border);
}
.hrhs-job-row:last-child { border-bottom: none; }
.hrhs-job-row__title { font-weight: 600; font-size: 0.9rem; color: var(--hrhs-dark); margin-bottom: 2px; }
.hrhs-job-row__title a { color: var(--hrhs-dark); }
.hrhs-job-row__title a:hover { color: var(--hrhs-primary); text-decoration: none; }
.hrhs-job-row__meta  { font-size: 0.78rem; color: var(--hrhs-muted); }
.hrhs-job-row__right { margin-left: auto; flex-shrink: 0; }

/* ─── MINI SECTION HEADING ────────────────────────────────────── */
.hrhs-mini-heading {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--hrhs-muted);
    padding: 14px 24px 8px;
}

@media (max-width: 900px) {
    .hrhs-dashboard-grid { grid-template-columns: 1fr; }
    .hrhs-sidebar { position: static; }
    .hrhs-two-col, .hrhs-two-col--wide { grid-template-columns: 1fr; }
}

/* ─── Motion preference ──────────────────────────────────────────
   Honor the OS-level "reduce motion" setting. Vestibular disorders
   make transforms and animation genuinely uncomfortable, and this is
   a system preference the user has already expressed. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── Keyboard focus ─────────────────────────────────────────── */
.hrhs-dash a:focus-visible,
.hrhs-dash button:focus-visible,
.hrhs-dash input:focus-visible,
.hrhs-dash select:focus-visible {
    outline: 2px solid var(--hrhs-primary, #4A90D9);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   INSIGHTS

   Sits below the action row. A pro signing in needs "what do I do
   today" before "how am I doing", so this reads as a second screen
   on the same page rather than the headline.
═══════════════════════════════════════════════════════════════ */
.hrhs-insights__heading {
    display: flex; align-items: baseline; gap: 10px;
    margin: 30px 0 14px; font-size: 1.15rem; font-weight: 800;
    letter-spacing: -.02em; color: var(--hrhs-dark);
}
.hrhs-insights__heading span { font-size: .8rem; font-weight: 600; color: var(--hrhs-muted); }

.hrhs-insights__kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.hrhs-kpi { background: var(--hrhs-white); border: 1px solid var(--hrhs-border); border-radius: var(--hrhs-radius-lg); padding: 16px 17px; }
.hrhs-kpi__k { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hrhs-muted); margin-bottom: 8px; }
.hrhs-kpi__v { font-size: 1.8rem; font-weight: 900; color: var(--hrhs-dark); letter-spacing: -.03em; line-height: 1; }
.hrhs-kpi__d { font-size: .78rem; color: var(--hrhs-muted); margin-top: 7px; line-height: 1.4; }

/* ─── Funnel ────────────────────────────────────────────────── */
.hrhs-funnel__step { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.hrhs-funnel__step:last-of-type { margin-bottom: 0; }
.hrhs-funnel__name { width: 155px; flex-shrink: 0; font-size: .86rem; font-weight: 600; color: var(--hrhs-dark); display: flex; align-items: center; gap: 6px; }
.hrhs-funnel__track { flex: 1; background: var(--hrhs-light-bg); border-radius: 8px; height: 34px; overflow: hidden; }
.hrhs-funnel__bar {
    height: 100%; border-radius: 8px;
    background: linear-gradient(90deg, var(--hrhs-dark), var(--hrhs-dark-lt));
    display: flex; align-items: center; padding-left: 12px;
    color: #fff; font-size: .82rem; font-weight: 800;
}
.hrhs-funnel__bar.is-final { background: linear-gradient(90deg, var(--hrhs-accent-dk), var(--hrhs-accent)); color: var(--hrhs-dark); }
.hrhs-funnel__rate { width: 54px; flex-shrink: 0; text-align: right; font-size: .8rem; color: var(--hrhs-muted); }

/* Tooltip on the step whose definition is not obvious: one homeowner who
   reveals a number and then messages is one contact, not two. */
.hrhs-funnel__info {
    width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
    background: var(--hrhs-border); color: var(--hrhs-dark);
    font-size: .62rem; font-weight: 800; font-style: normal;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: help; position: relative;
}
.hrhs-funnel__info:hover, .hrhs-funnel__info:focus-visible { background: var(--hrhs-dark); color: #fff; }
.hrhs-funnel__info::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
    width: 250px; padding: 10px 12px; border-radius: 8px;
    background: var(--hrhs-dark); color: #fff;
    font-size: .76rem; font-weight: 500; line-height: 1.5; text-align: left;
    opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 40;
}
.hrhs-funnel__info:hover::after, .hrhs-funnel__info:focus-visible::after { opacity: 1; }

.hrhs-insights__table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.hrhs-insights__table td { padding: 9px 0; border-bottom: 1px solid var(--hrhs-light-bg); }
.hrhs-insights__table tr:last-child td { border-bottom: 0; }
.hrhs-insights__table td:last-child { text-align: right; }
.hrhs-insights__vs { color: var(--hrhs-muted); font-size: .8rem; margin-left: 6px; }
.hrhs-insights__big { display: flex; align-items: baseline; gap: 9px; font-size: 2rem; font-weight: 900; color: var(--hrhs-dark); letter-spacing: -.03em; margin-bottom: 14px; }
.hrhs-insights__big span { font-size: .82rem; font-weight: 500; color: var(--hrhs-muted); letter-spacing: 0; }
.hrhs-insights__empty, .hrhs-insights__note { font-size: .85rem; color: var(--hrhs-muted); line-height: 1.6; margin: 10px 0 0; }
.hrhs-insights__capped p { font-size: .95rem; line-height: 1.65; margin: 0 0 14px; }

.hrhs-rdist { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; font-size: .8rem; }
.hrhs-rdist__n { width: 12px; color: var(--hrhs-muted); }
.hrhs-rdist__track { flex: 1; height: 9px; background: var(--hrhs-light-bg); border-radius: 10px; overflow: hidden; }
.hrhs-rdist__track i { display: block; height: 100%; background: var(--hrhs-accent-dk); }
.hrhs-rdist__c { width: 24px; text-align: right; color: var(--hrhs-muted); }

@media (max-width: 900px) { .hrhs-insights__kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
    .hrhs-funnel__name { width: 96px; font-size: .78rem; }
    .hrhs-funnel__rate { width: 40px; font-size: .74rem; }
    /* A 250px tooltip does not fit beside a 96px label on a phone. */
    .hrhs-funnel__info::after { width: 200px; left: 0; transform: none; }
}
