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

/* Sidebar */
.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(11, 79, 63, 0.2);
}

.brand-title {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--emerald-800);
}
[data-theme="dark"] .brand-title { color: #7EE0C3; }

.brand-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.nav-item:hover {
  background: var(--emerald-50);
  color: var(--emerald-700);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(11, 79, 63, 0.25);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg { width: 19px; height: 19px; }

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--text-muted);
}
.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.sidebar-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--bg-soft);
  border-radius: 99px;
}
.mode-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22A06B;
}
.mode-pill.local .dot { background: var(--gold-500); }

.sidebar-user-box {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 10px;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.user-mini-info { min-width: 0; flex: 1; }
.user-mini-name {
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-mini-role {
  font-size: 0.73rem;
  color: var(--gold-600);
  font-weight: 600;
}

/* Main Area */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-brand-btn {
  display: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.mobile-brand-btn img { width: 34px; height: 34px; border-radius: 9px; }

.page-heading {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

/* Buttons */

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 10px 12px 4px;
  user-select: none;
}
.nav-divider {
  border-top: 1px solid var(--border);
  margin: 8px 6px 2px;
}

[data-theme="dark"] .nav-section-label {
  color: var(--text-muted);
}
