@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds */
  --color-bg-base: #F7F7FA;
  --color-bg-surface: #FFFFFF;
  --color-bg-elevated: #F0F0F5;
  --color-bg-input: #FFFFFF;

  /* Borders */
  --color-border: #E2E2EB;
  --color-border-focus: #2563EB;

  /* Text */
  --color-text-primary: #111118;
  --color-text-secondary: #5C5C72;
  --color-text-muted: #9A9AB0;
  --color-text-inverse: #FFFFFF;

  /* Brand — Blue */
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-primary-subtle: #EFF6FF;
  --color-primary-text: #1D4ED8;

  /* Semantic */
  --color-success: #16A34A;
  --color-success-subtle: #F0FDF4;
  --color-warning: #D97706;
  --color-warning-subtle: #FFFBEB;
  --color-danger: #DC2626;
  --color-danger-subtle: #FEF2F2;
  --color-info: #0284C7;
  --color-info-subtle: #F0F9FF;

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-code: 13px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-primary: 0 4px 16px rgba(37,99,235,0.25);

  /* Z-index */
  --z-raised: 10;
  --z-sticky: 20;
  --z-sidebar: 30;
  --z-topbar: 40;
  --z-dropdown: 50;
  --z-modal-backdrop: 100;
  --z-modal: 110;
  --z-toast: 200;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

code, pre, .font-mono {
  font-family: var(--font-mono);
}

h1, h2, h3, h4 {
  font-weight: 600;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Layout ---------- */

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

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--color-bg-surface);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: width 200ms ease-out;
}

.sidebar.collapsed,
html.sidebar-is-collapsed .sidebar {
  width: 60px;
}

html.sidebar-is-collapsed .content-wrapper {
  margin-left: 60px;
}

.sidebar.collapsed .sidebar-logo,
html.sidebar-is-collapsed .sidebar-logo {
  justify-content: center;
  padding: 0;
  font-size: 0;
}

.sidebar.collapsed .sidebar-logo img,
html.sidebar-is-collapsed .sidebar-logo img {
  max-width: 36px;
  max-height: 36px;
}

.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-footer,
html.sidebar-is-collapsed .sidebar-nav,
html.sidebar-is-collapsed .sidebar-footer {
  padding-left: 8px;
  padding-right: 8px;
}

.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item span,
html.sidebar-is-collapsed .nav-group-label,
html.sidebar-is-collapsed .nav-item span {
  display: none;
}

.sidebar.collapsed .nav-item,
html.sidebar-is-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 0;
  width: 44px;
  margin-left: auto;
  margin-right: auto;
}

.sidebar-logo {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  font-weight: 700;
  font-size: var(--text-lg);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: hidden;
}

/* .sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
} */

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.nav-item.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary-text);
  font-weight: 600;
}

.nav-item svg { flex-shrink: 0; width: 20px; height: 20px; }

.nav-group-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 6px 12px;
}

.content-wrapper {
  margin-left: 264px;
  flex: 1;
  min-width: 0;
  transition: margin-left 200ms ease-out;
}

.content-wrapper.sidebar-collapsed { margin-left: 60px; }

.topbar {
  height: 60px;
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
}

.topbar-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

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

.notification-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.notification-btn:hover {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}

.notification-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notification-menu {
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
}

.notification-menu-header {
  padding: 12px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.notification-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  transition: background 150ms ease-out;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--color-bg-surface);
}

.notification-item.is-unread {
  background: var(--color-primary-subtle);
}

.notification-item.is-unread:hover {
  filter: brightness(0.98);
}

.notification-indicator {
  width: 10px;
  min-width: 10px;
  padding-top: 6px;
  display: flex;
  justify-content: center;
}

.notification-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.notification-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.notification-message {
  margin-top: 4px;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-secondary);
  white-space: normal;
}

.notification-item.is-read .notification-title {
  font-weight: 500;
}

.notification-item.is-read {
  background: var(--color-bg-elevated);
}

