:root {
  --primary: #a41f35; /* Burgundy */
  --primary-hover: #801829;
  --primary-light: rgba(164, 31, 53, 0.1);
  --accent: #8b5cf6; /* Violet accent */
  --secondary: #64748b; /* Slate Gray */
  --sidebar-bg: #000000;
  --white: #ffffff;
  --bg-main: #f8fafc;
  --surface: rgba(255, 255, 255, 0.7); /* For glassmorphism */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: rgba(226, 232, 240, 0.5);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --glass: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: blur(12px);
  --gradient-accent: linear-gradient(135deg, #a41f35, #8b5cf6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.sidebar {
  background: var(--sidebar-bg);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  z-index: 100;
  transition: all 0.3s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__brand {
  color: var(--white);
  font-size: 28px;
  font-weight: 800;
  padding: 0 12px 32px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__logo-container {
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.sidebar__logo {
  height: 128px;
  max-width: 100%;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav__item .icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  transform: translateX(4px);
}

.nav__item.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  box-shadow: inset 4px 0 0 var(--accent);
}

.hidden {
  display: none !important;
}

.search-shell--wide {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  gap: 24px;
}

.header-left {
  flex: 0 0 200px;
  display: flex;
  justify-content: flex-start;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-right {
  flex: 0 0 240px;
  display: flex;
  justify-content: flex-end;
}

.ai-search-container {
  width: 100%;
  max-width: 540px;
  position: relative;
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 24px;
  padding: 0 20px;
  height: 44px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-search-container:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(164, 31, 53, 0.12);
  transform: translateY(-1px);
}

.icon-btn-modern {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-btn-modern:hover {
  background: var(--bg-main);
  border-color: var(--secondary);
  color: var(--primary);
}

.icon-btn-modern .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 4px 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-trigger:hover {
  border-color: var(--secondary);
  background: var(--bg-main);
}

.avatar-mini {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}

.profile-trigger .chevron {
  width: 16px;
  height: 16px;
  fill: #94a3b8;
  transition: transform 0.2s ease;
}

.profile-trigger:hover .chevron {
  fill: var(--text-main);
}

.ai-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.sparkle-icon {
  width: 18px;
  height: 18px;
  fill: var(--primary);
  filter: drop-shadow(0 0 2px rgba(164, 31, 53, 0.3));
  animation: sparkle-glow 2s infinite ease-in-out;
}

@keyframes sparkle-glow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.ai-search-container input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  padding: 8px 0;
}

.search-shortcut {
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  margin-left: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-modern {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-modern--primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-modern--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-modern .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-plus-gradient {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #ffffff;
  border: none;
  font-size: 24px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(164, 31, 53, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-plus-gradient:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(164, 31, 53, 0.35);
  filter: brightness(1.1);
}

/* Custom Instant Tooltip (Shifted Left to avoid screen edge) */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: 120%;
  transform: translateY(-50%) translateX(10px);
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 8px;
}

.nav__item.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.3);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
}

.content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 14px 40px;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
}

.hero--searchbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  width: 100%;
  max-width: 600px;
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.search-icon {
  font-size: 16px;
  color: var(--text-muted);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-main);
}

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

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

.quick-btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
}

.quick-btn--primary {
  background: var(--primary);
  color: var(--white);
  border: none;
}

.quick-btn--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.quick-actions {
  display: flex;
  gap: 8px;
}

.quick-actions--compact {
  align-self: stretch;
  align-items: center;
}

.quick-actions--compact .icon-btn {
  margin-left: 4px;
}

.quick-actions--compact #userMenuBtn {
  margin-right: 4px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0b4a7e;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.icon-btn .icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.16);
}

.icon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

.icon-btn {
  position: relative;
}

.notification-panel {
  position: absolute;
  top: 86px;
  right: 32px;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 12px;
  padding: 14px;
  z-index: 1100;
}

.notification-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-panel__list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.notification-item {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  background: #ffffff;
}

.notification-item.unread {
  background: #eaf2ff;
  border-color: #c7dcff;
}

.notification-item strong {
  font-size: 13px;
  color: #1f3b71;
}

.notification-item span {
  font-size: 12px;
  color: var(--secondary);
}

.notification-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--secondary);
}

.intake-wizard {
  max-width: 860px;
}

.wizard-steps {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px auto 32px;
  max-width: 420px;
  width: 100%;
}

.wizard-step-line {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
  border-radius: 2px;
}

.wizard-step-progress {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 2px;
}

.wizard-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

.wizard-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.wizard-step-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  transition: color 0.3s ease;
  text-align: center;
}

/* Active State */
.wizard-step.active .wizard-step-circle {
  border-color: var(--primary);
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(164, 31, 53, 0.15);
  transform: scale(1.05);
}

.wizard-step.active .wizard-step-label {
  color: var(--primary);
  font-weight: 700;
}

/* Completed State */
.wizard-step.done .wizard-step-circle {
  border-color: #8b5cf6 !important;
  background: #8b5cf6 !important;
  color: #ffffff !important;
}

.wizard-step.done .wizard-step-label {
  color: #7c3aed;
}

/* Sliding Panels Viewport */
.wizard-body {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 12px;
}

.wizard-panels-wrapper {
  display: flex;
  width: 300%;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.wizard-panel {
  width: 33.333%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 8px 4px;
}

.review-grid {
  display: grid;
  gap: 10px;
  padding: 8px 4px;
}

.review-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.review-row span {
  color: #64748b;
}

.pill:hover,
.quick-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.quick-btn {
  background: #f5f7fa;
  color: var(--primary);
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.quick-btn--primary {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--primary);
}

.search-results {
  position: fixed;
  width: 360px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  z-index: 40;
  color: var(--text);
  font-size: 13px;
}

.search-preview__item {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.search-preview__item:hover {
  background: rgba(93, 99, 129, 0.06);
}

.search-preview__item mark {
  background: #fde68a;
  color: #0f172a;
  padding: 0 2px;
  border-radius: 4px;
}

.search-preview__title {
  font-weight: 600;
  color: #0f172a;
}

.search-preview__meta {
  font-size: 12px;
  color: #64748b;
}

.search-preview__badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(93, 99, 129, 0.08);
  color: #1f3b71;
}

.search-preview__empty {
  color: #64748b;
  font-size: 13px;
  padding: 8px 4px;
}

main {
  padding: 32px;
  flex: 1;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-weight: 700;
  color: var(--text-main);
  font-size: 18px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.metric {
  grid-column: span 4;
}

.wide {
  grid-column: span 8;
}

.full {
  grid-column: span 12;
}

.placeholder {
  padding: 32px 24px;
  color: var(--muted);
}

.placeholder h2 {
  margin-top: 0;
  color: var(--text);
}

.leads-view {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contacts-view {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contacts-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.contacts-actions {
  display: flex;
  gap: 8px;
}

.contacts-filters {
  display: flex;
  gap: 16px;
  color: var(--secondary);
  font-size: 13px;
}

.leads-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.leads-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.leads-actions .pill,
.leads-actions .cta,
.leads-actions button {
  margin-top: 0;
  padding: 8px 12px;
  font-size: 13px;
  width: auto;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tabs--soft .tab {
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: #fff;
  color: var(--muted);
}

.tabs--soft .tab.active {
  background: #e6f1ff;
  color: var(--primary);
  border-color: #bcd7ff;
}

.leads-filters {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.leads-filters.hidden {
  display: none;
}

.leads-filters .filter-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leads-filters input,
.leads-filters select,
.leads-filters button {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.leads-filters {
  flex-wrap: wrap;
}

#leadsStatus {
  min-height: 20px;
}

#leadsStatus.error-text {
  color: #c0392b;
}

.error-text {
  color: #c0392b;
}

#leadsPagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

#leadsPagination .leads-page-label {
  font-size: 13px;
  color: var(--secondary);
}

#contactsPagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

#contactsPagination .contacts-page-label {
  font-size: 13px;
  color: var(--secondary);
}

.error-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.error-list li {
  margin: 2px 0;
}

.leads-table {
  --leads-row-height: 88px;
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.leads-table-wrap {
  height: min(65vh, 640px);
  max-height: min(65vh, 640px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.leads-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.leads-table tbody tr {
  height: var(--leads-row-height);
}

.leads-view #lsaLeadsPanel {
  display: none;
}

.leads-view.leads-view--lsa #lsaLeadsPanel {
  display: block;
}

.lsa-panel--leads {
  margin-top: 12px;
}

.lsa-panel--leads .lsa-table select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
}

.lsa-action-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.lsa-audio--inline {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.leads-table th,
.leads-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.name-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(93, 99, 129, 0.08);
  color: #0f172a;
}

.conflict-badge--clear {
  background: #f5f3ff;
  color: #7c3aed;
}

.conflict-badge--possible {
  background: #fef3c7;
  color: #92400e;
}

.conflict-badge--confirmed {
  background: #fee2e2;
  color: #991b1b;
}

.leads-table td .muted.small {
  display: block;
}

.chip--conflict {
  background: rgba(93, 99, 129, 0.08);
  color: #0f172a;
}

.chip--conflict-clear {
  background: #f5f3ff;
  color: #7c3aed;
}

.chip--conflict-possible {
  background: #fef3c7;
  color: #92400e;
}

.chip--conflict-confirmed {
  background: #fee2e2;
  color: #991b1b;
}

.sla-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(93, 99, 129, 0.08);
  color: #0f172a;
  margin-top: 6px;
}

.sla-badge--ok {
  background: #f5f3ff;
  color: #7c3aed;
}

.sla-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.sla-badge--late {
  background: #fee2e2;
  color: #991b1b;
}

.name-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lead-tag {
  margin-left: auto;
  background: #eef4ff;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid #d5e5ff;
}

.leads-table input,
.leads-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.leads-table th {
  text-align: left;
  background: #f9fbff;
  color: var(--secondary);
  font-weight: 700;
}

.leads-table tr:hover {
  background: #f3f8ff;
}


.badge {
  background: #fdecc8;
  color: #b57f1b;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 8px;
  font-weight: 700;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 6px;
  padding: 6px;
  background: #fff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f3f6fb;
  color: var(--primary);
  border: 1px solid rgba(93, 99, 129, 0.2);
  font-weight: 700;
}

.status-intake {
  border-left: 4px solid #f5a524;
}

.avatar-dot {
  width: 10px;
  height: 10px;
  background: #f5a524;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.pipeline {
  padding: 16px;
}

.pipeline__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
}

.tab {
  border: none;
  background: transparent;
  padding: 10px 18px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: var(--primary);
  border-color: var(--primary);
}

.pipeline__actions .pill {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.pipeline__banner {
  background: #f6f0ff;
  border: 1px solid #d9c6ff;
  color: #5d3fa3;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.pipeline__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.column {
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.column__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.column__title {
  font-weight: 700;
  color: #22324b;
}

.column__meta {
  font-size: 12px;
  color: var(--muted);
}

.column__count {
  font-weight: 700;
  color: #22324b;
}

.column__empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.card--compact {
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  padding: 12px;
  margin-bottom: 10px;
}

.card__title {
  font-weight: 700;
  color: #1f3b71;
}

.profile-link {
  cursor: pointer;
  text-decoration: underline;
}

.card__meta {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0;
}

.link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.chip {
  display: inline-block;
  background: #ede7ff;
  color: #6b4bdc;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chip--success {
  background: #f5f3ff;
  color: #7c3aed;
}

.chip--warning {
  background: #fef3c7;
  color: #92400e;
}

.chip--soft {
  background: #e0f2fe;
  color: #075985;
}

.chip--primary {
  background: rgba(164, 31, 53, 0.12);
  color: #1d4ed8;
}

.chip--ghost {
  background: rgba(93, 99, 129, 0.06);
  color: #64748b;
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
}

.icons {
  display: flex;
  gap: 8px;
  color: var(--muted);
}
.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 8px;
}

.card__header select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
}

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

.metric__value {
  font-size: 26px;
  font-weight: 700;
}

.metric__trend {
  font-size: 12px;
}

.metric__trend.bad {
  color: #e05666;
}

.metric__trend.good {
  color: #8b5cf6;
}

.ring-chart {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0deg 270deg, rgba(0, 0, 0, 0.05) 270deg 360deg);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}

.ring-chart--small {
  width: 120px;
  height: 120px;
}

.ring-chart__inner {
  width: 60%;
  height: 60%;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary);
}

.legend-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.legend-col {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.blue { background: var(--primary); }
.dot.purple { background: #7c8cff; }
.dot.teal { background: #38bdf8; }
.dot.navy { background: #2c5282; }
.dot.gray { background: #d8e2ec; }

.bar-list {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr 5fr 80px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar {
  background: #eef3f9;
  border-radius: 8px;
  overflow: hidden;
  height: 14px;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7c8cff);
}

.bar-num {
  text-align: right;
  color: var(--muted);
}

.line-placeholder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

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

.dash-grid--full {
  grid-template-columns: repeat(12, 1fr);
}

.card--wide {
  grid-column: span 12;
}

.card--split {
  grid-column: span 12;
}

.card--full {
  grid-column: span 12;
}

.agenda-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.agenda-box {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.agenda-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.agenda-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.agenda-count__num {
  font-size: 18px;
  font-weight: 800;
}

.agenda-count__label {
  font-size: 12px;
  color: var(--secondary);
}

.agenda-text {
  color: var(--secondary);
  font-size: 13px;
}

.hourly-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.hourly-chart {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 12px;
  align-items: start;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.chart-title {
  font-weight: 700;
  text-align: center;
}

.chart-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.chart-tabs .pill {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0.01em;
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-tabs .pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chart-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 10px solid rgba(93, 99, 129, 0.08);
  display: grid;
  place-items: center;
  margin: 0 auto;
  box-shadow: inset 0 0 0 6px #ffffff;
}

.chart-circle__value {
  font-size: 18px;
  font-weight: 800;
}

.chart-circle__sub {
  color: var(--secondary);
}

.dashboard-billing {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  align-content: start;
}

.dashboard-billing__row {
  display: contents;
}

.dashboard-billing__card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
  min-height: 92px;
}

.dashboard-billing__title {
  font-weight: 700;
  font-size: 13px;
}

.dashboard-billing__value {
  color: #2563eb;
  font-weight: 800;
  font-size: 16px;
}

.dashboard-billing__card a {
  line-height: 1.3;
}

@media (max-width: 1100px) {
  .hourly-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-billing {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.intake-scorecards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.intake-scorecard {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.intake-scorecard:hover {
  transform: translateY(-2px);
  border-color: #cfe2ff;
  box-shadow: 0 16px 30px rgba(15, 27, 45, 0.12);
}

.intake-scorecard__label {
  font-size: 12px;
  color: var(--secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.intake-scorecard__value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.intake-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.intake-chart {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
  min-height: 220px;
}

.intake-chart__title {
  font-weight: 700;
  font-size: 13px;
}

.intake-bar-chart {
  height: 160px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(93, 99, 129, 0.08), #ffffff);
  position: relative;
  overflow: hidden;
  align-content: stretch;
  padding: 10px 12px 8px;
}

.intake-line-chart {
  height: 160px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, rgba(93, 99, 129, 0.08));
  position: relative;
  overflow: hidden;
}

.intake-funnel {
  height: 160px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--primary), var(--primary));
}

@media (max-width: 1024px) {
  .intake-charts {
    grid-template-columns: 1fr;
  }

  .intake-bar-chart,
  .intake-funnel {
    height: 200px;
  }

  .intake-line-chart {
    height: 220px;
  }
}

.intake-bar-chart,
.intake-line-chart,
.intake-funnel {
  display: grid;
  align-content: end;
  padding: 12px;
  gap: 6px;
}

.intake-bar-chart {
  align-content: stretch;
}

.intake-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12px, 1fr));
  gap: 8px;
  align-items: end;
  height: 100%;
}

.intake-bar {
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  min-height: 6px;
}

.intake-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--secondary);
}

.intake-bar-axis {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  height: 100%;
  align-items: stretch;
}

.intake-bar-y {
  display: grid;
  align-content: space-between;
  justify-items: end;
  font-size: 10px;
  color: var(--secondary);
  padding: 0 0 18px;
  border-right: 1px solid #d7e2ee;
}

.intake-bar-plot {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  border-bottom: 1px solid #d7e2ee;
  padding-bottom: 0;
  height: 100%;
}

.intake-bar-grid {
  position: relative;
  height: 100%;
  padding: 0 4px 2px;
  background:
    repeating-linear-gradient(
      to top,
      rgba(15, 111, 191, 0.08),
      rgba(15, 111, 191, 0.08) 1px,
      transparent 1px,
      transparent 20%
    );
  border-radius: 8px;
}

.intake-funnel {
  align-content: stretch;
  padding: 10px 12px;
}

.intake-tooltip {
  position: absolute;
  z-index: 5;
  padding: 6px 10px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

.field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.intake-line {
  height: 100%;
  border-radius: 10px;
  background: repeating-linear-gradient(
      180deg,
      rgba(93, 99, 129, 0.06),
      rgba(93, 99, 129, 0.06) 20px,
      rgba(93, 99, 129, 0.08) 20px,
      rgba(93, 99, 129, 0.08) 22px
    ),
    linear-gradient(120deg, rgba(15, 111, 191, 0.4), rgba(15, 111, 191, 0.05));
}

.intake-line__plot {
  height: 100%;
  border-radius: 10px;
  background: repeating-linear-gradient(
      180deg,
      rgba(93, 99, 129, 0.06),
      rgba(93, 99, 129, 0.06) 20px,
      rgba(93, 99, 129, 0.08) 20px,
      rgba(93, 99, 129, 0.08) 22px
    ),
    linear-gradient(120deg, rgba(15, 111, 191, 0.18), rgba(15, 111, 191, 0.03));
  padding: 6px;
}

.intake-line__plot svg {
  width: 100%;
  height: 100%;
}

.intake-line__area {
  fill: rgba(15, 111, 191, 0.04);
}

.intake-line__path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.intake-funnel-steps {
  display: grid;
  gap: 6px;
  width: 100%;
}

.intake-funnel-step {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 8px;
  color: #fff;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

.metric-drilldown {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.metric-drilldown__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e6edf5;
  background: #ffffff;
  font-size: 13px;
}

.metric-drilldown__row strong {
  font-weight: 700;
}

.metric-drilldown__table {
  display: grid;
  gap: 6px;
}

.metric-drilldown__header,
.metric-drilldown__item {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 10px;
  align-items: center;
}

.metric-drilldown__header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.metric-drilldown__item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e6edf5;
  background: #ffffff;
  font-size: 13px;
}

.metric-drilldown__pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.metric-link {
  justify-self: end;
}

.conflict-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.conflict-label {
  font-weight: 600;
}

.conflict-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(93, 99, 129, 0.08);
  color: #0f172a;
}

.conflict-pill--clear {
  background: #f5f3ff;
  color: #7c3aed;
}

.conflict-pill--possible {
  background: #fef3c7;
  color: #92400e;
}

.conflict-pill--confirmed {
  background: #fee2e2;
  color: #991b1b;
}

.conflict-meta {
  color: var(--secondary);
  font-size: 12px;
  margin-bottom: 8px;
}

.conflict-list {
  display: grid;
  gap: 8px;
}

.conflict-item {
  border: 1px solid #e6edf5;
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
  font-size: 12px;
  display: grid;
  gap: 4px;
}

.conflict-item__title {
  font-weight: 700;
  color: #0f172a;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid #e6edf5;
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
  display: grid;
  gap: 6px;
}

.history-item__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.history-status {
  font-weight: 700;
  text-transform: capitalize;
  color: #0f172a;
}

.history-note {
  font-size: 12px;
  color: var(--secondary);
}

.fin-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.fin-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.fin-bar {
  height: 120px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--primary), var(--primary));
}

.fin-bar--small { width: 70%; }
.fin-bar--medium { width: 80%; }
.fin-bar--large { width: 90%; }
.fin-bar--xl { width: 95%; }

.line-chart-placeholder {
  width: 100%;
  height: 240px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, rgba(93, 99, 129, 0.06));
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.line-chart-placeholder--wide {
  height: 260px;
}

.firm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 0;
}

.firm-filters {
  display: flex;
  gap: 8px;
}

.firm-filters select {
  padding: 8px 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.firm-section {
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  margin: 10px 16px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

/* Reports */
.reports-view {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.reports-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary));
  color: #fff;
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 27, 45, 0.2);
}

