:root{
  --bg:#070b14;
  --bg2:#0b1220;
  --panel:rgba(255,255,255,.06);
  --panel2:rgba(255,255,255,.08);
  --stroke:rgba(255,255,255,.10);
  --text:#e9f1ff;
  --muted:rgba(233,241,255,.65);
  --accent:#64ffda;
  --accent2:#7aa2ff;
  --danger:#ff5c5c;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --r:18px;
  --r2:24px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% 8%, rgba(100,255,218,.10), transparent 55%),
    radial-gradient(900px 500px at 92% 18%, rgba(122,162,255,.12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  overflow:hidden;
}

code, pre, .pre { font-family: var(--mono); }

.view{
  height:100%;
  width:100%;
  display:grid;
  place-items:center;
  padding:24px;
}
.view[aria-hidden="true"]{ display:none; }

.view-splash{
  background:
    radial-gradient(800px 400px at 50% 40%, rgba(100,255,218,.10), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15));
}
.splash-wrap{
  position:relative;
  text-align:center;
  padding:44px 46px;
  border-radius: var(--r2);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  overflow:hidden;
  min-width: min(520px, 92vw);
}
.logo-mark{
  width:72px;height:72px;margin:0 auto 14px auto;
  border-radius: 20px;
  border: 1px solid rgba(100,255,218,.45);
  background:
    radial-gradient(circle at 30% 30%, rgba(100,255,218,.55), rgba(100,255,218,.12) 60%, transparent 70%),
    linear-gradient(135deg, rgba(122,162,255,.22), rgba(0,0,0,.02));
  box-shadow: 0 10px 40px rgba(100,255,218,.12);
}
.splash-title{
  margin:0;
  font-size: 54px;
  letter-spacing: .14em;
  font-weight: 800;
}
.splash-tagline{
  margin:10px 0 0 0;
  color: var(--muted);
}
.splash-scanline{
  position:absolute;left:0;right:0;top:-20%;
  height:22%;
  background: linear-gradient(180deg, transparent, rgba(100,255,218,.08), transparent);
  animation: scan 2.2s linear infinite;
  pointer-events:none;
}
@keyframes scan{
  0%{ transform: translateY(-30%); }
  100%{ transform: translateY(520%); }
}
.splash-loader{
  margin:22px auto 0 auto;
  display:flex;
  gap:10px;
  justify-content:center;
}
.splash-loader span{
  width:10px;height:10px;border-radius:999px;
  background: rgba(233,241,255,.25);
  border:1px solid rgba(233,241,255,.14);
  animation: bounce 1.1s infinite ease-in-out;
}
.splash-loader span:nth-child(2){ animation-delay:.12s; }
.splash-loader span:nth-child(3){ animation-delay:.24s; }
@keyframes bounce{
  0%,100%{ transform: translateY(0); opacity:.45; }
  50%{ transform: translateY(-7px); opacity:1; }
}

.panel{
  width:min(980px, 96vw);
  border-radius: var(--r2);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-narrow{ width:min(520px, 96vw); }
.panel-head{
  padding:22px 22px 10px 22px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.panel-foot{
  padding:14px 22px;
  border-top:1px solid rgba(255,255,255,.06);
  display:flex;
  justify-content:flex-end;
}
h2{ margin:0 0 8px 0; }
h3{ margin:0 0 8px 0; }
h4{ margin:0 0 10px 0; }

.muted{ color: var(--muted); }
.tiny{ font-size: 12px; }
.list{ margin:0; padding-left:18px; color: var(--muted); }
.list code{ color: rgba(233,241,255,.85); }
.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  padding:18px 22px;
}
@media (max-width: 900px){
  body{ overflow:auto; }
  .grid-2{ grid-template-columns: 1fr; }
}

.card{
  border-radius: var(--r);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  padding:16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.card-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:baseline;
  margin-bottom:10px;
}
.divider{
  height:1px;
  background: rgba(255,255,255,.08);
  margin: 12px 0;
}

.row{
  display:flex;
  align-items:center;
}
.gap{ gap:10px; }
.grow{ flex:1; }

.btn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(135deg, rgba(100,255,218,.22), rgba(122,162,255,.14));
  border-color: rgba(100,255,218,.35);
}
.btn.primary:hover{ border-color: rgba(100,255,218,.55); }
.btn.ghost{
  background: rgba(255,255,255,.04);
}
.btn.full{ width:100%; }

.iconbtn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding:9px 10px;
  border-radius: 14px;
  cursor:pointer;
}
.iconbtn:hover{ background: rgba(255,255,255,.08); }

.label{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin: 10px 0;
}
input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: var(--text);
  outline:none;
}
textarea{ resize: vertical; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(100,255,218,.55);
  box-shadow: 0 0 0 3px rgba(100,255,218,.10);
}
.password-wrap{
  display:flex;
  gap:8px;
  align-items:center;
}

.error{
  margin-top:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,92,92,.35);
  background: rgba(255,92,92,.08);
  color: rgba(255,200,200,.95);
}

.status-pill, .pill{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  padding:8px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(233,241,255,.85);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.pill{ user-select:none; }

.switch{
  display:flex;
  gap:10px;
  align-items:center;
  margin-left:auto;
  font-size: 12px;
  color: rgba(233,241,255,.85);
}
.switch input{ width:auto; }

.view-app{
  display:grid;
  grid-template-columns: 280px 1fr;
  padding:0;
}
.sidebar{
  height:100%;
  border-right:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.20);
  padding: 18px;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px;
  border-radius: var(--r);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}
