:root {
  --bg: #020617;
  --panel: #0f172a;
  --panel2: #111827;
  --line: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #facc15;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #172033, var(--bg));
  color: var(--text);
  font-family: Arial, "Microsoft JhengHei", sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, .85);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: 1px; }
.nav { display: flex; gap: 12px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: var(--panel); color: white; }
.logout-form { display: flex; align-items: center; gap: 10px; }
.user-pill, .badge {
  border: 1px solid var(--line);
  background: #0b1220;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.badge.ok { color: var(--green); }
.badge.warn { color: var(--yellow); }
.container { width: min(1180px, calc(100% - 32px)); margin: 26px auto 80px; }
.footer { text-align: center; color: var(--muted); border-top: 1px solid var(--line); padding: 18px; font-size: 13px; }
.maintenance-bar { background: #78350f; color: #fde68a; padding: 10px 24px; text-align: center; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid var(--line); }
.alert.error { background: rgba(127, 29, 29, .45); color: #fecaca; }
.alert.success { background: rgba(20, 83, 45, .45); color: #bbf7d0; }
.hero { min-height: 65vh; display: grid; place-items: center; }
.hero-card, .auth-box, .panel, .stat-card {
  background: rgba(15, 23, 42, .94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.hero-card { max-width: 680px; padding: 46px; text-align: center; }
.hero-card h1 { font-size: 52px; margin: 0 0 12px; }
.hero-card.warning { border-color: #854d0e; }
.auth-box { max-width: 440px; margin: 80px auto; padding: 30px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p, .muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { padding: 22px; }
.stat-card span { display: block; color: var(--muted); margin-bottom: 10px; }
.stat-card strong { font-size: 34px; }
.panel { padding: 22px; margin-bottom: 18px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #1e293b;
  color: white;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: #0369a1; border-color: #0284c7; }
.btn.ghost { background: transparent; }
.btn.warn { background: #92400e; border-color: #d97706; }
.btn.small { padding: 7px 10px; font-size: 12px; }
.btn.full { width: 100%; }
.form-card label { display: block; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  background: #020617;
  border: 1px solid #334155;
  color: white;
  border-radius: 10px;
  padding: 12px;
  outline: none;
}
textarea { resize: vertical; }
.form-card button { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr:hover td { background: rgba(15, 23, 42, .55); }
.actions { display: flex; gap: 8px; }
.positive { color: var(--green); font-weight: 700; }
.negative { color: var(--red); font-weight: 700; }
@media (max-width: 860px) {
  .topbar, .page-head { align-items: flex-start; flex-direction: column; }
  .grid.two, .grid.four { grid-template-columns: 1fr; }
  .logout-form { width: 100%; justify-content: space-between; }
}
