  background: var(--bg);
  color: var(--text);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.app-main {
  min-width: 0;
  width: 100%;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34rem),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, white) 0%, color-mix(in srgb, var(--bg) 88%, var(--surface-secondary)) 100%);
}
:root[data-theme="dark"] .app-main,
.dark .app-main {
  background:
    radial-gradient(circle at top right, rgba(158, 234, 61, .05), transparent 32rem),
    var(--bg);
}
.app-page {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 22px 24px 24px;
}
.page-panel { background: var(--card); border: 1px solid var(--border-soft); border-radius: 18px; box-shadow: var(--shadow-sm); }
.page-title { font-family: 'Poppins', sans-serif; color: var(--text); font-weight: 800; letter-spacing: -0.03em; }
.page-subtitle { color: var(--muted); font-size: 13px; font-weight: 500; }
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--surface) 96%, white);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.page-toolbar__grow {
  flex: 1 1 320px;
  min-width: 240px;
}
.page-surface {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.page-surface__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 95%, white), color-mix(in srgb, var(--surface-secondary) 98%, white));
}
.page-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface-secondary);
}
.page-tab {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.page-tab:hover { color: var(--text); }
.page-tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.shell-content {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 18px 18px 18px 0;
  overflow-x: hidden;
}
.sidebar-shell {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: none;
}
:root[data-theme="dark"] .sidebar-shell {
  background: #0a0f0d;
  border-right: 1px solid #14221a;
  box-shadow: none;
}
.sidebar-logo-full {
  max-width: 138px;
  max-height: 86px;
  object-fit: contain;
}
.sidebar-logo-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0 14px;
  margin-top: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
  color: #94a3b8;
}
:root[data-theme="dark"] .sidebar-group-header {
  color: #475569;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  color: #475569;
  font-weight: 600;
  position: relative;
  transition: all 0.2s ease;
}
.sidebar-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar-nav-item.active {
  background: #14bd7e !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: none !important;
}
.sidebar-nav-item.active svg,
.sidebar-nav-item.active .text-green-500 {
  color: #ffffff !important;
}
:root[data-theme="dark"] .sidebar-nav-item {
  color: #94a3b8;
}
:root[data-theme="dark"] .sidebar-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
}
:root[data-theme="dark"] .sidebar-nav-item.active {
  background: #14bd7e !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: none !important;
}
.sidebar-active-indicator {
  position: absolute;
  left: 4px;
  color: #22c55e;
  font-size: 8px;
  pointer-events: none;
}
:root[data-theme="dark"] .sidebar-active-indicator {
  color: #4ade80;
}
.sidebar-subnav {
  margin: 6px 0 0 20px;
  padding-left: 12px;
  border-left: 1px solid #e2e8f0;
}
:root[data-theme="dark"] .sidebar-subnav {
  border-left-color: rgba(255,255,255,0.08);
}
.sidebar-subnav-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s ease;
}
.sidebar-subnav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar-subnav-item.active {
  background: #eaf7ed;
  color: #15803d;
}
:root[data-theme="dark"] .sidebar-subnav-item {
  color: #94a3b8;
}
:root[data-theme="dark"] .sidebar-subnav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #f8fafc;
}
:root[data-theme="dark"] .sidebar-subnav-item.active {
  background: #142e1f;
  color: #4ade80;
}
.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid #e2e8f0;
}
:root[data-theme="dark"] .sidebar-footer {
  border-top: 1px solid #14221a;
  background: transparent;
}
.sidebar-footer__label {
  margin-bottom: 8px;
  padding-left: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
}
:root[data-theme="dark"] .sidebar-footer__label {
  color: #475569;
}
.sidebar-logout {
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
}
.sidebar-logout:hover {
  background: #fee2e2;
  color: #ef4444;
}
:root[data-theme="dark"] .sidebar-logout {
  color: #94a3b8;
}
:root[data-theme="dark"] .sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
:root[data-theme="dark"] .sidebar-toggle-btn {
  border-color: #14221a;
  background: #0a0f0d;
  color: #94a3b8;
}