.reports-hero h2 {
  margin: 0 0 4px;
}

.reports-hero .muted {
  color: rgba(255, 255, 255, 0.82);
}

.reports-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reports-toolbar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  align-items: end;
}

.reports-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.reports-filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.reports-filters select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #0f172a;
}

.reports-search {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font-size: 14px;
}

.report-sections {
  display: grid;
  gap: 18px;
}

.report-section {
  background: #ffffff;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.report-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
  min-height: 180px;
}

.report-card h4 {
  margin: 0;
}

.report-card p {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
}

.report-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.report-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--secondary);
}

.builder-shell {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(15, 27, 45, 0.1);
  display: grid;
  gap: 16px;
}

.builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.builder-grid {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 12px;
}

.builder-panel {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 10px;
  align-content: start;
}

.builder-panel h4 {
  margin: 0;
}

.builder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.builder-chip {
  border: 1px solid #d9e4f2;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  font-size: 12px;
}

.builder-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.builder-canvas {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  background: #f9fbff;
  display: grid;
  gap: 12px;
}

.canvas-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.canvas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.canvas-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(15, 27, 45, 0.06);
}

.canvas-card--wide {
  grid-column: span 2;
}

.canvas-title {
  font-weight: 700;
  font-size: 13px;
}

.canvas-placeholder {
  height: 120px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(93, 99, 129, 0.08), #ffffff);
}

.canvas-placeholder--short {
  height: 90px;
}

.canvas-placeholder--table {
  height: 140px;
  background: repeating-linear-gradient(
    180deg,
    #ffffff,
    #ffffff 16px,
    rgba(93, 99, 129, 0.08) 16px,
    rgba(93, 99, 129, 0.08) 18px
  );
}

@media (max-width: 1100px) {
  .reports-toolbar {
    grid-template-columns: 1fr;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .canvas-card--wide {
    grid-column: span 1;
  }
}

/* Users */
.users-view {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.users-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary));
  color: #fff;
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 27, 45, 0.2);
}

.users-hero h2 {
  margin: 0 0 4px;
}

.users-hero .muted {
  color: rgba(255, 255, 255, 0.82);
}

.users-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.users-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
}

.users-left,
.users-right {
  display: grid;
  gap: 12px;
}

.users-right .users-card {
  align-content: start;
}

.users-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.users-card {
  display: grid;
  gap: 12px;
}

.user-form {
  display: grid;
  gap: 10px;
}

.user-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.user-form input,
.user-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.user-form__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.user-form #userCreateStatus {
  min-height: 18px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e6edf5;
}

.user-name {
  font-weight: 700;
}

.user-pill {
  font-size: 12px;
  font-weight: 700;
  background: rgba(93, 99, 129, 0.08);
  color: #0f172a;
  padding: 6px 10px;
  border-radius: 999px;
}

.user-pill--primary {
  background: var(--primary);
  color: #fff;
}

.role-matrix {
  display: grid;
  gap: 10px;
}

.role-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e6edf5;
  background: #ffffff;
}

.role-name {
  font-weight: 700;
}

.role-caps {
  color: var(--secondary);
  font-size: 13px;
}

.policy-list {
  display: grid;
  gap: 10px;
}

.policy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e6edf5;
  background: #ffffff;
}

.policy-title {
  font-weight: 700;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.permission-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: #ffffff;
}

.permission-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #0f172a;
}

.permission-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.users-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.users-search {
  flex: 1;
  min-width: 220px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font-size: 14px;
}

.users-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.users-filters select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: #0f172a;
}

.user-table {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  overflow: hidden;
}

.user-table__header,
.user-table__row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.6fr 0.8fr 0.8fr;
  gap: 10px;
  padding: 10px 12px;
  align-items: center;
}

.user-table__header {
  background: rgba(93, 99, 129, 0.06);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.user-table__row {
  background: #fff;
  border-top: 1px solid #e6edf5;
}

.user-table__row.is-selected {
  background: #eef6ff;
  border-color: #cfe2ff;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: capitalize;
  background: rgba(93, 99, 129, 0.08);
  color: #0f172a;
}

.status-pill.status-active {
  background: #f5f3ff;
  color: #7c3aed;
}

.status-pill.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.status-disabled {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 1100px) {
  .users-shell {
    grid-template-columns: 1fr;
  }
}

/* Settings */
.settings-view {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.settings-hero {
  background: #ffffff;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  padding: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.integrations-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 16px;
}

.integrations-hero h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.integrations-hero p {
  margin: 4px 0 0;
}

.integrations-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.integrations-hero__actions .pill {
  padding: 10px 14px;
  font-weight: 700;
}

.integrations-hero__actions .pill.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.integrations-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 0 16px;
}

.integrations-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.integrations-tabs .tab {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #fff;
}

.integrations-tabs .tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.integrations-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.integrations-tools .pill {
  font-size: 12px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: #64748b;
}

.input-with-icon input {
  padding: 10px 12px 10px 34px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  background: #fff;
  min-width: 220px;
}

.integration-list {
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
  margin: 0 16px 16px;
}

.integration-list__header,
.integration-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(90px, 0.6fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(150px, 0.9fr) minmax(150px, 0.9fr) minmax(110px, 0.5fr);
  gap: 10px;
  align-items: center;
}

.integration-list__header {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: rgba(93, 99, 129, 0.06);
  border-bottom: 1px solid rgba(93, 99, 129, 0.08);
}

.integration-list__body {
  display: grid;
}

.integration-row {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(93, 99, 129, 0.08);
  background: #fff;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.integration-row:hover {
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(164, 31, 53, 0.12);
}

.integration-row:last-child {
  border-bottom: none;
}

.integration-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
}

.integration-subtext {
  font-size: 12px;
  color: #64748b;
}

.integration-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.integration-empty {
  padding: 16px;
  border-bottom: 1px solid rgba(93, 99, 129, 0.08);
  color: #64748b;
  background: #ffffff;
}

.workflow-builder {
  margin: 0 16px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 27, 45, 0.08);
  overflow: hidden;
}

.workflow-builder__topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(93, 99, 129, 0.08);
  background: #ffffff;
}

.workflow-builder__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.workflow-builder__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.workflow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(93, 99, 129, 0.06);
  border: 1px solid rgba(93, 99, 129, 0.08);
  font-size: 12px;
  color: #64748b;
}

.toggle-btn {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  position: relative;
}

.toggle-btn::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}

.toggle-btn[aria-pressed="false"] {
  background: #cbd5f5;
}

.toggle-btn[aria-pressed="false"]::after {
  left: 2px;
}

.workflow-builder__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(93, 99, 129, 0.08);
}

.workflow-builder__tabs {
  display: flex;
  gap: 16px;
}

.workflow-canvas {
  position: relative;
  min-height: 560px;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.3) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 24px;
}

.workflow-pane {
  min-height: 560px;
}

.workflow-settings {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.workflow-settings__header h3 {
  margin: 0 0 6px;
}

.workflow-settings__card {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 27, 45, 0.05);
}

.workflow-setting {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.workflow-setting__row {
  display: grid;
  gap: 8px;
}

.workflow-setting__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workflow-setting__label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.toggle {
  position: relative;
  width: 38px;
  height: 20px;
  display: inline-flex;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(93, 99, 129, 0.08);
  transition: background 0.2s ease;
}

.toggle__slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle__slider {
  background: var(--primary);
}

.toggle input:checked + .toggle__slider::after {
  transform: translateX(18px);
}

.workflow-empty {
  padding: 24px;
  color: #64748b;
}

.workflow-rail {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workflow-graph {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
  justify-items: center;
}

.workflow-add {
  position: absolute;
  right: 24px;
  top: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  box-shadow: 0 10px 18px rgba(15, 27, 45, 0.08);
}

.workflow-add select {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
}

.workflow-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid rgba(93, 99, 129, 0.08);
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: -10px 0 24px rgba(15, 27, 45, 0.08);
}

.workflow-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(93, 99, 129, 0.08);
}

.workflow-panel__body {
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow: auto;
}

.workflow-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(93, 99, 129, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workflow-panel__actions {
  display: flex;
  gap: 8px;
}

.workflow-panel__label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.workflow-panel__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.workflow-panel__notice {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  display: grid;
  gap: 4px;
}

.workflow-panel textarea,
.workflow-panel input,
.workflow-panel select {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.workflow-node {
  width: 260px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 27, 45, 0.08);
}

.workflow-node--ghost {
  border-style: dashed;
  background: #ffffff;
  color: #64748b;
  text-align: center;
}

.workflow-node__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workflow-connector {
  width: 2px;
  height: 24px;
  background: #dbe3ee;
}

.workflow-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workflow-node--branch {
  width: 240px;
}

.workflow-end {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: #ffffff;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 1024px) {
  .workflow-builder__topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .workflow-builder__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workflow-builder__nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .workflow-graph {
    max-width: 100%;
  }

  .workflow-branches {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  display: grid;
  gap: 12px;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.settings-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.settings-form input {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.settings-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e6edf5;
  background: #ffffff;
}

.settings-title {
  font-weight: 700;
}


.firm-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.firm-actions {
  display: flex;
  gap: 6px;
}

.firm-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
  align-items: start;
}

.firm-gauge {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.gauge-ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: #0f172a;
  font-weight: 800;
}

.gauge-ring--pink {
  border: 10px solid #fce7f3;
  box-shadow: inset 0 0 0 6px #fff;
}

.gauge-ring--teal {
  border: 10px solid #f5f3ff;
  box-shadow: inset 0 0 0 6px #fff;
}

.gauge-ring--gray {
  border: 10px solid #e5e7eb;
  box-shadow: inset 0 0 0 6px #fff;
}

.gauge-value {
  font-size: 22px;
}

.gauge-sub {
  font-size: 12px;
  color: var(--secondary);
}

.gauge-totals {
  display: grid;
  gap: 6px;
}

.total-figure {
  font-weight: 800;
}

.firm-chart {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 0;
}

.feed-filters {
  display: flex;
  gap: 8px;
}

.feed-filters input,
.feed-filters select {
  padding: 8px 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.feed-list {
  margin: 12px 16px 16px;
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.feed-item {
  display: grid;
  grid-template-columns: 60px 1fr 140px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f6;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.feed-item:hover {
  background: #f7fbff;
  border-color: #d0e6ff;
  box-shadow: inset 2px 0 0 var(--primary);
}

/* Calendar */
.calendar-view {
  padding: 12px 16px 24px;
}

.calendar-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.calendar-sidebar {
  display: grid;
  gap: 16px;
}

.calendar-sidebar .cta--wide {
  width: 100%;
}

.mini-calendar {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.mini-calendar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 8px;
}

.mini-calendar__nav {
  display: flex;
  gap: 6px;
}

.mini-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.mini-calendar__day {
  text-align: center;
  font-size: 11px;
  color: var(--secondary);
  font-weight: 700;
}

.mini-date {
  border: none;
  background: #ffffff;
  color: var(--secondary);
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  cursor: pointer;
}

.mini-date:hover {
  background: #e6f1ff;
}

.mini-date.muted {
  color: #9aa9bc;
  background: #f3f6fb;
}

.mini-date.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.mini-date.active {
  background: rgba(164, 31, 53, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.calendar-group {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 26px rgba(15, 27, 45, 0.08);
}

.calendar-group__title {
  font-weight: 700;
  color: var(--secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #22324b;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.calendar-option--stack {
  display: grid;
  gap: 6px;
}

.calendar-option--stack select {
  width: 100%;
}

.calendar-option input {
  accent-color: var(--primary);
}

.calendar-option:hover {
  background: #eef5ff;
  border-color: #cfe2ff;
  transform: translateY(-1px);
}

.calendar-option input {
  width: 16px;
  height: 16px;
}

.calendar-option .dot {
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 2px rgba(15, 27, 45, 0.06);
}

.dot--blue { background: var(--primary); }
.dot--teal { background: #38bdf8; }
.dot--orange { background: #f59e0b; }
.dot--purple { background: #7c8cff; }

.calendar-main {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px 16px 20px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9eef5;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-nav__arrows {
  display: flex;
  gap: 6px;
}

.calendar-title {
  font-size: 18px;
  font-weight: 800;
}

.calendar-actions {
  display: flex;
  gap: 6px;
}

.calendar-panel {
  display: none;
  margin-top: 16px;
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
}

.calendar-grid__header {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-cell {
  border: 1px solid #e6edf5;
  border-radius: 10px;
  padding: 8px;
  min-height: 110px;
  background: #fafcff;
  display: grid;
  gap: 6px;
  align-content: start;
}

.calendar-cell span {
  font-weight: 700;
  font-size: 12px;
  color: var(--secondary);
}

.calendar-cell.muted {
  background: #f6f8fb;
  color: #9aa9bc;
}

.calendar-cell.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(164, 31, 53, 0.4);
}

.calendar-cell.selected {
  background: #eef6ff;
  border-color: #9cc7ff;
}

.event-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(93, 99, 129, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  cursor: pointer;
}

.event-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 27, 45, 0.18);
  filter: saturate(1.05);
}

.event-pill--blue { background: rgba(164, 31, 53, 0.12); color: var(--primary); }
.event-pill--teal { background: #f5f3ff; color: #0f766e; }
.event-pill--orange { background: #ffedd5; color: #9a3412; }
.event-pill--purple { background: #ede9fe; color: #5b21b6; }

.calendar-week__header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
}

.calendar-week__header .today {
  color: var(--primary);
}

.calendar-week__grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
  position: relative;
}

.time-col {
  display: grid;
  gap: 28px;
  font-size: 12px;
  color: var(--secondary);
}

.week-col,
.day-col {
  border: 1px solid #e6edf5;
  border-radius: 10px;
  min-height: 320px;
  position: relative;
  background: #ffffff;
  padding-top: 6px;
}

.event-block {
  position: absolute;
  left: 6px;
  right: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 27, 45, 0.12);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  cursor: pointer;
}

.event-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 27, 45, 0.2);
  filter: saturate(1.05);
}

.calendar-day__header {
  font-weight: 700;
  margin-bottom: 10px;
}

.calendar-day__grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
}

.agenda-list {
  display: grid;
  gap: 12px;
}

.agenda-item {
  display: grid;
  gap: 8px;
}

.agenda-date {
  font-size: 12px;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agenda-card {
  border: 1px solid #e6edf5;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  background: #ffffff;
}

.agenda-meta {
  font-size: 12px;
  color: var(--secondary);
}

.calendar-modal {
  max-width: 720px;
}

.calendar-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.calendar-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.calendar-form input,
.calendar-form select,
.calendar-form textarea {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.calendar-form textarea {
  resize: vertical;
  min-height: 90px;
}

.calendar-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.modal__status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--secondary);
}

.modal__status.error {
  color: #b42318;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--secondary);
}

.upload-status .status-text {
  line-height: 1.4;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(93, 99, 129, 0.2);
  border-top-color: #7b1e2b;
  animation: spin 0.8s linear infinite;
}

.spinner.hidden {
  display: none;
}

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

.calendar-detail {
  max-width: 420px;
  width: min(420px, 92vw);
  position: relative;
}

.calendar-detail__body {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.calendar-detail__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary);
}

.calendar-detail__meta {
  color: var(--secondary);
  font-size: 13px;
}

.calendar-detail__row {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.calendar-detail__row .label {
  font-weight: 700;
  color: var(--secondary);
}

.task-modal {
  max-width: 680px;
}

.task-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.task-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.task-form input,
.task-form select,
.task-form textarea {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.task-form textarea {
  resize: vertical;
  min-height: 110px;
}

.task-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.pipeline-modal {
  max-width: 720px;
}

.pipeline-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.pipeline-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.pipeline-form input,
.pipeline-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.pipeline-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

/* Tasks */
.tasks-view {
  padding: 12px 16px 24px;
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.tasks-header h2 {
  margin: 0;
}

.tasks-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tasks-tabs {
  display: flex;
  gap: 6px;
}

.tasks-board {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(0, 320px);
  gap: 16px;
  align-items: start;
}

.tasks-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.tasks-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.tasks-filters {
  display: grid;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.tasks-filters label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.tasks-filters select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #ffffff;
}

.tasks-quick {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tasks-quick.highlight {
  border-color: #9cc7ff;
  box-shadow: 0 0 0 3px rgba(164, 31, 53, 0.2), 0 10px 24px rgba(15, 27, 45, 0.08);
}

.tasks-quick__title {
  font-weight: 700;
  font-size: 13px;
}

.tasks-quick input,
.tasks-quick select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #ffffff;
}

.tasks-quick__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tasks-list {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.tasks-list__header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.8fr;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  border-bottom: 1px solid #e6edf5;
}

.tasks-list__body {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 560px;
  overflow: auto;
}

.task-card {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.8fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e6edf5;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.task-actions-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 10px 20px rgba(15, 27, 45, 0.12);
}

.task-card.active {
  border-color: var(--primary);
  background: #eef6ff;
}

.task-title {
  font-weight: 700;
  color: var(--secondary);
}

.task-meta {
  font-size: 12px;
  color: var(--secondary);
}

.task-matter-field {
  position: relative;
}

.task-matter-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 27, 45, 0.12);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 20;
}

.task-matter-suggest.hidden {
  display: none;
}

.task-matter-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-matter-option:hover {
  background: #f2f5fa;
  border-color: #d8e1ef;
}

.task-matter-option__meta {
  font-size: 11px;
  color: #7a8399;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.task-pill.high { background: #fee2e2; color: #991b1b; }
.task-pill.medium { background: #e0f2fe; color: #075985; }
.task-pill.low { background: #f5f3ff; color: #7c3aed; }

.task-detail {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  display: grid;
  gap: 12px;
  min-width: 0;
}

.task-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.task-detail__title {
  font-weight: 800;
  font-size: 16px;
}

.task-detail__status {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.task-detail__meta {
  font-size: 12px;
  color: var(--secondary);
}

.task-detail__section {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.task-detail__section textarea {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.task-detail__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.task-detail__row select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #ffffff;
}

.task-detail__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pipeline */
.pipeline-view {
  padding: 12px 16px 24px;
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.pipeline-header h2 {
  margin: 0;
}

.pipeline-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-filters input,
.pipeline-filters select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.pipeline-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pipeline-metrics .metric-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pipeline-metrics .metric-card:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.12);
}

.metric-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.06);
}

.metric-label {
  font-size: 12px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.metric-value {
  font-size: 20px;
  font-weight: 800;
  margin: 6px 0;
  color: var(--secondary);
}

.metric-meta {
  font-size: 12px;
  color: var(--secondary);
}

.pipeline__columns--wide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.pipeline__columns .column {
  background: #f6f9fd;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 240px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pipeline-view .column__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.pipeline-view .column__header {
  align-items: flex-start;
  min-height: 44px;
}

.pipeline-view .column__header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-view .column__header .chip {
  margin-top: 2px;
}

.pipeline-view .column__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(93, 99, 129, 0.08);
}

.pipeline-view .column__page {
  font-size: 12px;
  color: #64748b;
}

.pipeline__columns .column.drag-over {
  border-color: #9cc7ff;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(164, 31, 53, 0.25);
}

.pipeline__columns .column.drop-confirm {
  border-color: #34d399;
  background: #f5f3ff;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}

.column__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.column__title {
  font-weight: 800;
  font-size: 14px;
}

.column__meta {
  font-size: 12px;
  color: var(--secondary);
}

.pipeline-view .card--compact {
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  box-shadow: 0 10px 20px rgba(15, 27, 45, 0.08);
  min-height: 180px;
  min-width: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pipeline-view.is-scrolling .card--compact,
.pipeline-view.is-scrolling .metric-card {
  box-shadow: 0 6px 14px rgba(15, 27, 45, 0.08);
  transform: none;
}

.pipeline-view.is-scrolling .card--compact:hover {
  transform: none;
}

.pipeline-view .card--compact:hover {
  transform: translateY(-3px);
  border-color: rgba(164, 31, 53, 0.3);
  box-shadow: 0 14px 28px rgba(15, 27, 45, 0.15);
}

.pipeline-view .card__meta {
  font-size: 12px;
  color: var(--secondary);
}

.pipeline-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.pipeline-card__name {
  font-size: 18px;
  font-weight: 700;
  color: #1f3b71;
  min-width: 0;
}

.pipeline-card__name .profile-link {
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-card__icon-btn {
  border: 1px solid #d7dde6;
  background: #f7f8fb;
  color: var(--secondary);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.pipeline-card__details {
  display: grid;
  gap: 8px;
  min-height: 48px;
  overflow: hidden;
}

.pipeline-card__detail {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  min-width: 0;
}

.pipeline-card__label {
  color: var(--secondary);
  font-weight: 600;
  white-space: nowrap;
}

.pipeline-card__value {
  color: #22324b;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-card__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: nowrap;
}

@media (max-width: 900px) {
  .pipeline-card__detail {
    grid-template-columns: 1fr;
  }

  .pipeline-card__label {
    white-space: normal;
  }

  .pipeline-view .card--compact {
    height: auto;
  }

  .pipeline-card__actions {
    flex-wrap: wrap;
  }
}

.pipeline-card__action {
  border: 1px solid #e0e6f0;
  background: #f7f8fb;
  color: var(--secondary);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.pipeline-card__action:hover,
.pipeline-card__icon-btn:hover {
  color: var(--primary);
  background: rgba(164, 31, 53, 0.12);
  border-color: rgba(164, 31, 53, 0.35);
}

.pipeline-card__icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.case-management {
  background: linear-gradient(135deg, #f6f9ff 0%, #eef2fb 100%);
  border: 1px solid #d9e2f1;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.case-management.hidden {
  display: none;
}

.case-management__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.case-management__eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6f8a;
}

.case-management__title {
  font-size: 18px;
  font-weight: 700;
  color: #1d2d44;
}

.case-management__meta {
  font-size: 13px;
  color: var(--secondary);
}

.case-status-pill {
  background: #0f4c81;
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.case-management__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-kpi {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.case-kpi span {
  font-size: 12px;
  color: var(--secondary);
}

.case-kpi strong {
  font-size: 14px;
  color: #1f3b71;
}

.case-management__actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.case-management__actions .pill {
  width: 100%;
  justify-content: center;
}

.case-management__lists {
  display: grid;
  gap: 12px;
}

.case-list {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.case-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.case-list__header h6 {
  margin: 0;
  font-size: 14px;
  color: #1d2d44;
}

.case-list__body {
  display: grid;
  gap: 8px;
}

.case-list__item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
}

.case-list__item strong {
  font-size: 13px;
  color: #1f3b71;
}

.case-list__item span {
  font-size: 12px;
  color: var(--secondary);
}

.case-list__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.case-list__badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0b4a7e;
}

.case-list__empty {
  font-size: 12px;
  color: var(--secondary);
}

.pipeline-view .chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(93, 99, 129, 0.08);
  color: var(--secondary);
}

.pipeline-view .chip--status {
  background: #e0f2fe;
  color: #075985;
}

.pipeline-view .chip--success {
  background: #f5f3ff;
  color: #7c3aed;
}

.pipeline-view .chip--danger {
  background: #fee2e2;
  color: #991b1b;
}

.pipeline-view .chip-owner {
  background: #ede9fe;
  color: #5b21b6;
}

@media (max-width: 1080px) {
  .pipeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Matters */
.matters-view {
  padding: 12px 16px 24px;
}

.matters-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.matters-header h2 {
  margin: 0;
}

.matters-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.matters-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.matters-filters input,
.matters-filters select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.matters-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.matters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

/* Contacts */
.contacts-view {
  padding: 12px 16px 24px;
}

.contacts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.contacts-header h2 {
  margin: 0;
}

.contacts-header__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.contacts-header__actions input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.contacts-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.contact-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.contact-card:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.12);
}

.contact-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.contact-name {
  font-weight: 800;
  color: var(--secondary);
}

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

.contact-tag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(93, 99, 129, 0.08);
  color: var(--secondary);
}

.contact-tag.prospect {
  background: #fef3c7;
  color: #92400e;
}

.contact-tag.client {
  background: #f5f3ff;
  color: #7c3aed;
}

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

.contact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Activities */
.activities-view {
  padding: 12px 16px 24px;
}

.activities-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.activities-header h2 {
  margin: 0;
}

.activities-header__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.activities-date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
}

.activities-date input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--secondary);
}

.activities-date input:focus {
  outline: none;
}

.activities-header__actions input,
.activities-header__actions select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.activities-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.activities-panel {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.activities-list {
  display: grid;
  gap: 10px;
}

.activity-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.activity-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.activity-title {
  font-weight: 800;
  color: var(--secondary);
}

.activity-meta {
  font-size: 12px;
  color: var(--secondary);
}

.activity-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.activity-modal {
  max-width: 680px;
}

.activity-modal__list {
  display: grid;
  gap: 10px;
  padding: 6px 0;
}

.activities-metrics .metric-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.activities-metrics .metric-card:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.12);
}

.activities-sidebar {
  display: grid;
  gap: 12px;
}

.activities-summary,
.activities-upnext {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--secondary);
  margin-top: 8px;
}

.upnext-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  margin-top: 10px;
}

@media (max-width: 1080px) {
  .activities-panel {
    grid-template-columns: 1fr;
  }
}

/* Billing */
.billing-view {
  padding: 12px 16px 24px;
}

.billing-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.billing-header__title h2 {
  margin: 0;
}

.billing-header__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.billing-actions__right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}

.billing-bulk {
  display: flex;
  gap: 6px;
}

.billing-header__actions input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.billing-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.billing-panel {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.billing-table {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  overflow: hidden;
}

.billing-table__header {
  display: grid;
  grid-template-columns: 0.3fr 1.2fr 1.2fr 1fr 0.8fr 0.8fr 0.8fr 0.8fr;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  border-bottom: 1px solid #e6edf5;
}

.billing-table__body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.billing-row {
  display: grid;
  grid-template-columns: 0.3fr 1.2fr 1.2fr 1fr 0.8fr 0.8fr 0.8fr 0.8fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e6edf5;
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.billing-row:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 10px 20px rgba(15, 27, 45, 0.12);
}

.billing-metrics .metric-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.billing-metrics .metric-card:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.12);
}

.billing-drill-modal {
  max-width: 820px;
}

.billing-drill__list {
  display: grid;
  gap: 10px;
  padding: 6px 0;
}

.billing-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.billing-status.draft {
  background: rgba(93, 99, 129, 0.08);
  color: #475569;
}

.billing-status.unpaid {
  background: #fef3c7;
  color: #92400e;
}

.billing-status.overdue {
  background: #fee2e2;
  color: #991b1b;
}

.billing-status.paid {
  background: #f5f3ff;
  color: #7c3aed;
}

.billing-status.approved {
  background: #e0f2fe;
  color: #075985;
}

.billing-status.sent {
  background: #ede9fe;
  color: #5b21b6;
}

.billing-sidebar {
  display: grid;
  gap: 12px;
}

.billing-summary,
.billing-actions {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.billing-trust {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  display: grid;
  gap: 10px;
}

.billing-trust__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.billing-trust__balance {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--secondary);
}

.billing-trust__list {
  display: grid;
  gap: 8px;
}

.trust-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  font-size: 12px;
}

.trust-row__amount.deposit {
  color: #7c3aed;
  font-weight: 700;
}

.trust-row__amount.withdrawal {
  color: #991b1b;
  font-weight: 700;
}

.trust-modal {
  max-width: 520px;
}

.trust-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.trust-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.trust-form input,
.trust-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.payment-modal {
  max-width: 520px;
}

.payment-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.payment-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.payment-form input,
.payment-form select,
.payment-form textarea {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.payment-form .small {
  font-size: 12px;
  color: var(--secondary);
}

.payment-summary {
  display: grid;
  gap: 4px;
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 10px;
}

.payment-link__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1080px) {
  .billing-panel {
    grid-template-columns: 1fr;
  }
}

/* Payments */
.payments-view {
  padding: 12px 16px 24px;
}

.payments-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.payments-header h2 {
  margin: 0;
}

.payments-header__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.payments-header__actions input,
.payments-header__actions select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.payments-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payments-panel {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.payments-table {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  overflow: hidden;
}

.payments-table__header {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr 0.8fr 0.8fr 0.8fr 0.9fr;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  border-bottom: 1px solid #e6edf5;
}

.payments-table__body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.payments-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr 0.8fr 0.8fr 0.8fr 0.9fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e6edf5;
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.payments-row:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 10px 20px rgba(15, 27, 45, 0.12);
}

.payment-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.payment-status.succeeded {
  background: #f5f3ff;
  color: #7c3aed;
}

.payment-status.pending {
  background: #e0f2fe;
  color: #075985;
}

.payment-status.failed {
  background: #fee2e2;
  color: #991b1b;
}

.payment-status.refunded {
  background: rgba(93, 99, 129, 0.08);
  color: #475569;
}

.payment-status.partial-refund {
  background: #fef3c7;
  color: #92400e;
}

.payments-sidebar {
  display: grid;
  gap: 12px;
}

.payments-summary,
.payments-links {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.payments-autopay {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
}

.autopay-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  margin-top: 10px;
}

.autopay-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
}

.autopay-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.payment-link-modal {
  max-width: 520px;
}

.payment-detail-modal {
  max-width: 520px;
}

.payment-detail__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  margin-bottom: 12px;
}

.payment-detail__amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--secondary);
}

