:root{
  --bg:#0b0c10;
  --card:#11131a;
  --card2:#0f1117;
  --text:#e9ebf0;
  --muted:rgba(233,235,240,.72);
  --border:rgba(233,235,240,.12);
  --btn:#1a1d27;
  --btn2:#141723;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
}
*{box-sizing:border-box}
body{
  margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(122,92,255,.15), transparent 50%),
              radial-gradient(900px 600px at 85% 20%, rgba(0,255,170,.09), transparent 50%),
              var(--bg);
  color:var(--text);
}
a{color:inherit}
.wrap{max-width:1100px; margin:0 auto; padding:18px 16px 40px;}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 16px; border:1px solid var(--border);
  background: rgba(17,19,26,.6); backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky; top: 12px; z-index: 5;
}
.brand{display:flex; align-items:center; gap:10px}
.logo{
  width:36px; height:36px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(122,92,255,.95), rgba(0,255,170,.75));
  box-shadow: 0 8px 22px rgba(122,92,255,.18);
}
.brand h1{font-size:16px; margin:0}
.muted{color:var(--muted)}
.btn{
  cursor:pointer; border:1px solid var(--border); color:var(--text);
  background: linear-gradient(180deg, var(--btn), var(--btn2));
  padding:10px 12px; border-radius: 12px;
  display:inline-flex; align-items:center; gap:8px;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  border-color: rgba(122,92,255,.35);
  background: linear-gradient(180deg, rgba(122,92,255,.20), rgba(122,92,255,.06));
}
.btn.danger{
  border-color: rgba(255,92,92,.35);
  background: linear-gradient(180deg, rgba(255,92,92,.18), rgba(255,92,92,.06));
}
.grid{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:14px;
}
.tile{
  border:1px solid var(--border);
  background: rgba(17,19,26,.55);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
  cursor:pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.tile:hover{
  transform: translateY(-2px);
  border-color: rgba(233,235,240,.22);
  background: rgba(17,19,26,.72);
}
.tile img{
  width:100%;
  height:160px;
  object-fit: cover;
  display:block;
  background: #0a0b10;
}
.tile .info{padding:12px 12px 14px}
.tile .title{margin:0; font-size:14px}
.tile .sub{margin:6px 0 0; font-size:13px; color:var(--muted)}

/* MODALS */
.overlay{
  position:fixed; inset:0; background: rgba(0,0,0,.62);
  display:none; align-items:center; justify-content:center;
  padding:18px; z-index: 20;
}
.overlay.show{display:flex}
.modal{
  width:min(980px, 100%);
  border:1px solid var(--border);
  background: rgba(17,19,26,.92);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modalHead{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px;
  border-bottom:1px solid var(--border);
  gap:12px;
}
.modalHead .left{display:flex; flex-direction:column; gap:2px}
.modalHead .left strong{font-size:14px}
.modalBody{
  padding:14px;
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap:14px;
}
@media (max-width: 900px){
  .modalBody{grid-template-columns: 1fr}
}
.viewer{
  border:1px solid var(--border);
  background: rgba(15,17,23,.65);
  border-radius: 16px;
  padding:12px;
}
.viewer img{
  width:100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 14px;
  background: #0a0b10;
  display:block;
}
.viewerActions{
  display:flex; gap:10px; flex-wrap:wrap; margin-top:12px;
}
.side{
  border:1px solid var(--border);
  background: rgba(15,17,23,.55);
  border-radius: 16px;
  padding:12px;
}
.dl dt{font-weight:700; margin-top:10px; font-size:13px}
.dl dd{margin:4px 0 0; color:var(--muted); font-size:13px}
.thumbs{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-top:10px;
}
.thumb{
  width:86px; height:64px; object-fit: cover;
  border-radius: 12px;
  border:2px solid transparent;
  cursor:pointer;
  opacity:.9;
}
.thumb:hover{opacity:1}
.thumb.active{border-color: rgba(122,92,255,.55); opacity:1}
.qrBox{
  margin-top:12px;
  padding:10px;
  border:1px solid var(--border);
  border-radius: 14px;
  background: rgba(17,19,26,.55);
}
canvas{width:190px; height:190px}
.rowBtns{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}

/* LOGIN */
.loginScreen{
  position:fixed; inset:0;
  display:none; align-items:center; justify-content:center;
  padding:18px; z-index: 50;
  background: radial-gradient(1100px 700px at 25% 0%, rgba(122,92,255,.22), transparent 55%),
              radial-gradient(900px 600px at 85% 20%, rgba(0,255,170,.12), transparent 55%),
              rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
}
.loginScreen.show{display:flex}
.loginCard{
  width:min(980px, 100%);
  border:1px solid var(--border);
  border-radius: 18px;
  background: rgba(17,19,26,.92);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.loginGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:0;
}
@media (max-width: 900px){
  .loginGrid{grid-template-columns: 1fr}
}
.loginPane{
  padding:16px;
  border-right:1px solid var(--border);
}
@media (max-width: 900px){
  .loginPane{border-right:none; border-bottom:1px solid var(--border)}
}
.loginPane h2{margin:0 0 6px; font-size:16px}
.field{margin-top:12px}
.field label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.input{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(15,17,23,.8);
  color: var(--text);
  outline:none;
}
.hint{font-size:12px; color:var(--muted); margin-top:10px; line-height:1.35}
.phonePane{padding:16px}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(15,17,23,.65);
  color: var(--muted);
  font-size:12px;
}
.phoneRow{
  display:flex; gap:14px; flex-wrap:wrap; align-items:flex-start; margin-top:12px;
}
.phoneQR{
  border:1px solid var(--border);
  border-radius: 16px;
  background: rgba(15,17,23,.65);
  padding:10px;
}
.status{
  margin-top:10px; font-size:12px; color: var(--muted);
}
.userTag{font-size:13px; color:var(--muted)}