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

:root {
  /* Brand Colors */
  --color-primary: #8b5cf6;
  /* Electric Purple */
  --color-primary-hover: #7c3aed;
  --color-secondary: #06b6d4;
  /* Cyan */
  --color-accent: #f472b6;
  /* Pink */

  /* Backgrounds */
  --color-bg: #020617;
  /* Very dark blue/black */
  --color-surface: #0f172a;
  /* Dark blue slate */
  --color-surface-hover: #1e293b;
  --color-surface-alt: #1e293b;
  --color-sidebar-bg: rgba(15, 23, 42, 0.92);

  /* Text */
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;

  /* Borders & Overlays */
  --color-border: rgba(148, 163, 184, 0.1);
  --color-border-hover: rgba(139, 92, 246, 0.5);
  /* Purple tint */
  --color-overlay: rgba(2, 6, 23, 0.8);

  /* UI Elements */
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-glow-hover: 0 0 30px rgba(139, 92, 246, 0.3);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --gradient-surface: linear-gradient(145deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.4) 100%);
  --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.7) 100%);
  --gradient-card-border: linear-gradient(90deg, #259DCE, #2161DA, #6930A9, #D62D66);

  /* Sidebar sizing */
  --sidebar-width-expanded: 260px;
  --sidebar-width-collapsed: 72px;

  /* Z-index additions */
  --z-sidebar: 80;
  --z-sidebar-overlay: 75;
  --z-command-palette: 1100;
  --z-tooltip: 1050;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Fonts */
  --font-family-base: 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.08), transparent 25%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.analyzer-badge.duplicate-high {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.analyzer-badge.duplicate-medium {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.analyzer-badge.duplicate-low {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.analyzer-badge.duplicate-unavailable {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.duplicate-risk-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.duplicate-confirm-note {
  color: var(--color-text-muted);
  margin-bottom: 12px;
  font-size: 13px;
}

.duplicate-confirm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--gradient-surface);
}

.duplicate-confirm-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.6);
}

.duplicate-confirm-item.has-duplicate {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.duplicate-confirm-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.duplicate-confirm-match {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.duplicate-confirm-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

/* Navigation */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
}

.topnav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 20px;
  max-width: 1200px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.logo-img {
  height: 24px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.topnav nav {
  display: flex;
  gap: 8px;
}

.topnav nav a {
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.topnav nav a:hover,
.topnav nav a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.topnav nav a[aria-current="page"] {
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2);
}

/* Main nav (shared across pages) */
header .main-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
}

.main-nav .nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.main-nav .nav-brand img {
  height: 22px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.5));
}

.main-nav .nav-brand:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.main-nav .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

.main-nav .header-btn {
  color: var(--color-text-muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.main-nav .header-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.main-nav .header-btn.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25);
}

.nav-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.notification-bell .header-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-bell .header-btn .header-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.notification-bell .header-btn,
.profile-menu .profile-btn {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-bell .header-btn .header-btn-icon,
.profile-menu .profile-btn .profile-initial {
  font-size: 1rem;
  line-height: 1;
}

.profile-menu .profile-btn .chevron {
  display: none;
}

@media (max-width: 900px) {
  .hamburger-btn {
    display: inline-flex;
  }

  .main-nav {
    position: sticky;
    top: 0;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .main-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.95);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 40;
  }

  .main-nav .nav-links.is-open {
    display: flex;
  }

  .global-search {
    display: none;
  }

  .nav-actions {
    margin-left: auto;
    gap: 8px;
  }

  .notification-bell .header-btn,
  .profile-menu .profile-btn {
    padding: 8px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
  }

  .profile-btn .chevron {
    display: none;
  }

  .main-nav .header-btn {
    padding: 8px 12px;
  }
}

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  padding: 8px;
  gap: 4px;
  transition: all 0.2s ease;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.hamburger-btn.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-btn.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.org-switcher {
  position: relative;
}

