/* ============ THEME VARIABLES ============ */
:root, [data-theme="white"] {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface2: #f7f9fc;
  --header: #ffffff;
  --text: #1b2a41;
  --muted: #66738c;
  --accent: #e6a100;
  --accent-h: #cc8f00;
  --accent-soft: #fffbf0;
  --border: #dde2e9;
  --inputbg: #ffffff;
  --footer: #0d1b2a;
  --footer-text: #7a8aa0;
  --ok: #1a9e5c;
  --danger: #ef4444;
  --info: #2563eb;
  --shadow: 0 10px 30px rgba(0,0,0,.1);
  --radius: 12px;
}
[data-theme="matrix"] {
  --bg: #000000;
  --surface: #050b05;
  --surface2: #081208;
  --header: #020602;
  --text: #7dffa0;
  --muted: #3f9e5f;
  --accent: #22ff66;
  --accent-h: #00e052;
  --accent-soft: #06230f;
  --border: #123f22;
  --inputbg: #041004;
  --footer: #010401;
  --footer-text: #3f9e5f;
  --ok: #22ff66;
  --danger: #ff5555;
  --info: #22ddff;
  --shadow: 0 0 30px rgba(34,255,102,.15);
  --radius: 6px;
}
[data-theme="glass"] {
  --bg: linear-gradient(135deg, #1f2a4d 0%, #3a2f63 45%, #16537e 100%);
  --surface: rgba(255,255,255,.08);
  --surface2: rgba(255,255,255,.05);
  --header: rgba(255,255,255,.1);
  --text: #f2f5ff;
  --muted: #b9c3e6;
  --accent: #7c9dff;
  --accent-h: #5c82f0;
  --accent-soft: rgba(124,157,255,.12);
  --border: rgba(255,255,255,.18);
  --inputbg: rgba(255,255,255,.08);
  --footer: rgba(0,0,0,.35);
  --footer-text: #b9c3e6;
  --ok: #4ade80;
  --danger: #f87171;
  --info: #60a5fa;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --radius: 16px;
}
[data-theme="ember"] {
  --bg: #150a06;
  --surface: #1e0f09;
  --surface2: #241309;
  --header: #180b05;
  --text: #ffd9b8;
  --muted: #b98a63;
  --accent: #ff6b2d;
  --accent-h: #e5541a;
  --accent-soft: #2b150a;
  --border: #3f2213;
  --inputbg: #120904;
  --footer: #0e0603;
  --footer-text: #b98a63;
  --ok: #f59e0b;
  --danger: #ff4d4d;
  --info: #fbbf24;
  --shadow: 0 0 30px rgba(255,107,45,.18);
  --radius: 10px;
}
[data-theme="aurora"] {
  --bg: #0b1024;
  --surface: #111735;
  --surface2: #151c40;
  --header: #0d1330;
  --text: #e2e7ff;
  --muted: #8f9bd0;
  --accent: #8b5cf6;
  --accent-h: #7445e0;
  --accent-soft: #1a1740;
  --border: #262f5c;
  --inputbg: #0e1430;
  --footer: #080c1c;
  --footer-text: #8f9bd0;
  --ok: #34d399;
  --danger: #f87171;
  --info: #22d3ee;
  --shadow: 0 0 40px rgba(139,92,246,.25);
  --radius: 14px;
}

[data-theme="neon"] {
  --bg: radial-gradient(1100px 750px at 82% -8%, rgba(59,14,74,.55), transparent 60%),
        radial-gradient(950px 700px at -8% 108%, rgba(36,8,54,.55), transparent 55%),
        #0B050F;
  --surface: #1A0B26;
  --surface2: #13071C;
  --header: #12071A;
  --text: #F4EEFA;
  --muted: #A99BB8;
  --accent: #9EFF00;
  --accent-h: #A3FF12;
  --accent-soft: rgba(158,255,0,.08);
  --border: #351847;
  --inputbg: #13071C;
  --footer: #0B050F;
  --footer-text: #6E5E7E;
  --ok: #9EFF00;
  --danger: #D926A9;
  --info: #D926A9;
  --shadow: 0 8px 24px rgba(0,0,0,.45);
  --radius: 14px;
}
[data-theme="neon"] .banner { background: #170922; color: #F4EEFA; border-bottom: 1px solid #D926A9; }
[data-theme="neon"] .top-bar { background: #12071A; }
[data-theme="neon"] .btn { background: #9EFF00; color: #0B050F; border-radius: 9px; }
[data-theme="neon"] .btn:hover { background: #A3FF12; }
[data-theme="neon"] .btn.grey { background: #170922; color: #F4EEFA; border: 1px solid #C8239B; }
[data-theme="neon"] .btn.grey:hover { background: #220E31; }
[data-theme="neon"] .btn:disabled { background: #4A5A20; color: #A99BB8; }
[data-theme="neon"] .field input { border-radius: 9px; border-color: #351847; }
[data-theme="neon"] .field input:focus { outline: 1px solid #D926A9; border-color: #D926A9; }
[data-theme="neon"] input[type="file"] { border: 1.5px dashed #5A256E; border-radius: 12px; }
[data-theme="neon"] .opt { border-radius: 12px; border-color: #351847; }
[data-theme="neon"] .opt.sel { border-color: #D926A9; background: rgba(158,255,0,.06); }
[data-theme="neon"] .stepper::before { background: #351847; }
[data-theme="neon"] .step .circle { background: #13071C; border-color: #4A1E63; }
[data-theme="neon"] .step.active .circle { background: #9EFF00; border-color: #9EFF00; color: #0B050F; }
[data-theme="neon"] .step.done .circle { background: #D926A9; border-color: #D926A9; }
[data-theme="neon"] .abar button, [data-theme="neon"] .abar select { background: #170922; border: 1px solid #4A1E63; border-radius: 20px; }
[data-theme="neon"] .abar button:hover { background: #220E31; border-color: #D926A9; }
[data-theme="neon"] .tools input, [data-theme="neon"] .tools select, [data-theme="neon"] .tools button { background: #170922; border: 1px solid #351847; border-radius: 9px; }
[data-theme="neon"] .card { border-radius: 14px; border-color: #351847; }
[data-theme="neon"] .card b { color: #9EFF00; }
[data-theme="neon"] td button { background: #170922; border: 1px solid #4A1E63; border-radius: 8px; }
[data-theme="neon"] td button:hover { background: #220E31; border-color: #D926A9; }
[data-theme="neon"] td button.del { color: #D926A9; border-color: #C8239B; }
[data-theme="neon"] .stbadge.v { color: #D926A9; }
[data-theme="neon"] .dot.g { background: #9EFF00; box-shadow: 0 0 6px rgba(158,255,0,.6); width: 7px; height: 7px; }
[data-theme="neon"] .dot.r { background: #D926A9; box-shadow: 0 0 6px rgba(217,38,169,.6); width: 7px; height: 7px; }
[data-theme="neon"] .dot.b { background: #D926A9; box-shadow: 0 0 6px rgba(217,38,169,.6); width: 7px; height: 7px; }
[data-theme="neon"] .thumb { border-color: #4A1E63; }
[data-theme="neon"] .dlbtn { border-color: #4A1E63; background: #170922; }
[data-theme="neon"] .mbox, [data-theme="neon"] .smsbox, [data-theme="neon"] .login-box { border-radius: 14px; }
[data-theme="neon"] .mbox input, [data-theme="neon"] .mbox select { border-radius: 9px; }
[data-theme="neon"] .smsbox textarea { border-radius: 10px; }
[data-theme="neon"] #chips button { background: #170922; border: 1px solid #4A1E63; border-radius: 20px; color: #9EFF00; }
[data-theme="neon"] .vrow:hover { background: #220E31; }
[data-theme="neon"] .vtimer { color: #9EFF00; }

/* ============ BASE ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; color: var(--text); }

/* ============ PORTAL ============ */
.wrap { max-width: 500px; margin: 20px auto; border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); }
.top-bar { background: var(--header); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.top-bar img { height: 34px; }
.ssl-badge { color: var(--accent); font-size: 10px; font-weight: 700; border: 1px solid var(--accent); padding: 3px 8px; border-radius: 12px; }
.banner { background: var(--accent); color: #fff; padding: 13px 16px; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
[data-theme="matrix"] .banner, [data-theme="ember"] .banner, [data-theme="aurora"] .banner, [data-theme="glass"] .banner { color: #050505; }
[data-theme="glass"] .banner { color: #fff; }
.stepper { display: flex; justify-content: space-between; padding: 20px 30px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; }
.stepper::before { content: ''; position: absolute; top: 32px; left: 40px; right: 40px; height: 2px; background: var(--border); z-index: 1; }
.step { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.step .circle { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); }
.step.active .circle { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done .circle { background: var(--ok); border-color: var(--ok); color: #fff; }
.step span { font-size: 10px; color: var(--muted); font-weight: 600; }
.step.active span { color: var(--accent); }
.content { padding: 22px; }
.content h2 { font-size: 20px; margin-bottom: 4px; }
.content p.sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; line-height: 1.4; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field label span { color: var(--accent); }
.field input { border: 1px solid var(--border); border-radius: 7px; padding: 12px; font-size: 14px; width: 100%; background: var(--inputbg); }
.field input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.field input[type="file"] { padding: 9px; }
.btn { background: var(--accent); border-radius: 7px; color: #fff; padding: 14px; font-weight: 700; font-size: 15px; margin-top: 10px; width: 100%; border: 0; cursor: pointer; }
[data-theme="matrix"] .btn, [data-theme="ember"] .btn, [data-theme="aurora"] .btn { color: #060606; }
.btn:hover { background: var(--accent-h); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.grey { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.count { font-size: 42px; font-weight: 800; text-align: center; color: var(--accent); margin: 16px 0; }
.note { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.success-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; font-size: 36px; }
.opt { border: 1px solid var(--border); border-radius: 9px; padding: 14px; margin-bottom: 12px; cursor: pointer; background: var(--surface2); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt h3 { font-size: 14px; margin-bottom: 4px; }
.opt p { font-size: 11.5px; color: var(--muted); }
.foot { background: var(--footer); color: var(--footer-text); padding: 16px; font-size: 10.5px; line-height: 1.6; }
.foot-links { display: flex; gap: 15px; margin-top: 8px; flex-wrap: wrap; }
.foot-links a { color: var(--accent); text-decoration: none; cursor: pointer; }
.foot-links a:hover { text-decoration: underline; }

/* policy modal (portal) */
.pmodal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; place-items: center; z-index: 60; padding: 16px; }
.pmodal.on { display: grid; }
.pbox { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 80vh; overflow: auto; padding: 22px; box-shadow: var(--shadow); }
.pbox h3 { color: var(--accent); margin-bottom: 10px; font-size: 17px; }
.pbox h4 { font-size: 13px; margin: 14px 0 4px; }
.pbox p { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }

/* ============ ADMIN ============ */
.admin { background: var(--bg); color: var(--text); min-height: 100vh; }
.abar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--header); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.abar .grow { flex: 1; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.r { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.dot.b { background: var(--info); box-shadow: 0 0 8px var(--info); }
@keyframes blink { 50% { opacity: .25; } }
.dot.blink { animation: blink 1s infinite; }
.abar button, .abar select { background: var(--surface2); color: var(--text); border: 1px solid var(--border); padding: 7px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.abar button:hover { background: var(--accent-soft); }
.abar select { cursor: pointer; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; padding: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.card b { font-size: 24px; display: block; }
.card span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tools { display: flex; gap: 8px; padding: 0 18px 14px; flex-wrap: wrap; }
.tools input, .tools select { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 6px; font-size: 12px; }
.tools input { flex: 1; min-width: 180px; }
.tools button { background: var(--surface2); color: var(--text); border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.tools button:hover { background: var(--accent-soft); }
.tblwrap { margin: 0 18px 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { width: 100%; min-width: 1020px; margin: 0; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
td button { background: var(--surface2); color: var(--text); border: 1px solid var(--border); padding: 4px 8px; border-radius: 5px; font-size: 11px; cursor: pointer; margin-right: 4px; }
td button:hover { background: var(--accent-soft); }
td button.del { background: var(--accent-soft); color: var(--danger); }
.stbadge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.stbadge.v { color: var(--info); }
.stbadge.p { color: var(--muted); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; place-items: center; z-index: 50; }
.modal.on { display: grid; }
.mbox { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.mbox input, .mbox select { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--inputbg); color: var(--text); margin-bottom: 8px; }
.mbox h3 { margin-bottom: 12px; font-size: 16px; }
.mbox label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.smsbox { margin: 0 18px 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.smsbox textarea { width: 100%; background: var(--inputbg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px; font-size: 13px; }
.smsbox textarea:focus { outline: 2px solid var(--accent); }
#chips button { background: var(--surface2); color: var(--accent); border: 1px solid var(--border); padding: 4px 10px; border-radius: 14px; font-size: 11px; cursor: pointer; }
#chips button:hover { background: var(--accent-soft); }
.grow { flex: 1; }
.copybtn { min-width: 0; padding: 2px 8px; font-size: 12px; opacity: .45; }
tr:hover .copybtn, .copybtn.ok { opacity: 1; }
.copybtn.ok { color: var(--ok); border-color: var(--ok) !important; }
tbody tr:hover td { background: var(--surface2); }
td { white-space: nowrap; }
span.ellip { display: inline-block; max-width: 110px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.acts { text-align: right; }
.vrow { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.vrow:hover { background: var(--surface2); }
.vrow input { accent-color: var(--accent); margin: 0; }
.vtimer { margin-left: auto; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.docwrap { display: inline-flex; align-items: center; gap: 3px; margin-right: 4px; }
.thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); display: block; }
.dlbtn { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--border); color: var(--accent); font-size: 11px; text-decoration: none; }
.dlbtn:hover { background: var(--accent-soft); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-box { background: var(--surface); border: 1px solid var(--border); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); width: 340px; }
.login-box img { display: block; margin: 0 auto 16px; height: 40px; }
.login-box input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--inputbg); color: var(--text); margin-bottom: 12px; }

@media (max-width: 900px) {
  .abar { padding: 10px 12px; gap: 8px; }
  .cards { padding: 12px; gap: 8px; }
  .tools, .smsbox, .tblwrap { margin-left: 12px; margin-right: 12px; }
  .tools { padding: 0 0 12px; }
}
