/* ── App shell ────────────────────────────────────────────────── */
body {
  background: var(--color-bg);
  color: var(--color-text);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

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

/* ── Persistent sidebar (hidden — offcanvas used on all viewports) */
.app-sidebar {
  display: none;
}
.app-sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 26px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-brand-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.6rem 0.5rem;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-section-label {
  font-size: 0.61rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.28);
  padding: 0.65rem 0.6rem 0.25rem;
  margin-top: 0.25rem;
}
.sidebar-section-label:first-child {
  margin-top: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.75rem;
  border-radius: 7px;
  color: var(--color-sidebar-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-bottom: 0.05rem;
}
.sidebar-link:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text-active);
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--color-sidebar-active);
  color: var(--color-sidebar-text-active);
}
.sidebar-link i {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}

.sidebar-footer {
  padding: 0.7rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sidebar-username {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sidebar-logout {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.72rem;
  padding: 0;
  cursor: pointer;
  transition: color var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-logout:hover {
  color: #ffffff;
}

/* ── Main area ────────────────────────────────────────────────── */
.app-main {
  margin-left: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────────── */
.app-topbar {
  background: var(--color-topbar);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-clock {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.topbar-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  line-height: 1;
  display: flex;
  align-items: center;
}
.topbar-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Mobile offcanvas sidebar ─────────────────────────────────── */
.sidebar-offcanvas {
  background: var(--color-sidebar) !important;
  width: 220px !important;
}
.sidebar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.85rem 1rem;
}
.sidebar-offcanvas .offcanvas-body {
  padding: 0;
  background: var(--color-sidebar);
}

/* ── Hamburger always visible (offcanvas on all viewports) ────── */
.topbar-hamburger {
  display: flex !important;
}