.content-area {
  padding: 28px 32px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.content-area table {
  width: 100%;
  table-layout: auto;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease-out;
  min-height: 44px;
}

.btn-md { height: 40px; padding: 10px 20px; font-size: 14px; min-height: 40px; }
.btn-sm { height: 32px; padding: 8px 14px; font-size: 13px; min-height: 32px; }
.btn-lg { height: 48px; padding: 12px 28px; font-size: 16px; }

.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: var(--shadow-primary); }
.btn-secondary { background: var(--color-bg-elevated); color: var(--color-text-primary); border: 1px solid var(--color-border); }
.btn-secondary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { color: var(--color-text-primary); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-danger-ghost { background: transparent; color: var(--color-danger); border: 1px solid var(--color-danger); }

.btn:active { transform: scale(0.97); filter: brightness(0.95); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Inputs ---------- */

.form-group { margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.form-label .required { color: var(--color-danger); }

.form-control {
  width: 100%;
  height: 40px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: var(--text-base);
  color: var(--color-text-primary);
  font-family: inherit;
}

.form-control::placeholder { color: var(--color-text-muted); }

.form-control:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
  outline: none;
}

.form-control.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

textarea.form-control {
  height: auto;
  min-height: 100px;
  padding: 10px 14px;
  resize: vertical;
}

.form-helper { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.form-error { font-size: var(--text-sm); color: var(--color-danger); margin-top: var(--space-1); }

/* ---------- Cards ---------- */

.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-value { font-size: var(--text-3xl); font-weight: 700; }
.stat-card .stat-label { font-size: var(--text-sm); color: var(--color-text-secondary); margin-top: var(--space-1); }

/* ---------- Table ---------- */

.data-table-wrap {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table { min-width: 900px; width: 100%; border-collapse: collapse; }
table.data-table thead { background: var(--color-bg-elevated); }
table.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 12px 16px;
}
table.data-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  height: 52px;
  font-size: var(--text-sm);
}
table.data-table tbody tr:hover { background: var(--color-bg-elevated); }

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--color-text-secondary);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
}
.badge-primary { background: var(--color-primary-subtle); color: var(--color-primary-text); }
.badge-success { background: var(--color-success-subtle); color: var(--color-success); }
.badge-warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-subtle); color: var(--color-danger); }

/* ---------- Slide-over ---------- */

.slideover-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: var(--z-modal-backdrop);
  display: none;
}
.slideover-backdrop.open { display: block; }

.slideover-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  background: var(--color-bg-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform 200ms ease-out;
  display: flex;
  flex-direction: column;
}
.slideover-backdrop.open .slideover-panel { transform: translateX(0); }

.slideover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.slideover-body { padding: var(--space-6); overflow-y: auto; flex: 1; }
.slideover-footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ---------- Modal (confirm) ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0,0,0,0.4);
  z-index: var(--z-modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal-dialog {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 90%;
  padding: 28px;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}
.modal-backdrop.open .modal-dialog { transform: scale(1); opacity: 1; }

/* ---------- Dropdown ---------- */

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  min-width: 180px;
  z-index: var(--z-dropdown);
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--color-bg-surface); }
.dropdown-item.destructive { color: var(--color-danger); }
.dropdown-divider { border-top: 1px solid var(--color-border); margin: 4px 0; }

.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary-subtle);
  color: var(--color-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
}

.toast {
  min-width: 280px;
  max-width: 360px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 3px solid var(--color-info);
  box-shadow: var(--shadow-md);
  animation: toast-in 250ms cubic-bezier(0.16,1,0.3,1);
}
.toast.info { border-left-color: var(--color-info); }
.toast.success { border-left-color: var(--color-success); background: var(--color-success-subtle); }
.toast.warning { border-left-color: var(--color-warning); background: var(--color-warning-subtle); }
.toast.danger { border-left-color: var(--color-danger); background: var(--color-danger-subtle); }

@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Upload zone ---------- */

.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-input);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 150ms ease-out;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}

/* ---------- Tabs ---------- */