.org-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.profile-menu {
  position: relative;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0;
  border-radius: 50%;
}

.profile-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-btn .chevron {
  display: none;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  min-width: 240px;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-lg);
  padding: 10px 10px 8px;
  z-index: 60;
}

.profile-summary {
  padding: 6px 6px 8px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.8);
  margin-bottom: 6px;
}

.profile-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.profile-role {
  font-size: 0.8rem;
  font-weight: 500;
  color: #e5e7eb;
}

.profile-org {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.profile-section {
  padding: 4px 4px;
}

.profile-section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
}

.profile-menu-item:hover {
  background: rgba(148, 163, 184, 0.16);
}

.profile-submenu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-submenu-toggle {
  justify-content: space-between;
  font-weight: 600;
}

.profile-submenu-chevron {
  display: inline-flex;
  align-items: center;
  transition: transform var(--transition-fast);
}

.profile-submenu-toggle[aria-expanded="true"] .profile-submenu-chevron {
  transform: rotate(90deg);
}

.profile-submenu-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 12px;
  margin-top: 4px;
}

.profile-submenu-panel[hidden] {
  display: none;
}

.profile-submenu-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.profile-submenu-section + .profile-submenu-section {
  border-top: 1px solid rgba(51, 65, 85, 0.8);
  padding-top: 8px;
}

.profile-submenu-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding-left: 2px;
}