/* Advanced Doclines Styles */
.sidebar-search-container {
  position: relative;
  margin: 16px 14px 8px;
}
.sidebar-search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: #f3f4f6;
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  transition: all 0.2s ease;
}
.sidebar-search-input::placeholder {
  color: #9ca3af;
}
.sidebar-search-input:focus {
  background: #ffffff;
  border-color: #14bd7e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 189, 126, 0.1);
}
:root[data-theme="dark"] .sidebar-search-input {
  background: #181d1a;
  color: #e5e7eb;
}
:root[data-theme="dark"] .sidebar-search-input:focus {
  background: #0f1311;
  border-color: #14bd7e;
}
.sidebar-search-icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
  pointer-events: none;
}
.sidebar-search-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s ease;
}
.sidebar-search-icon-right:hover {
  color: #14bd7e;
}

.sidebar-collapse-toggle-floating {
  position: absolute;
  right: -12px;
  top: 28px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 100;
  font-size: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.sidebar-collapse-toggle-floating:hover {
  background: #f3f4f6;
  color: #14bd7e;
  border-color: #14bd7e;
  transform: scale(1.05);
}
:root[data-theme="dark"] .sidebar-collapse-toggle-floating {
  border-color: #27272a;
  background: #0f1311;
  color: #a1a1aa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .sidebar-collapse-toggle-floating:hover {
  background: #181d1a;
  color: #14bd7e;
  border-color: #14bd7e;
}

.sidebar-subnav-item.active {
  background: #14bd7e !important;
  color: #ffffff !important;
  font-weight: 700;
}
:root[data-theme="dark"] .sidebar-subnav-item.active {
  background: #14bd7e !important;
  color: #ffffff !important;
}

.sidebar-subnav {
  position: relative;
  margin-left: 28px;
  padding-left: 14px;
  border-left: none !important;
}
.sidebar-subnav-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 16px;
  width: 1px;
  background: #e5e7eb;
}
:root[data-theme="dark"] .sidebar-subnav-line {
  background: #27272a;
}
.sidebar-subnav-item-wrapper {
  position: relative;
  padding-left: 4px;
}
.sidebar-subnav-item-branch {
  position: absolute;
  left: -18px;
  top: 50%;
  width: 14px;
  height: 1px;
  background: #e5e7eb;
}
:root[data-theme="dark"] .sidebar-subnav-item-branch {
  background: #27272a;
}

.sidebar-theme-switch-pill {
  background: #f3f4f6;
  border-radius: 99px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}