.tabs { display: flex; border-bottom: 1px solid var(--color-border); gap: var(--space-1); }
.tab-item {
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.tab-item:hover { color: var(--color-text-primary); background: var(--color-bg-elevated); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.tab-item.active { color: var(--color-primary-text); border-bottom: 2px solid var(--color-primary); font-weight: 600; }

/* ---------- Auth / install ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-base);
  padding: var(--space-6);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
}

.auth-card h1 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.auth-card .auth-sub { color: var(--color-text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-6); }

/* ---------- Settings rows ---------- */

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}
.settings-row .settings-label { font-size: var(--text-base); font-weight: 500; }
.settings-row .settings-desc { font-size: var(--text-sm); color: var(--color-text-secondary); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.search-filters { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.skeleton {
  background: linear-gradient(90deg, #E8E8F0 25%, #F0F0F5 50%, #E8E8F0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ---------- Tag input ---------- */

.tag-input-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-subtle);
  color: var(--color-primary-text);
  font-size: var(--text-sm);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.tag-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.tag-input-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  display: none;
}
.tag-input-dropdown.open { display: block; }

.tag-input-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: var(--text-sm);
  cursor: pointer;
}
.tag-input-item:hover { background: var(--color-bg-surface); }

.tag-input-empty {
  padding: 12px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- Link projects modal ---------- */

.link-projects-modal {
  max-width: 860px;
  max-height: 80vh;
  width: 90%;
  display: flex;
  flex-direction: column;
}

.link-projects-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.link-projects-column {
  border-right: 1px solid var(--color-border);
  padding-right: var(--space-4);
  overflow-y: auto;
  max-height: 50vh;
}
.link-projects-column:last-child { border-right: none; }

.link-projects-column-header {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.link-projects-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 0;
  font-size: var(--text-sm);
}

/* ---------- Code / markdown preview block ---------- */

.code-preview {
  background: #F8F8FA;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-code);
  color: var(--color-text-primary);
  line-height: 1.7;
  overflow-x: auto;
}


/* ---------- Shared State Filter ---------- */
.state-filter {
  position: relative;
}

.state-filter-trigger {
  width: 160px;
  cursor: pointer;
  text-align: left;
}

.state-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 220px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.state-filter-menu.open {
  display: block;
}

.state-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  cursor: pointer;
}


.project-date-filter {
    position: relative;
}

.project-date-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.project-date-filter-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 250px;
    padding: 14px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.project-date-filter.open .project-date-filter-menu {
    display: block;
}

.project-date-filter-menu label {
    display: block;
    margin: 8px 0 5px;
    font-size: 12px;
    font-weight: 600;
}

.project-date-filter-menu label:first-child {
    margin-top: 0;
}

.project-date-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
}


/* ---------- Project compact filters ---------- */

.project-toolbar {
    align-items: flex-start;
}

.project-search-filters {
    flex: 1;
    flex-wrap: wrap;
}

.project-more-filters {
    position: relative;
}

.project-more-filters > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.project-more-filters > summary::-webkit-details-marker {
    display: none;
}

.project-more-filters-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 280px;
    padding: 14px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.project-more-filter-field {
    margin-bottom: 12px;
}

.project-more-filter-field:last-child {
    margin-bottom: 0;
}

.project-more-filter-field > label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
}

.project-more-filters-menu .form-control,
.project-more-filters-menu .state-filter,
.project-more-filters-menu .state-filter-trigger {
    width: 100% !important;
}

.project-more-filters-menu .state-filter-menu {
    width: 100%;
    min-width: 100%;
}


/* ---------- Contact Remark client format ---------- */

.contact-remarks-only .entity-summary-shell {
    width: min(1180px, calc(100vw - 48px));
    max-width: 1180px;
}

.contact-remarks-only .entity-summary-address {
    display: none;
}

.contact-remarks-only #entity-summary-contact-remarks-section {
    margin-top: 8px;
}

#entity-summary-contact-remarks {
    border-collapse: separate;
    border-spacing: 0 10px;
}

#entity-summary-contact-remarks .contact-remark-row td {
    padding: 12px 10px;
    vertical-align: middle;
    background: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

#entity-summary-contact-remarks .contact-remark-row td:first-child {
    border-left: 1px solid var(--color-border);
    border-radius: 8px 0 0 8px;
}

#entity-summary-contact-remarks .contact-remark-row td:last-child {
    border-right: 1px solid var(--color-border);
    border-radius: 0 8px 8px 0;
}

.contact-remark-call-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--color-info);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.contact-remark-date {
    white-space: nowrap;
    color: var(--color-text-secondary);
}

.contact-remark-status-chip {
    display: inline-block;
    min-width: 110px;
    padding: 6px 10px;
    border-radius: 7px;
    text-align: center;
    background: #fff0dc;
    font-size: 12px;
}

.contact-remark-pic-chip {
    display: inline-block;
    min-width: 130px;
    padding: 6px 10px;
    border-radius: 7px;
    text-align: center;
    background: var(--color-bg-muted, #eeeeef);
}

.contact-remark-text {
    min-width: 180px;
    font-weight: 600;
    white-space: normal;
}

.contact-remark-brand-chip {
    display: inline-block;
    min-width: 120px;
    padding: 7px 12px;
    border-radius: 7px;
    text-align: center;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
}

.contact-remarks-only .entity-summary-contact-actions {
    gap: 10px;
}

.contact-remarks-only #contact-remark-brand-filter {
    min-width: 145px;
    font-weight: 600;
}