.profile-submenu-item {
  font-size: 0.82rem;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.profile-submenu-item:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.profile-submenu-item.is-active {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.profile-submenu-item.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.profile-menu-item.danger {
  color: #fecaca;
}

.profile-footer {
  border-top: 1px solid rgba(51, 65, 85, 0.8);
  margin-top: 4px;
  padding-top: 6px;
}

.profile-menu-icon {
  width: 18px;
  text-align: center;
}

.header-btn-icon {
  font-size: 1.1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.org-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.org-btn .chevron {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.org-role-pill {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.org-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--color-surface, rgba(15, 23, 42, 0.94));
  border: 1px solid var(--color-surface-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  min-width: 240px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  max-height: min(320px, calc(100vh - 160px));
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 60;
}

.org-option {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: var(--color-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.org-option:last-child {
  border-bottom: 0;
}

.org-option:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.org-option.active {
  background: rgba(59, 130, 246, 0.12);
  border-left: 3px solid var(--color-primary);
}

.org-option .org-option-name {
  font-weight: 600;
}

.org-option .org-option-role {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.org-option.add-org {
  color: var(--color-primary);
  font-weight: 600;
}

.org-empty {
  padding: 12px;
  color: var(--color-muted);
}

/* Global Search */
.global-search {
  position: relative;
}

.search-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 0.9rem;
  width: 180px;
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input:focus {
  outline: none;
}

.search-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.search-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 8px 10px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.search-btn:hover {
  color: var(--color-primary);
}

.search-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 350px;
  max-width: 450px;
  max-height: 500px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  z-index: 70;
}

.search-suggestions,
.search-results {
  padding: 8px;
}

.search-suggestion-item,
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s ease;
}

.search-suggestion-item:hover,
.search-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-type-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

.search-suggestion-name,
.search-result-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggestion-type {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-section {
  margin-bottom: 12px;
}

.search-section-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.search-section-items {
  display: flex;
  flex-direction: column;
}

.search-item-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-item-status.status-active,
.search-item-status.status-published,
.search-item-status.status-done {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.search-item-status.status-draft,
.search-item-status.status-todo,
.search-item-status.status-open {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.search-item-status.status-in_progress,
.search-item-status.status-investigating {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.search-item-status.status-closed,
.search-item-status.status-resolved {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.search-no-results,
.search-loading,
.search-error {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.search-error {
  color: #f87171;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 20px;
}

.container.narrow {
  max-width: 600px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 20px;
}

.settings-side h1 {
  margin-bottom: 16px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-nav button {
  text-align: left;
  justify-content: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.settings-nav button.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #fff;
}

.settings-panels {
  display: grid;
  gap: 16px;
  --settings-panel-offset: 0px;
  --settings-panel-height: auto;
}

.settings-panel {
  display: none;
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  background:
    var(--gradient-card) padding-box,
    var(--gradient-card-border) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow-md);
}

.settings-panel.active {
  display: block;
}

.settings-panel[data-settings-panel="integrations"] {
  margin-top: var(--settings-panel-offset, 0px);
  height: var(--settings-panel-height, auto);
  overflow: auto;
}

.settings-org-grid {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 20px;
  align-items: start;
}

.settings-org-logo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.org-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.5);
  padding: 12px;
  text-align: center;
}

.org-logo-preview img {
  max-width: 100%;
  max-height: 120px;
  display: none;
}

.org-logo-preview.has-logo img {
  display: block;
}

.org-logo-preview.has-logo #orgLogoPlaceholder {
  display: none;
}

.integrations-actions {
  align-items: center;
  gap: 12px;
}

.inline-toast {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  color: var(--color-text);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.inline-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.inline-toast.is-success {
  border-color: rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
}

.inline-toast.is-error {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.inline-toast.is-loading {
  border-color: rgba(59, 130, 246, 0.5);
  color: #bfdbfe;
}

.inline-toast.is-info {
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--color-text);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--gradient-card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--color-text);
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-card-border);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.8;
  pointer-events: none;
}

  .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 157, 206, 0.5), rgba(105, 48, 169, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Apply gradient outline pattern to all surface blocks */
  .kpi-card,
  .stat,
  .table-container,
  .modal-content {
  position: relative;
  background: var(--gradient-card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi-card::before,
.stat::before,
.table-container::before,
.modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-card-border);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.8;
  pointer-events: none;
}

.kpi-card::after,
.stat::after,
.table-container::after,
.modal-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 157, 206, 0.5), rgba(105, 48, 169, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-hover);
  background:
    linear-gradient(var(--color-surface-hover), var(--color-surface-hover)) padding-box,
    var(--gradient-card-border) border-box;
}

.card:hover::before {
  opacity: 1;
  animation: border-chase 2.5s linear infinite;
}

  .card:hover::after {
    opacity: 1;
  }

/* Policy assemble layout overrides */
.assemble-summary,
.assemble-content {
  align-items: stretch;
  text-align: left;
  font-weight: 500;
}

.assemble-content .assemble-draft-content {
  width: 100%;
  text-align: left;
  font-weight: 400;
  line-height: 1.6;
}

.assemble-content .assemble-draft-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.assemble-content .assemble-draft-content p {
  margin: 0 0 0.85rem 0;
  text-align: left;
}

.assemble-content .assemble-draft-content ul {
  margin: 0 0 0.85rem 1.2rem;
  padding-left: 1rem;
  text-align: left;
}

.assemble-content .assemble-draft-content hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  margin: 1.75rem 0;
}

.editable-heading {
  cursor: text;
}

.editable-heading:focus {
  outline: 2px solid rgba(139, 92, 246, 0.8);
  outline-offset: 3px;
}

.kpi-card:hover::before,
.stat:hover::before,
.table-container:hover::before,
.modal-content:hover::before {
  opacity: 1;
  animation: border-chase 2.5s linear infinite;
}

.kpi-card:hover::after,
.stat:hover::after,
.table-container:hover::after,
.modal-content:hover::after {
  opacity: 1;
}

.upload-profile-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-panel {
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.info-icon:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
}

/* Static cards keep the outline but skip hover motion */
.card.card-static {
  cursor: default;
}

.card.card-static,
.card.card-static:hover {
  transform: none;
  box-shadow: none;
  background:
    var(--gradient-card) padding-box,
    var(--gradient-card-border) border-box;
}

.card.card-static::before,
.card.card-static:hover::before {
  opacity: 0;
}

.kpi-card {
  position: relative;
  display: block;
  background:
    var(--gradient-card) padding-box,
    var(--gradient-card-border) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-card-border);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.9;
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-hover);
}

.kpi-card:hover::before {
  animation: border-chase 2.5s linear infinite;
}

@keyframes border-chase {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Buttons */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-family: var(--font-family-base);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.95rem;
  gap: 8px;
}

.button:not(.secondary):not(.tertiary):not(.danger):not(.icon-btn):not(.sidebar-user-btn):not(.sidebar-toggle):not(.mobile-menu-toggle):not(.header-btn):not(.profile-btn):not(.org-btn):not(.action-btn):not(.ai-assist-btn):not(.profile-menu-item):not(.nav-item),
button:not(.secondary):not(.tertiary):not(.danger):not(.icon-btn):not(.sidebar-user-btn):not(.sidebar-toggle):not(.mobile-menu-toggle):not(.header-btn):not(.profile-btn):not(.org-btn):not(.action-btn):not(.ai-assist-btn):not(.profile-menu-item):not(.nav-item) {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.button:not(.secondary):not(.tertiary):not(.danger):not(.icon-btn):not(.sidebar-user-btn):not(.sidebar-toggle):not(.mobile-menu-toggle):not(.header-btn):not(.profile-btn):not(.org-btn):not(.action-btn):not(.ai-assist-btn):not(.profile-menu-item):not(.nav-item):hover,
button:not(.secondary):not(.tertiary):not(.danger):not(.icon-btn):not(.sidebar-user-btn):not(.sidebar-toggle):not(.mobile-menu-toggle):not(.header-btn):not(.profile-btn):not(.org-btn):not(.action-btn):not(.ai-assist-btn):not(.profile-menu-item):not(.nav-item):hover {
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
  filter: brightness(1.1);
}

.button.secondary,
button.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.button.secondary:hover,
button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-text-muted);
}

.button.danger,
button.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.button.danger:hover,
button.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.button.tertiary,
button.tertiary {
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.button.tertiary:hover,
button.tertiary:hover {
  background: rgba(139, 92, 246, 0.2);
}

/* Forms */
input,
select,
  textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  }

  /* Ensure dropdown menus stay dark themed on all selects */
  select option {
    background-color: #020617;
    color: #e5e7eb;
  }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
  background: rgba(15, 23, 42, 0.8);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  color: var(--color-text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Utilities */
.row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

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

.small-text {
  font-size: 0.875rem;
}

.text-right {
  text-align: right;
}

/* Notification Bell */
.notification-bell {
  position: relative;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--color-bg);
}

.response-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.response-chip.response-unset {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--color-text-tertiary);
}