.payment-detail__meta {
  font-size: 12px;
  color: var(--secondary);
  text-transform: capitalize;
}

.payment-detail__pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(93, 99, 129, 0.08);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
}

.payment-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  font-size: 13px;
  color: var(--secondary);
}

.payment-detail__refunds {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--secondary);
}

.payment-refund {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e6edf5;
}

.payment-detail__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.payment-detail__actions input {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #ffffff;
}

.payment-link-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.payment-link-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.payment-link-form input,
.payment-link-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.payment-link-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  margin-top: 10px;
}

.payment-link-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 1080px) {
  .payments-panel {
    grid-template-columns: 1fr;
  }
}

/* Accounts */
.accounts-view {
  padding: 12px 16px 24px;
}

.accounts-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 520px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.accounts-header h2 {
  margin: 0;
}

.accounts-header__actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-items: start;
}

.accounts-header__actions input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.accounts-header__actions select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.accounts-actions__search {
  width: 100%;
}

.accounts-actions__search input {
  width: 100%;
  height: 36px;
}

.accounts-actions__controls {
  display: grid;
  gap: 8px;
  width: 100%;
}

.accounts-actions__row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.accounts-actions__row button,
.accounts-actions__row select {
  height: 36px;
}

@media (max-width: 900px) {
  .accounts-header {
    grid-template-columns: 1fr;
  }

  .accounts-header__actions,
  .accounts-actions__controls,
  .accounts-actions__row {
    justify-items: stretch;
    justify-content: flex-start;
  }
}

.accounts-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.account-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(15, 27, 45, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.account-card:hover {
  transform: translateY(-1px);
  border-color: #cfe2ff;
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.12);
}

.account-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.account-name {
  font-weight: 800;
  color: var(--secondary);
}

.account-type {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(93, 99, 129, 0.08);
  font-weight: 700;
  text-transform: uppercase;
}

.account-type.trust {
  background: #e0f2fe;
  color: #075985;
}

.account-type.operating {
  background: #f5f3ff;
  color: #7c3aed;
}

.account-meta {
  font-size: 12px;
  color: var(--secondary);
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-modal {
  max-width: 560px;
}

.account-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.account-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.account-form input,
.account-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.account-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.account-detail {
  display: grid;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--secondary);
}

.account-detail__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.account-detail__transactions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.account-transaction {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e6edf5;
  font-size: 12px;
  color: var(--secondary);
}

.account-transaction__amount.negative {
  color: #991b1b;
  font-weight: 700;
}

.account-transaction__amount.positive {
  color: #7c3aed;
  font-weight: 700;
}

/* Invoice modal */
.invoice-modal {
  max-width: 820px;
}

.invoice-form {
  display: grid;
  gap: 16px;
  padding: 6px 0;
}

.invoice-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.invoice-form input,
.invoice-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.invoice-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.invoice-lines {
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.invoice-lines__header,
.invoice-line {
  display: grid;
  grid-template-columns: 2fr 0.6fr 0.8fr 0.8fr;
  gap: 8px;
  align-items: center;
}

.invoice-lines__header {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.invoice-line input {
  width: 100%;
}

.invoice-line__amount {
  font-weight: 700;
  color: var(--secondary);
}

.invoice-line__remove {
  background: transparent;
  border: none;
  color: #b42318;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.invoice-totals {
  display: grid;
  gap: 8px;
  justify-content: end;
}

.invoice-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--secondary);
}

.invoice-total-row--grand {
  font-size: 15px;
  font-weight: 800;
  color: var(--secondary);
}

.invoice-tax {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.invoice-tax input {
  width: 70px;
  text-align: right;
}

.invoice-detail-modal {
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
}

.invoice-detail__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 12px;
  margin-top: 12px;
}

.invoice-detail__side {
  display: grid;
  gap: 12px;
}

.invoice-history {
  margin-top: 12px;
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.invoice-history__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
}

.invoice-history__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--secondary);
}

.invoice-payments {
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.invoice-payment {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--secondary);
}

.invoice-payment strong {
  color: var(--secondary);
}

.invoice-attachments,
.invoice-preview {
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.invoice-send {
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.invoice-send label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.invoice-send input {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.invoice-attachment {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--secondary);
}

.invoice-preview__box {
  height: 160px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  display: grid;
  place-items: center;
  color: var(--secondary);
  background: #fff;
  font-size: 12px;
}

/* Documents */
.documents-view {
  padding: 12px 16px 24px;
}

.documents-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 520px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.documents-header h2 {
  margin: 0;
}

.documents-header__actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.documents-actions__search {
  width: 100%;
}

.documents-actions__search input {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.documents-actions__controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.documents-actions__controls select {
  height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #f1f5fb;
  border: 1px solid rgba(93, 99, 129, 0.08);
}

.view-toggle__btn {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #3b536f;
  cursor: pointer;
}

.view-toggle__btn.active {
  background: #fff;
  color: #0f4aa5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.documents-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.documents-sidebar {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.documents-folder-actions {
  display: grid;
  gap: 8px;
}

.doc-folder-list {
  display: grid;
  gap: 6px;
}

.doc-folder {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #ffffff;
  text-align: left;
  font-weight: 600;
  color: #1d2a3b;
  cursor: pointer;
}

.doc-folder.active {
  background: #e6f0ff;
  border-color: #c7ddff;
  color: #0f4aa5;
}

.doc-storage__label {
  font-weight: 700;
  font-size: 12px;
  color: #3c4c63;
}

.doc-storage__bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f8;
  overflow: hidden;
}

.doc-storage__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3c7df0, #7fb0ff);
}

.doc-storage__meta {
  font-size: 12px;
  color: #6b7b92;
}

.documents-content {
  display: grid;
  gap: 12px;
}

.documents-tabs {
  margin-top: 4px;
}

.documents-tab-panels {
  display: grid;
  gap: 12px;
}

.documents-tab-panel.hidden {
  display: none;
}
.documents-requests {
  border: 1px solid rgba(93, 99, 129, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.documents-requests__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.documents-templates,
.documents-activity {
  border: 1px solid rgba(93, 99, 129, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.documents-templates__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.documents-request-title {
  font-weight: 700;
  color: #1f2d3d;
}

.documents-request-btn {
  height: 24px;
  padding: 2px 8px;
  font-size: 12px;
}

.documents-requests__list {
  display: grid;
  gap: 8px;
}

.document-request {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  background: #ffffff;
  font-size: 13px;
  color: #1f2d3d;
}

.document-request__meta {
  font-size: 12px;
  color: #6b7b92;
}

.document-request__status {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 0;
  background: #fff4dd;
}

.document-request__status.requested {
  background: #fff4dd;
  color: #a15a11;
}

.document-request__status.received {
  background: #e5f7ee;
  color: #1d7a4f;
}

.document-request__status.overdue {
  background: #ffe6e6;
  color: #b82c2c;
}

.document-request__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.document-request-modal {
  max-width: 560px;
}

.document-request-body {
  display: grid;
  gap: 12px;
}

.document-request-body input,
.document-request-body select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.document-request-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.document-template-card {
  display: grid;
  grid-template-columns: 1.8fr 1fr 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  background: #ffffff;
  font-size: 13px;
  color: #1f2d3d;
}

.document-template__meta {
  font-size: 12px;
  color: #6b7b92;
}

.document-template__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.document-activity-row {
  display: grid;
  grid-template-columns: 110px 1fr 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  background: #ffffff;
  font-size: 13px;
  color: #1f2d3d;
}

.document-activity-row__meta {
  font-size: 12px;
  color: #6b7b92;
}

.documents-bulk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  color: #4b5f7a;
}

.documents-bulk.hidden {
  display: none;
}

.doc-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.documents-bulk select {
  height: 32px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.documents-bulk__meta {
  margin-left: auto;
  font-weight: 600;
  color: #1f2d3d;
}

.documents-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #6b7b92;
  padding: 2px 4px;
}

.documents-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.documents-filters__group {
  display: grid;
  gap: 6px;
}

.documents-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a8ca6;
  font-weight: 700;
}

.documents-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tag-chip {
  border: 1px solid #e1e7f2;
  background: #f7f9fd;
  color: #51637d;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-chip.active {
  background: #e6f0ff;
  border-color: #c7ddff;
  color: #0f4aa5;
}

.tag-chip.tag-chip--more {
  background: #fff;
  border-style: dashed;
  color: #3c567a;
}

.documents-tags__hidden {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
}

.documents-tags__hidden.is-open {
  display: flex;
}

.documents-filters select,
.documents-date-range input {
  height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.documents-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.documents-size-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.documents-dropzone {
  border: 1px dashed #c7d7f3;
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #4b6382;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.documents-dropzone input {
  display: none;
}

.documents-dropzone.is-dragover {
  border-color: #7aa6ff;
  background: #eef5ff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.documents-dropzone__title {
  font-weight: 700;
  color: #1f2d3d;
}

.documents-dropzone__meta {
  font-size: 12px;
  color: #6b7b92;
}

.doc-breadcrumb {
  font-weight: 600;
  color: #1f2d3d;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.documents-grid.is-list {
  display: block;
}

.document-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.document-card:hover {
  border-color: #cfe1ff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.document-card.is-selected {
  border-color: #8fb3ff;
  box-shadow: 0 10px 20px rgba(15, 74, 165, 0.18);
}

.doc-select {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid #d4dfee;
  background: #fff;
}

.doc-select input {
  width: 14px;
  height: 14px;
}

.doc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1d2a3b;
  background: #eef3ff;
}

.doc-icon--pdf {
  background: #ffe6e6;
  color: #b82c2c;
}

.doc-icon--doc {
  background: #e6f0ff;
  color: #1f5bb5;
}

.doc-icon--sheet {
  background: #e5f7ee;
  color: #1d7a4f;
}

.doc-icon--image {
  background: #fff4dd;
  color: #b86a12;
}

.doc-icon--folder {
  background: #f0f4ff;
  color: #3d5fa8;
}

.document-card__title {
  font-weight: 700;
  font-size: 14px;
  color: #1f2d3d;
}

.document-card__meta {
  font-size: 12px;
  color: #6b7b92;
}

.document-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #6b7b92;
}

.document-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.doc-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.doc-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5fb;
  color: #52627a;
  font-size: 11px;
}

.doc-row {
  display: grid;
  grid-template-columns: 26px 42px 2fr 1fr 1fr 90px 170px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.doc-row:hover {
  border-color: #cfe1ff;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

.doc-row--header {
  border: 0;
  background: transparent;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 11px;
  color: #7a8ca6;
  letter-spacing: 0.08em;
  cursor: default;
}

.doc-row--header span:first-child {
  text-align: center;
}

.document-upload-modal {
  max-width: 560px;
}

.document-upload-body {
  display: grid;
  gap: 12px;
}

.document-upload-body input,
.document-upload-body select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.document-upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.document-detail-modal {
  max-width: 560px;
}

.document-detail-body {
  display: grid;
  gap: 12px;
}

.document-detail-preview {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  background: #f7f9fd;
  padding: 10px;
  min-height: 180px;
  display: grid;
  place-items: center;
}

.document-detail-preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
}

.document-detail-preview iframe {
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.document-preview__placeholder {
  font-size: 13px;
  color: #6b7b92;
}

.document-preview {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  background: #f7f9fd;
  border-radius: 12px;
  padding: 12px;
}

.doc-icon--large {
  width: 64px;
  height: 64px;
  font-size: 12px;
}

.document-preview__meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #52627a;
}

.document-detail-info {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #3b4a60;
}

.document-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.document-versions {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
}

.document-versions__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.document-version-upload input {
  display: none;
}

.document-version {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f9fd;
  font-size: 13px;
  color: #2b3a52;
}

.document-version__meta {
  font-size: 12px;
  color: #6b7b92;
  margin-top: 2px;
}

.document-version__size {
  font-weight: 600;
  color: #1f2d3d;
}

@media (max-width: 900px) {
  .documents-header {
    grid-template-columns: 1fr;
  }

  .documents-header__actions {
    justify-items: stretch;
  }

  .documents-actions__controls {
    justify-content: flex-start;
  }

  .documents-body {
    grid-template-columns: 1fr;
  }

  .documents-filters {
    grid-template-columns: 1fr;
  }

  .document-request {
    grid-template-columns: 1fr;
  }

  .document-template-card,
  .document-activity-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .invoice-detail__grid {
    grid-template-columns: 1fr;
  }
}

.contact-modal {
  max-width: 680px;
}

.contact-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.contact-form textarea {
  resize: vertical;
  min-height: 90px;
}

.contact-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.matter-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.matter-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  border-color: rgba(30, 64, 175, 0.3);
}

.matter-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.matter-card:hover::before {
  opacity: 1;
}

.matter-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.matter-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.matter-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.matter-status {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.matter-status--active {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.matter-status--hold {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fef3c7;
}

.matter-status--closed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.matter-meta {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--secondary);
}

.matter-meta span {
  color: var(--secondary);
  font-weight: 700;
  margin-right: 6px;
}

.matter-progress {
  display: grid;
  gap: 6px;
}

.matter-progress__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
}

.matter-progress__bar {
  height: 10px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.matter-progress__bar span {
  display: block;
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.matter-card__footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.matter-modal {
  max-width: 720px;
}

.matter-form {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.matter-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}

.matter-form input,
.matter-form select {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--secondary);
}

.matter-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.matter-detail-modal {
  max-width: 520px;
}

.matter-detail__body {
  display: grid;
  gap: 12px;
  padding: 6px 0;
}

.matter-detail__pill {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(93, 99, 129, 0.08);
  color: var(--secondary);
}

.matter-detail__meta {
  font-size: 13px;
  color: var(--secondary);
}

@media (max-width: 1080px) {
  .tasks-board {
    grid-template-columns: 1fr;
  }

  .tasks-list__header,
  .task-card {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }
}

@media (max-width: 1024px) {
  .calendar-shell {
    grid-template-columns: 1fr;
  }

  .calendar-actions {
    flex-wrap: wrap;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .integration-list__header,
  .integration-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .integration-actions {
    justify-content: flex-start;
  }
}

.feed-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.feed-desc {
  display: grid;
  gap: 2px;
}

.feed-desc strong {
  font-weight: 700;
}

.feed-desc .muted {
  font-size: 12px;
}

.feed-time {
  text-align: right;
  color: var(--secondary);
  font-size: 12px;
}
.line-chart-placeholder::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  height: 2px;
  background: #cbd5e1;
}

.line-chart-placeholder::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary) 40%, transparent 40%, transparent 60%, var(--primary) 60%);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: center;
}

