/* ============================================================
   KOTAK EMAIL — "konsol banyak kotak surat"
   Warna dasar slate dingin, aksen amber sinyal, tiap akun punya
   warna sendiri supaya mudah dibedakan di kotak masuk gabungan.
   ============================================================ */
:root {
  --ink:      #0f1216;
  --panel:    #171b21;
  --panel-2:  #1e242c;
  --panel-3:  #252d37;
  --line:     #2a323c;
  --line-2:   #364150;
  --text:     #e6eaee;
  --muted:    #93a0ad;
  --muted-2:  #6b7784;
  --accent:   #f0a11e;   /* amber sinyal — aksi utama & belum dibaca */
  --accent-d: #c9821200;
  --info:     #4cc2ff;
  --ok:       #46d39a;
  --danger:   #ff6b6b;
  --radius:   12px;
  --radius-s: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-hidden { display: none !important; }

/* ---------- boot & toast ---------- */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; background: var(--ink);
  z-index: 50;
}
.boot-mark {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; background: linear-gradient(150deg, var(--accent), #b8730c);
  color: #1a1200; box-shadow: 0 8px 30px rgba(240,161,30,.25);
}
.boot-text { color: var(--muted); letter-spacing: .2px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text);
  padding: 11px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 60; max-width: 90vw; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--danger); }
.toast.ok  { border-color: var(--ok); }

/* ---------- tombol umum ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  padding: 9px 14px; border-radius: var(--radius-s); cursor: pointer;
  transition: .15s; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #445; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(150deg, var(--accent), #cf8712);
  color: #1a1200; border-color: transparent; font-weight: 650;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { border-color: #5a2b2b; color: #ffb0b0; background: #241012; }
.btn.danger:hover { background: #341316; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 10px; display: grid; place-items: center;
}

/* ---------- input ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.input, .select, textarea.input {
  width: 100%; background: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius-s); padding: 10px 12px; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,161,30,.15);
}
.input.mono { font-family: var(--mono); font-size: 13.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--muted-2); margin-top: -6px; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* =================== LAYAR LOGIN =================== */
.auth-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(240,161,30,.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, rgba(76,194,255,.08), transparent 60%),
    var(--ink);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-logo .mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(150deg, var(--accent), #b8730c); color: #1a1200;
}
.auth-logo h1 { font-size: 20px; margin: 0; letter-spacing: -.3px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 22px; }
.auth-card .btn.primary { width: 100%; margin-top: 6px; padding: 12px; }
.auth-foot { text-align: center; margin-top: 16px; color: var(--muted-2); font-size: 12.5px; }

/* =================== APLIKASI UTAMA =================== */
.shell { display: grid; grid-template-columns: 268px 1fr; height: 100dvh; }

