:root{
  --navy:#0E173E;--navy-mid:#121e4a;--navy-card:#162050;
  --green:#80C341;--green-dim:#6aaa30;
  --text-primary:#f0f4ff;--text-secondary:#8da5c8;--text-muted:#4d6080;
  --border:rgba(255,255,255,.08);--border-mid:rgba(255,255,255,.14);
  --acc:#80C341;--acc-pale:rgba(128,195,65,.12);--acc-border:rgba(128,195,65,.28);
  --sidebar-w:240px;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Plus Jakarta Sans',system-ui,sans-serif;background:var(--navy);color:var(--text-primary);line-height:1.65;overflow-x:hidden;-webkit-font-smoothing:antialiased;min-height:100vh;display:flex;flex-direction:column}
a{text-decoration:none;color:inherit}img{display:block;max-width:100%}

/* ── Topbar ── */
.topbar{background:var(--green);padding:.42rem 1.5rem;text-align:center;font-size:.75rem;font-weight:600;letter-spacing:.04em;color:var(--navy)}
.topbar span{opacity:.6;margin:0 .8rem}

/* ── Nav ── */
nav{position:sticky;top:0;z-index:1000;background:rgba(14,23,62,.96);backdrop-filter:blur(20px);border-bottom:1px solid var(--border)}
.nav-inner{display:flex;align-items:center;padding:0 2rem;height:64px;gap:1rem}
.nav-logo img{height:42px;width:auto;display:block}
.nav-tabs{display:flex;list-style:none;align-items:stretch;flex:1;height:100%}
.nav-tabs li a{display:flex;align-items:center;padding:0 .9rem;font-size:.78rem;font-weight:500;color:var(--text-secondary);border-bottom:2px solid transparent;transition:color .2s,border-color .2s;white-space:nowrap;height:auto;}
.nav-tabs li a:hover{color:var(--green);border-bottom-color:var(--green)}
.nav-right{display:flex;align-items:center;gap:.65rem;margin-left:auto;flex-shrink:0}
.nav-user{display:flex;align-items:center;gap:.55rem;padding:.36rem .82rem;border-radius:8px;border:1px solid var(--border-mid);cursor:pointer;transition:all .2s}
.nav-user:hover{border-color:var(--acc-border);background:var(--acc-pale)}
.nav-avatar{width:28px;height:28px;border-radius:50%;background:var(--acc-pale);border:1px solid var(--acc-border);display:flex;align-items:center;justify-content:center;font-size:.68rem;font-weight:800;color:var(--acc)}
.nav-user-name{font-size:.77rem;font-weight:600}
.btn-signout{background:transparent;border:1px solid var(--border-mid);color:var(--text-secondary);padding:.38rem .9rem;border-radius:7px;font-size:.76rem;font-weight:600;cursor:pointer;font-family:inherit;transition:all .2s}
.btn-signout:hover{border-color:rgba(237,31,36,.4);color:#ff6b6b}
.nav-burger{display:none;background:none;border:none;cursor:pointer;padding:.4rem;flex-direction:column;gap:5px}
.nav-burger span{display:block;width:22px;height:2px;background:var(--text-primary);border-radius:2px}
@media(max-width:900px){.nav-tabs{display:none}.nav-burger{display:flex}}

/* ── App shell ── */
.app-shell{display:flex;flex:1}

/* ── Sidebar ── */
.sidebar{width:var(--sidebar-w);flex-shrink:0;background:var(--navy-mid);border-right:1px solid var(--border);display:flex;flex-direction:column;position:sticky;top:98px;height:calc(100vh - 98px);overflow-y:auto}
.sidebar::-webkit-scrollbar{width:3px}
.sidebar::-webkit-scrollbar-thumb{background:var(--border-mid);border-radius:2px}
.sb-user{padding:1.2rem 1.1rem 1rem;border-bottom:1px solid var(--border)}
.sb-avatar{width:40px;height:40px;border-radius:50%;background:var(--acc-pale);border:2px solid var(--acc-border);display:flex;align-items:center;justify-content:center;font-size:.9rem;font-weight:800;color:var(--acc);margin-bottom:.6rem}
.sb-name{font-size:.84rem;font-weight:700}
.sb-email{font-size:.67rem;color:var(--text-muted);margin-top:.1rem}
.sb-tag{display:inline-flex;align-items:center;gap:.28rem;background:var(--acc-pale);border:1px solid var(--acc-border);border-radius:100px;padding:.15rem .52rem;font-size:.57rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--acc);margin-top:.48rem}
.sb-dot{width:5px;height:5px;border-radius:50%;background:var(--green);animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.4)}}
.sb-nav{padding:.5rem 0;flex:1}
.sb-section{padding:.55rem 1.1rem .22rem;font-size:.56rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--text-muted)}
.sb-item{display:flex;align-items:center;gap:.62rem;padding:.6rem 1.1rem;font-size:.8rem;font-weight:500;color:var(--text-secondary);cursor:pointer;transition:all .15s;border-left:3px solid transparent;user-select:none}
.sb-item:hover{color:var(--text-primary);background:rgba(255,255,255,.04)}
.sb-item.active{color:var(--acc);background:var(--acc-pale);border-left-color:var(--acc);font-weight:700}
.sb-item-ico{width:16px;height:16px;flex-shrink:0;opacity:.6;transition:opacity .15s}
.sb-item.active .sb-item-ico,.sb-item:hover .sb-item-ico{opacity:1}
.sb-badge{margin-left:auto;background:var(--acc);color:var(--navy);font-size:.56rem;font-weight:800;padding:.09rem .4rem;border-radius:100px;min-width:16px;text-align:center;flex-shrink:0}
.sb-badge.amber{background:#f0d060;color:#1a1000}
.sb-chevron{margin-left:auto;width:13px;height:13px;flex-shrink:0;color:var(--text-muted);transition:transform .25s}
.sb-item.open .sb-chevron{transform:rotate(180deg);color:var(--acc)}
.sb-sub{max-height:0;overflow:hidden;transition:max-height .3s ease,opacity .25s;opacity:0}
.sb-sub.open{max-height:300px;opacity:1}
.sb-sub-item{display:flex;align-items:center;gap:.55rem;padding:.5rem 1.1rem .5rem 2.5rem;font-size:.76rem;font-weight:400;color:var(--text-muted);cursor:pointer;transition:all .14s;border-left:3px solid transparent}
.sb-sub-item:hover{color:var(--text-primary);background:rgba(255,255,255,.04);border-left-color:var(--border)}
.sb-sub-item.active{color:var(--acc);font-weight:600;border-left-color:var(--acc);background:rgba(128,195,65,.06)}
.sb-sub-ico{width:13px;height:13px;flex-shrink:0;opacity:.55}
.sb-sub-item.active .sb-sub-ico{opacity:1;color:var(--acc)}
.sb-footer{padding:.9rem 1.1rem;border-top:1px solid var(--border)}
.sb-signout{display:flex;align-items:center;gap:.55rem;font-size:.74rem;color:var(--text-muted);cursor:pointer;padding:.45rem .55rem;border-radius:7px;transition:all .18s}
.sb-signout:hover{color:#ff6b6b;background:rgba(237,31,36,.06)}

/* ── Main ── */
.dash-main{flex:1;padding:2rem 2.2rem 4rem;overflow-y:auto;background:var(--navy);min-width:0;position:relative}
.dash-main::before{content:'';position:absolute;top:0;left:0;right:0;height:220px;background:radial-gradient(ellipse 70% 220px at 55% 0,rgba(128,195,65,.04) 0%,transparent 100%);pointer-events:none}

/* Page header */
.page-hd{margin-bottom:1.8rem;display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.page-eyebrow{font-size:.63rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--acc);margin-bottom:.28rem;display:flex;align-items:center;gap:.45rem}
.page-eyebrow::before{content:'';width:14px;height:2px;background:var(--acc)}
.page-title{font-family:'Instrument Serif',serif;font-size:clamp(1.5rem,2.5vw,2rem);font-weight:400;line-height:1.2}
.page-title em{font-style:italic;color:var(--acc)}
.page-sub{font-size:.78rem;color:var(--text-muted);margin-top:.28rem}
.btn-new{background:var(--acc);color:#fff;border:none;padding:.58rem 1.15rem;border-radius:8px;font-size:.79rem;font-weight:700;cursor:pointer;display:flex;align-items:center;gap:.4rem;font-family:inherit;transition:all .2s;white-space:nowrap;flex-shrink:0;align-self:flex-start;margin-top:.4rem}
.btn-new:hover{background:var(--green-dim);transform:translateY(-2px);box-shadow:0 6px 18px rgba(128,195,65,.3)}

/* Breadcrumb */
.breadcrumb{display:flex;align-items:center;gap:.5rem;font-size:.72rem;color:var(--text-muted);margin-bottom:1.5rem}
.breadcrumb a{color:var(--text-muted);transition:color .2s}
.breadcrumb a:hover{color:var(--acc)}
.bc-sep{opacity:.35}
.bc-cur{color:var(--acc);font-weight:600}

/* Filter / search bar */
.filter-bar{display:flex;align-items:center;gap:.7rem;margin-bottom:1.2rem;flex-wrap:wrap}
.search-wrap{position:relative;flex:1;min-width:200px}
.search-ico{position:absolute;left:.8rem;top:50%;transform:translateY(-50%);color:var(--text-muted);pointer-events:none}
.search-inp{width:100%;background:var(--navy-card);border:1px solid var(--border-mid);color:var(--text-primary);padding:.58rem 1rem .58rem 2.3rem;border-radius:9px;font-size:.82rem;font-family:inherit}
.search-inp::placeholder{color:var(--text-muted)}
.search-inp:focus{outline:none;border-color:var(--acc)}
.filter-sel{background:var(--navy-card);border:1px solid var(--border-mid);color:var(--text-primary);padding:.58rem .95rem;border-radius:9px;font-size:.82rem;font-family:inherit;cursor:pointer;min-width:140px}
.filter-sel:focus{outline:none;border-color:var(--acc)}
.results-count{font-size:.74rem;color:var(--text-muted);margin-left:auto;white-space:nowrap}
.results-count strong{color:var(--text-primary)}

/* ── Results table card ── */
.table-card{background:var(--navy-card);border:1px solid var(--border);border-radius:13px;overflow:hidden;margin-bottom:1.5rem}
.table-card-header{padding:1.1rem 1.4rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.7rem}
.tch-left{display:flex;align-items:center;gap:.7rem}
.tch-icon{width:32px;height:32px;border-radius:8px;background:var(--acc-pale);border:1px solid var(--acc-border);display:flex;align-items:center;justify-content:center;font-size:.85rem}
.tch-title{font-size:.88rem;font-weight:700}
.tch-sub{font-size:.69rem;color:var(--text-muted);margin-top:.08rem}
.tch-tabs{display:flex;gap:.35rem}
.tch-tab{padding:.32rem .8rem;border-radius:100px;font-size:.72rem;font-weight:600;border:1px solid var(--border);color:var(--text-muted);cursor:pointer;transition:all .18s}
.tch-tab:hover,.tch-tab.active{background:var(--acc-pale);border-color:var(--acc-border);color:var(--acc)}

/* Table */
.results-table{width:100%;border-collapse:collapse}
.results-table thead tr{border-bottom:1px solid var(--border-mid)}
.results-table th{padding:.75rem 1.2rem;font-size:.65rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--text-muted);text-align:left;white-space:nowrap}
.results-table th:last-child,.results-table th:nth-last-child(2){text-align:center}
.results-table tbody tr{border-bottom:1px solid var(--border);transition:background .15s;cursor:pointer}
.results-table tbody tr:last-child{border-bottom:none}
.results-table tbody tr:hover{background:rgba(255,255,255,.025)}
.results-table td{padding:.9rem 1.2rem;font-size:.82rem;vertical-align:middle}
.td-num{color:var(--text-muted);font-size:.75rem;font-weight:700;font-variant-numeric:tabular-nums}
.td-patient{display:flex;align-items:center;gap:.65rem}
.pt-avatar{width:30px;height:30px;border-radius:50%;background:var(--acc-pale);border:1px solid var(--acc-border);display:flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:800;color:var(--acc);flex-shrink:0}
.pt-name{font-size:.83rem;font-weight:600}
.pt-id{font-size:.67rem;color:var(--text-muted);margin-top:.08rem}
.td-date{color:var(--text-secondary);font-size:.8rem}
.td-date-sub{font-size:.67rem;color:var(--text-muted);margin-top:.08rem}
.td-test{font-size:.8rem;font-weight:600}
.td-test-sub{font-size:.67rem;color:var(--text-muted);margin-top:.08rem}

/* Status badges */
.status-badge{display:inline-flex;align-items:center;gap:.32rem;padding:.28rem .75rem;border-radius:100px;font-size:.67rem;font-weight:700;white-space:nowrap}
.status-badge::before{content:'';width:5px;height:5px;border-radius:50%;flex-shrink:0}
.status-not-activated{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.25);color:#f87171}
.status-not-activated::before{background:#f87171}
.status-activated{background:rgba(128,195,65,.1);border:1px solid var(--acc-border);color:var(--green)}
.status-activated::before{background:var(--green)}
.status-in-post{background:rgba(234,179,8,.1);border:1px solid rgba(234,179,8,.25);color:#f0d060}
.status-in-post::before{background:#f0d060}
.status-processing{background:rgba(74,158,255,.1);border:1px solid rgba(74,158,255,.22);color:#7db8ff}
.status-processing::before{background:#7db8ff}
.status-results-ready{background:rgba(128,195,65,.12);border:1px solid var(--acc-border);color:var(--acc)}
.status-results-ready::before{background:var(--acc)}

/* View / download actions */
.td-actions{text-align:center}
.action-btns{display:flex;align-items:center;justify-content:center;gap:.5rem}
.act-btn{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);background:rgba(255,255,255,.04);cursor:pointer;transition:all .18s;flex-shrink:0}
.act-btn:hover{transform:scale(1.08)}
.act-btn.view:hover{border-color:rgba(74,158,255,.4);background:rgba(74,158,255,.1)}
.act-btn.view svg{color:#7db8ff}
.act-btn.download:hover{border-color:var(--acc-border);background:var(--acc-pale)}
.act-btn.download svg{color:var(--acc)}
.act-btn.disabled{opacity:.28;cursor:not-allowed;pointer-events:none}

/* Empty / info states within table */
.table-empty{padding:3rem 2rem;text-align:center}
.te-ico{font-size:2rem;margin-bottom:.75rem}
.te-h{font-size:.92rem;font-weight:700;margin-bottom:.3rem}
.te-p{font-size:.78rem;color:var(--text-muted)}

/* Info notice */
.info-notice{background:rgba(74,158,255,.06);border:1px solid rgba(74,158,255,.18);border-radius:10px;padding:.9rem 1.1rem;display:flex;align-items:flex-start;gap:.7rem;margin-bottom:1.3rem;font-size:.78rem;color:var(--text-secondary);line-height:1.65}
.in-icon{width:28px;height:28px;border-radius:7px;background:rgba(74,158,255,.1);border:1px solid rgba(74,158,255,.2);display:flex;align-items:center;justify-content:center;font-size:.82rem;flex-shrink:0;margin-top:.05rem}

/* Summary cards */
.summary-row{display:grid;grid-template-columns:repeat(4,1fr);gap:.9rem;margin-bottom:1.6rem}
@media(max-width:780px){.summary-row{grid-template-columns:1fr 1fr}}
.sum-card{background:var(--navy-card);border:1px solid var(--border);border-radius:11px;padding:.95rem 1.1rem;transition:all .22s}
.sum-card:hover{border-color:var(--acc-border);transform:translateY(-2px)}
.sum-ico{width:30px;height:30px;border-radius:7px;display:flex;align-items:center;justify-content:center;font-size:.85rem;margin-bottom:.6rem}
.sum-val{font-family:'Instrument Serif',serif;font-size:1.65rem;line-height:1;margin-bottom:.16rem}
.sum-lbl{font-size:.66rem;color:var(--text-muted);font-weight:500}

/* Reveal */
.reveal{opacity:0;transform:translateY(11px);transition:opacity .36s,transform .36s}
.reveal.visible{opacity:1;transform:none}

footer{background:#060e25;border-top:1px solid var(--border);padding:1.3rem 2rem;text-align:center;font-size:.7rem;color:var(--text-muted)}
footer a{color:var(--text-muted);margin:0 .55rem}
footer a:hover{color:var(--acc)}

@media(max-width:768px){
  .sidebar{position:fixed;left:-100%;top:98px;height:calc(100vh - 98px);z-index:500;transition:left .28s;box-shadow:8px 0 32px rgba(0,0,0,.5)}
  .sidebar.open{left:0}
  .dash-main{padding:1.3rem 1rem 3rem}
  .summary-row{grid-template-columns:1fr 1fr}
  .results-table th:nth-child(3),.results-table td:nth-child(3){display:none}
}
@media(max-width:520px){
  .results-table th:nth-child(2),.results-table td:nth-child(2){display:none}
}