/* Echo System Mail: gelap seperti /pos Echo System KTV dan admin Echo System Chat, aksen merah-muda yang sama (#ff2357). */
:root {
    --bg: #0b0b10; --panel: #14141b; --panel2: #1b1b25; --line: #262633; --text: #ecedf3; --muted: #8d90a3;
    --accent: #ff2357; --ok: #3ecf8e; --warn: #ffb020; --danger: #ff5c6c;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

.app { display: flex; height: 100vh; overflow: hidden; }
.side { width: 250px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { padding: 1rem 1.1rem .6rem; font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; margin-top: .1rem; }
.tulis { margin: .4rem 1rem .8rem; display: block; text-align: center; background: var(--accent); color: #fff; border-radius: .8rem; padding: .6rem; font-weight: 600; }
.tulis:hover { filter: brightness(1.1); }
.menu { flex: 1; overflow-y: auto; padding: 0 .5rem; }
.menu a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: .6rem; color: var(--muted); }
.menu a:hover { background: var(--panel2); color: var(--text); }
.menu a.on { background: var(--panel2); color: var(--text); font-weight: 600; }
.menu a .n { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; min-width: 1.35rem; text-align: center; line-height: 1.35rem; font-weight: 700; }
.menu a .n.warn { background: var(--warn); color: #1a1200; }
.menu .grup { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: .9rem .8rem .3rem; }
.akun { border-top: 1px solid var(--line); padding: .8rem 1rem; font-size: .82rem; color: var(--muted); }
.akun b { display: block; color: var(--text); font-size: .9rem; }
.akun form { margin-top: .4rem; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; }
.link:hover { color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.top h1 { font-size: 1.05rem; margin: 0; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cari { display: flex; gap: .4rem; }
.cari input { background: var(--panel2); border: 1px solid var(--line); border-radius: .7rem; padding: .4rem .8rem; width: 240px; outline: none; }
.cari input:focus { border-color: var(--accent); }
.isi { flex: 1; overflow-y: auto; padding: 0; }
.pad { padding: 1.2rem 1.4rem; max-width: 980px; }

.flash { margin: .8rem 1.2rem 0; padding: .6rem .9rem; border-radius: .7rem; background: #12301f; border: 1px solid #1f6b43; color: #b9f3d3; }
.galat { margin: .8rem 1.2rem 0; padding: .6rem .9rem; border-radius: .7rem; background: #35141b; border: 1px solid #7a2030; color: #ffc4cc; }
.info { margin: .8rem 1.2rem 0; padding: .6rem .9rem; border-radius: .7rem; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }

.baris { display: flex; gap: .8rem; padding: .65rem 1.2rem; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); align-items: baseline; }
.baris:hover { background: var(--panel2); }
.baris .dari { width: 220px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.baris .judul { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.baris .judul b { color: var(--text); font-weight: 500; }
.baris .waktu { flex: none; color: var(--muted); font-size: .8rem; }
.baris.baru .dari, .baris.baru .judul b { font-weight: 700; }
.baris.baru::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); align-self: center; flex: none; margin-right: -.3rem; }
.kosong { padding: 3rem 1.4rem; color: var(--muted); text-align: center; }

.btn { display: inline-block; background: var(--panel2); border: 1px solid var(--line); border-radius: .7rem; padding: .45rem .9rem; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.utama { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.ok { background: #14452c; border-color: #1f6b43; color: #c9f7de; font-weight: 600; }
.btn.bahaya { background: #3d1620; border-color: #7a2030; color: #ffc4cc; }
.aksi { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.aksi form { margin: 0; }

.kepala { border-bottom: 1px solid var(--line); padding-bottom: .8rem; margin-bottom: 1rem; }
.kepala h2 { margin: 0 0 .5rem; font-size: 1.25rem; font-weight: 600; }
.meta { display: grid; grid-template-columns: 6.5rem 1fr; gap: .15rem .6rem; font-size: .88rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; word-break: break-word; }
.badan { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.bingkai { width: 100%; border: 1px solid var(--line); border-radius: .7rem; background: #fff; min-height: 380px; }
.lampiran { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.lampiran a, .lampiran span.l { background: var(--panel2); border: 1px solid var(--line); border-radius: .6rem; padding: .35rem .7rem; font-size: .85rem; }
.lampiran a:hover { border-color: var(--accent); }
.lampiran form { display: inline; }

.form label { display: block; margin: .8rem 0 .25rem; color: var(--muted); font-size: .82rem; }
.form input[type=text], .form input[type=file], .form textarea, .form select, .tolak textarea {
    width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: .7rem; padding: .55rem .8rem; outline: none;
}
.form input:focus, .form textarea:focus, .tolak textarea:focus { border-color: var(--accent); }
.form textarea { min-height: 280px; resize: vertical; font-family: inherit; }
.tolak { margin-top: 1rem; }

.lencana { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .78rem; font-weight: 600; border: 1px solid var(--line); background: var(--panel2); }
.lencana.pending { background: #3a2c08; border-color: #7a5a10; color: #ffd98a; }
.lencana.sent { background: #12301f; border-color: #1f6b43; color: #b9f3d3; }
.lencana.rejected, .lencana.failed { background: #35141b; border-color: #7a2030; color: #ffc4cc; }
.lencana.sending { background: #16283d; border-color: #2a5a90; color: #b8d8ff; }
.kartu { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.kartu h3 { margin: 0 0 .5rem; font-size: .95rem; }

.toast { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 50; }
.toast div { background: var(--panel2); border: 1px solid var(--accent); border-radius: .8rem; padding: .6rem .9rem; max-width: 340px; box-shadow: 0 8px 30px #0008; }
.toast b { display: block; }

/* masuk */
.masuk { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.masuk form { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 1.1rem; padding: 1.6rem; display: grid; gap: .8rem; }
.masuk h1 { margin: 0; font-size: 1.3rem; }
.masuk label { display: grid; gap: .25rem; color: var(--muted); font-size: .82rem; }
.masuk input { background: var(--panel2); border: 1px solid var(--line); border-radius: .7rem; padding: .6rem .8rem; outline: none; color: var(--text); }
.masuk input:focus { border-color: var(--accent); }
.masuk .btn { padding: .7rem; }
.masuk small { color: var(--muted); }

/* jendela pilih berkas dari Drive */
.modalbg { position: fixed; inset: 0; background: #0007; display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.1rem 1.2rem; width: 100%; max-width: 560px; }
.modal h3 { margin: 0 0 .3rem; }
.baris-drive { padding: .5rem .6rem; border-radius: .5rem; cursor: pointer; }
.baris-drive:hover { background: var(--panel2); }