:root[data-theme="dark"] .sidebar-theme-switch-pill {
  background: #181d1a;
}
.sidebar-theme-option-btn {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sidebar-theme-option-btn.active-light {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.sidebar-theme-option-btn.active-dark {
  background: #27272a;
  color: #f4f4f5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
:root[data-theme="dark"] .sidebar-theme-option-btn {
  color: #a1a1aa;
}

.sidebar-profile-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
:root[data-theme="dark"] .sidebar-profile-container {
  border-top-color: #27272a;
}
.sidebar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #14bd7e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(20, 189, 126, 0.2);
  flex-shrink: 0;
}
.sidebar-profile-info {
  margin-left: 10px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.sidebar-profile-name {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-email {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:root[data-theme="dark"] .sidebar-profile-name {
  color: #f4f4f5;
}
:root[data-theme="dark"] .sidebar-profile-email {
  color: #71717a;
}
.sidebar-profile-dots {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-profile-dots:hover {
  background: #f3f4f6;
  color: #111827;
}
:root[data-theme="dark"] .sidebar-profile-dots:hover {
  background: #181d1a;
  color: #f4f4f5;
}

.sidebar-notification-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-shell.collapsed .sidebar-nav-item.active {
  background: #14bd7e !important;
  color: #ffffff !important;
  border-radius: 12px;
}
.sidebar-shell.collapsed .sidebar-nav-item {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.sidebar-shell.collapsed .sidebar-profile-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.sidebar-shell.collapsed .sidebar-profile-avatar {
  margin: 0 auto !important;
}

/* Sidebar collapsed overflow fix to prevent clipping of absolute/floating flyout menus */
.sidebar-shell.collapsed nav,
.sidebar-shell.collapsed .overflow-y-auto {
  overflow: visible !important;
}

/* Profile Dropdown Popover Styling */
.sidebar-profile-dropdown {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
  animation: profileDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
:root[data-theme="dark"] .sidebar-profile-dropdown {
  background-color: #0c100e !important;
  border-color: #14221a !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Collapsed Admin Menu Floating Popover Styling */
.admin-dropdown-collapsed-floating {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  z-index: 1050 !important;
}
:root[data-theme="dark"] .admin-dropdown-collapsed-floating {
  background-color: #0c100e !important;
  border-color: #14221a !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

@keyframes profileDropdownFade {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mobile-bottom-nav {
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2)) !important;
  border-color: color-mix(in srgb, var(--sidebar-text) 18%, transparent) !important;
  box-shadow: 0 -16px 36px rgba(3, 7, 18, .22);
}
.mobile-drawer { background: var(--sidebar-bg-2) !important; }

.app-header {
  height: 72px;
  min-width: 0;
  width: 100%;
  flex-shrink: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
  color: var(--text);
  overflow: visible;
}
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.icon-button:hover {
  background: var(--surface-secondary);
  color: var(--text);
  border-color: var(--border-soft);
}
.icon-button:active { transform: scale(.97); }
.theme-toggle {
  width: 78px;
  min-width: 78px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 78px;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateX(0);
  transition: transform .18s ease;
}
.theme-toggle.is-dark::before {
  transform: translateX(38px);
}
.theme-toggle__icon {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color .18s ease, opacity .18s ease;
}
.theme-toggle__icon svg {
  width: 15px;
  height: 15px;
  display: block;
}
.theme-toggle.is-light .theme-toggle__icon--light,
.theme-toggle.is-dark .theme-toggle__icon--dark {
  color: var(--text);
}
.header-search {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  gap: 10px;
  width: min(100%, 360px);
  min-width: 0;
  max-width: min(360px, 100%);
  height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, white);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.header-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.header-search input::placeholder { color: var(--muted); }
.header-date-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.profile-trigger {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(100%, 196px);
  flex-shrink: 0;
  gap: 10px;
  padding: 4px 8px 4px 6px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.profile-trigger:hover,
.profile-trigger.is-open {
  background: color-mix(in srgb, var(--surface-secondary) 92%, white);
  border-color: var(--border-soft);
}
.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  border: 1px solid var(--border-soft);
}
.profile-trigger__name {
  max-width: 132px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.profile-trigger__role {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1;
  text-transform: capitalize;
  color: var(--muted);
}
.profile-trigger__chevron {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform .16s ease, color .16s ease;
}
.profile-trigger.is-open .profile-trigger__chevron {
  transform: rotate(180deg);
  color: var(--text);
}
.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 228px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 260;
}
.header-menu-root {
  position: relative;
  z-index: 220;
}
.header-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 260;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}
.notifications-menu {
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100dvh - 96px));
  border-radius: 20px;
  overflow: hidden;
}
.notifications-menu__header,
.notifications-menu__footer {
  padding: 13px 14px;
  background: color-mix(in srgb, var(--surface-secondary) 88%, var(--surface));
}
.notifications-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.notifications-menu__body {
  max-height: 360px;
  overflow-y: auto;
}
.notifications-menu__item {
  width: 100%;
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  transition: background .16s ease;
}
.notifications-menu__item:hover {
  background: var(--surface-secondary);
}
.notifications-menu__item.is-unread {
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}
.notifications-menu__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
}
.notifications-menu__footer {
  border-top: 1px solid var(--border-soft);
  text-align: center;
}
.notifications-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 30px 22px;
  text-align: center;
  color: var(--muted);
}
.profile-menu__header {
  padding: 10px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}
.profile-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease;
}
.profile-menu__item:hover {
  background: var(--surface-secondary);
  color: var(--text);
