* { box-sizing: border-box; }
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --border: #e5e5ea;
  --text: #1c1c1e;
  --text-dim: #6e6e73;
  --accent: #007aff;
  --accent-dim: #eef4ff;
  --green-bg: #e3f8ec;
  --green-text: #1d9a5c;
  --amber-bg: #fff4e0;
  --amber-text: #b26a00;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --border: #38383a;
    --text: #f2f2f7;
    --text-dim: #98989d;
    --accent: #0a84ff;
    --accent-dim: #0a2540;
    --green-bg: #0f2e1f;
    --green-text: #34c759;
    --amber-bg: #3a2a0a;
    --amber-text: #ffb340;
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  }
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 50;
}
.sidebar-brand {
  font-size: 20px;
  font-weight: 700;
  padding: 8px 12px 20px;
  letter-spacing: -0.3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 2px;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
}
.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item.disabled { color: var(--text-dim); cursor: default; }
.nav-item .soon {
  margin-left: auto;
  font-size: 11px;
  background: var(--border);
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 8px;
}

.main { flex: 1; margin-left: 240px; padding: 32px 40px 80px; max-width: 1400px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-title { font-size: 17px; font-weight: 700; }
.menu-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 45;
}

.page-title { font-size: 28px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.4px; }
.page-subtitle { color: var(--text-dim); font-size: 15px; margin: 0 0 24px; }

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.big-number { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; margin: 0; }
.big-number.small { font-size: 22px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 10px; }
.label { color: var(--text-dim); font-size: 15px; }
.value { font-weight: 600; font-size: 17px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
}
.pill.ok { background: var(--green-bg); color: var(--green-text); }
.pill.warn { background: var(--amber-bg); color: var(--amber-text); }
.pill.neutral { background: var(--border); color: var(--text-dim); }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}
.field input:focus { outline: none; border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--amber-text); margin-top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
}
.btn:active { opacity: 0.85; }
.btn.secondary { background: var(--accent-dim); color: var(--accent); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { width: 100%; max-width: 360px; }
.login-title { font-size: 24px; font-weight: 700; text-align: center; margin: 0 0 4px; }
.login-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin: 0 0 24px; }
.error-msg { color: #ff3b30; font-size: 14px; text-align: center; margin: 0 0 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .emoji { font-size: 40px; display: block; margin-bottom: 12px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px 16px 40px; }
  .topbar { display: flex; }
  .overlay.open { display: block; }
}