.lead-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.lead-report th,
.lead-report td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}

.lead-report th {
  background: #f6f9fc;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999;
  padding: 20px;
}

.modal.hidden {
  display: none !important;
}

.modal__content {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  width: min(480px, 90vw);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  position: relative;
}

.modal__content--wide {
  width: min(1000px, 95vw);
}

.stage-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.stage-pill {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #f6f9fc;
  text-align: center;
  font-weight: 700;
  color: var(--secondary);
}

.stage-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.profile-details p {
  margin: 4px 0;
  color: var(--text);
}

.profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.profile-page {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  padding: 12px 16px;
}

.profile-page.hidden {
  display: none;
}

.matter-profile {
  display: grid;
  gap: 12px;
  padding: 12px 16px;
}

.matter-profile.hidden {
  display: none;
}

.matter-profile__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 24px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.matter-profile__title {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.matter-profile__subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.matter-profile__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.matter-profile__tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 20px;
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.matter-tab {
  border: 1px solid rgba(226, 232, 240, 0.6);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.matter-tab:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.matter-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.matter-profile__actions .pill {
  width: auto;
  margin-top: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.matter-profile__actions .pill--ghost {
  background: #eef2f6;
  color: var(--primary);
  border: 1px solid rgba(93, 99, 129, 0.2);
}

.matter-profile__actions .pill--soft {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
}

.matter-profile__body {
  display: grid;
  gap: 12px;
}

.matter-profile__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "probate probate probate"
    "financial financial contacts"
    "details conflicts timeline"
    "custom custom timeline";
  gap: 16px;
  align-items: start;
}

.matter-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.matter-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.matter-panel__cta {
  width: auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  margin-top: 0;
  min-height: auto;
}

.matter-panel__header h4 {
  margin: 0;
}

.matter-panel--financial {
  grid-area: financial;
}

.matter-panel--details {
  grid-area: details;
}

.matter-panel--details {
  padding: 6px 20px 14px;
  gap: 0;
  align-self: start;
}

.matter-panel--details h4 {
  font-size: 16px;
  font-weight: 700;
  color: #6b7388;
  margin-top: 0;
  margin-bottom: 6px;
}

.matter-panel--conflicts {
  grid-area: conflicts;
}

.matter-panel--custom {
  grid-area: custom;
}

.matter-panel--probate {
  grid-area: probate;
  background: #ffffff;
  border: 1px solid var(--border);
}

.matter-panel--contacts {
  grid-area: contacts;
}

.matter-panel--timeline {
  grid-area: timeline;
  padding: 0;
  border: none;
  background: transparent;
}

.probate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.probate-workflow {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 12px;
}

.probate-workflow__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.probate-workspace {
  display: grid;
  gap: 12px;
}

.probate-workspace__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.probate-stage-workspace {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.probate-stage-workspace__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.probate-stage-workspace__body {
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: var(--secondary);
}

.probate-stage-task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(93, 99, 129, 0.12);
}

.probate-stage-task strong {
  color: #22324b;
}

.probate-card {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 10px;
  min-height: 180px;
}

.probate-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.probate-card__header h5 {
  margin: 0;
  font-size: 14px;
  color: #22324b;
}

.probate-stage-list,
.probate-checklist,
.probate-dates,
.probate-parties {
  display: grid;
  gap: 8px;
}

.probate-stage-list--tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.probate-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--secondary);
  background: transparent;
  border: none;
  text-align: left;
}

.probate-stage-list--tabs .probate-stage {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 999px;
  padding: 6px 12px;
  background: #f7f8fc;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.probate-stage-list--tabs .probate-stage:hover {
  border-color: rgba(164, 31, 53, 0.4);
  color: #1f3b71;
}

.probate-stage--active {
  border-color: rgba(164, 31, 53, 0.6);
  background: rgba(164, 31, 53, 0.1);
  color: #1f3b71;
  font-weight: 700;
}

.probate-stage__dot {
  display: none;
}

.probate-stage--done .probate-stage__dot {
  background: #8b5cf6;
}

.probate-stage--current {
  font-weight: 700;
  color: #1f3b71;
}

.probate-stage--current .probate-stage__dot {
  background: var(--primary);
}

.probate-stage-summary {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--secondary);
}

.probate-check {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--secondary);
}

.probate-check .chip {
  font-size: 11px;
}

.probate-date {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--secondary);
}

.probate-date strong {
  color: #22324b;
}

.probate-party-group {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f7f9ff;
}

.probate-party-group h6 {
  margin: 0 0 6px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
}

.probate-party {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #22324b;
}

.probate-empty {
  font-size: 13px;
  color: #64748b;
  background: #f5f7fb;
  border-radius: 8px;
  padding: 8px 10px;
}

/* Modern 2-Column Dashboard Layout */
.probate-layout-grid {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  align-items: flex-start;
}

.probate-workspace-focus {
  flex: 3; /* 60% width */
  min-width: 0;
}

.probate-context-hub {
  flex: 2; /* 40% width */
  background: #ffffff;
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar Tab Selectors (Modern Segmented Control Style) */
.context-hub-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  gap: 4px;
}

.context-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.context-tab:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
}

.context-tab.active {
  color: #ffffff !important;
  background: var(--primary) !important;
  font-weight: 700 !important;
}

.context-tab .tab-icon-svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Tab contents styling */
.context-hub-content {
  padding: 16px;
}

.context-panel {
  display: none;
}

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

.panel-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.panel-header-inline h5 {
  margin: 0;
  font-size: 14px;
  color: #1e293b;
  font-weight: 700;
}

/* Badges on tabs */
.context-tab .badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.context-tab.active .badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* Responsive adjustments for 2-column layout */
@media (max-width: 992px) {
  .probate-layout-grid {
    flex-direction: column;
  }
  .probate-workspace-focus,
  .probate-context-hub {
    width: 100%;
    flex: none;
  }
}

/* Modern Select Dropdown styling */
.select-modern {
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.select-modern:hover {
  border-color: #94a3b8;
  background-color: #f1f5f9;
}

.select-modern:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
  background-color: #ffffff;
}


.matter-financial {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  border-top: 1px solid #eef1f5;
  padding-top: 12px;
}

.matter-financial__cell {
  display: grid;
  gap: 6px;
  padding: 0 8px;
  border-right: 1px solid #eef1f5;
}

.matter-financial__cell:last-child {
  border-right: none;
}

.matter-financial__label {
  color: var(--muted);
  font-size: 12px;
}

.matter-financial__value {
  font-size: 20px;
  font-weight: 800;
  color: #0f1f3d;
}

.matter-financial__meta {
  color: var(--secondary);
  font-size: 12px;
}

.matter-financial__footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  border-top: 1px solid #eef1f5;
  padding-top: 12px;
}

.matter-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.matter-mini__title {
  font-weight: 600;
  color: #1f2a44;
}

.matter-mini__value {
  font-weight: 700;
  color: #0b4a7e;
}

.matter-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 28px;
  margin-top: 0;
}

.matter-detail {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--secondary);
  padding: 4px 0;
}

.matter-detail--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.matter-detail span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c879a;
}

.matter-detail strong {
  color: #0f1f3d;
  font-weight: 700;
  font-size: 15px;
}

.matter-contact {
  display: flex;
  gap: 10px;
  align-items: center;
}

.matter-contact__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbe7f5;
  color: #0b4a7e;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.matter-contact__name {
  font-weight: 700;
  color: #0f1f3d;
}

.matter-contact__meta {
  color: var(--muted);
  font-size: 12px;
}

.matter-contact__rows {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--secondary);
}

.matter-contact__rows strong {
  color: #0f1f3d;
  font-weight: 600;
  margin-left: 6px;
}

.matter-contact__footer {
  border-top: 1px solid #eef1f5;
  padding-top: 10px;
}

@media (max-width: 1100px) {
  .matter-profile__body {
    grid-template-columns: 1fr;
  }

  .matter-profile__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "probate"
      "financial"
      "contacts"
      "details"
      "conflicts"
      "custom"
      "timeline";
  }
}

.profile-left {
  min-width: 320px;
}

.profile-right {
  width: 100%;
}

.profile-header-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}

.profile-meta .profile-name {
  font-weight: 800;
  font-size: 18px;
  margin-top: 4px;
  color: var(--primary);
}

.profile-meta .profile-sub {
  color: var(--muted);
  font-size: 13px;
}

.profile-field {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  align-items: center;
  gap: 8px;
}

.profile-field strong {
  color: var(--primary);
}

.profile-field input {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}

.timeline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.timeline-header h4 {
  margin: 0;
}

.timeline-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-tab {
  border: 1px solid #d5deea;
  background: #ffffff;
  color: #2b3a55;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.timeline-tab.active {
  background: #0b4a7e;
  border-color: #0b4a7e;
  color: #fff;
}

.timeline-tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.timeline-quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-quick select {
  padding: 8px 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  background: #ffffff;
  color: #22324b;
  min-width: 150px;
}

.timeline-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  background: #ffffff;
}

.timeline-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  align-items: center;
}

.timeline-filters select {
  padding: 8px 10px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  background: #ffffff;
  color: #22324b;
}

.timeline-controls {
  display: grid;
  gap: 8px;
}

.timeline-controls .pill--soft {
  padding: 8px 10px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-day {
  display: grid;
  gap: 8px;
}

.timeline-day__label {
  font-weight: 800;
  color: var(--primary);
}

.timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e5edf7;
  border-radius: 10px;
  background: #f9fbff;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  cursor: pointer;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  margin-top: 6px;
}