.brand-dot{
  width:14px;height:14px;border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(100,255,218,.10), 0 0 40px rgba(100,255,218,.12);
}
.brand-title{ font-weight:800; letter-spacing:.16em; }
.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav-item{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: rgba(233,241,255,.9);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  display:flex;
  gap:10px;
  align-items:center;
}
.nav-item span{ font-weight:600; }
.nav-item:hover{ background: rgba(255,255,255,.06); }
.nav-item.active{
  border-color: rgba(100,255,218,.30);
  background: rgba(100,255,218,.08);
}
.sidebar-foot{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.main{
  height:100%;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.topbar{
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.12);
  display:flex;
  gap:12px;
  justify-content:space-between;
  align-items:center;
}
.top-left,.top-right{ display:flex; align-items:center; gap:10px; }
.search{
  display:flex;
  gap:8px;
  align-items:center;
}
.search input{
  width:min(420px, 44vw);
  background: rgba(0,0,0,.22);
}
.content{
  padding:16px;
  overflow:auto;
}
.page-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.page{ max-width: 1200px; margin: 0 auto; }

.stack{ display:flex; flex-direction:column; gap:10px; }
.listbox{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height: 520px;
  overflow:auto;
  padding-right: 6px;
}

.item{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding:12px;
  border-radius: 14px;
  cursor:pointer;
}
.item:hover{ background: rgba(255,255,255,.06); }
.item.active{ border-color: rgba(100,255,218,.28); background: rgba(100,255,218,.07); }
.item .meta{ color: var(--muted); font-size:12px; margin-top:6px; display:flex; gap:10px; flex-wrap:wrap; }

.quick .tile{
  padding:14px 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(233,241,255,.92);
  cursor:pointer;
}
.quick .tile:hover{ background: rgba(255,255,255,.06); }

.pre{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  border-radius: 14px;
  padding:12px;
  white-space: pre-wrap;
  overflow:auto;
}

.toasts{
  position: fixed;
  right: 14px;
  bottom: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index: 2000;
  max-width: min(420px, 92vw);
}
.toast{
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(16, 22, 40, .86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding:12px 12px;
}
.toast .t{ font-weight:700; }
.toast .m{ color: var(--muted); font-size: 12px; margin-top:4px; }

.modal-host{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display:grid;
  place-items:center;
  z-index: 1500;
  padding: 18px;
}
.modal{
  width:min(720px, 96vw);
  border-radius: var(--r2);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(15, 18, 30, .92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}
.modal-body{ padding: 16px 18px; }
.modal-foot{
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.cmdk{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1600;
  display:grid;
  place-items:start center;
  padding-top: 10vh;
}
.cmdk-panel{
  width:min(720px, 96vw);
  border-radius: var(--r2);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(14, 18, 30, .92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.cmdk-head{
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cmdk-head input{ width:100%; }
.cmdk-list{
  max-height: 360px;
  overflow:auto;
  padding: 10px 10px 14px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cmdk-item{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.cmdk-item:hover{ background: rgba(255,255,255,.06); }
.cmdk-kbd{ font-family: var(--mono); color: rgba(233,241,255,.65); font-size: 12px; }

/* === FIX: respect [hidden] for overlays (prevents cmdk/modal blocking UI) === */
.cmdk[hidden],
.modal-host[hidden]{
  display: none !important;
}

/* ============================
   NOTES + EVIDENCE (ADD-ON)
   Paste at END of style.css
   ============================ */

/* Make long lists usable */
#noteList,
#bagList,
#osintLinks,
#caseList {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Evidence bag items: nice stacked “mini cards” */
#bagItems .bag-item {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px;
}

#bagItems .bag-item .bag-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

#bagItems .bag-item .bag-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#bagItems .bag-item .thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  overflow: hidden;
  flex: 0 0 auto;
}

#bagItems .bag-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#bagItems .bag-item .bag-item-note textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
}

/* Slightly denser list rows (helps Notes/Bags feel “real”) */
.listbox .rowitem,
#noteList .rowitem,
#bagList .rowitem {
  padding: 10px 12px;
  border-radius: 12px;
}

/* Mobile: make the two-column layout stack cleanly */
@media (max-width: 980px) {
  #page-notes .grid-2,
  #page-evidence .grid-2 {
    grid-template-columns: 1fr !important;
  }

  #noteList,
  #bagList {
    max-height: 320px;
  }
}

/* ============================
   CALENDAR (ADD-ON)
   ============================ */
.cal-week{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-head{
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.cal-head > div{
  text-align:center;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.cal-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-day{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 10px 10px;
  min-height: 74px;
  cursor:pointer;
  position:relative;
  transition: background .2s ease, border-color .2s ease, transform .08s ease;
}
.cal-day:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}
.cal-day:active{ transform: translateY(1px); }

.cal-day .n{
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing:.04em;
}
.cal-day .dot{
  position:absolute;
  bottom:10px;
  left:10px;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.cal-day .dot span{
  width:8px;height:8px;border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(100,255,218,.55);
  box-shadow: 0 0 0 3px rgba(100,255,218,.08);
}
.cal-day.muted{
  opacity:.45;
}
.cal-day.today{
  border-color: rgba(122,162,255,.35);
  box-shadow: 0 0 0 3px rgba(122,162,255,.10);
}
.cal-day.selected{
  border-color: rgba(100,255,218,.38);
  background: rgba(100,255,218,.09);
}

.cal-item{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 12px;
}
.cal-item .top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}
.cal-item .title{
  font-weight:800;
}
.cal-item .meta{
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
