:root {
    --jd-bg: #f3f5f8;
    --jd-bg-soft: #f8fbfd;
    --jd-white: #ffffff;

    --jd-navy: #213448;
    --jd-navy-2: #2e465e;
    --jd-navy-3: #39546f;

    --jd-slate: #617181;
    --jd-slate-2: #7a8794;

    --jd-line: #dce4eb;
    --jd-line-2: #e7edf2;

    --jd-soft: #eef3f7;
    --jd-soft-2: #f4f7fa;

    --jd-text: #1f2a34;
    --jd-text-soft: #627080;

    --jd-shadow: 0 12px 28px rgba(20, 35, 52, 0.08);
    --jd-shadow-soft: 0 8px 18px rgba(20, 35, 52, 0.05);
    --jd-shadow-strong: 0 18px 48px rgba(20, 35, 52, 0.18);

    --jd-radius-xl: 22px;
    --jd-radius-lg: 18px;
    --jd-radius-md: 14px;
    --jd-radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: var(--jd-bg);
    color: var(--jd-text);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* =========================================
   LOGIN
========================================= */
.jd-login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(33, 52, 72, 0.95), rgba(55, 74, 93, 0.92)),
        linear-gradient(180deg, #edf2f7, #e4ebf2);
}

.jd-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.jd-login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 26px;
    box-shadow: 0 25px 80px rgba(9, 20, 33, 0.22);
    padding: 34px;
}

.jd-login-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--jd-soft);
    color: var(--jd-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 18px;
}

.jd-login-label,
.jd-section-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--jd-slate);
    margin-bottom: 8px;
}

.jd-login-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--jd-navy);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.jd-login-subtitle {
    color: var(--jd-text-soft);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.jd-login-note {
    color: var(--jd-text-soft);
    font-size: 0.86rem;
    text-align: center;
}

.jd-alert {
    border-radius: 14px;
}

/* =========================================
   FORM
========================================= */
.jd-label {
    font-weight: 600;
    color: var(--jd-navy);
    margin-bottom: 8px;
}

.jd-input {
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid var(--jd-line);
    box-shadow: none !important;
    color: var(--jd-text);
    background: #fff;
}

.jd-input:focus {
    border-color: #9eb0c2;
    background: #fff;
}

.form-select.jd-input {
    padding-right: 2.3rem;
}

/* =========================================
   APP LAYOUT
========================================= */
.jd-app {
    min-height: 100vh;
}

.jd-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    width: 280px;
    min-width: 280px;
    color: #fff;
    background: linear-gradient(180deg, #162535 0%, #102031 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.jd-sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
}

.jd-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 8px 24px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.jd-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.jd-brand-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.jd-brand-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
}

.jd-sidebar-section {
    margin: 0 10px 12px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.jd-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jd-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 500;
    transition: all 0.2s ease;
}

.jd-nav-link:hover,
.jd-nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.jd-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.jd-sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.jd-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.jd-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jd-user-name {
    font-weight: 600;
}

.jd-user-role {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}

.jd-main {
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   TOPBAR
========================================= */
.jd-topbar {
    padding: 22px 24px 12px;
}

.jd-topbar-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.jd-topbar-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.jd-topbar-titlewrap {
    min-width: 0;
    flex: 1;
}

.jd-topbar-right {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-shrink: 0;
}

.jd-page-title {
    margin: 0 0 4px;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--jd-navy);
}

.jd-page-subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--jd-text-soft);
    font-size: 0.93rem;
    line-height: 1.6;
}

.jd-menu-btn,
.jd-logout-icon {
    border: 1px solid var(--jd-line);
    background: #fff;
    color: var(--jd-navy);
    box-shadow: var(--jd-shadow-soft);
    transition: all 0.2s ease;
}

.jd-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 16px;
}

.jd-menu-btn:hover,
.jd-logout-icon:hover {
    background: #fff;
    color: var(--jd-navy);
    border-color: #ccd7e0;
}

