/* =========================
   DASHBOARD PAGE
========================= */

.dashboard-premium-root {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.dashboard-page-wrap {
    padding: 4px 4px 10px;
}

.dashboard-premium-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 14px;
    padding: 4px 0 2px;
    flex-wrap: wrap;
}

.dashboard-premium-header-surveys {
    margin-bottom: 10px;
}

.dashboard-premium-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 760px;
}

.dashboard-premium-title-wrap-wide {
    max-width: 860px;
}

.dashboard-premium-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.dashboard-premium-title-wrap h1,
.dashboard-premium-title-wrap h2 {
    margin: 0;
    color: #0f172a;
    line-height: 1.08;
    font-weight: 900;
}

.dashboard-premium-title-wrap h1 {
    font-size: 52px;
    letter-spacing: -0.03em;
}

.dashboard-premium-title-wrap h2 {
    font-size: 28px;
}

.dashboard-premium-title-wrap p {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.7;
}

.dashboard-premium-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-premium-actions-top {
    padding-top: 10px;
}

/* =========================
   KPI / STAT CARDS
========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--color-border-soft);
    border-radius: 22px;
    padding: 22px 22px 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 10px;
}

.stat-card-value {
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.stat-card-meta {
    font-size: 15px;
    line-height: 1.5;
    color: #64748b;
}

/* =========================
   TOPBAR
========================= */

.dashboard-topbar {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    width: 100%;
}

.dashboard-filter-card {
    padding: 14px 16px;
}

.dashboard-filter-label,
.dashboard-mini-stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 8px;
}

.dashboard-filter-select {
    width: 100%;
    height: 40px;
    border-radius: 14px;
    border: 1px solid #cfd8e3;
    background: #ffffff;
    padding: 0 12px;
    font-size: 14px;
    color: #0f172a;
}

.dashboard-topbar-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    width: 100%;
}

.dashboard-mini-stat {
    padding: 16px;
}

.dashboard-mini-stat strong {
    font-size: 16px;
    color: #0f172a;
}

/* =========================
   ALERT / STATUS
========================= */

.dashboard-error-alert {
    display: none;
    align-items: center;
    font-size: 14px;
    line-height: 1.5;
}

.dashboard-empty-state {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 0;
}

/* =========================
   KPI GRID
========================= */

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
}

.dashboard-kpi-card {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #eff4fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.dashboard-kpi-content {
    min-width: 0;
}

.dashboard-kpi-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 6px;
}

.dashboard-kpi-value {
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.dashboard-kpi-subtext {
    font-size: 13px;
    color: #64748b;
}

/* =========================
   ACTION GRID
========================= */

.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
}

.dashboard-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.dashboard-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #eff4fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.dashboard-action-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #0f172a;
}

.dashboard-action-text p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* =========================
   CHARTS / LISTS
========================= */

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    width: 100%;
}

.dashboard-chart-card,
.dashboard-list-card {
    padding: 20px;
}

.dashboard-card-head {
    margin-bottom: 16px;
}

.dashboard-card-head h2 {
    margin: 0 0 6px 0;
    font-size: 20px;
    color: #0f172a;
}

.dashboard-card-head p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.dashboard-canvas-wrap {
    min-height: 260px;
}

.dashboard-canvas-wrap-tall {
    min-height: 320px;
}

.dashboard-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.dashboard-list-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.dashboard-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-list-rank,
.dashboard-rating-badge {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #eff4fb;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.dashboard-rating-badge {
    background: #eef6ff;
    color: #1d4ed8;
}

.dashboard-list-content {
    min-width: 0;
    flex: 1;
}

.dashboard-list-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    margin-bottom: 4px;
    word-break: break-word;
}

.dashboard-list-meta {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* =========================
   ASSOCIATION PROFILE
========================= */

.association-profile-card {
    max-width: 1100px;
}

.association-profile-head {
    margin-bottom: 18px;
}

.association-form-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}

.association-form-message.success {
    background: #eafaf1;
    border: 1px solid #b8e7c8;
    color: #166534;
}

.association-form-message.error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.association-form-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.association-span-2 {
    grid-column: 1 / -1;
}

.association-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
}

.association-meta-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
}

.association-meta-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #6b7280;
}