/* --- sidebar --- */
.side {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.side-top {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.side-top .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px;
  background: linear-gradient(150deg, var(--accent), #b8730c); color: #1a1200; flex: none;
}
.side-top .brand { font-weight: 650; letter-spacing: -.2px; }
.side-scroll { overflow-y: auto; flex: 1; padding: 10px 10px 16px; min-height: 0; }
.side-label {
  font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2);
  padding: 14px 10px 6px; display: flex; justify-content: space-between; align-items: center;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  cursor: pointer; color: var(--text); transition: .12s; position: relative;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--panel-3); }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--accent);
}
.nav-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.nav-item .ic { width: 20px; text-align: center; flex: none; color: var(--muted); }
.nav-item .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .sub { font-size: 11.5px; color: var(--muted-2); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px;
  background: var(--accent); color: #1a1200; font-weight: 700; display: grid; place-items: center;
}
.badge.off { background: var(--panel-3); color: var(--muted); font-weight: 600; }
.side-foot {
  border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--panel-3); display: grid;
  place-items: center; font-weight: 700; color: var(--accent); flex: none;
}
.side-foot .who { flex: 1; overflow: hidden; }
.side-foot .who .n { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who .e { font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- panel utama --- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ink); }
.main-top {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.main-top .title { font-weight: 650; font-size: 16px; letter-spacing: -.2px; }
.main-top .title small { color: var(--muted-2); font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.main-top .spacer { flex: 1; }
.hamburger { display: none; }

.list { overflow-y: auto; flex: 1; min-height: 0; }

/* baris pesan */
.msg {
  display: grid; grid-template-columns: 6px 1fr auto; align-items: start; gap: 12px;
  padding: 13px 16px 13px 12px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .12s;
}
.msg:hover { background: var(--panel); }
.msg .stripe { width: 4px; align-self: stretch; border-radius: 3px; margin: 2px 0; }
.msg .body { min-width: 0; }
.msg .line1 { display: flex; align-items: center; gap: 8px; }
.msg .from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.unseen .from { color: #fff; }
.msg .acct-chip {
  font-size: 11px; padding: 1px 7px; border-radius: 20px; color: var(--ink);
  font-weight: 700; flex: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg .subject { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.msg.unseen .subject { font-weight: 600; }
.msg.seen .from, .msg.seen .subject { color: var(--muted); }
.msg .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.msg .date { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.msg .unseen-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* status kosong / error / loading */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 60px 24px; color: var(--muted); text-align: center; min-height: 240px;
}
.state .big { font-size: 40px; opacity: .5; }
.state .t { font-weight: 600; color: var(--text); }
.state .d { font-size: 13.5px; max-width: 380px; }
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err-banner {
  margin: 12px 16px; padding: 10px 14px; border: 1px solid #5a2b2b; background: #1e1113;
  border-radius: 10px; color: #ffc9c9; font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
}

/* =================== MODAL / OVERLAY =================== */
.overlay {
  position: fixed; inset: 0; background: rgba(5,7,10,.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 40;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
}
.modal.wide { max-width: 780px; }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.modal-head .h { font-weight: 650; font-size: 16px; flex: 1; }
.modal-body { padding: 18px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: var(--panel);
}

/* --- kartu akun (manajer) --- */
.acct-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; background: var(--panel-2);
}
.acct-card .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.acct-card .info { flex: 1; min-width: 0; }
.acct-card .info .l { font-weight: 600; }
.acct-card .info .e { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.acct-card .info .host { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); }
.acct-card .acts { display: flex; gap: 6px; flex: none; }
.acct-card.err { border-color: #5a2b2b; }

/* --- kotak lihat sandi --- */
.reveal {
  display: flex; align-items: center; gap: 10px; background: var(--ink); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 10px 12px; font-family: var(--mono); margin-top: 6px;
}
.reveal .val { flex: 1; word-break: break-all; font-size: 14px; }
.reveal .val.hidden { letter-spacing: 3px; }

/* --- pembaca pesan --- */
.reader-head { padding: 4px 2px 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.reader-head .subj { font-size: 18px; font-weight: 650; margin-bottom: 8px; line-height: 1.3; }
.reader-meta { font-size: 13px; color: var(--muted); }
.reader-meta .lbl { color: var(--muted-2); display: inline-block; width: 44px; }
.reader-meta .who { color: var(--text); }
.reader-frame {
  width: 100%; min-height: 300px; border: none; background: #fff; border-radius: 8px;
}
.reader-text {
  white-space: pre-wrap; word-break: break-word; font-family: var(--sans);
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 14px; color: var(--text);
}
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attach {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 20px; font-size: 12.5px; color: var(--muted);
}

/* provider catatan */
.note {
  font-size: 12.5px; color: #ffe0b0; background: #241a0c; border: 1px solid #4a3714;
  border-radius: 8px; padding: 9px 12px; margin-bottom: 14px;
}

.badge-pill {
  font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--panel-3); color: var(--muted);
}
.badge-pill.ok { background: #10281f; color: var(--ok); }
.badge-pill.off { background: #201113; color: var(--muted-2); }

/* =================== RESPONSIVE =================== */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 60px rgba(0,0,0,.6);
  }
  .side.open { transform: translateX(0); }
  .scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 29; display: none;
  }
  .scrim.show { display: block; }
  .hamburger { display: grid; }
  .row2 { grid-template-columns: 1fr; }
  .msg .acct-chip { max-width: 110px; }
}

/* ============================================================
   AKSES AKUN — komponen bagian Akun & Nomor HP
   ============================================================ */

/* ---- pemilih bagian (Email / Akun / Nomor) ---- */
.sec-tabs { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sec-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: 10px; background: transparent; border: 1px solid transparent;
  color: var(--muted); cursor: pointer; transition: background .12s, color .12s;
}
.sec-tab .ic { font-size: 18px; line-height: 1; }
.sec-tab .tx { font-size: 11px; font-weight: 600; letter-spacing: .2px; }
.sec-tab:hover { background: var(--panel-2); color: var(--text); }
.sec-tab.active { background: var(--panel-3); color: var(--text); border-color: var(--line-2); }

/* ---- kotak cari di bilah atas ---- */
.search {
  display: flex; align-items: center; gap: 7px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; flex: 0 1 300px; min-width: 150px;
}
.search:focus-within { border-color: var(--line-2); }
.search .s-ic { color: var(--muted-2); font-size: 13px; }
.s-input { flex: 1; border: none; background: transparent; outline: none; color: var(--text); min-width: 40px; }
.s-clear { border: none; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 12px; padding: 0 2px; }
.s-clear:hover { color: var(--text); }

/* ---- kategori di subnav akun ---- */
.cat-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); padding: 9px 11px 3px; }
.side-scroll .nav-item .dot {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; box-shadow: none;
}

/* ---- grid kartu (akun & nomor) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 14px 16px; }

/* ---- kartu akun (vault) ---- */
.v-card {
  display: flex; gap: 11px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.v-card:hover { border-color: var(--line-2); }
.v-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.v-body { flex: 1; min-width: 0; cursor: pointer; }
.v-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v-plat { font-weight: 650; }
.v-name { color: var(--muted); font-size: 13px; }
.v-lines { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.v-line { font-size: 12.5px; color: var(--muted); font-family: var(--mono); word-break: break-all; }
.v-line.muted { color: var(--muted-2); font-style: italic; font-family: var(--sans); }
.v-acts { display: flex; gap: 6px; flex: none; }
.v-card.mini { padding: 10px; }
.v-card.mini .v-ic { width: 32px; height: 32px; font-size: 15px; }
.v-card.mini .v-line { white-space: normal; }

/* ---- chip status ---- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px;
  border-radius: 999px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.chip.ok { background: #10281f; color: var(--ok); }
.chip.warn { background: #2b2410; color: #ffcf6b; }
.chip.danger { background: #2a1414; color: var(--danger); }
.chip.none { background: var(--panel-3); color: var(--muted); }

/* ---- keterangan (legend) ---- */
.legend { display: flex; flex-direction: column; gap: 7px; padding: 4px 11px; font-size: 12px; color: var(--muted); }
.legend > div { display: flex; align-items: center; gap: 7px; }

/* ---- kartu nomor HP ---- */
.p-card {
  display: flex; gap: 11px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.p-card:hover { border-color: var(--line-2); }
.p-body { flex: 1; min-width: 0; cursor: pointer; }
.p-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-num { font-weight: 700; font-family: var(--mono); font-size: 15px; letter-spacing: .3px; }
.p-label { color: var(--muted); font-size: 12.5px; }
.p-lines { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.p-masa { font-size: 12.5px; color: var(--muted); }
.p-use { font-size: 12px; color: var(--muted-2); }
.p-acts { display: flex; gap: 6px; flex: none; }

/* ---- detail nomor (cek silang) ---- */
.pd-head { padding: 2px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.pd-num { font-size: 20px; font-weight: 700; font-family: var(--mono); }
.pd-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.pd-masa { font-size: 13px; color: var(--muted); }
.pd-label { margin-top: 8px; color: var(--muted); font-size: 13px; }

/* ---- hasil cek nomor ---- */
.lk-head { margin: 14px 0 10px; padding: 11px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; }
.lk-head.none { background: #10281f; color: #cdefe0; border: 1px solid #1c5540; }
.lk-head.yes { background: #2b2410; color: #ffe6b3; border: 1px solid #5a4a1c; }

/* ---- state kecil di dalam modal ---- */
.state.small { padding: 26px 16px; min-height: auto; }
.state.small .big { font-size: 30px; }

/* ---- kartu platform di manajer platform (emoji) ---- */
.acct-card .dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; padding: 12px; }
  .main-top { flex-wrap: wrap; }
  .search { order: 5; flex: 1 1 100%; }
}

/* ---- 4 tab bagian: jaga tetap muat ---- */
.sec-tab .tx { white-space: nowrap; font-size: 10.5px; }
.sec-tabs { gap: 4px; padding: 10px 8px; }

/* tombol berbentuk link (mis. "Buka member area") */
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
a.btn:hover { text-decoration: none; }