.jd-menu-btn i,
.jd-logout-icon i {
    font-size: 1rem;
}

.jd-logout-btn {
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jd-logout-icon {
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jd-logout-icon:hover {
    transform: translateY(-1px);
}

.jd-content {
    flex: 1;
    padding: 0 24px 24px;
}

.jd-footer {
    padding: 8px 24px 20px;
}

.jd-footer-inner {
    color: var(--jd-text-soft);
    font-size: 0.88rem;
}

.jd-footer-dot {
    padding: 0 8px;
}

/* =========================================
   COMMON SECTIONS / CARDS
========================================= */
.jd-section {
    display: block;
}

.jd-section-header {
    margin-bottom: 18px;
}

.jd-section-title {
    margin-bottom: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--jd-navy);
}

.jd-section-text {
    max-width: 820px;
    margin-bottom: 0;
    color: var(--jd-text-soft);
    line-height: 1.7;
}

.jd-card,
.jd-metric-card,
.jd-evidence-card {
    background: var(--jd-white);
    border: 1px solid #e2e9ef;
    border-radius: var(--jd-radius-xl);
    box-shadow: var(--jd-shadow);
}

.jd-card {
    padding: 22px;
}

.jd-card-title {
    margin-bottom: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--jd-navy);
}

/* =========================================
   SUMMARY METRICS
========================================= */
.jd-metric-card {
    position: relative;
    height: 100%;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    transition: all 0.25s ease;
}

.jd-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(20, 35, 52, 0.12);
}

.jd-metric-accent::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(90deg, #213448, #3f5f7a);
    opacity: 0.08;
}

.jd-metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.jd-metric-titlewrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.jd-metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--jd-soft);
    color: var(--jd-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.jd-metric-label {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--jd-navy);
}

.jd-metric-value {
    margin-bottom: 0;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    text-align: right;
    color: var(--jd-navy);
    flex-shrink: 0;
}

.jd-metric-note {
    margin-top: 0;
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--jd-text-soft);
}

.jd-metric-status .jd-metric-value {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: normal;
    color: #4d7c57;
    background: rgba(77, 124, 87, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-block;
}

.jd-status-active {
    color: #2f6f4f;
    font-weight: 700;
}

/* =========================================
   TIMELINE
========================================= */
.jd-timeline {
    position: relative;
    padding-left: 28px;
}

.jd-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    width: 2px;
    background: linear-gradient(180deg, #c7d2dd, #dee6ed);
}

.jd-timeline-item {
    position: relative;
    padding: 0 0 22px 20px;
}

.jd-timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--jd-navy);
    box-shadow: 0 0 0 4px #edf2f7;
}

.jd-timeline-date {
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--jd-slate);
}

.jd-timeline-box {
    padding: 16px;
    background: #fbfcfd;
    border: 1px solid #e2e9ef;
    border-radius: 16px;
}

.jd-timeline-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--jd-navy);
}

.jd-timeline-box p {
    color: var(--jd-text-soft);
    line-height: 1.75;
}

/* =========================================
   CLUSTER / EVIDENCE CARDS
========================================= */
.jd-evidence-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdfe 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jd-evidence-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22px;
    width: 92px;
    height: 12px;
    border-radius: 0 0 12px 12px;
    background: #dbe5ee;
}

.jd-evidence-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(20, 35, 52, 0.10);
}

.jd-evidence-thumb-wrap {
    margin: -18px -18px 14px;
    overflow: hidden;
    background: #f7fafc;
    border-bottom: 1px solid #e6edf3;
}

.jd-evidence-thumb {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.jd-evidence-icon {
    width: 52px;
    height: 52px;
    margin-top: 10px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: var(--jd-soft);
    color: var(--jd-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.12rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.jd-evidence-title {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--jd-navy);
}

.jd-evidence-meta {
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--jd-slate);
}

.jd-evidence-severity {
    margin-top: 2px;
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--jd-slate);
}

.jd-evidence-desc {
    font-size: 0.92rem;
    line-height: 1.68;
    color: var(--jd-text-soft);
}

