:root {
    --page-bg: #f6f1ea;
    --panel-bg: rgba(255, 255, 255, 0.88);
    --page-border: rgba(75, 46, 131, 0.12);
    --page-shadow: 0 22px 48px rgba(45, 27, 78, 0.10);
}

body {
    background:
        radial-gradient(900px 380px at 85% 0%, rgba(107, 142, 35, 0.12), transparent 60%),
        radial-gradient(700px 320px at 15% 15%, rgba(75, 46, 131, 0.10), transparent 55%),
        var(--page-bg);
}

.investigations-page {
    padding-bottom: 56px;
}

.page-hero {
    padding: 48px 0 24px;
}

.hero-shell {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.compact-hero {
    align-items: center;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.page-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 3.6vw, 3.5rem);
    color: var(--text-main);
}

.hero-description {
    margin-top: 12px;
    max-width: 760px;
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.hero-actions .btn {
    width: fit-content;
}

.storage-strip {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(75, 46, 131, 0.10);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(45, 27, 78, 0.05);
}

.storage-strip-title {
    margin: 0 0 4px;
    color: var(--text-main);
    font-weight: 700;
}

.storage-strip-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.secondary-link {
    color: var(--primary);
    font-weight: 600;
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.15fr);
    gap: 24px;
}

.full-page-panel {
    max-width: 920px;
    margin: 0 auto;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--page-border);
    border-radius: 24px;
    box-shadow: var(--page-shadow);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(75, 46, 131, 0.08);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.55rem;
    color: var(--text-main);
}

.panel-badge {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(107, 142, 35, 0.10);
    color: var(--accent-hover);
    font-size: 0.82rem;
    font-weight: 700;
}

.investigation-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px 24px 24px;
}

.investigation-form .file-preview {
    grid-column: 1 / -1;
}

.investigation-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-main);
    font-weight: 600;
}

.investigation-form span {
    font-size: 0.95rem;
}

.investigation-form input,
.investigation-form select,
.investigation-form textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(75, 46, 131, 0.16);
    background: #fff;
    padding: 14px 16px;
    font: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.investigation-form textarea {
    resize: vertical;
    min-height: 140px;
}

.investigation-form input:focus,
.investigation-form select:focus,
.investigation-form textarea:focus {
    border-color: rgba(75, 46, 131, 0.42);
    box-shadow: 0 0 0 4px rgba(75, 46, 131, 0.08);
}

.full-width {
    grid-column: 1 / -1;
}

.file-field small {
    color: var(--text-muted);
    font-weight: 400;
}

.form-status {
    grid-column: 1 / -1;
    margin: -4px 0 0;
    min-height: 24px;
    font-weight: 600;
}

.form-status.is-error {
    color: #a61b1b;
}

.form-status.is-success {
    color: var(--accent-hover);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.list-panel {
    min-height: 100%;
}

.empty-state {
    padding: 28px 24px 6px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.empty-state p {
    margin: 0;
}

.investigation-list {
    display: grid;
    gap: 14px;
    padding: 0 24px 24px;
}

.investigation-item {
    border: 1px solid rgba(75, 46, 131, 0.12);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(45, 27, 78, 0.05);
}

.investigation-item[open] {
    border-color: rgba(75, 46, 131, 0.22);
}

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

.investigation-item summary::-webkit-details-marker {
    display: none;
}

.summary-main {
    display: grid;
    gap: 6px;
}

.summary-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
}

.summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.severity-tag {
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}

.severity-low { background: rgba(107, 142, 35, 0.12); color: var(--accent-hover); }
.severity-medium { background: rgba(250, 173, 20, 0.14); color: #8c5c00; }
.severity-high { background: rgba(255, 122, 24, 0.15); color: #a84e00; }
.severity-critical { background: rgba(198, 40, 40, 0.12); color: #9d1b1b; }

.details-body {
    padding: 0 20px 20px;
    border-top: 1px solid rgba(75, 46, 131, 0.08);
}

.details-grid {
    display: grid;
    gap: 14px;
    padding-top: 18px;
}

.detail-block {
    display: grid;
    gap: 6px;
}

.detail-label {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 700;
}

.detail-value {
    color: var(--text-main);
    line-height: 1.8;
    white-space: pre-wrap;
}

.detail-link {
    color: var(--primary);
    font-weight: 600;
    word-break: break-word;
}

.event-image {
        max-width: 100%;
        border-radius: 16px;
        border: 1px solid rgba(75, 46, 131, 0.12);
        box-shadow: 0 10px 20px rgba(45, 27, 78, 0.08);
    }

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.submit-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(23, 16, 36, 0.45);
    backdrop-filter: blur(8px);
}

.submit-loading:not([hidden]) {
    display: grid;
}

.submit-loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 360px;
    width: 100%;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 44px rgba(28, 19, 52, 0.22);
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid rgba(75, 46, 131, 0.14);
    border-top-color: var(--primary);
    animation: loading-spin 0.85s linear infinite;
    flex-shrink: 0;
}

.submit-loading-title {
    margin: 0 0 4px;
    color: var(--text-main);
    font-weight: 700;
}

.submit-loading-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

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

    .hero-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .storage-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .storage-strip .btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .page-hero {
        padding-top: 26px;
    }

    .panel-header,
    .investigation-form,
    .investigation-list,
    .empty-state {
        padding-left: 16px;
        padding-right: 16px;
    }

    .investigation-form {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .investigation-item summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn,
    .hero-actions .secondary-link {
        width: 100%;
        justify-content: center;
    }
}