:root {
    --bg: #f7f7fb;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text: #1f2230;
    --muted: #6b7280;
    --border: rgba(219, 223, 234, 0.85);
    --shadow: 0 18px 50px rgba(97, 74, 150, 0.08);
    --gradient: linear-gradient(135deg, #f14692 0%, #f38b35 45%, #8d56ff 100%);
    --gradient-soft: linear-gradient(135deg, rgba(241, 70, 146, 0.16), rgba(243, 139, 53, 0.16), rgba(141, 86, 255, 0.16));
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(241, 70, 146, 0.13), transparent 25%),
        radial-gradient(circle at top right, rgba(243, 139, 53, 0.12), transparent 22%),
        radial-gradient(circle at bottom center, rgba(141, 86, 255, 0.1), transparent 25%),
        var(--bg);
}

a { color: #7b48ef; text-decoration: none; }
a:hover { opacity: 0.85; }

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header, .site-footer, .main-content {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 16px;
    gap: 24px;
}

.brand-block { display: flex; align-items: center; gap: 14px; }
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--gradient);
    box-shadow: 0 12px 25px rgba(241, 70, 146, 0.24);
}
.brand-title { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.brand-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }

.main-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.main-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.55);
    color: var(--text);
    font-weight: 600;
}

.login-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.login-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
}

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

.hero-panel {
    position: relative;
    overflow: hidden;
    background: var(--gradient-soft);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 32px;
    padding: 34px;
    box-shadow: var(--shadow);
    margin: 8px 0 24px;
}
.hero-panel h1 { margin: 8px 0 10px; font-size: 2rem; }
.hero-panel p { margin: 0; max-width: 720px; color: var(--muted); line-height: 1.6; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.18em; font-weight: 800; color: #b42d75; }
.hero-glow {
    position: absolute;
    inset: auto -80px -80px auto;
    width: 260px;
    height: 260px;
    background: var(--gradient);
    opacity: 0.22;
    filter: blur(42px);
    border-radius: 50%;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 24px;
    backdrop-filter: blur(12px);
}
.card h2 { margin-top: 0; margin-bottom: 16px; }
.card h3 { margin-top: 18px; margin-bottom: 10px; }

.stats-grid, .content-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-one { display: grid; }
.compact-gap { gap: 18px; }

.stat-card span { display: block; color: var(--muted); margin-bottom: 10px; }
.stat-card strong { font-size: 2rem; }

.btn-primary, .btn-secondary, button {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.95rem;
}
.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 12px 24px rgba(141, 86, 255, 0.2);
}
.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}
.action-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stacked-actions { flex-direction: column; align-items: stretch; }

.toolbar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 14px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 13px 14px;
    background: rgba(255,255,255,0.85);
    color: var(--text);
    font: inherit;
}
label span {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}
.form-grid {
    display: grid;
    gap: 16px;
}
.two-col-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.narrow-card { max-width: 520px; margin: 0 auto; }
.login-shell { justify-items: center; }

.table-card table {
    width: 100%;
    border-collapse: collapse;
}
.table-card th, .table-card td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(219, 223, 234, 0.65);
}
.table-card th { color: var(--muted); font-size: 0.92rem; }

.clean-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.clean-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(219, 223, 234, 0.6);
}
.clean-list li:last-child { border-bottom: none; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip, .status-badge, .score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.86rem;
}
.chip { background: rgba(141, 86, 255, 0.1); color: #6c3bdf; }
.status-badge, .score-pill {
    background: var(--gradient-soft);
    color: #b23075;
}
.project-card h2, .recommendation-card h2 { margin-bottom: 10px; }
.card-topline { margin-bottom: 10px; }

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 0 0 28px;
    color: var(--muted);
}
.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .stats-grid, .two-columns, .three-columns, .toolbar, .two-col-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .site-header, .site-footer { flex-direction: column; align-items: flex-start; }
    .stats-grid, .two-columns, .three-columns, .toolbar, .two-col-form { grid-template-columns: 1fr; }
    .hero-panel { padding: 24px; }
    .hero-panel h1 { font-size: 1.6rem; }
    .main-content, .site-header, .site-footer { width: min(1240px, calc(100% - 24px)); }
}


.logout-form {
    margin: 0;
}

.header-user-name {
    font-weight: 600;
    color: #2b2d42;
    white-space: nowrap;
}

.analytics-layout {
    align-items: start;
}

.analytics-chart-box {
    width: min(100%, 420px);
    height: 420px;
    margin-top: 18px;
}

.reports-card {
    align-self: start;
}

.reports-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-group,
.report-more {
    border: 1px solid rgba(219, 223, 234, 0.7);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.report-group summary,
.report-more summary {
    list-style: none;
}

.report-group summary::-webkit-details-marker,
.report-more summary::-webkit-details-marker {
    display: none;
}

.report-group__summary,
.report-more__summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.report-group__summary:hover,
.report-more__summary:hover {
    background: rgba(141, 86, 255, 0.06);
}

.report-group__arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #7b48ef;
    border-bottom: 2px solid #7b48ef;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
    margin-top: -1px;
}

.report-group[open] .report-group__arrow {
    transform: rotate(45deg);
}

.report-group__title {
    font-size: 1rem;
    line-height: 1.2;
}

.report-group__content {
    padding: 0 14px 14px;
}

.report-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-list--nested {
    padding: 0 10px 10px;
}

.report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 6px;
    border-top: 1px solid rgba(219, 223, 234, 0.6);
}

.report-row:first-child {
    border-top: 1px solid rgba(219, 223, 234, 0.6);
}

.report-row__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.report-row__name {
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.report-row__description {
    color: var(--muted);
    font-size: 0.9rem;
    word-break: break-word;
}

.report-row--empty {
    color: var(--muted);
    justify-content: flex-start;
}

.report-more {
    margin-top: 10px;
}

.report-more__summary {
    font-weight: 600;
    color: #7b48ef;
    padding: 14px 16px;
}

.report-download-btn {
    min-width: 120px;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .report-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-download-btn {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .analytics-chart-box {
        height: 320px;
    }
}