/* Live analytics dashboard — matches survey brand */

.dash-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.dash-hero {
    background: #fff;
    border: 1px solid #efe0e1;
    border-radius: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 28px rgba(90, 30, 40, 0.06);
}

.dash-hero-top {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.dash-title {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 800;
    color: var(--survey-primary-dark);
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.dash-sub {
    margin: 0;
    color: #6b5559;
    font-size: 0.95rem;
}

.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dash-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #5a4549;
    background: var(--survey-primary-soft);
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.dash-toggle input {
    accent-color: var(--survey-primary);
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .dash-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dash-stat {
    background: linear-gradient(160deg, #fffaf9 0%, var(--survey-primary-soft) 100%);
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid #f0d8dc;
}

.dash-stat-value {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--survey-primary-dark);
    line-height: 1.1;
}

.dash-stat-label {
    display: block;
    font-size: 0.78rem;
    color: #7a6367;
    margin-top: 0.2rem;
}

.dash-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #7a6367;
}

.live-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #2f9e5d;
    box-shadow: 0 0 0 0 rgba(47, 158, 93, 0.5);
    animation: livePulse 1.8s ease-out infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(47, 158, 93, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(47, 158, 93, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 158, 93, 0); }
}

.dash-sep { opacity: 0.5; }

.dash-toolbar {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .dash-toolbar {
        grid-template-columns: 1fr;
    }
}

.dash-loading,
.dash-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #7a6367;
    background: #fff;
    border-radius: 1rem;
    border: 1px dashed #e5cfd2;
}

.dash-questions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dash-q {
    background: #fff;
    border: 1px solid #efe0e1;
    border-radius: 1rem;
    overflow: hidden;
}

.dash-q-head {
    padding: 1rem 1.15rem 0.75rem;
    border-bottom: 1px solid #f3e6e7;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    justify-content: space-between;
}

.dash-q-head:hover {
    background: #fffaf9;
}

.dash-q-section {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--survey-primary-dark);
    background: #f3e0e2;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.35rem;
}

.dash-q-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--survey-ink);
    line-height: 1.35;
}

.dash-q-meta {
    font-size: 0.78rem;
    color: #8a7276;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.dash-q-body {
    padding: 0.75rem 1.15rem 1.15rem;
}

.dash-q.collapsed .dash-q-body {
    display: none;
}

.dash-chart-block {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f5ecee;
}

.dash-chart-block:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.dash-chart-label {
    font-size: 0.9rem;
    font-weight: 650;
    color: #4a3539;
    margin-bottom: 0.35rem;
}

.dash-chart-note {
    font-size: 0.8rem;
    color: #8a7276;
    margin-bottom: 0.5rem;
}

.dash-chart-canvas-wrap {
    position: relative;
    height: 220px;
    max-width: 100%;
}

.dash-chart-canvas-wrap.tall {
    height: 320px;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    margin-top: 0.5rem;
}

.dash-table th,
.dash-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0e4e6;
    text-align: left;
}

.dash-table th {
    color: #7a6367;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dash-table td.count,
.dash-table td.pct {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: var(--survey-primary-dark);
    white-space: nowrap;
}

.dash-bar-track {
    height: 0.45rem;
    background: #f3e0e2;
    border-radius: 999px;
    overflow: hidden;
    min-width: 80px;
}

.dash-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--survey-primary) 0%, var(--survey-accent) 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.dash-q-chevron {
    color: #a0888c;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.dash-q.collapsed .dash-q-chevron {
    transform: rotate(-90deg);
}
