:root {
    --color-background: #f4f6f8;
    --color-surface: #ffffff;
    --color-primary: #5a5ce6;
    --color-primary-light: #eef0ff;
    --color-sidebar: linear-gradient(180deg, #151933 0%, #20264d 100%);
    --color-text: #1f2430;
    --color-muted: #6b7280;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    min-height: 100vh;
}

.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    color: #fff;
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 1040;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar .brand {
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background-color: #fff;
    color: #1a1f3c;
    box-shadow: 0 8px 16px rgba(19, 23, 48, 0.24);
}

.sidebar-footer .cta-card {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    color: #fff;
}

.main-panel {
    background-color: var(--color-background);
}

.topbar {
    background-color: var(--color-surface);
    border-bottom: 1px solid rgba(31, 36, 48, 0.05);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar .navbar-brand {
    color: var(--color-text);
}

.topbar .navbar-brand:hover {
    color: var(--color-primary);
}

.topbar .navbar-nav .nav-link {
    color: var(--color-muted);
    font-weight: 500;
    margin-left: 0.75rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.topbar .navbar-nav .nav-link.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.topbar .btn-light {
    border-radius: 999px;
    padding: 0.4rem 1rem;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-login {
    color: var(--color-text);
}

.user-name {
    font-weight: 600;
}

.content {
    padding: 2rem;
}

.page-hero {
    padding: 2.5rem 0;
}

.hero-card {
    background: var(--color-surface);
    border-radius: 1.25rem;
    box-shadow: 0 18px 40px rgba(23, 37, 84, 0.08);
}

.progress-sm {
    height: 0.5rem;
    background-color: rgba(90, 92, 230, 0.12);
}

.progress-bar {
    background: var(--color-primary);
}

.stat-card {
    background: var(--color-surface);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 12px 28px rgba(25, 32, 56, 0.06);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.content-panel .card {
    border-radius: 1.25rem;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.timeline-indicator {
    width: 44px;
    height: 44px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.timeline-content h6 {
    font-weight: 600;
}

.screening-intro {
    padding: 2rem 0 1rem;
}

.screening-card {
    background: var(--color-surface);
    border-radius: 1.25rem;
    box-shadow: 0 18px 40px rgba(23, 37, 84, 0.08);
    padding: 1.75rem;
}

.screening-card .form-label {
    font-weight: 600;
    color: var(--color-text);
}

.screening-results-section .table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-muted);
    letter-spacing: 0.06em;
}

.screening-results-section .badge {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
}

.screening-results-section .page-link {
    border-radius: 999px !important;
}

.screening-results-section .result-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.screening-results-section .result-row:hover {
    background-color: rgba(90, 92, 230, 0.05);
}

.screening-results-section .result-row.active {
    background-color: rgba(90, 92, 230, 0.1);
}

.screening-results-section .detail-row td {
    background-color: #f8f9fc;
    border-top: 0;
    padding: 1.5rem 2rem;
}

.screening-results-section .detail-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.screening-results-section .detail-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.screening-results-section .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.screening-results-section .detail-grid .card {
    border: 0;
    background: transparent;
}

.screening-results-section .detail-grid .card-body {
    padding: 0;
}

.screening-results-section .detail-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.match-badge-high {
    background-color: #fde2e1;
    color: #b42318;
}

.match-badge-medium {
    background-color: #fcefd6;
    color: #ad5f00;
}

.match-badge-low {
    background-color: #d8f5e4;
    color: #0c7a43;
}

.risk-score {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 120px;
}

.risk-score-value {
    font-weight: 600;
}

.risk-score-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(90, 92, 230, 0.15);
    overflow: hidden;
}

.risk-score-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5a5ce6 0%, #8b5cf6 100%);
    transition: width 0.3s ease;
}

.kyb-expandable {
    cursor: pointer;
}

.kyb-detail-row td {
    background-color: #f8f9fc;
    border-top: 0;
    padding: 1.25rem 1.5rem;
}

.kyb-detail-meta {
    font-size: 0.9rem;
    color: var(--color-muted);
}

@media (max-width: 1199px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 992px) {
    .layout-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 1050;
        padding: 1rem 1.25rem;
    }

    .main-panel {
        width: 100%;
    }

    .content {
        padding: 1.5rem 1.25rem 2.5rem;
    }
}

@media (max-width: 576px) {
    .page-hero h1 {
        font-size: 1.75rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .screening-card {
        padding: 1.5rem;
    }
}
