:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --border: #e3e2dc;
  --text: #26251f;
  --muted: #71706a;
  --accent: #1a56a8;
  --ok: #2c7a3f;
  --warn: #9a6a0a;
  --danger: #a32d2d;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.65 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 52px; position: sticky; top: 0;
}
.brand { font-weight: 600; letter-spacing: 1px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 14px; border-radius: 6px; color: var(--muted); }
.topbar nav a.active { background: #eef3fa; color: var(--accent); font-weight: 500; }
.logout button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }

main { max-width: 1100px; margin: 24px auto 48px; padding: 0 24px; }
footer { max-width: 1100px; margin: 0 auto 24px; padding: 0 24px; color: var(--muted); font-size: 12px; }

h1 { font-size: 20px; margin: 4px 0 4px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 600; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.urgent .n { color: var(--danger); }

table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); background: #fafaf8; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list td .sub { color: var(--muted); font-size: 12px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.badge.gray { background: #f0efeb; color: #5f5e5a; }
.badge.amber { background: #faf0d8; color: #854f0b; }
.badge.blue { background: #e6f1fb; color: #185fa5; }
.badge.green { background: #eaf3de; color: #3b6d11; }
.badge.purple { background: #eeedfe; color: #534ab7; }
.badge.red { background: #fcebeb; color: #a32d2d; }
.badge.teal { background: #E1F5EE; color: #0F6E56; }

button, .btn {
  display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 7px; padding: 6px 14px; font-size: 13px; cursor: pointer; text-decoration: none;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); border-color: #e8c8c8; }
button.small, .btn.small { padding: 3px 10px; font-size: 12px; }
form.inline { display: inline; }

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px;
  font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 220px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.6; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: #eaf3de; color: #2c5a10; border: 1px solid #c0dd97; }
.flash.err { background: #fcebeb; color: #a32d2d; border: 1px solid #f0b5b5; }

.pg { margin-bottom: 12px; }
.pg-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.pg-bar { height: 8px; background: #ecebe6; border-radius: 999px; overflow: hidden; }
.pg-fill { height: 100%; background: var(--accent); border-radius: 999px; }

.draft-basis { background: #fafaf8; border-left: 3px solid var(--accent); padding: 8px 12px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.warn { color: var(--danger); }
.muted { color: var(--muted); }
