:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #e5edf7;
  --text: #182033;
  --muted: #718096;
  --blue: #2578f0;
  --blue-dark: #155ec8;
  --green: #1f9d62;
  --orange: #e78a24;
  --red: #d64545;
  --shadow: 0 18px 45px rgba(23, 57, 99, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 15%, rgba(37, 120, 240, .12), transparent 32%),
    linear-gradient(135deg, #f8fbff, #eef4fb);
}
.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), #1dbb82);
}
.login-panel h1 { margin: 18px 0 6px; font-size: 28px; }
.login-panel p { margin: 0 0 26px; color: var(--muted); }
label { display: grid; gap: 8px; margin: 16px 0; color: #3c4a60; font-weight: 600; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfdff;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(37,120,240,.55);
  box-shadow: 0 0 0 3px rgba(37,120,240,.1);
}
.primary { color: #fff; background: var(--blue); box-shadow: 0 10px 24px rgba(37,120,240,.22); }
.primary:hover { background: var(--blue-dark); }
.secondary { color: var(--blue); background: #eaf2ff; padding: 10px 16px; }
.ghost { color: #526176; background: #eef3f8; padding: 10px 14px; }
.full { width: 100%; padding: 13px 16px; margin-top: 8px; }
.message { min-height: 22px; margin-top: 14px; color: var(--red); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #101828;
  color: #fff;
}
.side-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.side-brand strong { display: block; font-size: 18px; }
.side-brand span { display: block; margin-top: 3px; color: #9aa7bd; font-size: 13px; }
.nav {
  width: 100%;
  display: block;
  padding: 12px 14px;
  margin: 7px 0;
  color: #c7d2e5;
  background: transparent;
  text-align: left;
}
.nav.active, .nav:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .ghost { position: absolute; left: 16px; right: 16px; bottom: 20px; width: calc(100% - 32px); }
.sidebar .password-btn { bottom: 68px; }

.workspace { padding: 24px 28px 42px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.topbar h2 { margin: 0 0 6px; font-size: 26px; }
.topbar p { margin: 0; color: var(--muted); }
.view { animation: rise .24s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(26, 54, 93, .06);
}
.card { padding: 18px; }
.card span { color: var(--muted); }
.card strong { display: block; margin-top: 10px; font-size: 26px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 18px; overflow: hidden; }
.panel h3 { margin: 0 0 14px; font-size: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { max-width: 260px; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #526176; font-weight: 700; background: #f8fbff; }
tr:hover td { background: #fbfdff; }
.pill { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 0 9px; font-size: 12px; background: #edf4ff; color: var(--blue); font-weight: 700; }
.pill.green { color: var(--green); background: #eaf8f1; }
.pill.orange { color: var(--orange); background: #fff4e8; }
.pill.red { color: var(--red); background: #fff0f0; }
.muted { color: var(--muted); }
.detail-box { white-space: pre-wrap; background: #0f172a; color: #d8e2f4; border-radius: 8px; padding: 14px; max-height: 320px; overflow: auto; }
.notice-editor { display: grid; gap: 14px; max-width: 820px; }
textarea { min-height: 190px; resize: vertical; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .side-brand { grid-column: 1 / -1; margin-bottom: 8px; }
  .sidebar .ghost { position: static; width: 100%; grid-column: 1 / -1; }
  .cards, .grid2 { grid-template-columns: 1fr; }
}
