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

html, body {
  height: 100%;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--c-black);
  background: var(--c-bg);
}

/* ─── App Shell ─────────────────────────────────────────── */

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

/* ─── Sidebar ────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--c-white);
  border-right: 1px solid var(--c-divider);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.08) transparent;
}

.sidebar-logo {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-divider);
  flex-shrink: 0;
  background: var(--c-white);
}

.sidebar-logo-img {
  display: block;
  max-width: 150px;
  height: auto;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: var(--s-3) var(--s-2) var(--s-4);
  list-style: none;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(0,0,0,0.28);
  padding: var(--s-4) var(--s-3) var(--s-1);
  pointer-events: none;
}

.nav-section:not(:first-child) {
  margin-top: var(--s-2);
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 7px var(--s-3);
  color: rgba(0,0,0,0.55);
  text-decoration: none;
  font-size: var(--text-sm);
  line-height: 1.3;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.nav-item a:hover {
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.85);
}

.nav-item.active a {
  background: var(--c-primary-tint);
  color: var(--c-primary);
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .nav-icon,
.nav-item a:hover .nav-icon {
  opacity: 1;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--c-primary);
  color: white;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: var(--radius-pill);
}

/* Sidebar user block */
.sidebar-user {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--c-divider);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: var(--c-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  border-radius: var(--radius-pill);
}

.user-info { overflow: hidden; }

.user-name {
  font-size: var(--text-xs);
  color: rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.user-role {
  font-size: 10px;
  color: rgba(0,0,0,0.38);
  margin-top: 1px;
}

/* ─── Topbar ─────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--c-white);
  border-bottom: 1px solid var(--c-divider);
  display: flex;
  align-items: center;
  padding: 0 var(--s-8);
  gap: var(--s-4);
  z-index: 100;
}

.topbar-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--c-black);
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

/* Region toggle */
.region-toggle {
  display: flex;
  background: var(--c-grey);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.region-toggle button {
  padding: 4px 12px;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(0,0,0,0.4);
  font-family: var(--font-ui);
  border-radius: var(--radius-pill);
  transition: background 0.1s, color 0.1s;
}

.region-toggle button.active {
  background: var(--c-white);
  color: var(--c-black);
  box-shadow: var(--shadow-xs);
}

.region-toggle button:not(.active):hover {
  color: var(--c-black);
}

/* Notifications */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.45);
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.notif-btn:hover {
  background: var(--c-grey);
  color: var(--c-black);
}

.notif-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  width: 16px;
  height: 16px;
  background: var(--c-primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
}

/* Topbar avatar */
.topbar-avatar {
  width: 32px;
  height: 32px;
  background: var(--c-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  border-radius: var(--radius-pill);
  transition: background 0.12s;
}

.topbar-avatar:hover { background: var(--c-primary-hover); }

/* Topbar divider */
.topbar-sep {
  width: 1px;
  height: 20px;
  background: var(--c-divider);
}

/* ─── Main Content ───────────────────────────────────────── */

.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  padding: var(--s-8);
  flex: 1;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--s-6);
  gap: var(--s-4);
}

.page-header-left { flex: 1; }

.page-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--c-black);
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: rgba(0,0,0,0.45);
  margin-top: var(--s-1);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}
