:root {
    --brand: #0f9d76;
    --brand-2: #07c160;
    --ink: #0f172a;
    --muted: #6b7280;
    --surface: #f5f7fb;
    --card-border: #e9edf3;
}
body {
    background: var(--surface);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.admin-sidebar {
    background: radial-gradient(1200px 600px at -10% 0%, #123b34 0%, #0b1f1b 45%, #081411 100%) !important;
    border-right: 0;
    box-shadow: 8px 0 30px rgba(2, 6, 23, .06);
}
.admin-sidebar .navbar-brand { min-height: 64px; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 11px;
    background: linear-gradient(135deg, #07c160, #0ea5e9);
    color: #fff; font-weight: 800; letter-spacing: -.5px;
    box-shadow: 0 8px 20px rgba(7, 193, 96, .3);
}
.brand-mark-lg { width: 58px; height: 58px; border-radius: 18px; font-size: 26px; }
.admin-sidebar .nav-link { border-radius: 10px; margin: 2px 8px; color: rgba(255,255,255,.72); }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar .nav-link.active { background: rgba(7, 193, 96, .16); color: #fff; box-shadow: inset 3px 0 0 #07c160; }
.admin-sidebar .nav-link-icon { color: rgba(255,255,255,.55); }
.admin-sidebar .nav-link.active .nav-link-icon { color: #34d399; }
.sidebar-note { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); border-radius: 12px; padding: 12px; color: rgba(255,255,255,.7); font-size: 12px; }
.admin-topbar { background: rgba(255,255,255,.82); backdrop-filter: blur(14px); border-bottom: 1px solid #eef1f6; }
.page-header { display: flex; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 767px) {
    .page-header { flex-direction: column; align-items: flex-start; }
}
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card { border-color: var(--card-border); border-radius: 14px; box-shadow: 0 8px 28px rgba(15, 23, 42, .035); }
.card-header { border-bottom-color: #f0f3f8; }
.kpi-card { color: #fff; overflow: hidden; position: relative; }
.kpi-card::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -40px; top: -60px; background: rgba(255,255,255,.13); }
.kpi-green { background: linear-gradient(135deg, #059669, #10b981); }
.kpi-blue { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.kpi-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.kpi-orange { background: linear-gradient(135deg, #ea580c, #fbbf24); }
.kpi-label { font-size: 13px; opacity: .82; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin-top: 6px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); font-size: 20px; }
.kpi-foot { margin-top: 10px; font-size: 12px; opacity: .82; }
.kpi-foot .text-success, .kpi-foot .text-danger { color: #fff !important; font-weight: 700; }
.empty-chart { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; gap: 10px; font-size: 13px; text-align: center; }
.empty-chart i { font-size: 34px; color: #cbd5e1; }
.auth-body { min-height: 100vh; background: radial-gradient(900px 500px at 0% 0%, #d1fae5 0, transparent 55%), radial-gradient(800px 500px at 100% 100%, #dbeafe 0, transparent 55%), #f8fafc; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(15,23,42,.14); }
.auth-brand { padding: 54px 48px; background: radial-gradient(800px 500px at 0% 0%, #065f46, #052e2b 70%); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.auth-brand h1 { font-size: 34px; font-weight: 800; margin: 22px 0 8px; }
.auth-brand p { color: rgba(255,255,255,.66); margin-bottom: 30px; }
.auth-points { display: grid; gap: 12px; color: rgba(255,255,255,.82); font-size: 14px; }
.auth-points i { color: #34d399; margin-right: 8px; }
.auth-panel { padding: 54px 48px; display: flex; align-items: center; }
.auth-card { width: 100%; }
.error-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f8fafc; padding: 24px; }
.error-card { background: #fff; border-radius: 20px; padding: 40px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(15,23,42,.1); }
.error-code { font-size: 54px; font-weight: 800; color: #cbd5e1; letter-spacing: -2px; }
.error-body .pay-card { box-shadow: none; }
.code-block { background: #0b1220; color: #dbeafe; border-radius: 10px; padding: 12px 14px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; }
.code-block.small { font-size: 11px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: 0 0 20px 24px; border-left: 1px solid #e2e8f0; margin-left: 6px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-badge { position: absolute; left: -5px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #07c160; box-shadow: 0 0 0 4px #e9fbf2; }
.timeline-detail { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; font-size: 11px; color: #475569; margin: 8px 0 0; white-space: pre-wrap; word-break: break-all; }
.datagrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.datagrid-title { color: #8a94a6; font-size: 12px; margin-bottom: 3px; }
.datagrid-content { font-size: 13px; word-break: break-all; }
.docs-embedded { max-width: 980px; }
.markdown-body { color: #334155; font-size: 14px; line-height: 1.8; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: #0f172a; font-weight: 800; letter-spacing: -.3px; }
.markdown-body h1 { font-size: 30px; margin: 0 0 18px; }
.markdown-body h2 { font-size: 21px; margin: 34px 0 12px; padding-top: 8px; border-top: 1px solid #eef2f7; }
.markdown-body h3 { font-size: 16px; margin: 24px 0 8px; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; margin-bottom: 14px; }
.markdown-body li { margin: 4px 0; }
.markdown-body code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; padding: 1px 5px; font-size: 12px; color: #0f766e; }
.markdown-body pre { background: #0b1220; color: #dbeafe; border-radius: 12px; padding: 16px; overflow: auto; font-size: 12px; line-height: 1.7; position: relative; }
.markdown-body pre code { background: transparent; border: 0; color: inherit; padding: 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13px; }
.markdown-body th, .markdown-body td { border: 1px solid #e8edf4; padding: 8px 10px; text-align: left; vertical-align: top; }
.markdown-body th { background: #f8fafc; font-weight: 700; }
.markdown-body blockquote { border-left: 3px solid #07c160; background: #f0fdf4; margin: 14px 0; padding: 10px 14px; color: #166534; }
.markdown-body a { color: #0284c7; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body hr { border-color: #eef2f7; margin: 24px 0; }
.copy-btn { position: absolute; right: 8px; top: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #cbd5e1; border-radius: 6px; font-size: 11px; padding: 3px 8px; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.16); }
.toast-copy { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 12px; z-index: 9999; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast-copy.show { opacity: 1; }
@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { padding: 34px 28px; }
    .auth-panel { padding: 34px 28px; }
    .datagrid { grid-template-columns: 1fr; }
}
[data-bs-theme="dark"] body { background: #0b1220; color: #dbeafe; }
[data-bs-theme="dark"] .card { background: #101a2c; border-color: #1e293b; }
[data-bs-theme="dark"] .card-header { border-color: #1e293b; }
[data-bs-theme="dark"] .admin-topbar { background: rgba(11,18,32,.86); border-color: #1e293b; }
[data-bs-theme="dark"] .datagrid-title, [data-bs-theme="dark"] .text-secondary { color: #94a3b8 !important; }
[data-bs-theme="dark"] .table { color: #cbd5e1; }
[data-bs-theme="dark"] .markdown-body { color: #cbd5e1; }
[data-bs-theme="dark"] .markdown-body h1, [data-bs-theme="dark"] .markdown-body h2, [data-bs-theme="dark"] .markdown-body h3 { color: #f8fafc; }
[data-bs-theme="dark"] .markdown-body code { background: #1e293b; border-color: #334155; color: #5eead4; }
