/* Dashboard
 * Split from application.css to keep page-specific styles maintainable.
 */

.dashboard-event-card {
    display: block;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 20px rgba(15, 23, 42, 0.04);
}

.dashboard-event-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.dashboard-event-title {
    min-width: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-event-status {
    flex-shrink: 0;
    max-width: 44%;
    white-space: nowrap;
}

.dashboard-event-date {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.35;
}

.dashboard-event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.dashboard-event-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-event-open {
    flex-shrink: 0;
    color: var(--blue-600);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-archive {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.75);
    padding: 4px;
}

.dashboard-archive-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.dashboard-archive-summary::-webkit-details-marker {
    display: none;
}

.dashboard-archive-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-archive-title {
    margin: 0;
    color: #334155;
    font-size: 20px;
    font-weight: 800;
}

.dashboard-archive-count {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-archive-subtitle {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}

.dashboard-archive-chevron {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    transition: transform 160ms ease;
}

.dashboard-archive[open] .dashboard-archive-chevron {
    transform: rotate(180deg);
}

.dashboard-archive-list {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.dashboard-archive:not([open]) .dashboard-archive-list {
    display: none;
}

.dashboard-event-card-archived {
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: none;
}

.dashboard-event-card-archived .dashboard-event-title {
    color: #475569;
}

.dashboard-event-card-archived .dashboard-event-date,
.dashboard-event-card-archived .dashboard-event-meta {
    color: #94a3b8;
}

.dashboard-event-archived-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e2e8f0;
    padding: 6px 11px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 640px) {
    .dashboard-event-card {
        padding: 16px;
        border-radius: 18px;
    }

    .dashboard-event-main {
        gap: 10px;
    }

    .dashboard-event-title {
        font-size: 16px;
    }

    .dashboard-event-status {
        max-width: 48%;
        padding-inline: 10px;
        font-size: 12px;
    }

    .dashboard-event-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-event-meta {
        max-width: 100%;
        flex-wrap: wrap;
        row-gap: 2px;
        white-space: normal;
    }
}

.dashboard-create-toggle {
    list-style: none;
}

.dashboard-create-toggle::-webkit-details-marker {
    display: none;
}

/* Участники из прошлых мероприятий в форме создания */
.known-participants {
    margin-top: 18px;
}

.known-participants legend {
    color: #334155;
    font-size: 14px;
    font-weight: 600;
}

.known-participants-hint {
    margin: 2px 0 10px;
    color: #64748b;
    font-size: 13px;
}

.known-participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.known-participant {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: white;
    color: #0f172a;
    font-size: 14px;
    cursor: pointer;
}

.known-participant:has(input:checked) {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.known-participant input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--blue-600);
}

.known-participant .me-badge {
    margin-left: 0;
}

.known-participant-count {
    color: #94a3b8;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.known-participants-more {
    margin-top: 10px;
}

.known-participants-more summary {
    margin-bottom: 8px;
    color: var(--blue-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-month {
    margin: 8px 4px 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-month:first-child {
    margin-top: 0;
}

/* Личная аналитика */
.analytics-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.analytics-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analytics-period {
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: white;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.analytics-period-active {
    border-color: var(--blue-600);
    background: var(--blue-600);
    color: white;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.analytics-stat,
.analytics-card {
    padding: 18px;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    background: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 20px rgba(15, 23, 42, 0.04);
}

.analytics-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.analytics-stat strong {
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.analytics-stat span,
.analytics-muted {
    color: #64748b;
    font-size: 13px;
}

.analytics-card h2 {
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.analytics-card p + p {
    margin-top: 6px;
}

.analytics-bars {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 6px;
    height: 170px;
}

.analytics-bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.analytics-bar-fill {
    width: 100%;
    max-width: 36px;
    min-height: 2px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--brand-violet), var(--blue-600));
}

.analytics-bar-value {
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.analytics-bar-label {
    color: #64748b;
    font-size: 11px;
}

.analytics-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analytics-row-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    color: #334155;
}

.analytics-row-line a {
    color: var(--blue-700);
    font-weight: 600;
}

.analytics-meter {
    display: block;
    height: 8px;
    margin-top: 6px;
    border-radius: 9999px;
    background: #f1f5f9;
    overflow: hidden;
}

.analytics-meter span {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--blue-600), var(--brand-violet));
}

.analytics-teaser {
    position: relative;
}

.analytics-teaser-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
    filter: blur(5px);
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
}

.analytics-teaser-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(420px, calc(100% - 24px));
    transform: translate(-50%, -50%);
    padding: 22px 20px;
    border: 1px solid #ddd6fe;
    border-radius: 20px;
    background: white;
    box-shadow: 0 12px 32px rgba(76, 29, 149, 0.15);
    text-align: center;
}

.analytics-teaser-card h2 {
    margin: 10px 0 8px;
    font-size: 20px;
    font-weight: 800;
}

.analytics-teaser-card p {
    color: #334155;
}

.analytics-teaser-card .analytics-muted {
    margin-top: 12px;
}

.analytics-teaser-card .analytics-muted a {
    color: var(--blue-700);
    font-weight: 600;
}

.analytics-teaser-button {
    display: inline-flex;
    margin-top: 16px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--blue-600);
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.analytics-empty {
    text-align: center;
}

.analytics-empty-icon {
    font-size: 36px;
}

.analytics-empty p {
    color: #475569;
}

.analytics-footnote {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .analytics-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-stat:first-child {
        grid-column: span 2;
    }

    .analytics-stat {
        padding: 14px;
    }

    .analytics-bars {
        gap: 3px;
    }

    .analytics-bar-value {
        display: none;
    }
}

.analytics-card strong {
    white-space: nowrap;
}
