:root {
  --bg: #f4f4f2;
  --panel: #fff;
  --ink: #111;
  --muted: #777;
  --line: #e8e8e4;
  --soft: #f8f8f6;
  --danger: #a32727;
  --radius: 10px;
  --shadow: 0 12px 36px rgba(0, 0, 0, .045);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, input, textarea { outline: none; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 236px; flex-direction: column; padding: 28px 18px 20px; color: #fff; background: #111; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 15px; letter-spacing: .03em; }
.sidebar-brand small { margin-top: 2px; color: #888; font-size: 11px; }
.brand-mark { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #222; border-radius: 9px; color: #fff; background: #111; font-weight: 700; letter-spacing: .08em; }
.brand-mark.small { width: 38px; height: 38px; flex: 0 0 auto; border-color: #3c3c3c; border-radius: 8px; font-size: 12px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 7px; color: #888; transition: .16s ease; }
.sidebar nav a span { color: #555; font-size: 10px; letter-spacing: .08em; }
.sidebar nav a:hover { color: #ddd; background: #181818; }
.sidebar nav a.active { color: #111; background: #fff; }
.sidebar nav a.active span { color: #888; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px; color: #777; font-size: 12px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #8ca983; }

.workspace { min-height: 100vh; margin-left: 236px; padding: 36px 44px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.topbar h1 { margin: 2px 0 0; font-size: 26px; line-height: 1.2; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: #969696; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.admin-menu { display: flex; align-items: center; gap: 16px; color: #777; }
.admin-menu a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px; color: #333; background: #fff; }
.menu-button { display: none; border: 0; color: #111; background: transparent; font-size: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.stat-card { position: relative; padding: 22px; overflow: hidden; }
.stat-card > span { position: absolute; top: 18px; right: 18px; color: #bbb; font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.stat-card strong { display: block; margin-top: 16px; font-size: 30px; letter-spacing: -.04em; }
.stat-card p { margin: 3px 0 0; color: var(--muted); }
.panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.panel { padding: 24px; }
.panel.span-two { grid-column: span 2; }
.panel h2 { margin: 4px 0 20px; font-size: 17px; letter-spacing: -.02em; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-head h2 { margin-bottom: 0; }
.panel-head > a, .text-button { border: 0; color: #555; background: transparent; font-size: 12px; }
.activity-list > div { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-icon { width: 7px; height: 7px; border: 1px solid #111; border-radius: 50%; }
.activity-list p { margin: 0; }
.activity-list strong, .activity-list small { display: block; }
.activity-list strong { font-size: 13px; }
.activity-list small, .activity-list time { color: #999; font-size: 11px; }
.status-list { margin: 0 0 24px; }
.status-list > div { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.status-list dt, .status-list dd { margin: 0; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border: 1px solid #d7d7d2; border-radius: 999px; color: #444; background: #fafafa; font-size: 11px; white-space: nowrap; }
.tag.warn { color: #845b16; border-color: #e8dac0; background: #fffaf0; }
.muted-tag { color: #999; }

.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.five { grid-template-columns: 1fr .8fr .8fr .8fr 1.4fr; align-items: end; }
.form-grid.five .form-actions { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #333; font-size: 12px; font-weight: 600; }
label small, .hint { color: #999; font-size: 11px; font-weight: 400; }
input, textarea { width: 100%; border: 1px solid #deded9; border-radius: 7px; color: #171717; background: #fff; transition: .15s ease; }
input { height: 42px; padding: 0 12px; }
textarea { min-height: 110px; padding: 11px 12px; line-height: 1.65; resize: vertical; }
input:focus, textarea:focus { border-color: #777; box-shadow: 0 0 0 3px rgba(0, 0, 0, .035); }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid #111; border-radius: 7px; font-weight: 600; transition: .15s ease; }
.button.primary { color: #fff; background: #111; }
.button.primary:hover { background: #292929; }
.button.secondary { border-color: var(--line); color: #222; background: #fff; }
.button.full { width: 100%; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 15px; border: 1px solid var(--line); border-radius: 8px; }
.switch-row span, .switch-row strong, .switch-row small { display: block; }
.switch-row input { width: 40px; height: 22px; accent-color: #111; }
.narrow-panel { max-width: 760px; }
.reveal-panel { margin-bottom: 14px; border-color: #c9c9c2; }
.reveal-panel textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.notice-preview { min-height: 220px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.notice-preview strong { font-size: 16px; }
.notice-preview p { color: #555; white-space: normal; }
.notice-preview time { color: #aaa; font-size: 11px; }

.table-panel { margin-top: 14px; padding: 0; overflow: hidden; }
.table-panel .panel-head { padding: 24px 24px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: #999; background: #fbfbfa; font-size: 10px; letter-spacing: .05em; }
td { color: #444; font-size: 12px; }
code { color: #333; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.inline-form { display: inline; }
.text-button { padding: 3px 0; }
.empty { padding: 28px !important; color: #aaa; text-align: center; }
.pagination { display: flex; flex-wrap: wrap; gap: 5px; padding: 18px 24px; border-top: 1px solid var(--line); }
.pagination a { display: grid; min-width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 11px; }
.pagination a.active { color: #fff; border-color: #111; background: #111; }

.alert { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #deded8; border-radius: 7px; color: #555; background: #fff; }
.alert.success { color: #355230; border-color: #d5e1d1; background: #f8fbf7; }
.alert.error { color: var(--danger); border-color: #ead1d1; background: #fff9f9; }
.muted { color: var(--muted); }

.auth-page { min-height: 100vh; background: #f5f5f3; }
.auth-shell, .install-shell { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.auth-card { width: min(100%, 410px); padding: 38px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.install-card { width: min(100%, 720px); }
.auth-card .brand-mark { margin-bottom: 28px; }
.auth-card h1 { margin: 5px 0 4px; font-size: 25px; letter-spacing: -.035em; }
.auth-card > .muted { margin: 0 0 28px; }
.auth-foot { margin: 23px 0 0; color: #aaa; text-align: center; font-size: 11px; }
.requirements { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0; }
.status-dot { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: #777; font-size: 11px; }
.status-dot.ok::before { content: "●"; margin-right: 5px; color: #789170; }
.status-dot.bad::before { content: "●"; margin-right: 5px; color: #a54d4d; }
.sidebar-mask { display: none; }

@media (max-width: 1050px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.five { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .sidebar { width: 250px; transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .25); }
  .sidebar-mask.show { display: block; }
  .workspace { margin-left: 0; padding: 24px 16px 42px; }
  .topbar { margin-bottom: 22px; }
  .topbar > div:first-of-type { margin-right: auto; }
  .menu-button { display: block; margin-right: 12px; }
  .admin-menu span { display: none; }
  .stat-grid, .panel-grid, .form-grid.two, .form-grid.five { grid-template-columns: 1fr; }
  .panel.span-two { grid-column: auto; }
  .panel { padding: 20px; }
  .activity-list > div { grid-template-columns: 10px 1fr; }
  .activity-list time { grid-column: 2; }
  .auth-card { padding: 28px 22px; }
}
