* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
       background: #f5f6f8; color: #222; font-size: 14px; line-height: 1.6; }
a { color: #1d6fb8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: #fff; border-bottom: 1px solid #e3e5e8; padding: 0 28px;
          display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-size: 16px; font-weight: 600; color: #17375e; }
.brand span { font-size: 12px; font-weight: 400; color: #889; margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: #555; font-size: 14px; }
.topbar nav a.active { background: #eaf2fb; color: #1d6fb8; }
.topbar nav a.logout { color: #999; margin-left: 12px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 28px 60px; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.muted { color: #889; font-size: 13px; }
.danger { color: #c0392b !important; }

.flash { background: #fff8e6; border: 1px solid #f0dfae; color: #8a6d1d;
         padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }

.btn { display: inline-block; padding: 7px 14px; border: 1px solid #d5d8dc; background: #fff;
       color: #444; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #f4f5f7; text-decoration: none; }
.btn.primary { background: #1d6fb8; border-color: #1d6fb8; color: #fff; }
.btn.primary:hover { background: #175e9d; }
.btn.danger { color: #c0392b; border-color: #e6c4c0; }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 10px; font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0 20px; }
.stat-card { background: #fff; border: 1px solid #e6e8eb; border-radius: 8px; padding: 16px;
             display: block; color: #222; }
.stat-card:hover { border-color: #1d6fb8; text-decoration: none; }
.stat-label { color: #7a828a; font-size: 13px; }
.stat-num { font-size: 28px; font-weight: 600; color: #17375e; margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { background: #fff; border: 1px solid #e6e8eb; border-radius: 8px; padding: 16px 18px; }
.panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #17375e; }
.more { display: inline-block; margin-top: 10px; font-size: 13px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: top; }
.table th { color: #7a828a; font-weight: 500; background: #fafbfc; }
.table tr:last-child td { border-bottom: none; }
.table.list tr.clickable { cursor: pointer; }
.table.list tr.clickable:hover { background: #f6f9fd; }
.table.kv th { width: 100px; color: #888; }

.tag { display: inline-block; background: #eaf2fb; color: #1d6fb8; padding: 2px 8px;
       border-radius: 10px; font-size: 12px; }
.tag.done { background: #e8f5ec; color: #2e7d4f; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; }
.filters select, .filters input, input, select, textarea {
  border: 1px solid #d5d8dc; border-radius: 6px; padding: 7px 10px; font-size: 13px;
  font-family: inherit; background: #fff; color: #222; }
.filters input { flex: 1; }

.form-card { background: #fff; border: 1px solid #e6e8eb; border-radius: 8px; padding: 20px; max-width: 840px; }
.form-card label, .form-row label { display: block; font-size: 13px; color: #666; margin-bottom: 14px; }
.form-card label input, .form-card label select, .form-card label textarea,
.form-row label input, .form-row label select { display: block; width: 100%; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.btn-row { margin-top: 8px; display: flex; gap: 10px; }
.stage-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px;
              padding-top: 16px; border-top: 1px solid #eef0f2; }
.stage-form label { font-size: 13px; color: #666; }
.stage-form select { display: block; margin-top: 5px; }

.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form input[name=content] { flex: 1; }
.follow-form textarea { width: 100%; margin-top: 10px; }
.follow-form .form-row { grid-template-columns: 140px 1fr auto; align-items: end; gap: 10px; }
.follow-form .form-row label { font-size: 13px; color: #666; }
.follow-form .form-row label input { display: block; width: 100%; margin-top: 5px; }

.timeline { list-style: none; margin-top: 14px; }
.timeline li { border-left: 2px solid #d9e6f4; padding: 0 0 16px 16px; position: relative; }
.timeline li:before { content: ''; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px;
                      border-radius: 50%; background: #1d6fb8; }
.tl-date { color: #888; font-size: 12px; }
.tl-content { margin-top: 3px; white-space: pre-wrap; }
.tl-next { color: #c0392b; font-size: 12px; margin-top: 3px; }
.warn-list { list-style: none; font-size: 13px; margin-top: 8px; }
.warn-list li { padding: 4px 0; border-bottom: 1px dashed #eef0f2; color: #a0522d; }
.tabs { display: flex; gap: 6px; }
.tabs a { padding: 5px 12px; border-radius: 6px; color: #666; }
.tabs a.active { background: #1d6fb8; color: #fff; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { width: 340px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; padding: 32px; }
.login-box h1 { font-size: 24px; color: #17375e; text-align: center; }
.login-box .sub { text-align: center; color: #889; font-size: 13px; margin-bottom: 24px; }
.login-box label { display: block; font-size: 13px; color: #666; margin-bottom: 14px; }
.login-box label input { display: block; width: 100%; margin-top: 5px; }

@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
