:root{--bg:#f6f6f7;--ink:#14161a;--muted:#5d6470;--line:#e1e3e8;--orange:#e8501f;--orange2:#f07a1a;--card:#fff;--dark:#14161a}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink)}
.hidden{display:none!important}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-bottom:3px solid var(--orange);padding:10px 16px}
.logo{height:38px;width:auto}
.userbox{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted)}
main{max-width:640px;margin:0 auto;padding:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;margin-bottom:14px}
.narrow{max-width:420px;margin:24px auto}
h1{margin:0 0 4px;font-size:24px}h2{margin:0;font-size:18px}
.muted{color:var(--muted)}.small{font-size:12px}
label{display:block;font-size:13px;font-weight:600;margin:12px 0 0}
input[type=email],input[type=password],input[type=search],input[type=text]{width:100%;margin-top:6px;padding:12px;border:1px solid #c9ccd3;border-radius:10px;font-size:16px}
input:focus{outline:2px solid var(--orange);border-color:var(--orange)}
button{font:inherit;cursor:pointer;border:0;border-radius:10px}
.primary{background:linear-gradient(135deg,var(--orange),var(--orange2));color:#fff;font-weight:700;padding:13px 16px;margin-top:16px;width:100%}
.primary:disabled{opacity:.6;cursor:wait}
.ghost{background:#fff;border:1px solid var(--line);padding:7px 12px;font-size:13px}
.error{color:#b3261e;font-size:13px;min-height:18px;margin:10px 0 0}
.notice{font-size:12px;color:var(--muted);border-top:1px solid var(--line);padding-top:12px;margin-top:14px}
.tabs{display:flex;gap:8px;margin-bottom:14px}
.tab{flex:1;padding:10px;background:#fff;border:1px solid var(--line);font-weight:600}
.tab.active{background:var(--dark);color:#fff;border-color:var(--dark)}
.display{margin-top:6px;border:2px solid var(--orange);border-radius:10px;height:64px;display:flex;align-items:center;padding:0 16px;font:500 26px ui-monospace,Menlo,Consolas,monospace;letter-spacing:8px}
.display.empty{opacity:.3}
.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}
.keypad button{height:52px;font-size:20px;font-weight:700;background:#f1f2f4;color:var(--ink)}
.keypad button:active{background:#e1e3e8}
.keypad .danger{background:#fde5e1;color:#7a1a10}.keypad .alt{background:#e9eaee}
.wide{margin-top:0}
.rtitle{font-weight:600;font-size:14px;margin-bottom:10px}
.rrow{display:flex;align-items:center;gap:10px;background:#fff3ec;border:1px solid #f7c9b0;border-radius:14px;padding:12px 14px}
.code{flex:1;font:700 34px ui-monospace,Menlo,Consolas,monospace;letter-spacing:8px;color:#8a2a0a}
.copy{background:var(--dark);color:#fff;padding:9px 14px;font-size:13px}
.adminbar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.tablewrap{overflow:auto;margin-top:10px;max-height:60vh}
table{border-collapse:collapse;width:100%;font-size:12px}
th,td{text-align:left;padding:8px;border-bottom:1px solid var(--line);white-space:nowrap}
th{position:sticky;top:0;background:#fff}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--dark);color:#fff;padding:10px 16px;border-radius:999px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s}
.toast.show{opacity:1}
.tablewrap{max-width:100%}
#userEmail{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:520px){#userEmail{display:none}.logo{height:32px}}
.dangerbtn{color:#b3261e;border-color:#f3c3bd}
.dangerbtn.confirm{background:#b3261e;color:#fff;border-color:#b3261e}
.addform .primary{margin-top:14px}
.ok{color:#1e7a34}.bad{color:#b3261e}
.pill{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600}
.pill.on{background:#e3f4e6;color:#1e7a34}.pill.off{background:#f1f2f4;color:#5d6470}
td .ghost{padding:5px 9px;font-size:12px;margin-right:4px}
.pwrow{margin-top:12px}.pwbox{display:flex;flex-wrap:wrap;gap:8px;align-items:center;white-space:normal;background:#fff3ec;border-radius:10px;padding:10px}
.pwbox input{padding:8px;border:1px solid #c9ccd3;border-radius:8px;font-size:14px;flex:1;min-width:130px;margin:0}
.pwbox b{width:100%;font-size:13px}
.topright{display:flex;align-items:center;gap:10px}
.themebtn{font-size:16px;line-height:1;padding:7px 10px}
html[data-theme=dark]{--bg:#0f1114;--ink:#eceef1;--muted:#a3a9b3;--line:#2a2e35;--card:#181b20;--dark:#eceef1;color-scheme:dark}
html[data-theme=dark] .top{background:#14171b}
html[data-theme=dark] .logo{background:#fff;border-radius:8px;padding:4px 8px;box-sizing:content-box;height:30px}
html[data-theme=dark] input[type=email],html[data-theme=dark] input[type=password],html[data-theme=dark] input[type=search],html[data-theme=dark] input[type=text]{background:#0f1114;color:var(--ink);border-color:#3a3f47}
html[data-theme=dark] .ghost,html[data-theme=dark] .tab{background:#1f2329;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .tab.active{background:var(--orange);border-color:var(--orange);color:#fff}
html[data-theme=dark] .keypad button{background:#23272e;color:var(--ink)}
html[data-theme=dark] .keypad button:active{background:#2e333b}
html[data-theme=dark] .keypad .danger{background:#3a1f1b;color:#ffb4a8}
html[data-theme=dark] .keypad .alt{background:#2a2e35}
html[data-theme=dark] .rrow,html[data-theme=dark] .pwbox{background:#2a1a12;border-color:#5a2f1a}
html[data-theme=dark] .code{color:#ffb38a}
html[data-theme=dark] .copy{background:var(--orange);color:#fff}
html[data-theme=dark] th{background:var(--card)}
html[data-theme=dark] .toast{background:#eceef1;color:#14161a}
html[data-theme=dark] .pill.on{background:#16351f;color:#7ddc93}
html[data-theme=dark] .pill.off{background:#2a2e35;color:#a3a9b3}
html[data-theme=dark] .error,html[data-theme=dark] .bad,html[data-theme=dark] .dangerbtn{color:#ff8a7a}
html[data-theme=dark] .ok{color:#7ddc93}
html[data-theme=dark] .dangerbtn.confirm{background:#b3261e;color:#fff}