/* ---------- Contact Remark UI polish ---------- */

.contact-remarks-only .entity-summary-shell {
    width: min(1120px, calc(100vw - 56px));
    max-width: 1120px;
}

.contact-remarks-only .entity-summary-contact-header {
    align-items: center;
    margin-bottom: 4px;
}

.contact-remarks-only .entity-summary-contact-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.contact-remarks-only .entity-summary-contact-actions {
    gap: 8px;
    align-items: center;
}

.contact-remarks-only #contact-remark-brand-filter {
    min-width: 150px;
    font-weight: 400;
    background: var(--color-bg-surface);
}

#entity-summary-contact-remarks {
    border-spacing: 0 8px;
}

#entity-summary-contact-remarks .contact-remark-row td {
    padding: 11px 12px;
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

#entity-summary-contact-remarks .contact-remark-row td:first-child {
    padding-left: 12px;
    border-left: 1px solid var(--color-border);
    border-radius: 9px 0 0 9px;
}

#entity-summary-contact-remarks .contact-remark-row td:last-child {
    padding-right: 12px;
    border-right: 1px solid var(--color-border);
    border-radius: 0 9px 9px 0;
}

.contact-remark-call-chip {
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.contact-remark-date {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.contact-remark-status-chip {
    min-width: 120px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.contact-remark-pic-chip {
    min-width: 120px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
}

.contact-remark-text {
    min-width: 190px;
    max-width: 300px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--color-text-primary);
    white-space: normal;
}

.contact-remark-brand-chip {
    min-width: 110px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: var(--color-primary-subtle);
    color: var(--color-primary-text);
    border: 1px solid var(--color-border);
}

.contact-remark-row .btn-ghost {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.contact-remark-row .btn-ghost:hover {
    color: var(--color-text-primary);
}



/* Contact Remark brand tones */

.contact-remark-brand-chip {
    border: 0;
    font-weight: 500;
}

.contact-remark-brand-chip.brand-tone-blue {
    background: #eaf2ff;
    color: #315a9f;
}

.contact-remark-brand-chip.brand-tone-green {
    background: #eaf8ef;
    color: #34734b;
}

.contact-remark-brand-chip.brand-tone-purple {
    background: #f1edff;
    color: #65549a;
}

.contact-remark-brand-chip.brand-tone-orange {
    background: #fff2e5;
    color: #96613a;
}

.contact-remark-brand-chip.brand-tone-pink {
    background: #fcecf3;
    color: #95536f;
}

.contact-remark-brand-chip.brand-tone-teal {
    background: #e8f7f5;
    color: #34756f;
}

.contact-remark-brand-chip.brand-tone-neutral {
    background: #f1f2f4;
    color: #676b73;
}

/* ---------- Contact Remark cleaner final polish ---------- */

#entity-summary-contact-remarks .contact-remark-row td {
    background: #fff;
    padding: 12px 14px;
}

.contact-remark-pic-chip {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
    color: var(--color-text-primary);
}

.contact-remark-text {
    font-weight: 400;
    color: var(--color-text-secondary);
}

.contact-remark-brand-chip {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent !important;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.contact-remark-brand-chip::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 7px;
    background: currentColor;
}

.contact-remark-brand-chip.brand-tone-blue {
    color: #4f6fae;
}

.contact-remark-brand-chip.brand-tone-green {
    color: #4b8060;
}

.contact-remark-brand-chip.brand-tone-purple {
    color: #7562a7;
}

.contact-remark-brand-chip.brand-tone-orange {
    color: #a16c42;
}

.contact-remark-brand-chip.brand-tone-pink {
    color: #9b6078;
}

.contact-remark-brand-chip.brand-tone-teal {
    color: #427d77;
}

.contact-remark-brand-chip.brand-tone-neutral {
    color: var(--color-text-secondary);
}

.contact-remark-status-chip {
    min-width: 0;
    padding: 5px 9px;
}

.contact-remark-row .btn-ghost {
    padding-left: 4px;
    padding-right: 4px;
}

.entity-summary-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.entity-summary-section-heading h3 {
    margin: 0;
}


/* =========================================================
   CRM WORKFLOW NAVIGATION
   ========================================================= */

.nav-collapsible {
  margin: 2px 0 6px;
}

.nav-parent {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 42px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.nav-parent::-webkit-details-marker {
  display: none;
}

.nav-parent::marker {
  display: none;
  content: "";
}

.nav-parent:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.nav-collapsible[open] > .nav-parent,
.nav-collapsible.is-active > .nav-parent {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
}

.nav-parent > svg:first-child {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-parent-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-chevron {
  width: 15px !important;
  height: 15px !important;
  margin-left: auto;
  opacity: 0.55;
  flex-shrink: 0;
  transition: transform 160ms ease;
}

.nav-collapsible[open] > .nav-parent .nav-chevron {
  transform: rotate(90deg);
}

.nav-submenu {
  position: relative;
  margin: 5px 0 9px 22px;
  padding: 2px 0 2px 14px;
  border-left: 1px solid var(--color-border);
}

.nav-subitem {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.nav-subitem::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--color-border);
}

.nav-subitem span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-subitem:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.nav-subitem.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary-text);
  font-weight: 600;
}

.nav-subitem.active::after {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--color-primary-text);
  transform: translateY(-50%);
}

.nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Collapsed sidebar support */

.sidebar.collapsed .nav-parent,
html.sidebar-is-collapsed .nav-parent {
  width: 44px;
  padding: 0;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.sidebar.collapsed .nav-parent-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-submenu,
html.sidebar-is-collapsed .nav-parent-label,
html.sidebar-is-collapsed .nav-chevron,
html.sidebar-is-collapsed .nav-submenu {
  display: none;
}


/* Final sidebar polish */

.sidebar-nav {
  scrollbar-color: transparent transparent;
}

.sidebar-nav:hover {
  scrollbar-color: var(--color-border) transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: var(--color-border);
}

.nav-collapsible[open] > .nav-parent {
  background: color-mix(
    in srgb,
    var(--color-bg-elevated) 65%,
    transparent
  );
}

.nav-subitem {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.nav-subitem:hover {
  color: var(--color-text-primary);
}

.nav-subitem.active {
  color: var(--color-primary-text);
  font-weight: 600;
}


/* ===== Notification UI Polish ===== */

.notification-menu {
  width: 380px;
  max-height: 460px;
  overflow-y: auto;
  padding: 0;
  border-radius: 12px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.12);
}

.notification-menu-header {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  position: sticky;
  top: 0;
  z-index: 2;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  text-decoration: none;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  transition:
    background 120ms ease,
    transform 120ms ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--color-bg-surface);
}

.notification-item.is-unread {
  background: color-mix(
    in srgb,
    var(--color-primary) 7%,
    var(--color-bg-elevated)
  );
}

.notification-item.is-unread:hover {
  background: color-mix(
    in srgb,
    var(--color-primary) 10%,
    var(--color-bg-elevated)
  );
}

.notification-indicator {
  width: 8px;
  min-width: 8px;
  padding-top: 7px;
  display: flex;
  justify-content: center;
}

.notification-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.notification-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.notification-item.is-read .notification-title {
  font-weight: 500;
}

.notification-time {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.notification-message {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-secondary);
  white-space: normal;
}

.notification-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.notification-btn {
  transition:
    background 120ms ease,
    color 120ms ease;
}

.notification-badge {
  top: -1px;
  right: -1px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  font-size: 9px;
  line-height: 15px;
}


/* ===== Notification Bell Alignment ===== */

.notification-btn {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.notification-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
}


/* ===== Notification Dropdown Background Fix ===== */

.notification-menu {
  background: #ffffff;
  border-color: #e6eaf0;
}

.notification-menu-header {
  background: #ffffff;
  border-bottom-color: #e6eaf0;
}

.notification-item {
  background: #ffffff;
  border-bottom-color: #edf0f4;
}

.notification-item.is-read {
  background: #ffffff;
}

.notification-item:hover,
.notification-item.is-read:hover {
  background: #f8fafc;
}

.notification-item.is-unread {
  background: #f7f9ff;
  box-shadow:
    inset 3px 0 0 var(--color-primary);
}

.notification-item.is-unread:hover {
  background: #f2f6ff;
}

.notification-empty {
  background: #ffffff;
}


/* ===== Notification UI V2 ===== */

