* {
    box-sizing: border-box;
}

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

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f5f7fa;
    color: #1f2937;
}

.app {
    min-height: 100vh;
}

/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.app-header {
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 24px;

    background: #111827;
    color: #ffffff;
}

.brand {
    font-size: 20px;
    letter-spacing: 0.3px;
}

.header-user {
    font-size: 14px;
    opacity: 0.8;
}

/*
|--------------------------------------------------------------------------
| Body
|--------------------------------------------------------------------------
*/

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

/*
|--------------------------------------------------------------------------
| Sidebar
|--------------------------------------------------------------------------
*/

.sidebar {
    width: 240px;

    padding: 20px 14px;

    background: #ffffff;
    border-right: 1px solid #e5e7eb;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item {
    display: block;

    padding: 11px 14px;

    border-radius: 8px;

    color: #4b5563;
    text-decoration: none;

    font-size: 14px;
    font-weight: 500;
}

.sidebar-item:hover {
    background: #f3f4f6;
}

.sidebar-item.active {
    background: #e5e7eb;
    color: #111827;
}

/*
|--------------------------------------------------------------------------
| Main
|--------------------------------------------------------------------------
*/

.app-main {
    flex: 1;

    padding: 32px;
}

.page {
    max-width: 1400px;
    margin: 0 auto;
}

/*
|--------------------------------------------------------------------------
| Dashboard
|--------------------------------------------------------------------------
*/

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

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

.page-header p {
    margin: 0;
    color: #6b7280;
}

/*
|--------------------------------------------------------------------------
| Cards
|--------------------------------------------------------------------------
*/

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 20px;
}

.dashboard-card {
    padding: 24px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.dashboard-card h2 {
    margin-top: 0;
    margin-bottom: 10px;

    font-size: 18px;
}

.dashboard-card p {
    margin: 0;

    color: #6b7280;
    line-height: 1.5;
}

/*
|--------------------------------------------------------------------------
| Authentication
|--------------------------------------------------------------------------
*/

.auth-body {
    min-height: 100vh;

    margin: 0;

    background: #f5f7fa;
}

.auth-main {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 32px;
}

.auth-brand {
    margin-bottom: 24px;

    font-size: 24px;
    color: #111827;
}

.login-page {
    width: 100%;
    max-width: 420px;
}

.login-card {
    padding: 32px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 10px 30px rgba(
            0,
            0,
            0,
            0.06
        );
}

.login-header {
    margin-bottom: 28px;

    text-align: center;
}

.login-header h1 {
    margin: 0 0 8px;

    font-size: 24px;
    color: #111827;
}

.login-header p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;

    color: #374151;
}

.form-group input {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #ffffff;

    color: #111827;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input:focus {
    border-color: #6b7280;

    box-shadow:
        0 0 0 3px rgba(
            107,
            114,
            128,
            0.12
        );
}

.form-group select,
.form-group textarea {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #ffffff;

    color: #111827;

    font-family: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group select {
    min-height: 42px;

    cursor: pointer;
}

.form-group textarea {
    min-height: 110px;

    resize: vertical;

    line-height: 1.5;
}

.form-group select:focus,
.form-group textarea:focus {
    border-color: #6b7280;

    box-shadow:
        0 0 0 3px rgba(
            107,
            114,
            128,
            0.12
        );
}

.form-group select:disabled,
.form-group textarea:disabled,
.form-group input:disabled {
    background: #f3f4f6;

    color: #6b7280;

    cursor: not-allowed;
}

.login-button {
    width: 100%;

    margin-top: 4px;

    padding: 12px 16px;

    border: 0;
    border-radius: 8px;

    background: #111827;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}


.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.page-header-actions .login-button {
    width: auto;

    margin-top: 0;

    white-space: nowrap;
}

.login-button:hover {
    opacity: 0.92;
}

.login-button:active {
    transform: translateY(1px);
}

/*
|--------------------------------------------------------------------------
| Diagnostic Engine
|--------------------------------------------------------------------------
*/

.diagnostic-page {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.diagnostic-case-card,
.diagnostic-test-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.diagnostic-case-card {
    padding: 24px;
}

.diagnostic-case-header,
.diagnostic-test-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.diagnostic-label {
    display: block;
    margin-bottom: 7px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diagnostic-case-header h2,
.diagnostic-section-header h2 {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.diagnostic-status {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.diagnostic-status-progress {
    background: #f3f4f6;
    color: #374151;
}

.diagnostic-case-info {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.diagnostic-info-item,
.diagnostic-test-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diagnostic-info-item span,
.diagnostic-test-detail span {
    color: #6b7280;
    font-size: 12px;
}

.diagnostic-info-item strong,
.diagnostic-test-detail strong {
    color: #111827;
    font-size: 14px;
}

.diagnostic-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.diagnostic-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.diagnostic-test-card {
    padding: 24px;
}

.diagnostic-test-header h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.diagnostic-test-header p {
    margin: 0;
    max-width: 760px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.diagnostic-test-number {
    padding: 7px 10px;
    border-radius: 7px;
    background: #f3f4f6;
    color: #374151;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.diagnostic-test-details {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 18px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.diagnostic-test-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.diagnostic-primary-button {
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.diagnostic-primary-button:hover {
    opacity: 0.9;
}

.diagnostic-path {
    display: flex;
    align-items: stretch;
    gap: 12px;
    overflow-x: auto;
}

.diagnostic-path-item {
    min-width: 210px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.diagnostic-path-item span,
.diagnostic-path-item small {
    display: block;
    color: #6b7280;
    font-size: 11px;
}

.diagnostic-path-item strong {
    display: block;
    margin: 8px 0 4px;
    color: #111827;
    font-size: 14px;
}

.diagnostic-path-active {
    border-color: #9ca3af;
    box-shadow:
        0 0 0 2px rgba(
            17,
            24,
            39,
            0.05
        );
}

.diagnostic-path-arrow {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 20px;
}

@media (max-width: 900px) {

    .diagnostic-case-info,
    .diagnostic-test-details {
        grid-template-columns: 1fr 1fr;
    }

}

@media (max-width: 600px) {

    .diagnostic-case-info,
    .diagnostic-test-details {
        grid-template-columns: 1fr;
    }

    .diagnostic-case-header,
    .diagnostic-test-header {
        flex-direction: column;
    }

    .diagnostic-test-actions {
        justify-content: stretch;
    }

    .diagnostic-primary-button {
        width: 100%;
    }

}