.jd-evidence-footer-meta {
    min-height: 24px;
    margin-top: 12px;
}

/* =========================================
   TAGS / BADGES
========================================= */
.jd-tags {
    margin-top: 12px;
}

.jd-tag,
.jd-attachment-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.jd-tag {
    padding: 6px 10px;
    margin-top: 8px;
    margin-right: 8px;
    background: #e9eef4;
    border: 1px solid #dbe4ec;
    color: var(--jd-navy);
}

.jd-attachment-badge {
    padding: 6px 10px;
    background: #edf3f8;
    border: 1px solid #d8e2eb;
    color: var(--jd-navy);
}

.jd-tags-card {
    padding: 22px;
}

.jd-tags-large .jd-tag {
    padding: 8px 12px;
    font-size: 0.82rem;
    background: #eef3f7;
    border: 1px solid #dbe4ec;
    font-weight: 600;
}

.jd-tags-count {
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--jd-slate);
    background: #f1f5f8;
    border: 1px solid #dde6ed;
    border-radius: 999px;
}

/* =========================================
   LIST
========================================= */
.jd-list {
    margin: 0;
    padding-left: 18px;
    color: var(--jd-text-soft);
}

.jd-list li {
    margin-bottom: 12px;
    line-height: 1.7;
}

/* =========================================
   BUTTONS
========================================= */
.jd-btn-primary {
    min-height: 46px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--jd-navy) 0%, #1b2d3f 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(20, 35, 52, 0.10);
    transition: all 0.2s ease;
}

.jd-btn-primary:hover {
    background: linear-gradient(180deg, var(--jd-navy-2) 0%, #233a50 100%);
    color: #fff;
    transform: translateY(-1px);
}

.jd-btn-outline {
    min-height: 44px;
    border: 1px solid var(--jd-line);
    border-radius: 14px;
    background: #fff;
    color: var(--jd-navy);
    font-weight: 600;
    box-shadow: var(--jd-shadow-soft);
    transition: all 0.2s ease;
}

.jd-btn-outline:hover {
    background: #fff;
    color: var(--jd-navy);
    border-color: #ccd7e0;
    transform: translateY(-1px);
}

/* =========================================
   OFFCANVAS
========================================= */
.jd-offcanvas {
    background: linear-gradient(180deg, #162535 0%, #102031 100%);
    color: #fff;
}

.jd-offcanvas .jd-nav-link {
    color: rgba(255, 255, 255, 0.84);
}

/* =========================================
   MODAL
========================================= */
.jd-modal-content {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--jd-shadow-strong);
}

.jd-modal-header {
    padding: 22px 24px;
    background: linear-gradient(180deg, var(--jd-navy) 0%, #1d3247 100%);
    color: #fff;
    border-bottom: 0;
}

.jd-modal-header .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.jd-modal-meta {
    margin-top: 2px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

.jd-modal-body-text {
    font-size: 0.95rem;
    line-height: 1.82;
    color: var(--jd-text-soft);
}

.jd-modal-actions-wrap {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #e4ebf1;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.jd-subsection-title {
    margin-bottom: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--jd-navy);
}

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

/* =========================================
   ATTACHMENT CHIPS
========================================= */
.jd-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid #dbe4ec;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
    box-shadow: 0 6px 16px rgba(20, 35, 52, 0.05);
    transition: all 0.2s ease;
}

.jd-attachment-chip:hover {
    background: linear-gradient(180deg, #f5f9fc 0%, #edf3f8 100%);
    border-color: #c8d6e3;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(20, 35, 52, 0.08);
}

.jd-attachment-chip-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--jd-soft);
    color: var(--jd-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.jd-attachment-chip-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.jd-attachment-chip-label {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--jd-navy);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.jd-attachment-chip-type {
    margin-top: 2px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--jd-text-soft);
}

.jd-attachment-chip[data-type="image"] .jd-attachment-chip-icon {
    background: #edf4fb;
    color: #274f76;
}

.jd-attachment-chip[data-type="pdf"] .jd-attachment-chip-icon {
    background: #f9ecec;
    color: #a13c3c;
}

.jd-attachment-chip[data-type="doc"] .jd-attachment-chip-icon,
.jd-attachment-chip[data-type="docx"] .jd-attachment-chip-icon {
    background: #eef1fb;
    color: #3651a3;
}

.jd-attachment-chip[data-type="audio"] .jd-attachment-chip-icon {
    background: #f3eefb;
    color: #6b42a8;
}

.jd-attachment-chip[data-type="video"] .jd-attachment-chip-icon {
    background: #eef7f7;
    color: #256f6f;
}

/* =========================================
   REPORT CONTENT
========================================= */
.jd-report-content {
    font-size: 0.96rem;
    line-height: 1.85;
    color: var(--jd-text-soft);
}

.jd-report-content h3 {
    margin-bottom: 16px;
    font-size: 1.24rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--jd-navy);
}

