* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f4f6f9; color: #1f2329; }
.muted { color: #8a94a6; font-size: 12px; }
.error { color: #c0392b; font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; }

.login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: #1f2a44; }
.login-card { background: #fff; padding: 28px 30px; border-radius: 12px; width: 360px; }
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card label { display: block; font-size: 13px; margin: 12px 0; color: #374151; }
.login-card input { width: 100%; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; margin-top: 4px; }
.login-card button { width: 100%; margin-top: 8px; }

.layout { display: flex; min-height: 100vh; }
aside { width: 190px; background: #1f2a44; color: #cbd5e1; display: flex; flex-direction: column; }
.brand { padding: 18px 16px; font-size: 16px; font-weight: 600; color: #fff; letter-spacing: 1px; }
aside nav { flex: 1; overflow: auto; }
aside nav a { display: block; padding: 9px 16px; font-size: 13px; cursor: pointer; border-left: 3px solid transparent; }
aside nav a:hover { background: #263352; color: #fff; }
aside nav a.active { background: #2b3a5e; color: #fff; border-left-color: #4d7cff; }
.me { padding: 12px 16px; font-size: 12px; border-top: 1px solid #2b3a5e; }
.link { background: none; border: none; color: #7ea2ff; padding: 6px 0; cursor: pointer; font-size: 12px; }

main { flex: 1; padding: 0 22px 40px; }
main header { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 12px; }
main h2 { font-size: 17px; margin: 0; }
.actions { display: flex; align-items: center; gap: 10px; }
.flash { font-size: 12px; padding: 4px 10px; border-radius: 12px; background: #e7f5ec; color: #1e7a45; }
.flash.err { background: #fdecea; color: #b3261e; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .num { font-size: 26px; font-weight: 600; color: #1f2a44; }
.stat .label { font-size: 12px; color: #8a94a6; margin-top: 4px; }

.panel { background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.scroll-y { max-height: 58vh; overflow-y: auto; border: 1px solid #eef1f5; border-radius: 8px; }
.scroll-y table { margin: 0; }
.subpanel { margin-top: 12px; padding: 10px 12px; background: #fafbfc; border-radius: 8px; }
.chip { display: inline-block; background: #eef3ff; color: #2b5cff; border-radius: 12px; padding: 2px 9px; font-size: 12px; margin: 2px; }
.cascade { display: flex; gap: 4px; flex-wrap: wrap; }
.cascade select { flex: 1 1 84px; min-width: 84px; padding: 5px 6px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { background: #f5f7fb; border-color: #e3e8f0; }
.inline { width: auto; display: inline-block; padding: 4px 8px; font-size: 12px; margin-left: 6px; }
.cell { width: 100%; padding: 4px 6px; border: 1px solid #e5e7eb; border-radius: 4px; font-size: 12.5px; }
button.mini { padding: 3px 9px; font-size: 12px; margin-right: 4px; }
button.mini.danger { color: #b3261e; border-color: #f3c4c0; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.chk input { width: auto; margin: 0; }
.tip { background: #f0f6ff; border-left: 3px solid #2b5cff; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.panel h3 { font-size: 14px; margin: 0 0 10px; color: #1f2a44; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 10px; }
.form-grid label { font-size: 12px; color: #4b5563; display: block; }
.form-grid input { width: 100%; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #eef1f5; }
th { color: #6b7280; font-weight: 500; font-size: 12px; background: #fafbfc; }
td { color: #1f2329; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button { padding: 7px 14px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 13px; }
button.primary { background: #2b5cff; border-color: #2b5cff; color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
.hint { font-size: 12px; color: #8a94a6; margin: 8px 0 0; }
