:root {
    --qa-sidebar-width: 236px;
    --qa-bg: #f6f7f9;
    --qa-surface: #ffffff;
    --qa-surface-soft: #f1f5f9;
    --qa-border: #e5e7eb;
    --qa-text: #111827;
    --qa-text-muted: #6b7280;
    --qa-primary: #2563eb;
    --qa-primary-soft: #dbeafe;
    --qa-success: #059669;
    --qa-warning: #d97706;
    --qa-danger: #dc2626;
    --qa-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--qa-bg);
    color: var(--qa-text);
}

.qa-shell {
    min-height: 100vh;
    display: flex;
    background: var(--qa-bg);
}

.qa-sidebar {
    width: var(--qa-sidebar-width);
    min-height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    border-right: 1px solid var(--qa-border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    z-index: 1030;
}

.qa-sidebar-brand {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--qa-border);
}

.qa-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.qa-brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    flex-shrink: 0;
}

.qa-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qa-brand-copy strong {
    font-size: 14px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--qa-text);
}

.qa-brand-copy small {
    font-size: 11px;
    color: var(--qa-text-muted);
    margin-top: 2px;
}

.qa-sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--qa-text-muted);
}

.qa-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.qa-nav-section {
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
}

.qa-nav-section:last-child {
    border-bottom: 0;
}

.qa-nav-label {
    padding: 0 8px 6px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.qa-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 36px;
    padding: 0 9px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease;
}

.qa-nav-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.72;
}

.qa-nav-item:hover {
    background: var(--qa-surface-soft);
    color: var(--qa-text);
}

.qa-nav-item.active {
    background: var(--qa-primary-soft);
    color: var(--qa-primary);
}

.qa-nav-item.active i {
    opacity: 1;
}

.qa-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    border-top: 1px solid var(--qa-border);
}

.qa-footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--qa-text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.qa-footer-link:hover {
    background: var(--qa-surface-soft);
    color: var(--qa-text);
}

.qa-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.qa-topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--qa-border);
    background: rgba(246, 247, 249, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.qa-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--qa-border);
    border-radius: 8px;
    background: #fff;
    color: var(--qa-text);
}

.qa-page-heading {
    min-width: 0;
}

.qa-page-kicker {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--qa-primary);
    margin-bottom: 3px;
}

.qa-page-heading h1 {
    margin: 0;
    color: var(--qa-text);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 750;
}

.qa-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qa-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.qa-status-pill i {
    font-size: 7px;
}

.qa-content {
    flex: 1;
    padding: 26px 28px 38px;
}

.qa-content > .container,
.qa-content > .container-fluid {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.qa-home {
    max-width: 1280px;
}

.qa-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}

.qa-hero-copy {
    min-height: 280px;
    padding: 32px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.82)),
        url("https://images.unsplash.com/photo-1642790106117-e829e14a795f?auto=format&fit=crop&w=1400&q=80");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--qa-shadow);
}

.qa-hero-eyebrow,
.qa-section-eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.qa-hero-copy h2 {
    max-width: 820px;
    margin: 14px 0 12px;
    font-size: 34px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

.qa-hero-copy p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
}

.qa-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.qa-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 700;
}

.qa-system-panel,
.qa-module,
.qa-flow-step,
.qa-data-card,
.qa-note-panel {
    border: 1px solid var(--qa-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.qa-system-panel {
    padding: 20px;
}

.qa-system-panel h3,
.qa-home-section h3,
.qa-note-panel h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 750;
    color: var(--qa-text);
}

.qa-system-panel p,
.qa-module p,
.qa-flow-step p,
.qa-note-panel p {
    margin: 8px 0 0;
    color: var(--qa-text-muted);
    font-size: 13px;
}

.qa-metric-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
}

.qa-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.qa-metric-row:last-child {
    border-bottom: 0;
}

.qa-metric-row span {
    color: var(--qa-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.qa-metric-row strong {
    color: var(--qa-text);
    font-size: 20px;
    font-weight: 800;
}

.qa-home-section {
    margin-top: 28px;
}

.qa-section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 14px;
}

.qa-section-header p {
    max-width: 700px;
    margin: 5px 0 0;
    color: var(--qa-text-muted);
    font-size: 13px;
}

.qa-module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.qa-module {
    display: flex;
    flex-direction: column;
    min-height: 178px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.qa-module:hover {
    color: inherit;
    border-color: #bfdbfe;
    box-shadow: var(--qa-shadow);
    transform: translateY(-2px);
}

.qa-module-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--qa-primary-soft);
    color: var(--qa-primary);
    margin-bottom: 14px;
}

.qa-module strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--qa-text);
}

.qa-module small {
    margin-top: auto;
    padding-top: 16px;
    color: var(--qa-primary);
    font-size: 12px;
    font-weight: 800;
}

.qa-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.qa-flow-step {
    padding: 18px;
}

.qa-flow-number {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.qa-flow-step strong {
    display: block;
    color: var(--qa-text);
    font-size: 14px;
}

.qa-data-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.qa-data-card {
    padding: 16px;
}

.qa-data-card span {
    display: block;
    color: var(--qa-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.qa-data-card strong {
    display: block;
    margin-top: 5px;
    color: var(--qa-text);
    font-size: 24px;
    font-weight: 800;
}

.qa-note-panel {
    padding: 20px;
}

.qa-note-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.qa-note-item {
    padding: 14px;
    border-radius: 8px;
    background: var(--qa-surface-soft);
}

.qa-note-item strong {
    display: block;
    font-size: 13px;
    color: var(--qa-text);
}

.qa-note-item span {
    display: block;
    margin-top: 5px;
    color: var(--qa-text-muted);
    font-size: 12px;
}

.loading-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    color: var(--qa-text-muted);
}

.loading-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #dbeafe;
    border-top-color: var(--qa-primary);
    animation: qa-spin 0.85s linear infinite;
}

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

@media (max-width: 1180px) {
    .qa-module-grid,
    .qa-flow-grid,
    .qa-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qa-home-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .qa-shell {
        display: block;
    }

    .qa-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--qa-shadow);
    }

    .qa-shell.sidebar-open .qa-sidebar {
        transform: translateX(0);
    }

    .qa-sidebar-close,
    .qa-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .qa-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        z-index: 1020;
    }

    .qa-shell.sidebar-open .qa-mobile-overlay {
        display: block;
    }

    .qa-topbar {
        padding: 12px 14px;
        align-items: center;
    }

    .qa-page-heading h1 {
        font-size: 18px;
    }

    .qa-topbar-actions {
        display: none;
    }

    .qa-content {
        padding: 18px 14px 28px;
    }

    .qa-hero-copy {
        padding: 24px;
        min-height: 240px;
    }

    .qa-hero-copy h2 {
        font-size: 26px;
    }

}

@media (max-width: 620px) {
    .qa-module-grid,
    .qa-flow-grid,
    .qa-data-grid,
    .qa-note-list {
        grid-template-columns: 1fr;
    }

    .qa-section-header {
        display: block;
    }
}
