:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}


.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.winui-page-container {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  position: relative;
}

.winui-top-navbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-surface, #1e1e1e);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  box-sizing: border-box;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.mobile-menu-btn:hover {
  background: rgba(128, 128, 128, 0.15);
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.nav-brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: var(--icon-filter) !important;
}

.winui-brand {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.nav-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.nav-profile-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-license-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nav-license-tag.active {
  background: var(--success-bg);
  color: var(--success);
}

.nav-license-tag.inactive,
.nav-license-tag.expired {
  background: var(--danger-bg);
  color: var(--danger);
}

.nav-action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s;
  flex-shrink: 0;
}

.nav-action-btn:hover {
  background: rgba(128, 128, 128, 0.12);
  color: var(--text-primary);
}

.winui-sidebar {
  width: 240px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--bg-surface, #1e1e1e);
  border-right: 1px solid var(--border-color);
  position: relative;
}

.winui-nav-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 12px 8px;
  list-style: none;
}

.sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-surface, #1e1e1e);
}

.sidebar-footer #sidebarLogoutBtn,
.sidebar-footer .winui-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sidebar-footer #sidebarLogoutBtn:hover,
.sidebar-footer .winui-nav-item:hover {
  background: rgba(128, 128, 128, 0.12);
}

.icon-nav {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .winui-brand {
    display: none;
  }

  .winui-sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 260px;
    height: calc(100dvh - 56px);
    z-index: 1000;
    overflow: hidden;
  }

  .sidebar-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }

  .nav-profile-badge {
    gap: 6px;
    padding: 3px 8px;
    font-size: 11px;
    max-width: 150px;
  }

  .nav-profile-badge span:first-of-type {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-license-tag {
    display: none;
  }
}

@media (max-width: 420px) {
  .winui-top-navbar {
    padding-inline: 10px;
  }

  .navbar-left,
  .navbar-right {
    gap: 6px;
  }

  .nav-profile-badge {
    max-width: calc(100vw - 64px);
  }

  .nav-profile-name {
    max-width: 92px;
  }
}

