/* ─── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ─── Base ──────────────────────────────────────────────────────── */
.lt-wrap *, .lt-wrap *::before, .lt-wrap *::after { box-sizing: border-box; }
.lt-wrap {
    font-family: 'Tajawal', 'Cairo', Arial, sans-serif;
    font-size: 15px; color: #1a1a2e;
    max-width: 1400px; margin: 0 auto; padding: 20px;
    direction: rtl; text-align: right;
}
.lt-wrap.lt-ltr {
    font-family: 'Inter', -apple-system, sans-serif;
    direction: ltr; text-align: left;
}

/* ─── Language bar ──────────────────────────────────────────────── */
.lt-lang-bar { text-align: center; margin-bottom: 20px; }
.lt-lang-toggle {
    display: flex; align-items: center; gap: 6px;
}
.lt-lang-btn {
    background: none; border: 1.5px solid #e5e7eb; border-radius: 20px;
    padding: 5px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; color: #6b7280; transition: all 0.2s;
    font-family: inherit;
}
.lt-lang-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.lt-lang-btn:hover:not(.active) { border-color: #4f46e5; color: #4f46e5; }
.lt-lang-sep { color: #d1d5db; font-size: 14px; }

/* ─── Auth Card ─────────────────────────────────────────────────── */
.lt-auth-card {
    max-width: 640px; margin: 0 auto;
    background: #fff; border-radius: 16px;
    box-shadow: 0 4px 40px rgba(0,0,0,0.10); padding: 48px;
}
.lt-logo { text-align: center; margin-bottom: 32px; }
.lt-logo-icon { font-size: 48px; line-height: 1; margin-bottom: 10px; }
.lt-logo h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; color: #1a1a2e; }
.lt-logo p  { margin: 0; color: #6b7280; font-size: 14px; }

/* ─── Tabs ──────────────────────────────────────────────────────── */
.lt-tabs {
    display: flex; margin-bottom: 28px;
    border-bottom: 2px solid #f0f0f5;
}
.lt-tab {
    flex: 1; padding: 12px; border: none; background: transparent;
    font-size: 15px; font-weight: 600; color: #6b7280; cursor: pointer;
    border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; font-family: inherit;
}
.lt-tab.active { color: #4f46e5; border-bottom-color: #4f46e5; }
.lt-tab:hover:not(.active) { color: #374151; }
.lt-tab-pane { display: none; }
.lt-tab-pane.active { display: block; }

/* ─── Forms ─────────────────────────────────────────────────────── */
.lt-form-group { margin-bottom: 16px; }
.lt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lt-form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.lt-form-group label .req { color: #ef4444; }
.lt-form-group input, .lt-form-group select, .lt-form-group textarea {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 14px; color: #111827; background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s; outline: none; font-family: inherit;
}
.lt-wrap.lt-ltr .lt-form-group input,
.lt-wrap.lt-ltr .lt-form-group select,
.lt-wrap.lt-ltr .lt-form-group textarea { direction: ltr; text-align: left; }
.lt-form-group input:focus, .lt-form-group select:focus, .lt-form-group textarea:focus {
    border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); background: #fff;
}
.lt-ref-display {
    padding: 10px 14px; background: #f0fdf4;
    border: 1.5px solid #bbf7d0; border-radius: 8px;
    font-size: 13px; color: #166534; font-weight: 500;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.lt-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 11px 22px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.lt-btn-primary { background: #4f46e5; color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,0.3); }
.lt-btn-primary:hover { background: #4338ca; box-shadow: 0 4px 14px rgba(79,70,229,0.4); }
.lt-btn-primary:disabled { opacity: 0.6; cursor: default; }
.lt-btn-outline { background: transparent; color: #4f46e5; border: 1.5px solid #4f46e5; }
.lt-btn-outline:hover { background: #4f46e5; color: #fff; }
.lt-btn-ghost { background: transparent; color: #6b7280; border: 1.5px solid #e5e7eb; }
.lt-btn-ghost:hover { background: #f9fafb; }
.lt-btn-sm { padding: 7px 16px; font-size: 13px; }
#lt-login-btn, #lt-register-btn { width: 100%; margin-top: 8px; padding: 13px; font-size: 16px; }

/* ─── Messages ──────────────────────────────────────────────────── */
.lt-msg { padding: 10px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.lt-msg-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.lt-msg-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ─── Topbar ────────────────────────────────────────────────────── */
.lt-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-radius: 14px; padding: 16px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07); margin-bottom: 16px;
    flex-wrap: wrap; gap: 12px;
}
.lt-patient-info { display: flex; align-items: center; gap: 14px; }
.lt-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(135deg,#4f46e5,#7c3aed);
    color: #fff; font-size: 20px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lt-patient-name { font-weight: 700; font-size: 16px; color: #111827; }
.lt-patient-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.lt-topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lt-result-count { font-size: 13px; color: #6b7280; font-weight: 500; }

/* ─── Dashboard nav tabs ────────────────────────────────────────── */
.lt-dash-tabs {
    display: flex; gap: 4px; background: #f1f0fb;
    border-radius: 12px; padding: 4px; margin-bottom: 20px; width: fit-content;
}
.lt-dash-tab {
    padding: 9px 22px; border: none; border-radius: 9px; cursor: pointer;
    font-size: 14px; font-weight: 600; background: transparent; color: #6b7280;
    display: flex; align-items: center; gap: 6px; transition: all 0.2s; font-family: inherit;
}
.lt-dash-tab.active { background: #fff; color: #4f46e5; box-shadow: 0 2px 8px rgba(79,70,229,0.12); }

/* ─── Stats ─────────────────────────────────────────────────────── */
.lt-stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.lt-stat-card { background: #fff; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.lt-stat-num   { font-size: 26px; font-weight: 700; color: #4f46e5; line-height: 1; margin-bottom: 6px; }
.lt-stat-label { font-size: 12px; color: #6b7280; font-weight: 500; }

/* ─── Results section ───────────────────────────────────────────── */
.lt-results-section { background: #fff; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); overflow: hidden; }
.lt-results-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px 12px; border-bottom: 1px solid #f0f0f5; flex-wrap: wrap; gap: 12px;
}
.lt-results-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #111827; }
.lt-filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lt-search-input, .lt-filter-select {
    padding: 8px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 13px; color: #374151; outline: none; transition: border-color 0.2s; font-family: inherit;
}
.lt-search-input { width: 200px; }
.lt-filter-select { min-width: 200px; }
.lt-search-input:focus, .lt-filter-select:focus { border-color: #4f46e5; }

/* ─── Empty ─────────────────────────────────────────────────────── */
.lt-empty { text-align: center; padding: 60px 20px; color: #6b7280; }
.lt-empty-icon { font-size: 48px; margin-bottom: 16px; }
.lt-empty p { margin: 0; font-size: 15px; }

/* ─── Table ─────────────────────────────────────────────────────── */
.lt-table-wrap { overflow-x: auto; }
.lt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lt-table th {
    padding: 11px 14px; background: #f8f9ff;
    font-weight: 700; font-size: 12px; color: #5b21b6; text-transform: uppercase;
    letter-spacing: 0.3px; border-bottom: 1.5px solid #e5e7eb; white-space: nowrap; text-align: right;
}
.lt-wrap.lt-ltr .lt-table th, .lt-wrap.lt-ltr .lt-table td { text-align: left; }
.lt-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; text-align: right; }
.lt-table tbody tr:hover { background: #f8f9ff; }
.lt-table tbody tr:last-child td { border-bottom: none; }
.lt-td-date  { font-weight: 600; color: #374151; white-space: nowrap; }
.lt-td-test  { font-weight: 500; color: #111827; max-width: 220px; }
.lt-td-value { font-weight: 700; color: #1a1a2e; white-space: nowrap; font-size: 14px; }
.lt-unit     { font-size: 11px; font-weight: 400; color: #6b7280; margin-right: 2px; }
.lt-wrap.lt-ltr .lt-unit { margin-right: 0; margin-left: 2px; }
.lt-td-ref   { color: #6b7280; font-size: 12px; white-space: nowrap; }
.lt-td-lab   { color: #6b7280; font-size: 12px; }
.lt-td-notes { max-width: 150px; color: #6b7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Badges & Status ───────────────────────────────────────────── */
.lt-badge-cat { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #ede9fe; color: #5b21b6; white-space: nowrap; }
.lt-status { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lt-status-normal { background: #dcfce7; color: #15803d; }
.lt-status-high   { background: #fee2e2; color: #dc2626; }
.lt-status-low    { background: #fef3c7; color: #d97706; }

/* ─── Sparkline button ──────────────────────────────────────────── */
.lt-sparkline-btn {
    background: none; border: none; cursor: pointer; padding: 2px 5px;
    font-size: 14px; opacity: 0.5; transition: opacity 0.2s; vertical-align: middle;
}
.lt-sparkline-btn:hover { opacity: 1; }

/* ─── Delete ────────────────────────────────────────────────────── */
.lt-delete-btn { background: none; border: none; cursor: pointer; color: #d1d5db; font-size: 14px; padding: 4px 8px; border-radius: 6px; transition: all 0.2s; }
.lt-delete-btn:hover { color: #ef4444; background: #fee2e2; }

/* ─── Modal ─────────────────────────────────────────────────────── */
.lt-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lt-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 660px; max-height: 92vh; overflow-y: auto; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.lt-modal-wide { max-width: 820px; }
.lt-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.lt-modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: #111827; }
.lt-modal-close { background: #f3f4f6; border: none; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 16px; color: #6b7280; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.lt-modal-close:hover { background: #fee2e2; color: #ef4444; }
.lt-modal-footer { display: flex; justify-content: flex-start; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #f0f0f5; }
.lt-wrap.lt-ltr .lt-modal-footer { justify-content: flex-end; }
.lt-chart-modal-body { height: 320px; position: relative; }
.lt-chart-stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #f0f0f5; }

/* ─── Charts Tab ────────────────────────────────────────────────── */
.lt-charts-intro { color: #6b7280; font-size: 14px; margin-bottom: 16px; }

.lt-chart-pills {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
}
.lt-chart-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px 8px 10px;
    border: 1.5px solid #e5e7eb; border-radius: 24px;
    background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: #374151;
    transition: all 0.2s; font-family: inherit;
    max-width: 220px;
}
.lt-chart-pill:hover { border-color: #4f46e5; color: #4f46e5; background: #f5f3ff; }
.lt-chart-pill.active { border-color: #4f46e5; background: #4f46e5; color: #fff; }

/* Icon bubble */
.lt-pill-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    transition: background 0.2s;
}
.lt-chart-pill:hover  .lt-pill-icon { background: #ede9fe; }
.lt-chart-pill.active .lt-pill-icon { background: rgba(255,255,255,0.2); }

/* Label */
.lt-pill-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Count badge */
.lt-pill-count {
    background: rgba(0,0,0,0.1); border-radius: 10px;
    padding: 1px 7px; font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.lt-chart-pill.active .lt-pill-count { background: rgba(255,255,255,0.25); }

.lt-chart-area { background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.lt-chart-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.lt-chart-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #111827; }
.lt-chart-meta  { font-size: 13px; color: #6b7280; }
.lt-chart-summary-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.lt-pill-stat {
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: #f1f0fb; color: #5b21b6;
}
.lt-pill-trend         { background: #f1f5f9; color: #64748b; }
.lt-pill-status-normal { background: #dcfce7; color: #15803d; }
.lt-pill-status-high   { background: #fee2e2; color: #dc2626; }
.lt-pill-status-low    { background: #fef3c7; color: #d97706; }

.lt-canvas-wrap { position: relative; height: 360px; margin-bottom: 28px; }
.lt-canvas-wrap canvas { width: 100% !important; }

/* ─── History mini-table ────────────────────────────────────────── */
.lt-chart-history h4 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #374151; }
.lt-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lt-mini-table th { padding: 8px 12px; background: #f8f9ff; font-weight: 600; font-size: 12px; color: #5b21b6; border-bottom: 1.5px solid #e5e7eb; text-align: right; }
.lt-mini-table td { padding: 9px 12px; border-bottom: 1px solid #f3f4f6; }
.lt-mini-table tbody tr:last-child td { border-bottom: none; }
.lt-mini-table tbody tr:hover { background: #f8f9ff; }
.lt-wrap.lt-ltr .lt-mini-table th, .lt-wrap.lt-ltr .lt-mini-table td { text-align: left; }

.lt-change { font-weight: 700; font-size: 12px; }
.lt-change-up   { color: #ef4444; }
.lt-change-down { color: #22c55e; }
.lt-change-flat { color: #94a3b8; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) { .lt-stats-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) {
    .lt-auth-card  { padding: 24px 18px; }
    .lt-form-row   { grid-template-columns: 1fr; }
    .lt-topbar     { flex-direction: column; align-items: flex-start; }
    .lt-stats-row  { grid-template-columns: 1fr 1fr; }
    .lt-search-input { width: 130px; }
    .lt-modal      { padding: 20px 16px; }
    .lt-canvas-wrap { height: 260px; }
    .lt-chart-area  { padding: 16px; }
    .lt-dash-tabs   { width: 100%; }
    .lt-dash-tab    { flex: 1; justify-content: center; }
}

/* ═══════════════════════════════════════
   PDF IMPORT BUTTON & MODAL
═══════════════════════════════════════ */
.lt-btn-pdf {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(14,165,233,0.35);
}
.lt-btn-pdf:hover { background: linear-gradient(135deg, #0284c7, #0369a1); box-shadow: 0 4px 14px rgba(14,165,233,0.45); }

/* ── Steps ── */
.lt-pdf-step { }

/* ── Drop Zone ── */
.lt-pdf-dropzone {
    border: 2.5px dashed #c7d2fe;
    border-radius: 14px;
    background: #f8f9ff;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.lt-pdf-dropzone:hover,
.lt-pdf-drag-over {
    border-color: #4f46e5;
    background: #eef2ff;
}
.lt-pdf-drop-icon { font-size: 48px; margin-bottom: 12px; line-height: 1; }
.lt-pdf-dropzone p { margin: 0 0 16px; color: #6b7280; font-size: 15px; }
.lt-pdf-dropzone label {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 8px; cursor: pointer;
    background: #4f46e5; color: #fff; font-size: 14px; font-weight: 600;
    transition: background 0.2s; font-family: inherit;
}
.lt-pdf-dropzone label:hover { background: #4338ca; }

/* ── Processing spinner ── */
.lt-pdf-processing {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; padding: 40px; color: #4f46e5; font-size: 15px; font-weight: 600;
}
.lt-pdf-spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid #e0e7ff;
    border-top-color: #4f46e5;
    animation: lt-spin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes lt-spin { to { transform: rotate(360deg); } }

/* ── Meta bar ── */
.lt-pdf-meta-bar {
    background: #f8f9ff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.lt-pdf-meta-bar .lt-form-row { margin-bottom: 0; }
.lt-pdf-meta-bar .lt-form-group { margin-bottom: 0; }

/* ── Select all bar ── */
.lt-pdf-select-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0 8px;
    border-bottom: 2px solid #f0f0f5;
    margin-bottom: 0;
}
.lt-check-all-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: #374151; cursor: pointer;
}
.lt-check-all-label input { width: 16px; height: 16px; cursor: pointer; accent-color: #4f46e5; }
.lt-pdf-found-count {
    font-size: 12px; font-weight: 600; color: #4f46e5;
    background: #eef2ff; padding: 3px 10px; border-radius: 20px;
}

/* ── Preview table ── */
.lt-pdf-preview-table tbody tr td:first-child {
    text-align: center; padding: 10px 8px;
}
.lt-pdf-preview-table input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer; accent-color: #4f46e5;
}
.lt-pdf-preview-table tbody tr { transition: background 0.15s; }
.lt-pdf-preview-table tbody tr:has(input:not(:checked)) { opacity: 0.45; }

/* ── Unmatched warning ── */
.lt-pdf-unmatched {
    margin-top: 12px; padding: 10px 14px;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; font-size: 12px; color: #92400e;
}

/* ── Done screen ── */
.lt-pdf-done {
    text-align: center;
    padding: 40px 20px;
}
.lt-pdf-done-icon { font-size: 52px; line-height: 1; margin-bottom: 16px; }
.lt-pdf-done h3   { font-size: 20px; color: #15803d; margin: 0 0 24px; font-weight: 700; }

/* ═══════════════════════════════════════
   LANGUAGE DROPDOWN
═══════════════════════════════════════ */
.lt-lang-select {
    padding: 6px 32px 6px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234f46e5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.lt-lang-select:hover  { border-color: #4f46e5; }
.lt-lang-select:focus  { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.lt-lang-bar { text-align: center; margin-bottom: 20px; }

/* ═══════════════════════════════════════
   SORTABLE COLUMN HEADERS
═══════════════════════════════════════ */
.lt-th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.lt-th-sort:hover { color: #4f46e5; background: #f0eeff; }
.lt-sort-icon {
    display: inline-block;
    font-size: 11px;
    color: #c4b5fd;
    margin-right: 3px;
    transition: color 0.15s;
    font-style: normal;
}
.lt-wrap.lt-ltr .lt-sort-icon { margin-right: 0; margin-left: 3px; }
.lt-sort-icon.active { color: #4f46e5; font-weight: 700; }

/* ═══════════════════════════════════════
   CHART — HIGH CONTRAST LEGEND PILLS
═══════════════════════════════════════ */
.lt-legend-normal {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: #15803d;
}
.lt-legend-high {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: #dc2626;
}
.lt-legend-low {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: #d97706;
}
.lt-chart-legend {
    display: flex; flex-wrap: wrap; gap: 16px;
    margin-bottom: 12px; padding: 10px 16px;
    background: #f8fdf9; border: 1.5px solid #bbf7d0;
    border-radius: 10px; font-size: 12px;
}
.lt-chart-legend-item {
    display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.lt-legend-dot {
    width: 12px; height: 12px; border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1.5px currentColor;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   IMAGING TAB
═══════════════════════════════════════════════════ */
.lt-imaging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.lt-imaging-header .lt-charts-intro { margin: 0; }

/* ── Filter bar ── */
.lt-img-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.lt-img-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.lt-img-filter-btn:hover  { border-color: #4f46e5; color: #4f46e5; }
.lt-img-filter-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.lt-img-filter-btn.active .lt-pill-count { background: rgba(255,255,255,0.25); color: #fff; }

/* ── Gallery grid ── */
.lt-img-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.lt-img-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.lt-img-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.11);
}

/* ── Thumbnail area ── */
.lt-img-thumb-wrap {
    position: relative;
    aspect-ratio: 4/3;
    background: #0f172a;
    overflow: hidden;
}
.lt-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.lt-img-card:hover .lt-img-thumb { transform: scale(1.04); }

/* ── Hover overlay ── */
.lt-img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}
.lt-img-card:hover .lt-img-overlay { opacity: 1; }
.lt-img-view-btn, .lt-img-del-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, transform 0.15s;
    backdrop-filter: blur(4px);
    text-decoration: none;
}
.lt-img-view-btn:hover { background: rgba(255,255,255,0.35); transform: scale(1.1); }
.lt-img-del-btn:hover  { background: rgba(220,38,38,0.7);    transform: scale(1.1); }

/* ── PDF thumb ── */
.lt-img-pdf-thumb {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: #f8f9ff; color: #4f46e5; gap: 8px;
    font-size: 48px;
}
.lt-img-pdf-label { font-size: 13px; font-weight: 700; letter-spacing: 1px; }

/* ── Card body ── */
.lt-img-card-body {
    padding: 12px 14px 14px;
}
.lt-img-card-mod {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.lt-img-side {
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}
.lt-img-card-part {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.lt-img-card-date { font-size: 12px; color: #6b7280; }
.lt-img-card-notes {
    font-size: 12px; color: #9ca3af;
    margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Modality badge colours ── */
.lt-badge-xray  { background: #dbeafe; color: #1d4ed8; }
.lt-badge-mri   { background: #ede9fe; color: #6d28d9; }
.lt-badge-ct    { background: #fef3c7; color: #92400e; }
.lt-badge-us    { background: #d1fae5; color: #065f46; }
.lt-badge-echo  { background: #fce7f3; color: #9d174d; }
.lt-badge-other { background: #f3f4f6; color: #374151; }

/* ═══════════════════════════════════════════════════
   IMAGING UPLOAD MODAL
═══════════════════════════════════════════════════ */
.lt-img-dropzone {
    border: 2.5px dashed #c7d2fe;
    border-radius: 14px;
    background: #f8f9ff;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.lt-img-dropzone:hover, .lt-img-dropzone.lt-pdf-drag-over {
    border-color: #4f46e5;
    background: #eef2ff;
}
.lt-img-drop-icon { font-size: 52px; line-height: 1; margin-bottom: 10px; }
.lt-img-dropzone p { margin: 0 0 14px; color: #6b7280; font-size: 15px; }
.lt-img-drop-sub { font-size: 12px !important; color: #9ca3af !important; margin-top: 8px !important; }
.lt-img-dropzone label {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 8px; cursor: pointer;
    background: #4f46e5; color: #fff; font-size: 14px; font-weight: 600;
    transition: background 0.2s; font-family: inherit;
}
.lt-img-dropzone label:hover { background: #4338ca; }

/* ── Preview thumbnails grid ── */
.lt-img-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 16px;
}
.lt-img-pre-item {
    position: relative;
    width: 90px; height: 90px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}
.lt-img-pre-thumb {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.lt-img-pre-remove {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px;
    background: rgba(0,0,0,0.65); color: #fff;
    border-radius: 50%; border: none;
    font-size: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit;
}
.lt-img-pre-name {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.55); color: #fff;
    font-size: 9px; padding: 2px 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-img-pre-add {
    width: 90px; height: 90px;
    border-radius: 10px;
    border: 2.5px dashed #c7d2fe;
    background: #f8f9ff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 28px; color: #a5b4fc;
    transition: all 0.15s;
}
.lt-img-pre-add:hover { border-color: #4f46e5; color: #4f46e5; background: #eef2ff; }

/* ── Meta fields ── */
.lt-img-meta-fields { margin-top: 4px; }

/* ── Upload progress bar ── */
.lt-img-progress-wrap {
    margin-top: 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.lt-img-progress-bar {
    height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden;
}
.lt-img-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg,#4f46e5,#7c3aed);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.lt-img-progress-wrap span { font-size: 12px; color: #4f46e5; font-weight: 600; }

/* ═══════════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════════ */
.lt-lightbox {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.lt-lightbox-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.92);
    cursor: zoom-out;
}
.lt-lightbox-inner {
    position: relative; z-index: 1;
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 100px);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
#lt-lightbox-img {
    max-width: 100%; max-height: calc(100vh - 160px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: block;
}
.lt-lightbox-caption {
    color: rgba(255,255,255,0.75);
    font-size: 13px; text-align: center;
    max-width: 600px;
}
.lt-lightbox-close {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.4);
    color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s; backdrop-filter: blur(6px);
}
.lt-lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lt-lightbox-prev, .lt-lightbox-next {
    position: absolute; top: 50%; z-index: 2;
    transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.4);
    color: #fff; font-size: 26px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s; backdrop-filter: blur(6px);
}
.lt-lightbox-prev { left: 16px; }
.lt-lightbox-next { right: 16px; }
.lt-lightbox-prev:hover, .lt-lightbox-next:hover { background: rgba(255,255,255,0.3); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .lt-img-gallery { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
    .lt-lightbox-inner { max-width: calc(100vw - 60px); }
    .lt-lightbox-prev { left: 6px; }
    .lt-lightbox-next { right: 6px; }
}

/* ═══════════════════════════════════════
   PDF / IMAGE IMPORT — upload button row
═══════════════════════════════════════ */
.lt-pdf-upload-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.lt-upload-browse-btn,
.lt-upload-camera-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
}
.lt-upload-browse-btn {
    background: #4f46e5;
    color: #fff;
}
.lt-upload-browse-btn:hover { background: #4338ca; }

.lt-btn-camera,
.lt-upload-camera-btn {
    background: #fff;
    color: #374151;
    border: 2px solid #d1d5db !important;
}
.lt-upload-camera-btn:hover {
    border-color: #4f46e5 !important;
    color: #4f46e5;
    background: #f5f3ff;
}

/* Hide camera button on desktop (it only makes sense on mobile) */
@media (hover: hover) and (pointer: fine) {
    .lt-upload-camera-btn { display: none; }
}

/* ═══════════════════════════════════════
   DUPLICATE DETECTION — PDF Import
═══════════════════════════════════════ */
.lt-dupe-row {
    background: #fff7ed !important;
    opacity: 0.80;
}
.lt-dupe-row td { color: #92400e; }

.lt-dupe-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #fde68a;
    color: #92400e;
    border: 1px solid #fcd34d;
    vertical-align: middle;
    margin-inline-start: 6px;
    white-space: nowrap;
}

/* Done step messages */
.lt-pdf-done-saved {
    font-size: 16px; font-weight: 700; color: #166534; margin: 0 0 12px;
}
.lt-pdf-done-alldupes {
    font-size: 15px; font-weight: 700; color: #92400e; margin: 0 0 10px;
}
.lt-pdf-done-skipped-title {
    font-size: 14px; font-weight: 600; color: #b45309; margin: 10px 0 6px;
}
.lt-pdf-dupe-list {
    margin: 0 0 0 18px; padding: 0;
    list-style: disc;
}
[dir="rtl"] .lt-pdf-dupe-list { margin: 0 18px 0 0; }
.lt-pdf-dupe-list li {
    font-size: 13px; color: #78350f; margin-bottom: 3px;
}
.lt-pdf-dupe-date {
    color: #a16207; font-size: 12px;
}

/* ═══════════════════════════════════════
   DATE GROUP HEADERS — Results Tab
═══════════════════════════════════════ */
.lt-date-group-hdr td {
    padding: 0 !important;
    border-bottom: none !important;
}
.lt-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border: none;
    border-top: 2px solid #c7d2fe;
    border-bottom: 1px solid #c7d2fe;
    padding: 10px 16px;
    cursor: pointer;
    text-align: start;
    transition: background 0.2s;
}
.lt-group-toggle:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #dde5ff 100%);
}
.lt-group-arrow {
    font-size: 11px;
    color: #6366f1;
    transition: transform 0.2s;
    min-width: 12px;
}
.lt-group-toggle[aria-expanded="false"] .lt-group-arrow {
    transform: rotate(-90deg);
}
.lt-group-date {
    font-weight: 700;
    font-size: 14px;
    color: #3730a3;
    flex-shrink: 0;
}
.lt-group-lab {
    font-size: 12px;
    color: #6b7280;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 2px 10px;
}
.lt-group-count {
    margin-inline-start: auto;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #6366f1;
    border-radius: 10px;
    padding: 2px 9px;
    min-width: 22px;
    text-align: center;
}
.lt-group-row td:first-child {
    padding-inline-start: 28px;
}
[dir="rtl"] .lt-group-toggle { flex-direction: row-reverse; }
[dir="rtl"] .lt-group-count  { margin-inline-start: 0; margin-inline-end: auto; }

/* ═══════════════════════════════════════
   PHONE OTP AUTH UI
═══════════════════════════════════════ */
.lt-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.lt-pass-wrap input {
    flex: 1;
    padding-inline-end: 42px !important;
}
.lt-eye-btn {
    position: absolute;
    inset-inline-end: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.lt-eye-btn:hover { opacity: 1; }

.lt-auth-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.lt-link-btn {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
    text-decoration: underline;
    font-family: inherit;
    transition: color 0.2s;
}
.lt-link-btn:hover { color: #4338ca; }

/* OTP input */
.lt-otp-input {
    text-align: center !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    letter-spacing: 8px !important;
    width: 100% !important;
    padding: 14px !important;
    border: 2px solid #6366f1 !important;
    border-radius: 10px !important;
    color: #1e1b4b !important;
    background: #f5f3ff !important;
    font-family: monospace !important;
}
.lt-otp-input:focus {
    border-color: #4338ca !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.2) !important;
}

/* OTP sent info box */
.lt-otp-sent-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f3ff;
    border-radius: 10px;
    border: 1px solid #ddd6fe;
}
.lt-otp-icon { font-size: 36px; margin-bottom: 8px; }
.lt-otp-sent-info p { margin: 0 0 6px; color: #6b7280; font-size: 14px; }
.lt-otp-sent-info strong { color: #4338ca; font-size: 16px; direction: ltr; display: block; }

/* Optional fields summary */
.lt-optional-fields {
    margin: 12px 0;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
}
.lt-optional-fields summary {
    cursor: pointer;
    padding: 10px 0;
    color: #6b7280;
    font-size: 13px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.lt-optional-fields summary::before { content: '▶'; font-size: 10px; }
.lt-optional-fields[open] summary::before { content: '▼'; }
.lt-optional-fields summary::-webkit-details-marker { display: none; }

/* Message success variant */
.lt-msg.lt-msg-success-bg {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
