* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: #f5f7fa; color: #1f2937; }
.hidden { display: none !important; }
a { color: #2f6bff; cursor: pointer; text-decoration: none; }
button {
  background: #2f6bff; color: #fff; border: 0; border-radius: 6px;
  padding: 8px 16px; cursor: pointer; font-size: 14px;
}
button.ghost { background: #fff; color: #2f6bff; border: 1px solid #2f6bff; }
button.danger { background: #dc2626; }
button.mini { padding: 4px 10px; font-size: 12px; }
input, textarea, select {
  width: 100%; padding: 9px 12px; border: 1px solid #dbe0e6; border-radius: 6px;
  font-size: 14px; margin-bottom: 10px; background: #fff;
}
textarea { min-height: 220px; font-family: Consolas, monospace; font-size: 13px; }

.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { width: 360px; background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 8px 30px rgba(31,35,41,.08); }
.brand { font-size: 28px; font-weight: 700; color: #2f6bff; text-align: center; }
.brand-sub { text-align: center; color: #6b7280; margin: 6px 0 24px; }
.or { text-align: center; color: #9ca3af; font-size: 12px; margin: 14px 0; }
.error { color: #dc2626; font-size: 13px; min-height: 18px; margin-top: 10px; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #24406e; color: #dbe4f3; display: flex; flex-direction: column; }
.sidebar-brand { padding: 20px 18px; font-weight: 700; color: #fff; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav .nav-group { color: #a9bcdf; font-size: 11px; padding: 14px 18px 6px; letter-spacing: 1px; }
.sidebar nav a { display: block; padding: 10px 18px; color: #dbe4f3; font-size: 14px; }
.sidebar nav a.active, .sidebar nav a:hover { background: #35578f; color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; display: flex; justify-content: space-between; }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; background: #fff; border-bottom: 1px solid #eef1f5; }
.topbar h1 { font-size: 18px; margin: 0; }
.content { padding: 20px 24px 60px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric { background: #fff; border-radius: 10px; padding: 16px 18px; }
.metric .v { font-size: 22px; font-weight: 700; color: #2f6bff; }
.metric .l { color: #6b7280; font-size: 13px; margin-top: 4px; }

.card { background: #fff; border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
th { color: #6b7280; font-weight: 500; background: #fafbfc; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #eaf2ff; color: #2f6bff; margin-right: 4px; }
.tag.green { background: #eaf9f0; color: #16a34a; }
.tag.orange { background: #fff1e6; color: #ff7a00; }
.tag.red { background: #fee7e7; color: #dc2626; }
.tag.gray { background: #f2f4f7; color: #9ca3af; }
.row-actions a { margin-right: 8px; font-size: 13px; }
.muted { color: #6b7280; }

.modal { position: fixed; inset: 0; background: rgba(16,35,63,.45); display: flex; align-items: center; justify-content: center; }
.modal-card { width: 760px; max-height: 88vh; background: #fff; border-radius: 12px; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #eef1f5; font-weight: 600; }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #eef1f5; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: #6b7280; }
.field.wide { grid-column: 1 / -1; }
.field.check { flex-direction: row; align-items: center; gap: 8px; margin-top: 18px; }
.field.check input { width: auto; margin: 0; }
.field.check > span { font-size: 13px; color: #1f2937; }
.row-item { display: grid; grid-template-columns: 1fr 1fr 80px; gap: 8px; margin-bottom: 8px; align-items: center; }
.row-item.wide { grid-template-columns: 2fr 1fr 1fr 80px; }
.row-item input, .row-item select { margin-bottom: 0; }
