@import url('consultant-theme.css');

.consultant-hero-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ── Daily performance section ── */
.dash-perf-section {
    margin-bottom: 28px;
    padding: 22px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.dash-perf-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.dash-perf-header-text h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--purple-700);
    margin: 4px 0 6px;
}

.dash-perf-header-text p {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.dash-perf-label {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(8, 145, 178, 0.1));
    color: var(--purple-700);
    border: 1px solid rgba(13, 148, 136, 0.18);
}

.dash-perf-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dash-perf-summary-item {
    min-width: 120px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--glass-border);
    text-align: center;
}

.dash-perf-summary-item strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--purple-700);
    margin-bottom: 2px;
}

.dash-perf-summary-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dash-perf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dash-perf-empty {
    grid-column: 1 / -1;
    padding: 36px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
}

.dash-perf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 20px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    overflow: hidden;
    min-height: 0;
}

.dash-perf-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--purple-500), #0891b2);
    opacity: 0.85;
}

.dash-perf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(13, 148, 136, 0.14);
    border-color: rgba(13, 148, 136, 0.28);
}

.dash-perf-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.dash-perf-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--purple-600), #0891b2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.dash-perf-identity {
    flex: 1;
    min-width: 0;
}

.dash-perf-identity strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.45;
    color: var(--text);
    word-break: break-word;
}

.dash-perf-identity small {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.dash-perf-ring-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    margin-top: 2px;
}

.dash-perf-ring-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dash-perf-ring-bg {
    fill: none;
    stroke: rgba(13, 148, 136, 0.12);
    stroke-width: 4;
}

.dash-perf-ring-fg {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.dash-perf-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--purple-700);
}

.dash-activity-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(100, 116, 139, 0.16);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    color: inherit;
    pointer-events: none;
}

.dash-activity-bar.is-live {
    border-color: rgba(220, 38, 38, 0.18);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.9), rgba(255, 255, 255, 0.98));
}

.dash-activity-bar.is-live[data-kind="study"] {
    border-color: rgba(79, 70, 229, 0.2);
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.95), rgba(255, 255, 255, 0.98));
}

.dash-activity-bar-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.dash-activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    background: rgba(100, 116, 139, 0.1);
    flex-shrink: 0;
}

.dash-activity-bar.is-live .dash-activity-icon {
    background: rgba(239, 68, 68, 0.1);
}

.dash-activity-bar.is-live[data-kind="study"] .dash-activity-icon {
    background: rgba(79, 70, 229, 0.1);
}

.dash-activity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-activity-text strong {
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.3;
}

.dash-activity-text span {
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-activity-timer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 7px 10px;
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.04);
}

.dash-activity-timer strong {
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.dash-activity-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
    animation: dash-live-pulse 1.4s infinite;
}

.dash-activity-live-dot[hidden] {
    display: none !important;
}

@keyframes dash-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dash-perf-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dash-perf-metric {
    padding: 12px 10px;
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.06);
    border: 1px solid rgba(13, 148, 136, 0.1);
    text-align: center;
}

.dash-perf-metric.is-highlight {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(8, 145, 178, 0.08));
    border-color: rgba(13, 148, 136, 0.2);
}

.dash-perf-metric-icon {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.dash-perf-metric strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--purple-700);
    line-height: 1.4;
}

.dash-perf-metric span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.dash-perf-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.74rem;
    color: var(--text-muted);
    padding-top: 4px;
    border-top: 1px solid rgba(13, 148, 136, 0.08);
}

.dash-perf-last-study {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.72rem;
}

.dash-perf-horizon {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(13, 148, 136, 0.05);
    border: 1px solid rgba(13, 148, 136, 0.12);
}

.dash-perf-horizon.is-complete {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.22);
}

.dash-perf-horizon.is-partial {
    background: rgba(245, 158, 11, 0.07);
    border-color: rgba(245, 158, 11, 0.2);
}

.dash-perf-horizon.is-empty {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
}

.dash-perf-horizon-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dash-perf-horizon-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dash-perf-horizon-badge {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--purple-700);
}

.dash-perf-horizon.is-complete .dash-perf-horizon-badge {
    color: #059669;
}

.dash-perf-horizon.is-partial .dash-perf-horizon-badge {
    color: #d97706;
}

.dash-perf-horizon.is-empty .dash-perf-horizon-badge {
    color: #64748b;
}

.dash-perf-horizon-strip {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
}

.dash-perf-day {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 800;
    font-size: 0.78rem;
    transition: transform 0.15s ease;
}

.dash-perf-day small {
    font-size: inherit;
    font-weight: inherit;
}

.dash-perf-day.has-plan {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(13, 148, 136, 0.14));
    border-color: rgba(16, 185, 129, 0.28);
    color: #047857;
}

.dash-perf-day.no-plan {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

.dash-perf-day.is-today {
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.35);
}

.dash-perf-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.68rem;
}

.dash-perf-status.is-active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.dash-perf-status.is-idle {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

.dash-perf-status.is-done {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.dash-perf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.dash-perf-page-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.75);
    color: var(--purple-700);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.dash-perf-page-btn:hover:not(:disabled) {
    border-color: rgba(13, 148, 136, 0.35);
    background: white;
    transform: translateY(-1px);
}

.dash-perf-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dash-perf-page-badge {
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--purple-600), #0891b2);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .dash-perf-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dash-perf-section {
        padding: 16px;
    }

    .dash-perf-grid {
        grid-template-columns: 1fr;
    }

    .dash-perf-summary {
        width: 100%;
    }

    .dash-perf-summary-item {
        flex: 1;
        min-width: 0;
    }

    .dash-perf-metrics {
        grid-template-columns: 1fr;
    }

    .dash-perf-horizon-strip {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
