:root {
    --bg: #081013;
    --panel: #0d191e;
    --panel-2: #111f24;
    --line: #284047;
    --line-bright: #347383;
    --text: #edf4f5;
    --muted: #91a5aa;
    --cyan: #39d7e8;
    --green: #3ed598;
    --amber: #f4bd50;
    --red: #ff6b6b;
    --violet: #a98cff;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background-color: var(--bg); color: var(--text); font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; letter-spacing: 0; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .16; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
a { color: inherit; }
.topbar { height: 68px; border-bottom: 1px solid var(--line-bright); background: rgba(8,16,19,.96); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 12px; height: 34px; background: var(--cyan); box-shadow: 0 0 20px rgba(57,215,232,.55); }
.brand strong { display: block; color: var(--cyan); font-size: 18px; }
.brand small { color: var(--muted); font-size: 9px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.doctor-name { color: var(--muted); }
h1 { margin: 6px 0 0; font-size: 25px; line-height: 1.2; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 700; }
.subtle, .exam-heading p { color: var(--muted); }
.button { appearance: none; border: 1px solid var(--line-bright); background: var(--panel-2); color: var(--text); min-height: 38px; padding: 9px 16px; border-radius: 4px; cursor: pointer; text-decoration: none; font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.button:hover { border-color: var(--cyan); color: var(--cyan); }
.button.primary { background: var(--cyan); border-color: var(--cyan); color: #041013; }
.button.warning { background: var(--amber); border-color: var(--amber); color: #171006; }
.button.ghost { background: transparent; }
.button.compact { min-height: 32px; padding: 6px 12px; }
.button.wide { width: 100%; margin-top: 8px; }
.login-shell { min-height: calc(100vh - 68px); display: grid; grid-template-columns: minmax(360px, 1fr) minmax(420px, 520px); }
.login-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); background: #071014; padding: 28px; }
.scan-frame { width: min(50vw, 540px); aspect-ratio: 4 / 3; border: 1px solid var(--line-bright); position: relative; overflow: hidden; background: #050a0c; }
.camera-feed { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; transition: opacity .2s ease; }.camera-active .camera-feed { opacity: .82; }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; color: var(--muted); }.camera-placeholder strong { color: var(--cyan); font-size: 22px; }.camera-placeholder span { margin-top: 7px; font-size: 10px; }
.scan-grid { position: absolute; inset: 0; opacity: .32; background-image: linear-gradient(rgba(57,215,232,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(57,215,232,.18) 1px, transparent 1px); background-size: 40px 40px; }
.scan-subject { position: absolute; width: 34%; height: 70%; left: 33%; top: 15%; border: 2px solid rgba(220,247,250,.7); border-radius: 48% 48% 40% 40%; box-shadow: 0 0 24px rgba(57,215,232,.18); }
.scan-line { position: absolute; left: 0; right: 0; height: 2px; top: 20%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); animation: scan 4s ease-in-out infinite alternate; }
.scan-corner { position: absolute; width: 28px; height: 28px; border-color: var(--cyan); border-style: solid; }.scan-corner.top-left { left: 12px; top: 12px; border-width: 2px 0 0 2px; }.scan-corner.top-right { right: 12px; top: 12px; border-width: 2px 2px 0 0; }.scan-corner.bottom-left { left: 12px; bottom: 12px; border-width: 0 0 2px 2px; }.scan-corner.bottom-right { right: 12px; bottom: 12px; border-width: 0 2px 2px 0; }
@keyframes scan { to { top: 80%; } }
.camera-controls { width: min(50vw, 540px); display: flex; align-items: center; gap: 12px; margin-top: 14px; }.camera-controls span { color: var(--muted); font-size: 10px; }.camera-toggle { min-width: 140px; }
.login-panel { padding: 12vh 52px 40px; background: rgba(13,25,30,.94); }
.login-panel form { margin-top: 34px; }
label { color: var(--muted); font-size: 12px; font-weight: 600; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #091216; color: var(--text); font: inherit; padding: 11px 12px; margin-top: 7px; outline: none; }
input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(57,215,232,.12); }
.login-panel label { display: block; margin-bottom: 18px; }
.workspace, .exam-workspace { position: relative; max-width: 1540px; margin: 0 auto; padding: 28px; }
.workspace-head, .exam-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.metric { border-left: 2px solid var(--cyan); padding-left: 14px; }
.metric strong { display: block; font-size: 24px; color: var(--cyan); }
.metric span { color: var(--muted); font-size: 11px; }
.filterbar { display: grid; grid-template-columns: 160px 160px minmax(260px,1fr) auto; gap: 12px; align-items: end; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; margin-bottom: 18px; }
.data-panel { border: 1px solid var(--line); background: rgba(13,25,30,.94); }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 1050px; }
th { color: var(--muted); font-size: 10px; text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line-bright); }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: rgba(57,215,232,.045); }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.chip { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 3px; border: 1px solid currentColor; font-size: 10px; font-weight: 700; white-space: nowrap; }
.chip.success { color: var(--green); }.chip.warning { color: var(--amber); }.chip.error { color: var(--red); }.chip.accent { color: var(--violet); }.chip.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 60px; }
.alert { padding: 12px 14px; border-left: 3px solid var(--line-bright); background: var(--panel); margin: 14px 0; }
.alert.success { border-color: var(--green); }.alert.error { border-color: var(--red); color: #ffc3c3; }
.exam-heading { align-items: center; }
.exam-heading p { margin: 7px 0 0; }
.back-link { display: block; position: absolute; top: 16px; color: var(--muted); text-decoration: none; }
.exam-heading > div { margin-top: 24px; }
.exam-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(360px, .8fr); min-height: calc(100vh - 210px); border: 1px solid var(--line-bright); }
.viewer-panel { min-width: 0; background: #030708; border-right: 1px solid var(--line-bright); display: flex; flex-direction: column; }
.viewer-panel > header { height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.viewer-panel header strong, .viewer-panel header small { display: block; }.viewer-panel header small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.live-dot { color: var(--green); font-size: 9px; }.live-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.image-stage { flex: 1; min-height: 500px; display: grid; place-items: center; overflow: auto; padding: 18px; }
.radiology-image { display: none; max-width: 100%; max-height: calc(100vh - 300px); object-fit: contain; }.radiology-image.active { display: block; }
.image-tabs { min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; overflow: auto; }
.image-tab { width: 34px; height: 30px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }.image-tab.active { border-color: var(--cyan); color: var(--cyan); }
.viewer-empty { min-height: 500px; flex: 1; display: grid; align-content: center; justify-items: center; color: var(--muted); }.viewer-empty span { font-size: 34px; color: var(--line-bright); }
.expertise-panel { background: rgba(13,25,30,.98); padding: 20px; min-width: 0; }
.patient-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin-bottom: 20px; }
.patient-facts div { background: var(--panel-2); padding: 12px; }.patient-facts span, .patient-facts strong { display: block; }.patient-facts span { color: var(--muted); font-size: 9px; margin-bottom: 6px; }.patient-facts strong { font-size: 12px; }
.expertise-label { display: block; }.expertise-label textarea { min-height: 390px; resize: vertical; line-height: 1.55; }
.editor-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin: 8px 0 16px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 900px) {
    .topbar { padding: 0 16px; }.doctor-name { display: none; }
    .login-shell { grid-template-columns: 1fr; }.login-visual { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 18px; }.scan-frame, .camera-controls { width: min(100%, 560px); }.scan-frame { max-height: 48vh; }.login-panel { padding: 42px 24px 70px; }
    .workspace, .exam-workspace { padding: 18px; }.filterbar { grid-template-columns: 1fr 1fr; }.filterbar .search { grid-column: 1 / -1; }
    .exam-grid { grid-template-columns: 1fr; }.viewer-panel { border-right: 0; border-bottom: 1px solid var(--line-bright); }.image-stage { min-height: 380px; }
}
@media (max-width: 560px) {
    .login-visual { padding: 14px; }.scan-frame { width: 100%; aspect-ratio: 3 / 4; max-height: 52vh; }.scan-subject { width: 54%; height: 58%; left: 23%; top: 18%; }.camera-controls { width: 100%; justify-content: space-between; }.camera-toggle { min-width: 132px; }
    h1 { font-size: 20px; }.workspace-head { align-items: flex-start; }.metric { display: none; }.filterbar { grid-template-columns: 1fr; }.filterbar .search { grid-column: auto; }.filterbar .button { width: 100%; }
    .data-panel { border: 0; background: transparent; }.table-wrap { overflow: visible; }
    table { display: block; min-width: 0; }.data-panel thead { display: none; }.data-panel tbody { display: grid; gap: 10px; }
    .data-panel tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-left: 3px solid var(--line-bright); border-radius: 4px; background: rgba(13,25,30,.96); padding: 12px; }
    .data-panel td { display: block; min-width: 0; padding: 8px; border: 0; overflow-wrap: anywhere; }
    .data-panel td::before { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
    .data-panel td:nth-child(1)::before { content: "Pasien"; }.data-panel td:nth-child(2)::before { content: "Pemeriksaan"; }.data-panel td:nth-child(3)::before { content: "Waktu"; }
    .data-panel td:nth-child(4)::before { content: "Perujuk"; }.data-panel td:nth-child(5)::before { content: "Media"; }.data-panel td:nth-child(6)::before { content: "Expertise"; }
    .data-panel td:nth-child(1), .data-panel td:nth-child(2), .data-panel td:nth-child(4), .data-panel td:nth-child(7) { grid-column: 1 / -1; }
    .data-panel td:nth-child(1) { padding-bottom: 12px; border-bottom: 1px solid var(--line); }.data-panel td:nth-child(1) strong { color: var(--cyan); font-size: 15px; }
    .data-panel td:nth-child(2) { padding-top: 12px; }.data-panel td:nth-child(7) { padding-top: 10px; }.data-panel td:nth-child(7) .button { width: 100%; }
    .data-panel .empty { display: block; grid-column: 1 / -1; padding: 38px 18px; }.data-panel .empty::before { display: none; }
    .exam-heading { align-items: flex-start; }.exam-heading .chip { margin-top: 26px; }.patient-facts { grid-template-columns: 1fr; }.actions { flex-direction: column; }.actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; } }
