/* =========================
   THEME VARIABLES
========================= */
:root{
  --bg:#070a12;
  --card:#0b1020;
  --text:#e8ebf5;
  --muted:#9aa4b2;
  --border:#1b2550;
  --primary:#4f7cff;
  --primary2:#2563eb;
  --accent:#22d3ee;
  --danger:#ef4444;
}

/* =========================
   RESET & BASE
========================= */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1200px 600px at 20% -10%, #111b3a 0%, var(--bg) 55%),
    linear-gradient(180deg, #05070d, #02040a);
  color:var(--text);
  min-height:100vh;
}

/* =========================
   LAYOUT
========================= */
.wrap{
  max-width:1200px;
  margin:0 auto;
  padding:18px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:10px 0 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
}

.logo{
  width:48px;
  height:48px;
  border-radius:16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #22d3ee 100%);
  display:grid;
  place-items:center;
  font-size:22px;
  box-shadow: 0 12px 40px rgba(34,211,238,.35);
}

h1{
  margin:0;
  font-size:22px;
  letter-spacing:.3px;
}

p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

/* =========================
   GRID
========================= */
.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  padding-bottom:40px;
}

@media(min-width:900px){
  .grid{
    grid-template-columns: 1.15fr 1fr 1.25fr;
  }
}

/* =========================
   CARD (GLASS)
========================= */
.card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  backdrop-filter: blur(14px);
  border:1px solid var(--border);
  border-radius:20px;
  padding:16px;
  box-shadow:
    0 20px 60px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
}

h2{
  margin:0 0 10px;
  font-size:16px;
  letter-spacing:.3px;
}

/* =========================
   TEXT & UTIL
========================= */
.muted{color:var(--muted)}
.tiny{font-size:12px}
.big{font-size:14px}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break:break-word;
}

.row{
  display:flex;
  align-items:center;
  gap:10px;
}

.space{justify-content:space-between}
.gap{gap:12px}
.subrow{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
}

/* =========================
   INPUTS & BUTTONS
========================= */
.lbl{
  display:block;
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

.input{
  width:100%;
  background: rgba(0,0,0,.35);
  border:1px solid var(--border);
  border-radius:14px;
  padding:11px 12px;
  color:var(--text);
  outline:none;
  transition:.15s;
}

.input:focus{
  border-color: rgba(79,124,255,.8);
  box-shadow:0 0 0 3px rgba(79,124,255,.18);
}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  transition:.15s;
  white-space:nowrap;
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
}

.btn.primary{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(79,124,255,.35);
}

.btn.primary:hover{
  filter:brightness(1.1);
}

.pill{
  text-decoration:none;
  color:var(--text);
  border:1px solid var(--border);
  padding:8px 14px;
  border-radius:999px;
  font-size:13px;
  background: rgba(255,255,255,.03);
}

/* =========================
   HR
========================= */
.hr{
  height:1px;
  background: rgba(255,255,255,.08);
  margin:14px 0;
}

/* =========================
   INBOX LIST
========================= */
.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.item{
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  background: rgba(0,0,0,.35);
  border-radius:16px;
  padding:12px;
  cursor:pointer;
  transition:.15s;
}

.item:hover{
  background: rgba(79,124,255,.08);
}

.item.active{
  border-color: rgba(79,124,255,.9);
  background: rgba(79,124,255,.14);
  box-shadow: 0 0 0 1px rgba(79,124,255,.25);
}

.item .top{
  display:flex;
  justify-content:space-between;
  gap:8px;
}

.item .subj{
  font-weight:700;
  font-size:14px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:70%;
}

.item .time{
  font-size:11px;
  color:var(--muted);
}

.item .from{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* =========================
   MESSAGE VIEWER
========================= */
.viewerBar{
  display:flex;
  align-items:center;
  gap:12px;
}

.modes{
  display:flex;
  gap:8px;
}

.chip{
  border:1px solid var(--border);
  background: rgba(0,0,0,.35);
  color:var(--text);
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  cursor:pointer;
  transition:.15s;
}

.chip.active{
  border-color: rgba(79,124,255,.9);
  background: rgba(79,124,255,.18);
}

/* =========================
   OTP BOX
========================= */
.otp{
  margin-top:12px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(34,211,238,.6);
  background: linear-gradient(135deg, rgba(34,211,238,.15), rgba(79,124,255,.12));
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  box-shadow: 0 10px 35px rgba(34,211,238,.35);
}

/* =========================
   HTML VIEWER
========================= */
.htmlWrap{margin-top:12px}

.htmlFrame{
  width:100%;
  height:420px;
  border-radius:18px;
  border:1px solid var(--border);
  background:white;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

/* =========================
   TEXT / RAW
========================= */
.pre{
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0,0,0,.45);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  min-height:260px;
  line-height:1.5;
  overflow:auto;
  margin-top:12px;
}

/* =========================
   STATES
========================= */
.empty{
  color:var(--muted);
  font-size:13px;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:24px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size:12px;
}

.metaCard{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.35);
}

.metaGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

@media(min-width:900px){
  .metaGrid{ grid-template-columns:1fr 1fr; }
}

.metaText{
  margin-top:4px;
  font-size:13px;
  line-height:1.4;
  color: var(--text);
}

.otpCode{
  font-size:18px;
  letter-spacing:2px;
  font-weight:800;
}