:root {
    --bg: #11150f;
    --panel: #1a2118;
    --line: #2c3828;
    --text: #e8f0e3;
    --muted: #93a48a;
    --accent: #d4a017;
    --ok: #6fbf73;
    --err: #e07060;
    --paid: #5cb8d6;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.side { width: 220px; background: #141a12; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; }
.brand strong { display: block; font-size: 16px; }
.brand span { color: var(--muted); font-size: 12px; }
.side nav { margin-top: 28px; display: grid; gap: 6px; }
.side nav a { padding: 10px 12px; border-radius: 8px; color: var(--muted); }
.side nav a.active, .side nav a:hover { background: #24301f; color: var(--text); }
.side-foot { margin-top: auto; color: var(--muted); font-size: 12px; }
.main { flex: 1; padding: 28px 32px; overflow: auto; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.head h1 { margin: 0 0 6px; font-size: 22px; }
.head p { margin: 0; color: var(--muted); max-width: 720px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: var(--accent); color: #1b1403; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag.on { background: #244226; color: var(--ok); }
.tag.off { background: #2a2a2a; color: var(--muted); }
.tag.accepted { background: #24351f; color: var(--ok); }
.tag.failed { background: #3a221f; color: var(--err); }
.tag.paid { background: #1d3340; color: var(--paid); }
.tag.pending { background: #3a3218; color: var(--accent); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.modal-card { width: min(720px, 100%); max-height: 90vh; overflow: auto; }
.modal-card.wide { width: min(920px, 100%); }
label { display: block; margin: 10px 0; color: var(--muted); font-size: 12px; }
input, select, textarea { width: 100%; margin-top: 6px; background: #10150e; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row-actions { display: flex; gap: 8px; margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 12px; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.install-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.install-card { width: min(480px, 92vw); }
.ok { color: var(--ok); margin: 10px 0; }
.err { color: var(--err); margin: 10px 0; }
code { background: #10150e; padding: 1px 6px; border-radius: 4px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 99; background: #3a221f; color: #ffd4ce; border: 1px solid var(--err); border-radius: 10px; padding: 12px 16px; max-width: 420px; }
.toast.ok { background: #24351f; color: var(--ok); border-color: var(--ok); }
.link { color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.detail { background: #10150e; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 60vh; white-space: pre-wrap; word-break: break-all; font-size: 12px; color: #d5e0cf; }
@media (max-width: 900px) {
    .app { display: block; }
    .side { width: auto; }
    .grid2, .stats { grid-template-columns: 1fr 1fr; }
    .head { flex-direction: column; }
}
