* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --primary:#1f5fd0; --ink:#1f2733; --muted:#78849a; --line:#e6ebf2; --bg:#f4f6fa; --danger:#d13b3b; --ok:#1f9d6b; --warn:#d98a12; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.ghost { background: #fff; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0c8c8; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { display: block; width: 100%; padding: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; margin-bottom: 16px; }
.login-title { font-size: 19px; font-weight: 600; }
.login-sub { color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
.fl { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.fl input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.fl input:focus { outline: none; border-color: var(--primary); }
.err { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

.app { min-height: 100vh; }
.topbar { background: #1f2a44; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; }
.brand { font-size: 16px; font-weight: 600; }
.brand span { opacity: .7; font-weight: 400; font-size: 13px; margin-left: 4px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.who { font-size: 13px; opacity: .85; }
.topbar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.tabs { display: flex; gap: 4px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: none; background: none; padding: 13px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 12px 28px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.metric .lbl { color: var(--muted); font-size: 13px; }
.metric .num { font-size: 26px; font-weight: 600; margin-top: 4px; }
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.muted { color: var(--muted); font-size: 12px; }
.note { background: #f0f5ff; color: #3b5b96; border-radius: 9px; padding: 10px 12px; font-size: 12px; margin-top: 10px; }

.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.entry { border: 1px solid var(--line); border-radius: 10px; padding: 14px 10px; text-align: center; cursor: pointer; background: #fff; }
.entry:hover { border-color: var(--primary); }
.entry b { display: block; font-size: 20px; color: var(--primary); font-weight: 500; }
.entry span { font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 500; background: #fafbfd; }
td.num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #eef2f8; color: #4a5871; }
.badge.ok { background: #e5f6ef; color: var(--ok); }
.badge.warn { background: #fdf2e0; color: var(--warn); }
.badge.info { background: #e8f0fd; color: var(--primary); }
.row-actions button { margin-right: 6px; }
.table-scroll { overflow-x: auto; }

.list { display: none; }
.list-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.list-row .t { font-weight: 500; }
.list-row .d { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-row .r { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

.modal { position: fixed; inset: 0; background: rgba(20,28,45,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto; padding: 20px; }
.modal-box h3 { font-size: 16px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #1f2a44; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 80; font-size: 13px; }

@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .entry-grid { grid-template-columns: repeat(3, 1fr); }
  main { padding: 22px; }
}
@media (max-width: 620px) {
  .table-view { display: none; }
  .list { display: block; }
  .who { display: none; }
}
