:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --text: #e8eaef;
  --text-muted: #9aa3b5;
  --accent: #6c9eff;
  --danger: #f07178;
  --border: #2a3142;
  --radius: 12px;
  --tier-s: rgba(234, 179, 8, 0.22);
  --tier-a: rgba(249, 115, 22, 0.18);
  --tier-b: rgba(132, 204, 22, 0.16);
  --tier-c: rgba(59, 130, 246, 0.16);
  --tier-d: rgba(107, 114, 128, 0.2);
  --tier-none: rgba(107, 114, 128, 0.08);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-card: #ffffff;
  --text: #1a1d27;
  --text-muted: #5c6578;
  --accent: #2563eb;
  --danger: #dc2626;
  --border: #e2e6ef;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

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

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  z-index: 10;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  padding: 0.5rem 0.75rem 1.25rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 1.5rem;
  min-width: 0;
}

.page-root {
  max-width: 960px;
}

.bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem 1rem 4.5rem;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 10;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    transition: color 0.15s ease;
  }

  .bottom-nav-item.active,
  .bottom-nav-item:hover {
    color: var(--accent);
  }

  .bottom-nav-item svg {
    width: 24px;
    height: 24px;
  }

  .bottom-nav-more {
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    padding: 0;
  }
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.login-subtitle {
  margin: 0 0 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.page-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}