.jd-report-content h4 {
    margin-top: 22px;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--jd-navy);
}

.jd-report-content p {
    margin-bottom: 14px;
}

.jd-report-content ul {
    margin-bottom: 14px;
    padding-left: 18px;
}

.jd-report-content li {
    margin-bottom: 8px;
}

.jd-report-table {
    font-size: 0.92rem;
    border-color: #dde6ed;
}

.jd-report-table th {
    background: #eef3f7;
    color: var(--jd-navy);
    white-space: nowrap;
    font-weight: 700;
}

.jd-report-table td,
.jd-report-table th {
    padding: 12px 14px;
    vertical-align: top;
}

/* =========================================
   ABSTRACT / SPECIAL CONTENT BLOCKS
========================================= */
.jd-abstract-card {
    padding: 24px;
}

.jd-abstract-header,
.jd-chronology-intro,
.jd-medical-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.jd-abstract-header {
    margin-bottom: 14px;
}

.jd-chronology-intro {
    margin-bottom: 20px;
}

.jd-medical-head {
    margin-bottom: 18px;
}

.jd-abstract-icon,
.jd-chronology-intro-icon,
.jd-medical-head-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--jd-soft);
    color: var(--jd-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jd-abstract-sub {
    font-size: 0.85rem;
    color: var(--jd-text-soft);
}

.jd-abstract-body p {
    color: var(--jd-text-soft);
    line-height: 1.8;
    font-size: 0.95rem;
}

.jd-chronology-card {
    padding: 24px;
}

.jd-medical-card {
    padding: 22px;
}

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

.jd-medical-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px dashed #dbe4ec;
    color: var(--jd-text-soft);
    line-height: 1.75;
}

.jd-medical-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.jd-medical-list-icon {
    width: 22px;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jd-navy);
}

.jd-highlight-soft {
    color: #c85a8d;
    font-weight: 600;
    background: linear-gradient(transparent 62%, rgba(232, 170, 196, 0.28) 62%);
    padding: 0 2px;
    border-radius: 4px;
}

