* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-image: radial-gradient(var(--grid-color) 1px, transparent 1px);
  background-size: 24px 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

.app-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-bg);
}

.app-sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--border-color);
  background: var(--surface-bg);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-main {
  grid-area: main;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  .app-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
  }
  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  .app-shell.sidebar-open::before {
    content: '';
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }
  .app-main {
    padding: 16px;
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .app-main {
    padding: 12px;
    gap: 10px;
  }
}
