* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
       background: #f4f6f9; color: #2c3e50; }
a { color: #1f6feb; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #1f2d3d; color: #c8d2dd; flex-shrink: 0; }
.sidebar .brand { padding: 18px 20px; font-size: 17px; font-weight: 700; color: #fff;
                  border-bottom: 1px solid #2c3e50; }
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #8aa0b6; margin-top: 3px; }
.nav a { display: block; color: #c8d2dd; text-decoration: none; padding: 12px 20px;
         font-size: 14px; border-left: 3px solid transparent; }
.nav a:hover { background: #28384a; color: #fff; }
.nav a.active { background: #28384a; color: #fff; border-left-color: #1abc9c; }
.main { flex: 1; padding: 22px 26px; overflow-x: auto; }
.card { background: #fff; border-radius: 8px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 18px; }
h1 { font-size: 21px; margin: 0 0 4px; }
.page-sub { color: #8aa0b6; font-size: 13px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef1f5; }
th { background: #f8f9fb; color: #667; font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
input, select, textarea { padding: 7px 9px; border: 1px solid #d5dae0; border-radius: 5px;
                          font-size: 14px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #1abc9c; }
button, .btn { background: #1abc9c; color: #fff; border: 0; padding: 8px 16px; border-radius: 5px;
               cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #16a085; }
.btn.primary { background: #1f6feb; } .btn.primary:hover { background: #1857c4; }
.btn.danger { background: #e74c3c; } .btn.danger:hover { background: #c0392b; }
.btn.ghost { background: #eef1f5; color: #445; } .btn.ghost:hover { background: #dfe4ea; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 150px; }
label { font-size: 12.5px; color: #667; display: block; margin-bottom: 4px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 150px; background: #fff; border-radius: 8px; padding: 16px 18px;
        box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat .n { font-size: 26px; font-weight: 700; color: #1f2d3d; }
.stat .l { color: #8aa0b6; font-size: 13px; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px;
       background: #e9f7f1; color: #1e8e5a; }
.tag.gray { background: #eef1f5; color: #7f8c8d; }
.tag.blue { background: #e7f1ff; color: #1f6feb; }
.tag.orange { background: #fef3e2; color: #d98a00; }
.tag.purple { background: #f0e9ff; color: #7c3aed; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none;
            align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow:auto; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 560px; padding: 20px 22px; }
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; top: 18px; right: 18px; background: #2c3e50; color: #fff; padding: 10px 16px;
         border-radius: 6px; font-size: 14px; opacity: 0; transition: opacity .25s; z-index: 99; pointer-events: none; }
.toast.show { opacity: .95; }
.toast.err { background: #e74c3c; }
.muted { color: #8aa0b6; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.empty { padding: 18px; text-align: center; color: #8aa0b6; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.section-title { font-weight: 600; margin: 18px 0 10px; }
.fee-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.fee-row input { flex: 1; }
.fee-row .amount { max-width: 140px; }
.total-line { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 15px; }
.total-line .grand { font-size: 18px; color: #c0392b; font-weight: 700; }
@media (max-width: 760px) { .grid2,.grid3,.grid4 { grid-template-columns: 1fr; } .sidebar{display:none;} }
