:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #162033;
  background: #f5f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: #ffffff;
  border-bottom: 1px solid #e3e8f2;
}

h1, h2 { margin: 0; }
.topbar h1 { font-size: 22px; }
.topbar p { margin: 6px 0 0; color: #64748b; }

main { max-width: 1180px; margin: 28px auto; padding: 0 20px 40px; }

.panel {
  background: #fff;
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.login-panel { max-width: 420px; margin: 70px auto; }
.grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 650;
}

input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 11px;
  font: inherit;
  background: #fff;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  margin-top: 16px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #1e40af; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.ghost {
  background: #eef2ff;
  color: #1d4ed8;
  margin-top: 0;
}
.ghost:hover { background: #dbeafe; }

.hidden { display: none !important; }
.hint { margin-top: 8px; color: #64748b; font-size: 14px; }
.error { margin-top: 12px; color: #b91c1c; font-weight: 650; }
.message { margin-top: 12px; font-weight: 650; }
.message.ok { color: #15803d; }
.message.bad { color: #b91c1c; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.actions { display: flex; gap: 10px; }
.user-line { margin-top: 10px; color: #334155; background: #f8fafc; border-radius: 6px; padding: 10px; }

.summary-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}
.summary-card {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 140px;
  background: #f8fafc;
}
.summary-card strong { display: block; font-size: 18px; margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td {
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 8px;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}
th { background: #f8fafc; color: #334155; }
td a { color: #1d4ed8; text-decoration: none; }
.danger { background: #fee2e2; color: #991b1b; margin-top: 0; padding: 7px 10px; }
.danger:hover { background: #fecaca; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}