/* =========================================
   SMALL HELPERS
========================================= */
.text-muted {
    color: var(--jd-text-soft) !important;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 991.98px) {
    .jd-main {
        margin-left: 0;
    }

    .jd-topbar {
        padding: 18px 16px 10px;
    }

    .jd-topbar-main {
        gap: 12px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .jd-topbar-left {
        gap: 12px;
        min-width: 0;
        flex: 1;
    }

    .jd-topbar-right {
        flex-shrink: 0;
    }

    .jd-page-title {
        margin-bottom: 6px;
        font-size: 1.26rem;
        line-height: 1.25;
    }

    .jd-page-subtitle {
        max-width: 520px;
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .jd-content {
        padding: 0 16px 20px;
    }

    .jd-footer {
        padding: 8px 16px 18px;
    }
}

@media (max-width: 575.98px) {
    .jd-login-card {
        padding: 24px;
        border-radius: 20px;
    }

    .jd-card,
    .jd-metric-card,
    .jd-evidence-card,
    .jd-modal-content {
        border-radius: 18px;
    }

    .jd-topbar {
        padding: 16px 14px 8px;
    }

    .jd-topbar-main {
        gap: 10px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .jd-topbar-left {
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .jd-topbar-right {
        flex-shrink: 0;
    }

    .jd-menu-btn,
    .jd-logout-icon {
        width: 46px;
        min-width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .jd-page-title {
        margin-bottom: 4px;
        font-size: 1.16rem;
        line-height: 1.25;
    }

    .jd-page-subtitle {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .jd-section-title {
        font-size: 1.18rem;
    }

    .jd-metric-top {
        gap: 12px;
        margin-bottom: 12px;
    }

    .jd-metric-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 0.9rem;
    }

    .jd-metric-label {
        font-size: 0.86rem;
    }

    .jd-metric-value {
        font-size: 1.55rem;
    }

    .jd-evidence-thumb {
        height: 170px;
    }

    .jd-modal-actions {
        gap: 10px;
    }

    .jd-attachment-chip {
        width: 100%;
    }

    .jd-attachment-chip-label {
        max-width: none;
    }

    .jd-chronology-card,
    .jd-medical-card {
        padding: 20px;
    }

    .jd-chronology-intro,
    .jd-medical-head {
        align-items: flex-start;
    }
}

@media (min-width: 1200px) {
    .jd-metric-card-wrapper {
        display: flex;
        justify-content: center;
    }
}

/* =========================================
   ADJUST MODAL HEADER WITH PRINT/EXPORT PDF BUTTON
========================================= */
.jd-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.jd-modal-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.jd-modal-tool-btn {
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.jd-modal-tool-btn i {
    font-size: 13px;
}

.jd-modal-tool-btn-light {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
}

.jd-modal-tool-btn-light:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
}

.jd-modal-tool-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.jd-modal-tool-btn-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

@media (max-width: 767.98px) {
    .jd-modal-header {
        align-items: stretch;
    }

    .jd-modal-header-tools {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .jd-modal-tool-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* =========================================================
   PAGE PRELOADER — STABLE POSITION / CALMER FADE
========================================================= */
.jd-main {
    position: relative;
    min-height: 100vh;
}

.jd-page-loader {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 280px;
    /* ikut lebar sidebar desktop kau */
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(250, 251, 252, 0.28);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .28s ease-out,
        visibility 0s linear .28s;

    -webkit-tap-highlight-color: transparent;
}

.jd-page-loader.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
        opacity .18s ease-in,
        visibility 0s linear 0s;
}

.jd-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transform: scale(.985);
    transition: transform .18s ease;
    will-change: transform;
}

.jd-page-loader.is-active .jd-spinner-wrap {
    transform: scale(1);
}

.jd-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid rgba(15, 23, 42, 0.09);
    border-top-color: #355574;
    border-right-color: #5b84c4;
    animation: jdSpin .82s linear infinite;
    will-change: transform;
}

body.jd-loading {
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .jd-page-loader {
        left: 0;
        background: rgba(250, 251, 252, 0.32);
    }
}

@media (prefers-reduced-motion: reduce) {

    .jd-page-loader,
    .jd-spinner-wrap {
        transition: none;
    }

    .jd-spinner {
        animation-duration: 1.2s;
    }
}

@keyframes jdSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   CONTENT REVEAL — PREMIUM BUT MODAL-FRIENDLY
========================================================= */
.jd-content {
    transition:
        opacity .32s ease-out,
        transform .32s ease-out;
    will-change: opacity, transform;
}

body.jd-loading .jd-content {
    opacity: 0.82;
    transform: translateY(6px);
}

body:not(.jd-loading) .jd-content {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   MODAL SAFETY
========================================================= */
/* bila modal terbuka, jangan bagi jd-content terus bawa effect transition */
body.modal-open .jd-content {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
}

/* jangan paksa backdrop/modal opacity */
.modal-dialog,
.modal-content {
    transform: none;
}