.notification-menu {
  width: 410px;
  max-height: 520px;
  overflow-y: auto;

  right: -8px;
  top: calc(100% + 12px);

  padding: 0;

  background: #ffffff;

  border: 1px solid #e7ebf1;
  border-radius: 14px;

  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.13),
    0 4px 12px rgba(15, 23, 42, 0.06);
}

.notification-menu::before {
  content: "";
  position: absolute;

  top: -6px;
  right: 19px;

  width: 12px;
  height: 12px;

  background: #ffffff;

  border-left: 1px solid #e7ebf1;
  border-top: 1px solid #e7ebf1;

  transform: rotate(45deg);
}

.notification-menu-header {
  min-height: 68px;

  padding: 15px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  background: #ffffff;

  border-bottom: 1px solid #edf0f4;

  position: sticky;
  top: 0;
  z-index: 3;
}

.notification-menu-title {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
  color: #18212f;
}

.notification-menu-subtitle {
  margin-top: 3px;

  font-size: 11px;
  line-height: 1.4;

  color: #8a94a6;
}

.notification-header-count {
  flex-shrink: 0;

  padding: 4px 8px;

  border-radius: 999px;

  background: #edf3ff;
  color: #3567d4;

  font-size: 10px;
  font-weight: 600;
}

#notification-list {
  padding: 8px;

  background: #f8fafc;
}

.notification-item {
  position: relative;

  display: flex;
  align-items: flex-start;

  gap: 12px;

  margin-bottom: 6px;
  padding: 12px;

  background: #ffffff;

  border: 1px solid #edf0f4;
  border-radius: 10px;

  color: #18212f;
  text-decoration: none;

  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.notification-item:last-child {
  margin-bottom: 0;
}

.notification-item:hover {
  background: #ffffff;
  border-color: #dce3ec;

  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.06);

  transform: translateY(-1px);
}

.notification-item.is-unread {
  background: #f6f9ff;
  border-color: #dbe6ff;
}

.notification-item.is-unread:hover {
  background: #f3f7ff;
}

.notification-icon-wrap {
  position: relative;

  width: 34px;
  height: 34px;

  flex: 0 0 34px;
}

.notification-icon {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 9px;

  background: #edf3ff;
  color: #4c6fdc;
}

.notification-icon svg {
  width: 16px;
  height: 16px;
}

.notification-dot {
  position: absolute;

  top: -2px;
  right: -2px;

  width: 8px;
  height: 8px;

  border: 2px solid #ffffff;
  border-radius: 50%;

  background: #2563eb;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 14px;
}

.notification-title {
  font-size: 13px;
  line-height: 1.4;

  font-weight: 650;

  color: #1c2430;
}

.notification-item.is-read .notification-title {
  font-weight: 550;
}

.notification-time {
  flex-shrink: 0;

  padding-top: 1px;

  font-size: 10px;
  line-height: 1.4;

  color: #98a1b2;

  white-space: nowrap;
}

.notification-message {
  margin-top: 4px;

  font-size: 11.5px;
  line-height: 1.5;

  color: #667085;

  white-space: normal;
}

.notification-empty {
  margin: 8px;
  padding: 32px 18px;

  background: #ffffff;

  border: 1px dashed #dfe4eb;
  border-radius: 10px;

  text-align: center;

  font-size: 12px;
  color: #98a1b2;
}

/* Bell itself */

.notification-btn {
  width: 36px;
  height: 36px;

  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;

  border: 1px solid transparent;
  border-radius: 10px;

  color: #667085;

  line-height: 0;

  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.notification-btn:hover {
  background: #f8fafc;
  border-color: #e6eaf0;

  color: #344054;
}

.notification-btn svg {
  width: 19px;
  height: 19px;

  display: block;
  margin: 0;
}

.notification-badge {
  top: -3px;
  right: -3px;

  min-width: 16px;
  height: 16px;

  padding: 0 4px;

  border: 2px solid #ffffff;
  border-radius: 999px;

  background: #ef4444;
  color: #ffffff;

  font-size: 9px;
  line-height: 12px;
  font-weight: 700;
}


/* ===== Notification Client Tabs ===== */

.notification-menu {
  width: min(880px, calc(100vw - 32px));
  max-height: 620px;
  overflow: hidden;
}

.notification-menu-header {
  position: relative;
  top: auto;
}

.notification-tabs {
  display: flex;
  align-items: stretch;

  overflow-x: auto;

  background: #ffffff;

  border-bottom: 1px solid #e7ebf1;

  scrollbar-width: thin;
}

.notification-tab {
  min-width: max-content;

  padding: 13px 16px;

  background: transparent;

  border: 0;
  border-bottom: 2px solid transparent;

  color: #667085;

  font-size: 12px;
  font-weight: 600;

  white-space: nowrap;

  cursor: pointer;
}

.notification-tab:hover {
  background: #f8fafc;
  color: #344054;
}

.notification-tab.is-active {
  color: #2563eb;

  background: #f8faff;

  border-bottom-color: #2563eb;
}

#notification-list {
  max-height: 440px;

  overflow-y: auto;

  padding: 10px;

  background: #f8fafc;
}

