/* RESET đơn giản */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* THEME: DARK & LIGHT */
body.dark {
  --bg-main: #020617;
  --bg-elevated: #020617;
  --bg-sidebar: #020617;
  --border-color: #1f2937;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.15);
}

body.light {
  --bg-main: #f3f4f6;
  --bg-elevated: #ffffff;
  --bg-sidebar: #e5e7eb;
  --border-color: #d1d5db;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* LAYOUT CHÍNH */
.app {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
}

/* trạng thái thu gọn */
.sidebar.collapsed {
  width: 64px;
}

/* HEADER TRONG SIDEBAR */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* nút chữ F */
.logo-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

body.dark .logo-btn {
  background: var(--accent-soft);
  color: var(--accent);
}

body.light .logo-btn {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.logo-btn:hover {
  transform: scale(1.03);
  background-color: var(--accent);
  color: white;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Khi sidebar thu gọn, ẩn chữ FITS */
.sidebar.collapsed .logo-text {
  display: none;
}

/* MENU */
.sidebar-menu {
  padding: 0.5rem 0.25rem;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 0.5rem;
  margin: 0.1rem 0.25rem;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  border: none;
  background-color: transparent;
}

.menu-item:hover {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.menu-item.active {
  color: var(--accent);
}

body.dark .menu-item.active {
  background-color: var(--accent-soft);
  color: var(--accent);
}

body.light .menu-item.active {
  background-color: transparent;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}

.menu-icon {
  width: 1.25rem;
  text-align: center;
}

/* Ẩn chữ menu khi thu gọn */
.sidebar.collapsed .menu-text {
  display: none;
}

/* FOOTER SIDEBAR */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar.collapsed .footer-text {
  display: none;
}

/* MAIN AREA */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-elevated);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.hint {
  color: var(--text-muted);
}

/* NÚT THEME */
.theme-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.theme-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* CONTENT */
.content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* VIEW SECTIONS */
.view {
  display: none;
}

.view.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* CARD */
.card {
  background-color: var(--bg-elevated);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.card h2,
.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-main);
}

.card ul {
  margin-left: 1rem;
  list-style: disc;
  font-size: 0.9rem;
}

.card li {
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

/* RESPONSIVE: màn hình nhỏ */
@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}
