:root {
  --bg: #f5f5f7;
  --card: rgba(255,255,255,.92);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60,60,67,.12);
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --purple: #af52de;
  --shadow: 0 18px 48px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(0,122,255,.18), transparent 30%),
    radial-gradient(circle at 95% 0%, rgba(175,82,222,.13), transparent 28%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.boot-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 34px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.logo-chip { width: 54px; height: 54px; border-radius: 22px; display: grid; place-items: center; background: #111827; color: #fff; font-weight: 950; letter-spacing: -.06em; font-size: 24px; margin-bottom: 18px; }
h1, h2, h3, p { margin: 0; }
.login-card h1 { font-size: 32px; letter-spacing: -.05em; line-height: 1; }
.login-card p { color: var(--muted); margin-top: 8px; font-weight: 650; font-size: 14px; line-height: 1.45; }
.form { display: grid; gap: 12px; margin-top: 24px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 850; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  border-radius: 17px;
  padding: 13px 14px;
  outline: none;
  transition: box-shadow .22s ease, border-color .22s ease, transform .22s ease;
}
.field input:focus, .field select:focus { border-color: rgba(0,122,255,.45); box-shadow: 0 0 0 5px rgba(0,122,255,.10); transform: translateY(-1px); }
.primary-btn, .ghost-btn, .danger-btn {
  border: 0;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.primary-btn { background: var(--blue); color: #fff; }
.ghost-btn { background: rgba(118,118,128,.12); color: var(--text); }
.danger-btn { background: rgba(255,59,48,.12); color: #b42318; }
.primary-btn:disabled, .ghost-btn:disabled, .danger-btn:disabled { opacity: .55; cursor: not-allowed; }
.err { margin-top: 14px; color: #b42318; background: rgba(255,59,48,.10); border: 1px solid rgba(255,59,48,.18); padding: 11px 12px; border-radius: 16px; font-size: 13px; font-weight: 800; display: none; }
.err.show { display: block; }
.shell { width: min(1180px, 100%); margin: 0 auto; padding: 22px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo-chip { width: 46px; height: 46px; border-radius: 18px; margin: 0; font-size: 21px; }
.brand h1 { font-size: 24px; letter-spacing: -.04em; line-height: 1; }
.brand p { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 5px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; color: var(--text); text-decoration: none; background: rgba(255,255,255,.68); border: 1px solid var(--line); padding: 10px 13px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.hero { background: linear-gradient(135deg, #111827, #1c1c1e 62%, #007aff 130%); color: #fff; border-radius: 34px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; position: relative; }
.hero:after { content: ''; position: absolute; right: -48px; bottom: -72px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.hero-kicker { font-size: 12px; color: rgba(255,255,255,.68); font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.hero h2 { font-size: clamp(28px, 6vw, 52px); letter-spacing: -.06em; line-height: .95; margin-top: 8px; }
.hero p { color: rgba(255,255,255,.62); font-weight: 700; font-size: 13px; margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.card, .panel { background: var(--card); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 8px 26px rgba(0,0,0,.045); border-radius: 26px; overflow: hidden; }
.card { padding: 16px; }
.card small { display: block; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 9px; }
.card strong { display: block; font-size: 22px; letter-spacing: -.04em; line-height: 1.05; }
.card span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.panel { margin-bottom: 12px; }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { font-size: 17px; letter-spacing: -.03em; }
.panel-body { padding: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.status-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(52,199,89,.14); }
.logbox { background: #0b1020; color: #d8e1ff; border-radius: 20px; padding: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; max-height: 280px; overflow: auto; white-space: pre-wrap; }
.period-list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.58); border-radius: 18px; padding: 12px; }
.row-title { font-size: 13px; font-weight: 900; }
.row-sub { color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 9px; background: rgba(118,118,128,.12); color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.badge.success { color: #248a3d; background: rgba(52,199,89,.12); }
.badge.processing { color: #946200; background: rgba(255,149,0,.14); }
.progress { height: 9px; border-radius: 999px; background: rgba(118,118,128,.14); overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0%; background: var(--blue); border-radius: 999px; transition: width .2s ease; }
.help { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.45; margin-top: 9px; }
@media (max-width: 820px) {
  .shell { padding: 12px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr 1fr; }
  .two, .three { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .row { grid-template-columns: 1fr; }
}