.response-chip.response-avoid {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.response-chip.response-mitigate {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.response-chip.response-accept {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.response-chip.response-transfer {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.notification-dropdown {
  background: var(--color-sidebar-bg, var(--color-surface));
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  overflow: hidden;
  position: absolute;
  right: 0;
  top: 100%;
  width: 350px;
  margin-top: 1rem;
  z-index: 100;
}

.sidebar .notification-dropdown {
  left: 0;
  right: auto;
  width: min(340px, calc(100vw - 24px));
  max-width: calc(100vw - 32px);
}

.notification-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.notification-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-list .empty-state {
  padding: 18px 12px;
  text-align: center;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.notification-item {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.notification-item.unread {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: var(--shadow-glow);
}

.notification-item:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-glow-hover);
}

.notification-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-text);
}

.notification-title-row .notification-title-text {
  color: inherit;
}

.notification-title-row.tone-info {
  background: rgba(99, 102, 241, 0.12);
  color: #cbd5ff;
}

.notification-title-row.tone-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.notification-title-row.tone-success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.notification-title-row.tone-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.notification-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-message {
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.5;
}

.notification-entity {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.notification-entity-label {
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-dim);
}

.notification-entity-value {
  color: var(--color-text);
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid var(--color-border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--color-text);
  white-space: nowrap;
}

.notification-date-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.notification-age-chip.age-fresh {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.notification-age-chip.age-warning {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.notification-age-chip.age-stale {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecdd3;
}

.notification-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: flex-end;
}

/* Password Strength Meter */
.password-strength-container {
  margin-top: 8px;
}

.password-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

.password-strength-fill.strength-0 {
  width: 0;
  background: transparent;
}

.password-strength-fill.strength-1 {
  width: 25%;
  background: #ef4444;
}

.password-strength-fill.strength-2 {
  width: 50%;
  background: #f59e0b;
}

.password-strength-fill.strength-3 {
  width: 75%;
  background: #3b82f6;
}

.password-strength-fill.strength-4 {
  width: 100%;
  background: #22c55e;
}

.password-strength-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.password-strength-text.strength-1 {
  color: #ef4444;
}

.password-strength-text.strength-2 {
  color: #f59e0b;
}

.password-strength-text.strength-3 {
  color: #3b82f6;
}

.password-strength-text.strength-4 {
  color: #22c55e;
}

.password-requirements {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.password-requirements ul {
  margin: 4px 0 0 0;
  padding-left: 16px;
}

.password-requirements li {
  margin: 2px 0;
}

.password-requirements li.met {
  color: #22c55e;
}

.password-requirements li.unmet {
  color: var(--color-text-muted);
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

.loading-spinner.large {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.warning {
  border-left: 4px solid #f59e0b;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Branded Dialog */
.brand-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1200;
}

.brand-dialog-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.brand-dialog {
  width: min(520px, 92vw);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.brand-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-dialog-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.45));
}

.brand-dialog-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-dialog-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.brand-dialog-message {
  margin: 12px 0 18px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.brand-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.brand-dialog-info {
  border-left: 4px solid #3b82f6;
}

.brand-dialog-success {
  border-left: 4px solid #22c55e;
}

.brand-dialog-warning {
  border-left: 4px solid #f59e0b;
}

.brand-dialog-error {
  border-left: 4px solid #ef4444;
}

/* Error Pages */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* Accessibility Improvements */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Mobile Responsiveness */

/* Large screens (1440px and up) */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop (1024px - 1439px) */
@media (max-width: 1439px) {
  .container {
    max-width: 1000px;
  }
  
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .settings-shell {
    grid-template-columns: 220px 1fr;
  }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .container {
    max-width: 100%;
    padding: 1.5rem 16px;
  }
  
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .settings-shell {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .settings-side {
    order: -1;
  }
  
  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .settings-nav button {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .settings-panel[data-settings-panel="integrations"] {
    margin-top: 0;
    height: auto;
  }

  .inline-toast {
    width: 100%;
    justify-content: center;
  }

  .settings-org-grid {
    grid-template-columns: 1fr;
  }
  
  .main-nav {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  
  .main-nav .nav-links {
    order: 3;
    width: 100%;
    margin-top: 10px;
    justify-content: center;
  }
  
  .nav-actions {
    margin-left: auto;
  }
  
  .search-input {
    width: 140px;
  }
  
  .search-dropdown {
    min-width: 300px;
    right: -50px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .notification-dropdown {
    width: 300px;
  }

  .table-container {
    overflow-x: auto;
    overflow-y: hidden;
  }

  table {
    table-layout: fixed;
  }
}

/* Mobile (320px - 767px) */
@media (max-width: 767px) {
  .container {
    padding: 1rem 12px;
  }
  
  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .main-nav {
    padding: 8px 12px;
  }
  
  .main-nav .nav-brand {
    font-size: 0.9rem;
  }
  
  .main-nav .nav-brand img {
    height: 18px;
  }
  
  .main-nav .nav-links {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .main-nav .nav-links::-webkit-scrollbar {
    display: none;
  }
  
  .main-nav .header-btn {
    padding: 6px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  
  .nav-actions {
    gap: 8px;
  }
  
  .global-search {
    display: none;
  }
  
  .org-btn {
    padding: 6px 8px;
    font-size: 0.85rem;
  }
  
  .org-dropdown {
    min-width: 200px;
  }
  
  .profile-btn {
    padding: 4px 8px;
  }
  
  .profile-dropdown {
    min-width: 200px;
  }
  
  h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .settings-shell {
    padding: 1rem 12px;
  }
  
  .settings-panel {
    padding: 14px;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 10px 12px;
  }
  
  .notification-dropdown {
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 70vh;
  }
  
  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  
  .toast {
    max-width: 100%;
  }
  
  .error-code {
    font-size: 4rem;
  }
  
  .error-message {
    font-size: 1.2rem;
  }
}

/* Extra small mobile (320px) */
@media (max-width: 374px) {
  .container {
    padding: 0.75rem 8px;
  }
  
  .main-nav {
    padding: 6px 8px;
  }
  
  .main-nav .nav-brand span {
    display: none;
  }
  
  .main-nav .header-btn {
    padding: 5px 8px;
    font-size: 0.8rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .btn {
    padding: 8px 12px;
  }
  
  .org-btn .org-role-pill {
    display: none;
  }
}

/* ============================================
   Sidebar + Command Palette Layout
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width-expanded);
  min-width: 0;
  padding: 0;
  transition: margin-left var(--transition-slow);
}

.app-layout.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width-expanded);
  background: var(--color-sidebar-bg, var(--color-surface));
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}

.sidebar.notification-open {
  overflow: visible;
}

.app-layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-width-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  min-height: 64px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  overflow: hidden;
}

.sidebar-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand-icon img,
.sidebar-brand-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .sidebar-brand-text {
  opacity: 0;
  pointer-events: none;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-base);
}

.app-layout.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.nav-group {
  margin-bottom: 10px;
}

.nav-group-label {
  padding: 8px 12px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .nav-group-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 10px;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  box-shadow: none;
}

.nav-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.24) 0%, rgba(139, 92, 246, 0.2) 100%);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35), 0 8px 18px rgba(59, 130, 246, 0.18);
}

.nav-item.active[data-nav-id="news"] {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22) 0%, rgba(252, 165, 165, 0.18) 100%);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35), 0 8px 18px rgba(239, 68, 68, 0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: var(--color-primary);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.nav-item.active[data-nav-id="news"]::before {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}
.nav-item.active .nav-item-text {
  font-weight: 600;
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity var(--transition-fast);
}

.nav-item[data-nav-id="news"] {
  align-items: flex-start;
}

.nav-item[data-nav-id="news"] .nav-item-text {
  white-space: pre-line;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
}

.nav-item[data-nav-id="news"] .nav-item-icon {
  margin-top: 2px;
}

.app-layout.sidebar-collapsed .nav-item-text {
  opacity: 0;
  pointer-events: none;
}

.nav-item-badge {
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.app-layout.sidebar-collapsed .nav-item-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0;
  width: 8px;
  height: 8px;
  font-size: 0;
}

.nav-item-nested {
  padding-left: 44px;
}

.app-layout.sidebar-collapsed .nav-item-nested {
  padding-left: 12px;
}

.nav-item-parent {
  justify-content: space-between;
}

.nav-item-parent-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.nav-item-expand {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.nav-item-parent.expanded .nav-item-expand {
  transform: rotate(90deg);
}

.app-layout.sidebar-collapsed .nav-item-expand {
  opacity: 0;
  width: 0;
}

.nav-children {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-base);
  overflow: hidden;
}

.nav-children.expanded {
  grid-template-rows: 1fr;
}

.nav-children-inner {
  min-height: 0;
}

.app-layout.sidebar-collapsed .nav-children {
  position: absolute;
  left: 100%;
  top: 0;
  width: 210px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  grid-template-rows: 1fr;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
}

.nav-item-parent:hover + .nav-children,
.app-layout.sidebar-collapsed .nav-children:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.app-layout.sidebar-collapsed .nav-children .nav-item-nested {
  padding-left: 12px;
}

.nav-item-parent.has-active-child::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

.nav-item-parent.expanded.has-active-child::after {
  display: none;
}

.app-layout.sidebar-collapsed .nav-item-parent.has-active-child::after {
  right: 8px;
  top: 8px;
  transform: none;
}

.nav-item-count {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: var(--color-secondary-bg, rgba(255, 255, 255, 0.08));
  border-radius: 999px;
  color: var(--color-text-dim);
  margin-left: auto;
  transition: opacity var(--transition-fast);
}

.nav-item-parent.expanded .nav-item-count {
  opacity: 0;
  width: 0;
  padding: 0;
  margin: 0;
}

.app-layout.sidebar-collapsed .nav-item-count {
  display: none;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ai-copilot-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(6, 182, 212, 0.08));
  border-radius: 12px;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.ai-copilot-btn:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(6, 182, 212, 0.16));
  box-shadow: var(--shadow-glow-hover);
  transform: translateY(-1px);
}

.ai-copilot-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.5)); }
  50% { filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.7)); }
}

.ai-copilot-text {
  flex: 1;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .ai-copilot-text {
  opacity: 0;
  pointer-events: none;
}

.ai-copilot-kbd {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: rgba(2, 6, 23, 0.7);
  border-radius: 4px;
  color: var(--color-text-dim);
  font-family: monospace;
  transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .ai-copilot-kbd {
  opacity: 0;
}

.sidebar-profile {
  width: 100%;
  position: relative;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.sidebar-user-btn:hover {
  background: var(--color-surface-hover);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(6, 182, 212, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  transition: opacity var(--transition-fast);
}

.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.sidebar-user-chevron {
  color: var(--color-text-dim);
  transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .sidebar-user-info,
.app-layout.sidebar-collapsed .sidebar-user-chevron {
  opacity: 0;
  pointer-events: none;
}

.sidebar-profile .profile-dropdown {
  top: auto;
  bottom: calc(100% + 8px);
  right: 0;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-sidebar-overlay);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.visible {
  opacity: 1;
}

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--color-surface);
  border-radius: 12px;
  color: var(--color-text);
  cursor: pointer;
  z-index: calc(var(--z-sidebar) - 1);
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: env(safe-area-inset-bottom);
  z-index: calc(var(--z-sidebar) + 2);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.mobile-bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 14px 10px 12px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 12px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.mobile-nav-item .mobile-nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-item .mobile-nav-icon svg {
  width: 18px;
  height: 18px;
}

.mobile-nav-item.active {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.mobile-nav-item.active .mobile-nav-icon {
  color: var(--color-primary);
}

.mobile-nav-item.active[data-nav-id="news"] {
  background: rgba(239, 68, 68, 0.16);
}

.mobile-nav-item.active[data-nav-id="news"] .mobile-nav-icon {
  color: #ef4444;
}

.mobile-nav-item[data-nav-id="news"] .mobile-nav-label {
  white-space: pre-line;
  text-align: center;
  line-height: 1.1;
}

.mobile-nav-badge {
  margin-top: 2px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0 6px;
  line-height: 1.2;
}

.mobile-nav-fab {
  position: absolute;
  left: 50%;
  top: -17px;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  pointer-events: auto;
  cursor: pointer;
}

.mobile-nav-fab svg {
  width: 22px;
  height: 22px;
}

/* Command palette */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  z-index: var(--z-command-palette);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.command-palette-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.command-palette {
  width: 100%;
  max-width: 620px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
  transform: scale(0.95) translateY(-20px);
  transition: transform var(--transition-base);
}

.command-palette-overlay.is-visible .command-palette {
  transform: scale(1) translateY(0);
}

.command-palette-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.command-palette-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--color-text);
  font-family: inherit;
}

.command-palette-input::placeholder {
  color: var(--color-text-dim);
}

.command-palette-close {
  padding: 4px 8px;
  background: var(--color-surface-alt);
  border: none;
  border-radius: 4px;
  color: var(--color-text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: monospace;
}

.command-palette-body {
  max-height: 420px;
  overflow-y: auto;
}

.command-group {
  padding: 8px;
}

.command-group-label {
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.command-item:hover,
.command-item.selected {
  background: var(--color-surface-hover);
}

.command-item.selected {
  background: rgba(139, 92, 246, 0.16);
}

.command-item-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.command-item-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-text);
}

.command-item-hint {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.command-item-kbd {
  display: flex;
  gap: 4px;
}

.command-item-kbd kbd {
  padding: 2px 6px;
  background: var(--color-surface-alt);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--color-text-dim);
  font-family: monospace;
}

.command-palette.ai-mode .command-palette-header {
  border-bottom-color: rgba(139, 92, 246, 0.6);
}

.ai-suggestion {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-suggestion-icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.ai-suggestion-content h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.ai-suggestion-content p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.command-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.command-footer-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

.command-footer-hint kbd {
  padding: 2px 6px;
  background: var(--color-surface-alt);
  border-radius: 4px;
  font-family: monospace;
}

/* Tooltip */
.tooltip {
  position: fixed;
  left: calc(var(--sidebar-width-collapsed) + 8px);
  padding: 8px 12px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--color-text);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: all var(--transition-fast);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-layout.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-width-collapsed);
  }

  .app-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed);
  }

  .app-layout.sidebar-collapsed .sidebar-brand-text,
  .app-layout.sidebar-collapsed .nav-group-label,
  .app-layout.sidebar-collapsed .nav-item-text,
  .app-layout.sidebar-collapsed .nav-item-badge,
  .app-layout.sidebar-collapsed .ai-copilot-text,
  .app-layout.sidebar-collapsed .ai-copilot-kbd,
  .app-layout.sidebar-collapsed .sidebar-user-info,
  .app-layout.sidebar-collapsed .sidebar-user-chevron {
    opacity: 0;
    pointer-events: none;
  }

  .app-layout.sidebar-collapsed .nav-item-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 0;
    width: 8px;
    height: 8px;
    font-size: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width-expanded) !important;
  }

  .app-layout.mobile-nav-open .sidebar {
    transform: translateX(0);
    z-index: 10001;
  }

  .app-layout.mobile-nav-open .sidebar-overlay {
    display: block;
    z-index: 10000;
  }

  .main-content {
    margin-left: 0 !important;
    padding-top: 68px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .mobile-menu-toggle {
    display: none;
  }

  .mobile-bottom-nav {
    display: block;
  }

  .app-layout.mobile-nav-open .mobile-bottom-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
  }

  .app-layout.mobile-nav-open .mobile-bottom-nav-inner,
  .app-layout.mobile-nav-open .mobile-nav-fab {
    pointer-events: none !important;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-brand-text,
  .nav-group-label,
  .nav-item-text,
  .ai-copilot-text,
  .ai-copilot-kbd,
  .sidebar-user-info,
  .sidebar-user-chevron {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .nav-item-badge {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 2px 8px !important;
    font-size: 0.7rem !important;
  }

  .command-palette {
    margin: 16px;
    max-width: calc(100% - 32px);
  }
}

/* Print styles */
@media print {
  .main-nav,
  .nav-actions,
  .sidebar,
  .sidebar-overlay,
  .mobile-menu-toggle,
  .command-palette-overlay,
  .tooltip,
  .toast-container,
  .notification-dropdown {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
