/* Application Shell */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--color-paper);
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--color-accent);
  color: white;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.sidebar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
}

.sidebar-title {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md) 0;
  list-style: none;
}

.nav-item {
  display: block;
  padding: var(--space-md) var(--space-lg);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: white;
}

.nav-item:focus-visible {
  outline: 2px solid white;
  outline-offset: -2px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--text-sm);
}

.user-info {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
  font-weight: 600;
  color: white;
  margin-bottom: var(--space-xs);
}

.user-role {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.sign-out-btn {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.sign-out-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-2xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-date {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-ink);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-search {
  position: relative;
}

.topbar-search input {
  width: 200px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  background: var(--color-paper);
}

.topbar-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-btn:hover {
  background: var(--color-accent-light);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: var(--space-2xl) var(--space-2xl);
  overflow-y: auto;
}

.page-header {
  margin-bottom: var(--space-2xl);
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--color-mid);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s;
  }

  .sidebar.open {
    max-height: 100vh;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar.open .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: var(--space-md) 0;
  }

  .sidebar-footer {
    display: none;
  }

  .sidebar.open .sidebar-footer {
    display: block;
  }

  .topbar {
    padding: var(--space-lg) var(--space-lg);
  }

  .mobile-menu-btn {
    display: block;
  }

  .topbar-search {
    display: none;
  }

  .topbar-search input {
    width: 150px;
  }

  .page-content {
    padding: var(--space-lg);
  }

  .page-title {
    font-size: var(--text-2xl);
  }

  .topbar-btn {
    font-size: var(--text-xs);
    padding: var(--space-sm) var(--space-md);
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: var(--space-md);
  }

  .topbar-left {
    gap: var(--space-md);
  }

  .topbar-date {
    display: none;
  }

  .topbar-title {
    font-size: var(--text-base);
  }

  .page-content {
    padding: var(--space-md);
  }

  .page-title {
    font-size: var(--text-xl);
  }

  .topbar-right {
    gap: var(--space-sm);
  }

  .topbar-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }
}