.timeline-dot--call { background: var(--primary); }
.timeline-dot--email { background: #7c3aed; }
.timeline-dot--task { background: #0ea5e9; }
.timeline-dot--deadline { background: #ef4444; }
.timeline-dot--document { background: #111827; }
.timeline-dot--intake { background: #8b5cf6; }
.timeline-dot--note { background: #14b8a6; }
.timeline-dot--appointment { background: #f97316; }
.timeline-dot--filing { background: #4b5563; }
.timeline-dot--default { background: var(--primary); }

.timeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-item:hover {
  border-color: #bcd7ff;
  box-shadow: 0 8px 20px rgba(164, 31, 53, 0.12);
  background: #f2f7ff;
}

.timeline-item--expanded {
  border-color: var(--primary);
  background: #edf5ff;
}

.timeline-item--expanded strong,
.timeline-item--expanded p {
  display: block;
}

.timeline-content p {
  margin: 0 0 4px 0;
  color: #22324b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-item--expanded .timeline-content p {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.timeline-badge--call { background: var(--primary); }
.timeline-badge--email { background: #7c3aed; }
.timeline-badge--task { background: #0ea5e9; }
.timeline-badge--deadline { background: #ef4444; }
.timeline-badge--document { background: #111827; }
.timeline-badge--intake { background: #8b5cf6; }
.timeline-badge--note { background: #14b8a6; }
.timeline-badge--appointment { background: #f97316; }
.timeline-badge--filing { background: #4b5563; }
.timeline-badge--default { background: var(--primary); }

.timeline-meta {
  color: var(--secondary);
  font-size: 12px;
}

.timeline-time {
  margin-left: auto;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
}

.timeline-content strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-content small {
  color: #6b7a91;
}

.pill--ghost {
  background: #eef2f6;
  color: var(--primary);
}

.timeline-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.timeline-types .pill {
  background: #f5f7fa;
  color: #22324b;
  border: 1px solid rgba(93, 99, 129, 0.2);
  box-shadow: none;
  padding: 8px 12px;
  margin: 0;
}

.timeline-types .pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.timeline-types.compact .pill {
  padding: 6px 10px;
  font-size: 12px;
}

.timeline-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(93, 99, 129, 0.06);
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #0f172a;
  margin-top: 6px;
}

.timeline-empty {
  background: #ffffff;
  border: 1px dashed rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 16px;
  color: var(--secondary);
  text-align: center;
}

.timeline-modal__body {
  display: grid;
  gap: 12px;
}

.timeline-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.timeline-modal__content strong {
  font-size: 16px;
  display: block;
  margin-bottom: 6px;
}

.timeline-modal__content p {
  margin: 0;
  line-height: 1.5;
  color: #22324b;
}

.stage-panel {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.profile-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.stage-track span {
  height: 6px;
  border-radius: 999px;
  background: rgba(93, 99, 129, 0.08);
}

.stage-track span.active {
  background: linear-gradient(90deg, #8b1d30, var(--primary));
}

.stage-horizontal {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.stage-option {
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: grid;
  gap: 4px;
}

.stage-option span {
  font-weight: 700;
  color: #7a1226;
  font-size: 13px;
}

.stage-option small {
  color: var(--secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stage-option.active {
  border-color: var(--primary);
  background: rgba(164, 31, 53, 0.12);
  box-shadow: 0 10px 20px rgba(164, 31, 53, 0.2);
  transform: translateY(-2px);
}

.stage-option:hover {
  border-color: rgba(164, 31, 53, 0.5);
  transform: translateY(-1px);
}

.stage-promote {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d7e6f9;
  background: #f5f9ff;
  display: grid;
  gap: 8px;
}

.stage-promote__label {
  font-size: 13px;
  font-weight: 600;
  color: #1f3b71;
}

.stage-promote__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-promote__actions input {
  flex: 1 1 220px;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  padding: 8px 10px;
}

.cta-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.cta-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  width: 100%;
  flex: 1 1 0;
  transition: all 0.3s ease;
}

.cta-card:hover {
  transform: translateY(-4px);
  border-color: rgba(30, 64, 175, 0.3);
}

.cta-blue { background: var(--gradient-accent); color: #fff; }
.cta-purple { background: linear-gradient(135deg, #4c1d95, #7c3aed); color: #fff; }
.cta-teal { background: linear-gradient(135deg, #0d9488, #14b8a6); color: #fff; }
.cta-orange { background: linear-gradient(135deg, #ea580c, #f97316); color: #fff; }
.cta-output {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: #eaf1f9;
  font-size: 13px;
  line-height: 1.4;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(93, 99, 129, 0.08);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.qualify-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border-radius: 10px;
  color: #0f172a;
  border: 1px solid rgba(93, 99, 129, 0.08);
}

.qualify-result {
  margin-top: 12px;
  padding: 12px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(93, 99, 129, 0.08);
  color: #0f172a;
  line-height: 1.5;
}

.qualify-conflicts {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.qualify-conflicts .conflict-item {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
}

.qualify-result__pill {
  display: inline-block;
  padding: 4px 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}

.qualify-error {
  margin-top: 10px;
  color: #b42318;
  font-weight: 600;
}

.engagement-suggestions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.engagement-suggestions .suggestion-item {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal__close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f1f5f9 !important;
  border: none !important;
  border-radius: 50% !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  color: #64748b !important;
  padding: 0 !important;
  transition: all 0.2s ease !important;
  z-index: 100 !important;
  box-shadow: none !important;
}

.modal__close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  transform: scale(1.1) !important;
}

.modal__actions {
  justify-content: flex-end;
}

.modal__actions--right {
  justify-content: flex-end;
  gap: 8px;
}

.modal__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.form-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.labeled label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #22324b;
  font-size: 14px;
}

.labeled input,
.labeled textarea {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 6px;
  padding: 10px;
}

.labeled .full {
  grid-column: span 2;
}

input,
textarea {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

button {
  background: linear-gradient(135deg, var(--primary), var(--primary));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.activity-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 12px;
  padding: 12px;
}

.activity-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 10px;
  overflow-x: auto;
}

.activity-tab {
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #f5f7fa;
  color: #1f2937;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.activity-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.activity-icon {
  width: 16px;
  height: 16px;
}

.activity-body {
  min-height: 180px;
  display: grid;
  text-align: center;
  color: var(--secondary);
}

.activity-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.activity-actions--top {
  justify-content: flex-start;
  margin-top: 0;
  margin-bottom: 8px;
}

.activity-pane {
  display: none;
}
.activity-pane.active {
  display: grid;
  place-items: center;
}

.activity-pane--list.active {
  place-items: start;
}

.activity-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.activity-item {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  display: grid;
  gap: 4px;
}

.activity-item strong {
  font-size: 13px;
  color: #1f3b71;
}

.activity-item span {
  font-size: 12px;
  color: var(--secondary);
}

.activity-item__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--secondary);
}

.note-item {
  position: relative;
}

.note-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.note-item:hover .note-actions {
  opacity: 1;
  pointer-events: auto;
}

.task-item {
  position: relative;
}

.task-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.task-item:hover .task-actions {
  opacity: 1;
  pointer-events: auto;
}

.pill.danger {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fff1f2;
}

.agenda {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.agenda-tabs {
  display: flex;
  gap: 4px;
}

.agenda-tab {
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #f5f7fa;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.agenda-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.agenda-filters {
  color: var(--secondary);
  font-size: 13px;
}

.agenda-list {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.agenda-item {
  padding: 10px;
  border: 1px solid #e7eef6;
  border-radius: 8px;
}

.agenda-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.agenda-meta {
  color: var(--secondary);
  font-size: 12px;
}

.matters-view {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.matters-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.matters-actions {
  display: flex;
  gap: 8px;
}

.matters-filters {
  display: flex;
  gap: 16px;
  color: var(--secondary);
  font-size: 13px;
}

.forms-view {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.forms-actions {
  display: flex;
  gap: 8px;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.form-card {
  background: #fff;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  display: grid;
  gap: 6px;
}

.form-title {
  font-weight: 700;
}

.form-meta {
  color: var(--secondary);
  font-size: 12px;
}

textarea,
input,
select,
pre.output {
  color: var(--text);
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 4px;
}

input,
textarea,
button {
  width: 100%;
  font: inherit;
}

input,
textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fdfdfd;
}

button {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

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

.status {
  font-size: 13px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.output {
  background: var(--secondary);
  color: #e6edf7;
  padding: 12px;
  border-radius: 8px;
  min-height: 80px;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 8px;
}

.output:empty {
  display: none;
}

.marketing {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.marketing-accounts {
  display: grid;
  gap: 14px;
}

.marketing-accounts__actions {
  display: flex;
  gap: 8px;
}

.marketing-accounts__form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 1fr) auto;
  gap: 10px;
}

.marketing-accounts__form .pill {
  margin: 0;
}

.marketing-accounts__table {
  border: 1px solid rgba(93, 99, 129, 0.16);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.accounts-head,
.accounts-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, 0.6fr) minmax(120px, 0.6fr) minmax(180px, 0.8fr);
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
}

.accounts-head {
  background: rgba(123, 30, 43, 0.08);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7b1e2b;
  font-weight: 700;
}

.accounts-row {
  border-top: 1px solid rgba(93, 99, 129, 0.12);
  font-size: 14px;
  color: #2c2f3d;
}

.accounts-row strong {
  display: block;
  font-weight: 700;
}

.accounts-row .muted {
  font-size: 12px;
}

.accounts-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.accounts-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.accounts-chip--connected {
  background: rgba(24, 160, 88, 0.15);
  color: #12814a;
}

.accounts-chip--pending {
  background: rgba(232, 181, 0, 0.15);
  color: #946d00;
}

.accounts-chip--default {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.marketing-accounts__hint {
  color: #67708a;
}

@media (max-width: 900px) {
  .marketing-accounts__form {
    grid-template-columns: 1fr;
  }
  .accounts-head,
  .accounts-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .accounts-actions {
    justify-content: flex-start;
  }
}

.marketing__hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 4px;
}

.marketing__selected {
  margin-top: 8px;
  color: var(--primary);
  font-weight: 700;
}

.marketing__filters {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.marketing__filters .pill {
  margin-top: 0;
  width: auto;
}

.marketing__mediums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.medium-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f9fbff 0%, #ffffff 100%);
  border: 1px solid #e4ecf5;
  cursor: pointer;
  color: inherit;
  margin: 0;
  text-align: left;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.medium-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.medium-card.active {
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.medium-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--secondary);
  background: #e8f1ff;
  letter-spacing: 0.04em;
}

.medium-card__icon--search {
  background: linear-gradient(135deg, #e4f1ff, #cde3ff);
}

.medium-card__icon--ads {
  background: linear-gradient(135deg, #fff4e6, #ffe7c2);
}

.medium-card__icon--ga4 {
  background: linear-gradient(135deg, #e8fdf5, #cbf5e5);
}

.medium-card__icon--facebook {
  background: linear-gradient(135deg, #e8ecff, #d5ddff);
}

.medium-card__icon--instagram {
  background: linear-gradient(135deg, #ffe9f2, #ffd9e8);
}

.medium-card__icon--lsa {
  background: linear-gradient(135deg, #ffe6e6, #ffd1d9);
}

.medium-card__name {
  font-weight: 800;
  margin-bottom: 2px;
}

.medium-card__meta {
  color: var(--secondary);
  font-size: 13px;
}

.medium-card__stat {
  text-align: right;
  display: grid;
  gap: 2px;
}

.medium-card__value {
  font-weight: 800;
  color: var(--primary);
}

.medium-card__label {
  font-size: 12px;
  color: var(--secondary);
}

.marketing__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.marketing-kpi {
  display: grid;
  gap: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.kpi-label {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 700;
}

.kpi-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--secondary);
}

.kpi-trend {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
}

.kpi-trend.positive {
  color: #1c8c4d;
}

.kpi-trend.negative {
  color: #b44235;
}

.kpi-sub {
  color: var(--secondary);
  font-size: 13px;
}

.marketing-insight {
  grid-column: span 2;
  background: var(--secondary);
  color: #e6edf7;
  display: grid;
  gap: 8px;
}

.marketing-insight__title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.marketing-insight__summary {
  margin: 0;
  color: #c8d2e0;
}

.marketing-insight__list {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #d9e4f2;
}

.lsa-panel {
  display: grid;
  gap: 16px;
}

.lsa-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lsa-panel__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lsa-banner {
  background: rgba(164, 31, 53, 0.08);
  color: #7a1226;
  border: 1px dashed rgba(164, 31, 53, 0.25);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.lsa-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.lsa-metric {
  display: grid;
  gap: 6px;
}

.lsa-metric__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lsa-metric__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.lsa-metric__sub {
  color: var(--muted);
  font-size: 12px;
}

.lsa-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}

.lsa-table-wrap {
  overflow-x: auto;
}

.lsa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lsa-table thead th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 8px;
}

.lsa-table tbody td {
  padding: 10px 6px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.lsa-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(164, 31, 53, 0.12);
  color: #7a1226;
}

.lsa-status--missed {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.lsa-status--booked {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.lsa-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lsa-action-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lsa-action-btn.primary {
  background: rgba(164, 31, 53, 0.12);
  color: #7a1226;
  border-color: rgba(164, 31, 53, 0.25);
}

.lsa-audio {
  display: grid;
  gap: 12px;
}

.lsa-audio audio {
  width: 100%;
}

.lsa-markets {
  display: grid;
  gap: 16px;
}

.lsa-market-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.lsa-market-tab {
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
  color: #2c2f3d;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lsa-market-tab.active {
  background: #7b1e2b;
  border-color: #7b1e2b;
  color: #fff;
}

.lsa-market-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 12px;
}

.lsa-market-card {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.lsa-market-card.active {
  border-color: rgba(123, 30, 43, 0.6);
  box-shadow: 0 12px 24px rgba(123, 30, 43, 0.2);
}

.lsa-market-card__label {
  font-weight: 700;
  color: #2c2f3d;
}

.lsa-market-card__meta {
  font-size: 12px;
  color: #6b7280;
}

.lsa-market-card__count {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  color: #7b1e2b;
}

.lsa-market-leads {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.lsa-import {
  max-width: 920px;
}

.lsa-import__controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.lsa-import__field {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lsa-import__list {
  border: 1px solid #eceff5;
  border-radius: 14px;
  padding: 12px;
  min-height: 180px;
  background: #f8fafc;
}

.lsa-import__row {
  display: grid;
  grid-template-columns: auto 1.2fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.lsa-import__row:last-child {
  margin-bottom: 0;
}

.lsa-import__row input[type="text"] {
  width: 100%;
}

.lsa-import__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.lsa-import__hint {
  margin-top: 10px;
}

.lsa-import__list .empty {
  color: #64748b;
  text-align: center;
  padding: 24px 0;
}

@media (max-width: 720px) {
  .lsa-import__row {
    grid-template-columns: auto 1fr;
  }
}

.lsa-market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(123, 30, 43, 0.08);
}

.lsa-market-header .lsa-market-title {
  font-weight: 800;
  color: #7b1e2b;
}

.lsa-market-header .lsa-market-meta {
  font-size: 12px;
  color: #6b7280;
}

.lsa-market-group {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.lsa-market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(123, 30, 43, 0.08);
}

.lsa-market-title {
  font-weight: 700;
  color: #7b1e2b;
}

.lsa-market-meta {
  font-size: 12px;
  color: #6b7280;
}

.lsa-market-count {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.lsa-market-body {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
}

.lsa-lead-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 12px;
}

.lsa-lead-name strong {
  display: block;
  font-weight: 700;
}

.lsa-lead-name span {
  font-size: 12px;
  color: #6b7280;
}

.lsa-lead-card select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #fff;
}

.lsa-lead-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lsa-lead-actions .lsa-action-btn {
  padding: 6px 10px;
}

@media (max-width: 900px) {
  .lsa-lead-card {
    grid-template-columns: 1fr;
  }
  .lsa-market-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 1024px) {
  .lsa-content {
    grid-template-columns: 1fr;
  }
}

.automations {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.automations__hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: center;
}

.automations__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.automations__actions .pill {
  margin-top: 0;
  width: auto;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.automation-card {
  background: #ffffff;
  border: 1px solid #e4ecf5;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  text-align: left;
}

.automation-card h3 {
  margin: 0;
}

.automation-card p {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
}

.automation-card__meta {
  font-size: 12px;
  color: var(--secondary);
}

.automation-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #e6f1ff;
  color: var(--primary);
  border-radius: 20px;
  font-weight: 700;
  width: fit-content;
}

.automation-card__tag--blue {
  background: #eaf3ff;
  color: var(--primary);
}

.automation-card__tag--green {
  background: #e8fdf5;
  color: #1c8c4d;
}

.automation-card__tag--purple {
  background: #f0e9ff;
  color: #5a3fc0;
}

.automation-card__tag--orange {
  background: #fff4e6;
  color: #c7651c;
}

.automation-card__tag--teal {
  background: #e7f9fa;
  color: #1f7a83;
}

.automation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.automation-card.active {
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.automation-detail {
  display: grid;
  gap: 10px;
}

.automation-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.automation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.automation-actions .pill {
  margin-top: 0;
  width: auto;
}

.automation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--secondary);
  font-size: 13px;
}

.badge-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e4ecf5;
  background: #f7fbff;
  color: var(--primary);
  font-weight: 700;
}

.automation-builder {
  margin-top: 12px;
  border: 1px solid #e4ecf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 27, 45, 0.06);
}

.builder__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e4ecf5;
}

.builder__breadcrumbs {
  color: var(--secondary);
  font-size: 13px;
  cursor: pointer;
}

.builder__tabs {
  display: inline-flex;
  gap: 6px;
  justify-content: center;
}

.builder__tab {
  border: 1px solid #e4ecf5;
  background: #f7fbff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.builder__tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #eaf3ff;
}

.builder__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.builder__canvas-shell {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 64px;
  align-items: stretch;
}

.builder__toolbar {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px 6px;
  border-right: 1px solid #e4ecf5;
}

.builder__canvas {
  position: relative;
  min-height: 520px;
  background: repeating-linear-gradient(
      0deg,
      #f5f7fa,
      #f5f7fa 1px,
      transparent 1px,
      transparent 16px
    ),
    repeating-linear-gradient(
      90deg,
      #f5f7fa,
      #f5f7fa 1px,
      transparent 1px,
      transparent 16px
    );
  background-color: #fbfdff;
  padding: 24px 60px;
  overflow: hidden;
}

.builder__canvas-empty {
  color: var(--secondary);
  text-align: center;
  margin-top: 200px;
}

.builder__zoom {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-left: 1px solid #e4ecf5;
}

.tool-btn {
  background: #fff;
  border: 1px solid #e4ecf5;
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 27, 45, 0.06);
  font-weight: 800;
  color: var(--primary);
}

.builder__controls {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e4ecf5;
  justify-content: flex-end;
}

.builder__lane {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.builder__node {
  background: #fff;
  border: 1px solid #e4ecf5;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(15, 27, 45, 0.08);
  display: grid;
  gap: 6px;
  position: relative;
}

.builder__node-label {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder__node-sub {
  color: var(--secondary);
  font-size: 13px;
}

.builder__connector {
  width: 2px;
  background: #d3dce8;
  height: 32px;
  margin: 8px auto;
}

.builder__add-inline {
  display: flex;
  justify-content: center;
  margin: 6px 0 10px;
}

.node-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #eaf3ff;
  font-weight: 800;
}

.node-trigger {
  border-color: #c6e6d8;
  background: #f3fbf7;
}

.node-action {
  border-color: rgba(93, 99, 129, 0.2);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--secondary);
}

.note-modal__tabs {
  margin: 0 16px;
}

.note-modal__body {
  padding: 12px 16px 4px;
}

.note-pane.hidden {
  display: none;
}

.note-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.note-textarea {
  width: 100%;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  min-height: 140px;
  resize: vertical;
}

.note-helper {
  margin-top: 6px;
  color: var(--secondary);
  font-size: 13px;
}

.record-card {
  border: 1px dashed #d8e2ef;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
  display: grid;
  gap: 10px;
}

.record-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.record-timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.record-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.record-playback audio {
  width: 100%;
}

.note-status {
  flex: 1;
  color: var(--primary);
  font-size: 13px;
  min-height: 18px;
}

.note-status.error {
  color: #b42318;
}

.toast {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 440px;
  max-width: 92vw;
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 32px 96px rgba(0, 0, 0, 0.16),
    0 8px 30px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), opacity 250ms ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.toast__content {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
}

.toast__icon-container {
  grid-column: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 2px;
}

.toast__text-container {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.toast__title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.toast__message {
  font-size: 13.5px;
  line-height: 1.5;
  color: #475569;
}

.toast__actions {
  grid-column: 1 / span 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.toast__action-btn {
  min-width: 90px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #334155;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.toast__action-btn:hover {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.18);
}

.toast__action-btn--primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toast__action-btn--primary:hover {
  background: #1e293b;
}

.auth-screen {
  position: fixed;
  inset: 0;
  background: #f8fafc;
  display: grid;
  place-items: stretch;
  padding: 0;
  z-index: 1300;
}

.auth-screen.hidden {
  display: none;
}

#appShell.hidden {
  display: none;
}

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  min-height: 100vh;
}

.auth-showcase {
  position: relative;
  background: linear-gradient(135deg, #2b0b12 0%, #5a1422 45%, var(--primary) 100%);
  color: #ffffff;
  padding: 80px;
  display: grid;
  gap: 24px;
  align-content: center;
  overflow: hidden;
}

.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 185, 200, 0.25), transparent 46%),
    radial-gradient(circle at 80% 10%, rgba(255, 140, 170, 0.18), transparent 52%),
    radial-gradient(circle at 70% 82%, rgba(43, 11, 18, 0.95), transparent 55%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.08) 0%, transparent 55%);
  opacity: 0.8;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 145, 170, 0.12), transparent 35%),
    radial-gradient(circle at 75% 70%, rgba(255, 210, 220, 0.14), transparent 42%),
    conic-gradient(from 120deg, rgba(255, 255, 255, 0.08), transparent 30%, rgba(255, 115, 145, 0.14), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.6;
  pointer-events: none;
}

.auth-showcase > * {
  position: relative;
  z-index: 1;
}

.auth-showcase h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  max-width: 520px;
}

.auth-showcase .muted {
  color: rgba(255, 255, 255, 0.75);
  font-size: 17px;
  line-height: 1.6;
  max-width: 480px;
}

.auth-showcase__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  width: fit-content;
}

.auth-showcase__stats {
  display: flex;
  gap: 48px;
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 32px;
  max-width: 520px;
}

.auth-showcase__stats > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-showcase__stats strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
}

.auth-showcase__stats span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-showcase__glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 228, 0.4), transparent 70%);
  bottom: -80px;
  right: -40px;
  opacity: 0.6;
}

.auth-panel {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: 440px;
}

.auth-brand-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-brand-logo {
  height: 200px;
  object-fit: contain;
}

.auth-card h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.auth-card .muted {
  color: #64748b;
  font-size: 15px;
  margin-top: -12px;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.2s ease;
}

.auth-form input:hover {
  border-color: rgba(15, 23, 42, 0.2);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(164, 31, 53, 0.1);
}

.auth-form .cta {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.25);
  margin-top: 8px;
}

.auth-form .cta:hover {
  background: #8b1527;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(164, 31, 53, 0.3);
}

.auth-form .cta:active {
  transform: translateY(0);
}

@media (max-width: 960px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    padding: 60px 40px;
  }

  .auth-panel {
    padding: 40px 24px;
  }
}

.toast__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toast__action {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.toast__action:hover {
  border-color: rgba(255, 255, 255, 0.7);
}

.quick-actions {
  position: relative;
}


.handoff-card {
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.handoff-card .muted {
  margin: 0;
  color: var(--secondary);
}

.handoff-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.handoff-actions input {
  flex: 1;
  min-width: 160px;
  border: 1px solid rgba(93, 99, 129, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
}

.pill--danger {
  background: #b42318;
  color: #fff;
}

.pill--ghost {
  background: #eef2f6;
  color: var(--primary);
}

.role-block.hidden {
  display: none;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.probate-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.probate-dashboard-card {
  border: 1px solid rgba(93, 99, 129, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 10px;
  min-height: 180px;
}

.probate-dashboard-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #22324b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.queue-item {
  border: 1px solid rgba(93, 99, 129, 0.08);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.queue-item__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.queue-item__title {
  font-weight: 700;
  color: #0f172a;
}

.queue-item__meta {
  color: var(--secondary);
  font-size: 12px;
}

.queue-item__link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.queue-item__link:hover {
  text-decoration: underline;
}

.queue-item__sla {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 12px;
}

.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid transparent;
}

.sla-ok {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

.sla-warn {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}

.sla-urgent {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecdd3;
}

.subnav {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
}

.dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 0;
}

.dashboard-range,
.dashboard-range__custom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-range__custom input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.dashboard-range .pill.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.subnav__tab {
  border: 1px solid rgba(93, 99, 129, 0.2);
  background: #ffffff;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.subnav__tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot--muted {
  background: #cdd8e5;
}

.dot--live {
  background: #d22d2d;
}
@media (max-width: 720px) {
  .marketing__filters {
    justify-content: flex-start;
  }
  .marketing-insight {
    grid-column: span 1;
  }
}

.intake-page {
  background: radial-gradient(circle at top, rgba(8, 89, 154, 0.12), transparent 55%), #f5f7fb;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.intake-shell {
  width: min(640px, 100%);
}

.intake-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(16, 35, 64, 0.12);
  border: 1px solid rgba(8, 89, 154, 0.08);
}

.intake-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #08599a;
  margin-bottom: 12px;
}

.intake-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.intake-form label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: #14213d;
}

.intake-form input,
.intake-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(20, 33, 61, 0.15);
  font-size: 0.95rem;
  background: #fff;
}

.intake-form textarea {
  resize: vertical;
}

.intake-form .cta {
  margin-top: 4px;
}

/* Probate Dashboard Modern Styles */
.probate-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.probate-dashboard-card {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.probate-dashboard-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.queue-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.queue-item__info {
  display: flex;
  flex-direction: column;
}

.queue-item__title {
  font-weight: 600;
  font-size: 14px;
}

.queue-item__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge--danger {
  background: #FEE2E2;
  color: #B91C1C;
}

.badge--warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge--success {
  background: #f5f3ff;
  color: #6d28d9;
}

.badge--info {
  background: #DBEAFE;
  color: #1E40AF;
}

/* Probate Timeline Component */
.probate-timeline-container {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-main);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.probate-timeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-width: 800px;
  position: relative;
  padding-top: 20px;
}

.probate-timeline::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 40px;
  right: 40px;
  height: 4px;
  background: var(--border);
  z-index: 1;
}

.probate-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.probate-timeline-step.completed .step-node {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.probate-timeline-step.active .step-node {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.probate-timeline-step.completed .step-label,
.probate-timeline-step.active .step-label {
  color: var(--text-main);
}

.step-meta {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Probate Command Center Styles */
.probate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.probate-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 4px;
}

.probate-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.probate-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.probate-stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 35px rgba(164, 31, 53, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
  border-color: rgba(164, 31, 53, 0.5);
  background: linear-gradient(to bottom right, #ffffff, #fffafa);
}

.probate-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.probate-stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.probate-stat-value.danger { color: #dc2626; }
.probate-stat-value.warning { color: #d97706; }
.probate-stat-value.success { color: #8b5cf6; }

.probate-stat-delta {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.probate-dash-layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 24px;
}

@media (max-width: 1200px) {
  .probate-dash-layout {
    grid-template-columns: 1fr;
  }
}

.probate-dash-main,
.probate-dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.estate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.estate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.estate-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0.5;
}

.estate-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.estate-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.estate-card__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
}

.estate-card__number {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.estate-card__progress-track {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.estate-card__progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.estate-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.estate-card__stage {
  font-weight: 600;
  color: var(--primary);
}

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

.deadline-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deadline-item {
  padding: 14px;
  border-radius: var(--radius);
  background: #f8fafc;
  border-left: 4px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deadline-item.urgent { border-left-color: #ef4444; background: #fef2f2; }
.deadline-item.warning { border-left-color: #f59e0b; background: #fffbeb; }

.deadline-item__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.deadline-item__date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.doc-intake-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-intake-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.doc-intake-item:hover {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.doc-info__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.doc-info__sub {
  font-size: 12px;
  color: var(--text-muted);
}

.doc-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
  width: fit-content;
}

.doc-status.verified { background: #f5f3ff; color: #7c3aed; }
.doc-status.pending { background: #fef9c3; color: #854d0e; }

.matters-table tbody tr {
  cursor: pointer;
  transition: all 0.2s ease;
}

.matters-table tbody tr:hover {
  background: #f8fafc;
}

/* Insights & Enrichment Dashboard */
.insights-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.probate-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.probate-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.probate-stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.probate-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.probate-stat-value.success { color: #8b5cf6; }
.probate-stat-value.warning { color: #f59e0b; }
.probate-stat-value.error { color: #ef4444; }

.probate-stat-delta {
  font-size: 0.75rem;
  color: var(--secondary);
}

.probate-dash-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .probate-dash-layout {
    grid-template-columns: 1fr;
  }
}

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

.enrichment-event-item:hover {
  background: var(--bg-main);
}

.probate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.smallest { font-size: 0.75rem; }
.smallest.muted { color: var(--secondary); }

/* Prospect Lookup & Intelligence Styles */
.insights-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-main);
}

.insights-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.insights-hero {
  padding: 5rem 2rem;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  color: white;
  border-radius: 24px;
  text-align: center;
  margin-bottom: 3rem;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.insights-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(164, 31, 53, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.lookup-box {
  max-width: 600px;
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lookup-field {
  width: 100%;
}

.lookup-actions {
  width: 100%;
}

.lookup-actions .pill--primary {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 12px;
  background: var(--primary);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(164, 31, 53, 0.3);
  transition: all 0.3s ease;
}

.lookup-actions .pill--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(164, 31, 53, 0.5);
  background: #c02540;
}

.insights-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, #a41f35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.lookup-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.25rem 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
}

.lookup-input-wrap:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(164, 31, 53, 0.5);
  box-shadow: 0 0 0 4px rgba(164, 31, 53, 0.1);
}

.lookup-icon {
  width: 20px;
  height: 20px;
  fill: rgba(255, 255, 255, 0.4);
  margin-right: 1rem;
}

.lookup-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem 0;
  font-size: 1.2rem;
  outline: none;
  color: white;
  width: 100%;
}

.lookup-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

#runLookupBtn {
  transition: all 0.3s ease;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#runLookupBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(164, 31, 53, 0.4);
}

.lookup-suggestions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  align-items: center;
}

.suggestion-tag {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-tag:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.prospect-card {
  padding: 0;
  overflow: hidden;
}

.prospect-card__header {
  padding: 2rem;
  background: var(--bg-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.prospect-identity {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.prospect-logo {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.prospect-tabs {
  display: flex;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  gap: 2rem;
}

.prospect-tab {
  padding: 1rem 0;
  border: none;
  background: none;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.prospect-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.prospect-content {
  padding: 2rem;
}

.info-grid {
  display: grid;
  gap: 2rem;
}

.info-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.info-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.intel-card {
  background: var(--bg-main);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.intel-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.intel-score {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  background: white;
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* Intelligence Dashboard Visuals */
.probate-visuals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.visual-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.visual-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

/* Trend Chart (SVG implementation) */
.trend-chart-container {
  width: 100%;
  height: 180px;
  position: relative;
}

.chart-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Donut Chart */
.donut-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.donut-chart {
  width: 140px;
  height: 140px;
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: conic-gradient(
    var(--primary) 0% 35%,
    var(--success) 35% 60%,
    var(--warning) 60% 85%,
    var(--border) 85% 100%
  );
}

.donut-chart::after {
  content: "";
  width: 80px;
  height: 80px;
  background: var(--bg-card, #fff);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Funnel Chart */
.funnel-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.funnel-label {
  flex: 0 0 160px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.funnel-track {
  flex: 1;
  height: 8px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 1s ease;
  opacity: 0.8;
}

.funnel-value {
  flex: 0 0 40px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
  text-align: right;
}

/* Workflow Labels */
.badge-workflow {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge-ai { background: rgba(139, 92, 246, 0.12); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-human { background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-decision { background: rgba(245, 158, 11, 0.12); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-local { background: rgba(59, 130, 246, 0.12); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.3); }

.badge-ai::before { content: "●"; }
.badge-human::before { content: "○"; }
.badge-decision::before { content: "◆"; }
.badge-local::before { content: "§"; }

.priority-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.priority-pill--high { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.priority-pill--medium { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.priority-pill--low { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.2); }

/* Tab View Styling */
.tab-view-container {
  padding: 2rem;
  border-radius: 16px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

.tab-view-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tab-header-text h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.tab-header-text p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: 12px;
  max-width: 500px;
  margin: 2rem auto;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.empty-state-card p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.matter-activities-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

/* Decision Point Wizards & Guidance */
.decision-wizard {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.decision-wizard__header {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.decision-wizard__title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.priority-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.priority-item:hover {
  border-color: var(--primary);
}

.priority-item__level {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.priority-item__label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Local Rules Banners */
.local-rules-banner {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 1rem;
  display: flex;
  gap: 12px;
}

.local-rules-banner__icon {
  color: #3b82f6;
  font-size: 1.2rem;
}

.local-rules-banner__content {
  flex: 1;
}

.local-rules-banner__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 4px;
}

.local-rules-banner__text {
  font-size: 0.8rem;
  color: #374151;
  line-height: 1.4;
}

/* Qualification Alerts */
.qualification-alert {
  padding: 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-top: 1rem;
  display: flex;
  gap: 10px;
}

.qualification-alert--error {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.qualification-alert--warning {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400e;
}

/* Phase 9: Special Situations Alerts */
.probate-alert {
  margin: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: alertFadeIn 0.3s ease;
}

.probate-alert--danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: #b91c1c;
}

.probate-alert--warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  color: #92400e;
}

.probate-alert--info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--primary);
  color: #1e40af;
}

.probate-alert__title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.probate-alert__message {
  font-size: 0.85rem;
  line-height: 1.4;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Estate Wizard Panels */
.wizard-body {
  min-height: 300px;
  position: relative;
}

.wizard-step-panel {
  display: none;
  animation: slideIn 0.3s ease;
}

.wizard-step-panel.active {
  display: block;
}

.wizard-header-content {
  flex: 1;
}

.wizard-progress {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.wizard-progress__bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

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

/* Responsive Dashboard Overrides */
@media (max-width: 1024px) {
  .probate-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .probate-visuals-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .probate-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .probate-header__actions {
    width: 100%;
  }
  
  .probate-header__actions .pill {
    width: 100%;
    justify-content: center;
  }
  
  .probate-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .probate-dash-layout {
    grid-template-columns: 1fr;
  }
  
  .visual-card {
    min-height: auto;
  }

  .donut-container {
    flex-direction: column;
    text-align: center;
  }
}

/* Sidebar and Main Content adjustments for mobile */
@media (max-width: 480px) {
  main {
    padding: 1rem;
  }
  
  .probate-stat-value {
    font-size: 24px;
  }
  
  .card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Top Bar Responsiveness */
@media (max-width: 900px) {
  .search-shell--wide {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .header-left {
    order: 1;
  }
  
  .header-right {
    order: 2;
  }
  
  .header-center {
    order: 3;
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .ai-search-container {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .header-left span {
    display: none;
  }
  
  .btn-modern {
    padding: 10px;
  }
  
  .header-divider {
    display: none;
  }
}

/* Global Mobile Responsiveness for Overview Page */
@media screen and (max-width: 850px) {
  /* Force Sidebar to hide or collapse if not handled */
  .sidebar {
    width: 70px !important;
  }
  .sidebar span {
    display: none;
  }
  
  /* Main Content Area */
  .content {
    margin-left: 70px !important;
    padding: 15px !important;
  }

  /* Grid stacking */
  .probate-stats-grid, 
  .probate-visuals-grid, 
  .probate-dash-layout {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }

  /* Stat Values */
  .probate-stat-value {
    font-size: 24px !important;
  }

  /* Chart Cards */
  .visual-card {
    height: auto !important;
    min-height: 300px;
  }

  /* Header Actions Stacking */
  .probate-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }

  /* Top Search Bar */
  .search-shell {
    flex-direction: column;
    gap: 10px;
  }
  .header-center {
    width: 100% !important;
  }
  .ai-search-container {
    width: 100% !important;
  }
}

/* Sleek Dashboard & Modal Overrides */

/* 1. Premium Modals */
.modal {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px);
}

.modal__content {
  border-radius: 24px !important;
  padding: 32px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3) !important;
}

.modal__header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* 2. Refined Wizard Buttons */
.modal__actions {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 24px !important;
}

.modal__actions .pill {
  width: auto !important;
  min-width: 120px !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 10px 24px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  transform: none !important;
}

.modal__actions .pill--ghost {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.modal__actions .pill--ghost:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.modal__actions .pill:not(.pill--ghost),
.modal__actions .cta {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
}

.modal__actions .pill:not(.pill--ghost):hover,
.modal__actions .cta:hover {
  background: #871a2b !important;
  color: #ffffff !important;
}

.modal__actions .pill:disabled {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

/* 3. Sleek Inputs & 2x2 Grid Layout */
.wizard-panel .form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px 20px !important;
}

.wizard-panel .form-grid label {
  grid-column: span 1 !important;
}

.wizard-panel[data-step="3"] .form-grid label {
  grid-column: span 2 !important;
}

.wizard-body input, 
.wizard-body select, 
.wizard-body textarea {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  color: #0f172a !important;
  outline: none !important;
}

.wizard-body input:focus, 
.wizard-body select:focus, 
.wizard-body textarea:focus {
  border-color: var(--primary) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(164, 31, 53, 0.1) !important;
}

.wizard-body select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
}

/* Custom Select Dropdown Styling */
.custom-select-container {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  color: #0f172a !important;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  user-select: none;
  
  /* Custom select arrow styling */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
}

.custom-select-trigger.active {
  border-color: var(--primary) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(164, 31, 53, 0.1) !important;
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 16px -6px rgba(15, 23, 42, 0.04);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-select-options.hidden {
  display: none !important;
}

.custom-select-option {
  padding: 10px 14px;
  font-size: 13.5px;
  color: #334155;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  text-align: left;
  user-select: none;
}

.custom-select-option:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.custom-select-option.selected {
  background: rgba(164, 31, 53, 0.08) !important;
  color: var(--primary) !important;
  font-weight: 600;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 4. Modernizing Bottom Cards (Case Progress & Feeds) */
.estate-grid, .doc-intake-list, .deadline-feed {
  gap: 12px !important;
}

.estate-card, .doc-intake-item, .deadline-item {
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: 16px !important;
  padding: 16px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
}

.estate-card:hover, .doc-intake-item:hover, .deadline-item:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.06) !important;
  border-color: var(--primary-light) !important;
}

.card__header span {
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  color: #1e293b !important;
}

/* Refined View All Micro-Pill */
#viewAllDocs {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 10px !important;
  font-size: 11px !important;
  height: auto !important;
  width: auto !important;
  background: rgba(164, 31, 53, 0.05) !important;
  color: var(--primary) !important;
  border: none !important;
  opacity: 0.8;
}

#viewAllDocs:hover {
  opacity: 1;
  background: rgba(164, 31, 53, 0.1) !important;
}

#recentDocsSection {
  position: relative;
}

/* Platform Footer Styles */
.app-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  width: 100%;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  margin-top: auto;
}

/* Redesigned Grid-style Progress Path (Google Cloud Console Stepper Style) */
.workflow-path {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  width: 100%;
  padding: 12px 0;
}

.workflow-step {
  height: 42px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px; /* Clean modern card/pill layout */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 16px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.workflow-step span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.workflow-step:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.workflow-step--done {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #ffffff !important;
}

.workflow-step--done:hover {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
}

.workflow-step.workflow-step--active {
  background: var(--primary) !important; /* Burgundy #a41f35 */
  border-color: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 6px -1px rgba(164, 31, 53, 0.2), 0 2px 4px -1px rgba(164, 31, 53, 0.1) !important;
}

.workflow-step.workflow-step--active:hover {
  background: #8c1a2d !important;
  border-color: #8c1a2d !important;
  color: #ffffff !important;
}

.workflow-step.workflow-step--current:not(.workflow-step--active) {
  border: 1.5px dashed var(--primary) !important;
  color: var(--primary) !important;
  background: rgba(164, 31, 53, 0.02) !important;
}

.workflow-step.workflow-step--current:not(.workflow-step--active):hover {
  background: rgba(164, 31, 53, 0.06) !important;
  border-color: var(--primary) !important;
}

.workflow-step .step-icon {
  margin-right: 6px;
  font-size: 14px;
}

/* Matter Profile Hero Section */
.matter-profile__hero {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 24px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat__label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-stat__value {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.hero-stat__sub {
  font-size: 12px;
  color: #94a3b8;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

/* Probate AI Findings */
.probate-ai-finding {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.probate-ai-finding--warning {
  border-left: 4px solid #f59e0b;
}

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

.finding-header .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(164, 31, 53, 0.08);
  color: var(--primary, #a41f35);
  flex-shrink: 0;
}

.finding-header .icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finding-header h6 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.finding-body p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 16px;
}

.finding-actions {
  display: flex;
  gap: 8px;
}

/* Probate Party Layout */
.probate-party-group {
  margin-bottom: 20px;
}

.probate-party-group h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.probate-party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.probate-party-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.party-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.party-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.party-sub {
  font-size: 11px;
  color: #64748b;
}

/* Probate Deadlines */
.probate-date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  margin-bottom: 8px;
}

.date-info {
  display: flex;
  flex-direction: column;
}

.date-label {
  font-size: 11px;
  color: #94a3b8;
}

.date-value {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.date-status {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status--warning { background: #fef3c7; color: #d97706; }
.status--danger { background: #fee2e2; color: #dc2626; }
.status--success { background: #ede9fe; color: #7c3aed; }
.status--pending { background: #f1f5f9; color: #64748b; }


/* Insights Module - Refined Contact Profiles */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: white;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.contact-row:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.08);
}

.contact-profile {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.contact-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #c02540);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(164, 31, 53, 0.2);
}

.contact-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

.contact-actions {
  display: flex;
  gap: 0.5rem;
}

.pill--sm {
  padding: 0.5rem 1rem !important;
  font-size: 0.8rem !important;
  height: auto !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.pill--soft {
  background: rgba(164, 31, 53, 0.05) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(164, 31, 53, 0.1) !important;
}

.pill--soft:hover {
  background: var(--primary) !important;
  color: white !important;
}

.pill--soft .icon {
  fill: currentColor !important;
}

/* ============================================
   MATTER PROFILE — TAB CONTENT VIEWS
   ============================================ */

.matter-tab-content {
  padding: 24px 32px;
  animation: tabFadeIn 0.25s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-view-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.tab-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}

.tab-view-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 2px 0;
  letter-spacing: -0.01em;
}

.tab-view-header p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.tab-view-body {
  padding: 20px 24px;
}

/* ---- List rows (Tasks, Notes, Documents) ---- */
.tab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-list-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tab-list-item:hover {
  border-color: #8b5cf6;
  background: #f5f3ff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08);
}

.tab-list-item__check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: #94a3b8;
}

.tab-list-item__check.is-done {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: #ffffff;
}

.tab-list-item__body {
  flex: 1;
  min-width: 0;
}

.tab-list-item__title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 5px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-list-item__note-body {
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  margin: 0 0 6px 0;
  white-space: pre-wrap;
  line-height: 1.5;
  word-break: break-word;
}

.tab-list-item__meta {
  font-size: 13px;
  color: #94a3b8;
}

/* ---- Calendar date tile ---- */
.tab-list-item__date {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  padding: 4px 0;
}

.date-month {
  font-size: 8px;
  font-weight: 800;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.05em;
}

.date-day {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

/* ---- Empty states ---- */
.tab-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.tab-empty-state .empty-icon {
  font-size: 40px;
}

.tab-empty-state h4 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.tab-empty-state p {
  font-size: 13px;
  color: #94a3b8;
  max-width: 280px;
  margin: 0;
}

/* ---- Utility classes ---- */
.line-through { text-decoration: line-through; opacity: 0.6; }
.text-danger   { color: #dc2626 !important; }

.pill--xs {
  padding: 3px 8px !important;
  font-size: 11px !important;
  height: auto !important;
}

.pill--primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
}

.pill--primary:hover {
  background: var(--primary-dark, #8b1128) !important;
}

.pill--indigo {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: none !important;
}

/* ============================================
   OVERVIEW PAGE — Schedule & Tasks Panels
   ============================================ */

.overview-list {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.overview-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.overview-list__item:last-child {
  border-bottom: none;
}

.overview-list__item:hover {
  background: #f8fafc;
}

.overview-list__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.overview-list__dot--danger {
  background: #dc2626;
}

.overview-list__text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-list__meta {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}

.overview-list__empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

/* ============================================
   MATTERS LIST VIEW
   ============================================ */

.matters-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 16px;
}

.matters-list-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
  margin: 0;
}

.matters-list-header button,
.matters-list-header .pill {
  width: auto !important;
  padding: 7px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  height: auto !important;
  flex-shrink: 0;
}

/* Filter tabs */
.matters-filter-tabs {
  display: flex;
  gap: 2px;
  padding: 0 32px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.matters-filter-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  width: auto !important;
  height: auto !important;
  line-height: 1.4;
}

.matters-filter-tab:hover {
  background: #f8fafc;
  color: #1e293b;
}

.matters-filter-tab.active {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Table */
.matters-table-wrap {
  padding: 0 32px 32px;
}

.matters-table {
  width: 100%;
  border-collapse: collapse;
}

.matters-table thead tr {
  border-bottom: 1px solid #f1f5f9;
}

.matters-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.matters-table__row {
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.12s;
}

.matters-table__row:hover {
  background: #f8fafc;
}

.matters-table__row:last-child {
  border-bottom: none;
}

.matters-table td {
  padding: 14px 12px;
  font-size: 13px;
  color: #475569;
  vertical-align: middle;
}

.matters-table__name {
  font-weight: 600 !important;
  color: #1e293b !important;
  max-width: 280px;
}

.matters-table__type {
  color: #64748b !important;
}

.matters-table__date {
  color: #64748b !important;
  white-space: nowrap;
}

.matters-table__ai {
  text-align: center;
}

.matters-table__empty td {
  text-align: center;
  padding: 48px;
  color: #94a3b8;
  font-size: 13px;
}

/* ── Estates page redesign ─────────────────────────────── */

/* Subtitle under h1 */
.estates-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 400;
}

/* Heirlo AI search bar */
.estates-ai-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbf0;
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.estates-ai-bar:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.estates-ai-bar__icon {
  color: #94a3b8;
  flex-shrink: 0;
}

.estates-ai-bar__input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: #1e293b;
  font-family: inherit;
  min-width: 0;
}

.estates-ai-bar__input::placeholder {
  color: #94a3b8;
}

.estates-ai-bar__btn {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 4px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: opacity 0.15s !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  width: auto !important;
  height: auto !important;
  white-space: nowrap !important;
  line-height: 1.6 !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: unset !important;
}

.estates-ai-bar__btn:hover {
  opacity: 0.85 !important;
}

/* Sortable column headers */
.matters-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.matters-th-sortable:hover {
  color: #475569;
}

.matters-th-sortable.sort-asc,
.matters-th-sortable.sort-desc {
  color: var(--primary);
}

.sort-caret {
  font-size: 10px;
  opacity: 0.5;
  margin-left: 3px;
}

.matters-th-sortable.sort-asc .sort-caret,
.matters-th-sortable.sort-desc .sort-caret {
  opacity: 1;
  color: var(--primary);
}

/* New table columns */
.matters-table__client {
  color: #334155;
  font-size: 13px;
}

.matters-table__step {
  white-space: nowrap;
}

.matters-table__action {
  color: #475569;
  font-size: 13px;
}

/* Probate workflow step badges */
.step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.step--prefiling {
  background: #e0f2fe;
  color: #0369a1;
}

.step--filing {
  background: #f5f3ff;
  color: #7c3aed;
}

.step--notice {
  background: #fef9c3;
  color: #854d0e;
}

.step--claims {
  background: #fde8d8;
  color: #9a3412;
}

.step--accounting {
  background: #ede9fe;
  color: #5b21b6;
}

.step--closing {
  background: #f1f5f9;
  color: #475569;
}

/* Sort hint footer */
.matters-sort-hint {
  padding: 8px 32px 12px;
  font-size: 11px;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  font-style: italic;
}

/* ── Goal-based Probate Workflow ────────────────────────────────────────── */

/* Panel header */
.pw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.pw-header h4 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 2px;
}

.pw-header__meta {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* Current step hero card */
.pw-current-card {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.pw-current-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.pw-current-card__desc {
  font-size: 13px;
  color: #475569;
  margin: 0 0 14px;
  line-height: 1.6;
}

.pw-current-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Workflow action buttons */
.pw-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 16px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  width: auto !important;
  height: auto !important;
  white-space: nowrap !important;
  min-width: unset !important;
  line-height: 1.4 !important;
}

.pw-btn--primary {
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
}

.pw-btn--primary:hover {
  opacity: 0.88 !important;
}

.pw-btn--outline {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.pw-btn--outline:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

/* Goal stepper section */
.pw-goal-section {
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
}

/* Inline variant — sits below the step banner, above the AI card */
.pw-goal-section--inline {
  margin-bottom: 0;
  border-radius: 0 0 12px 12px;
  border-top: none;
  background: #f8fafc;
  padding: 12px 20px 14px;
  overflow: visible;
}

/* In inline mode: hide the label, hide desc, compress arrows & chips */
.pw-goal-section--inline .pw-goal-label {
  display: none;
}

.pw-goal-section--inline .pw-step-desc {
  display: none;
}

.pw-goal-section--inline .pw-goal-arrow {
  font-size: 14px;
  margin-top: 7px;
  padding: 0 1px;
  color: #cbd5e1;
}

.pw-goal-section--inline .pw-goal-step-wrap {
  min-width: 0;
  gap: 0;
  flex: 1 1 0;
}

.pw-goal-section--inline .pw-goal-step {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
  min-width: 0;
}

.pw-goal-section--inline .pw-goal-step--active {
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  transform: translateY(-1px);
}

.pw-goal-section--inline .pw-goal-stepper {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

/* ── Step progress banner ───────────────────────────────────── */
.pw-step-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #a41f35 0%, #7f1226 100%);
  border-radius: 12px 12px 0 0;
  padding: 18px 24px;
  color: #fff;
  gap: 12px;
}

.pw-step-banner__left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pw-step-banner__counter {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
  min-width: 72px;
}

.pw-step-banner__divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.3);
  border-radius: 1px;
}

.pw-step-banner__name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.pw-step-banner__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pw-step-banner__of {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pw-goal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* Horizontal stepper row */
.pw-goal-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  width: 100%;
}

.pw-goal-step-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 90px;
}

.pw-goal-arrow {
  font-size: 22px;
  color: #cbd5e1;
  padding: 0 2px;
  line-height: 1;
  align-self: flex-start;
  margin-top: 12px;
  flex-shrink: 0;
}

.pw-goal-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  white-space: nowrap;
  user-select: none;
  width: 100%;
  text-align: center;
}

.pw-goal-step:hover {
  border-color: #94a3b8;
  color: #334155;
  background: #f1f5f9;
}

/* Completed step */
.pw-goal-step--done {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #ffffff !important;
}

.pw-goal-step--done:hover {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
}

/* Currently active (selected) step */
.pw-goal-step--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(164, 31, 53, 0.35);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  transform: translateY(-1px);
}

/* Active chip in inline banner — no transform so it doesn't overflow container */
.pw-goal-step--active-inline {
  transform: none !important;
  box-shadow: 0 2px 8px rgba(164, 31, 53, 0.3) !important;
}

.pw-goal-step--current {
  border-color: var(--primary);
  color: var(--primary);
}

.pw-step-check {
  font-size: 13px;
  font-weight: 800;
}

.pw-step-label {
  font-size: 13.5px;
}

.pw-step-desc {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  max-width: 120px;
  line-height: 1.4;
  padding: 0 4px;
}

/* Context hub below stepper */
.pw-context-hub {
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.pw-context-hub__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  padding: 14px 20px 0;
  background: #ffffff;
}

/* ── Estate Profile: Breadcrumb ─────────────────────────────────────────── */

.mp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.mp-breadcrumb__link {
  color: var(--primary);
  font-weight: 500;
}

.mp-breadcrumb__link:hover {
  text-decoration: underline;
}

.mp-breadcrumb__sep {
  color: #cbd5e1;
}

.mp-breadcrumb__current {
  color: #475569;
  font-weight: 500;
}

/* ── Estate Profile: Workflow tab two-column layout ─────────────────────── */

.ep-workflow-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .ep-workflow-grid { grid-template-columns: 1fr; }
}

.ep-workflow-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── AI Action Card ─────────────────────────────────────────────────────── */

.ep-ai-card {
  display: flex;
  gap: 14px;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  padding: 18px 20px;
}

.ep-ai-card__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.ep-ai-card__body {
  flex: 1;
  min-width: 0;
}

.ep-ai-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.ep-ai-card__desc {
  font-size: 13px;
  color: #475569;
  margin: 0 0 14px;
  line-height: 1.6;
}

.ep-ai-card__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ep-ai-card__status {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

/* Estate profile action buttons */
.ep-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 14px !important;
  border-radius: 7px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  width: auto !important;
  height: auto !important;
  white-space: nowrap !important;
  min-width: unset !important;
  line-height: 1.4 !important;
}

.ep-btn--primary {
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
}

.ep-btn--primary:hover { opacity: 0.88 !important; }

.ep-btn--outline {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.ep-btn--outline:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

.ep-btn--ghost {
  background: transparent !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
}

.ep-btn--ghost:hover {
  background: #f1f5f9 !important;
}

/* ── AI prepared / Attorney reviews columns ─────────────────────────────── */

.ep-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.ep-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 10px;
}

.ep-check-list,
.ep-review-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ep-check-list li,
.ep-review-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.ep-check {
  color: #8b5cf6;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ep-warn {
  color: #d97706;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Draft preview ──────────────────────────────────────────────────────── */

.ep-draft-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.ep-draft-preview__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 10px;
}

.ep-draft-preview__body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
}

.ep-draft-preview__subject {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.ep-draft-preview__text {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.6;
}

/* ── Case Pulse sidebar ─────────────────────────────────────────────────── */

.ep-workflow-right {
  position: sticky;
  top: 16px;
}

.ep-case-pulse {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
}

.ep-case-pulse__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 14px;
}

.ep-case-pulse__row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.ep-case-pulse__row:last-child {
  border-bottom: none;
}

.ep-pulse-key {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ep-pulse-val {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.ep-pulse-val--phase {
  color: #0369a1;
  background: #e0f2fe;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.ep-pulse-val--ai {
  color: #7c3aed;
}

.ep-pulse-val--blocked {
  color: var(--primary);
}


.matters-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.matters-status--open,
.matters-status--active {
  background: #f5f3ff;
  color: #8b5cf6;
}

.matters-status--pending,
.matters-status--on-hold {
  background: #fef3c7;
  color: #d97706;
}

.matters-status--closed,
.matters-status--complete,
.matters-status--completed {
  background: #f1f5f9;
  color: #64748b;
}

/* AI badge */
.matters-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
}

.matters-ai-badge--empty {
  background: #f1f5f9;
  color: #cbd5e1;
}

/* ============================================
   MATTER PROFILE — Redesigned Layout
   ============================================ */

.matter-profile {
  padding: 0;
}

/* Breadcrumb */
.mp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 32px 0;
  font-size: 13px;
}

.mp-breadcrumb__link {
  color: var(--primary, #a41f35);
  text-decoration: none;
  font-weight: 500;
}

.mp-breadcrumb__link:hover { text-decoration: underline; }

.mp-breadcrumb__sep { color: #cbd5e1; }

.mp-breadcrumb__current { color: #64748b; }

/* Title row */
.mp-title-row {
  padding: 8px 32px 0;
}

.mp-title {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 2px 0;
  letter-spacing: -0.02em;
}

.mp-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

/* Profile Header Actions */
.profile-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-profile-edit {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
  padding: 0 24px !important;
  height: 40px !important;
  min-width: 120px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  font-size: 13.5px !important;
  white-space: nowrap !important;
  width: auto !important;
  box-sizing: border-box !important;
  margin-top: 0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.btn-profile-edit:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px) !important;
}

.btn-detail-edit:hover {
  color: var(--primary) !important;
}

.btn-profile-task {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--primary) !important;
  font-weight: 600 !important;
  padding: 0 24px !important;
  height: 40px !important;
  min-width: 120px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  font-size: 13.5px !important;
  white-space: nowrap !important;
  width: auto !important;
  box-sizing: border-box !important;
  margin-top: 0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.btn-profile-task:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(128, 0, 32, 0.12) !important;
}

/* Underline tabs */
.mp-tabs {
  display: flex;
  gap: 12px;
  padding: 16px 32px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0;
  box-shadow: none !important;
}

.mp-tab {
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  margin-top: 0 !important;
  margin-bottom: -1px !important;
  white-space: nowrap !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.mp-tab:hover {
  color: #1e293b !important;
  background: #f8fafc !important;
  border-radius: 8px 8px 0 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.mp-tab.active {
  color: var(--primary, #a41f35) !important;
  border-bottom-color: var(--primary, #a41f35) !important;
  font-weight: 700 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Dashboard body */
.matter-profile__body {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Info card (white container) */
.mp-info-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

/* 2-column info grid */
.mp-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #f1f5f9;
}

.mp-info-section {
  padding: 20px 24px;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.mp-info-section:nth-child(even) { border-right: none; }
.mp-info-section:nth-last-child(-n+2) { border-bottom: none; }

.mp-info-section__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 12px;
}

.mp-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #f8fafc;
}

.mp-info-row:last-child { border-bottom: none; }

.mp-info-row span {
  color: #64748b;
  flex-shrink: 0;
  margin-right: 12px;
}

.mp-info-row strong {
  color: #1e293b;
  font-weight: 500;
  text-align: right;
}

/* AI Paralegal banner */
.mp-ai-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  padding: 16px 24px;
  background: rgba(99, 102, 241, 0.06);
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.mp-ai-banner__icon {
  font-size: 18px;
  color: #4f46e5;
  flex-shrink: 0;
  margin-top: 2px;
}

.mp-ai-banner__title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.mp-ai-banner__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mp-ai-banner__tags span {
  font-size: 12px;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 500;
}

/* Recent Activity */
.mp-activity {
  padding: 16px 24px;
}

.mp-activity__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

.mp-activity__list { display: flex; flex-direction: column; }

.mp-activity__item {
  padding: 10px 0;
  font-size: 13px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
}

.mp-activity__item:last-child { border-bottom: none; }

.mp-activity__empty {
  font-size: 13px;
  color: #94a3b8;
  padding: 12px 0;
}

/* ============================================
   MATTER PROFILE — Client Strip
   ============================================ */

.mp-client-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 32px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.mp-client-strip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary, #a41f35);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mp-client-strip__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.mp-client-strip__name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.mp-client-strip__sep {
  color: #cbd5e1;
  font-size: 12px;
}

.mp-client-strip__detail {
  font-size: 13px;
  color: #64748b;
}

.mp-client-strip__status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: #f5f3ff;
  color: #8b5cf6;
  flex-shrink: 0;
}

.mp-client-strip__status--closed,
.mp-client-strip__status--complete {
  background: #f1f5f9;
  color: #64748b;
}

.mp-client-strip__status--pending,
.mp-client-strip__status--on-hold {
  background: #fef3c7;
  color: #d97706;
}

/* ============================================
   MATTER PROFILE — CRM Header Redesign
   ============================================ */

.mp-header {
  background: #ffffff;
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
}

.mp-header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
}

.mp-header__identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mp-header__avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary, #a41f35);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.2);
}

.mp-header__title {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 2px 0;
  letter-spacing: -0.02em;
}

.mp-header__subtitle {
  font-size: 13px;
  color: #64748b;
}

.mp-header__actions {
  display: flex;
  gap: 10px;
}

/* CRM Meta Bar */
.mp-header__meta {
  display: flex;
  gap: 0;
  padding: 0 32px 16px;
  border-top: 1px solid #f8fafc;
}

.mp-meta {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-meta__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mp-meta__value {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

/* Status colors in meta bar */
.mp-meta__value--open { color: #8b5cf6; }
.mp-meta__value--closed { color: #64748b; }
.mp-meta__value--pending { color: #d97706; }

/* Hide old breadcrumb and title row styles if they conflict */
.mp-title-row, .mp-client-strip { display: none !important; }

/* ==========================================
   UNIFIED CALENDAR & TASKS STYLES
   ========================================== */
.tasks-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tasks-page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.tasks-page-header__actions {
  display: flex;
  gap: 12px;
}

.pill--modern-action {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.pill--modern-action:hover {
  background: #f8fafc !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.calendar-tabs-row {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
  padding-bottom: 8px;
}

.calendar-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.calendar-tab-btn:hover {
  color: var(--primary);
  background: rgba(164, 31, 53, 0.04);
}

.calendar-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.tasks-layout-grid {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.calendar-main-column {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.calendar-toolbar-compact {
  margin-bottom: 20px;
}

.calendar-nav-compact {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-nav-arrows-compact {
  display: flex;
  gap: 6px;
}

.calendar-title-compact {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.tasks-summary-sidebar {
  width: 340px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tasks-summary-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.tasks-summary-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tasks-summary-group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.overdue .tasks-summary-group-title {
  color: var(--primary);
}

.today .tasks-summary-group-title {
  color: #d97706;
}

.this-week .tasks-summary-group-title {
  color: #64748b;
}

.tasks-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tasks-summary-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.tasks-summary-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.tasks-summary-item .divider {
  margin: 0 6px;
  color: #94a3b8;
}

.tasks-summary-item .matter {
  color: #64748b;
  font-weight: 400;
}

.tasks-summary-empty {
  font-size: 12px;
  color: #94a3b8;
  padding: 4px 12px;
  font-style: italic;
}

/* ==========================================
   AI CONVERSATIONAL SEARCH MODAL DIALOG
   ========================================== */
.ai-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  justify-content: flex-end; /* Align right to slide in drawer */
  align-items: stretch;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* Delay visibility hidden during transition so the child slide out completes perfectly! */
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.4s;
}

.ai-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px) saturate(140%);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-modal.hidden .ai-modal__backdrop {
  opacity: 0;
}

.ai-modal__card {
  position: relative;
  width: 540px; /* Modern Notion/Linear drawer width */
  max-width: 100%;
  height: 100vh; /* Stretch to full height */
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  border-radius: 24px 0 0 24px; /* Curve left side beautifully */
  box-shadow: -15px 0 45px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(0);
}

.ai-modal.hidden .ai-modal__card {
  transform: translateX(100%); /* Slide drawer out to the right */
}

.ai-modal__header {
  display: flex;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.ai-modal__search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-modal__sparkle {
  color: var(--primary);
  filter: drop-shadow(0 2px 4px rgba(164, 31, 53, 0.15));
  animation: ai-pulse 2s infinite ease-in-out;
}

@keyframes ai-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

#aiSearchInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  outline: none;
}

#aiSearchInput::placeholder {
  color: #94a3b8;
}

.ai-modal__close-btn {
  background: #f1f5f9;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-modal__close-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.ai-modal__body {
  padding: 24px;
  flex: 1; /* Stretch vertical height inside full-height drawer */
  overflow-y: auto;
  background: #fafbfe;
}

.ai-modal__suggestions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-modal__suggestions .suggestion-title {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.suggestion-chip svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #64748b;
  transition: color 0.2s;
}

.suggestion-chip:hover {
  border-color: var(--primary);
  background: rgba(164, 31, 53, 0.03);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.suggestion-chip:hover svg {
  color: var(--primary);
}

/* Chat area styling */
.ai-modal__chat {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.15);
}

.chat-bubble.ai {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.chat-bubble .timestamp {
  font-size: 9px;
  opacity: 0.6;
  margin-top: 6px;
  text-align: right;
}

.chat-bubble.user .timestamp {
  color: rgba(255, 255, 255, 0.8);
}

.chat-bubble.ai .timestamp {
  color: #94a3b8;
}

/* Sparkle typing bubble */
.chat-bubble.ai.thinking {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-weight: 500;
}

.ai-typing-dots {
  display: flex;
  gap: 4px;
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Rich styled lists inside AI answers */
.ai-rich-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.ai-rich-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-rich-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.ai-rich-card .title {
  font-weight: 600;
  color: #0f172a;
}

.ai-rich-card .meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.ai-rich-card .badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.ai-modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.ai-modal__footer kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 5px;
  font-family: inherit;
  font-size: 9px;
  color: #475569;
}

/* Reassuring Enterprise Security Badge */
.ai-modal__security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  margin-right: 14px;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.08);
  animation: badge-pulse 3s infinite ease-in-out;
  cursor: help;
}

.ai-modal__security-badge svg {
  color: #8b5cf6;
  flex-shrink: 0;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.08);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
  }
}

/* Bottom Prompt Input Area */
.ai-modal__input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px 22px 24px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.ai-modal__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 4px 8px 4px 18px;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.ai-modal__input-wrap:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(164, 31, 53, 0.08), inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.ai-modal__input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  padding: 8px 0;
}

.ai-modal__input-wrap input::placeholder {
  color: #94a3b8;
}

.ai-modal__send-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-modal__send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(164, 31, 53, 0.25);
}

.ai-modal__send-btn svg {
  width: 16px;
  height: 16px;
  color: #ffffff;
}

.ai-modal__input-badge-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-modal__input-badge-wrap .ai-modal__security-badge {
  margin-right: 0;
}

/* Premium Settings Layout & Avatars */
.settings-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  margin-top: 16px;
  align-items: start;
}
@media (max-width: 991px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}
#settingsAvatarContainer:hover .avatar-hover-overlay {
  opacity: 1 !important;
}
#settingsAvatarContainer:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.08);
}

#settingsAddUserBtn:hover {
  transform: scale(1.08);
  background-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.2);
}

/* ==========================================================================
   Heirlo Co-Pilot Styling
   ========================================================================== */
.heirlo-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: inherit;
}

/* Floating Action Button (FAB) */
.heirlo-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary, #a41f35);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px 10px 14px;
  box-shadow: 0 10px 25px rgba(164, 31, 53, 0.25), 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.heirlo-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px rgba(164, 31, 53, 0.35), 0 4px 8px rgba(0, 0, 0, 0.12);
  background: #b52940;
}

.heirlo-fab__sparkle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: heirlo-sparkle-pulse 2s infinite ease-in-out;
}

.heirlo-fab__sparkle svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

.heirlo-fab__label {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Chat Panel Flyout */
.heirlo-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 520px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom right;
}

.heirlo-panel.hidden {
  transform: scale(0.8) translateY(40px);
  opacity: 0;
  pointer-events: none;
}

.heirlo-panel.expanded {
  width: 800px !important;
  height: 700px !important;
  max-width: calc(100vw - 48px) !important;
  max-height: calc(100vh - 100px) !important;
}

.heirlo-btn-expand:hover {
  opacity: 1 !important;
  transform: scale(1.1) !important;
}

.heirlo-btn-close:hover {
  opacity: 1 !important;
  transform: scale(1.1) !important;
}

/* Header */
.heirlo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--primary, #a41f35);
  color: #ffffff;
}

.heirlo-header__branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.heirlo-header__branding svg.sparkle {
  width: 20px;
  height: 20px;
  fill: #ffffff;
  animation: sparkle-rotate 4s infinite linear;
}

.heirlo-header__text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.heirlo-header__text p {
  margin: 0;
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}

.heirlo-btn-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.heirlo-btn-close:hover {
  opacity: 1;
}

/* Status Tune Indicator */
.heirlo-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.heirlo-status__indicator {
  width: 8px;
  height: 8px;
  background: #8b5cf6;
  border-radius: 50%;
  animation: heirlo-online-pulse 1.5s infinite;
}

.heirlo-status__text {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chat Area */
.heirlo-chat {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.heirlo-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.heirlo-message--assistant {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.heirlo-message--user {
  align-self: flex-end;
  background: var(--primary, #a41f35);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.heirlo-message p {
  margin: 0 0 8px 0;
}

.heirlo-message p:last-child {
  margin-bottom: 0;
}

.heirlo-message ul, .heirlo-message ol {
  margin: 6px 0;
  padding-left: 18px;
}

.heirlo-message li {
  margin-bottom: 4px;
}

.heirlo-message code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
}

.heirlo-message--user code {
  background: rgba(255, 255, 255, 0.2);
}

/* Suggestion Pills */
.heirlo-suggestions {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  background: #ffffff;
  border-top: 1px solid #f8fafc;
  white-space: nowrap;
}

.heirlo-suggestions::-webkit-scrollbar {
  display: none;
}

.heirlo-pill {
  display: inline-block;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.heirlo-pill:hover {
  background: rgba(164, 31, 53, 0.06);
  border-color: rgba(164, 31, 53, 0.25);
  color: var(--primary, #a41f35);
}

/* Input Area */
.heirlo-input-area {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.heirlo-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 4px 6px 4px 12px;
}

.heirlo-form:focus-within {
  border-color: var(--primary, #a41f35);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(164, 31, 53, 0.08);
}

.heirlo-form input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #0f172a;
  padding: 6px 0;
}

.heirlo-btn-send {
  background: var(--primary, #a41f35);
  border: none;
  color: #ffffff;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  border-radius: 10px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(164, 31, 53, 0.3);
}

.heirlo-btn-send:hover {
  background: #b52940;
  transform: scale(1.05);
}

.heirlo-btn-send svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Keyframes */
@keyframes heirlo-sparkle-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
}

@keyframes heirlo-online-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
  }
}

@keyframes sparkle-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Continue button — appears below AI responses for long drafts */
.heirlo-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  margin: 2px 0 6px;
  font-family: inherit;
  transition: all 0.15s ease;
}
.heirlo-continue-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.heirlo-loading {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
}

.heirlo-loading span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: heirlo-bounce 1.4s infinite ease-in-out both;
}

.heirlo-loading span:nth-child(1) { animation-delay: -0.32s; }
.heirlo-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes heirlo-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Voice Dictation Button & Keyframes */
.heirlo-btn-mic {
  background: transparent;
  border: 1.5px solid #e2e8f0 !important;
  color: #64748b;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.heirlo-btn-mic:hover {
  color: var(--primary, #a41f35);
  background: rgba(164, 31, 53, 0.05);
}

.heirlo-btn-mic svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.heirlo-btn-mic.recording {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  animation: heirlo-mic-pulse 1.2s infinite ease-in-out;
}

@keyframes heirlo-mic-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Interactive Action Cards */
/* Workflow action card — appears after AI response for Review/Edit/Approve/Override */
.heirlo-workflow-actions {
  margin: 8px 0 4px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.heirlo-workflow-actions__label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 10px;
}

.heirlo-workflow-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.heirlo-wf-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.heirlo-wf-btn svg {
  flex-shrink: 0;
  display: block;
}

.heirlo-wf-btn--approve {
  background: var(--primary, #a41f35);
  color: #fff;
}
.heirlo-wf-btn--approve:hover:not(:disabled) {
  background: #b52940;
  transform: translateY(-1px);
}
.heirlo-wf-btn--approve:disabled {
  background: #6b7280;
  cursor: default;
}

.heirlo-wf-btn--edit {
  background: transparent;
  color: var(--primary, #a41f35);
  border: 1.5px solid var(--primary, #a41f35);
}
.heirlo-wf-btn--edit:hover {
  background: rgba(164, 31, 53, 0.06);
}

.heirlo-wf-btn--reject {
  background: #fff1f2;
  color: #be123c;
  border: 1.5px solid #fecdd3;
}
.heirlo-wf-btn--reject:hover {
  background: #ffe4e6;
}

/* Interactive Action Cards */
.heirlo-action-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.heirlo-action-card--task {
  border-left: 4px solid var(--primary); /* Task Accent (Burgundy) */
}

.heirlo-action-card--note {
  border-left: 4px solid #3b82f6; /* Note Accent */
}

.heirlo-action-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.heirlo-action-card--task .heirlo-action-card__header { color: var(--primary); }
.heirlo-action-card--note .heirlo-action-card__header { color: #2563eb; }

.heirlo-action-card__body h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.heirlo-action-card__body p {
  margin: 0;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

.heirlo-action-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.heirlo-action-btn {
  background: #f1f5f9;
  color: #334155;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.heirlo-action-card--task .heirlo-action-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.heirlo-action-card--note .heirlo-action-btn:hover {
  background: #3b82f6;
  color: #ffffff;
}

.heirlo-action-btn.executed {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   GLOBAL TYPOGRAPHY SCALE-UP (Proportional Reading Upgrade)
   ========================================================================== */

/* Base font-size bump for high legibility */
body {
  font-size: 15px !important;
}

/* Global Heading Elements Scale */
h1 { font-size: 32px !important; }
h2 { font-size: 26px !important; }
h3 { font-size: 22px !important; }
h4 { font-size: 18px !important; }
h5 { font-size: 15.5px !important; }
h6 { font-size: 13.5px !important; }

/* Sidebar Navigation Brand & Items */
.sidebar__brand {
  font-size: 31px !important;
}
.nav__item {
  font-size: 17.5px !important;
}

/* Page Headers & Breadcrumbs */
.header__title, 
.page-title {
  font-size: 28px !important;
}
.header__subtitle {
  font-size: 15px !important;
}
.mp-breadcrumb {
  font-size: 14.5px !important;
}

/* Matter Profile Headers & Meta Tags */
.mp-header__title {
  font-size: 30px !important;
}
.mp-title {
  font-size: 26px !important;
}
.mp-header__subtitle {
  font-size: 16.5px !important;
}
.mp-meta__label {
  font-size: 11.5px !important;
}
.mp-meta__value {
  font-size: 15.5px !important;
}
.mp-tab {
  font-size: 15.5px !important;
}

/* Matter Info Cards & Rows */
.mp-info-section__label {
  font-size: 12px !important;
}
.mp-info-row span {
  font-size: 15px !important;
}
.mp-info-row strong {
  font-size: 15.5px !important;
}

/* Standard Cards & Section Headers */
.card-title,
.section-title {
  font-size: 17.5px !important;
}
.card p,
.mp-info-section p {
  font-size: 15px !important;
}

/* Table Typographies */
.table th, 
.billing-table th, 
.payments-table th {
  font-size: 12.5px !important;
  letter-spacing: 0.05em;
}
.table td, 
.billing-table td, 
.payments-table td {
  font-size: 15px !important;
}

/* Forms, Labels & Inputs */
.form-group label,
label {
  font-size: 14.5px !important;
}
.form-group input, 
.form-group select, 
.form-group textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  font-size: 15px !important;
}

/* Muted & Small Typographic Helpers */
.muted,
.small,
.text-muted,
.muted-text {
  font-size: 13px !important;
}
.badge,
.tag {
  font-size: 12.5px !important;
}

/* ============================================
   DOCUMENT CENTER & AI DRAWER STYLES
   ============================================ */

.document-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.document-upload-zone:hover {
  border-color: var(--primary);
  background: rgba(164, 31, 53, 0.02);
}

.document-upload-zone.dragover {
  border-color: var(--primary) !important;
  background: rgba(164, 31, 53, 0.08) !important;
  border-style: solid !important;
}

.document-upload-zone .upload-icon {
  font-size: 36px;
  color: #94a3b8;
  transition: transform 0.2s;
}

.document-upload-zone:hover .upload-icon {
  transform: translateY(-4px) scale(1.1);
  color: var(--primary);
}

.document-upload-zone h4 {
  font-size: 15px !important;
  font-weight: 700;
  color: #334155;
  margin: 0;
}

.document-upload-zone p {
  font-size: 12px !important;
  color: #64748b;
  margin: 0;
}

/* Document type badge styling */
.doc-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.doc-type-icon.pdf {
  background: #fee2e2;
  color: #ef4444;
}

.doc-type-icon.xlsx, .doc-type-icon.xls {
  background: #f5f3ff;
  color: #8b5cf6;
}

.doc-type-icon.docx, .doc-type-icon.doc {
  background: #dbeafe;
  color: #2563eb;
}

.doc-type-icon.default {
  background: #f1f5f9;
  color: #475569;
}

/* Sleek sliding AI Analysis Drawer */
.doc-analysis-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 520px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
  z-index: 2000;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(226, 232, 240, 0.8);
}

.doc-analysis-drawer.open {
  right: 0;
}

.doc-analysis-drawer__header {
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.doc-analysis-drawer__header h3 {
  font-size: 18px !important;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.doc-analysis-drawer__close {
  background: none !important;
  border: none !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 22px !important;
  font-weight: 300 !important;
  cursor: pointer;
  color: #64748b !important;
  line-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}

.doc-analysis-drawer__close:hover {
  color: var(--primary) !important;
  background: rgba(164, 31, 53, 0.08) !important;
}

.doc-analysis-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.analysis-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analysis-section h4 {
  font-size: 14px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 0;
  border-bottom: 1.5px solid #f1f5f9;
  padding-bottom: 6px;
}

.analysis-summary {
  font-size: 14px !important;
  line-height: 1.6;
  color: #334155;
  background: #f8fafc;
  padding: 16px;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}

.analysis-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-detail-item {
  display: flex;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  font-size: 13.5px !important;
}

.analysis-detail-item strong {
  width: 160px;
  color: #475569;
  flex-shrink: 0;
}

.analysis-detail-item span {
  color: #1e293b;
  font-weight: 600;
}

.analysis-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-checklist-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  position: relative;
}

.analysis-checklist-item.priority {
  border-left: 3.5px solid #8b5cf6;
}

.analysis-checklist-item h5 {
  font-size: 13.5px !important;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-checklist-item p {
  font-size: 12.5px !important;
  color: #64748b;
  margin: 0;
}

.doc-analysis-drawer__footer {
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
  display: flex;
  gap: 12px;
}

.doc-analysis-drawer__footer button {
  flex: 1;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Premium Document Action Buttons styling (Follows Platform Burgundy/AI Violet Theme) */
.doc-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius, 10px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  line-height: 1;
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

.doc-btn-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  display: inline-block;
  flex-shrink: 0;
  stroke-width: 2.5px;
}

/* Analyze Button (Platform's AI Violet / Accent Theme) */
.doc-action-btn--analyze {
  background: rgba(139, 92, 246, 0.06);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.15);
}
.doc-action-btn--analyze:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}
.doc-action-btn--analyze:active {
  transform: translateY(0);
}

/* Download Button (Platform's Burgundy Theme - Neutral Action) */
.doc-action-btn--download {
  background: rgba(164, 31, 53, 0.04);
  color: var(--primary, #a41f35);
  border: 1px solid rgba(164, 31, 53, 0.15);
}
.doc-action-btn--download:hover {
  background: rgba(164, 31, 53, 0.08);
  border-color: rgba(164, 31, 53, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.1);
}
.doc-action-btn--download:active {
  transform: translateY(0);
}

/* Delete Button (Danger Soft Crimson Theme) */
.doc-action-btn--delete {
  background: rgba(239, 68, 68, 0.05);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.doc-action-btn--delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}
.doc-action-btn--delete:active {
  transform: translateY(0);
}

/* Drawer Footer Buttons - Redesign to match platform theme */
.doc-analysis-drawer__footer button {
  margin-top: 0 !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  padding: 10px 18px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 42px !important;
}

.doc-analysis-drawer__footer button.pill--primary {
  background: var(--primary, #a41f35) !important;
  color: #ffffff !important;
  border: 1px solid var(--primary, #a41f35) !important;
  box-shadow: 0 4px 12px rgba(164, 31, 53, 0.15) !important;
}

.doc-analysis-drawer__footer button.pill--primary:hover {
  background: var(--primary-hover, #801829) !important;
  border-color: var(--primary-hover, #801829) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 18px rgba(164, 31, 53, 0.25) !important;
}

.doc-analysis-drawer__footer button.pill--primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(164, 31, 53, 0.15) !important;
}

.doc-analysis-drawer__footer button.pill--ghost {
  background: #ffffff !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

.doc-analysis-drawer__footer button.pill--ghost:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1.5px) !important;
}

.doc-analysis-drawer__footer button.pill--ghost:active {
  transform: translateY(0) !important;
}

/* Priority tags style rules */
.priority-tag {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-tag--high {
  background: #fee2e2;
  color: #dc2626;
}

.priority-tag--medium {
  background: #fef3c7;
  color: #d97706;
}

.priority-tag--low {
  background: #f1f5f9;
  color: #64748b;
}

/* Universal Reset to isolate tabs, workflow steps, and navigation pills from invasive global button styles */
.mp-tab,
.context-tab,
.calendar-tab-btn,
.matters-filter-tab,
.prospect-tab,
.documents-tabs .tab,
.doc-tab {
  transform: none !important;
  margin-top: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

.mp-tab:hover,
.context-tab:hover,
.calendar-tab-btn:hover,
.matters-filter-tab:hover,
.prospect-tab:hover,
.documents-tabs .tab:hover,
.doc-tab:hover {
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Maintain active states shadows specifically and cleanly */
.context-tab.active,
.context-tab.active:hover {
  box-shadow: none !important;
}

/* Horizontal Phase Stepper Styles */
.phase-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding: 8px 4px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.phase-stepper::-webkit-scrollbar {
  height: 4px;
}
.phase-stepper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.phase-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex: 1;
  min-width: 80px;
}

.phase-step:hover {
  background: #f1f5f9;
  color: #334155 !important;
  border-color: #cbd5e1;
}

.phase-step.active,
.phase-step.active.completed {
  background: var(--primary, #a41f35) !important;
  color: #ffffff !important;
  border-color: var(--primary, #a41f35) !important;
  box-shadow: 0 4px 6px -1px rgba(164, 31, 53, 0.2), 0 2px 4px -1px rgba(164, 31, 53, 0.1) !important;
}

.phase-step.completed {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #ffffff !important;
}

.phase-step.completed:hover {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
}

.phase-step.current-phase {
  border: 1.5px dashed var(--primary, #a41f35);
}

.phase-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.1);
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1;
}

.phase-step.active .phase-step__num,
.phase-step.active.completed .phase-step__num {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.phase-step.completed .phase-step__num {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}


/* ════════════════════════════════════════════════════════════════
   ESTATE PLANNING MODULE
   ════════════════════════════════════════════════════════════════ */

/* Sidebar nav emerald accent for Estate Planning */
.nav__item[data-section="estate-planning"].active {
  color: #7c3aed !important;
  background: rgba(139, 92, 246, 0.08) !important;
  border-left-color: #7c3aed !important;
}

/* ── View layout ─────────────────────────────────────────────── */
.ep-view {
  padding: 28px 32px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ep-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.ep-view-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.ep-view-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

/* ── New Plan button ─────────────────────────────────────────── */
.ep-new-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 9px 20px !important;
  background: #7c3aed !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background 0.15s !important;
  width: auto !important;
  height: auto !important;
}

.ep-new-btn:hover {
  background: #6d28d9 !important;
}

/* ── Stats bar ───────────────────────────────────────────────── */
.ep-stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.ep-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 24px;
  min-width: 110px;
  gap: 4px;
}

.ep-stat__num {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.ep-stat__num--active  { color: #7c3aed; }
.ep-stat__num--review  { color: #b45309; }
.ep-stat__num--signed  { color: #7c3aed; }

.ep-stat__label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── AI Ask bar ──────────────────────────────────────────────── */
.ep-ai-bar {
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
  border-radius: 10px;
  padding: 10px 14px;
}

.ep-ai-bar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ep-ai-bar__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
}

.ep-ai-bar__input::placeholder { color: #94a3b8; }

.ep-ai-bar__btn {
  padding: 6px 16px !important;
  background: #7c3aed !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  width: auto !important;
  height: auto !important;
  transition: background 0.15s !important;
}

.ep-ai-bar__btn:hover { background: #6d28d9 !important; }

/* ── Filter tabs ─────────────────────────────────────────────── */
.ep-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ep-filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ep-filter-tab:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.ep-filter-tab.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

/* ── Plans table ─────────────────────────────────────────────── */
.ep-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.ep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.ep-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.ep-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  white-space: nowrap;
}

.ep-table-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}

.ep-table-row:last-child { border-bottom: none; }

.ep-table-row:hover { background: #f5f3ff; }

.ep-table td {
  padding: 13px 16px;
  vertical-align: middle;
}

.ep-table-name__main {
  font-weight: 600;
  color: #1e293b;
}

.ep-table-name__sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.ep-table-muted {
  color: #64748b;
}

/* ── Type badge ──────────────────────────────────────────────── */
.ep-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #ede9fe;
  color: #6d28d9;
  white-space: nowrap;
}

/* ── Status chips ────────────────────────────────────────────── */
.ep-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Open row button ─────────────────────────────────────────── */
.ep-open-btn {
  padding: 5px 12px !important;
  background: transparent !important;
  color: #7c3aed !important;
  border: 1px solid #ddd6fe !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.12s !important;
  width: auto !important;
  height: auto !important;
}

.ep-open-btn:hover {
  background: #7c3aed !important;
  color: #fff !important;
}

/* ── Empty state ─────────────────────────────────────────────── */
.ep-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 12px;
  text-align: center;
}

.ep-empty-state__icon {
  margin-bottom: 8px;
  opacity: 0.7;
}

.ep-empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.ep-empty-state p {
  font-size: 13.5px;
  color: #64748b;
  max-width: 360px;
  margin: 0;
  line-height: 1.6;
}

/* ── New Plan modal ──────────────────────────────────────────── */
.ep-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep-modal-overlay.hidden { display: none; }

.ep-modal {
  background: #fff;
  border-radius: 14px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
}

.ep-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.ep-modal__header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ep-modal__close {
  background: none !important;
  border: none !important;
  font-size: 22px !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  padding: 0 4px !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
}

.ep-modal__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ep-form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ep-form-row label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ep-form-row input,
.ep-form-row select,
.ep-form-row textarea {
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.ep-form-row input:focus,
.ep-form-row select:focus,
.ep-form-row textarea:focus {
  border-color: #7c3aed;
}

.ep-modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
}

.ep-modal-btn {
  padding: 8px 20px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  width: auto !important;
  height: auto !important;
  transition: all 0.15s !important;
}

.ep-modal-btn--cancel {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

.ep-modal-btn--cancel:hover { background: #e2e8f0 !important; }

.ep-modal-btn--create {
  background: #7c3aed !important;
  color: #fff !important;
  border: none !important;
}

.ep-modal-btn--create:hover { background: #6d28d9 !important; }

/* ── EP Profile ──────────────────────────────────────────────── */
.ep-profile {
  padding: 28px 32px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ep-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.ep-profile-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.ep-profile-subtitle {
  font-size: 13px;
  color: #64748b;
}

.ep-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  background: #f5f3ff;
  color: #7c3aed;
}

.ep-edit-btn {
  padding: 6px 14px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: auto !important;
  height: auto !important;
}

.ep-profile-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Violet AI card variant ───────────────────────────────────── */
.ep-ai-card--violet {
  background: #f5f3ff !important;
  border-color: #ddd6fe !important;
}

.ep-ai-card__num--violet {
  background: #8b5cf6 !important;
}

.ep-ai-card__status--violet {
  color: #7c3aed !important;
}

.ep-btn--violet {
  background: #8b5cf6 !important;
  color: #fff !important;
  border: none !important;
}

.ep-btn--violet:hover { opacity: 0.88 !important; }

/* Violet active stepper chip for EP */
.pw-goal-step.pw-goal-step--ep-active {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25) !important;
}

.ep-case-pulse--violet .ep-case-pulse__label { color: #7c3aed; }

.mp-tab-badge {
  background: var(--primary, #a41f35);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

.mp-tab-badge.hidden {
  display: none !important;
}

