* {
    box-sizing: border-box;
}

:root {
    --bf-dark: #071a2f;
    --bf-blue: #0f2f52;
    --bf-green: #0f766e;
    --bf-lime: #22c55e;
    --bf-purple: #5b21b6;
    --bf-red: #ef4444;
    --bf-bg: #eef3f6;
    --bf-card: #ffffff;
    --bf-text: #0f172a;
    --bf-muted: #64748b;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bf-bg);
    color: var(--bf-text);
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 120px);
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #06182b, #08213a);
    color: white;
    padding: 26px 24px;
}

.sidebar h2 {
    margin: 0 0 4px;
    font-size: 26px;
}

.sidebar p {
    margin-top: 0;
    opacity: 0.82;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 32px;
}

.sidebar nav a {
    color: white;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.2s ease;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(116, 227, 255, 0.16);
}

.logout-btn {
    width: 100%;
    margin-top: 34px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #ef4444;
    color: white;
    cursor: pointer;
    font-weight: 800;
}

.main-content {
    flex: 1;
    padding: 34px;
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0;
    font-size: 34px;
    color: #0f172a;
}

.page-header p {
    color: var(--bf-muted);
    font-size: 16px;
}

.toolbar {
    background: white;
    padding: 18px;
    border-radius: 18px;
    margin-bottom: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.toolbar select {
    width: 100%;
    max-width: 430px;
    padding: 13px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.summary-card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bf-green), var(--bf-lime));
}

.summary-card:nth-child(2)::after {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.summary-card:nth-child(3)::after {
    background: linear-gradient(90deg, #7c3aed, #c084fc);
}

.summary-card:nth-child(4)::after {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}

.summary-card p {
    margin: 0 0 10px;
    color: var(--bf-muted);
    font-size: 15px;
}

.summary-card h2 {
    margin: 0;
    color: var(--bf-green);
    font-size: 32px;
}

.analytics-area {
    display: grid;
    gap: 22px;
}

.question-analytics-card {
    background: white;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.question-analytics-card h2 {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 25px;
}

.question-meta {
    color: var(--bf-muted);
    font-size: 14px;
    margin-bottom: 22px;
    font-weight: 600;
}

.bar-row {
    margin-bottom: 18px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 800;
}

.bar-track {
    width: 100%;
    height: 18px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0f766e, #22c55e);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.45);
}

.question-analytics-card:nth-child(2n) .bar-fill {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.35);
}

.question-analytics-card:nth-child(3n) .bar-fill {
    background: linear-gradient(90deg, #7c3aed, #c084fc);
    box-shadow: 0 0 14px rgba(124, 58, 237, 0.35);
}

.insight-box {
    margin-top: 22px;
    padding: 16px 18px;
    border-left: 5px solid var(--bf-green);
    background: #ecfdf5;
    color: #064e3b;
    border-radius: 14px;
    line-height: 1.6;
    font-size: 15px;
}

.rating-style-card,
.line-style-card,
.pie-style-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
}

.rating-score {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    min-height: 90px;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    color: #5b21b6;
}

.rating-score span {
    font-size: 34px;
    font-weight: 900;
}

.rating-score small {
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 44px 22px;
    color: var(--bf-muted);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.buildframe-footer {
    width: 100%;
    padding: 16px 18px;
    background: linear-gradient(135deg, #071a2f, #0f2f52);
    color: #ffffff;
    text-align: center;
    border-top: 1px solid rgba(116, 227, 255, 0.22);
}

.buildframe-credit {
    max-width: 980px;
    margin: 0 auto;
}

.buildframe-credit strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 3px;
}

.buildframe-credit span {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-bottom: 8px;
    color: #ffffff;
}

.buildframe-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
}

.buildframe-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
}

.buildframe-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar {
        width: 100%;
    }

    .main-content {
        padding: 22px;
    }
}

@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .bar-label {
        flex-direction: column;
    }
}