@media (max-width: 720px) {
  .notification-menu {
    width: calc(100vw - 24px);

    right: -56px;
  }

  .notification-tab {
    padding-left: 13px;
    padding-right: 13px;
  }
}



/* ===== Notification Tab Counters ===== */

.notification-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.notification-tab-count {
  min-width: 17px;
  height: 17px;

  padding: 0 5px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;

  background: #2563eb;
  color: #ffffff;

  font-size: 9px;
  line-height: 1;
  font-weight: 700;
}

.notification-tab:not(.is-active)
.notification-tab-count {
  background: #e8efff;
  color: #3567d4;
}

.notification-tab-count[hidden] {
  display: none !important;
}



/* ===== New Project Notification Action ===== */

.new-project-action-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  margin-bottom: 20px;
  padding: 18px 20px;

  background: #f7f9ff;
  border: 1px solid #dce5ff;
  border-radius: 10px;
}

.new-project-action-copy {
  min-width: 0;
}

.new-project-action-label {
  margin-bottom: 3px;

  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;

  color: #5271d8;
}

.new-project-action-title {
  font-size: 16px;
  font-weight: 700;

  color: var(--color-text-primary);
}

.new-project-action-help {
  margin-top: 3px;

  font-size: 12px;
  color: var(--color-text-secondary);
}

.new-project-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 900px) {
  .new-project-action-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .new-project-action-buttons {
    justify-content: flex-start;
  }
}



/* ===== Notification Side Popup + Action Status ===== */

.notification-action-status {
  display: inline-flex;
  align-items: center;

  width: fit-content;

  margin-top: 7px;
  padding: 3px 8px;

  border-radius: 999px;

  font-size: 9px;
  line-height: 1.3;
  font-weight: 700;
}

.notification-action-needed {
  background: #fff4d6;
  color: #9a6700;
}

.notification-action-taken {
  background: #e8f7ee;
  color: #18794e;
}

.notification-popup-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;

  z-index: 99999;

  width: min(
    380px,
    calc(100vw - 32px)
  );

  display: flex;
  flex-direction: column;
  gap: 10px;

  pointer-events: none;
}

.notification-side-popup {
  width: 100%;

  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 14px 16px;

  border: 1px solid
    var(--color-border);
  border-radius: 10px;

  background:
    var(--color-bg-primary, #fff);

  box-shadow:
    0 12px 30px
    rgba(15, 23, 42, 0.16);

  color: inherit;
  text-align: left;

  cursor: pointer;
  pointer-events: auto;

  opacity: 0;
  transform:
    translateX(24px);

  transition:
    opacity .22s ease,
    transform .22s ease;
}

.notification-side-popup.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.notification-side-popup:hover {
  transform:
    translateX(-3px);
}

.notification-side-popup-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background: #eef4ff;
  color: #2563eb;
}

.notification-side-popup-icon svg {
  width: 17px;
  height: 17px;
}

.notification-side-popup-content {
  min-width: 0;
  flex: 1;
}

.notification-side-popup-kicker {
  margin-bottom: 2px;

  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;

  color: #2563eb;
}

.notification-side-popup-title {
  display: block;

  font-size: 12px;
  line-height: 1.35;

  color:
    var(--color-text-primary);
}

.notification-side-popup-message {
  margin-top: 3px;

  font-size: 11px;
  line-height: 1.4;

  color:
    var(--color-text-secondary);
}

.notification-side-popup-close {
  margin-left: 4px;

  font-size: 17px;
  line-height: 1;

  color:
    var(--color-text-muted);
}

@media (max-width: 640px) {
  .notification-popup-stack {
    right: 16px;
    bottom: 16px;
    left: 16px;

    width: auto;
  }
}
