:root {
  --bg: #f1f5f9;
  --card: #fff;
  --primary: #5b8def;
  --text: #0f172a;
  --muted: #64748b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  background: var(--bg);
  color: var(--text);
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #1e293b;
  color: #fff;
}
.top a { color: #cbd5e1; margin-left: 16px; text-decoration: none; }
.top a:hover { color: #fff; }
.brand { font-weight: 800; }
.who { margin-left: 16px; opacity: 0.7; font-size: 14px; }
.main { max-width: 1100px; margin: 24px auto; padding: 0 16px 40px; }
.cards { display: flex; gap: 16px; margin: 16px 0 28px; }
.stat {
  flex: 1;
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.stat .n { font-size: 36px; font-weight: 900; color: var(--primary); }
.stat .l { color: var(--muted); margin-top: 6px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
th, td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; font-size: 14px; }
th { background: #f8fafc; }
.mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.ok { background: #dcfce7; color: #166534; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline input, .rule-edit input, .rule-edit textarea, .login-card input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
}
.inline button, .rule-edit button, .login-card button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.hint {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.rule-edit {
  background: var(--card);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.rule-edit label { display: block; margin: 8px 0 4px; font-weight: 700; font-size: 13px; }
.rule-edit textarea, .rule-edit input[type="text"], .rule-edit input:not([type]) { width: 100%; }
.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.rule-edit .chk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  white-space: nowrap;
}
.rule-edit .chk input { width: auto; margin: 0; }
.rule-edit .chk.locked { color: #64748b; }
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e293b, #334155 50%, #5b8def);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.login-card h1 { margin: 0; font-size: 24px; }
.login-card .sub { color: var(--muted); margin: 6px 0 20px; }
.login-card label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 18px; padding: 12px; font-size: 16px; }
.login-card .hint { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