.association-meta-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* =========================
   MANAGEMENT PAGES
========================= */

.management-page-card {
    padding: 26px 28px 20px;
}

.management-page-card-premium {
    padding: 24px 22px 20px;
}

.management-name-cell {
    font-weight: 600;
    color: #0f172a;
}

.management-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.management-actions .btn {
    min-width: 106px;
}

/* =========================
   SURVEY / QUESTIONS PAGES
========================= */

.surveys-overview-section,
.survey-builder-section,
.questions-overview-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.surveys-overview-section-premium {
    gap: 20px;
}

.surveys-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
}

.surveys-kpi-grid-premium {
    gap: 18px;
    margin-bottom: 2px;
}

.survey-stat-card {
    padding: 18px 20px;
}

.survey-stat-card-premium {
    min-height: 132px;
    justify-content: space-between;
    border-radius: 22px;
    border: 1px solid #e7edf5;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.survey-stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 800;
    margin-bottom: 10px;
}

.survey-stat-value {
    display: block;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.survey-stat-card-premium .survey-stat-value {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.survey-stat-meta {
    font-size: 13px;
    color: #64748b;
}

.survey-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.survey-builder-layout-management {
    grid-template-columns: minmax(360px, 0.95fr) minmax(620px, 1.05fr);
    gap: 18px;
    align-items: start;
}

.questions-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.survey-side-panel {
    position: sticky;
    top: 0;
}

.survey-upload-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
    padding: 22px;
    border-radius: 18px;
    border: 2px dashed #cfd8e3;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    align-items: center;
    justify-content: center;
    text-align: center;
}

.survey-upload-dropzone.is-dragover {
    border-color: var(--color-primary);
    background: #f5f9ff;
}

.survey-upload-dropzone strong {
    font-size: 15px;
    color: #0f172a;
}

.survey-upload-dropzone p {
    margin: 0;
    max-width: 420px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
}

.survey-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.survey-template-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--color-border-soft);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    transition: var(--transition);
}

.survey-template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.survey-template-card strong {
    font-size: 15px;
    color: #0f172a;
}

.survey-template-card p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
}

.survey-progress-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.survey-progress-bar {
    position: relative;
    width: 220px;
    max-width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e5edf6;
    overflow: hidden;
}

.survey-progress-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary) 0%, #60a5fa 100%);
}

.survey-table-head {
    margin-bottom: 16px;
}

.survey-col-scope-cell {
    color: #334155;
    line-height: 1.5;
    font-size: 13px;
}

.survey-col-count-cell {
    text-align: center;
}

.survey-col-created-cell {
    color: #64748b;
    white-space: nowrap;
    font-size: 13px;
}

.col-title {
    min-width: 156px;
}

.col-scope {
    min-width: 168px;
}

.col-count {
    width: 68px;
    text-align: center;
}

.col-status {
    width: 82px;
}

.col-created {
    width: 100px;
}

.col-actions {
    width: 184px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1300px) {
    .dashboard-kpi-grid,
    .dashboard-action-grid,
    .stats-grid,
    .surveys-kpi-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 1100px) {
    .dashboard-topbar {
        grid-template-columns: 1fr;
    }

    .dashboard-topbar-info {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-grid,
    .dashboard-lower-grid,
    .survey-builder-layout,
    .survey-template-grid,
    .survey-builder-layout-management {
        grid-template-columns: 1fr;
    }

    .survey-side-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .association-form-grid,
    .association-meta-grid {
        grid-template-columns: 1fr;
    }

    .association-span-2 {
        grid-column: auto;
    }

    .management-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .management-actions .btn {
        min-width: auto;
    }
}

@media (max-width: 700px) {
    .dashboard-premium-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-premium-title-wrap h1 {
        font-size: 36px;
    }

    .dashboard-kpi-grid,
    .dashboard-action-grid,
    .stats-grid,
    .surveys-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-list-item {
        gap: 10px;
    }

    .dashboard-list-rank,
    .dashboard-rating-badge {
        width: 32px;
        min-width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 12px;
    }

    .management-page-card,
    .management-page-card-premium {
        padding: 18px 16px 14px;
    }

    .stat-card {
        min-height: auto;
    }

    .dashboard-page-wrap {
        padding: 0;
    }
}