/* Vedrix Portal Design System */
:root {
  --app-space-1: 0.5rem;
  --app-space-2: 1rem;
  --app-space-3: 1.5rem;
  --app-space-4: 2rem;
  --app-space-5: 2.5rem;
  --app-space-6: 3rem;
  --app-radius-sm: 12px;
  --app-radius: 18px;
  --app-radius-lg: 20px;
  --app-bg: #f4f7fb;
  --app-bg-2: #eaf0f8;
  --app-sidebar: #101426;
  --app-sidebar-2: #1a1d35;
  --app-panel: rgba(255,255,255,0.86);
  --app-panel-solid: #ffffff;
  --app-line: #dfe6f1;
  --app-line-strong: #cbd5e5;
  --app-text: #172033;
  --app-muted: #667085;
  --app-violet: #6247ea;
  --app-blue: #1b76ff;
  --app-cyan: #17b7d8;
  --app-gold: #b78a37;
  --app-green: #13a46b;
  --app-red: #d94d4d;
  --app-orange: #f28a2e;
  --app-shadow: 0 20px 55px rgba(16,20,38,0.095);
  --app-shadow-soft: 0 12px 28px rgba(16,20,38,0.07);
  --app-ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -12%, rgba(98,71,234,0.16), transparent 28rem),
    radial-gradient(circle at 8% 22%, rgba(27,118,255,0.12), transparent 24rem),
    linear-gradient(135deg, var(--app-bg), var(--app-bg-2));
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
}

a { text-decoration: none; }

:focus-visible {
  outline: 3px solid rgba(27,118,255,0.55);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 9999;
  transform: translateY(-140%);
  background: #101426;
  color: #fff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 800;
  transition: transform 180ms var(--app-ease);
}

.skip-link:focus { transform: translateY(0); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  background:
    radial-gradient(circle at 24% 22%, rgba(255,255,255,0.13), transparent 19rem),
    linear-gradient(135deg, #101426 0%, #191f3a 53%, #f5f7fb 53%);
  animation: appPageIn 320ms var(--app-ease) both;
}

.auth-brand {
  color: #fff;
  padding: clamp(2rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand h2 { max-width: 720px; line-height: 1; }

.auth-card {
  align-self: center;
  justify-self: center;
  width: min(92vw, 488px);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: var(--app-radius-lg);
  padding: var(--app-space-4);
  box-shadow: 0 32px 90px rgba(16,20,38,0.16);
  backdrop-filter: blur(22px) saturate(140%);
  animation: appCardIn 520ms var(--app-ease) both;
}

@keyframes appCardIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@keyframes appPageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.btn {
  border-radius: 14px;
  font-weight: 760;
  transition: transform 180ms var(--app-ease), box-shadow 180ms var(--app-ease), background 180ms var(--app-ease), border-color 180ms var(--app-ease);
}

.btn:hover { transform: translateY(-2px); }

.btn-app {
  background: linear-gradient(135deg, var(--app-violet), var(--app-blue));
  color: #fff;
  border: 0;
  box-shadow: 0 14px 30px rgba(98,71,234,0.24);
  padding: 0.74rem 1.05rem;
}

.btn-app:hover { color: #fff; box-shadow: 0 18px 42px rgba(98,71,234,0.32); }

.btn-outline-app {
  border: 1px solid var(--app-line);
  border-radius: 14px;
  color: var(--app-text);
  background: rgba(255,255,255,0.82);
  padding: 0.72rem 1rem;
}

.btn-outline-app:hover {
  border-color: rgba(98,71,234,0.45);
  color: var(--app-violet);
  background: #fff;
  box-shadow: var(--app-shadow-soft);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  animation: appPageIn 360ms var(--app-ease) both;
}

.sidebar {
  background:
    radial-gradient(circle at 18% 0%, rgba(98,71,234,0.32), transparent 18rem),
    linear-gradient(180deg, var(--app-sidebar), var(--app-sidebar-2));
  color: #fff;
  padding: var(--app-space-3);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 16px 0 45px rgba(16,20,38,0.18);
}

.brand-lockup {
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 0 0 var(--app-space-3);
  margin-bottom: var(--app-space-2);
}

.brand-lockup:before {
  content: "";
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff, #8adfff 38%, #6247ea);
  box-shadow: 0 16px 34px rgba(98,71,234,0.36);
}

.brand-lockup strong { display: block; font-size: 1.12rem; letter-spacing: 0; }
.brand-lockup span { color: rgba(255,255,255,0.62); font-size: 0.86rem; }

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.7rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.76);
  border-radius: 16px;
  padding: 0.78rem 0.85rem;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 650;
  transition: transform 180ms var(--app-ease), background 180ms var(--app-ease), color 180ms var(--app-ease), border-color 180ms var(--app-ease);
}

.side-link span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  color: transparent;
  opacity: 0.56;
  flex: 0 0 auto;
}

.side-link:hover, .side-link.active {
  color: #fff;
  background: rgba(255,255,255,0.105);
  border-color: rgba(255,255,255,0.16);
  transform: translateX(4px);
}

.side-link.active span {
  opacity: 1;
  background: linear-gradient(135deg, #79d8ff, #ffffff);
  box-shadow: 0 0 18px rgba(121,216,255,0.75);
}

.side-group { margin-top: 1rem; }

.side-heading {
  color: rgba(255,255,255,0.42);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
}

.content {
  min-width: 0;
  padding: var(--app-space-3);
}

.topbar {
  position: sticky;
  top: var(--app-space-2);
  z-index: 8;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--app-radius-lg);
  padding: var(--app-space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-space-2);
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: blur(18px) saturate(135%);
}

.topbar h1 { letter-spacing: 0; }

.panel {
  position: relative;
  background: var(--app-panel);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: var(--app-radius);
  padding: var(--app-space-3);
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: blur(18px) saturate(130%);
  transition: transform 180ms var(--app-ease), box-shadow 180ms var(--app-ease), border-color 180ms var(--app-ease);
}

/* :not(:has(table)) matters here: :hover matches every ancestor of the
   hovered element too, so without this guard, hovering a row inside a
   table-wrapping .panel would also "lift" the whole panel (shadow/transform),
   which visually reads as a line/shadow appearing above the table. */
.panel:hover:not(:has(table)) {
  transform: translateY(-3px);
  border-color: var(--app-line-strong);
  box-shadow: var(--app-shadow);
}

.metric {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.metric:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--app-violet), var(--app-cyan), #78e0aa);
}

.metric .value {
  font-size: clamp(1.65rem, 3vw, 2rem);
  line-height: 1.1;
  font-weight: 500;
  color: #101828;
}

.crm-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-label {
  color: var(--app-muted);
  font-weight: 760;
  font-size: 0.86rem;
}

.metric-note {
  color: var(--app-muted);
  font-size: 0.82rem;
}

.metric-green:before { background: linear-gradient(90deg, var(--app-green), #78e0aa); }
.metric-gold:before { background: linear-gradient(90deg, var(--app-gold), #ffd36b); }
.metric-red:before { background: linear-gradient(90deg, var(--app-red), #ff9a9a); }

.workspace-hero,
.client-onboarding,
.service-workspace-card,
.document-workspace {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 22px;
  padding: clamp(1.35rem, 3vw, 2rem);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72)),
    radial-gradient(circle at 88% 8%, rgba(98,71,234,0.12), transparent 18rem);
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: blur(18px) saturate(135%);
}

.workspace-hero,
.client-onboarding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.workspace-hero h2,
.client-onboarding h2,
.service-workspace-card h2,
.document-workspace h2 {
  margin: 0.75rem 0 0.55rem;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  font-weight: 860;
  letter-spacing: 0;
}

.workspace-hero p,
.client-onboarding p,
.service-workspace-card p,
.document-workspace p {
  max-width: 760px;
  margin: 0;
  color: var(--app-muted);
}

.workspace-action { flex: 0 0 auto; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.map-card { min-height: 420px; }
.map-card.compact { min-height: 320px; }

.world-map {
  position: relative;
  color: #ced8e7;
  min-height: 310px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(244,247,251,0.82)),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(27,118,255,0.05) 32px),
    repeating-linear-gradient(90deg, transparent, transparent 31px, rgba(27,118,255,0.05) 32px);
  border: 1px solid var(--app-line);
  overflow: hidden;
}

.world-map.small { min-height: 230px; }
.world-map.modal { min-height: min(70vh, 620px); }
.world-map svg { width: min(96%, 840px); height: auto; filter: drop-shadow(0 22px 28px rgba(16,20,38,0.08)); }

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 72px;
  border-radius: 16px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid rgba(98,71,234,0.18);
  color: var(--app-violet);
  box-shadow: 0 18px 38px rgba(16,20,38,0.14);
  text-align: center;
}

.map-pin:before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: rgba(98,71,234,0.12);
  z-index: -1;
}

.map-pin strong { display: block; font-size: 1.1rem; line-height: 1; font-weight: 500; }
.map-pin span { display: block; font-size: 0.72rem; font-weight: 760; }
.map-pin.green { color: var(--app-green); border-color: rgba(19,164,107,0.2); }
.map-pin.gold { color: var(--app-gold); border-color: rgba(183,138,55,0.22); }

.modal-surface {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10,18,35,0.48);
  overflow-y: auto;
}

.modal-panel {
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 24px 60px rgba(15,23,42,0.24);
  padding: 1.5rem;
}

.confirm-modal-panel {
  width: min(480px, 96vw);
  max-height: none;
  display: grid;
  gap: 0.75rem;
}

.confirm-modal-panel .toolbar-actions {
  margin-top: 0.5rem;
}

/* Compact invoice/client/amount summary inside a delete-confirmation body
   (see BillingActionMenu) -- kept generic enough to reuse for any future
   ConfirmModal that wants a quick key/value recap of what's being deleted. */
.confirm-modal-meta {
  display: grid;
  gap: 6px;
  margin-top: 0.5rem;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: #f8fafc;
}

.confirm-modal-meta > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confirm-modal-meta span {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 500;
}

.confirm-modal-meta strong {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.distribution { display: grid; gap: 1rem; margin-top: 1.25rem; }
.distribution-row > div:first-child { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.45rem; }
.distribution-row > div:first-child strong { font-weight: 600; }
.distribution-row span { color: var(--app-muted); font-weight: 500; }
.bar { height: 9px; border-radius: 999px; background: #edf1f7; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--app-violet), var(--app-blue)); }

.activity-list { display: grid; gap: 0.9rem; margin-top: 1rem; }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: start; padding-bottom: 0.9rem; border-bottom: 1px solid #edf1f7; }
.activity-item > span { width: 10px; height: 10px; border-radius: 999px; margin-top: 0.4rem; background: linear-gradient(135deg, var(--app-violet), var(--app-cyan)); box-shadow: 0 0 0 5px rgba(98,71,234,0.09); }
.activity-item p { margin: 0.15rem 0 0; color: var(--app-muted); font-size: 0.88rem; }
.activity-item time { color: var(--app-muted); font-size: 0.78rem; white-space: nowrap; }

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.crm-table-card { overflow: hidden; }
.crm-table th:first-child, .crm-table td:first-child { width: 42px; }
.pagination-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1rem; color: var(--app-muted); font-size: 0.86rem; }
.pagination-row div { display: flex; gap: 0.5rem; }

.service-timeline { display: grid; gap: 0.8rem; margin-top: 1rem; }
.timeline-step { display: flex; align-items: center; gap: 0.75rem; color: var(--app-muted); }
.timeline-step span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--app-line); background: #fff; font-weight: 900; }
.timeline-step.complete { color: var(--app-text); }
.timeline-step.complete span { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--app-green), #78e0aa); }

.next-action-card {
  flex: 0 0 min(360px, 100%);
  border-radius: 20px;
  padding: 1rem;
  background: #101426;
  color: #fff;
  box-shadow: 0 20px 48px rgba(16,20,38,0.18);
}

.next-action-card span { color: rgba(255,255,255,0.62); font-size: 0.8rem; font-weight: 800; }
.next-action-card strong { display: block; margin-top: 0.4rem; font-size: 1rem; font-weight: 500; }

.client-service-title { font-size: 1.65rem; font-weight: 860; margin: 1rem 0; }
.status-stack { display: grid; grid-template-columns: 1fr; gap: 0.2rem; }
.status-stack span, .workspace-meta span, .document-grid span { color: var(--app-muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.status-stack strong, .workspace-meta strong, .document-grid strong { margin-bottom: 0.7rem; font-weight: 500; }

.progress-ring {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin: 1rem auto;
  border-radius: 999px;
  background: conic-gradient(var(--app-violet) 0 40%, #edf1f7 40% 100%);
  color: #101426;
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 16px #fff;
}

.service-workspace-card { display: grid; gap: 1.25rem; }
.workspace-meta, .document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.workspace-meta div, .document-grid div { border: 1px solid var(--app-line); border-radius: 16px; padding: 1rem; background: rgba(255,255,255,0.72); }
.progress-line { height: 12px; border-radius: 999px; background: #edf1f7; overflow: hidden; margin-top: 0.45rem; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--app-violet), var(--app-cyan)); border-radius: inherit; }

.document-workspace.locked { border-style: dashed; }

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

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  font-size: 0.76rem;
  background: #f1efff;
  color: var(--app-violet);
  border: 1px solid rgba(98,71,234,0.14);
  font-weight: 780;
}

.pill.green { background: #e8f8f1; color: var(--app-green); border-color: rgba(19,164,107,0.16); }
.pill.gold { background: #fff6df; color: var(--app-gold); border-color: rgba(183,138,55,0.18); }
.pill.red { background: #fff0f0; color: var(--app-red); border-color: rgba(217,77,77,0.15); }

.table {
  overflow: hidden;
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.table th {
  color: var(--app-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom-color: var(--app-line);
  padding: 0.9rem 0.75rem;
}

.table td {
  padding: 0.95rem 0.75rem;
  border-bottom-color: #edf1f7;
  color: #273449;
}

.table tbody tr {
  transition: background 160ms var(--app-ease);
}

.table tbody tr:hover {
  background: rgba(98,71,234,0.045);
}

.form-label {
  color: #344054;
  font-weight: 720;
}

.form-control, .form-select, textarea {
  min-height: 48px;
  border: 1px solid var(--app-line) !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,0.86) !important;
  box-shadow: none;
  font-weight: 500;
  transition: border-color 160ms var(--app-ease), box-shadow 160ms var(--app-ease), background 160ms var(--app-ease);
}

.form-control::placeholder, .form-select::placeholder, textarea::placeholder {
  font-weight: 400;
}

.form-control:focus, .form-select:focus, textarea:focus {
  outline: none;
}

.alert {
  border: 1px solid rgba(19,164,107,0.18);
  border-radius: var(--app-radius-sm);
  background: #eaf8f2;
  color: #087048;
}

.locked {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(244,247,251,0.74)),
    repeating-linear-gradient(135deg, rgba(98,71,234,0.05), rgba(98,71,234,0.05) 12px, rgba(27,118,255,0.055) 12px, rgba(27,118,255,0.055) 24px);
  border: 1px dashed #b8c2d4;
}

.locked:before {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: rgba(98,71,234,0.08);
}

.mobile-menu { display: none; }

.skeleton {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf1f7, #ffffff, #edf1f7);
  background-size: 220% 100%;
  animation: appSkeleton 1.5s infinite;
}

@keyframes appSkeleton {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--app-line-strong);
  border-radius: var(--app-radius);
  background: rgba(255,255,255,0.62);
  padding: var(--app-space-4);
}

.empty-state h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--vdx-ink, #111827); }
.empty-state p { font-size: 14px; line-height: 1.55; }

/* Shared date-only picker: the button displays DD-MM-YYYY while onChange
   continues emitting the API-safe YYYY-MM-DD value. */
.app-date-picker {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: var(--vdx-ink, #111827);
  background: rgba(255,255,255,.9);
}
.app-date-picker .placeholder { color: #7b8497; font-weight: 400; opacity: 1; }
.app-date-picker i { color: var(--vdx-primary, #1d4fff); }
.app-date-picker:focus-visible { outline: 0; }
/* Must clear .modal-surface's z-index (100000) -- this popover is a
   document.body portal, same as the modal, so when opened from a field
   inside an open modal (e.g. Record Payment's Payment Date) it is a sibling
   layer, not a descendant, and needs a higher z-index to paint on top. */
.app-date-popover-layer { position: fixed; inset: 0; z-index: 100001; }
.app-date-popover {
  position: fixed;
  padding: 14px;
  border: 1px solid rgba(37,91,255,.14);
  border-radius: 16px;
  background: #fff;
  color: #111827;
  box-shadow: 0 24px 60px rgba(15,23,42,.2);
}
.app-date-header,.app-date-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-date-header { margin-bottom: 12px; }
.app-date-header strong { font-size: 14px; font-weight: 700; }
.app-date-nav { display: flex; gap: 6px; }
.app-date-nav button {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid rgba(37,91,255,.15); border-radius: 9px;
  color: var(--vdx-primary, #1d4fff); background: #f7f9ff; cursor: pointer;
}
.app-date-nav button:hover,.app-date-nav button:focus-visible { color: #fff; background: var(--vdx-primary, #1d4fff); outline: 0; }
.app-date-nav .icon-action-svg { width: 15px; height: 15px; }
.app-date-weekdays,.app-date-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.app-date-weekdays { margin-bottom: 5px; }
.app-date-weekdays span { padding: 4px 0; text-align: center; color: #667085; font-size: 11px; font-weight: 700; }
.app-date-grid button {
  aspect-ratio: 1; min-width: 0; border: 0; border-radius: 9px;
  background: transparent; color: #172033; font-size: 12px; cursor: pointer;
}
.app-date-grid button:hover:not(:disabled),.app-date-grid button:focus-visible { background: #edf2ff; color: var(--vdx-primary, #1d4fff); outline: 2px solid rgba(29,79,255,.18); }
.app-date-grid button.outside { color: #a6adba; }
.app-date-grid button.today { box-shadow: inset 0 0 0 1px var(--vdx-primary, #1d4fff); }
.app-date-grid button.selected { color: #fff; background: var(--vdx-primary, #1d4fff); font-weight: 700; }
.app-date-grid button:disabled { color: #cbd0da; background: #f8fafc; cursor: not-allowed; text-decoration: line-through; }
.app-date-footer { margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf0f5; }
.app-date-text-btn { border: 0; background: transparent; color: var(--vdx-primary, #1d4fff); font-size: 12px; font-weight: 700; cursor: pointer; }
@media (max-width: 480px) { .app-date-popover { padding: 12px; } }

.loading-state {
  display: grid;
  gap: 0.7rem;
}

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

@media (max-width: 1080px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .crm-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-meta, .document-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; background: #f5f7fb; }
  .auth-brand { padding: var(--app-space-4); background: var(--app-sidebar); min-height: 40vh; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(86vw, 320px);
    transform: translateX(-104%);
    transition: transform 240ms var(--app-ease);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .content { padding: var(--app-space-2); }
  .topbar { top: var(--app-space-1); align-items: flex-start; flex-direction: column; }
  .workspace-hero, .client-onboarding, .panel-head { align-items: flex-start; flex-direction: column; }
  .table-toolbar { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
  .auth-card, .panel { padding: var(--app-space-2); border-radius: 16px; }
  .content { padding: var(--app-space-1); }
  .topbar { border-radius: 16px; }
  .crm-stat-grid, .workspace-meta, .document-grid { grid-template-columns: 1fr; }
  .world-map { min-height: 260px; }
  .map-pin { min-width: 58px; padding: 0.45rem 0.55rem; }
  .pagination-row { align-items: flex-start; flex-direction: column; }
}

/* Premium Vedrix CRM concept layer */
:root {
  --app-bg: #f7f9fd;
  --app-bg-2: #ffffff;
  --app-sidebar: #00113a;
  --app-sidebar-2: #020a24;
  --app-panel: rgba(255,255,255,0.94);
  --app-line: #e5ebf5;
  --app-line-strong: #d7dfec;
  --app-text: #07143a;
  --app-muted: #526286;
  --app-violet: #1030ff;
  --app-blue: #1030ff;
  --app-cyan: #2d64ff;
  --app-gold: #f08a14;
  --app-green: #0f9f6e;
  --app-red: #e04747;
  --app-shadow: 0 24px 70px rgba(12,25,68,0.12);
  --app-shadow-soft: 0 14px 38px rgba(12,25,68,0.08);
}

body {
  background: #f7f9fd;
  color: var(--app-text);
}

h1, h2, h3, h4, h5, h6,
.value,
.metric-label,
.side-heading,
.role-badge,
.pill,
.btn,
.table th,
.brand-lockup strong {
  font-family: Montserrat, Inter, system-ui, sans-serif;
  letter-spacing: 0.01em;
}

.layout { grid-template-columns: 286px minmax(0, 1fr); }

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 12% 8%, rgba(16,48,255,0.34), transparent 14rem),
    linear-gradient(180deg, #00113a 0%, #020817 100%);
}

.sidebar-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.brand-lockup {
  padding-bottom: 1.45rem;
  margin-bottom: 1.15rem;
}

.brand-lockup:before { display: none; }

.brand-lockup img {
  width: 178px;
  height: auto;
  display: block;
  margin-bottom: 1.4rem;
}

.brand-lockup strong {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.06rem;
  font-weight: 850;
}

.brand-lockup span { color: rgba(255,255,255,0.72); }

.side-group { margin-top: 1.4rem; }
.side-heading { color: rgba(255,255,255,0.5); font-size: 0.69rem; }

.side-link {
  border-radius: 10px;
  padding: 0.82rem 0.9rem;
  color: rgba(255,255,255,0.82);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 720;
}

.side-link span {
  width: 7px;
  height: 7px;
  opacity: 0;
}

.side-link:hover,
.side-link.active {
  background: var(--app-violet);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 16px 34px rgba(16,48,255,0.28);
  transform: none;
}

.side-link.active span { opacity: 1; background: #fff; box-shadow: none; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1rem;
  color: #fff;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--app-violet);
  font-weight: 850;
}

.sidebar-user strong { display: block; font-size: 0.9rem; }
.sidebar-user small { display: block; color: rgba(255,255,255,0.66); }

.content {
  padding: 1.65rem 2rem 2rem;
  background: #f7f9fd;
}

.topbar {
  position: relative;
  top: 0;
  padding: 0.25rem 0 1.1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.topbar h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 850;
}

.topbar p {
  margin: 0.35rem 0 0;
  color: var(--app-muted);
  max-width: 760px;
}

.role-badge {
  color: var(--app-violet);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-btn {
  display: flex;
  width: 42px;
  height: 42px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: #fff;
  color: var(--app-violet);
  font-weight: 900;
  box-shadow: var(--app-shadow-soft);
  align-items: center;
  justify-content: center;
}

.header-refresh-btn {
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.header-refresh-btn:hover:not(:disabled),
.notification-btn:hover {
  transform: translateY(-1px);
}

.header-refresh-btn:active:not(:disabled),
.notification-btn:active {
  transform: translateY(0);
}

.header-refresh-btn:disabled {
  cursor: progress;
  opacity: .78;
}

.header-refresh-btn.refreshing .ui-icon {
  animation: vedrix-refresh-spin .82s linear infinite;
}

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

.header-refresh-toast {
  position: absolute;
  top: calc(100% + 10px);
  right: 24px;
  z-index: 1300;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.panel,
.workspace-hero,
.client-onboarding,
.service-workspace-card,
.document-workspace {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: none;
}

.panel:hover:not(:has(table)) {
  transform: none;
  border-color: var(--app-line-strong);
  box-shadow: var(--app-shadow-soft);
}

.workspace-hero,
.client-onboarding {
  min-height: 150px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9)),
    radial-gradient(circle at 92% 0%, rgba(16,48,255,0.08), transparent 18rem);
}

.workspace-hero h2,
.client-onboarding h2,
.service-workspace-card h2,
.document-workspace h2 {
  color: var(--app-violet);
  text-transform: uppercase;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.35;
}

.btn-app {
  background: var(--app-violet);
  box-shadow: 0 14px 30px rgba(16,48,255,0.22);
}

.btn-app:hover { box-shadow: 0 16px 34px rgba(16,48,255,0.28); }

.btn-outline-app {
  background: #fff;
  border-color: var(--app-line);
}

.pill {
  color: var(--app-violet);
  background: #eef2ff;
  border-color: #dce4ff;
}

.crm-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1rem;
}

.metric:before { display: none; }

.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  color: var(--app-violet);
  background: #fff;
  box-shadow: inset 0 0 0 4px #f6f8ff;
  font-family: Montserrat, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
}

.metric-label {
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--app-text);
}

.metric .value {
  color: var(--app-violet);
  font-size: clamp(1.45rem, 2.3vw, 1.8rem);
}

.metric-note { color: var(--app-muted); }

.world-map {
  color: #b8c7ee;
  background:
    radial-gradient(circle at 50% 50%, rgba(16,48,255,0.08), transparent 24rem),
    linear-gradient(180deg, #ffffff, #fbfcff);
  border-color: transparent;
}

.world-map svg path {
  stroke: rgba(16,48,255,0.16);
  stroke-width: 1;
  stroke-dasharray: 1 4;
}

.map-pin {
  border-radius: 10px;
  color: var(--app-violet);
  border-color: rgba(16,48,255,0.28);
}

.map-pin:before { background: rgba(16,48,255,0.12); }

.distribution-row strong,
.activity-item strong,
.client-service-title {
  color: var(--app-text);
}

.bar { height: 6px; }
.bar span { background: var(--app-violet); }

.activity-item > span {
  background: var(--app-violet);
  box-shadow: 0 0 0 5px rgba(16,48,255,0.1);
}

.table-toolbar {
  grid-template-columns: minmax(260px, 1fr) 160px auto;
}

.table th {
  color: #39476b;
  letter-spacing: 0.02em;
}

.table td {
  color: #243456;
  font-size: 0.92rem;
}

.form-control,
.form-select,
textarea {
  border-radius: 10px !important;
  min-height: 44px;
}

.service-timeline {
  gap: 1rem;
}

.timeline-step span {
  width: 30px;
  height: 30px;
  color: transparent;
  border-color: #d8e0ef;
}

.timeline-step.complete span {
  color: #fff;
  background: var(--app-violet);
  font-size: 0.62rem;
}

.next-action-card {
  background: #06133d;
  border-radius: 14px;
}

.auth-logo {
  width: min(260px, 80%);
  height: auto;
  margin-bottom: 2rem;
}

@media (max-width: 1080px) {
  .crm-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575px) {
  .header-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .crm-stat-grid { grid-template-columns: 1fr; }
}

.crm-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--app-space-2);
  color: var(--app-muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0 0 var(--app-space-3);
}

.crm-breadcrumb strong { color: var(--app-text); }

.app-breadcrumb {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  color: var(--app-muted);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  background: transparent;
}

.app-breadcrumb a,
.app-breadcrumb span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  white-space: nowrap;
}

.app-breadcrumb a {
  color: var(--app-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.app-breadcrumb a:hover,
.app-breadcrumb a:focus-visible {
  color: var(--app-primary);
  outline: none;
}

.app-breadcrumb-separator {
  color: rgba(99, 109, 129, 0.72);
  font-weight: 600;
}

.app-breadcrumb-current {
  color: var(--app-primary);
  font-weight: 700;
}

.approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-space-3);
  padding: var(--app-space-3) 0;
  border-top: 1px solid var(--app-border);
}

.approval-row:first-of-type { border-top: 0; }

@media (max-width: 768px) {
  .approval-row { align-items: flex-start; flex-direction: column; }
}

/* Super Admin dashboard reference layout */
.side-link .side-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: currentColor;
  background: rgba(255,255,255,0.08);
  opacity: 1;
  font-size: 0.9rem;
  font-weight: 850;
  flex: 0 0 auto;
}

.side-link.active .side-icon {
  color: #1030ff;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(16,48,255,0.22);
}

.sa-dashboard {
  display: grid;
  gap: 1.25rem;
  color: #111827;
}

.sa-header,
.sa-hero,
.dashboard-card {
  background: rgba(255,255,255,0.94);
  border: 1px solid #e7ecf4;
  border-radius: 24px;
  box-shadow: 0 20px 52px rgba(15,23,42,0.08);
}

.sa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.sa-brand { display: flex; align-items: center; gap: 0.9rem; }
.sa-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 16px; }
.sa-brand span { display: block; color: #667085; font-size: 0.82rem; font-weight: 650; }
.sa-brand strong { display: block; font-size: 1.45rem; line-height: 1; color: #111827; }

.sa-header-actions { display: flex; align-items: center; gap: 0.75rem; }
.sa-icon-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid #dce3ee;
  background: #fff;
  color: #111827;
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sa-icon-btn span {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #315cff;
}
.sa-search { width: min(280px, 32vw); border-radius: 999px; min-height: 48px; padding-inline: 1.25rem; }
.sa-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #111827;
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(17,24,39,0.22);
}

.sa-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.sa-hero h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); font-weight: 850; letter-spacing: 0; }
.sa-hero h2 span,
.sa-hero h2 strong { color: #315cff; }
.sa-hero p { margin: 0.45rem 0 0; color: #667085; font-size: 1.05rem; }

.admin-team-widget {
  min-width: 210px;
  padding: 1rem;
  border-radius: 22px;
  background: #f7f9fd;
  border: 1px solid #e5ebf5;
}
.admin-team-widget span { display: block; color: #667085; font-size: 0.82rem; font-weight: 700; }
.admin-team-widget strong { display: block; margin: 0.2rem 0 0.75rem; font-size: 1.35rem; }
.avatar-stack { display: flex; }
.avatar-stack span {
  width: 34px;
  height: 34px;
  margin-left: -8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #315cff, #76a9ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}
.avatar-stack span:first-child { margin-left: 0; }

.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}
.dashboard-card {
  padding: 1.15rem;
  overflow: hidden;
  transition: transform 180ms var(--app-ease), box-shadow 180ms var(--app-ease), border-color 180ms var(--app-ease);
}
.dashboard-card:hover:not(:has(table)) { transform: translateY(-3px); box-shadow: 0 24px 60px rgba(15,23,42,0.11); }
.dashboard-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dashboard-card h2 { margin: 0; font-size: 1.05rem; font-weight: 800; color: #111827; }

.stat-card { min-height: 178px; }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #315cff;
  background: #edf3ff;
}
.stat-green .stat-icon { color: #159447; background: #e9f9ef; }
.stat-violet .stat-icon { color: #7438d8; background: #f4eafe; }
.stat-gold .stat-icon { color: #b77900; background: #fff4d8; }
.stat-orange .stat-icon { color: #d97706; background: #fff0df; }
.stat-change { font-size: 0.78rem; font-weight: 800; color: #159447; }
.stat-change.down { color: #e15b64; }
.stat-card .value { margin: 0.25rem 0; font-size: clamp(1.6rem, 2.2vw, 2.1rem); font-weight: 500; color: #111827; }

.mini-line { width: 100%; height: 58px; margin-top: 0.7rem; color: #315cff; }
.mini-line.green { color: #16a34a; }
.mini-line.violet { color: #6d28d9; }
.mini-line.gold, .mini-line.orange { color: #f59e0b; }
.mini-bars { height: 58px; display: flex; align-items: end; gap: 0.45rem; margin-top: 0.7rem; }
.mini-bars span { flex: 1; min-width: 6px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #315cff, #b7c9ff); }

.sa-main-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr); gap: 1rem; }
.chart-total { font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 500; color: #111827; }
.chart-positive { color: #159447; font-size: 0.86rem; font-weight: 800; margin-bottom: 0.5rem; }
.line-chart { width: 100%; height: auto; min-height: 220px; }

.sa-map-visual {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a9bfdf;
  border-radius: 20px;
  background: #f8fbff;
  overflow: hidden;
}
.sa-map-visual svg { width: 100%; max-width: 620px; filter: drop-shadow(0 14px 24px rgba(49,92,255,0.08)); }
.sa-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  color: #315cff;
  background: #fff;
  border: 1px solid #dbe6ff;
  box-shadow: 0 10px 24px rgba(49,92,255,0.12);
  font-size: 0.72rem;
  font-weight: 850;
}
.country-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.country-row > div:first-child { display: flex; justify-content: space-between; color: #344054; font-size: 0.9rem; margin-bottom: 0.35rem; }
.country-row span { color: #667085; font-weight: 500; }
.country-bar { height: 8px; border-radius: 999px; background: #edf2f8; overflow: hidden; }
.country-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #315cff, #72a5ff); }

.sa-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr); gap: 1rem; }
.sa-activities .activity-list { margin-top: 0; }
.sa-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
  border-color: rgba(17,24,39,0.08);
  background:
    radial-gradient(circle at 90% 20%, rgba(118,169,255,0.42), transparent 12rem),
    linear-gradient(135deg, #111827, #1f2937 58%, #263b78);
}
.sa-cta-card h2 { color: #fff; font-size: 1.35rem; }
.sa-cta-card p { margin: 0.35rem 0 0; color: rgba(255,255,255,0.72); }

@media (max-width: 1280px) {
  .sa-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sa-main-grid, .sa-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sa-header, .sa-hero, .sa-cta-card { align-items: flex-start; flex-direction: column; }
  .sa-header-actions { width: 100%; flex-wrap: wrap; }
  .sa-search { width: 100%; order: 3; }
  .sa-kpi-grid { grid-template-columns: 1fr; }
  .admin-team-widget { width: 100%; }
}

/* Super Admin dashboard refinement pass */
.content:has(.sa-dashboard) {
  background: #f5f7fc;
}

.content:has(.sa-dashboard) > .topbar {
  display: none;
}

.sa-dashboard {
  gap: 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sa-header,
.sa-hero,
.dashboard-card {
  border-color: #e6ebf3;
  background: #ffffff;
  box-shadow: 0 10px 40px rgba(15,23,42,.06);
}

.sa-header {
  position: sticky;
  top: 16px;
  z-index: 7;
  padding: 16px 20px;
  min-height: 88px;
  backdrop-filter: blur(18px) saturate(140%);
}

.sa-title-block h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 4vw, 44px);
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: 0;
}

.sa-title-block p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.45;
}

.sa-header-actions { gap: 12px; }
.sa-icon-btn {
  width: 44px;
  height: 44px;
  border-color: #dfe5ef;
  font-size: 1.1rem;
  transition: transform 180ms var(--app-ease), box-shadow 180ms var(--app-ease), border-color 180ms var(--app-ease);
}
.sa-icon-btn:hover { transform: translateY(-2px); border-color: #b9c7ff; box-shadow: 0 10px 24px rgba(45,91,255,.12); }
.sa-icon-btn span { background: #2d5bff; animation: notificationPulse 1.8s ease-in-out infinite; }

.sa-search-wrap {
  position: relative;
  width: clamp(280px, 28vw, 400px);
}
.sa-search-wrap > span {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  color: #8a94a6;
  font-weight: 800;
}
.sa-search {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dfe5ef;
  background: #f9fbff;
  padding-left: 42px;
  box-shadow: none;
}
.sa-search:focus { outline: none; }

.sa-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px 4px 4px;
  border: 1px solid #e3e8f1;
  border-radius: 999px;
  background: #fff;
}
.sa-profile strong { display: block; color: #111827; font-size: 13px; line-height: 1.1; }
.sa-profile span { display: block; color: #6b7280; font-size: 12px; }
.sa-profile em { color: #6b7280; font-style: normal; font-weight: 900; }
.sa-avatar { width: 38px; height: 38px; font-size: 0.8rem; background: linear-gradient(135deg, #111827, #334155); box-shadow: none; }
.sa-report-btn { min-height: 44px; border-radius: 999px; padding-inline: 18px; background: #2d5bff; box-shadow: 0 12px 24px rgba(45,91,255,.18); }
.sa-report-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(45,91,255,.24); }

.sa-hero {
  min-height: 188px;
  padding: clamp(24px, 4vw, 40px);
  background:
    radial-gradient(circle at 78% 16%, rgba(45,91,255,.10), transparent 18rem),
    linear-gradient(135deg, #fff, #fbfdff);
}
.sa-hero h2 { font-size: clamp(2.4rem, 5vw, 48px); font-weight: 760; }
.sa-hero p { color: #6b7280; font-size: clamp(1rem, 1.4vw, 1.1rem); }

.admin-team-widget {
  min-width: 236px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.76);
  background: rgba(255,255,255,.72);
  box-shadow: 0 18px 44px rgba(45,91,255,.10);
  backdrop-filter: blur(16px) saturate(140%);
}
.admin-team-widget strong { font-size: 1.5rem; font-weight: 500; }
.admin-team-widget small { display: block; margin-top: 10px; color: #16a34a; font-size: 12px; font-weight: 800; }
.avatar-stack span { position: relative; width: 38px; height: 38px; }
.avatar-stack span:after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #16a34a;
}

.sa-kpi-grid { gap: 16px; }
.dashboard-card { border-radius: 22px; padding: 24px; }
.stat-card {
  min-height: 214px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-card-top { margin-bottom: 12px; }
.stat-icon { width: 52px; height: 52px; border-radius: 50%; }
.stat-change { padding: 4px 8px; border-radius: 999px; background: #ecfdf3; color: #16a34a; }
.stat-change.down { background: #fef2f2; color: #ef4444; }
.stat-card .metric-label { color: #111827; font-size: 16px; font-weight: 680; }
.stat-card .value { font-size: clamp(2rem, 2.8vw, 38px); font-weight: 500; }
.stat-card .metric-note { color: #6b7280; font-size: 13px; }
.mini-line path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: drawChart 1.1s ease forwards; }
.mini-bars span { transform-origin: bottom; animation: growBar .9s ease both; }

.sa-main-grid { grid-template-columns: minmax(0, 1.14fr) minmax(380px, .86fr); gap: 24px; }
.chart-card { min-height: 420px; }
.sa-month-select { width: 132px; border-radius: 999px; border-color: #dfe5ef; }
.chart-total { font-size: clamp(2rem, 3.4vw, 40px); font-weight: 500; }
.line-chart-wrap { position: relative; min-height: 270px; }
.chart-tooltip {
  position: absolute;
  right: 9%;
  top: 18%;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms var(--app-ease), transform 180ms var(--app-ease);
}
.chart-card:hover .chart-tooltip { opacity: 1; transform: translateY(0); }
.line-chart { min-height: 260px; }
.line-chart path[stroke] { stroke-dasharray: 760; stroke-dashoffset: 760; animation: drawChart 1.25s ease forwards; }

.sa-map-visual { min-height: 254px; background: linear-gradient(180deg, #f9fbff, #f4f8ff); color: #c6d4e8; }
.sa-map-visual .land { fill: currentColor; stroke: #fff; stroke-width: 2; transition: fill 180ms var(--app-ease), transform 180ms var(--app-ease); }
.sa-map-visual .india,
.sa-map-visual .uk,
.sa-map-visual .uae,
.sa-map-visual .usa { fill: #78a2ff; }
.sa-map-visual:hover .land { transform: translateY(-1px); }
.sa-map-pin { color: #2d5bff; border-color: #dce6ff; }
.country-list { gap: 12px; }
.country-row > div:first-child { font-size: 14px; }
.country-bar { height: 9px; }
.country-bar span { animation: growWidth .9s ease both; }

.sa-bottom-grid { grid-template-columns: minmax(0, 1fr) minmax(380px, .9fr); gap: 24px; }
.sa-activity-list { display: grid; gap: 8px; }
.sa-activity-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 10px;
  background: transparent;
  text-align: left;
  transition: background 180ms var(--app-ease), border-color 180ms var(--app-ease), transform 180ms var(--app-ease);
}
.sa-activity-row:hover { background: #f8fbff; border-color: #e3eaf7; transform: translateX(3px); }
.sa-activity-icon { width: 38px; height: 38px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.sa-activity-row.green .sa-activity-icon { color: #16a34a; background: #ecfdf3; }
.sa-activity-row.blue .sa-activity-icon { color: #2d5bff; background: #eef4ff; }
.sa-activity-row.gold .sa-activity-icon { color: #f59e0b; background: #fffbeb; }
.sa-activity-row.violet .sa-activity-icon { color: #7c3aed; background: #f5f3ff; }
.sa-activity-copy strong { display: block; color: #111827; font-size: 14px; font-weight: 500; }
.sa-activity-copy small { display: block; color: #6b7280; font-size: 13px; margin-top: 2px; }
.sa-activity-row time { color: #8a94a6; font-size: 12px; white-space: nowrap; }

.sa-cta-card {
  position: relative;
  min-height: 210px;
  padding: 32px;
  background:
    radial-gradient(circle at 86% 42%, rgba(125,171,255,.42), transparent 12rem),
    linear-gradient(135deg, #071a45, #0f2d70 58%, #143fa3);
}
.sa-cta-card h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); font-weight: 760; }
.sa-cta-card .btn { position: relative; z-index: 2; min-height: 48px; border-radius: 999px; background: #fff; color: #1742b9; box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.sa-cta-illustration {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 132px;
  height: 132px;
  opacity: .24;
  background:
    linear-gradient(135deg, transparent 49%, #fff 50% 54%, transparent 55%),
    linear-gradient(45deg, transparent 49%, #fff 50% 54%, transparent 55%);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 28px;
  transform: rotate(8deg);
}

.sidebar .side-group { margin-top: 20px; }
.sidebar .side-heading { padding: 8px 12px; letter-spacing: .08em; font-size: 11px; }
.side-link { min-height: 44px; padding: 8px 10px; font-weight: 680; }
.side-link:hover { background: rgba(255,255,255,.09); transform: translateX(3px); }
.side-link.active { background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 #79a2ff; }

@keyframes drawChart { to { stroke-dashoffset: 0; } }
@keyframes growBar { from { transform: scaleY(.25); opacity: .45; } to { transform: scaleY(1); opacity: 1; } }
@keyframes growWidth { from { width: 0; } }
@keyframes notificationPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(45,91,255,.34); } 50% { box-shadow: 0 0 0 7px rgba(45,91,255,0); } }

@media (max-width: 1280px) {
  .sa-header { align-items: flex-start; flex-direction: column; }
  .sa-header-actions { width: 100%; }
  .sa-search-wrap { flex: 1; width: auto; }
}

@media (max-width: 768px) {
  .sa-title-block h1 { font-size: 34px; }
  .sa-header { position: relative; top: auto; }
  .sa-header-actions { align-items: stretch; }
  .sa-search-wrap { width: 100%; order: 2; }
  .sa-profile { width: 100%; justify-content: flex-start; order: 3; }
  .sa-report-btn { width: 100%; order: 4; }
  .sa-main-grid, .sa-bottom-grid { gap: 16px; }
  .dashboard-card { padding: 18px; }
  .sa-activity-row { grid-template-columns: 38px 1fr; }
  .sa-activity-row time { grid-column: 2; }
  .sa-cta-illustration { width: 92px; height: 92px; }
}

/* Internal CRM module refinement */
.module-page {
  display: grid;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 4px;
}

.crm-breadcrumb.compact {
  margin: 0 0 16px;
  gap: 8px;
  font-size: 13px;
}

.page-header h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 3.6vw, 36px);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}

.page-header p {
  max-width: 720px;
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.5;
}

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

.summary-card {
  min-height: 156px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px;
  padding: 20px;
  border: 1px solid #e7ecf4;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(15,23,42,.05);
  transition: transform 180ms var(--app-ease), box-shadow 180ms var(--app-ease), border-color 180ms var(--app-ease);
}

.summary-card:hover {
  transform: translateY(-3px);
  border-color: #dbe5ff;
  box-shadow: 0 16px 42px rgba(15,23,42,.08);
}

.summary-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #2d5bff;
  background: #eef4ff;
  font-weight: 900;
}
.summary-green .summary-icon { color: #16a34a; background: #ecfdf3; }
.summary-gold .summary-icon { color: #f59e0b; background: #fffbeb; }
.summary-red .summary-icon { color: #ef4444; background: #fef2f2; }
.summary-violet .summary-icon { color: #7c3aed; background: #f5f3ff; }

.summary-card span { display: block; color: #6b7280; font-size: 13px; font-weight: 700; }
.summary-card strong { display: block; margin-top: 6px; color: #111827; font-size: clamp(1.8rem, 3vw, 34px); line-height: 1; font-weight: 500; }
.summary-card small { display: block; margin-top: 8px; color: #6b7280; font-size: 13px; }
.summary-card .mini-line { grid-column: 1 / -1; height: 34px; margin: 4px 0 0; opacity: .72; }

.data-table-shell {
  display: grid;
  gap: 20px;
}

.module-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e7ecf4;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(15,23,42,.05);
}

.toolbar-title h3 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 740;
}

.toolbar-title span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

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

.toolbar-actions .btn,
.toolbar-actions .form-select,
.search-box .form-control {
  min-height: 42px;
  border-radius: 14px;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a94a6;
  font-weight: 900;
  z-index: 2;
}

.search-box .form-control {
  padding-left: 38px;
  border-color: #dfe5ef;
  background: #f9fbff;
}

.toolbar-actions .form-select {
  width: auto;
  min-width: 136px;
  border-color: #dfe5ef;
  background-color: #fff;
}

.lead-status-badge-select {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #f2f4f7;
  transition: transform 160ms var(--app-ease), background 160ms var(--app-ease);
}

.lead-status-badge-select:hover {
  transform: translateY(-1px);
}

.lead-status-badge-select.green { background: #ecfdf3; }
.lead-status-badge-select.gold { background: #fffbeb; }
.lead-status-badge-select.red { background: #fef2f2; }
.lead-status-badge-select.draft { background: #f2f4f7; }

.lead-status-badge-select select {
  width: auto;
  min-width: 0;
  border: 0;
  padding: 5px 26px 5px 12px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.lead-status-badge-select.green select { color: #16a34a; }
.lead-status-badge-select.gold select { color: #f59e0b; }
.lead-status-badge-select.red select { color: #ef4444; }
.lead-status-badge-select.draft select { color: #667085; }

.lead-status-badge-select select:disabled {
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

.lead-detail-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .lead-detail-split-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.table-toolbar-unified {
  align-items: center;
}

.table-toolbar-unified .toolbar-title {
  min-width: 170px;
}

.table-toolbar-unified .toolbar-title h3 {
  font-size: 22px;
  font-weight: 680;
}

.table-toolbar-actions {
  flex: 1;
  flex-wrap: nowrap;
}

.table-toolbar-actions .search-box {
  width: min(360px, 34vw);
}

.table-filter-wrap {
  position: relative;
  flex: 0 0 auto;
}

.table-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-filter-button.has-filters {
  border-color: rgba(37, 91, 255, .34);
  color: var(--app-blue, #1d4fff);
  background: rgba(255, 255, 255, .92);
}

.filter-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--app-blue, #1d4fff);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.table-filter-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 120;
  width: min(420px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(17, 24, 39, .16);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  animation: dropdownFade 160ms var(--app-ease) both;
}

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

body[data-page="dashboard"] .services-filter-popover {
  width: min(420px, calc(100vw - 48px)) !important;
}

body[data-page="dashboard"] .services-filter-popover .filter-popover-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.filter-field {
  display: grid;
  gap: 7px;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.filter-field > span {
  color: #5f6b7d;
}

.filter-field .date-range-filter,
.filter-field .app-select,
.filter-field .date-range-trigger,
.filter-field .app-select-trigger {
  width: 100%;
}

.table-filter-popover .date-range-popover {
  left: auto;
  right: 0;
  z-index: 140;
}

.clients-filter-popover .filter-field:has(.date-range-filter.open) {
  grid-column: 1 / -1;
}

.clients-filter-popover .date-range-popover.inline {
  position: static;
  width: 100%;
  max-width: none;
  margin-top: 8px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .1);
}

.filter-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, .88);
}

.bulk-toolbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -58px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #c7d5ff;
  border-radius: 16px;
  background: #eef4ff;
  box-shadow: 0 14px 34px rgba(45,91,255,.14);
  animation: dropdownFade 180ms var(--app-ease) both;
}
.bulk-toolbar strong { color: #1742b9; margin-right: auto; }
.bulk-toolbar button { border: 0; color: #1742b9; background: #fff; border-radius: 12px; padding: 7px 12px; font-weight: 750; }

.data-table-card {
  overflow: hidden;
  border: 1px solid #e7ecf4;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(15,23,42,.05);
}

.premium-table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.premium-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid #e7ecf4;
  background: #f8fafd;
  color: #475467;
  font-size: 14px;
  font-weight: 780;
  text-transform: capitalize;
  white-space: nowrap;
  padding: 14px 16px;
}

.premium-table tbody td {
  border-bottom: 1px solid #eef2f7;
  color: #344054;
  font-size: 15px;
  padding: 16px;
  vertical-align: middle;
}

.premium-table tbody strong,
.premium-table tbody .table-link,
.crm-table tbody strong,
.crm-table tbody .table-link {
  font-weight: 500;
}

.premium-table tbody tr {
  cursor: pointer;
  transition: background 160ms var(--app-ease), box-shadow 160ms var(--app-ease);
}

.premium-table tbody tr:hover {
  background: #f8fbff;
}

.premium-table tbody tr.selected {
  background: #eef4ff;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms var(--app-ease), background 160ms var(--app-ease);
}
.status-badge.green { background: #ecfdf3; color: #16a34a; }
.status-badge.gold { background: #fffbeb; color: #f59e0b; }
.status-badge.red { background: #fef2f2; color: #ef4444; }
.status-badge.blue { background: #eaf1ff; color: #2457f5; }
.status-badge.draft { background: #f2f4f7; color: #667085; }
.status-badge:hover { transform: translateY(-1px); }

.action-dropdown {
  position: relative;
  display: inline-flex;
}

.action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  min-width: 156px;
  display: none;
  padding: 8px;
  border: 1px solid #e7ecf4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15,23,42,.12);
  animation: dropdownFade 160ms var(--app-ease) both;
}

.action-dropdown:hover .action-menu,
.action-dropdown:focus-within .action-menu,
.action-dropdown.open .action-menu { display: grid; }

.action-menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  color: #344054;
  background: transparent;
  text-align: left;
  font-weight: 500;
  font-size: 14px;
}
.action-menu button:hover { color: #1742b9; background: #eef4ff; }

.action-menu button.has-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-menu button.has-icon .icon-action-svg,
.action-menu button.has-icon .icon-action-fa {
  width: 14px;
  height: 14px;
  font-size: 14px;
  flex: none;
}

.action-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: #e7ecf4;
}

.table-action-menu {
  justify-content: center;
}

.table-action-trigger {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(37, 91, 255, .28);
  border-radius: 12px;
  color: var(--vdx-primary, #1d4fff);
  background: rgba(255, 255, 255, .9);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(31, 64, 128, .08);
  transition: transform .16s var(--app-ease), border-color .16s var(--app-ease), background .16s var(--app-ease);
}

.table-action-trigger:hover,
.table-action-trigger:focus-visible {
  border-color: var(--vdx-primary, #1d4fff);
  background: #fff;
  transform: translateY(-1px);
  outline: none;
}

.table-action-menu .action-menu {
  min-width: 178px;
}

.empty-module {
  min-height: 280px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  box-shadow: 0 10px 35px rgba(15,23,42,.05);
}

.loading-panel,
.error-state { border-radius: 20px; box-shadow: 0 10px 35px rgba(15,23,42,.05); }
.error-state p { color: #6b7280; }

.layout { grid-template-columns: 286px minmax(0, 1fr); }
.sidebar {
  width: 286px;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.sidebar-scroll { overflow-x: hidden; }
.sidebar .side-group { margin-top: 24px; }
.side-link { transition: transform 180ms var(--app-ease), background 180ms var(--app-ease), color 180ms var(--app-ease), box-shadow 180ms var(--app-ease); }

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 768px) {
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header .btn { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; overflow-x: auto; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr; }
  .search-box, .toolbar-actions .form-select, .toolbar-actions .btn { width: 100%; }
  .bulk-toolbar { position: sticky; bottom: 8px; left: auto; right: auto; flex-wrap: wrap; }
  .premium-table tbody td, .premium-table thead th { padding: 12px; }
}

/* Compact internal page rhythm */
.content:not(:has(.sa-dashboard)) > .topbar {
  margin-bottom: 16px !important;
}
.content:not(:has(.sa-dashboard)) .workspace-hero {
  padding: 20px 24px;
  margin-bottom: 20px !important;
}
.content:not(:has(.sa-dashboard)) .workspace-hero h2 {
  font-size: clamp(1.6rem, 2.6vw, 2rem);
}
.content:not(:has(.sa-dashboard)) .workspace-hero p {
  font-size: 15px;
}
.content:not(:has(.sa-dashboard)) .panel {
  box-shadow: 0 10px 35px rgba(15,23,42,.05);
}

/* Super Admin dashboard sizing correction */
:root {
  --sa-blue: #2d5bff;
  --sa-bg: #f5f7fc;
  --sa-text: #111827;
  --sa-muted: #6b7280;
  --sa-shadow: 0 10px 35px rgba(15,23,42,.05);
}

.layout:has(.sa-dashboard) {
  grid-template-columns: 296px minmax(0, 1fr);
  background: var(--sa-bg);
}

.layout:has(.sa-dashboard) .sidebar {
  width: 296px;
  padding: 24px 20px;
  overflow-y: auto;
  -ms-overflow-style: none;
}
.layout:has(.sa-dashboard) .sidebar-scroll { padding-right: 0; overflow-x: hidden; }
.layout:has(.sa-dashboard) .brand-lockup { margin-bottom: 24px; padding-bottom: 24px; }
.layout:has(.sa-dashboard) .side-group { margin-top: 28px; }
.layout:has(.sa-dashboard) .side-heading {
  padding: 0 12px 10px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .06em;
}
.layout:has(.sa-dashboard) .side-link {
  min-height: 48px;
  gap: 12px;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.2;
}
.layout:has(.sa-dashboard) .side-link .side-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  font-size: .86rem;
}
.layout:has(.sa-dashboard) .sidebar-bottom {
  padding-top: 18px;
  margin-top: 22px;
}

.content:has(.sa-dashboard) {
  padding: 32px 40px;
  background: var(--sa-bg);
}

.sa-dashboard {
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.sa-header {
  min-height: 116px;
  padding: 24px 24px;
  border-radius: 22px;
  box-shadow: var(--sa-shadow);
}
.sa-title-block h1 {
  font-size: clamp(2.35rem, 3vw, 44px);
  font-weight: 760;
  letter-spacing: -.01em;
}
.sa-title-block p {
  max-width: 610px;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.45;
}
.sa-header-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 12px;
}
.sa-icon-btn {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}
.sa-search-wrap {
  width: clamp(300px, 28vw, 400px);
  flex: 0 1 400px;
}
.sa-search {
  min-height: 48px;
  font-size: 15px;
}
.sa-profile {
  min-width: 178px;
  min-height: 56px;
  padding: 6px 12px 6px 6px;
}
.sa-profile strong {
  max-width: 86px;
  font-size: 14px;
  line-height: 1.15;
}
.sa-profile span { font-size: 13px; line-height: 1.15; }
.sa-profile .sa-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}
.sa-report-btn {
  min-width: 142px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 40px;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.15;
}

.sa-hero {
  min-height: 232px;
  align-items: center;
  padding: 36px 48px;
  border-radius: 22px;
  box-shadow: var(--sa-shadow);
}
.sa-hero h2 {
  font-size: clamp(2.65rem, 3.9vw, 58px);
  line-height: 1.08;
  font-weight: 760;
}
.sa-hero p {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.45;
}
.admin-team-widget {
  min-width: 250px;
  padding: 24px;
  border-radius: 22px;
}
.admin-team-widget span { font-size: 14px; }
.admin-team-widget strong {
  margin: 10px 0 20px;
  font-size: 28px;
}
.avatar-stack span {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.sa-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
.dashboard-card {
  border-radius: 22px;
  box-shadow: var(--sa-shadow);
}
.stat-card {
  min-height: 238px;
  padding: 28px 30px;
}
.stat-card-top { margin-bottom: 18px; }
.stat-icon {
  width: 64px;
  height: 64px;
  font-size: 22px;
}
.stat-change {
  font-size: 14px;
  padding: 5px 12px;
}
.stat-card .metric-label {
  min-height: 42px;
  display: flex;
  align-items: flex-end;
  color: var(--sa-text);
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.stat-card .value {
  margin: 10px 0 8px;
  font-size: clamp(2.3rem, 3vw, 42px);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-card .metric-note {
  font-size: 14px;
  line-height: 1.3;
}
.stat-card .mini-line,
.stat-card .mini-bars {
  height: 42px;
  margin-top: 14px;
}

.sa-main-grid,
.sa-bottom-grid {
  gap: 20px;
}
.chart-card,
.country-widget {
  min-height: 400px;
}
.sa-map-visual {
  min-height: 230px;
}
.sa-cta-card {
  min-height: 190px;
}

@media (max-width: 1440px) {
  .layout:has(.sa-dashboard) { grid-template-columns: 276px minmax(0, 1fr); }
  .layout:has(.sa-dashboard) .sidebar { width: 276px; }
  .content:has(.sa-dashboard) { padding: 28px 32px; }
  .sa-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sa-header { align-items: flex-start; flex-direction: column; }
  .sa-header-actions { width: 100%; }
  .sa-search-wrap { flex: 1 1 340px; }
}

@media (max-width: 992px) {
  .layout:has(.sa-dashboard) { grid-template-columns: 1fr; }
  .content:has(.sa-dashboard) { padding: 20px; }
  .sa-hero { align-items: flex-start; flex-direction: column; padding: 28px; }
  .admin-team-widget { width: 100%; }
  .sa-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .content:has(.sa-dashboard) { padding: 14px; }
  .sa-header { padding: 18px; }
  .sa-title-block h1 { font-size: 34px; }
  .sa-title-block p { font-size: 14px; }
  .sa-header-actions { display: grid; grid-template-columns: 48px 1fr; }
  .sa-search-wrap, .sa-profile, .sa-report-btn { width: 100%; grid-column: 1 / -1; }
  .sa-kpi-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 210px; padding: 22px; }
  .sa-hero h2 { font-size: 38px; }
}

/* Reference-proportion pass: premium classic CRM */
:root {
  --sa-blue: #2d5bff;
  --sa-blue-soft: #eef4ff;
  --sa-bg: #f6f8fc;
  --sa-text: #111827;
  --sa-muted: #6b7280;
  --sa-muted-2: #9ca3af;
  --sa-card: #ffffff;
  --sa-shadow: 0 10px 35px rgba(15,23,42,.05);
}

.layout:has(.sa-dashboard) {
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--sa-bg);
}

.layout:has(.sa-dashboard) .sidebar {
  width: 272px;
  padding: 24px 18px;
}
.layout:has(.sa-dashboard) .brand-lockup { margin-bottom: 24px; padding-bottom: 24px; }
.layout:has(.sa-dashboard) .side-group { margin-top: 32px; }
.layout:has(.sa-dashboard) .side-heading {
  padding: 0 12px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
}
.layout:has(.sa-dashboard) .side-link {
  min-height: 48px;
  border-radius: 14px;
  padding: 8px 12px;
  color: rgba(255,255,255,.78);
  font-size: 15px;
  font-weight: 500;
}
.layout:has(.sa-dashboard) .side-link .side-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.layout:has(.sa-dashboard) .side-link:hover { transform: translateX(2px); }
.layout:has(.sa-dashboard) .side-link.active {
  background: rgba(255,255,255,.13);
  box-shadow: inset 3px 0 0 rgba(121,162,255,.92);
}

.content:has(.sa-dashboard) {
  padding: 32px;
  background: var(--sa-bg);
}
.sa-dashboard {
  max-width: 1500px;
  gap: 28px;
}

.sa-header {
  min-height: 88px;
  align-items: center;
  padding: 18px 24px;
  border-radius: 20px;
  background: var(--sa-card);
  box-shadow: var(--sa-shadow);
}
.sa-title-block h1 {
  font-size: clamp(2.25rem, 3.4vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}
.sa-title-block p {
  max-width: 620px;
  margin-top: 6px;
  color: var(--sa-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}
.sa-header-actions { gap: 12px; align-items: center; }
.sa-icon-btn {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 16px;
  font-size: 20px;
}
.sa-search-wrap { width: clamp(300px, 27vw, 392px); flex: 0 1 392px; }
.sa-search {
  min-height: 48px;
  border-radius: 16px;
  color: var(--sa-text);
  font-size: 15px;
  font-weight: 400;
}
.sa-profile {
  min-width: 168px;
  min-height: 48px;
  border-radius: 16px;
  padding: 5px 10px 5px 5px;
}
.sa-profile .sa-avatar { width: 38px; height: 38px; flex-basis: 38px; }
.sa-profile strong { max-width: 88px; font-size: 14px; font-weight: 600; }
.sa-profile span { color: var(--sa-muted); font-size: 12px; font-weight: 400; }
.sa-report-btn {
  min-width: 128px;
  min-height: 48px;
  border-radius: 14px;
  background: var(--sa-blue);
  font-size: 15px;
  font-weight: 600;
}

.sa-hero {
  min-height: 164px;
  padding: 28px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 18%, rgba(45,91,255,.08), transparent 18rem),
    #ffffff;
  box-shadow: var(--sa-shadow);
}
.sa-hero h2 {
  font-size: clamp(2rem, 3.1vw, 38px);
  line-height: 1.12;
  font-weight: 650;
}
.sa-hero p {
  margin-top: 8px;
  color: var(--sa-muted);
  font-size: 15px;
  font-weight: 400;
}
.admin-team-widget {
  min-width: 224px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 35px rgba(45,91,255,.06);
}
.admin-team-widget span { font-size: 13px; font-weight: 500; }
.admin-team-widget strong { margin: 8px 0 16px; font-size: 24px; font-weight: 650; }
.admin-team-widget small { font-size: 13px; font-weight: 500; }
.avatar-stack span { width: 36px; height: 36px; font-size: 12px; font-weight: 600; }

.sa-kpi-grid { gap: 24px; }
.dashboard-card {
  border-radius: 20px;
  padding: 24px;
  background: var(--sa-card);
  box-shadow: var(--sa-shadow);
}
.dashboard-card:hover:not(:has(table)) { transform: translateY(-2px); }
.dashboard-card h2 { font-size: 24px; font-weight: 600; }
.stat-card {
  min-height: 176px;
  padding: 24px;
}
.stat-card-top { margin-bottom: 14px; }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 600;
}
.stat-change {
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}
.stat-card .metric-label {
  min-height: auto;
  display: block;
  color: var(--sa-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
.stat-card .value {
  margin: 10px 0 6px;
  font-size: clamp(2.1rem, 2.6vw, 40px);
  font-weight: 650;
  line-height: 1;
}
.stat-card .metric-note { color: var(--sa-muted); font-size: 13px; font-weight: 400; }
.stat-card .mini-line,
.stat-card .mini-bars { height: 34px; margin-top: 12px; }

.sa-main-grid,
.sa-bottom-grid { gap: 24px; }
.chart-card,
.country-widget { min-height: 360px; }
.dashboard-card-head { margin-bottom: 20px; }
.chart-total { font-size: clamp(2rem, 2.8vw, 38px); font-weight: 650; }
.chart-positive { font-size: 13px; font-weight: 500; }
.line-chart-wrap { min-height: 238px; }
.line-chart { min-height: 230px; }
.sa-map-visual { min-height: 220px; }
.country-row > div:first-child { font-size: 14px; }
.country-row strong { font-weight: 500; }
.country-row span { font-weight: 400; }
.sa-activity-copy strong { font-size: 14px; font-weight: 600; }
.sa-activity-copy small { font-size: 13px; font-weight: 400; }
.sa-activity-row { border-radius: 14px; }
.sa-activity-icon { width: 36px; height: 36px; }

.sa-cta-card {
  min-height: 172px;
  padding: 28px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 42%, rgba(125,171,255,.18), transparent 12rem),
    linear-gradient(135deg, #09235c, #143a8e);
}
.sa-cta-card h2 { font-size: clamp(1.4rem, 2.1vw, 24px); font-weight: 600; }
.sa-cta-card p { font-size: 15px; font-weight: 400; }
.sa-cta-card .btn {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 500;
}

@media (max-width: 1440px) {
  .layout:has(.sa-dashboard) { grid-template-columns: 260px minmax(0, 1fr); }
  .layout:has(.sa-dashboard) .sidebar { width: 260px; }
  .content:has(.sa-dashboard) { padding: 28px; }
  .sa-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 992px) {
  .layout:has(.sa-dashboard) { grid-template-columns: 1fr; }
  .content:has(.sa-dashboard) { padding: 24px; }
  .sa-header { align-items: flex-start; flex-direction: column; }
  .sa-header-actions { width: 100%; flex-wrap: wrap; }
  .sa-search-wrap { flex: 1 1 320px; width: auto; }
  .sa-hero { align-items: flex-start; flex-direction: column; }
  .admin-team-widget { width: 100%; }
  .sa-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-main-grid, .sa-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content:has(.sa-dashboard) { padding: 16px; }
  .sa-dashboard { gap: 20px; }
  .sa-title-block h1 { font-size: 34px; }
  .sa-header-actions { display: grid; grid-template-columns: 48px 1fr; }
  .sa-search-wrap, .sa-profile, .sa-report-btn { width: 100%; grid-column: 1 / -1; }
  .sa-kpi-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 168px; }
  .sa-hero h2 { font-size: 32px; }
}

/* World map SVG refinement */
.sa-map-visual {
  min-height: 230px;
  padding: 16px;
  background: linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%);
  isolation: isolate;
}

.sa-map-image {
  width: min(100%, 570px);
  height: auto;
  display: block;
  opacity: 0.9;
  filter: saturate(0.72) contrast(0.96) brightness(1.04) drop-shadow(0 16px 28px rgba(49, 92, 255, 0.08));
  pointer-events: none;
  user-select: none;
}

.sa-map-pin {
  display: inline-grid;
  place-items: center;
  gap: 2px;
  min-width: 58px;
  padding: 6px 8px;
  border-radius: 14px;
  color: #244cff;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(133, 162, 255, 0.42);
  box-shadow: 0 14px 28px rgba(49, 92, 255, 0.16);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.sa-map-pin strong {
  font-size: 13px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0;
}

.sa-map-pin em {
  font-size: 11px;
  line-height: 1;
  font-style: normal;
  font-weight: 500;
  color: #50627e;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .sa-map-visual {
    min-height: 190px;
    padding: 12px;
  }

  .sa-map-pin {
    min-width: 48px;
    padding: 5px 6px;
  }

  .sa-map-pin strong {
    font-size: 12px;
  }

  .sa-map-pin em {
    font-size: 10px;
  }
}

/* Super Admin sidebar black theme refinement */
.layout:has(.sa-dashboard) .sidebar {
  background: #030303;
  color: #ffffff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.22);
}

.layout:has(.sa-dashboard) .sidebar-scroll {
  padding-bottom: 12px;
}

.layout:has(.sa-dashboard) .brand-lockup {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.layout:has(.sa-dashboard) .brand-lockup strong {
  color: #ffffff;
  font-weight: 650;
  letter-spacing: 0;
}

.layout:has(.sa-dashboard) .brand-lockup span,
.layout:has(.sa-dashboard) .side-heading {
  color: rgba(255, 255, 255, 0.52);
}

.layout:has(.sa-dashboard) .side-link {
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
}

.layout:has(.sa-dashboard) .side-link .side-icon {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.layout:has(.sa-dashboard) .side-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.layout:has(.sa-dashboard) .side-link:hover .side-icon {
  background: rgba(47, 91, 255, 0.28);
  border-color: rgba(101, 136, 255, 0.35);
}

.layout:has(.sa-dashboard) .side-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2457ff 0%, #1338d8 100%);
  box-shadow: 0 14px 28px rgba(36, 87, 255, 0.26);
}

.layout:has(.sa-dashboard) .side-link.active .side-icon {
  color: #2457ff;
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.48);
}

.layout:has(.sa-dashboard) .sidebar-bottom {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(3, 3, 3, 0) 0%, #030303 18%);
}

.layout:has(.sa-dashboard) .sidebar-bottom > .side-link {
  min-height: 44px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.layout:has(.sa-dashboard) .sidebar-bottom > .side-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.layout:has(.sa-dashboard) .sidebar-bottom > .side-link:last-of-type {
  color: #ffd4d4;
}

.layout:has(.sa-dashboard) .sidebar-bottom > .side-link:last-of-type .side-icon {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.2);
}

.layout:has(.sa-dashboard) .sidebar-user {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.layout:has(.sa-dashboard) .sidebar-user .avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2457ff, #6f8cff);
  box-shadow: 0 12px 28px rgba(36, 87, 255, 0.34);
  color: #ffffff;
  font-size: 15px;
  font-weight: 650;
}

.layout:has(.sa-dashboard) .sidebar-user strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

.layout:has(.sa-dashboard) .sidebar-user small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 500;
}

/* Sidebar fixed logo and custom menu scrollbar */
.sidebar {
  height: 100vh;
  overflow: hidden;
}

.brand-lockup {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
  background: inherit;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.layout:has(.sa-dashboard) .sidebar {
  overflow: hidden;
  -ms-overflow-style: auto;
}

.layout:has(.sa-dashboard) .sidebar-scroll {
  padding-right: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Super Admin sidebar requested spacing and stable hover sizing */
.layout:has(.sa-dashboard) .sidebar {
  width: 272px;
  padding: 24px 0 18px 18px;
}

.layout:has(.sa-dashboard) .brand-lockup {
  margin-bottom: 0;
  padding-bottom: 0;
  padding-right: 18px;
}

.layout:has(.sa-dashboard) .brand-lockup img,
.brand-lockup img {
  margin-bottom: 0;
}

.layout:has(.sa-dashboard) .sidebar-scroll {
  padding-right: 10px;
  padding-top: 24px;
}

.layout:has(.sa-dashboard) .side-group {
  margin-top: 30px;
}

.layout:has(.sa-dashboard) .side-group:first-child {
  margin-top: 0;
}

.layout:has(.sa-dashboard) .side-link {
  width: 100%;
  min-height: 64px;
  height: 64px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  margin: 0 0 2px;
  border: 1px solid transparent;
  transform: translateX(0);
}

.layout:has(.sa-dashboard) .side-link:hover,
.layout:has(.sa-dashboard) .side-link.active {
  transform: translateX(0);
  border-color: rgba(255, 255, 255, 0.12);
}

.layout:has(.sa-dashboard) .side-link .side-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.layout:has(.sa-dashboard) .side-heading {
  padding: 0 14px 12px;
}

@media (max-width: 1440px) {
  .layout:has(.sa-dashboard) .sidebar {
    width: 272px;
    padding: 24px 0 18px 18px;
  }
}

/* App-wide sidebar spacing and stable menu behavior */
.layout .sidebar {
  width: 272px;
  padding: 24px 0 18px 18px;
  overflow: hidden;
}

.layout .brand-lockup {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-bottom: 0;
  padding-right: 18px;
}

.layout .brand-lockup img {
  margin-bottom: 0;
}

.layout .sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 24px;
  padding-right: 10px;
}

.layout .side-group {
  margin-top: 30px;
}

.layout .side-group:first-child {
  margin-top: 0;
}

.layout .side-heading {
  padding: 0 14px 12px;
}

.layout .side-link {
  width: 100%;
  min-height: 64px;
  height: 64px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  margin: 0 0 2px;
  border: 1px solid transparent;
  transform: translateX(0);
}

.layout .side-link:hover,
.layout .side-link.active {
  transform: translateX(0);
}

.layout .side-link .side-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

@media (max-width: 1440px) {
  .layout .sidebar {
    width: 272px;
    padding: 24px 0 18px 18px;
  }
}

/* Premium Vedrix authentication -- dark mode, matching the client dashboard's
   own dark palette (--app-bg / --app-panel / --app-blue from client-dark.css)
   so moving from auth into the portal feels like one product. */
body[data-page="login"],
body[data-page="forgot-password"],
body[data-page="forgot-password-verify"],
body[data-page="reset-password"],
body[data-page="otp"] {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 10%, rgba(37, 99, 235, 0.14), transparent 34%),
    radial-gradient(circle at 12% 92%, rgba(59, 130, 246, 0.1), transparent 32%),
    #0B0F17;
  color-scheme: dark;
}

/* Login fills the full viewport edge-to-edge (see the login-specific
   .auth-shell rule below). forgot-password/otp keep the compact floating
   card, sized to its natural content height and centered by this parent. */
body[data-page="login"] #root,
body[data-page="forgot-password"] #root,
body[data-page="forgot-password-verify"] #root,
body[data-page="reset-password"] #root,
body[data-page="otp"] #root {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

body[data-page="login"] .auth-shell,
body[data-page="forgot-password"] .auth-shell,
body[data-page="forgot-password-verify"] .auth-shell,
body[data-page="reset-password"] .auth-shell,
body[data-page="otp"] .auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
}

body[data-page="login"] .auth-shell::before,
body[data-page="forgot-password"] .auth-shell::before,
body[data-page="forgot-password-verify"] .auth-shell::before,
body[data-page="reset-password"] .auth-shell::before,
body[data-page="otp"] .auth-shell::before {
  content: "";
  position: fixed;
  inset: auto -12vw -22vh auto;
  width: 46vw;
  height: 46vw;
  pointer-events: none;
  background: radial-gradient(circle, rgba(36, 87, 255, 0.12), transparent 64%);
  filter: blur(6px);
}

/* All auth-flow pages (login, forgot-password, its OTP step, reset-password,
   the legacy otp stub) share this same full-bleed two-column shell -- the
   branding panel must stay on the left at the same width on every one of
   them, not just on login (previously forgot-password/reset-password fell
   back to a narrow centered floating card, which read as a different,
   inconsistent layout). */
body[data-page="login"] .auth-shell,
body[data-page="forgot-password"] .auth-shell,
body[data-page="forgot-password-verify"] .auth-shell,
body[data-page="reset-password"] .auth-shell,
body[data-page="otp"] .auth-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #0B0F17;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-page="login"] .auth-shell::before,
body[data-page="forgot-password"] .auth-shell::before,
body[data-page="forgot-password-verify"] .auth-shell::before,
body[data-page="reset-password"] .auth-shell::before,
body[data-page="otp"] .auth-shell::before {
  content: none;
}

body[data-page="login"] .auth-brand,
body[data-page="forgot-password"] .auth-brand,
body[data-page="forgot-password-verify"] .auth-brand,
body[data-page="reset-password"] .auth-brand,
body[data-page="otp"] .auth-brand {
  display: none;
  position: relative;
  isolation: isolate;
  min-height: 100%;
  padding: clamp(32px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.16), transparent 22%),
    radial-gradient(circle at 78% 24%, rgba(59, 130, 246, 0.32), transparent 25%),
    radial-gradient(circle at 58% 72%, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(145deg, #07122D 0%, #102A73 52%, #174CFF 100%);
}

body[data-page="login"] .auth-brand::after,
body[data-page="forgot-password"] .auth-brand::after,
body[data-page="forgot-password-verify"] .auth-brand::after,
body[data-page="reset-password"] .auth-brand::after,
body[data-page="otp"] .auth-brand::after {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 28%),
    radial-gradient(circle at 70% 64%, rgba(158, 219, 255, 0.2), transparent 35%);
  filter: blur(26px);
}

.auth-brand-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.auth-brand-glow span {
  position: absolute;
  display: block;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(34px);
}

.auth-brand-glow span:nth-child(1) { top: 8%; right: -34px; }
.auth-brand-glow span:nth-child(2) { left: -42px; bottom: 28%; background: rgba(60, 183, 255, 0.22); }
.auth-brand-glow span:nth-child(3) { right: 16%; bottom: -44px; background: rgba(255, 255, 255, 0.18); }

body[data-page="login"] .auth-logo,
body[data-page="forgot-password"] .auth-logo,
body[data-page="forgot-password-verify"] .auth-logo,
body[data-page="reset-password"] .auth-logo,
body[data-page="otp"] .auth-logo {
  width: 206px;
  max-width: 72%;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.14));
}

.auth-brand-copy {
  max-width: 390px;
}

.auth-brand-copy h2 {
  margin: 0 0 14px;
  color: #fff !important;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 720;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.auth-brand-copy p {
  margin: 0;
  max-width: 360px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.65;
}

body[data-page="login"] .auth-card,
body[data-page="forgot-password"] .auth-card,
body[data-page="forgot-password-verify"] .auth-card,
body[data-page="reset-password"] .auth-card,
body[data-page="otp"] .auth-card {
  width: 100%;
  max-width: 550px;
  align-self: center;
  justify-self: center;
  padding: clamp(32px, 4vw, 54px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  animation: appCardIn 420ms var(--app-ease) both;
}

.auth-form-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: rgba(36, 87, 255, 0.1);
}

.auth-form-mark img {
  width: 30px;
  height: 30px;
}

.auth-title {
  margin: 18px 0 20px;
  color: #F7F9FC !important;
  font-size: clamp(24px, 2.6vw, 28px);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: #929CAD;
  font-size: 15px;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

body[data-page="login"] .form-label,
body[data-page="forgot-password"] .form-label,
body[data-page="forgot-password-verify"] .form-label,
body[data-page="reset-password"] .form-label,
body[data-page="otp"] .form-label {
  margin: 0;
  color: #D6DBE5;
  font-size: 14px;
  font-weight: 500;
}

body[data-page="login"] .form-control,
body[data-page="forgot-password"] .form-control,
body[data-page="forgot-password-verify"] .form-control,
body[data-page="reset-password"] .form-control,
body[data-page="otp"] .form-control {
  min-height: 52px !important;
  padding: 0 16px;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #171B24 !important;
  color: #F5F7FA !important;
  font-size: 15px !important;
  font-weight: 400;
}

body[data-page="login"] .form-control::placeholder,
body[data-page="forgot-password"] .form-control::placeholder,
body[data-page="forgot-password-verify"] .form-control::placeholder,
body[data-page="reset-password"] .form-control::placeholder,
body[data-page="otp"] .form-control::placeholder {
  color: #737D8E;
}

body[data-page="login"] .form-control:focus,
body[data-page="forgot-password"] .form-control:focus,
body[data-page="forgot-password-verify"] .form-control:focus,
body[data-page="reset-password"] .form-control:focus,
body[data-page="otp"] .form-control:focus {
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22) !important;
}

body[data-page="login"] .form-control.is-invalid,
body[data-page="forgot-password"] .form-control.is-invalid,
body[data-page="forgot-password-verify"] .form-control.is-invalid,
body[data-page="reset-password"] .form-control.is-invalid,
body[data-page="otp"] .form-control.is-invalid {
  border-color: #f87171 !important;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #9AA4B2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms var(--app-ease), color 160ms var(--app-ease);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(37, 99, 235, 0.16);
  color: #60A5FA;
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #929CAD;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.remember-check input {
  width: 16px;
  height: 16px;
  accent-color: #2563EB;
}

.forgot-link,
.auth-back-link {
  color: #5B9CFF;
  font-size: 14px;
  font-weight: 500;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.forgot-link:hover,
.auth-back-link:hover {
  color: #8FBBFF;
}

.auth-form-row .auth-back-link {
  margin-top: 0;
}

.auth-form-row--end {
  justify-content: flex-end;
}

.auth-submit {
  width: 100%;
  min-height: 52px !important;
  margin-top: 8px;
  border-radius: 16px !important;
  font-size: 15px !important;
  font-weight: 500;
  transition: transform 180ms var(--app-ease), box-shadow 180ms var(--app-ease);
}

/* Compact, right-aligned variant for the two-action Forgot Password / Reset
   Password screens (see item 14/15 of the auth consistency brief) -- Login
   keeps its full-width Sign In button untouched since it isn't scoped here. */
.auth-form-row .auth-submit {
  width: auto;
  min-width: 190px;
  margin-top: 0;
}

/* Scoped (not just .auth-submit) so this wins over the site-wide, unscoped
   .btn-app rule at equal !important weight -- an attribute-qualified
   selector always beats a bare class selector regardless of source order. */
body[data-page="login"] .auth-submit,
body[data-page="forgot-password"] .auth-submit,
body[data-page="forgot-password-verify"] .auth-submit,
body[data-page="reset-password"] .auth-submit,
body[data-page="otp"] .auth-submit,
body.signup-auth-page .auth-submit {
  background: linear-gradient(135deg, #2563EB, #3B82F6) !important;
  border-color: #2563EB !important;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.32) !important;
}

.auth-submit:hover:not(:disabled) {
  box-shadow: 0 22px 42px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-2px);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.auth-signup-hint {
  margin: 22px 0 0;
  color: #929CAD;
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
}

.auth-signup-hint .auth-signup-link {
  color: #5B9CFF;
  font-weight: 600;
  border: 0;
  background: none;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.auth-signup-hint .auth-signup-link:hover,
.auth-signup-hint .auth-signup-link:focus-visible {
  color: #8FBBFF;
  text-decoration: underline;
}

.auth-error,
.auth-success {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.45;
}

.auth-error {
  color: #FCA5A5;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.1);
}

.auth-success {
  color: #6EE7B7;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.1);
}

/* Six-digit verification code entry, shared by any auth flow that needs it
   (currently password reset -- see OtpCodeInput in app.js). */
.otp-input-group {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.otp-input-box {
  width: 100%;
  min-height: 56px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #171B24 !important;
  color: #F5F7FA !important;
  font-size: 22px !important;
  font-weight: 650;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.otp-input-box:focus {
  outline: none;
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.otp-input-group.has-error .otp-input-box {
  border-color: rgba(248, 113, 113, 0.5) !important;
}

.otp-resend-row {
  margin-top: 4px;
}

.otp-resend-hint {
  color: #7D8798;
  font-size: 13px;
  font-weight: 500;
}

/* Small "which email got the code" line, placed just above the OTP boxes
   instead of as a paragraph under the heading -- keeps the context useful
   without reintroducing a subtitle (see item 5 of the auth consistency brief). */
.otp-target-hint {
  margin: 0 0 4px;
  color: #7D8798;
  font-size: 13px;
  font-weight: 500;
}

.otp-target-hint strong {
  color: #D6DBE5;
  font-weight: 500;
}

.forgot-link:disabled {
  color: #5B6472;
  cursor: default;
}

@media (max-width: 420px) {
  .otp-input-group {
    gap: 7px;
  }

  .otp-input-box {
    min-height: 48px !important;
    font-size: 19px !important;
  }
}

.auth-contact-card {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.1);
}

.auth-admin-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.1);
}

.auth-admin-avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  color: #fff;
  font-size: 17px;
  font-weight: 720;
}

.auth-admin-profile div {
  display: grid;
  gap: 2px;
}

.auth-admin-profile strong {
  color: #F5F7FA;
  font-size: 16px;
  font-weight: 720;
}

.auth-admin-profile span {
  color: #929CAD;
  font-size: 13.5px;
  font-weight: 550;
}

.auth-view-panel {
  animation: authViewIn 320ms var(--app-ease) both;
}

@keyframes authViewIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

.auth-contact-card strong {
  color: #111827;
  font-size: 15px;
  font-weight: 720;
}

.auth-contact-card span {
  color: #929CAD;
  font-size: 14px;
  line-height: 1.45;
}

.auth-contact-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-contact-actions a {
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  color: #F5F7FA;
  background: #171B24;
  font-size: 13px;
  font-weight: 680;
  transition: transform 180ms var(--app-ease), border-color 180ms var(--app-ease), box-shadow 180ms var(--app-ease);
}

.auth-contact-actions a:hover,
.auth-contact-actions a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.18);
}

.auth-contact-actions i {
  color: #5B9CFF;
  font-size: 19px;
}

/* otp.html is a legacy stub (demo-login only, not part of the real
   OTP/verification flow) that predates the .auth-* component system and
   still uses raw Bootstrap classes -- covered here so it isn't left as a
   stray white page inside an otherwise-dark auth flow. */
body[data-page="otp"] {
  --app-muted: #929CAD;
}

body[data-page="otp"] .h3 {
  color: #F7F9FC;
}

body[data-page="otp"] .alert-danger {
  color: #FCA5A5;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.1);
}

.auth-field-error {
  color: #FCA5A5;
  font-size: 13px;
  font-weight: 560;
}

.auth-back-link {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Google sign-in -- Login and Create Account only (see item 23 of the auth
   dark-mode brief). Dark secondary button: transparent-on-dark surface with
   a thin border, matching the "no light panels" rule; the G glyph keeps its
   official four brand colours regardless of theme. */
.google-auth-button {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #171B24;
  color: #F5F7FA;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.google-auth-button:hover,
.google-auth-button:focus-visible {
  background: #1E2430;
  border-color: rgba(255, 255, 255, 0.2);
}

.google-auth-icon {
  width: 19px;
  height: 19px;
  flex: none;
}

.auth-or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: #7D8798;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-or-divider::before,
.auth-or-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 900px) {
  body[data-page="login"] .auth-shell,
  body[data-page="forgot-password"] .auth-shell,
  body[data-page="forgot-password-verify"] .auth-shell,
  body[data-page="reset-password"] .auth-shell,
  body[data-page="otp"] .auth-shell {
    width: min(560px, calc(100vw - 28px));
    min-height: 0;
  }

  body[data-page="login"] .auth-brand,
  body[data-page="forgot-password"] .auth-brand,
  body[data-page="forgot-password-verify"] .auth-brand,
  body[data-page="reset-password"] .auth-brand,
  body[data-page="otp"] .auth-brand {
    min-height: 210px;
    padding: 28px;
  }

  .auth-brand-copy h2 {
    font-size: 30px;
  }

  .auth-brand-copy p {
    font-size: 14px;
  }

  body[data-page="login"] .auth-card,
  body[data-page="forgot-password"] .auth-card,
  body[data-page="forgot-password-verify"] .auth-card,
  body[data-page="reset-password"] .auth-card,
  body[data-page="otp"] .auth-card {
    max-width: none;
    padding: 30px;
  }
}

@media (max-width: 560px) {
  body[data-page="login"] .auth-shell,
  body[data-page="forgot-password"] .auth-shell,
  body[data-page="forgot-password-verify"] .auth-shell,
  body[data-page="reset-password"] .auth-shell,
  body[data-page="otp"] .auth-shell {
    width: calc(100vw - 20px);
    border-radius: 22px;
  }

  body[data-page="login"] .auth-shell {
    border-radius: 0;
  }

  body[data-page="login"] .auth-brand,
  body[data-page="forgot-password"] .auth-brand,
  body[data-page="forgot-password-verify"] .auth-brand,
  body[data-page="reset-password"] .auth-brand,
  body[data-page="otp"] .auth-brand {
    min-height: 148px;
    padding: 22px;
  }

  body[data-page="login"] .auth-logo,
  body[data-page="forgot-password"] .auth-logo,
  body[data-page="forgot-password-verify"] .auth-logo,
  body[data-page="reset-password"] .auth-logo,
  body[data-page="otp"] .auth-logo {
    width: 154px;
  }

  .auth-brand-copy {
    display: none;
  }

  body[data-page="login"] .auth-card,
  body[data-page="forgot-password"] .auth-card,
  body[data-page="forgot-password-verify"] .auth-card,
  body[data-page="reset-password"] .auth-card,
  body[data-page="otp"] .auth-card {
    padding: 26px 20px 24px;
  }

  .auth-form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .auth-contact-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .layout .sidebar {
    width: min(86vw, 320px);
    padding: 24px 0 18px 18px;
  }
}

/* Sidebar logo requested sizing */
.layout:has(.sa-dashboard) .brand-lockup img,
.brand-lockup img {
  align-items: center;
  width: 150px;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

/* Vedrix classic collapsible CRM sidebar */
.layout {
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns 240ms var(--app-ease);
}

.layout:has(.sidebar.collapsed) {
  grid-template-columns: 88px minmax(0, 1fr);
}

.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 280px;
  height: 100vh;
  padding: 20px;
  overflow: visible;
  background: linear-gradient(180deg, #18191b 0%, #121415 100%);
  color: #f7f8fb;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 16px 0 42px rgba(0, 0, 0, 0.22);
  transition: width 240ms var(--app-ease), padding 240ms var(--app-ease), transform 240ms var(--app-ease);
}

.layout .sidebar.collapsed,
.layout:has(.sa-dashboard) .sidebar.collapsed {
  width: 88px;
  padding: 20px 16px;
}

.layout .brand-lockup,
.layout:has(.sa-dashboard) .brand-lockup {
  position: relative;
  top: auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.layout .brand-lockup img,
.layout:has(.sa-dashboard) .brand-lockup img,
.brand-lockup img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  margin: 0;
  flex: 0 0 42px;
}

.brand-mark strong {
  display: block;
  color: #ffffff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.sidebar-collapse {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms var(--app-ease), background 180ms var(--app-ease), border-color 180ms var(--app-ease);
}

.sidebar-collapse:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.layout .sidebar-scroll,
.layout:has(.sa-dashboard) .sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 0 14px;
}

.side-menu-label {
  margin: 0 0 12px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-menu {
  display: grid;
  gap: 6px;
}

.layout .side-group,
.layout:has(.sa-dashboard) .side-group,
.layout .side-heading,
.layout:has(.sa-dashboard) .side-heading {
  display: none;
}

.layout .side-link,
.layout:has(.sa-dashboard) .side-link,
.layout .sidebar-bottom > .side-link,
.layout:has(.sa-dashboard) .sidebar-bottom > .side-link {
  position: relative;
  width: 100%;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  box-shadow: none;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transform: none;
  transition: color 180ms var(--app-ease), background 180ms var(--app-ease), border-color 180ms var(--app-ease), box-shadow 180ms var(--app-ease);
}

.layout .side-link:hover,
.layout:has(.sa-dashboard) .side-link:hover {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.08);
  transform: none;
}

.layout .side-link.active,
.layout:has(.sa-dashboard) .side-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(36, 87, 255, 0.95), rgba(36, 87, 255, 0.55));
  border-color: rgba(108, 138, 255, 0.44);
  box-shadow: 0 14px 30px rgba(36, 87, 255, 0.22);
  transform: none;
}

.layout .side-link.danger:hover,
.layout:has(.sa-dashboard) .side-link.danger:hover {
  color: #ffd6d6;
  background: rgba(255, 89, 89, 0.08);
  border-color: rgba(255, 89, 89, 0.18);
}

.layout .side-link .side-icon,
.layout:has(.sa-dashboard) .side-link .side-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: currentColor;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}

.side-svg {
  width: 21px;
  height: 21px;
  display: block;
}

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

.side-badge {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #111315;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.layout .sidebar-user,
.layout:has(.sa-dashboard) .sidebar-user {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 10px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #ffffff;
}

.layout .sidebar-user .avatar,
.layout:has(.sa-dashboard) .sidebar-user .avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #2457ff, #6b86ff);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(36, 87, 255, 0.24);
}

.sidebar-user-copy {
  min-width: 0;
}

.layout .sidebar-user strong,
.layout:has(.sa-dashboard) .sidebar-user strong {
  display: block;
  overflow: hidden;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.layout .sidebar-user small,
.layout:has(.sa-dashboard) .sidebar-user small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-weight: 500;
}

.sidebar.collapsed .brand-lockup {
  justify-content: center;
  padding-bottom: 20px;
}

.sidebar.collapsed .brand-mark strong,
.sidebar.collapsed .sidebar-collapse,
.sidebar.collapsed .side-label,
.sidebar.collapsed .side-menu-label,
.sidebar.collapsed .sidebar-user-copy {
  display: none;
}

.sidebar.collapsed .brand-mark {
  justify-content: center;
}

.sidebar.collapsed .sidebar-scroll {
  padding-top: 22px;
}

.sidebar.collapsed .side-menu {
  place-items: center;
}

.sidebar.collapsed .side-link {
  width: 56px;
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .side-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.sidebar.collapsed .sidebar-user {
  grid-template-columns: 1fr;
  justify-items: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.collapsed .side-link::after,
.sidebar.collapsed .sidebar-user::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  z-index: 80;
  transform: translateY(-50%) translateX(-4px);
  padding: 9px 12px;
  border-radius: 12px;
  color: #141517;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--app-ease), transform 160ms var(--app-ease);
}

.sidebar.collapsed .side-link:hover::after,
.sidebar.collapsed .sidebar-user:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 920px) {
  .layout,
  .layout:has(.sidebar.collapsed),
  .layout:has(.sa-dashboard),
  .layout:has(.sa-dashboard):has(.sidebar.collapsed) {
    grid-template-columns: 1fr;
  }

  .layout .sidebar,
  .layout .sidebar.collapsed,
  .layout:has(.sa-dashboard) .sidebar,
  .layout:has(.sa-dashboard) .sidebar.collapsed {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 320px);
    padding: 20px;
    transform: translateX(-104%);
  }

  .layout .sidebar.open,
  .layout .sidebar.collapsed.open,
  .layout:has(.sa-dashboard) .sidebar.open,
  .layout:has(.sa-dashboard) .sidebar.collapsed.open {
    transform: translateX(0);
  }

  .sidebar.collapsed .brand-mark strong,
  .sidebar.collapsed .side-label,
  .sidebar.collapsed .side-menu-label,
  .sidebar.collapsed .sidebar-user-copy {
    display: block;
  }

  .sidebar.collapsed .sidebar-collapse {
    display: none;
  }

  .sidebar.collapsed .side-menu {
    place-items: stretch;
  }

  .sidebar.collapsed .side-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
  }

  .sidebar.collapsed .sidebar-user {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: stretch;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Collapsed sidebar control and legacy span reset */
.layout .side-link .side-label,
.layout:has(.sa-dashboard) .side-link .side-label {
  width: auto;
  height: auto;
  opacity: 1;
  color: inherit;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.layout .side-link .side-badge,
.layout:has(.sa-dashboard) .side-link .side-badge {
  opacity: 1;
  color: #111315;
  background: #ffffff;
  box-shadow: none;
}

.sidebar.collapsed .brand-lockup {
  flex-direction: column;
  gap: 12px;
}

.sidebar.collapsed .sidebar-collapse {
  display: inline-grid;
  width: 42px;
  height: 32px;
  font-size: 12px;
}

@media (max-width: 920px) {
  .sidebar.collapsed .brand-lockup {
    flex-direction: row;
  }

  .sidebar.collapsed .sidebar-collapse {
    display: none;
  }
}

/* Account menu moved from sidebar to top-right header */
.sidebar .sidebar-user {
  display: none !important;
}

.user-menu {
  position: relative;
  z-index: 30;
}

.user-menu-trigger {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid #dfe6f2;
  border-radius: 999px;
  color: #111827;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border-color 180ms var(--app-ease), box-shadow 180ms var(--app-ease), transform 180ms var(--app-ease);
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
  border-color: #b9c7ff;
  box-shadow: 0 16px 32px rgba(45, 91, 255, 0.12);
  transform: translateY(-1px);
}

.user-menu-avatar {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, #334155);
  font-size: 13px;
  font-weight: 700;
}

.user-menu-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.user-menu-copy {
  min-width: 0;
  display: block;
  text-align: left;
  width: 50%;
}

.user-menu-copy strong {
  display: block;
  max-width: 120px;
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-menu-copy small {
  display: block;
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
}

.user-menu-caret {
  color: #6b7280;
  font-size: 12px;
  line-height: 1;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.16);
}

.user-menu-dropdown button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: #1f2937;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.user-menu-dropdown button:hover {
  background: #f4f7ff;
  color: #2457ff;
}

.user-menu-dropdown button.danger:hover {
  background: #fff1f1;
  color: #dc2626;
}

.sa-header .user-menu-trigger {
  min-height: 48px;
  border-radius: 16px;
}

@media (max-width: 640px) {
  .user-menu {
    width: 100%;
  }

  .user-menu-trigger {
    width: 100%;
    justify-content: flex-start;
  }

  .user-menu-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }
}

/* Sidebar logo mode and requested app padding */
.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar {
  padding: 20px 0 20px 20px;
}

.layout .sidebar.collapsed,
.layout:has(.sa-dashboard) .sidebar.collapsed {
  padding: 20px 16px;
}

.layout .brand-lockup,
.layout:has(.sa-dashboard) .brand-lockup {
  padding-right: 20px;
}

.layout .sidebar.collapsed .brand-lockup,
.layout:has(.sa-dashboard) .sidebar.collapsed .brand-lockup {
  padding-right: 0;
}

.brand-mark strong {
  display: none !important;
}

.brand-mark .brand-logo-full,
.layout .brand-lockup img.brand-logo-full,
.layout:has(.sa-dashboard) .brand-lockup img.brand-logo-full {
  width: 150px;
  height: auto;
  max-height: 46px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  margin: 0;
}

.brand-mark .brand-logo-icon,
.layout .brand-lockup img.brand-logo-icon,
.layout:has(.sa-dashboard) .brand-lockup img.brand-logo-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: none;
  flex: 0 0 42px;
  margin: 0;
}

.sidebar.collapsed .brand-mark .brand-logo-full {
  display: none;
}

.sidebar.collapsed .brand-mark .brand-logo-icon {
  display: block;
}

.sidebar.collapsed .brand-mark {
  width: 100%;
  justify-content: center;
}

@media (max-width: 920px) {
  .layout .sidebar,
  .layout .sidebar.collapsed,
  .layout:has(.sa-dashboard) .sidebar,
  .layout:has(.sa-dashboard) .sidebar.collapsed {
    padding: 20px 0 20px 20px;
  }

  .sidebar.collapsed .brand-mark .brand-logo-full {
    display: block;
  }

  .sidebar.collapsed .brand-mark .brand-logo-icon {
    display: none;
  }
}

/* Super Admin dashboard reference redesign */
.content:has(.sa-reference-dashboard) {
  padding: 0;
  background: #f4f4f4;
}

.content:has(.sa-reference-dashboard) > .topbar {
  display: none;
}

.sa-reference-dashboard {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  display: grid;
  gap: 0;
  color: #0b0b0c;
  background: #f4f4f4;
  font-family: Inter, system-ui, sans-serif;
}

.sa-ref-header {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 42px;
  border-bottom: 1px solid #dedede;
}

.sa-ref-title h1 {
  margin: 0;
  color: #050505;
  font-size: clamp(40px, 4vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.sa-ref-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.sa-ref-search {
  width: min(44vw, 520px);
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  border-radius: 18px;
  background: #e9e9e9;
  color: #0d0d0d;
}

.sa-ref-search span {
  font-size: 34px;
  line-height: 1;
}

.sa-ref-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #222;
  font-size: 18px;
  font-weight: 400;
}

.sa-ref-search input::placeholder {
  color: #a1a1a1;
}

.sa-ref-notification {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #5b91eb;
  background: #e9e9e9;
  font-size: 28px;
}

.sa-reference-dashboard .user-menu-trigger {
  min-height: 66px;
  padding: 6px 18px 6px 8px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: #1f35ff;
  box-shadow: none;
}

.sa-reference-dashboard .user-menu-trigger:hover,
.sa-reference-dashboard .user-menu.open .user-menu-trigger {
  transform: none;
  box-shadow: 0 18px 35px rgba(31, 53, 255, .16);
}

.sa-reference-dashboard .user-menu-avatar {
  width: 50px;
  height: 50px;
  background: #ffffff;
  color: #1f2937;
  overflow: hidden;
}

.sa-reference-dashboard .user-menu-copy strong,
.sa-reference-dashboard .user-menu-copy small,
.sa-reference-dashboard .user-menu-caret {
  color: #ffffff;
}

.sa-reference-dashboard .user-menu-copy strong {
  max-width: 150px;
  font-size: 18px;
  font-weight: 500;
}

.sa-reference-dashboard .user-menu-copy small {
  font-size: 15px;
  opacity: .72;
}

.sa-ref-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 42px 26px;
}

.sa-ref-intro h2 {
  margin: 0;
  color: #111;
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 500;
  letter-spacing: 0;
}

.sa-ref-select {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: #343434;
  background: #ffffff;
  font-size: 17px;
  font-weight: 400;
}

.sa-ref-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 0 42px 42px;
}

.sa-ref-metric,
.sa-ref-panel {
  border: 0;
  border-radius: 18px;
  background: #e8e8e8;
  box-shadow: none;
}

.sa-ref-metric {
  min-height: 272px;
  padding: 28px 28px 24px;
}

.sa-ref-metric-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  margin-bottom: 32px;
}

.sa-ref-metric.purple .sa-ref-metric-icon { background: #9917cf; }
.sa-ref-metric.coral .sa-ref-metric-icon { background: #f29571; }
.sa-ref-metric.blue .sa-ref-metric-icon { background: #6da2e9; }
.sa-ref-metric.gold .sa-ref-metric-icon { background: #f6c462; }

.sa-ref-metric .side-svg {
  width: 30px;
  height: 30px;
}

.sa-ref-metric p {
  margin: 0 0 14px;
  color: #858585;
  font-size: 20px;
  font-weight: 400;
}

.sa-ref-metric strong {
  display: block;
  color: #050505;
  font-size: clamp(34px, 3.1vw, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

.sa-ref-metric strong span {
  margin-left: 8px;
  font-size: 24px;
  font-weight: 400;
}

.sa-ref-metric small {
  display: block;
  margin-top: 18px;
  color: #3d3d3d;
  font-size: 15px;
  font-weight: 400;
}

.sa-ref-metric small.up::first-letter { color: #23a04d; }
.sa-ref-metric small.down { color: #444; }

.sa-ref-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(360px, 1fr);
  gap: 40px;
  padding: 0 42px 42px;
}

.sa-ref-panel {
  min-height: 360px;
  padding: 32px;
}

.sa-ref-panel h3 {
  margin: 0;
  color: #121212;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0;
}

.sa-ref-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sa-ref-revenue {
  min-height: 490px;
}

.sa-ref-map {
  min-height: 490px;
  overflow: hidden;
}

.sa-ref-map .sa-map-visual {
  min-height: 350px;
  margin-top: 24px;
  padding: 12px;
  border-radius: 18px;
  background: transparent;
}

.sa-ref-map .sa-map-image {
  width: min(100%, 520px);
  opacity: .55;
  filter: grayscale(1) contrast(.86) brightness(.98);
}

.sa-ref-map .sa-map-pin {
  background: #ffffff;
  box-shadow: none;
}

.sa-ref-chart {
  height: 360px;
  display: grid;
  place-items: center;
  padding-top: 26px;
}

.sa-ref-chart svg {
  width: 100%;
  height: 100%;
  opacity: .68;
}

.sa-ref-activities {
  min-height: 405px;
}

.sa-ref-activity-list {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.sa-ref-activity {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.sa-ref-activity > span {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: #111;
}

.sa-ref-activity strong {
  display: block;
  color: #151515;
  font-size: 15px;
  font-weight: 600;
}

.sa-ref-activity small,
.sa-ref-activity time {
  color: #858585;
  font-size: 13px;
  font-weight: 400;
}

.sa-ref-workload {
  min-height: 405px;
}

.sa-ref-workload-chart {
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  align-items: end;
  gap: 16px;
  padding-top: 28px;
}

.sa-ref-person {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.sa-ref-stack {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.sa-ref-stack span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #111;
  border-radius: 50%;
  color: #ffffff;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
}

.sa-ref-stack span.filled {
  background: #050505;
}

.sa-ref-stack span.hot {
  border-color: #f35b2b;
  background: #f35b2b;
}

.sa-ref-person small {
  color: #8b8b8b;
  font-size: 14px;
}

@media (max-width: 1320px) {
  .sa-ref-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-ref-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .sa-ref-header,
  .sa-ref-intro {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 22px;
  }

  .sa-ref-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .sa-ref-search {
    width: 100%;
  }

  .sa-ref-metrics,
  .sa-ref-grid {
    grid-template-columns: 1fr;
    padding-inline: 22px;
    gap: 20px;
  }

  .sa-ref-metric,
  .sa-ref-panel {
    min-height: auto;
  }

  .sa-ref-workload-chart {
    overflow-x: auto;
  }
}

/* Super Admin compact widget layout and overflow fix */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.layout,
.content,
.sa-reference-dashboard {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.content:has(.sa-reference-dashboard) {
  background: #f4f4f4;
  overflow-x: clip;
}

.sa-reference-dashboard {
  gap: 0;
}

.sa-reference-dashboard .sa-ref-header {
  min-width: 0;
  min-height: 96px;
  padding: 20px 30px;
}

.sa-reference-dashboard .sa-ref-title h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.sa-reference-dashboard .sa-ref-actions {
  min-width: 0;
  flex-wrap: wrap;
}

.sa-reference-dashboard .sa-ref-search {
  width: min(38vw, 430px);
  min-height: 50px;
  border-radius: 14px;
}

.sa-reference-dashboard .sa-ref-search span {
  font-size: 22px;
}

.sa-reference-dashboard .sa-ref-search input {
  font-size: 14px;
}

.sa-reference-dashboard .sa-ref-notification {
  width: 50px;
  height: 50px;
  font-size: 18px;
}

.sa-reference-dashboard .user-menu-trigger {
  min-height: 50px;
}

.sa-reference-dashboard .user-menu-avatar {
  width: 38px;
  height: 38px;
}

.sa-reference-dashboard .user-menu-copy strong {
  font-size: 14px;
}

.sa-reference-dashboard .user-menu-copy small {
  font-size: 12px;
}

.sa-reference-dashboard .sa-ref-intro {
  padding: 24px 30px 18px;
}

.sa-reference-dashboard .sa-ref-intro h2 {
  font-size: clamp(22px, 2vw, 30px);
}

.sa-reference-dashboard .sa-ref-select {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.sa-reference-dashboard .sa-ref-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0 30px 24px;
}

.sa-reference-dashboard .sa-ref-metric {
  min-height: 150px;
  padding: 18px;
  border-radius: 16px;
}

.sa-reference-dashboard .sa-ref-metric-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
}

.sa-reference-dashboard .sa-ref-metric.green .sa-ref-metric-icon {
  background: #5fd078;
}

.sa-reference-dashboard .sa-ref-metric .side-svg {
  width: 21px;
  height: 21px;
}

.sa-reference-dashboard .sa-ref-metric p {
  margin-bottom: 8px;
  font-size: 14px;
}

.sa-reference-dashboard .sa-ref-metric strong {
  font-size: clamp(24px, 2.4vw, 34px);
}

.sa-reference-dashboard .sa-ref-metric strong span {
  font-size: 15px;
}

.sa-reference-dashboard .sa-ref-metric small {
  margin-top: 12px;
  font-size: 12px;
}

.sa-reference-dashboard .sa-ref-widget-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  padding: 0 30px 30px;
}

.sa-reference-dashboard .sa-ref-panel {
  min-width: 0;
  min-height: 270px;
  padding: 22px;
  border-radius: 16px;
}

.sa-reference-dashboard .sa-ref-panel h3 {
  font-size: 18px;
}

.sa-reference-dashboard .sa-ref-map {
  grid-column: span 6;
}

.sa-reference-dashboard .sa-ref-revenue,
.sa-reference-dashboard .sa-ref-service-revenue {
  grid-column: span 3;
}

.sa-reference-dashboard .sa-ref-quick-actions,
.sa-reference-dashboard .sa-ref-team-performance {
  grid-column: span 6;
  min-height: 250px;
}

.sa-reference-dashboard .sa-ref-map .sa-map-visual {
  min-height: 230px;
  margin-top: 12px;
  padding: 0;
}

.sa-reference-dashboard .sa-ref-map .sa-map-image {
  width: min(100%, 520px);
}

.sa-reference-dashboard .sa-ref-chart {
  height: 210px;
  padding-top: 14px;
}

.sa-ref-donut-layout {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.sa-ref-donut {
  width: 112px;
  height: 112px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#315cff 0 28%, #7c3aed 28% 52%, #22c55e 52% 70%, #f97316 70% 84%, #a3a36f 84% 94%, #93a8ef 94% 100%);
}

.sa-ref-donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #e8e8e8;
}

.sa-ref-donut strong,
.sa-ref-donut span {
  position: relative;
  z-index: 1;
}

.sa-ref-donut strong {
  align-self: end;
  font-size: 15px;
}

.sa-ref-donut span {
  align-self: start;
  color: #777;
  font-size: 11px;
}

.sa-ref-service-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sa-ref-service-list div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.sa-ref-service-list span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sa-ref-service-list strong {
  min-width: 0;
  overflow: hidden;
  color: #222;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sa-ref-service-list b {
  font-weight: 600;
}

.sa-ref-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.sa-ref-action-grid button {
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  color: #111;
  background: #f7f7f7;
  font-size: 12px;
  font-weight: 500;
}

.sa-ref-action-grid .side-svg {
  width: 18px;
  height: 18px;
}

.priority-task-widget .sa-ref-panel-head {
  align-items: center;
}

.priority-task-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  margin-right: -2px;
  scrollbar-gutter: stable;
}

.priority-task-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 14px;
  color: #111827;
  text-align: left;
  background: rgba(255,255,255,0.46);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.priority-task-item:hover {
  transform: translateY(-1px);
  border-color: rgba(36,87,255,.28);
  background: rgba(255,255,255,0.66);
}

.priority-task-title {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.priority-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 999px;
  background: #2457ff;
  box-shadow: 0 0 0 4px rgba(36,87,255,.12);
}

.priority-dot.high {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}

.priority-dot.medium {
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249,115,22,.14);
}

.priority-dot.low {
  background: #2457ff;
  box-shadow: 0 0 0 4px rgba(36,87,255,.12);
}

.priority-task-meta {
  color: #667085;
  font-size: 12px;
}

.priority-task-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.priority-task-line .pill {
  padding: 3px 8px;
  font-size: 11px;
  justify-self: end;
}

.priority-task-line small {
  color: #667085;
  font-size: 12px;
  justify-self: start;
}

.task-toolbar .toolbar-actions {
  grid-template-columns: minmax(240px, 1.2fr) repeat(5, minmax(128px, .7fr)) auto auto;
}

.task-search {
  min-width: 220px;
}

.table-link {
  border: 0;
  padding: 0;
  color: #111827;
  background: transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
}

.table-link:hover {
  color: var(--app-blue);
}

.task-actions .action-menu {
  min-width: 168px;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-form-grid label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.task-form-wide {
  grid-column: 1 / -1;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.task-detail-grid > div {
  padding: 14px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.68);
}

.task-detail-grid span {
  display: block;
  margin-bottom: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

.task-detail-grid strong {
  color: #111827;
  font-size: 14px;
}

.task-detail-description,
.task-modal-actions {
  grid-column: 1 / -1;
}

.task-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.task-detail-description p {
  margin: 0;
  color: #475467;
}

.task-modal-panel {
  width: min(980px, 96vw);
}

.task-view-switcher {
  align-items: center;
}

.task-view-switcher-compact {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.task-view-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.64);
  border-radius: 16px;
  background: rgba(255,255,255,.56);
}

.task-view-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: #475467;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.task-view-tabs button.active,
.task-view-tabs button[aria-selected="true"] {
  color: #fff;
  background: #2457ff;
  box-shadow: 0 12px 26px rgba(36,87,255,.22);
}

.task-kanban-board {
  display: flex;
  flex-flow: row nowrap;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.task-kanban-board::-webkit-scrollbar {
  display: none;
}

.task-kanban-view {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.task-kanban-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 38px;
}

.task-kanban-navigation .icon-action-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.task-kanban-navigation .icon-action-btn:disabled {
  opacity: 0.38;
  cursor: default;
  box-shadow: none;
}

.task-kanban-column {
  flex: 0 0 clamp(250px, calc((100% - 48px) / 4), 320px);
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.58), rgba(255,255,255,.34));
  box-shadow: 0 18px 48px rgba(31,64,128,.08);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

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

.task-kanban-head h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 750;
}

.task-kanban-head span {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #2457ff;
  background: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
}

.task-kanban-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.task-kanban-card,
.task-list-item {
  border: 1px solid rgba(255,255,255,.62);
  background: rgba(255,255,255,.58);
  box-shadow: 0 16px 38px rgba(31,64,128,.08);
}

.task-kanban-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
}

.task-kanban-card-clickable {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.task-kanban-card-clickable:hover,
.task-kanban-card-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(36, 87, 255, .34);
  box-shadow: 0 20px 44px rgba(31,64,128,.13);
}

.task-card-title {
  display: block;
}

.task-card-title strong,
.task-list-main h3 {
  margin: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.task-kanban-card p,
.task-list-main p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.task-card-meta,
.task-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
}

.task-assign-select {
  display: grid;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.task-assign-select .form-select {
  min-height: 36px;
}

.task-empty-column {
  padding: 18px;
  border: 1px dashed rgba(36,87,255,.25);
  border-radius: 14px;
  color: #667085;
  background: rgba(255,255,255,.36);
  font-size: 13px;
  text-align: center;
}

.task-list-view {
  display: grid;
  gap: 14px;
}

.task-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

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

/* Task Management list view: four compact, consistently aligned rows. */
body[data-page="dashboard"] .task-management-page > .task-list-view.vedrix-scrollable-table {
  align-content: start;
  gap: 12px;
  height: 572px;
  min-height: 572px;
  max-height: 572px;
  padding: 2px 8px 2px 2px;
  overflow-x: hidden;
  scroll-padding-block: 2px;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-item {
  position: relative;
  min-height: 133px;
  padding: 18px 20px 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.78), rgba(99, 102, 241, 0.42)) top left / 100% 2px no-repeat,
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(247, 250, 255, 0.52));
  box-shadow: 0 14px 38px rgba(31, 64, 128, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-item:hover {
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: 0 18px 42px rgba(31, 64, 128, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-main {
  gap: 12px;
  min-width: 0;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-main > div:first-child {
  min-width: 0;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-main h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-main h3 .table-link {
  max-width: 100%;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-main p {
  overflow: hidden;
  color: #667085;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta {
  display: grid;
  grid-template-columns: minmax(190px, 1.45fr) minmax(170px, 1.3fr) minmax(145px, 1fr) minmax(100px, 0.72fr) minmax(105px, 0.76fr) minmax(110px, 0.8fr);
  align-items: start;
  gap: 0;
  min-width: 0;
  padding-top: 11px;
  border-top: 1px solid rgba(15, 23, 42, 0.065);
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 5px;
  min-width: 0;
  padding: 0 16px;
  border-left: 0;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item:first-child {
  padding-left: 0;
  border-left: 0;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item > small {
  color: #8490a3;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item > span,
body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item > strong {
  line-height: 1.35;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-person {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-client,
body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-service,
body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-assignee {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta .team-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  flex-basis: 26px;
  font-size: 10px;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta .pill {
  justify-self: start;
  white-space: nowrap;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-due {
  white-space: nowrap;
}

body[data-page="dashboard"] .task-management-page > .task-list-view .task-actions {
  align-self: center;
}

@media (max-width: 1120px) {
  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 0;
  }

  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .task-management-page > .task-list-view.vedrix-scrollable-table {
    height: 572px;
    min-height: 572px;
    max-height: 572px;
  }

  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px;
  }

  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 0;
  }

  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-meta-item:nth-child(4) {
    padding-left: 16px;
    border-left: 0;
  }
}

.task-toast {
  margin: 0;
  border-radius: 14px;
}

@media (max-width: 980px) {
  .task-view-switcher {
    align-items: stretch;
    flex-direction: column;
  }

  .task-view-tabs,
  .task-list-item {
    width: 100%;
  }

  .task-list-item {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .task-management-page > .task-list-view .task-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.sa-ref-team-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 12px;
}

.sa-ref-team-table th {
  padding: 8px;
  color: #777;
  font-weight: 500;
  text-align: left;
}

.sa-ref-team-table td {
  padding: 9px 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  color: #171717;
}

.sa-ref-team-table td:first-child span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 50%;
  color: #fff;
  background: #111;
  font-size: 10px;
}

@media (max-width: 1380px) {
  .sa-reference-dashboard .sa-ref-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sa-reference-dashboard .sa-ref-map,
  .sa-reference-dashboard .sa-ref-revenue,
  .sa-reference-dashboard .sa-ref-service-revenue,
  .sa-reference-dashboard .sa-ref-quick-actions,
  .sa-reference-dashboard .sa-ref-team-performance {
    grid-column: span 12;
  }
}

@media (max-width: 780px) {
  .sa-reference-dashboard .sa-ref-header,
  .sa-reference-dashboard .sa-ref-intro {
    padding-inline: 18px;
  }

  .sa-reference-dashboard .sa-ref-search {
    width: 100%;
  }

  .sa-reference-dashboard .sa-ref-metrics,
  .sa-reference-dashboard .sa-ref-widget-grid {
    grid-template-columns: 1fr;
    padding-inline: 18px;
  }

  .sa-reference-dashboard .sa-ref-metric,
  .sa-reference-dashboard .sa-ref-panel {
    grid-column: 1 / -1;
  }

  .sa-ref-donut-layout,
  .sa-ref-action-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard refinement pass: final overrides for sidebar/logo, compact typography and widgets. */
html,
body,
#app {
  max-width: 100%;
  overflow-x: hidden;
}

.layout,
.content,
.content:has(.sa-reference-dashboard),
.sa-reference-dashboard {
  max-width: 100%;
  overflow-x: clip;
}

.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar {
  padding: 20px 0 20px 20px;
  overflow: hidden;
}

.layout .sidebar-scroll,
.layout:has(.sa-dashboard) .sidebar-scroll {
  min-width: 0;
  padding-right: 0;
  margin-right: 0;
  overflow-x: hidden;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark .brand-logo-icon,
.layout .brand-lockup img.brand-logo-icon,
.layout:has(.sa-dashboard) .brand-lockup img.brand-logo-icon {
  width: 42px !important;
  height: 42px !important;
  display: block !important;
  object-fit: contain;
  margin: 0 !important;
}

.brand-wordmark,
.brand-mark strong.brand-wordmark {
  display: block !important;
  color: #f8fafc;
  font-family: "Orbitron", "Montserrat", "Inter", sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.sidebar.collapsed .brand-wordmark,
.sidebar.collapsed .brand-mark strong.brand-wordmark {
  display: none !important;
}

.sidebar.collapsed .brand-mark {
  justify-content: center;
  gap: 0;
}

.sa-reference-dashboard .sa-ref-title h1 {
  font-size: clamp(28px, 2.7vw, 40px);
  font-weight: 650;
  letter-spacing: 0;
}

.sa-reference-dashboard .sa-ref-intro h2 {
  font-size: clamp(22px, 1.9vw, 28px);
  font-weight: 600;
  letter-spacing: 0;
}

.sa-reference-dashboard .sa-ref-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.sa-reference-dashboard .sa-ref-metric {
  min-height: 168px;
  padding: 18px;
  overflow: hidden;
}

.sa-reference-dashboard .sa-ref-metric p {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-transform: none;
  letter-spacing: 0;
}

.sa-reference-dashboard .sa-ref-metric strong {
  font-size: clamp(24px, 2vw, 24px);
  font-weight: 650;
  letter-spacing: 0;
}

.sa-reference-dashboard .sa-ref-metric small {
  font-size: 11px;
  font-weight: 500;
}

.sa-reference-dashboard .sa-ref-metric .mini-line,
.sa-reference-dashboard .sa-ref-metric .mini-bars {
  width: 100%;
  height: 34px;
  margin-top: 10px;
}

.sa-reference-dashboard .sa-ref-metric .mini-line {
  display: block;
  opacity: 0.82;
}

.sa-reference-dashboard .sa-ref-panel {
  padding: 20px;
}

.sa-reference-dashboard .sa-ref-panel h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.sa-reference-dashboard .sa-ref-select,
.sa-reference-dashboard select,
.module-toolbar select,
.form-select {
  min-height: 38px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background-color: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.interactive-chart {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 190px;
}

.interactive-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-hover-label {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  font-size: 11px;
  font-weight: 650;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.interactive-donut-wrap {
  display: contents;
}

.sa-ref-donut.interactive {
  transition: transform 180ms ease, filter 180ms ease;
}

.sa-ref-donut.interactive:hover {
  transform: scale(1.03);
  filter: saturate(1.08);
}

.sa-ref-service-list button {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  color: #222;
  background: transparent;
  font-size: 11px;
  text-align: left;
  transition: background 180ms ease, transform 180ms ease;
}

.sa-ref-service-list button:hover,
.sa-ref-service-list button.active {
  background: rgba(36, 87, 255, 0.08);
}

.sa-ref-service-list button span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sa-ref-service-list button strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sa-ref-action-grid button {
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.sa-ref-action-grid button:hover {
  border-color: rgba(36, 87, 255, 0.22);
  background: #fff;
  transform: translateY(-2px);
}

@media (max-width: 1480px) {
  .sa-reference-dashboard .sa-ref-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .sa-reference-dashboard .sa-ref-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sa-reference-dashboard .sa-ref-metrics {
    grid-template-columns: 1fr;
  }

  .brand-wordmark,
  .brand-mark strong.brand-wordmark {
    font-size: 24px;
  }
}

/* Super Admin dashboard layout update. */
.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar {
  height: 100%;
}

.layout .sidebar.collapsed,
.layout:has(.sa-dashboard) .sidebar.collapsed {
  padding: 20px 0 16px 16px;
}

.sa-reference-dashboard .sa-ref-title h1 {
  font-size: clamp(28px, 2.7vw, 30px);
}

.sa-reference-dashboard .sa-ref-intro h2 {
  font-size: clamp(14px, 1.9vw, 20px);
}

.sa-data-status {
  display: block;
  margin-top: 4px;
  color: #8a94a6;
  font-size: 11px;
}

.sa-reference-dashboard .sa-ref-metric {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.sa-reference-dashboard .sa-ref-metric-icon {
  width: 34px;
  height: 34px;
  margin: 0;
  flex: 0 0 34px;
}

.sa-reference-dashboard .sa-ref-metric .side-svg {
  width: 16px;
  height: 16px;
}

.sa-reference-dashboard .sa-ref-metric-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sa-reference-dashboard .sa-ref-metric-main strong {
  min-width: 0;
  white-space: nowrap;
}

.sa-reference-dashboard .sa-ref-metric .mini-line,
.sa-reference-dashboard .sa-ref-metric .mini-bars {
  display: none !important;
}

.sa-reference-dashboard .sa-ref-map {
  grid-column: span 7;
}

.sa-reference-dashboard .sa-ref-revenue-combined {
  grid-column: span 5;
}

.sa-reference-dashboard .sa-ref-revenue,
.sa-reference-dashboard .sa-ref-service-revenue {
  grid-column: span 5;
}

.sa-reference-dashboard .sa-ref-quick-actions {
  grid-column: span 3;
}

.sa-reference-dashboard .sa-ref-team-performance {
  grid-column: span 6;
}

.sa-reference-dashboard .sa-ref-funnel {
  grid-column: span 3;
}

.sa-map-widget {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, 0.7fr);
  gap: 18px;
  align-items: center;
}

.sa-reference-dashboard .sa-map-widget .sa-map-visual {
  min-height: 260px;
  margin-top: 8px;
}

.sa-map-pin {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.sa-map-pin:hover,
.sa-map-pin.active {
  z-index: 3;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 16px 34px rgba(36, 87, 255, 0.22);
}

.sa-map-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 132px;
  transform: translate(-50%, calc(-100% - 18px));
  padding: 8px 10px;
  border: 1px solid rgba(36, 87, 255, 0.14);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.16);
  pointer-events: none;
}

.sa-map-tooltip strong,
.sa-map-tooltip span {
  display: block;
}

.sa-map-tooltip strong {
  font-size: 12px;
  font-weight: 650;
}

.sa-map-tooltip span {
  margin-top: 2px;
  color: #667085;
  font-size: 11px;
}

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

.sa-country-list button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.sa-country-list button:hover,
.sa-country-list button.active {
  border-color: rgba(36, 87, 255, 0.26);
  background: #f8faff;
}

.sa-country-list button span,
.sa-country-list button strong,
.sa-country-list button em {
  position: relative;
  z-index: 1;
}

.sa-country-list button span {
  min-width: 0;
  overflow: hidden;
  padding-left: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sa-country-list button strong {
  font-weight: 650;
}

.sa-country-list button em {
  padding-right: 10px;
  color: #6b7280;
  font-style: normal;
}

.sa-country-list button i {
  position: absolute;
  inset: auto auto 0 0;
  height: 3px;
  border-radius: 999px;
  background: #315cff;
}

.sa-reference-dashboard .sa-ref-revenue-combined .sa-ref-donut-layout {
  grid-template-columns: minmax(132px, 0.8fr) minmax(0, 1fr);
  margin-top: 22px;
}

.sa-ref-panel-head small {
  display: block;
  margin-top: 3px;
  color: #16a34a;
  font-size: 11px;
  font-weight: 500;
}

.sa-funnel-chart {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

.sa-funnel-bars {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.sa-funnel-bars button {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, #315cff, #8ba5ff);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.sa-funnel-bars button:hover,
.sa-funnel-bars button.active {
  transform: translateY(-2px);
  filter: saturate(1.12);
}

.sa-funnel-list {
  display: grid;
  gap: 6px;
}

.sa-funnel-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(17, 24, 39, 0.07);
  color: #111827;
  font-size: 12px;
}

.sa-funnel-list div.active {
  color: #315cff;
}

.sa-funnel-list em {
  color: #667085;
  font-style: normal;
}

@media (min-width: 1181px) {
  .sa-reference-dashboard .sa-ref-map {
    grid-column: span 7 !important;
  }

  .sa-reference-dashboard .sa-ref-revenue-combined {
    grid-column: span 5 !important;
  }

  .sa-reference-dashboard .sa-ref-quick-actions {
    grid-column: span 3 !important;
  }

  .sa-reference-dashboard .sa-ref-team-performance {
    grid-column: span 6 !important;
  }

  .sa-reference-dashboard .sa-ref-funnel {
    grid-column: span 3 !important;
  }
}

@media (max-width: 1180px) {
  .sa-reference-dashboard .sa-ref-map,
  .sa-reference-dashboard .sa-ref-revenue-combined,
  .sa-reference-dashboard .sa-ref-quick-actions,
  .sa-reference-dashboard .sa-ref-team-performance,
  .sa-reference-dashboard .sa-ref-funnel {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .sa-map-widget,
  .sa-reference-dashboard .sa-ref-revenue-combined .sa-ref-donut-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar scroll and chart refinement pass. */
.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  align-self: start;
}

.layout .brand-lockup,
.layout:has(.sa-dashboard) .brand-lockup {
  flex: 0 0 auto;
}

.layout .sidebar-scroll,
.layout:has(.sa-dashboard) .sidebar-scroll {
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.layout .side-menu,
.layout:has(.sa-dashboard) .side-menu {
  max-height: calc(100vh - 152px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.sa-reference-dashboard .sa-ref-revenue-combined .sa-ref-donut-layout {
  grid-template-columns: minmax(190px, 0.95fr) minmax(0, 1fr);
  align-items: center;
}

.sa-ref-donut.interactive {
  width: min(100%, 220px);
  height: auto;
  aspect-ratio: 1;
  position: relative;
  display: block;
  border-radius: 0;
  background: transparent !important;
}

.sa-ref-donut.interactive::after {
  display: none;
}

.sa-ref-donut.interactive svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.sa-donut-track,
.sa-donut-segment {
  fill: none;
  transform: rotate(-90deg);
  transform-origin: 110px 110px;
}

.sa-donut-track {
  stroke: rgba(17, 24, 39, 0.06);
  stroke-width: 31;
}

.sa-donut-segment {
  stroke-width: 31;
  stroke-linecap: round;
  cursor: pointer;
  transition: stroke-width 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.sa-donut-segment:hover,
.sa-donut-segment.active {
  stroke-width: 36;
  filter: drop-shadow(0 8px 12px rgba(17, 24, 39, 0.13));
}

.sa-donut-percent {
  fill: #111827;
  font-size: 13px;
  font-weight: 500;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.sa-donut-center {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: 92px;
  min-height: 62px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
}

.sa-donut-center strong {
  position: static;
  align-self: end;
  color: #111827;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
}

.sa-donut-center span {
  position: static;
  align-self: start;
  max-width: 90px;
  color: #667085;
  font-size: 11px;
  line-height: 1.15;
}

.sa-funnel-bars button {
  justify-content: center;
  padding: 0 14px;
}

.sa-funnel-bars button span {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* Fixed dashboard shell: only the page content scrolls. */
html,
body,
#root,
#app {
  height: 100%;
  margin: 0;
}

body[data-page="dashboard"] {
  min-height: 0;
  overflow: hidden;
}

html:has(body[data-page="dashboard"]) {
  overflow: hidden;
}

body[data-page="dashboard"] #app {
  min-height: 0;
  overflow: hidden;
}

body[data-page="dashboard"] .layout,
body[data-page="dashboard"] .layout:has(.sidebar.collapsed),
body[data-page="dashboard"] .layout:has(.sa-dashboard),
body[data-page="dashboard"] .layout:has(.sa-dashboard):has(.sidebar.collapsed) {
  width: 100%;
  height: 100vh;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

body[data-page="dashboard"] .sidebar,
body[data-page="dashboard"] .layout .sidebar,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar,
body[data-page="dashboard"] .layout .sidebar.collapsed,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar.collapsed {
  position: relative;
  top: auto;
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-page="dashboard"] .brand-lockup,
body[data-page="dashboard"] .layout .brand-lockup,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .brand-lockup {
  flex: 0 0 auto;
}

body[data-page="dashboard"] .sidebar-scroll,
body[data-page="dashboard"] .layout .sidebar-scroll,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
  padding-right: 0;
  margin-right: 0;
}

body[data-page="dashboard"] .side-menu-label {
  flex: 0 0 auto;
}

body[data-page="dashboard"] .side-menu,
body[data-page="dashboard"] .layout .side-menu,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-menu {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  margin-right: 0;
  overscroll-behavior: contain;
}

body[data-page="dashboard"] .content,
body[data-page="dashboard"] .content:has(.sa-dashboard),
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

body[data-page="dashboard"] .topbar,
body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 28px 30px;
}

body[data-page="dashboard"] .page-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 30px 30px;
  overscroll-behavior: contain;
}

body[data-page="dashboard"] .page-content > .sa-dashboard,
body[data-page="dashboard"] .page-content > .module-page,
body[data-page="dashboard"] .page-content > .client-dashboard,
body[data-page="dashboard"] .page-content > .admin-dashboard,
body[data-page="dashboard"] .page-content > .sa-reference-dashboard {
  min-height: auto;
  overflow: visible;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header {
  margin-left: -30px;
  margin-right: -30px;
}

/* Dashboard glass background system. */
body[data-page="dashboard"] {
  background: #f7fbff url("../media/dashboard-glass-bg.png") center center / cover no-repeat fixed;
}

body[data-page="dashboard"] .layout,
body[data-page="dashboard"] .content,
body[data-page="dashboard"] .page-content,
body[data-page="dashboard"] .sa-dashboard,
body[data-page="dashboard"] .sa-reference-dashboard,
body[data-page="dashboard"] .content:has(.sa-dashboard),
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) {
  background: transparent !important;
}

body[data-page="dashboard"] .topbar,
body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header {
  background: rgba(255, 255, 255, 0.46) !important;
  border-color: rgba(255, 255, 255, 0.54) !important;
  box-shadow: 0 18px 54px rgba(31, 64, 128, 0.08);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

body[data-page="dashboard"] .sa-ref-metric,
body[data-page="dashboard"] .sa-ref-panel,
body[data-page="dashboard"] .panel,
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .summary-card,
body[data-page="dashboard"] .workspace-hero,
body[data-page="dashboard"] .module-toolbar,
body[data-page="dashboard"] .table-shell {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 22px 60px rgba(31, 64, 128, 0.10);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

body[data-page="dashboard"] .sa-country-list button,
body[data-page="dashboard"] .sa-ref-action-grid button,
body[data-page="dashboard"] .sa-ref-select,
body[data-page="dashboard"] .user-menu-trigger,
body[data-page="dashboard"] .sa-ref-search,
body[data-page="dashboard"] .notification-btn,
body[data-page="dashboard"] .sa-ref-notification {
  background: rgba(255, 255, 255, 0.62) !important;
  border-color: rgba(255, 255, 255, 0.66) !important;
  box-shadow: 0 12px 28px rgba(31, 64, 128, 0.08);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

body[data-page="dashboard"] .sa-map-visual {
  background: rgba(255, 255, 255, 0.20) !important;
}

body[data-page="dashboard"] .sa-map-image {
  opacity: 0.62;
  filter: brightness(0) saturate(100%) invert(36%) sepia(99%) saturate(3135%) hue-rotate(222deg) brightness(101%) contrast(104%);
}

body[data-page="dashboard"] .sa-map-pin,
body[data-page="dashboard"] .sa-map-tooltip {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(16px) saturate(155%);
  -webkit-backdrop-filter: blur(16px) saturate(155%);
}

body[data-page="dashboard"] .sa-funnel-bars button {
  box-shadow: 0 14px 30px rgba(49, 92, 255, 0.18);
}

@media (max-width: 880px) {
  body[data-page="dashboard"] {
    overflow: auto;
  }

  body[data-page="dashboard"] .layout,
  body[data-page="dashboard"] .layout:has(.sidebar.collapsed),
  body[data-page="dashboard"] .layout:has(.sa-dashboard),
  body[data-page="dashboard"] .layout:has(.sa-dashboard):has(.sidebar.collapsed) {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-page="dashboard"] .content,
  body[data-page="dashboard"] .content:has(.sa-dashboard),
  body[data-page="dashboard"] .content:has(.sa-reference-dashboard) {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-page="dashboard"] .page-content {
    overflow: visible;
    padding: 0 18px 24px;
  }
}

/* Header/content gutter alignment and task action enhancement. */
body[data-page="dashboard"] .page-content {
  padding: 0 38px 32px;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header {
  margin-left: 0;
  margin-right: 0;
  padding: 28px 0;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-intro {
  padding: 0px 0 0;
  margin-bottom: 0;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metrics {
  padding: 0;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-widget-grid {
  padding: 0;
}

body[data-page="dashboard"] .user-menu-trigger {
  color: #fff !important;
  background: linear-gradient(135deg, #2457ff, #123bd8) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 18px 38px rgba(36, 87, 255, 0.24);
}

body[data-page="dashboard"] .user-menu-trigger .user-menu-avatar {
  color: #2457ff;
  background: #fff;
}

body[data-page="dashboard"] .user-menu-trigger .user-menu-copy strong,
body[data-page="dashboard"] .user-menu-trigger .user-menu-copy small,
body[data-page="dashboard"] .user-menu-trigger .user-menu-caret {
  color: #fff;
}

body[data-page="dashboard"] .sa-ref-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="dashboard"] .sa-ref-action-grid button {
  min-height: 74px;
  border-radius: 14px;
  padding: 10px 8px;
}

body[data-page="dashboard"] .sa-ref-action-grid .side-svg {
  width: 20px;
  height: 20px;
}

/* Dropdown, metric spacing and donut polish. */
.sa-reference-dashboard .sa-ref-metric p {
  margin-bottom: 0;
}

body[data-page="dashboard"] .user-menu {
  z-index: 1200;
}

body[data-page="dashboard"] .user-menu-dropdown {
  z-index: 1300;
  min-width: 220px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

body[data-page="dashboard"] .sa-ref-panel,
body[data-page="dashboard"] .sa-ref-panel-head,
body[data-page="dashboard"] .sa-ref-intro {
  position: relative;
}

body[data-page="dashboard"] .sa-ref-panel-head {
  z-index: 20;
}

body[data-page="dashboard"] .sa-ref-intro {
  z-index: 10;
}

body[data-page="dashboard"] .sa-ref-select,
body[data-page="dashboard"] select.sa-ref-select,
body[data-page="dashboard"] .form-select {
  height: 48px;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 48px 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-radius: 16px;
  color: #111827;
  background-color: rgba(255, 255, 255, 0.72) !important;
  background-image: none !important;
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  box-shadow: 0 12px 34px rgba(31, 64, 128, 0.10);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

body[data-page="dashboard"] .sa-ref-select:focus,
body[data-page="dashboard"] select.sa-ref-select:focus,
body[data-page="dashboard"] .form-select:focus {
  outline: none;
}

body[data-page="dashboard"] .sa-ref-select option,
body[data-page="dashboard"] .form-select option {
  color: #111827;
  background: #fff;
  font-weight: 500;
}

body[data-page="dashboard"] .sa-ref-revenue-combined {
  overflow: visible;
}

body[data-page="dashboard"] .sa-ref-donut.interactive {
  width: min(100%, 238px);
}

body[data-page="dashboard"] .sa-donut-track {
  stroke: rgba(255, 255, 255, 0.54);
  stroke-width: 27;
}

body[data-page="dashboard"] .sa-donut-segment {
  stroke-width: 29;
  stroke-linecap: round;
  filter: drop-shadow(0 10px 15px rgba(17, 24, 39, 0.08));
}

body[data-page="dashboard"] .sa-donut-segment:hover,
body[data-page="dashboard"] .sa-donut-segment.active {
  stroke-width: 34;
  filter: drop-shadow(0 12px 18px rgba(17, 24, 39, 0.18));
}

body[data-page="dashboard"] .sa-donut-percent {
  fill: #111827;
  font-size: 12px;
  font-weight: 500;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 6px;
}

body[data-page="dashboard"] .sa-donut-center {
  width: 98px;
  min-height: 70px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body[data-page="dashboard"] .sa-donut-center strong {
  font-size: 18px;
}

/* Requested dashboard compact spacing and icon fixes. */
body[data-page="dashboard"] .page-content {
  padding: 0 24px 15px;
}

.sa-reference-dashboard .sa-ref-metric p {
  margin-bottom: 0;
}

.sa-ref-service-list button {
  padding: 4px 8px;
  font-size: 13px;
}

.sa-ref-team-table {
  font-size: 13px;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header {
  padding: 18px 0;
}

body[data-page="dashboard"] .topbar,
body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.sa-ref-header {
  border-bottom: 0;
}

.sa-ref-search .ui-icon,
.sa-ref-notification .ui-icon,
.notification-btn .ui-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.sa-ref-search span {
  display: inline-grid;
  place-items: center;
  color: #111827;
}

.sa-ref-notification {
  display: inline-grid;
  place-items: center;
  color: #2457ff;
}

@media (max-width: 880px) {
  body[data-page="dashboard"] .page-content {
    padding: 0 18px 24px;
  }

  body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header {
    padding: 22px 0;
  }
}

/* Requested visual tuning overrides. */
body[data-page="dashboard"] .sa-donut-center {
  width: auto;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: blur(10px);
}

.layout:has(.sa-dashboard) .side-link.active .side-icon {
  color: #fff;
  background: transparent;
}

.sa-reference-dashboard .sa-ref-metric p {
  font-size: 14px;
  font-weight: 300;
  color: #252525;
}

.sa-data-status {
  display: block;
  margin-top: 4px;
  color: #7e7e7e;
  font-size: 14px;
}

/* Requested spacing and dropdown layering fixes. */
body[data-page="dashboard"] .page-content {
  padding: 0 32px 14px;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metrics {
  padding: 0;
}

body[data-page="dashboard"] .user-menu,
body[data-page="dashboard"] .sa-ref-actions {
  position: relative;
  z-index: 3000;
}

body[data-page="dashboard"] .user-menu-dropdown {
  z-index: 3100;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-widget-grid {
  position: relative;
  z-index: 1;
}

body[data-page="dashboard"] .sa-ref-panel {
  isolation: isolate;
}

body[data-page="dashboard"] .sa-ref-panel:focus-within,
body[data-page="dashboard"] .sa-ref-panel:hover {
  z-index: 80;
}

body[data-page="dashboard"] .sa-ref-panel-head {
  z-index: 120;
}

body[data-page="dashboard"] .sa-ref-select {
  position: relative;
  z-index: 140;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metric .sa-ref-metric-icon,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metric.purple .sa-ref-metric-icon,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metric.green .sa-ref-metric-icon,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metric.blue .sa-ref-metric-icon,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metric.gold .sa-ref-metric-icon,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metric.coral .sa-ref-metric-icon {
  background: #2457ff;
  color: #fff;
}

/* Application button and dropdown normalization. */
.btn {
  min-height: 36px;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
}

.btn.btn-sm,
.btn-sm {
  min-height: 32px;
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1.1;
}

.btn-app {
  border: 1px solid #1033ff !important;
  color: #fff !important;
  background: #1033ff !important;
  box-shadow: 0 10px 24px rgba(16, 51, 255, 0.22);
}

.btn-app:hover,
.btn-app:focus {
  color: #fff !important;
  background: #0b28d8 !important;
  border-color: #0b28d8 !important;
  box-shadow: 0 14px 30px rgba(16, 51, 255, 0.28);
}

.btn-outline-app {
  border: 1px solid #111827 !important;
  color: #fff !important;
  background: #111827 !important;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.btn-outline-app:hover,
.btn-outline-app:focus {
  color: #fff !important;
  background: #000 !important;
  border-color: #000 !important;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.22);
}

.btn-export-app,
.btn-download-app,
button[aria-label*="Export"],
a[download],
a[href$=".pdf"].btn,
a[href$=".xlsx"].btn,
a[href$=".csv"].btn {
  min-height: 36px;
  border: 1px solid #1033ff !important;
  border-radius: 12px;
  padding: 8px 14px;
  color: #1033ff !important;
  background: rgba(255,255,255,0.88) !important;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  box-shadow: none;
}

.btn-export-app:hover,
.btn-download-app:hover,
button[aria-label*="Export"]:hover,
a[download]:hover,
a[href$=".pdf"].btn:hover,
a[href$=".xlsx"].btn:hover,
a[href$=".csv"].btn:hover {
  color: #0b28d8 !important;
  border-color: #0b28d8 !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(16, 51, 255, 0.12);
}

.btn-export-app.tone-danger {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  background: rgba(255,255,255,0.88) !important;
}

.btn-export-app.tone-danger:hover {
  color: #fff !important;
  border-color: #dc2626 !important;
  background: #ef4444 !important;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.18);
}

.confirm-modal-danger .toolbar-actions .btn-app {
  border: 1px solid #ef4444 !important;
  background: #ef4444 !important;
}

.confirm-modal-danger .toolbar-actions .btn-app:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.form-select,
.sa-ref-select,
select.sa-ref-select,
body[data-page="dashboard"] .form-select,
body[data-page="dashboard"] .sa-ref-select,
body[data-page="dashboard"] select.sa-ref-select {
  min-height: 38px !important;
  height: 38px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  padding: 0 38px 0 14px !important;
  border-radius: 12px !important;
  color: #111827 !important;
  background-color: rgba(255,255,255,0.9) !important;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.5 7.5L10 12L14.5 7.5' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 13px center !important;
  background-size: 16px 16px !important;
  box-shadow: 0 8px 22px rgba(31, 64, 128, 0.08);
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

.form-select:hover,
.sa-ref-select:hover,
select.sa-ref-select:hover {
  border-color: rgba(16, 51, 255, 0.38) !important;
  box-shadow: 0 10px 24px rgba(16, 51, 255, 0.10);
}

.form-select:focus,
.sa-ref-select:focus,
select.sa-ref-select:focus,
body[data-page="dashboard"] .form-select:focus,
body[data-page="dashboard"] .sa-ref-select:focus,
body[data-page="dashboard"] select.sa-ref-select:focus {
  outline: none;
}

.sa-ref-panel-head .sa-ref-select,
.sa-reference-dashboard .sa-ref-select {
  min-width: 126px;
}

/* Sidebar header and collapse control. */
.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar,
body[data-page="dashboard"] .layout .sidebar,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar {
  overflow: visible !important;
}

.layout .sidebar-scroll,
.layout:has(.sa-dashboard) .sidebar-scroll,
body[data-page="dashboard"] .layout .sidebar-scroll,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.layout .brand-lockup,
.layout:has(.sa-dashboard) .brand-lockup,
body[data-page="dashboard"] .layout .brand-lockup,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .brand-lockup {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  min-height: 84px !important;
  padding: 16px 48px 20px 0 !important;
  overflow: visible !important;
}

.layout .sidebar.collapsed .brand-lockup,
.layout:has(.sa-dashboard) .sidebar.collapsed .brand-lockup,
body[data-page="dashboard"] .layout .sidebar.collapsed .brand-lockup,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar.collapsed .brand-lockup {
  min-height: 104px !important;
  justify-content: flex-start !important;
  padding: 16px 46px 24px 9px !important;
}

.brand-mark,
.sidebar.collapsed .brand-mark,
.layout .sidebar.collapsed .brand-mark,
.layout:has(.sa-dashboard) .sidebar.collapsed .brand-mark {
  min-width: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.layout .sidebar.collapsed .brand-mark,
.layout:has(.sa-dashboard) .sidebar.collapsed .brand-mark,
body[data-page="dashboard"] .layout .sidebar.collapsed .brand-mark,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar.collapsed .brand-mark {
  justify-content: flex-start !important;
}

.sidebar-collapse,
body[data-page="dashboard"] .sidebar-collapse,
.layout .sidebar.collapsed .sidebar-collapse,
.layout:has(.sa-dashboard) .sidebar.collapsed .sidebar-collapse,
body[data-page="dashboard"] .layout .sidebar.collapsed .sidebar-collapse,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar.collapsed .sidebar-collapse {
  position: absolute !important;
  top: 23px !important;
  right: -15px !important;
  z-index: 520 !important;
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  flex-basis: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid rgba(17,24,39,.12) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.16) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  transform: none !important;
}

.sidebar-collapse i,
body[data-page="dashboard"] .sidebar-collapse i {
  display: block !important;
  color: #111827 !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

.sidebar-collapse:hover,
body[data-page="dashboard"] .sidebar-collapse:hover {
  color: #000 !important;
  background: #fff !important;
  border-color: rgba(16,51,255,.34) !important;
  box-shadow: 0 10px 22px rgba(16,51,255,.22) !important;
}

/* App-wide custom dropdowns: replaces native select menus with the profile-menu style. */
.app-select {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: auto;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  overflow: visible;
}

.app-select.open {
  z-index: 4200;
}

.app-select.form-select,
.app-select.sa-ref-select {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] .app-select,
body[data-page="dashboard"] .app-select.form-select,
body[data-page="dashboard"] .app-select.sa-ref-select,
.sa-reference-dashboard .app-select.sa-ref-select,
.module-toolbar .app-select.form-select,
.toolbar-actions .app-select.form-select {
  height: auto !important;
  min-height: 0 !important;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 14px !important;
  outline: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.app-select-trigger {
  width: 100%;
  min-width: 126px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px 0 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 12px;
  color: #111827;
  background: rgba(255,255,255,.92) !important;
  background-clip: padding-box;
  box-shadow: 0 8px 22px rgba(31,64,128,.08);
  font: inherit;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.app-select-trigger i {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: center / 16px 16px no-repeat url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.5 7.5L10 12L14.5 7.5' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform .18s ease;
}

.app-select.open .app-select-trigger i {
  transform: rotate(180deg);
}

.app-select-trigger:hover,
.app-select.open .app-select-trigger {
  border-color: rgba(16,51,255,.38);
  box-shadow: 0 10px 24px rgba(16,51,255,.1);
}

.app-select-trigger.is-invalid {
  border-color: #dc3545;
}

.app-select-trigger:focus-visible {
  outline: none;
}

.app-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 4300;
  width: max(100%, 190px);
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(17,24,39,.22);
}

.app-select-menu button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  color: #111827;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}

.app-select-menu button:hover,
.app-select-menu button[aria-selected="true"] {
  color: #1033ff;
  background: rgba(16,51,255,.08);
}

.app-select-menu button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

/* Body-level floating overlays. Menus are portaled to avoid clipping by cards,
   table wrappers, scroll containers, and transformed parents. z-index sits
   just above .modal-surface (100000) -- both are document.body portals, so
   an overlay opened from a field inside an open modal (e.g. Record Payment's
   Payment Method select) is a sibling layer, not a descendant, and needs a
   higher z-index to paint on top of the modal instead of behind it. */
.overlay-portal {
  position: fixed !important;
  z-index: 100001 !important;
  overflow-x: hidden;
}

.app-select-menu.overlay-portal {
  right: auto !important;
  width: auto;
}

.action-menu.overlay-portal {
  display: grid !important;
  right: auto !important;
}

.table-filter-popover.overlay-portal,
.date-range-popover.overlay-portal,
.user-menu-dropdown.overlay-portal {
  right: auto !important;
}

.table-filter-popover.overlay-portal,
.date-range-popover.overlay-portal,
.app-select-menu.overlay-portal {
  overflow-y: auto;
}

body[data-page="dashboard"] .sa-ref-panel-head,
body[data-page="dashboard"] .sa-ref-intro,
body[data-page="dashboard"] .module-toolbar,
body[data-page="dashboard"] .toolbar-actions,
.task-modal-panel {
  overflow: visible;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-quick-actions {
  grid-column: span 4 !important;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-team-performance {
  grid-column: span 5 !important;
}

body[data-page="dashboard"] .priority-task-list {
  padding-right: 0 !important;
  margin-right: 0 !important;
  scrollbar-gutter: stable;
}

body[data-page="dashboard"] .priority-task-item {
  margin-right: 12px;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-quick-actions,
  body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-team-performance {
    grid-column: span 12 !important;
  }
}

/* Unified Vedrix application design system layer. */
:root {
  --vdx-primary: #1033ff;
  --vdx-primary-2: #2457ff;
  --vdx-ink: #111827;
  --vdx-muted: #667085;
  --vdx-line: rgba(255,255,255,.58);
  --vdx-line-strong: rgba(16,51,255,.16);
  --vdx-card: linear-gradient(135deg, rgba(255,255,255,.62), rgba(255,255,255,.34));
  --vdx-card-solid: rgba(255,255,255,.9);
  --vdx-shadow: 0 24px 70px rgba(31,64,128,.1);
  --vdx-shadow-soft: 0 14px 36px rgba(31,64,128,.07);
  --vdx-radius: 18px;
  --vdx-radius-sm: 14px;
  --vdx-gap: 20px;
}

body[data-page="dashboard"],
body[data-page="login"],
body[data-page="forgot-password"],
body[data-page="forgot-password-verify"],
body[data-page="reset-password"],
body[data-page="otp"] {
  color: var(--vdx-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body[data-page="dashboard"] h1,
body[data-page="dashboard"] h2,
body[data-page="dashboard"] h3,
body[data-page="dashboard"] h4,
body[data-page="dashboard"] h5,
body[data-page="login"] h1,
body[data-page="login"] h2,
body[data-page="forgot-password"] h1,
body[data-page="forgot-password"] h2,
body[data-page="forgot-password-verify"] h1,
body[data-page="forgot-password-verify"] h2,
body[data-page="reset-password"] h1,
body[data-page="reset-password"] h2,
body[data-page="otp"] h1,
body[data-page="otp"] h2 {
  color: var(--vdx-ink);
  letter-spacing: 0;
  line-height: 1.08;
}

body[data-page="dashboard"] h1 {
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 760;
}

body[data-page="dashboard"] h2 {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 720;
}

body[data-page="dashboard"] h3,
body[data-page="dashboard"] .h5 {
  font-size: clamp(17px, 1.25vw, 20px);
  font-weight: 700;
}

body[data-page="dashboard"] p,
body[data-page="dashboard"] small,
body[data-page="dashboard"] .muted,
body[data-page="dashboard"] .metric-note,
body[data-page="dashboard"] .toolbar-title span,
body[data-page="dashboard"] .crm-breadcrumb {
  color: var(--vdx-muted) !important;
}

body[data-page="dashboard"] .module-page,
body[data-page="dashboard"] .client-dashboard,
body[data-page="dashboard"] .admin-dashboard {
  display: grid;
  gap: var(--vdx-gap);
  max-width: 100%;
  animation: appCardIn .28s var(--app-ease);
}

body[data-page="dashboard"] .page-header,
body[data-page="dashboard"] .workspace-hero,
body[data-page="dashboard"] .client-onboarding,
body[data-page="dashboard"] .document-workspace,
body[data-page="dashboard"] .panel,
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .summary-card,
body[data-page="dashboard"] .data-table-card,
body[data-page="dashboard"] .module-toolbar,
body[data-page="dashboard"] .empty-module,
body[data-page="dashboard"] .loading-panel,
body[data-page="dashboard"] .error-state,
body[data-page="dashboard"] .modal-panel,
body[data-page="dashboard"] .task-modal-panel {
  border: 1px solid rgba(15,23,42,0.08) !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 60px rgba(15,23,42,.24) !important;
}

body[data-page="dashboard"] .page-header,
body[data-page="dashboard"] .workspace-hero,
body[data-page="dashboard"] .client-onboarding {
  align-items: center;
  padding: 24px 28px !important;
}

body[data-page="dashboard"] .panel,
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .summary-card,
body[data-page="dashboard"] .empty-module,
body[data-page="dashboard"] .loading-panel,
body[data-page="dashboard"] .error-state {
  padding: 22px !important;
}

body[data-page="dashboard"] .panel:hover:not(:has(table)),
body[data-page="dashboard"] .dashboard-card:hover:not(:has(table)),
body[data-page="dashboard"] .summary-card:hover:not(:has(table)) {
  border-color: rgba(16,51,255,.2) !important;
  box-shadow: var(--vdx-shadow) !important;
  transform: translateY(-1px);
}

/* .data-table-card is always a table wrapper -- it must never lift/shadow on
   hover, since hovering any row inside it also matches :hover on this
   ancestor (see :not(:has(table)) note above for the other selectors). */
body[data-page="dashboard"] .data-table-card:hover {
  border-color: inherit !important;
  box-shadow: inherit !important;
  transform: none !important;
}

body[data-page="dashboard"] .summary-grid,
body[data-page="dashboard"] .crm-stat-grid,
body[data-page="dashboard"] .document-grid,
body[data-page="dashboard"] .workspace-meta {
  gap: 16px !important;
}

body[data-page="dashboard"] .summary-card {
  min-height: 120px;
}

body[data-page="dashboard"] .summary-card strong,
body[data-page="dashboard"] .metric .value,
body[data-page="dashboard"] .stat-card .value {
  color: var(--vdx-ink);
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 760;
  letter-spacing: 0;
}

body[data-page="dashboard"] .summary-icon,
body[data-page="dashboard"] .metric-icon,
body[data-page="dashboard"] .stat-icon {
  color: #fff !important;
  background: var(--vdx-primary) !important;
  box-shadow: 0 14px 30px rgba(16,51,255,.22) !important;
}

body[data-page="dashboard"] .module-toolbar {
  align-items: center;
  gap: 16px !important;
  padding: 14px !important;
}

body[data-page="dashboard"] .toolbar-actions {
  align-items: center;
  gap: 10px !important;
}

body[data-page="dashboard"] .search-box,
body[data-page="dashboard"] .sa-ref-search {
  border-radius: 16px !important;
  background: rgba(255,255,255,.76) !important;
  box-shadow: 0 10px 30px rgba(31,64,128,.06) !important;
}

body[data-page="dashboard"] .form-control,
body[data-page="dashboard"] textarea {
  min-height: 40px !important;
  border: 1px solid rgba(17,24,39,.1) !important;
  border-radius: 14px !important;
  color: var(--vdx-ink) !important;
  background: rgba(255,255,255,.84) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500;
}

body[data-page="dashboard"] .form-control:focus,
body[data-page="dashboard"] textarea:focus,
body[data-page="dashboard"] .app-select-trigger:focus-visible,
body[data-page="login"] .form-control:focus,
body[data-page="forgot-password"] .form-control:focus,
body[data-page="forgot-password-verify"] .form-control:focus,
body[data-page="reset-password"] .form-control:focus,
body[data-page="otp"] .form-control:focus {
  outline: none;
}

body[data-page="dashboard"] .app-select-trigger {
  min-height: 40px;
  border-radius: 14px;
  background: rgba(255,255,255,.88) !important;
}

body[data-page="dashboard"] .app-select-menu {
  border-radius: 18px;
  border-color: rgba(255,255,255,.72);
}

body[data-page="dashboard"] .btn {
  min-height: 36px;
  border-radius: 7px !important;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  transition: transform .18s var(--app-ease), box-shadow .18s var(--app-ease), background .18s var(--app-ease), border-color .18s var(--app-ease);
}

body[data-page="dashboard"] .btn:hover {
  transform: translateY(-1px);
}

body[data-page="dashboard"] .btn-app {
  border: 1px solid var(--vdx-primary) !important;
  color: #fff !important;
  background: var(--vdx-primary) !important;
  box-shadow: 0 14px 28px rgba(16,51,255,.22) !important;
}

body[data-page="dashboard"] .btn-outline-app {
  border: 1px solid #111827 !important;
  color: #fff !important;
  background: #111827 !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] .btn-export-app,
body[data-page="dashboard"] .btn-download-app {
  border: 1px solid var(--vdx-primary) !important;
  color: var(--vdx-primary) !important;
  background: rgba(255,255,255,.9) !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] .btn-export-app.tone-danger {
  border: 1px solid #ef4444 !important;
  color: #ef4444 !important;
  background: rgba(255,255,255,.9) !important;
}

body[data-page="dashboard"] .btn-export-app.tone-danger:hover {
  border: 1px solid #dc2626 !important;
  color: #fff !important;
  background: #ef4444 !important;
}

body[data-page="dashboard"] .data-table-card {
  overflow: hidden;
  padding: 0 !important;
}

body[data-page="dashboard"] .premium-table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

body[data-page="dashboard"] .premium-table thead th {
  border-bottom: 1px solid rgba(17,24,39,.08) !important;
  color: #5b6475 !important;
  background: rgba(255,255,255,.6) !important;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body[data-page="dashboard"] .premium-table tbody td {
  border-bottom: 1px solid rgba(17,24,39,.07) !important;
  color: #283246;
  font-size: 13px;
  vertical-align: middle;
}

body[data-page="dashboard"] .premium-table tbody tr {
  transition: background .16s var(--app-ease), transform .16s var(--app-ease);
}

body[data-page="dashboard"] .premium-table tbody tr:hover {
  background: rgba(255,255,255,.5) !important;
}

body[data-page="dashboard"] .assigned-task-row {
  cursor: pointer;
}

body[data-page="dashboard"] .assigned-task-row:hover {
  background: rgba(36, 87, 255, .06) !important;
}

body[data-page="dashboard"] .assigned-task-row:focus-visible {
  outline: 2px solid var(--vdx-primary, #2457ff);
  outline-offset: -2px;
}

body[data-page="dashboard"] .status-badge,
body[data-page="dashboard"] .pill,
body[data-page="dashboard"] .role-badge {
  min-height: 24px;
  border-radius: 999px !important;
  border: 1px solid rgba(16,51,255,.14);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

body[data-page="dashboard"] .pill {
  font-weight: 500;
}

body[data-page="dashboard"] .status-badge.green,
body[data-page="dashboard"] .pill.green {
  color: #047857;
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.18);
}

body[data-page="dashboard"] .status-badge.gold,
body[data-page="dashboard"] .pill.gold {
  color: #b45309;
  background: rgba(245,158,11,.14);
  border-color: rgba(245,158,11,.22);
}

body[data-page="dashboard"] .status-badge.red,
body[data-page="dashboard"] .pill.red {
  color: #dc2626;
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.18);
}

body[data-page="dashboard"] .status-badge.blue,
body[data-page="dashboard"] .pill.blue {
  color: #2457f5;
  background: rgba(36,87,245,.1);
  border-color: rgba(36,87,245,.16);
}

body[data-page="dashboard"] .status-badge.draft,
body[data-page="dashboard"] .pill:not(.green):not(.gold):not(.red) {
  color: var(--vdx-primary);
  background: rgba(16,51,255,.08);
  border-color: rgba(16,51,255,.14);
}

body[data-page="dashboard"] .empty-state,
body[data-page="dashboard"] .empty-module,
body[data-page="dashboard"] .loading-state,
body[data-page="dashboard"] .error-state {
  color: var(--vdx-muted);
  text-align: center;
}

body[data-page="dashboard"] .modal-surface {
  background: rgba(10,18,35,0.48) !important;
}

body[data-page="dashboard"] .modal-panel,
body[data-page="dashboard"] .task-modal-panel {
  color: var(--vdx-ink);
}

body[data-page="dashboard"] .pagination-row {
  padding: 14px 16px;
  color: var(--vdx-muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  body[data-page="dashboard"] .page-header,
  body[data-page="dashboard"] .workspace-hero,
  body[data-page="dashboard"] .module-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="dashboard"] .toolbar-actions,
  body[data-page="dashboard"] .search-box,
  body[data-page="dashboard"] .toolbar-actions .btn,
  body[data-page="dashboard"] .toolbar-actions .app-select {
    width: 100% !important;
  }
}

/* Super Admin internal page structure normalization. */
body[data-page="dashboard"] .topbar h1 {
  max-width: 560px;
  font-size: clamp(28px, 2.25vw, 32px) !important;
  font-weight: 760 !important;
  line-height: 1.05 !important;
}

body[data-page="dashboard"] .topbar .data-status,
body[data-page="dashboard"] .topbar p {
  max-width: 920px;
  font-size: 15px !important;
  line-height: 1.45;
}

body[data-page="dashboard"] .page-content > .module-page {
  gap: 18px !important;
  padding-top: 0;
}

body[data-page="dashboard"] .page-content > .module-page .summary-grid {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 16px !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card {
  min-height: 106px !important;
  align-items: center;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 13px;
  padding: 18px !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 14px !important;
  font-size: 14px;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card span {
  color: #5f6b7f !important;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card strong {
  margin-top: 5px;
  font-size: clamp(23px, 1.9vw, 28px) !important;
  font-weight: 720 !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card small {
  margin-top: 6px;
  color: #6b7280 !important;
  font-size: 12px;
  font-weight: 500;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card .mini-line {
  display: none;
}

body[data-page="dashboard"] .page-content > .module-page .module-toolbar {
  border-radius: 18px !important;
  padding: 14px 16px !important;
}

body[data-page="dashboard"] .page-content > .module-page .toolbar-title h3 {
  margin: 0;
  font-size: 18px !important;
}

body[data-page="dashboard"] .page-content > .module-page .toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body[data-page="dashboard"] .page-content > .module-page .toolbar-actions .search-box,
body[data-page="dashboard"] .page-content > .module-page .toolbar-actions .form-control {
  min-width: min(280px, 100%);
}

body[data-page="dashboard"] .page-content > .module-page .data-table-card {
  border-radius: 18px !important;
}

body[data-page="dashboard"] .page-content > .module-page .premium-table th,
body[data-page="dashboard"] .page-content > .module-page .premium-table td {
  padding: 13px 14px;
}

@media (max-width: 1320px) {
  body[data-page="dashboard"] .page-content > .module-page .summary-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  body[data-page="dashboard"] .page-content > .module-page .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body[data-page="dashboard"] .page-content > .module-page .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard shell header restoration. */
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar {
  display: flex !important;
}

body[data-page="dashboard"] .topbar.route-dashboard {
  position: relative;
  z-index: 6000;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 !important;
  padding: 24px 38px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-page="dashboard"] .topbar.route-dashboard > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

body[data-page="dashboard"] .topbar.route-dashboard .role-badge,
body[data-page="dashboard"] .topbar.route-dashboard p,
body[data-page="dashboard"] .topbar.route-dashboard .btn-app {
  display: none !important;
}

body[data-page="dashboard"] .topbar.route-dashboard h1 {
  margin: 0 !important;
  color: #030712;
  font-size: clamp(24px, 2vw, 36px) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

body[data-page="dashboard"] .topbar.route-dashboard .header-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

body[data-page="dashboard"] .topbar.route-dashboard .sa-ref-search {
  min-height: 50px;
  width: clamp(320px, 32vw, 560px);
  max-width: 100%;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu-trigger {
  min-width: 198px;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu {
  position: relative;
  z-index: 6200;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu.open {
  z-index: 7000;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu-dropdown {
  z-index: 7100;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu-trigger:focus,
body[data-page="dashboard"] .topbar.route-dashboard .user-menu-trigger:focus-visible {
  outline: 0 !important;
  box-shadow:
    0 18px 38px rgba(36, 87, 255, 0.24),
    inset 0 0 0 2px rgba(255, 255, 255, 0.34) !important;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu-copy small {
  color: #ffffff !important;
  opacity: 0.9;
}

body[data-page="dashboard"] .topbar.route-dashboard .user-menu-caret {
  color: #ffffff !important;
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 980px) {
  body[data-page="dashboard"] .topbar.route-dashboard {
    flex-wrap: wrap;
    padding: 20px 22px !important;
  }

  body[data-page="dashboard"] .topbar.route-dashboard .header-actions,
  body[data-page="dashboard"] .topbar.route-dashboard .sa-ref-search {
    width: 100%;
  }

  body[data-page="dashboard"] .topbar.route-dashboard .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Unified internal application header. Dashboard header is the master template. */
body[data-page="dashboard"] .content > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
  position: relative;
  z-index: 6000;
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin: 0 !important;
  padding: 24px 38px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-page="dashboard"] .app-header-title {
  min-width: 0;
}

body[data-page="dashboard"] .topbar.app-header h1 {
  margin: 0 !important;
  color: #030712;
  font-size: clamp(24px, 2vw, 36px) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

body[data-page="dashboard"] .topbar.app-header .app-header-search {
  justify-self: stretch;
  width: 100%;
  min-height: 50px;
  max-width: 560px;
}

body[data-page="dashboard"] .topbar.app-header .header-actions {
  position: relative;
  z-index: 6200;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

body[data-page="dashboard"] .topbar.app-header .user-menu.open {
  z-index: 7000;
}

body[data-page="dashboard"] .topbar.app-header .user-menu-dropdown {
  z-index: 7100;
}

body[data-page="dashboard"] .topbar.app-header .user-menu-trigger {
  min-width: 198px;
}

body[data-page="dashboard"] .topbar.app-header .user-menu-trigger:focus,
body[data-page="dashboard"] .topbar.app-header .user-menu-trigger:focus-visible {
  outline: 0 !important;
  box-shadow:
    0 18px 38px rgba(36, 87, 255, 0.24),
    inset 0 0 0 2px rgba(255, 255, 255, 0.34) !important;
}

body[data-page="dashboard"] .topbar.app-header .user-menu-copy small,
body[data-page="dashboard"] .topbar.app-header .user-menu-caret {
  color: #ffffff !important;
}

body[data-page="dashboard"] .page-header,
body[data-page="dashboard"] .crm-breadcrumb,
body[data-page="dashboard"] .workspace-hero {
  display: none !important;
}

/* Team Management module */
.team-toolbar {
  align-items: center;
}

.team-toolbar > .search-box {
  flex: 1 1 420px;
  max-width: 560px;
}

.team-toolbar > .toolbar-actions {
  flex: 0 1 auto;
}

.team-member-cell,
.team-profile-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-member-cell strong,
.team-profile-heading h3 {
  display: block;
  margin: 0;
  color: #111827;
}

.team-member-cell small,
.team-profile-heading span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.team-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2457ff, #123bd8);
  font-size: 12px;
  font-weight: 800;
}

.team-avatar.lg {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  font-size: 15px;
}

.team-detail-grid,
.team-form-grid,
.permission-matrix {
  display: grid;
  gap: 16px;
}

.team-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-notes,
.team-toggle {
  grid-column: 1 / -1;
}

.team-info-card {
  min-height: 96px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.team-info-card span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 650;
}

.team-info-card strong {
  color: #111827;
  font-size: 15px;
  font-weight: 500;
}

.permission-matrix {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.permission-group {
  padding: 16px !important;
}

.permission-list {
  display: grid;
  gap: 6px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
  color: #111827;
}

.permission-item input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: #2457ff;
}

.permission-item span {
  min-width: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.permission-item-parent {
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid rgba(36,87,255,.18);
  border-radius: 10px;
  background: rgba(36,87,255,.05);
}

.permission-select-all {
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
  padding: 4px 10px;
  border: 1px solid rgba(36,87,255,.3);
  border-radius: 999px;
  background: #fff;
  color: #2457ff;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.permission-select-all:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.permission-list-locked {
  opacity: .5;
}

.permission-list-locked .permission-item {
  cursor: not-allowed;
}

/* Shared permission-aware action control (PermissionAction/ExportButton):
   the control stays in place and keeps its normal layout, just dimmed and
   non-interactive, rather than being hidden -- per the "disabled actions
   must remain visible" requirement. */
.permission-action-disabled {
  opacity: .45;
  cursor: not-allowed !important;
  pointer-events: auto;
}

.permission-action-disabled:hover {
  opacity: .45;
}

.team-activity-line {
  margin: 0 0 10px;
  color: #344054;
  font-size: 14px;
}

.team-action-dropdown .action-menu {
  z-index: 5000;
}

/* Client Management module */
.client-toolbar {
  align-items: center;
}

.client-toolbar > .search-box {
  flex: 1 1 420px;
  max-width: 560px;
}

.client-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
}

.client-summary h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 720;
}

.client-summary p {
  margin: 6px 0 12px;
  color: #6b7280;
}

.client-avatar {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, #2457ff, #123bd8);
  font-size: 18px;
  font-weight: 850;
  box-shadow: 0 18px 38px rgba(36, 87, 255, 0.22);
}

.client-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.client-chip-row,
.client-section-grid,
.client-info-grid,
.client-form-grid {
  display: grid;
  gap: 16px;
}

.client-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-interest-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .service-interest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .service-interest-grid {
    grid-template-columns: 1fr;
  }
}

.form-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--app-line-strong);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 650;
  color: var(--app-text);
  cursor: pointer;
}

.form-check-chip input {
  accent-color: var(--app-blue);
}

.client-info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-info-grid span,
.workspace-meta span,
.document-grid span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 650;
}

.client-info-grid strong,
.workspace-meta strong,
.document-grid strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

.client-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-service-card,
.client-document-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.client-document-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.client-document-card .toolbar-actions {
  grid-column: 1 / -1;
}

.client-drive-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Overrides the row layout above -- the redesigned widget (header, read-only
   link field + copy icon, actions) stacks vertically instead of a single
   left/right row. */
body[data-page="dashboard"] .client-drive-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

body[data-page="dashboard"] .client-drive-card .panel-head {
  margin-bottom: 16px;
}

body[data-page="dashboard"] .drive-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

body[data-page="dashboard"] .drive-link-input {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

body[data-page="dashboard"] .drive-link-input:read-only {
  background: #f8fafc;
  cursor: default;
}

body[data-page="dashboard"] .drive-card-actions {
  margin-top: 16px;
}

.client-timeline {
  display: grid;
  gap: 12px;
}

.client-timeline-item,
.communication-row,
.note-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.client-timeline-item > span {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: #2457ff;
  box-shadow: 0 0 0 5px rgba(36, 87, 255, 0.12);
}

.client-timeline-item strong,
.communication-row strong,
.note-row strong {
  color: #111827;
  font-size: 14px;
}

.client-timeline-item p,
.communication-row p,
.note-row p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.notes-panel,
.notes-form {
  display: grid;
  gap: 14px;
}

.notes-form > button {
  justify-self: start;
  width: auto;
  max-width: 200px;
}

.note-row {
  grid-template-columns: 1fr auto;
}

.note-row small {
  display: block;
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
}

.floating-contact-panel {
  position: sticky;
  right: 24px;
  bottom: 22px;
  z-index: 120;
  width: fit-content;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 45px rgba(31, 64, 128, 0.16);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.floating-contact-panel strong {
  padding: 0 8px;
  color: #111827;
  font-size: 13px;
}

.client-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-wide {
  grid-column: 1 / -1;
}

.client-action-dropdown .action-menu {
  z-index: 5000;
}

@media (max-width: 1180px) {
  .team-detail-grid,
  .permission-matrix,
  .client-info-grid,
  .client-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .team-toolbar,
  .client-toolbar,
  .client-drive-card,
  .floating-contact-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .team-toolbar > .search-box,
  .team-toolbar > .toolbar-actions,
  .team-toolbar .btn,
  .team-toolbar .app-select,
  .client-toolbar > .search-box,
  .client-toolbar > .toolbar-actions,
  .client-toolbar .btn,
  .client-toolbar .app-select {
    width: 100% !important;
    max-width: none;
  }

  .team-detail-grid,
  .team-form-grid,
  .permission-matrix,
  .client-info-grid,
  .client-form-grid,
  .client-summary {
    grid-template-columns: 1fr;
  }

  .floating-contact-panel {
    width: 100%;
  }
}

@media (max-width: 980px) {
  body[data-page="dashboard"] .content > .topbar.app-header,
  body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
  body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
    grid-template-columns: 1fr;
    padding: 20px 22px !important;
  }

  body[data-page="dashboard"] .topbar.app-header .app-header-search,
  body[data-page="dashboard"] .topbar.app-header .header-actions {
    width: 100%;
    max-width: none;
  }

  body[data-page="dashboard"] .topbar.app-header .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Global CRM layout consistency layer. Dashboard remains the master reference. */
body[data-page="dashboard"] {
  --crm-page-x: 38px;
  --crm-page-bottom: 32px;
  --crm-section-gap: 20px;
  --crm-card-gap: 16px;
  --crm-card-pad: 18px;
  --crm-stat-label-size: 14px;
  --crm-stat-value-size: 24px;
  --crm-stat-note-size: 13px;
  --crm-stat-label-weight: 600;
  --crm-stat-value-weight: 500;
  --crm-stat-note-weight: 400;
}

body[data-page="dashboard"] .content {
  min-width: 0;
  padding: 0 !important;
}

body[data-page="dashboard"] .content > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
  padding: 24px var(--crm-page-x) !important;
}

body[data-page="dashboard"] .page-content {
  padding: 0 var(--crm-page-x) var(--crm-page-bottom) !important;
}

body[data-page="dashboard"] .page-content > .module-page,
body[data-page="dashboard"] .page-content > .sa-dashboard,
body[data-page="dashboard"] .page-content > .sa-reference-dashboard,
body[data-page="dashboard"] .page-content > .client-dashboard,
body[data-page="dashboard"] .page-content > .admin-dashboard {
  width: 100%;
  max-width: none;
  margin: 0 !important;
}

body[data-page="dashboard"] .module-page,
body[data-page="dashboard"] .team-detail-page,
body[data-page="dashboard"] .team-form-page,
body[data-page="dashboard"] .client-management-page,
body[data-page="dashboard"] .client-profile-page,
body[data-page="dashboard"] .client-form-page,
body[data-page="dashboard"] .task-management-page,
body[data-page="dashboard"] .sa-reference-dashboard {
  gap: var(--crm-section-gap) !important;
}

body[data-page="dashboard"] .summary-grid,
body[data-page="dashboard"] .crm-stat-grid,
body[data-page="dashboard"] .sa-ref-metrics,
body[data-page="dashboard"] .client-summary,
body[data-page="dashboard"] .team-form-grid,
body[data-page="dashboard"] .client-form-grid,
body[data-page="dashboard"] .permission-matrix,
body[data-page="dashboard"] .task-stats-grid {
  gap: var(--crm-card-gap) !important;
}

body[data-page="dashboard"] .module-toolbar,
body[data-page="dashboard"] .data-table-card,
body[data-page="dashboard"] .crm-table-card,
body[data-page="dashboard"] .panel,
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .empty-module,
body[data-page="dashboard"] .loading-panel,
body[data-page="dashboard"] .error-state {
  margin: 0 !important;
}

body[data-page="dashboard"] .summary-card,
body[data-page="dashboard"] .crm-stat-card,
body[data-page="dashboard"] .stat-card,
body[data-page="dashboard"] .sa-ref-metric {
  min-height: 100px;
  padding: var(--crm-card-pad) !important;
}

body[data-page="dashboard"] .summary-card span,
body[data-page="dashboard"] .crm-stat-card .metric-label,
body[data-page="dashboard"] .stat-card .metric-label,
body[data-page="dashboard"] .metric .metric-label,
body[data-page="dashboard"] .sa-ref-metric p {
  margin: 0 !important;
  color: #252525 !important;
  font-size: var(--crm-stat-label-size) !important;
  font-weight: var(--crm-stat-label-weight) !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body[data-page="dashboard"] .summary-card strong,
body[data-page="dashboard"] .crm-stat-card .metric-value,
body[data-page="dashboard"] .stat-card .value,
body[data-page="dashboard"] .metric .value,
body[data-page="dashboard"] .sa-ref-metric strong,
body[data-page="dashboard"] .sa-ref-metric-main strong {
  margin-top: 6px !important;
  color: #111827 !important;
  font-size: var(--crm-stat-value-size) !important;
  font-weight: var(--crm-stat-value-weight) !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

body[data-page="dashboard"] .summary-card small,
body[data-page="dashboard"] .crm-stat-card .metric-note,
body[data-page="dashboard"] .stat-card .metric-note,
body[data-page="dashboard"] .metric small,
body[data-page="dashboard"] .sa-ref-metric small,
body[data-page="dashboard"] .sa-data-status {
  color: #667085 !important;
  font-size: var(--crm-stat-note-size) !important;
  font-weight: var(--crm-stat-note-weight) !important;
  line-height: 1.35 !important;
}

body[data-page="dashboard"] .summary-card .mini-line,
body[data-page="dashboard"] .summary-card .mini-bars,
body[data-page="dashboard"] .sa-ref-metric .mini-line,
body[data-page="dashboard"] .sa-ref-metric .mini-bars {
  display: none !important;
}

body[data-page="dashboard"] .premium-table,
body[data-page="dashboard"] .crm-table,
body[data-page="dashboard"] .team-table,
body[data-page="dashboard"] .client-table,
body[data-page="dashboard"] .task-table {
  width: 100%;
  font-size: 13px;
}

body[data-page="dashboard"] .premium-table th,
body[data-page="dashboard"] .premium-table td,
body[data-page="dashboard"] .crm-table th,
body[data-page="dashboard"] .crm-table td {
  vertical-align: middle;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] {
    --crm-page-x: 28px;
    --crm-page-bottom: 28px;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] {
    --crm-page-x: 18px;
    --crm-page-bottom: 22px;
    --crm-section-gap: 16px;
    --crm-card-gap: 14px;
  }

  body[data-page="dashboard"] .content > .topbar.app-header,
  body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
  body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
    padding: 20px var(--crm-page-x) !important;
  }
}

/* Service Management module */
body[data-page="dashboard"] .service-toolbar .toolbar-actions {
  flex: 1 1 auto;
}

body[data-page="dashboard"] .service-toolbar .search-box {
  flex: 1 1 300px;
  min-width: min(320px, 100%);
}

body[data-page="dashboard"] .service-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--crm-card-gap, 16px);
}

/* Super Admin/Admin Service Catalog only -- the Client Portal's Browse
   Services catalog reuses the bare .service-card-grid/.service-catalog-card
   classes and must keep its existing column behavior untouched. */
body[data-page="dashboard"] .service-management-page .service-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1200px) {
  body[data-page="dashboard"] .service-management-page .service-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body[data-page="dashboard"] .service-management-page .service-card-grid {
    grid-template-columns: 1fr;
  }
}

body[data-page="dashboard"] .service-catalog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 14px;
  min-height: 272px;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--vdx-line);
  border-radius: var(--vdx-radius);
  color: var(--vdx-ink);
  background: var(--vdx-card);
  box-shadow: var(--vdx-shadow-soft);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: transform .18s var(--app-ease), box-shadow .18s var(--app-ease), border-color .18s var(--app-ease);
}

body[data-page="dashboard"] .service-catalog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 51, 255, .22);
  box-shadow: var(--vdx-shadow);
}

body[data-page="dashboard"] .service-card-head,
body[data-page="dashboard"] .service-detail-header,
body[data-page="dashboard"] .service-total-row,
body[data-page="dashboard"] .service-checklist-item,
body[data-page="dashboard"] .service-document-list .client-document-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

body[data-page="dashboard"] .service-card-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-page="dashboard"] .service-catalog-card-inactive {
  opacity: 0.75;
}

body[data-page="dashboard"] .service-catalog-card-inactive .status-badge {
  color: #c93737;
  background: #fdecec;
  border-color: #f6caca;
}

body[data-page="dashboard"] .service-catalog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 15px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .09);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0;
}

body[data-page="dashboard"] .client-portal .service-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  body[data-page="dashboard"] .client-portal .service-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  body[data-page="dashboard"] .client-portal .service-card-grid { grid-template-columns: 1fr; }
}

body[data-page="dashboard"] .service-catalog-card h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 17px;
  font-weight: 680;
}

body[data-page="dashboard"] .service-catalog-card p {
  margin: 0;
  min-height: 58px;
  color: #667085 !important;
  font-size: 13px;
  line-height: 1.45;
}

body[data-page="dashboard"] .service-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  color: #667085;
  font-size: 12px;
}

body[data-page="dashboard"] .service-card-meta strong {
  color: #111827;
  font-size: 13px;
  font-weight: 500;
}

body[data-page="dashboard"] .service-catalog-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

body[data-page="dashboard"] .service-checklist-badge {
  background: #f2f4f7;
  color: #344054;
  border-color: rgba(17, 24, 39, .08);
}

body[data-page="dashboard"] .service-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--crm-card-gap, 16px);
}

body[data-page="dashboard"] .service-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  gap: var(--crm-card-gap, 16px);
  align-items: start;
}

body[data-page="dashboard"] .service-workspace-grid > div {
  display: grid;
  gap: var(--crm-card-gap, 16px);
}

body[data-page="dashboard"] .service-main-column,
body[data-page="dashboard"] .service-side-column {
  min-width: 0;
}

body[data-page="dashboard"] .service-progress-card,
body[data-page="dashboard"] .service-pricing-card,
body[data-page="dashboard"] .service-checklist-card,
body[data-page="dashboard"] .service-documents-card,
body[data-page="dashboard"] .service-notes-card,
body[data-page="dashboard"] .service-timeline-card {
  margin: 0 !important;
}

body[data-page="dashboard"] .service-price-grid,
body[data-page="dashboard"] .service-checklist-list,
body[data-page="dashboard"] .service-document-list,
body[data-page="dashboard"] .note-list {
  display: grid;
  gap: 10px;
}

body[data-page="dashboard"] .service-template-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

body[data-page="dashboard"] .service-template-meta > div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 14px;
  background: rgba(255, 255, 255, .42);
}

body[data-page="dashboard"] .service-template-meta span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="dashboard"] .service-template-meta strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

body[data-page="dashboard"] .service-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, .07);
}

body[data-page="dashboard"] .service-price-row span,
body[data-page="dashboard"] .service-total-row span {
  color: #667085;
  font-size: 13px;
}

body[data-page="dashboard"] .service-price-row strong,
body[data-page="dashboard"] .service-total-row strong {
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

body[data-page="dashboard"] .service-total-row {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 24, 39, .1);
}

body[data-page="dashboard"] .service-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, .07);
}

body[data-page="dashboard"] .service-setting-row > span {
  color: #667085;
  font-size: 13px;
}

body[data-page="dashboard"] .service-checklist-item {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 16px;
  background: rgba(255, 255, 255, .52);
}

body[data-page="dashboard"] .service-reorder-handle {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 10px;
  color: #64748b;
  background: rgba(255, 255, 255, .54);
  cursor: grab;
}

body[data-page="dashboard"] .service-reorder-handle svg,
body[data-page="dashboard"] .service-settings-card .panel-head > svg,
body[data-page="dashboard"] .service-notes-card .panel-head > svg,
body[data-page="dashboard"] .service-timeline-card .panel-head > svg {
  width: 18px;
  height: 18px;
  color: var(--vdx-primary, #2457ff);
}

body[data-page="dashboard"] .service-checklist-card .panel-head,
body[data-page="dashboard"] .service-notes-card .panel-head {
  margin-bottom: 16px;
}

body[data-page="dashboard"] .service-checklist-item h4 {
  margin: 0 0 5px;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

body[data-page="dashboard"] .service-checklist-item p {
  margin: 0 0 10px;
  color: #667085 !important;
  font-size: 13px;
}

body[data-page="dashboard"] .service-checklist-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body[data-page="dashboard"] .service-icon-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-action-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid rgba(37, 91, 255, .22);
  border-radius: 10px;
  color: var(--vdx-primary, #1d4fff);
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 8px 22px rgba(31, 64, 128, .08);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s var(--app-ease), box-shadow .16s var(--app-ease), border-color .16s var(--app-ease), background .16s var(--app-ease), color .16s var(--app-ease);
}

.icon-action-svg {
  display: block;
  width: 18px;
  height: 18px;
  color: inherit;
  pointer-events: none;
}

.icon-action-fa {
  display: block;
  width: 18px;
  font-size: 17px;
  line-height: 1;
  color: inherit;
  text-align: center;
  pointer-events: none;
}

.icon-action-btn:hover,
.icon-action-btn:focus-visible {
  color: #fff;
  background: var(--vdx-primary, #1d4fff);
  border-color: var(--vdx-primary, #1d4fff);
  box-shadow: 0 14px 28px rgba(37, 91, 255, .2);
  transform: translateY(-1px);
  outline: none;
}

.icon-action-danger {
  border-color: rgba(239, 68, 68, .24);
  color: #ef4444;
}

.icon-action-danger:hover,
.icon-action-danger:focus-visible {
  color: #fff;
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 14px 28px rgba(239, 68, 68, .18);
}

.icon-action-dark {
  border-color: rgba(17, 24, 39, .18);
  color: #344054;
}

.icon-action-dark:hover,
.icon-action-dark:focus-visible {
  color: #fff;
  background: #111827;
  border-color: #111827;
  box-shadow: 0 14px 28px rgba(17, 24, 39, .18);
}

body[data-page="dashboard"] .service-checklist-form,
body[data-page="dashboard"] .service-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body[data-page="dashboard"] .service-checklist-form .toolbar-actions,
body[data-page="dashboard"] .service-edit-wide {
  grid-column: 1 / -1;
}

body[data-page="dashboard"] .service-edit-grid {
  margin-bottom: 0;
}

@media (max-width: 1320px) {
  body[data-page="dashboard"] .service-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .service-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  body[data-page="dashboard"] .service-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .service-workspace-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .service-workspace-grid {
    gap: var(--crm-card-gap, 16px);
  }

  body[data-page="dashboard"] .service-side-column {
    display: contents !important;
  }

  body[data-page="dashboard"] .service-main-column {
    display: contents !important;
  }

  body[data-page="dashboard"] .service-pricing-card { order: 1; }
  body[data-page="dashboard"] .service-progress-card { order: 2; }
  body[data-page="dashboard"] .service-checklist-card { order: 3; }
  body[data-page="dashboard"] .service-settings-card { order: 4; }
  body[data-page="dashboard"] .service-notes-card { order: 5; }
  body[data-page="dashboard"] .service-timeline-card { order: 6; }

  body[data-page="dashboard"] .service-workspace-grid > .panel,
  body[data-page="dashboard"] .service-workspace-grid .panel {
    margin-bottom: 0 !important;
  }

  body[data-page="dashboard"] .service-checklist-form,
  body[data-page="dashboard"] .service-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body[data-page="dashboard"] .service-card-grid,
  body[data-page="dashboard"] .service-summary-grid,
  body[data-page="dashboard"] .service-checklist-form,
  body[data-page="dashboard"] .service-edit-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .service-checklist-item,
  body[data-page="dashboard"] .service-document-list .client-document-card {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-page="dashboard"] .service-checklist-actions {
    justify-content: flex-start;
  }

  body[data-page="dashboard"] .service-template-meta {
    grid-template-columns: 1fr;
  }
}

/* Analytics module */
body[data-page="dashboard"] .date-range-filter {
  position: relative;
  z-index: 50;
}

body[data-page="dashboard"] .date-range-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 154px;
}

body[data-page="dashboard"] .date-range-trigger i,
body[data-page="dashboard"] .app-select-trigger i {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

body[data-page="dashboard"] .date-range-filter.open .date-range-trigger i {
  transform: rotate(225deg);
}

body[data-page="dashboard"] .date-range-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 7000;
  display: grid;
  gap: 12px;
  width: min(320px, 88vw);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 24px 64px rgba(31, 64, 128, .18);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

body[data-page="dashboard"] .date-range-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body[data-page="dashboard"] .date-range-presets button {
  border: 0;
  border-radius: 12px;
  padding: 9px 10px;
  color: #111827;
  background: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

body[data-page="dashboard"] .date-range-presets button:hover {
  color: #fff;
  background: var(--vdx-primary);
}

body[data-page="dashboard"] .date-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body[data-page="dashboard"] .date-range-fields label {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

body[data-page="dashboard"] .analytics-controls .toolbar-actions,
body[data-page="dashboard"] .analytics-report-shell .toolbar-actions {
  flex-wrap: wrap;
}

/* ---------- Stat cards ---------- */

body[data-page="dashboard"] .analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--crm-card-gap, 16px);
  margin-bottom: var(--crm-card-gap, 16px);
}

/* Shared Super Admin Dashboard metric-card contract used by Dashboard and Analytics. */
body[data-page="dashboard"] .dashboard-metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 100px;
  padding: var(--crm-card-pad) !important;
  overflow: hidden;
}

body[data-page="dashboard"] .dashboard-metric-card .sa-ref-metric-icon {
  width: 34px;
  height: 34px;
  margin: 0;
  flex: 0 0 34px;
}

body[data-page="dashboard"] .dashboard-metric-card .sa-ref-metric-icon .side-svg {
  width: 16px;
  height: 16px;
}

body[data-page="dashboard"] .dashboard-metric-card .sa-ref-metric-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body[data-page="dashboard"] .dashboard-metric-card .sa-ref-metric-main strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="dashboard"] .dashboard-metric-card > small {
  display: block;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-card {
  justify-content: flex-start;
  gap: 12px;
  min-height: 112px;
  height: 100%;
  padding: 18px !important;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-card > p {
  margin: 0;
  color: #475467;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-card .sa-ref-metric-main {
  gap: 14px;
  min-width: 0;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-card .sa-ref-metric-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  opacity: 1;
  filter: none;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-card .sa-ref-metric-icon .side-svg {
  width: 21px;
  height: 21px;
  opacity: 1;
  stroke: currentColor;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-card .sa-ref-metric-main strong {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
	overflow: visible;
	color: #111827 !important;
	font-size: 24px !important;
	font-weight: 500 !important;
	line-height: 1.05 !important;
	text-overflow: clip;
	white-space: nowrap;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-total-tasks .sa-ref-metric-icon,
body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-active-services .sa-ref-metric-icon {
  color: #1746d1;
  background: #e8efff;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-assigned-team .sa-ref-metric-icon,
body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-completed-tasks .sa-ref-metric-icon,
body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-total-revenue .sa-ref-metric-icon {
  color: #087a55;
  background: #e4f7ee;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-pending-works .sa-ref-metric-icon {
  color: #b45309;
  background: #fff2d8;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-in-progress-works .sa-ref-metric-icon {
  color: #4338ca;
  background: #ebe9ff;
}

body[data-page="dashboard"] .analytics-stats-grid .analytics-metric-critical-tasks .sa-ref-metric-icon {
  color: #dc2626;
  background: #fee8e7;
}

/* ---------- Chart grid & shell ---------- */

body[data-page="dashboard"] .analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--crm-card-gap, 16px);
}

body[data-page="dashboard"] .analytics-chart-card {
  min-height: 340px;
  padding: var(--crm-card-pad) !important;
}

body[data-page="dashboard"] .analytics-chart-head {
  align-items: center;
  margin-bottom: 8px !important;
}

body[data-page="dashboard"] .analytics-chart-head h3 {
  margin: 0;
  color: var(--crm-widget-title-color, #111827);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

/* ---------- Axis charts (Lead Conversion Trend / Revenue Overview) ---------- */

body[data-page="dashboard"] .analytics-axis-chart-wrap {
  position: relative;
}

body[data-page="dashboard"] .analytics-axis-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

body[data-page="dashboard"] .analytics-grid-line {
  stroke: rgba(17, 24, 39, .07);
  stroke-width: 1;
}

body[data-page="dashboard"] .analytics-axis-label {
  fill: #98a2b3;
  font-size: 11px;
  font-weight: 600;
}

body[data-page="dashboard"] .analytics-line-path {
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 760ms ease;
}

body[data-page="dashboard"] .analytics-line-path.is-drawn {
  opacity: 1;
}

body[data-page="dashboard"] .analytics-line-path.leads { stroke: #2457ff; }
body[data-page="dashboard"] .analytics-line-path.converted { stroke: #22c55e; }
body[data-page="dashboard"] .analytics-line-path.revenue { stroke: #2457ff; }

body[data-page="dashboard"] .analytics-line-dot {
  fill: #fff;
  stroke-width: 2.5;
  opacity: 0;
  transform: scale(.4);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 320ms ease, transform 320ms ease, r 160ms ease;
}

body[data-page="dashboard"] .analytics-line-dot.is-visible {
  opacity: 1;
  transform: scale(1);
}

body[data-page="dashboard"] .analytics-line-dot.leads { stroke: #2457ff; }
body[data-page="dashboard"] .analytics-line-dot.converted { stroke: #22c55e; }
body[data-page="dashboard"] .analytics-line-dot.revenue { stroke: #2457ff; }

body[data-page="dashboard"] .analytics-area-fill {
  opacity: 0;
  transition: opacity 900ms ease;
}

body[data-page="dashboard"] .analytics-area-fill.is-drawn {
  opacity: 1;
}

body[data-page="dashboard"] .analytics-hover-line {
  stroke: rgba(16, 51, 255, .28);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

body[data-page="dashboard"] .analytics-chart-tooltip {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  display: grid;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .24);
  pointer-events: none;
}

body[data-page="dashboard"] .analytics-chart-tooltip strong {
  font-size: 12.5px;
  font-weight: 500;
}

body[data-page="dashboard"] .analytics-chart-tooltip span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .82);
}

body[data-page="dashboard"] .analytics-chart-tooltip .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2457ff;
}

body[data-page="dashboard"] .analytics-chart-tooltip .dot.converted { background: #22c55e; }
body[data-page="dashboard"] .analytics-chart-tooltip .dot.revenue { background: #2457ff; }

body[data-page="dashboard"] .chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

body[data-page="dashboard"] .chart-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  background: #2457ff;
}

body[data-page="dashboard"] .chart-legend span.converted::before {
  background: #22c55e;
}

/* ---------- Service Performance ---------- */

body[data-page="dashboard"] .analytics-service-performance {
  display: grid;
  gap: 16px;
}

body[data-page="dashboard"] .analytics-service-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #111827;
  font-size: 13px;
  font-weight: 650;
}

body[data-page="dashboard"] .analytics-service-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, .08);
}

body[data-page="dashboard"] .analytics-service-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2457ff, #6ea2ff);
  transition: width 900ms cubic-bezier(.22, .9, .32, 1);
}

body[data-page="dashboard"] .analytics-service-row-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="dashboard"] .analytics-service-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-page="dashboard"] .analytics-service-row-meta i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

body[data-page="dashboard"] .analytics-service-row-meta .completed i { background: #22c55e; }
body[data-page="dashboard"] .analytics-service-row-meta .pending i { background: #f59e0b; }

/* ---------- Work Status Donut ---------- */

body[data-page="dashboard"] .analytics-donut-layout {
  display: grid;
  grid-template-columns: minmax(180px, .95fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

body[data-page="dashboard"] .analytics-donut-visual {
  position: relative;
}

body[data-page="dashboard"] .analytics-donut-visual svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

body[data-page="dashboard"] .analytics-donut-track {
  fill: none;
  stroke: rgba(17, 24, 39, .06);
  stroke-width: 26;
}

body[data-page="dashboard"] .analytics-donut-segment {
  fill: none;
  stroke-width: 26;
  cursor: pointer;
  transition: stroke-width 200ms ease;
}

body[data-page="dashboard"] .analytics-donut-segment.active {
  stroke-width: 30;
}

body[data-page="dashboard"] .analytics-donut-value {
  fill: #0b1120;
  font-size: 26px;
  font-weight: 500;
}

body[data-page="dashboard"] .analytics-donut-caption {
  fill: #98a2b3;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

body[data-page="dashboard"] .analytics-donut-legend {
  display: grid;
  gap: 10px;
}

body[data-page="dashboard"] .analytics-donut-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background 160ms ease;
}

body[data-page="dashboard"] .analytics-donut-legend-row:hover,
body[data-page="dashboard"] .analytics-donut-legend-row.active {
  background: rgba(36, 87, 255, .08);
  color: #111827;
}

body[data-page="dashboard"] .analytics-donut-legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

body[data-page="dashboard"] .analytics-donut-legend-row strong {
  color: #111827;
  font-weight: 500;
}

/* ---------- Country-wise Clients ---------- */

body[data-page="dashboard"] .analytics-country-list {
  display: grid;
  gap: 16px;
}

body[data-page="dashboard"] .analytics-country-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #111827;
  font-size: 13px;
  font-weight: 650;
}

body[data-page="dashboard"] .analytics-country-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, .08);
}

body[data-page="dashboard"] .analytics-country-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2457ff, #6ea2ff);
  transition: width 900ms cubic-bezier(.22, .9, .32, 1);
}

body[data-page="dashboard"] .analytics-country-percent {
  display: block;
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Admin Performance ---------- */

body[data-page="dashboard"] .analytics-admin-list {
  display: grid;
  gap: 18px;
}

body[data-page="dashboard"] .analytics-admin-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

body[data-page="dashboard"] .analytics-admin-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #2457ff, #1033ff);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
}

body[data-page="dashboard"] .analytics-admin-body {
  flex: 1 1 auto;
  min-width: 0;
}

body[data-page="dashboard"] .analytics-admin-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
}

body[data-page="dashboard"] .analytics-admin-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, .08);
}

body[data-page="dashboard"] .analytics-admin-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2457ff, #6ea2ff);
  transition: width 900ms cubic-bezier(.22, .9, .32, 1);
}

body[data-page="dashboard"] .analytics-admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="dashboard"] .analytics-report-shell .search-box {
  min-width: min(280px, 100%);
}

body[data-page="dashboard"] .analytics-reports-table {
  table-layout: fixed;
  min-width: 1180px;
}

body[data-page="dashboard"] .analytics-reports-table col.compact { width: 104px; }
body[data-page="dashboard"] .analytics-reports-table col.wide { width: 205px; }
body[data-page="dashboard"] .analytics-reports-table col.number { width: 92px; }
body[data-page="dashboard"] .analytics-reports-table col.country { width: 104px; }
body[data-page="dashboard"] .analytics-reports-table col.date { width: 118px; }
body[data-page="dashboard"] .analytics-reports-table col.status { width: 122px; }
body[data-page="dashboard"] .analytics-reports-table col.action { width: 86px; }

body[data-page="dashboard"] .analytics-reports-table th,
body[data-page="dashboard"] .analytics-reports-table td {
  padding: 11px 12px !important;
  white-space: nowrap;
}

body[data-page="dashboard"] .analytics-reports-table th.number,
body[data-page="dashboard"] .analytics-reports-table td.number {
  text-align: right;
}

body[data-page="dashboard"] .analytics-reports-table th.status,
body[data-page="dashboard"] .analytics-reports-table td.status,
body[data-page="dashboard"] .analytics-reports-table th.action,
body[data-page="dashboard"] .analytics-reports-table td.action {
  text-align: center;
}

body[data-page="dashboard"] .analytics-reports-table .table-ellipsis {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  body[data-page="dashboard"] .analytics-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .analytics-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .analytics-chart-grid,
  body[data-page="dashboard"] .analytics-donut-layout,
  body[data-page="dashboard"] .analytics-stats-grid,
  body[data-page="dashboard"] .date-range-fields {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .date-range-popover {
    left: 0;
    right: auto;
  }
}

/* Final internal page alignment guard. Header and body share one gutter. */
body[data-page="dashboard"] {
  --app-shell-gutter-x: 38px;
  --app-shell-header-y: 24px;
  --app-shell-bottom: 32px;
}

body[data-page="dashboard"] .content {
  padding: 0 !important;
}

body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .content > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
  box-sizing: border-box;
  width: 100%;
  margin: 0 !important;
  padding: var(--app-shell-header-y) var(--app-shell-gutter-x) !important;
}

body[data-page="dashboard"] .app-breadcrumb {
  box-sizing: border-box;
  width: 100%;
  flex: 0 0 42px;
  min-height: 42px;
  padding: 0 var(--app-shell-gutter-x) !important;
}

body[data-page="dashboard"] .page-content {
  box-sizing: border-box;
  width: 100%;
  padding: 0 var(--app-shell-gutter-x) var(--app-shell-bottom) !important;
  scrollbar-gutter: stable;
}

body[data-page="dashboard"] .page-content > .module-page,
body[data-page="dashboard"] .page-content > .sa-dashboard,
body[data-page="dashboard"] .page-content > .sa-reference-dashboard,
body[data-page="dashboard"] .page-content > .client-dashboard,
body[data-page="dashboard"] .page-content > .admin-dashboard {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-intro,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metrics,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-widget-grid {
  margin-right: 0 !important;
  margin-left: 0 !important;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] {
    --app-shell-gutter-x: 28px;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] {
    --app-shell-gutter-x: 18px;
    --app-shell-header-y: 20px;
    --app-shell-bottom: 22px;
  }
}

/* Unified table toolbar */
@media (max-width: 1100px) {
  body[data-page="dashboard"] .table-toolbar-actions {
    flex-wrap: wrap;
  }

  body[data-page="dashboard"] .table-toolbar-actions .search-box {
    width: min(100%, 420px);
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .table-toolbar-unified {
    align-items: stretch;
  }

  body[data-page="dashboard"] .table-toolbar-actions,
  body[data-page="dashboard"] .filter-popover-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .table-toolbar-actions .search-box,
  body[data-page="dashboard"] .table-toolbar-actions .btn,
  body[data-page="dashboard"] .table-toolbar-actions .app-select {
    width: 100%;
  }

  body[data-page="dashboard"] .table-filter-wrap {
    position: static;
  }

  body[data-page="dashboard"] .table-filter-popover {
    left: 0;
    right: 0;
    width: 100%;
  }

  body[data-page="dashboard"] .services-filter-popover .filter-popover-grid {
    grid-template-columns: 1fr;
  }
}

/* Global dropdown layering guard */
body[data-page="dashboard"] .module-page,
body[data-page="dashboard"] .data-table-shell,
body[data-page="dashboard"] .data-table-card,
body[data-page="dashboard"] .crm-table-card,
body[data-page="dashboard"] .module-toolbar,
body[data-page="dashboard"] .panel {
  overflow: visible !important;
}

body[data-page="dashboard"] .table-responsive {
  overflow-x: auto;
  overflow-y: visible !important;
  /* Small gap so a horizontal scrollbar never sits flush against the last
     row's text -- wrapper-level spacing only, table/row heights untouched. */
  padding-bottom: 10px;
}

body[data-page="dashboard"] .action-dropdown,
body[data-page="dashboard"] .team-action-dropdown,
body[data-page="dashboard"] .client-action-dropdown,
body[data-page="dashboard"] .table-action-menu,
body[data-page="dashboard"] .app-select,
body[data-page="dashboard"] .date-range-filter,
body[data-page="dashboard"] .table-filter-wrap,
body[data-page="dashboard"] .user-menu {
  position: relative;
  z-index: 7200;
}

body[data-page="dashboard"] .action-dropdown.open,
body[data-page="dashboard"] .team-action-dropdown.open,
body[data-page="dashboard"] .client-action-dropdown.open,
body[data-page="dashboard"] .table-action-menu.open,
body[data-page="dashboard"] .app-select.open,
body[data-page="dashboard"] .date-range-filter.open,
body[data-page="dashboard"] .table-filter-wrap:focus-within,
body[data-page="dashboard"] .user-menu.open {
  z-index: 9000 !important;
}

body[data-page="dashboard"] .action-menu,
body[data-page="dashboard"] .app-select-menu,
body[data-page="dashboard"] .date-range-popover,
body[data-page="dashboard"] .table-filter-popover,
body[data-page="dashboard"] .user-menu-dropdown {
  z-index: 9100 !important;
}

body[data-page="dashboard"] .table-filter-popover {
  isolation: isolate;
  border-color: rgba(226, 232, 240, .98) !important;
  background: #fff !important;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-page="dashboard"] .table-filter-popover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #fff;
}

body[data-page="dashboard"] .table-filter-popover .app-select-menu,
body[data-page="dashboard"] .table-filter-popover .date-range-popover {
  border-color: rgba(226, 232, 240, .98) !important;
  background: #fff !important;
  box-shadow: 0 24px 56px rgba(15, 23, 42, .18) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-page="dashboard"] .table-filter-popover .filter-popover-actions {
  background: #fff;
}

body[data-page="dashboard"] .data-table-card .action-menu:not(.overlay-portal) {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
}

body[data-page="dashboard"] .pagination-row {
  position: relative;
  z-index: 1;
}

/* Global page layout contract. Dashboard spacing is the source of truth. */
body[data-page="dashboard"] {
  --app-page-gutter-x: 38px;
  --app-page-header-y: 24px;
  --app-page-gap: 20px;
  --app-page-bottom: 32px;
  --crm-card-gap: var(--app-page-gap);
  --vdx-gap: var(--app-page-gap);
}

body[data-page="dashboard"] .content {
  box-sizing: border-box;
  min-width: 0;
  padding: 0 !important;
}

body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .content > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 var(--app-page-gap) !important;
  padding: var(--app-page-header-y) var(--app-page-gutter-x) !important;
}

body[data-page="dashboard"] .app-page-container,
body[data-page="dashboard"] .page-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0 var(--app-page-gutter-x) var(--app-page-bottom) !important;
  scrollbar-gutter: stable;
}

body[data-page="dashboard"] .app-page-container > .module-page,
body[data-page="dashboard"] .app-page-container > .sa-dashboard,
body[data-page="dashboard"] .app-page-container > .sa-reference-dashboard,
body[data-page="dashboard"] .app-page-container > .client-dashboard,
body[data-page="dashboard"] .app-page-container > .admin-dashboard,
body[data-page="dashboard"] .page-content > .module-page,
body[data-page="dashboard"] .page-content > .sa-dashboard,
body[data-page="dashboard"] .page-content > .sa-reference-dashboard,
body[data-page="dashboard"] .page-content > .client-dashboard,
body[data-page="dashboard"] .page-content > .admin-dashboard {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  gap: var(--app-page-gap) !important;
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body[data-page="dashboard"] .module-page > *,
body[data-page="dashboard"] .sa-dashboard > *,
body[data-page="dashboard"] .sa-reference-dashboard > *,
body[data-page="dashboard"] .client-dashboard > *,
body[data-page="dashboard"] .admin-dashboard > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Non-dashboard module statistics. Dashboard uses .sa-ref-metric and is
   intentionally excluded from this simplified stat-card treatment. */
body[data-page="dashboard"] .page-content > .module-page .summary-grid,
body[data-page="dashboard"] .app-page-container > .module-page .summary-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)) !important;
  gap: var(--app-page-gap) !important;
  width: 100% !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card,
body[data-page="dashboard"] .app-page-container > .module-page .summary-card {
  min-height: 118px !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card small,
body[data-page="dashboard"] .app-page-container > .module-page .summary-card small,
body[data-page="dashboard"] .page-content > .module-page .summary-card .mini-line,
body[data-page="dashboard"] .app-page-container > .module-page .summary-card .mini-line,
body[data-page="dashboard"] .page-content > .module-page .summary-card .mini-bars,
body[data-page="dashboard"] .app-page-container > .module-page .summary-card .mini-bars {
  display: none !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card span,
body[data-page="dashboard"] .app-page-container > .module-page .summary-card span {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

body[data-page="dashboard"] .page-content > .module-page .summary-card strong, body[data-page="dashboard"] .app-page-container > .module-page .summary-card strong {
	margin-top: 6px !important;
	color: #111827 !important;
	font-size: 20px !important;
	font-weight: var(--crm-stat-value-weight) !important;
	line-height: 1.1 !important;
	letter-spacing: 0 !important;
}

/* Team Management card view */
body[data-page="dashboard"] .team-management-page .team-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--app-page-gap);
  width: 100%;
}

body[data-page="dashboard"] .team-profile-card {
  position: relative;
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  background: rgba(255, 255, 255, .46);
  box-shadow: 0 24px 70px rgba(31, 64, 128, .12);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body[data-page="dashboard"] .team-profile-card:hover {
  transform: translateY(-3px);
  border-color: rgba(36, 87, 255, .34);
  box-shadow: 0 30px 82px rgba(31, 64, 128, .18);
}

body[data-page="dashboard"] .team-profile-card:focus-visible {
  outline: 3px solid rgba(36, 87, 255, .2);
  outline-offset: 3px;
}

body[data-page="dashboard"] .team-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

body[data-page="dashboard"] .team-card-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #1033ff, #315cff);
  box-shadow: 0 16px 32px rgba(16, 51, 255, .26);
  font-size: 18px;
  font-weight: 800;
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #1033ff, #315cff);
  font-weight: 800;
  line-height: 1;
}

.user-avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.user-avatar.md { width: 42px; height: 42px; font-size: 14px; }
.user-avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

body[data-page="dashboard"] .team-card-avatar > .user-avatar {
  width: 100%;
  height: 100%;
  border: 0;
}

body[data-page="dashboard"] .team-card-avatar:has(.user-avatar img) {
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

body[data-page="dashboard"] .team-card-avatar:has(.user-avatar img) > .user-avatar {
  background: transparent;
}

body[data-page="dashboard"] .team-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255,255,255,.96);
  border-radius: 999px;
  background: #22c55e;
}

body[data-page="dashboard"] .team-card-identity {
  min-width: 0;
}

body[data-page="dashboard"] .team-card-status-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  align-self: start;
  gap: 8px;
}

body[data-page="dashboard"] .team-power-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(239, 68, 68, .24);
  border-radius: 11px;
  color: #dc2626;
  background: rgba(255,255,255,.72);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

body[data-page="dashboard"] .team-power-button.inactive {
  border-color: rgba(34, 197, 94, .28);
  color: #059669;
}

body[data-page="dashboard"] .team-power-button:hover:not(:disabled) {
  border-color: currentColor;
  background: #fff;
}

body[data-page="dashboard"] .team-power-button:disabled {
  cursor: wait;
  opacity: .55;
}

body[data-page="dashboard"] .team-power-button svg {
  width: 17px;
  height: 17px;
}

body[data-page="dashboard"] .team-card-name {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: #111827;
  background: transparent;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
  text-align: left;
}

body[data-page="dashboard"] .team-card-identity span,
body[data-page="dashboard"] .team-card-contact a,
body[data-page="dashboard"] .team-card-description {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

body[data-page="dashboard"] .team-card-description {
  min-height: 42px;
  margin: 0;
}

body[data-page="dashboard"] .team-card-contact {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

body[data-page="dashboard"] .team-card-contact a {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  color: #334155;
  text-decoration: none;
}

body[data-page="dashboard"] .team-card-contact svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: #1033ff;
}

body[data-page="dashboard"] .team-card-contact a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="dashboard"] .team-card-contact a:hover {
  color: #1033ff;
}

body[data-page="dashboard"] .team-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="dashboard"] .team-card-metrics div {
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  background: rgba(255,255,255,.56);
  text-align: center;
}

body[data-page="dashboard"] .team-card-metrics strong {
  display: block;
  color: #111827;
  font-size: 23px;
  line-height: 1;
  font-weight: 500;
}

body[data-page="dashboard"] .team-card-metrics span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

body[data-page="dashboard"] .team-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

body[data-page="dashboard"] .team-contact-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(36, 87, 255, .18);
  border-radius: 13px;
  color: #1033ff;
  background: rgba(255,255,255,.74);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

body[data-page="dashboard"] .team-contact-icon:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 12px 26px rgba(16, 51, 255, .14);
}

body[data-page="dashboard"] .team-assign-task {
  min-height: 38px;
  margin-left: auto;
  padding-inline: 14px;
}

body[data-page="dashboard"] .team-view-switcher {
  flex: 0 0 auto;
}

body[data-page="dashboard"] .team-view-switcher .task-view-tabs button {
  min-height: 38px;
}

body[data-page="dashboard"] .team-detail-page .team-detail-work-grid {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr) minmax(0, 1.15fr);
  gap: var(--app-page-gap);
  width: 100%;
  min-width: 0;
}

body[data-page="dashboard"] .team-detail-page .team-detail-work-panel {
  min-width: 0;
  max-width: 100%;
}

body[data-page="dashboard"] .team-detail-page .data-table-shell,
body[data-page="dashboard"] .team-detail-page .data-table-card,
body[data-page="dashboard"] .team-detail-page .table-responsive {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body[data-page="dashboard"] .team-detail-page .table-toolbar-unified {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

body[data-page="dashboard"] .team-detail-page .table-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

body[data-page="dashboard"] .team-detail-page .table-toolbar-actions .search-box {
  min-width: 0;
  width: 100%;
}

body[data-page="dashboard"] .team-detail-page .table-toolbar-actions .btn {
  min-width: 0;
  white-space: nowrap;
}

body[data-page="dashboard"] .team-detail-page .premium-table th,
body[data-page="dashboard"] .team-detail-page .premium-table td {
  padding: 12px 14px;
  white-space: nowrap;
}

body[data-page="dashboard"] .team-detail-page .empty-module {
  min-height: 260px;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .team-management-page .team-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="dashboard"] .team-detail-page .team-detail-work-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body[data-page="dashboard"] .team-management-page .team-card-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .team-card-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body[data-page="dashboard"] .team-card-head .status-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

body[data-page="dashboard"] .summary-grid,
body[data-page="dashboard"] .crm-stat-grid,
body[data-page="dashboard"] .dashboard-grid,
body[data-page="dashboard"] .portal-grid,
body[data-page="dashboard"] .analytics-chart-grid,
body[data-page="dashboard"] .service-card-grid,
body[data-page="dashboard"] .service-summary-grid,
body[data-page="dashboard"] .service-workspace-grid,
body[data-page="dashboard"] .team-detail-grid,
body[data-page="dashboard"] .client-overview-grid,
body[data-page="dashboard"] .client-section-grid,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metrics,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-widget-grid {
  gap: var(--app-page-gap) !important;
}

body[data-page="dashboard"] .module-page > .row,
body[data-page="dashboard"] .client-dashboard > .row,
body[data-page="dashboard"] .admin-dashboard > .row {
  --bs-gutter-x: var(--app-page-gap);
  --bs-gutter-y: var(--app-page-gap);
  width: 100%;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body[data-page="dashboard"] .module-page > .row > *,
body[data-page="dashboard"] .client-dashboard > .row > *,
body[data-page="dashboard"] .admin-dashboard > .row > * {
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
}

body[data-page="dashboard"] .data-table-shell,
body[data-page="dashboard"] .service-workspace-grid > div,
body[data-page="dashboard"] .service-checklist-list,
body[data-page="dashboard"] .service-document-list,
body[data-page="dashboard"] .note-list,
body[data-page="dashboard"] .analytics-progress-list {
  gap: var(--app-page-gap) !important;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] {
    --app-page-gutter-x: 28px;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] {
    --app-page-gutter-x: 18px;
    --app-page-header-y: 20px;
    --app-page-gap: 16px;
    --app-page-bottom: 22px;
  }
}

/* Final overlay portal contract: these elements live under document.body, so
   they bypass clipped cards, tables, transformed widgets, and scroll panels.
   .flip-up is excluded from the bottom reset -- it's the one case (a select
   menu with no room below its trigger) that needs `bottom` to anchor the menu
   growing upward instead of getting clipped against the viewport edge. */
body .overlay-portal:not(.flip-up) {
  position: fixed !important;
  z-index: 100001 !important;
  right: auto !important;
  bottom: auto !important;
  overflow-x: hidden;
}

body .overlay-portal.flip-up {
  position: fixed !important;
  z-index: 100001 !important;
  right: auto !important;
  overflow-x: hidden;
}

body[data-page="dashboard"] .overlay-portal:not(.flip-up),
body[data-page="dashboard"] .data-table-card .overlay-portal:not(.flip-up),
body[data-page="dashboard"] .data-table-card .action-menu.overlay-portal {
  bottom: auto !important;
}

body .action-menu.overlay-portal {
  display: grid !important;
}

body .app-select-menu.overlay-portal,
body .table-filter-popover.overlay-portal,
body .date-range-popover.overlay-portal {
  overflow-y: auto;
}

/* Unified dashboard shell width contract.
   Keep every internal route on the same content rail and prevent page-level
   horizontal overflow from dashboard widgets, tables, or detail views. */
:root {
  --sidebar-expanded-width: 280px;
  --sidebar-collapsed-width: 88px;
  --sidebar-current-width: var(--sidebar-expanded-width);
}

html,
body,
#root {
  width: 100%;
  max-width: 100%;
  height: 100%;
}

body[data-page="dashboard"] {
  overflow: hidden !important;
}

body[data-page="dashboard"] .layout {
  --sidebar-current-width: var(--sidebar-expanded-width);
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  grid-template-columns: var(--sidebar-current-width) minmax(0, 1fr) !important;
  overflow: hidden !important;
}

body[data-page="dashboard"] .layout:has(.sidebar.collapsed) {
  --sidebar-current-width: var(--sidebar-collapsed-width);
}

body[data-page="dashboard"] .layout .sidebar {
  width: var(--sidebar-current-width) !important;
  min-width: var(--sidebar-current-width) !important;
  max-width: var(--sidebar-current-width) !important;
  flex-shrink: 0;
}

body[data-page="dashboard"] .content {
  width: calc(100vw - var(--sidebar-current-width)) !important;
  max-width: calc(100vw - var(--sidebar-current-width)) !important;
  min-width: 0 !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}

body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .content > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
  flex: 0 0 auto;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}

body[data-page="dashboard"] .app-page-container,
body[data-page="dashboard"] .page-content {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body[data-page="dashboard"] .app-page-container > *,
body[data-page="dashboard"] .page-content > *,
body[data-page="dashboard"] .module-page,
body[data-page="dashboard"] .sa-dashboard,
body[data-page="dashboard"] .sa-reference-dashboard,
body[data-page="dashboard"] .client-dashboard,
body[data-page="dashboard"] .admin-dashboard,
body[data-page="dashboard"] .team-detail-page,
body[data-page="dashboard"] .team-form-page,
body[data-page="dashboard"] .client-profile-page,
body[data-page="dashboard"] .client-form-page {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

body[data-page="dashboard"] .panel,
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .module-toolbar,
body[data-page="dashboard"] .data-table-card,
body[data-page="dashboard"] .crm-table-card,
body[data-page="dashboard"] .table-responsive,
body[data-page="dashboard"] .table-wrapper {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

body[data-page="dashboard"] .table-responsive,
body[data-page="dashboard"] .table-wrapper,
body[data-page="dashboard"] .crm-table-card,
body[data-page="dashboard"] .data-table-card {
  overflow-x: auto;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-header,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-intro,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-metrics,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-widget-grid {
  width: 100% !important;
  max-width: 100% !important;
}

/* Unified non-profile dropdown chevron.
   Keep the user profile caret untouched; this only standardizes app selects,
   filters, chart/date controls, and table dropdown triggers. */
.app-select-trigger .dropdown-chevron,
.date-range-trigger .dropdown-chevron,
.dropdown-trigger .dropdown-chevron,
.filter-trigger .dropdown-chevron,
.table-filter-trigger .dropdown-chevron {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  flex: 0 0 18px !important;
  color: currentColor !important;
  stroke-width: 2 !important;
  transform: none !important;
  background: none !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

.app-select-trigger,
.date-range-trigger,
.dropdown-trigger,
.filter-trigger,
.table-filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-select-trigger > span,
.date-range-trigger > span {
  min-width: 0;
}

.app-select.open .app-select-trigger .dropdown-chevron,
.date-range-filter.open .date-range-trigger .dropdown-chevron {
  transform: rotate(180deg) !important;
}

body[data-page="dashboard"] .date-range-trigger i,
body[data-page="dashboard"] .app-select-trigger i,
.app-select-trigger i,
.date-range-trigger i {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: 0 !important;
  background: none !important;
  transform: none !important;
}

@media (max-width: 920px) {
  body[data-page="dashboard"] .layout,
  body[data-page="dashboard"] .layout:has(.sidebar.collapsed) {
    --sidebar-current-width: 0px;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-page="dashboard"] .content {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}

/* Shared header -> breadcrumb -> content rhythm.
   Keep vertical spacing in one place so pages do not jump between modules. */
:root {
  --app-header-breadcrumb-gap: 10px;
  --app-breadcrumb-content-gap: 14px;
}

body[data-page="dashboard"] .content > .topbar,
body[data-page="dashboard"] .content > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar,
body[data-page="dashboard"] .content:has(.sa-dashboard) > .topbar.app-header,
body[data-page="dashboard"] .content:has(.sa-reference-dashboard) > .topbar.app-header {
  margin-bottom: 0 !important;
  padding-bottom: var(--app-header-breadcrumb-gap) !important;
}

body[data-page="dashboard"] .app-breadcrumb {
  flex: 0 0 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body[data-page="dashboard"] .app-breadcrumb a,
body[data-page="dashboard"] .app-breadcrumb span {
  min-height: 28px;
}

body[data-page="dashboard"] .app-page-container,
body[data-page="dashboard"] .page-content {
  padding-top: var(--app-breadcrumb-content-gap) !important;
}

/* Dedicated create pages */
.create-page {
  gap: 18px !important;
  padding-bottom: 96px !important;
}

.create-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: 18px;
  align-items: start;
  width: 100%;
}

.create-form-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.create-form-side {
  position: sticky;
  top: 14px;
  min-width: 0;
}

.create-form-section {
  padding: 22px;
}

.create-form-section h3,
.form-summary-card h3 {
  margin: 0 0 16px;
  color: var(--app-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.create-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 7px;
  margin: 0;
  min-width: 0;
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 650;
}

.color-field-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.color-field-control .form-control-color {
  flex: 0 0 48px;
  width: 48px;
  min-height: 40px !important;
  padding: 4px !important;
}

.color-field-hex {
  font-size: 14px;
  font-weight: 650;
  color: var(--app-ink, #111827);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.form-field > span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.form-field em {
  color: #ef4444;
  font-style: normal;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.validation-message {
  color: #dc2626;
  font-size: 12px;
  font-weight: 650;
}

.form-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 2px;
  color: var(--app-text);
  font-size: 14px;
  font-weight: 600;
}

.form-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--app-primary);
}

.form-summary-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.form-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.form-summary-row:last-child {
  border-bottom: 0;
}

.form-summary-row span {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 650;
}

.form-summary-row strong {
  color: var(--app-text);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 42px rgba(31, 64, 128, 0.14);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.unsaved-indicator {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 750;
}

.save-error {
  display: block;
  margin-top: 3px;
  color: #b45309;
  font-size: 12px;
  font-weight: 650;
}

.btn-secondary-app {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
}

/* Used by consultation "Cancel Request" and the Billing "Delete Selected"
   bulk action -- previously had no dedicated styling and fell back to plain
   .btn defaults. */
.btn-danger-app {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.22);
}

.btn-danger-app:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

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

  .create-form-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .create-form-grid {
    grid-template-columns: 1fr;
  }

  .save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .save-bar .toolbar-actions {
    width: 100%;
  }

  .save-bar .btn {
    flex: 1 1 auto;
  }
}

.crm-stat-card {
  min-height: 100px !important;
  padding: 22px 24px !important;
}

.crm-stat-icon {
  width: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  flex: 0 0 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 30% !important;
  background: #2457ff !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.crm-stat-icon svg {
  width: 16px !important;
  height: 16px !important;
  color: #ffffff !important;
  stroke: currentColor !important;
}

.summary-green .crm-stat-icon,
.summary-gold .crm-stat-icon,
.summary-red .crm-stat-icon,
.summary-violet .crm-stat-icon {
  background: #2457ff !important;
  color: #ffffff !important;
}

.crm-stat-label {
  margin: 0 !important;
  color: #252525 !important;
  font-size: var(--crm-stat-label-size) !important;
  font-weight: var(--crm-stat-label-weight) !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.crm-stat-value {
  margin-top: 6px !important;
  color: #111827 !important;
  font-size: var(--crm-stat-value-size) !important;
  font-weight: var(--crm-stat-value-weight) !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

/* Unified module stat cards: match the Dashboard reference sizing and rhythm. */
body[data-page="dashboard"] .page-content > .module-page .summary-grid,
body[data-page="dashboard"] .app-page-container > .module-page .summary-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
}

body[data-page="dashboard"] .page-content > .module-page .crm-stat-card,
body[data-page="dashboard"] .app-page-container > .module-page .crm-stat-card {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: center !important;
  align-items: center !important;
  column-gap: 14px !important;
  row-gap: 14px !important;
}

body[data-page="dashboard"] .page-content > .module-page .crm-stat-copy,
body[data-page="dashboard"] .app-page-container > .module-page .crm-stat-copy {
  display: contents !important;
}

body[data-page="dashboard"] .page-content > .module-page .crm-stat-icon,
body[data-page="dashboard"] .app-page-container > .module-page .crm-stat-icon {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

body[data-page="dashboard"] .page-content > .module-page .crm-stat-label,
body[data-page="dashboard"] .app-page-container > .module-page .crm-stat-label {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

body[data-page="dashboard"] .page-content > .module-page .crm-stat-value,
body[data-page="dashboard"] .app-page-container > .module-page .crm-stat-value {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

/* Global reusable search input icon.
   Replaces broken text/icon fallbacks while preserving existing search sizing. */
.search-input {
  position: relative;
  width: 100%;
}

.search-input__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 2;
  width: 18px;
  height: 18px;
  color: #64748b;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-input .form-control,
.search-input input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 46px !important;
}

.search-box.search-input {
  width: 320px;
}

.sa-ref-search.search-input,
.app-header-search.search-input {
  position: relative;
}

.sa-ref-search.search-input .search-input__icon,
.app-header-search.search-input .search-input__icon {
  left: 24px;
  width: 20px;
  height: 20px;
  color: #111827;
}

.sa-ref-search.search-input input,
.app-header-search.search-input input {
  padding-left: 36px !important;
}

.search-box > span,
.sa-ref-search > span:not(.filter-count) {
  display: none !important;
}

.app-breadcrumb {
  flex: 0 0 20px !important;
}

.task-detail-page .detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--app-section-gap, 16px);
  margin-bottom: var(--app-section-gap, 16px);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
}

.info-field span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.info-field strong {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

.employee-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 16px 32px rgba(36, 87, 255, .18);
}

.employee-avatar.lg {
  width: 66px;
  height: 66px;
}

.employee-avatar-wrap {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 87, 255, .1);
}

.employee-avatar-wrap.lg {
  width: 66px;
  height: 66px;
  flex-basis: 66px;
}

.employee-avatar-wrap .employee-avatar {
  width: 100%;
  height: 100%;
  box-shadow: none;
}

.client-summary {
  position: relative;
  padding-right: 116px;
}

.client-summary-actions {
  position: absolute;
  top: 22px;
  right: 22px;
  display: inline-flex;
  gap: 10px;
}

.assigned-service-meta {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.assigned-service-meta p,
.assigned-service-footer {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.assigned-service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.assigned-services-widget {
  min-width: 0;
}

.assigned-services-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.assigned-services-list .client-service-card {
  min-width: 0;
  margin-bottom: 0 !important;
}

@media (max-width: 1100px) {
  .assigned-services-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .assigned-services-list {
    grid-template-columns: 1fr;
  }
}

.client-service-card {
  min-width: 0;
  margin-bottom: 24px;
  padding: 24px 28px 24px;
}

.client-service-card > div:first-child {
  align-items: flex-start;
  gap: 14px;
}

.service-checklist-workspace > h3,
.service-checklist-workspace > p {
  margin-bottom: 8px;
}

.service-checklist-section {
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.service-checklist-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: #111827;
  font-weight: 750;
  text-align: left;
}

.service-checklist-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.checklist-progress-head {
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.client-checklist-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.56);
}

.client-checklist-row p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.checklist-status-dot {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(36,87,255,.12);
  color: #2457ff;
  font-weight: 900;
}

.checkbox-multiselect {
  position: relative;
}

.checkbox-multiselect-trigger {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.selected-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(36, 87, 255, .12);
  color: #2457ff;
  font-size: 12px;
  font-weight: 750;
}

.selected-badge em {
  font-style: normal;
  cursor: pointer;
}

.checkbox-multiselect-menu {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 24px 64px rgba(15,23,42,.18);
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #111827;
  font-weight: 650;
}

.checkbox-option:hover {
  background: rgba(36,87,255,.08);
}

.task-detail-page .detail-grid-four {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.task-detail-page .detail-card {
  min-height: 112px;
}

.task-detail-page .detail-card span,
.task-detail-page .task-detail-side p,
.task-detail-page .document-row span {
  color: #64748b;
  font-size: 14px;
  font-weight: 650;
}

.task-detail-page .detail-card strong {
  display: block;
  margin-top: 10px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.task-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  gap: var(--app-section-gap, 16px);
  margin-bottom: var(--app-section-gap, 16px);
}

.task-meta-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--app-section-gap, 16px);
  margin-bottom: var(--app-section-gap, 16px);
  align-items: stretch;
}

.task-meta-cards > .detail-card {
  height: 100%;
}

.task-bottom-row,
.employee-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(280px, 35fr);
  gap: var(--app-section-gap, 16px);
  align-items: stretch;
  margin-bottom: var(--app-section-gap, 16px);
}

.task-detail-page .client-profile-hero {
  align-items: flex-start;
}

body[data-page="dashboard"] .layout.super-admin-layout .task-detail-page {
  gap: var(--app-section-gap, 16px) !important;
  min-width: 0;
}

.task-info-grid {
  margin-top: 0;
}

body[data-page="dashboard"] .layout.super-admin-layout .task-detail-page .task-information-heading {
  margin-bottom: 12px !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .task-detail-page .panel > h3,
body[data-page="dashboard"] .layout.super-admin-layout .task-detail-page .panel > .panel-head {
  margin-bottom: 12px !important;
}

.task-detail-page .info-grid {
  gap: 16px 20px;
  align-items: start;
}

.task-detail-page .info-field,
.task-detail-page .info-field strong {
  min-width: 0;
}

.task-detail-page .info-field strong {
  overflow-wrap: anywhere;
}

.task-assignment-card .assignment-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.assignment-select {
  width: 100%;
  min-height: 42px;
}

.task-schedule-card {
  margin-bottom: var(--app-section-gap, 16px);
}

.task-activity-scroll {
  max-height: 292px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.comments-scroll {
  max-height: 230px;
  overflow-y: auto;
  padding-right: 6px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-form > button {
  justify-self: start;
  width: auto;
  max-width: 200px;
}

.employee-information-card {
  margin-bottom: var(--app-section-gap, 16px);
}

.team-detail-page .module-toolbar {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.team-detail-page .team-profile-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.team-detail-page .team-profile-heading > div {
  min-width: 0;
}

.team-detail-page .team-profile-heading h3,
.team-detail-page .team-profile-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-detail-page .team-profile-heading .status-badge {
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
}

.team-detail-page .toolbar-actions {
  flex: 0 0 auto;
  width: auto !important;
  justify-content: flex-end !important;
  margin-left: auto;
}

.team-detail-page .info-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.task-detail-page .info-field .status-badge {
  width: fit-content;
}

.team-detail-page .info-field .status-badge {
  width: fit-content;
}

.team-detail-page .task-list-view.compact-task-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.team-detail-page .task-list-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .42);
}

.team-detail-page .task-list-main h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.team-detail-page .task-list-main {
  gap: 4px;
}

.team-detail-page .task-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: #53627a;
  font-size: 12px;
  font-weight: 650;
}

.team-detail-page .team-task-priority {
  border: 1px solid transparent;
}

.team-detail-page .team-task-priority.priority-low {
  color: #087f5b;
  background: #e7f8f2;
  border-color: rgba(8, 127, 91, .18);
}

.team-detail-page .team-task-priority.priority-medium {
  color: #1746d1;
  background: #e8efff;
  border-color: rgba(23, 70, 209, .18);
}

.team-detail-page .team-task-priority.priority-high {
  color: #b45309;
  background: #fff4df;
  border-color: rgba(180, 83, 9, .2);
}

.team-detail-page .team-task-priority.priority-critical {
  color: #c92a2a;
  background: #fff0f0;
  border-color: rgba(201, 42, 42, .2);
}

.employee-activity-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

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

.permission-card-header .h6 {
  min-width: 0;
  flex: 1 1 auto;
}

.permission-card-header .pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.team-detail-page .permission-matrix {
  align-items: stretch;
}

/* Only let this page's permission grid flex to auto-fit columns above the
   tablet breakpoint -- otherwise it overrides the shared responsive rules
   (2 columns tablet, 1 column mobile) required for the permission editor. */
@media (min-width: 1181px) {
  .team-detail-page .permission-matrix {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.team-detail-page .permission-group {
  min-width: 0;
}

.team-detail-page .permission-group .h6 {
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
  overflow-wrap: break-word;
}

.team-detail-page .permission-list {
  gap: 10px;
}

.team-detail-page .employee-activity-row {
  align-items: stretch;
}

.team-detail-page .employee-activity-row .panel {
  min-height: 100%;
}

@media (max-width: 720px) {
  .team-detail-page .module-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-detail-page .toolbar-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    margin-left: 0;
  }

  .team-detail-page .info-grid {
    grid-template-columns: 1fr;
  }
}

.service-workspace-grid {
  align-items: start;
}

.service-setting-row,
.service-price-row {
  min-height: 46px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.service-setting-row:last-child,
.service-price-row:last-child {
  border-bottom: 0;
}

.service-template-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.service-template-meta > div {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.service-template-meta span {
  font-size: 12px;
}

.service-template-meta strong {
  font-size: 17px;
  font-weight: 500;
}

.service-checklist-item {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: default;
}

.service-activity-scroll {
  max-height: 356px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.task-detail-main h3,
.task-detail-side h3,
.task-detail-layout .panel h3 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.task-detail-main h3:not(:first-child) {
  margin-top: 22px;
}

.task-detail-main p,
.task-detail-side p {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}

.document-list,
.checklist-list,
.compact-task-list {
  display: grid;
  gap: 10px;
}

.checklist-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 16px;
  background: rgba(255, 255, 255, .42);
}

.document-row,
.checklist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 14px;
  background: rgba(255, 255, 255, .42);
}

.checklist-row {
  justify-content: flex-start;
}

.checklist-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.checklist-row .toolbar-actions {
  margin-left: auto;
}

.checklist-dot {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(100, 116, 139, .12);
  color: #64748b;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s var(--app-ease), background .18s var(--app-ease), color .18s var(--app-ease);
}

.checklist-dot:hover {
  transform: translateY(-1px);
  background: rgba(36, 87, 255, .12);
  color: #2457ff;
}

.checklist-dot.done {
  background: rgba(36, 87, 255, .14);
  color: #2457ff;
}

@media (max-width: 720px) {
  .checklist-edit-form {
    grid-template-columns: 1fr;
  }
}

.task-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.compact-task-list .task-list-item {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 14px;
  background: rgba(255, 255, 255, .42);
}

.compact-task-list h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

@media (max-width: 980px) {
  .task-detail-layout {
    grid-template-columns: 1fr;
  }
  .info-grid,
  .task-meta-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .task-bottom-row,
  .employee-activity-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .info-grid,
  .task-meta-cards {
    grid-template-columns: 1fr;
  }
  .client-summary {
    padding-right: 0;
  }
  .client-summary-actions {
    position: static;
    margin-left: auto;
  }
  .client-checklist-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }
}

.notification-bell {
  position: relative;
  display: inline-flex;
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}

.notification-panel-head strong {
  display: block;
  color: #111827;
  font-size: 18px;
  font-weight: 750;
}

.notification-panel-head span,
.notification-note,
.notification-empty {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.notification-panel-head button,
.notification-view-all,
.notification-item-actions button {
  border: 0;
  background: transparent;
  color: #2457ff;
  font-size: 13px;
  font-weight: 750;
}

.notification-list {
  max-height: 270px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.notification-item-main {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #cbd5e1;
}

.notification-item.unread .notification-dot {
  background: #2457ff;
  box-shadow: 0 0 0 5px rgba(36, 87, 255, 0.12);
}

.notification-item strong,
.notification-item small,
.notification-item em {
  display: block;
}

.notification-item strong {
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

.notification-item small {
  margin-top: 3px;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.notification-item em {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.notification-item-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.notification-view-all {
  width: calc(100% - 36px);
  margin: 12px 18px 18px;
  padding: 12px 14px;
  border: 1px solid rgba(36, 87, 255, 0.26);
  border-radius: 14px;
  background: rgba(36, 87, 255, 0.08);
}

.notification-note,
.notification-empty {
  padding: 14px 18px;
}

.my-profile-page {
  display: grid;
  gap: 18px;
}

.profile-alert {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
}

.profile-alert.success {
  border: 1px solid rgba(20, 184, 166, 0.22);
  background: rgba(240, 253, 250, 0.72);
  color: #0f766e;
}

.profile-alert.error {
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(254, 242, 242, 0.72);
  color: #b91c1c;
}

.profile-summary-card,
.profile-section {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 18px 54px rgba(31, 64, 128, 0.08);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.profile-summary-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 24px;
}

.profile-avatar-block {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.profile-avatar-xl {
  display: inline-flex;
  width: 96px;
  height: 96px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: #2457ff;
  color: #fff;
  box-shadow: 0 16px 36px rgba(36, 87, 255, 0.18);
  font-size: 28px;
  font-weight: 850;
}

.profile-avatar-xl img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-actions,
.profile-summary-actions,
.profile-contact-actions,
.profile-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-summary-actions {
  position: absolute;
  top: 18px;
  right: 18px;
}

.profile-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  color: #2457ff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-summary-copy h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 750;
  letter-spacing: 0;
}

.profile-summary-copy p {
  margin: 8px 0 12px;
  color: #64748b;
  font-size: 15px;
  font-weight: 600;
}

.profile-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}

.profile-contact-actions a {
  display: inline-flex;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(36, 87, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: #2457ff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.profile-contact-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.profile-contact-actions a:hover {
  background: #2457ff;
  color: #fff;
  transform: translateY(-1px);
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-section {
  padding: 22px;
}

.profile-section:nth-last-child(-n + 2),
.profile-section:has(.profile-security-grid) {
  grid-column: 1 / -1;
}

.profile-secondary-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.profile-secondary-row .profile-section {
  grid-column: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.profile-secondary-row .profile-section .profile-activity-list {
  flex: 1;
  max-height: none;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-section h2,
.profile-password-card h3 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
}

.profile-form-grid,
.profile-security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-field {
  display: grid;
  gap: 7px;
}

.profile-field span {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.profile-readonly {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

.profile-security-card,
.profile-password-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.profile-security-card strong {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

.profile-security-card p,
.profile-security-card small {
  display: block;
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.profile-password-card {
  margin-top: 0;
}

.profile-password-card .btn {
  margin-top: 14px;
}

.permissions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-chip {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid rgba(36, 87, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #2457ff;
  font-size: 13px;
  font-weight: 750;
}

.profile-activity-list {
  display: grid;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap .form-control {
  padding-right: 48px;
}

.password-input-wrap .password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #2457ff;
  transform: translateY(-50%);
}

.password-input-wrap .password-toggle:hover {
  background: rgba(36, 87, 255, 0.08);
}

.profile-activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.profile-activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #2457ff;
  box-shadow: 0 0 0 5px rgba(36, 87, 255, 0.12);
}

.profile-activity-item strong {
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

.profile-activity-item p,
.profile-activity-item small {
  display: block;
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.profile-save-actions {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  justify-content: flex-end;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

@media (max-width: 1000px) {
  .profile-summary-card,
  .profile-layout,
  .profile-form-grid,
  .profile-secondary-row,
  .profile-security-grid {
    grid-template-columns: 1fr;
  }

  .profile-section,
  .profile-section:has(.profile-security-grid) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .notification-panel {
    width: calc(100vw - 24px) !important;
    left: 12px !important;
    right: 12px !important;
  }

  .profile-summary-card {
    padding: 18px;
  }
}

/* Shared statistics layout: card visuals stay unchanged; only the parent grid
   controls equal-width rows for 3, 4, 5, or 6 metric cards. */
.crm-stats-grid,
body[data-page="dashboard"] .page-content > .module-page .crm-stats-grid,
body[data-page="dashboard"] .app-page-container > .module-page .crm-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--crm-stat-count, 5), minmax(0, 1fr)) !important;
  gap: var(--app-page-gap, 18px) !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
}

@media (max-width: 1199px) {
  .crm-stats-grid,
  body[data-page="dashboard"] .page-content > .module-page .crm-stats-grid,
  body[data-page="dashboard"] .app-page-container > .module-page .crm-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .crm-stats-grid,
  body[data-page="dashboard"] .page-content > .module-page .crm-stats-grid,
  body[data-page="dashboard"] .app-page-container > .module-page .crm-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Shared CRM visual system. The Super Admin dashboard keeps its own reference
   styles; internal modules inherit these tokens for matching typography/cards. */
body[data-page="dashboard"] .module-page {
  --crm-widget-title-size: 18px;
  --crm-widget-title-weight: 600;
  --crm-widget-title-line: 1.3;
  --crm-widget-title-color: #111827;
  --crm-widget-title-spacing: 0;
  --crm-widget-pad: 18px;
  --crm-widget-radius: 22px;
  --crm-widget-border: rgba(255, 255, 255, 0.72);
  --crm-widget-bg: rgba(255, 255, 255, 0.46);
  --crm-widget-shadow: 0 18px 54px rgba(31, 64, 128, 0.08);
}

body[data-page="dashboard"] .module-page .panel,
body[data-page="dashboard"] .module-page .dashboard-card,
body[data-page="dashboard"] .module-page .data-table-card,
body[data-page="dashboard"] .module-page .crm-table-card,
body[data-page="dashboard"] .module-page .module-toolbar,
body[data-page="dashboard"] .module-page .empty-module,
body[data-page="dashboard"] .module-page .loading-panel,
body[data-page="dashboard"] .module-page .error-state,
body[data-page="dashboard"] .module-page .team-profile-card,
body[data-page="dashboard"] .module-page .service-card,
body[data-page="dashboard"] .module-page .service-detail-hero,
body[data-page="dashboard"] .module-page .form-summary-card,
body[data-page="dashboard"] .module-page .create-form-section,
body[data-page="dashboard"] .module-page .profile-section,
body[data-page="dashboard"] .module-page .profile-summary-card {
  border: 1px solid var(--crm-widget-border) !important;
  border-radius: var(--crm-widget-radius) !important;
  background: var(--crm-widget-bg) !important;
  box-shadow: var(--crm-widget-shadow) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

body[data-page="dashboard"] .module-page .panel h2,
body[data-page="dashboard"] .module-page .panel h3,
body[data-page="dashboard"] .module-page .dashboard-card h2,
body[data-page="dashboard"] .module-page .dashboard-card h3,
body[data-page="dashboard"] .module-page .data-table-card h2,
body[data-page="dashboard"] .module-page .data-table-card h3,
body[data-page="dashboard"] .module-page .crm-table-card h2,
body[data-page="dashboard"] .module-page .crm-table-card h3,
body[data-page="dashboard"] .module-page .module-toolbar h2,
body[data-page="dashboard"] .module-page .module-toolbar h3,
body[data-page="dashboard"] .module-page .sa-ref-panel-head h3,
body[data-page="dashboard"] .module-page .form-summary-card h3,
body[data-page="dashboard"] .module-page .profile-section h2 {
  margin: 0 !important;
  color: var(--crm-widget-title-color) !important;
  font-size: var(--crm-widget-title-size) !important;
  font-weight: var(--crm-widget-title-weight) !important;
  line-height: var(--crm-widget-title-line) !important;
  letter-spacing: var(--crm-widget-title-spacing) !important;
  text-transform: none !important;
}

body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-panel h3,
body[data-page="dashboard"] .sa-reference-dashboard .sa-ref-panel-head h3,
body[data-page="dashboard"] .module-page .widget-title,
body[data-page="dashboard"] .module-page .card-title,
body[data-page="dashboard"] .module-page .section-title,
body[data-page="dashboard"] .module-page .table-title,
body[data-page="dashboard"] .module-page .toolbar-title {
  font-size: var(--crm-widget-title-size) !important;
  font-weight: var(--crm-widget-title-weight) !important;
  letter-spacing: 0 !important;
  line-height: 1.3 !important;
  margin-bottom: 0px !important;
}

body[data-page="dashboard"] .module-page .panel h3 + p,
body[data-page="dashboard"] .module-page .panel-head h3 + p {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
}

body[data-page="dashboard"] .module-page .summary-card.crm-stat-card,
body[data-page="dashboard"] .module-page .metric.crm-stat-card,
body[data-page="dashboard"] .module-page article.crm-stat-card {
  min-height: 100px !important;
  padding: var(--crm-card-pad) !important;
}

body[data-page="dashboard"] .module-page .crm-stat-icon,
body[data-page="dashboard"] .module-page .summary-icon.crm-stat-icon,
body[data-page="dashboard"] .module-page .metric-icon.crm-stat-icon {
  width: 40px !important;
  height: 40px !important;
  flex: 0 0 40px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 30% !important;
  background: #2457ff !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] .module-page .crm-stat-icon svg,
body[data-page="dashboard"] .module-page .summary-icon.crm-stat-icon svg,
body[data-page="dashboard"] .module-page .metric-icon.crm-stat-icon svg {
  width: 16px !important;
  height: 16px !important;
  color: #ffffff !important;
  stroke: currentColor !important;
}

body[data-page="dashboard"] .summary-card span,
body[data-page="dashboard"] .crm-stat-card .metric-label,
body[data-page="dashboard"] .stat-card .metric-label,
body[data-page="dashboard"] .metric .metric-label,
body[data-page="dashboard"] .sa-ref-metric p,
body[data-page="dashboard"] .module-page .crm-stat-label,
body[data-page="dashboard"] .module-page .metric-label.crm-stat-label,
body[data-page="dashboard"] .module-page .summary-card .crm-stat-label {
  margin: 0 !important;
  color: #252525 !important;
  font-size: var(--crm-stat-label-size) !important;
  font-weight: var(--crm-stat-label-weight) !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body[data-page="dashboard"] .module-page .crm-stat-value,
body[data-page="dashboard"] .module-page .value.crm-stat-value,
body[data-page="dashboard"] .module-page .summary-card .crm-stat-value {
  margin-top: 6px !important;
  color: #111827 !important;
  font-size: var(--crm-stat-value-size) !important;
  font-weight: var(--crm-stat-value-weight) !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

body[data-page="dashboard"] .module-page .summary-card strong,
body[data-page="dashboard"] .module-page .metric .value,
body[data-page="dashboard"] .module-page .stat-card .value,
body[data-page="dashboard"] .module-page .metric-value,
body[data-page="dashboard"] .module-page .team-info-card strong,
body[data-page="dashboard"] .module-page .service-template-meta strong,
body[data-page="dashboard"] .module-page .profile-summary-value,
body[data-page="dashboard"] .module-page .analytics-value,
body[data-page="dashboard"] .module-page .count-value {
  font-size: var(--crm-stat-value-size) !important;
  font-weight: var(--crm-stat-value-weight) !important;
}

body[data-page="dashboard"] .module-page .form-summary-row strong {
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.4;
}

.sa-reference-dashboard .sa-ref-metric-icon {
  width: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  flex: 0 0 40px !important;
  border-radius: 30% !important;
}

.sa-reference-dashboard .sa-ref-metric .side-svg {
  width: 16px !important;
  height: 16px !important;
}

/* Team member detail final UI guard: keep the profile hero horizontal on desktop
   even when older responsive toolbar rules are active. */
body[data-page="dashboard"] .team-detail-page > .module-toolbar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

body[data-page="dashboard"] .team-detail-page > .module-toolbar .team-profile-heading {
  flex: 1 1 auto !important;
  justify-content: flex-start !important;
}

body[data-page="dashboard"] .team-detail-page > .module-toolbar .toolbar-actions {
  width: auto !important;
  flex: 0 0 auto !important;
  justify-content: flex-end !important;
  margin-left: auto !important;
}

@media (max-width: 720px) {
  body[data-page="dashboard"] .team-detail-page > .module-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  body[data-page="dashboard"] .team-detail-page > .module-toolbar .toolbar-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }
}

/* Global widget rhythm -- kept at 0 because every container that renders these
   widgets already spaces its children with its own grid/flex `gap` (module-page,
   sa-dashboard, task-kanban-board, service-card-grid, etc.); a non-zero value here
   stacks an extra margin on top of that gap and inflates vertical spacing beyond
   the matching horizontal gap. */
:root {
  --crm-widget-bottom-space: 0px;
}

:where(
  .panel,
  .dashboard-card,
  .summary-card,
  .crm-stat-card,
  .data-table-card,
  .crm-table-card,
  .module-toolbar,
  .empty-module,
  .loading-panel,
  .error-state,
  .service-card,
  .team-profile-card,
  .form-summary-card,
  .profile-section,
  .profile-summary-card,
  .sa-ref-panel,
  .sa-ref-metric,
  .task-kanban-column,
  .task-list-item,
  .client-service-card,
  .client-document-card,
  .service-detail-hero,
  .service-workspace-card,
  .priority-task-card
) {
  margin-bottom: var(--crm-widget-bottom-space) !important;
}
/* Billing invoice workflow */
.create-invoice-page,
.invoice-detail-page,
.billing-revenue-page {
  width: 100%;
}

.invoice-create-hero {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: var(--crm-widget-bottom-space, 18px);
	padding: 22px 2px;
}

.invoice-create-hero h2 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0;
  margin: 0 0 4px;
}

.invoice-create-hero p {
  color: var(--app-muted);
  margin: 0;
}

.invoice-create-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 35%);
}

.create-invoice-grid {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.create-invoice-grid > * {
  min-width: 0;
}

.invoice-information,
.client-information,
.payment-information,
.notes-terms {
  grid-column: span 1;
}

.selected-services,
.invoice-create-actions {
  grid-column: 1 / -1;
}

.invoice-form-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.invoice-form-panel,
.invoice-preview-card,
.invoice-summary-card {
  margin-bottom: 0;
}

.invoice-form-panel h3,
.invoice-preview-card h3,
.invoice-summary-card h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 14px;
}

.invoice-form-panel > .panel-head h3,
.invoice-preview-card > .panel-head h3,
.invoice-summary-card > .panel-head h3 {
  margin-bottom: 0;
}

.profile-field-wide {
  grid-column: 1 / -1;
}

.invoice-signature-field {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(15, 23, 42, 0.09);
}

.invoice-signature-field-copy {
  display: grid;
  gap: 4px;
}

.invoice-signature-field-copy strong {
  color: #101828;
  font-size: 13px;
  font-weight: 700;
}

.invoice-signature-field-copy span {
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.invoice-signature-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.invoice-signature-upload {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 100%;
  min-height: 142px;
  padding: 24px;
  border: 1px solid rgba(71, 84, 103, 0.18);
  border-radius: 14px;
  color: #344054;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.invoice-signature-upload:hover,
.invoice-signature-upload:focus-visible {
  border-color: rgba(37, 87, 245, 0.42);
  outline: none;
  background: rgba(247, 249, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(37, 87, 245, 0.08);
}

.invoice-signature-upload-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #2457f5;
  background: rgba(36, 87, 245, 0.08);
}

.invoice-signature-upload-icon svg {
  width: 17px;
  height: 17px;
}

.invoice-signature-upload strong {
  font-size: 13px;
  font-weight: 650;
}

.invoice-signature-upload small {
  color: #667085;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.invoice-signature-preview {
  display: grid;
  min-height: 142px;
  place-items: center;
  padding: 18px 20px 12px;
  border: 1px solid rgba(71, 84, 103, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.invoice-signature-preview img {
  display: block;
  width: auto;
  max-width: min(300px, 100%);
  height: auto;
  max-height: 88px;
  object-fit: contain;
}

.invoice-signature-preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 100%;
  margin-top: 10px;
}

.invoice-signature-preview-actions .danger {
  color: #dc2626;
}

.invoice-service-editor .panel-head {
  margin-bottom: 14px;
}

/* Dedicated horizontal-scroll container for the Selected Services table --
   the table gets a comfortable min-width instead of being squeezed to fit
   100% (which previously made overflow impossible), so narrow viewports
   scroll the table instead of crushing every column unreadably. */
.invoice-line-items-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.invoice-service-table {
  max-width: 100%;
}

/* Item | Amount | Action -- no per-line discount or tax columns (see the
   invoice tax/discount refactor, item 8). Narrower min-width than the old
   7-column layout since there's far less to fit. */
.invoice-service-table table {
  min-width: 420px;
  table-layout: auto;
  width: 100%;
}

.invoice-service-table th:nth-child(1),
.invoice-service-table td:nth-child(1) {
  width: 56%;
}

.invoice-service-table th:nth-child(2),
.invoice-service-table td:nth-child(2) {
  width: 28%;
}

.invoice-service-table th:nth-child(3),
.invoice-service-table td:nth-child(3) {
  text-align: center;
  width: 16%;
}

.invoice-service-select {
  width: 100%;
  min-width: 160px;
}

.invoice-service-table .form-control {
  min-height: 38px;
  padding: 8px 10px;
}

.invoice-number-input {
  max-width: 96px;
}

.invoice-service-name {
  width: 100%;
}

.action-menu button.danger {
  color: #ef4444;
}

.action-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.invoice-summary-sticky {
  position: sticky;
  top: 18px;
}

.create-invoice-grid .invoice-summary-card {
  height: 100%;
}

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

.invoice-total-list > div {
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
}

.invoice-total-list span,
.invoice-summary-meta span,
.invoice-preview-grid span {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 600;
}

.invoice-grand-total strong {
  color: var(--app-blue);
  font-size: 22px;
}

.invoice-summary-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  padding-top: 12px;
}

.invoice-summary-meta span {
  white-space: nowrap;
}

/* Values (Client / Due Date / Selected Services) get their own column that
   fills the remaining width and right-aligns -- a long client name wraps
   within that column instead of overflowing or dragging the layout
   left-heavy, and normal weight keeps them from reading as bold/heavy like
   the money summary's totals above. */
.invoice-summary-meta strong {
  font-weight: 400;
  text-align: right;
  justify-self: end;
}

.invoice-preview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.invoice-preview-grid p {
  color: var(--app-muted);
  margin: 4px 0 0;
}

.invoice-preview-lines {
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.invoice-preview-lines > div,
.invoice-preview-total {
  display: flex;
  justify-content: space-between;
}

.invoice-preview-total {
  border-top: 1px solid rgba(17, 24, 39, 0.12);
  margin-top: 14px;
  padding-top: 14px;
}

.invoice-preview-total strong {
  color: var(--app-blue);
  font-size: 22px;
}

.invoice-create-actions {
  align-items: center;
  justify-content: flex-end;
}

.creatable-country-select {
  position: relative;
}

.invoice-preview-modal {
  align-items: center;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow: hidden;
  padding: 32px;
  position: fixed;
  z-index: 5000;
}

.invoice-preview-shell {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  max-width: 940px;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.invoice-preview-toolbar {
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  flex: 0 0 auto;
}

.invoice-preview-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.invoice-preview-document {
  background: #eef4ff;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px;
}

.classic-invoice-template {
  background: #fff;
  color: #111827;
  font-family: Inter, Arial, sans-serif;
  line-height: 1.45;
  margin: 0 auto;
  max-width: 794px;
  min-height: 1123px;
  padding: 54px 58px;
}

.classic-invoice-template p,
.classic-invoice-template h1,
.classic-invoice-template h2,
.classic-invoice-template h3,
.classic-invoice-template h4 {
  margin: 0;
}

.classic-invoice-header {
  align-items: flex-start;
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr auto;
  padding-bottom: 28px;
}

.classic-invoice-logo {
  align-items: center;
  display: inline-flex;
  margin-bottom: 14px;
}

.classic-invoice-logo img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.classic-company-block h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.classic-company-block p,
.classic-bill-to p,
.classic-invoice-footer p {
  color: #4b5563;
  font-size: 12px;
}

.classic-invoice-title {
  min-width: 210px;
  text-align: right;
  padding-top: 4px;
}

.classic-invoice-title p {
  color: #24245f;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin: 0 0 12px;
}

.classic-invoice-title span {
  color: #4b5563;
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.classic-bill-to {
  border-top: 1px solid #d9dee8;
  padding: 22px 0 28px;
}

.classic-bill-to h3 {
  color: #24245f;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.classic-bill-to strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.classic-invoice-table {
  border-collapse: collapse;
  width: 100%;
}

.classic-invoice-table th {
  background: #24245f;
  color: #fff;
  font-size: 12px;
  padding: 14px 12px;
  text-align: left;
}

/* body[data-page="dashboard"] prefix + !important: a broad dashboard-wide
   rule (last table column = Action, centered + squeezed to ~80px + nowrap,
   itself !important) otherwise wins this specificity fight now that Amount
   is the invoice table's last column too -- see item 11 of the invoice
   tax/discount refactor. The prefix covers Preview/PDF/Print alike since all
   three render under the real document body (portal or detached container),
   which keeps the data-page attribute regardless. Scoped to this one table. */
body[data-page="dashboard"] .classic-invoice-table th:not(:first-child),
body[data-page="dashboard"] .classic-invoice-table td:not(:first-child) {
  text-align: right !important;
  width: auto !important;
  max-width: none !important;
  white-space: normal !important;
}

.classic-invoice-table td {
  border-bottom: 1px solid #d9dee8;
  font-size: 12px;
  padding: 16px 12px;
  vertical-align: top;
}

.classic-invoice-table td strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.classic-invoice-table td span {
  color: #6b7280;
  display: block;
  font-size: 11px;
}

/* Totals uses the full content width instead of a narrow right-hand column --
   there is no left-hand sibling to balance against any more (Notes was
   removed from this document, see ClassicInvoiceTemplate), so a fixed
   max-width here just left the left half of the page empty. */
.classic-invoice-lower {
  padding-top: 28px;
}

.classic-totals {
  display: grid;
  width: 100%;
}

.classic-totals-group {
  display: grid;
}

.classic-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 2px;
  border-bottom: 1px solid #e5e9f2;
}

.classic-totals-group .classic-totals-row:last-child {
  border-bottom: none;
}

.classic-totals-row span {
  color: #4b5563;
  font-size: 12.5px;
  font-weight: 600;
}

.classic-totals-row strong {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.classic-grand-total {
  background: #24245f;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 10px;
  border-bottom: none;
}

.classic-grand-total span,
.classic-grand-total strong {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

/* Keeps Balance Due / Payment Status visually distinct from Grand Total
   instead of reading as one continuous list. */
.classic-totals-status {
  padding-top: 6px;
  border-top: 1px solid #d9dee8;
}

.classic-payment-details {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #d9dee8;
}

.classic-payment-details h3 {
  margin: 0 0 8px;
  color: #24245f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.classic-payment-details-list {
  display: grid;
  gap: 6px 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.classic-payment-detail {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.classic-payment-details-list span {
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 600;
}

.classic-payment-details-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 11px;
  font-weight: 650;
}

@media (max-width: 640px) {
  .classic-payment-details-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.classic-signature {
  display: grid;
  justify-items: end;
  width: 100%;
  margin-top: 20px;
}

.classic-signature img {
  display: block;
  width: auto;
  max-width: 190px;
  height: auto;
  max-height: 76px;
  object-fit: contain;
}

.classic-signature span {
  min-width: 190px;
  margin-top: 5px;
  padding-top: 6px;
  border-top: 1px solid #98a2b3;
  color: #475467;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
}

.classic-thanks {
  color: #24245f;
  font-size: 14px;
  font-weight: 700;
  margin-top: 44px !important;
}

.classic-payment-details + .classic-thanks,
.classic-signature + .classic-thanks {
  margin-top: 16px !important;
}

.classic-invoice-footer {
  border-top: 1px solid #d9dee8;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 34px;
  padding-top: 18px;
}

.classic-invoice-footer h4 {
  color: #24245f;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* CRM-only widget shown below the invoice preview -- never part of
   .classic-invoice-template, so it's excluded from print/PDF automatically. */
.payment-instructions-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 4px;
}

.payment-instructions-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-instructions-row span {
  color: var(--app-muted, #66738b);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.payment-instructions-row strong {
  font-size: 14px;
  font-weight: 600;
}

.billing-table td,
.billing-table th {
  white-space: nowrap;
}

/* Select-all / row checkbox column -- compact, doesn't widen the table or
   disturb its existing column set (Invoice ID/Client/.../Action stay as-is). */
.table-checkbox-cell {
  width: 36px;
  padding-right: 4px !important;
  padding-left: 16px !important;
  text-align: center;
}

.table-row-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--app-primary, #2563eb);
  cursor: pointer;
}

.billing-table tr.row-selected {
  background: rgba(37, 99, 235, 0.05);
}

/* Contextual bulk-action strip -- only rendered while at least one row is
   selected, sits between the toolbar and the table. */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--app-text);
  font-size: 13.5px;
  font-weight: 600;
}

.service-checklist-modal {
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.38);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow-y: auto;
  padding: 32px;
  position: fixed;
  z-index: 5200;
}

.service-checklist-modal-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  max-width: 840px;
  padding: 22px;
  width: min(840px, 100%);
}

.service-checklist-modal-panel .modal-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.service-checklist-modal-panel h2 {
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 4px;
}

.service-checklist-modal-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

@media (max-width: 1180px) {
  .invoice-create-layout {
    grid-template-columns: 1fr;
  }

  .invoice-summary-sticky {
    position: static;
  }
}

@media (max-width: 760px) {
  .create-invoice-grid {
    grid-template-columns: 1fr;
  }

  .invoice-information,
  .client-information,
  .payment-information,
  .notes-terms,
  .selected-services,
  .invoice-create-actions {
    grid-column: 1 / -1;
  }

  .invoice-service-table table,
  .invoice-service-table thead,
  .invoice-service-table tbody,
  .invoice-service-table tr,
  .invoice-service-table td {
    display: block;
    width: 100% !important;
  }

  .invoice-service-table thead {
    display: none;
  }

  .invoice-service-table tbody tr {
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 18px;
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
  }

  .invoice-service-table td {
    border: 0;
    padding: 0;
  }

  .invoice-service-table td::before {
    color: var(--app-muted);
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .invoice-service-table td:last-child {
    text-align: left;
  }
}

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

  .create-invoice-grid > * {
    grid-column: 1 / -1;
  }

  .classic-invoice-header,
  .classic-invoice-footer {
    grid-template-columns: 1fr;
  }

  .classic-invoice-title {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .invoice-create-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .invoice-preview-grid {
    grid-template-columns: 1fr;
  }

  .invoice-preview-modal {
    padding: 16px;
  }

  .invoice-preview-shell {
    height: calc(100dvh - 32px);
    max-height: calc(100dvh - 32px);
  }

  .classic-invoice-template {
    padding: 32px 24px;
  }
}

@media print {
  .invoice-preview-toolbar {
    display: none !important;
  }

  .invoice-preview-modal,
  .invoice-preview-shell,
  .invoice-preview-document {
    background: #fff !important;
    box-shadow: none !important;
    inset: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    position: static !important;
  }

  .invoice-preview-shell {
    height: auto !important;
    max-height: none !important;
  }
}

/* Employee profile and global action consistency */
body[data-page="dashboard"] .layout .side-link,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-link {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
}

body[data-page="dashboard"] .layout .side-menu,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-menu {
  gap: 6px !important;
}

/* Global sidebar spacing/scroll contract.
   Keep every role in the same compact top-to-bottom menu flow. */
body[data-page="dashboard"] .layout .sidebar,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar,
.layout .sidebar,
.layout:has(.sa-dashboard) .sidebar {
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
}

body[data-page="dashboard"] .layout .brand-lockup,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .brand-lockup,
.layout .brand-lockup,
.layout:has(.sa-dashboard) .brand-lockup {
  flex: 0 0 auto !important;
}

body[data-page="dashboard"] .layout .sidebar-scroll,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar-scroll,
.layout .sidebar-scroll,
.layout:has(.sa-dashboard) .sidebar-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 18px 0 14px !important;
  margin: 0 !important;
}

body[data-page="dashboard"] .layout .side-menu-label,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-menu-label,
.layout .side-menu-label,
.layout:has(.sa-dashboard) .side-menu-label {
  flex: 0 0 auto !important;
  margin: 0 0 10px !important;
}

body[data-page="dashboard"] .layout .side-menu,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-menu,
.layout .side-menu,
.layout:has(.sa-dashboard) .side-menu {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-content: stretch !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 0 8px 12px 0 !important;
  margin: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
}

body[data-page="dashboard"] .layout .side-link,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-link,
.layout .side-link,
.layout:has(.sa-dashboard) .side-link {
  flex: 0 0 44px !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 14px !important;
  margin: 0 0 10px !important;
  border-radius: 14px !important;
  line-height: 1.2 !important;
}

body[data-page="dashboard"] .layout .side-link:last-child,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-link:last-child,
.layout .side-link:last-child,
.layout:has(.sa-dashboard) .side-link:last-child {
  margin-bottom: 0 !important;
}

body[data-page="dashboard"] .layout .side-link .side-icon,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-link .side-icon,
.layout .side-link .side-icon,
.layout:has(.sa-dashboard) .side-link .side-icon {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px !important;
}

body[data-page="dashboard"] .layout .side-link .side-svg,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-link .side-svg,
.layout .side-link .side-svg,
.layout:has(.sa-dashboard) .side-link .side-svg {
  width: 20px !important;
  height: 20px !important;
}

body[data-page="dashboard"] .layout .side-badge,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .side-badge,
.layout .side-badge,
.layout:has(.sa-dashboard) .side-badge {
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

body[data-page="dashboard"] .layout .sidebar.collapsed .side-menu,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar.collapsed .side-menu,
.layout .sidebar.collapsed .side-menu,
.layout:has(.sa-dashboard) .sidebar.collapsed .side-menu {
  gap: 0 !important;
  padding-right: 0 !important;
}

body[data-page="dashboard"] .layout .sidebar.collapsed .side-link,
body[data-page="dashboard"] .layout:has(.sa-dashboard) .sidebar.collapsed .side-link,
.layout .sidebar.collapsed .side-link,
.layout:has(.sa-dashboard) .sidebar.collapsed .side-link {
  flex-basis: 44px !important;
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  justify-content: center !important;
  padding: 0 !important;
}

body[data-page="dashboard"] .table-action-trigger {
  width: 36px !important;
  height: 36px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  font-size: 16px !important;
}

body[data-page="dashboard"] .premium-table th:last-child,
body[data-page="dashboard"] .premium-table td:last-child,
body[data-page="dashboard"] .table th:last-child,
body[data-page="dashboard"] .table td:last-child {
  width: 72px !important;
  max-width: 80px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

body[data-page="dashboard"] .table-action-menu,
body[data-page="dashboard"] .team-action-dropdown,
body[data-page="dashboard"] .client-action-dropdown,
body[data-page="dashboard"] .action-dropdown {
  align-items: center !important;
  justify-content: center !important;
}

/* Task client context */
.client-context-panel {
  margin-bottom: 18px;
}

.client-context-panel .panel-head {
  align-items: flex-start;
  gap: 16px;
}

.client-context-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.client-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.client-context-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 16px;
  background: rgba(255, 255, 255, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.client-context-grid span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.client-context-grid strong {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-management-page .client-context-panel {
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .client-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .client-context-panel .panel-head {
    flex-direction: column;
  }

  .client-context-actions {
    justify-content: flex-start;
  }

  .client-context-grid {
    grid-template-columns: 1fr;
  }
}

.employee-dashboard {
  --employee-chart-blue: #2457ff;
  --employee-chart-purple: #7c3aed;
}

.employee-dashboard > .crm-stats-grid {
  margin-bottom: 18px;
}

.employee-dashboard-intro,
.employee-secondary-insights,
.employee-dashboard-panel {
  margin-bottom: 18px;
}

.employee-dashboard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.employee-dashboard-intro h2 {
  margin: 0 0 4px;
  color: #111827;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.12;
}

.employee-dashboard-intro p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
}

.employee-dashboard-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 180px;
}

.employee-secondary-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 18px;
}

.employee-secondary-insights div,
.employee-workload-grid div {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.36);
  padding: 14px;
}

.employee-secondary-insights span,
.employee-workload-grid span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.employee-secondary-insights strong,
.employee-workload-grid strong {
  color: #111827;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.1;
}

.employee-task-charts,
.employee-task-trend-row,
.employee-task-info-row,
.employee-task-bottom-row {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.employee-task-charts,
.employee-task-trend-row,
.employee-task-bottom-row {
  grid-template-columns: minmax(0, 65fr) minmax(300px, 35fr);
}

.employee-task-info-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.employee-dashboard-panel {
  min-width: 0;
  padding: 22px 24px;
}

.employee-dashboard-panel .sa-ref-panel-head {
  margin-bottom: 14px;
}

.employee-status-chart {
  display: grid;
  gap: 12px;
}

.employee-status-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(140px, 1fr) 40px;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 0;
  color: #111827;
  text-align: left;
  cursor: pointer;
}

.employee-status-row span {
  overflow: hidden;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-status-row i {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 87, 255, 0.12);
}

.employee-status-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2457ff, #7ba5ff);
}

.employee-status-row strong {
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.employee-priority-chart {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(150px, 1fr);
  align-items: center;
  gap: 16px;
}

.employee-priority-chart svg,
.employee-trend-chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.employee-priority-chart text {
  fill: #111827;
  font-size: 22px;
  font-weight: 500;
}

.employee-priority-chart .employee-chart-caption {
  fill: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.employee-priority-legend,
.employee-chart-legend {
  display: grid;
  gap: 10px;
}

.employee-priority-legend button,
.employee-chart-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.employee-priority-legend i,
.employee-chart-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
}

.employee-priority-legend strong {
  margin-left: auto;
  color: #111827;
  font-weight: 500;
}

.employee-trend-chart {
  display: grid;
  gap: 8px;
}

.employee-trend-chart text {
  fill: #64748b;
}

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

.employee-workload-grid div:last-child {
  grid-column: 1 / -1;
}

.employee-widget-list,
.employee-activity-list {
  display: grid;
  gap: 12px;
}

.employee-widget-list.compact-scroll,
.employee-activity-list.compact-scroll {
  max-height: 310px;
  overflow-y: auto;
  padding-right: 8px;
}

.employee-task-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.38);
  padding: 14px;
  color: #111827;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.employee-task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 87, 255, 0.28);
  background: rgba(255, 255, 255, 0.52);
}

.employee-task-card strong {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}

.employee-task-card span,
.employee-task-card small {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.employee-task-card div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.employee-task-card.attention {
  border-color: rgba(245, 158, 11, 0.32);
}

.employee-activity-list button {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: transparent;
  padding: 10px 0;
  text-align: left;
}

.employee-activity-list button:last-child {
  border-bottom: 0;
}

.employee-activity-list i {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #2457ff;
  box-shadow: 0 0 0 4px rgba(36, 87, 255, 0.1);
}

.employee-activity-list strong,
.employee-activity-list small {
  display: block;
}

.employee-activity-list strong {
  color: #111827;
  font-size: 14px;
  font-weight: 650;
}

.employee-activity-list small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.employee-task-table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.employee-task-table td strong,
.employee-task-table td small {
  display: block;
}

.employee-task-table td small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.employee-error-state {
  margin-bottom: 18px;
}

/* Employee dashboard UI refinement */
body[data-page="dashboard"] .employee-dashboard .employee-dashboard-intro.sa-ref-panel {
  min-height: 0 !important;
  height: auto !important;
  padding: 20px 24px !important;
  align-items: center !important;
}

body[data-page="dashboard"] .employee-dashboard .employee-secondary-insights.sa-ref-panel {
  min-height: 0 !important;
  height: auto !important;
  padding: 12px !important;
}

.employee-insight-card {
  min-height: 142px;
  display: grid;
  grid-template-rows: auto minmax(54px, 1fr);
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.36);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.employee-insight-copy {
  display: grid;
  gap: 4px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.employee-insight-sparkline {
  width: 100%;
  height: 58px;
  align-self: end;
  color: #2457ff;
  opacity: 0.96;
}

.employee-insight-card.red .employee-insight-sparkline { color: #ef4444; }
.employee-insight-card.orange .employee-insight-sparkline { color: #f97316; }
.employee-insight-card.green .employee-insight-sparkline { color: #16a34a; }
.employee-insight-card.blue .employee-insight-sparkline { color: #2457ff; }

.employee-insight-sparkline polyline {
  filter: drop-shadow(0 8px 10px rgba(36, 87, 255, 0.12));
}

.employee-axis-line {
  stroke: rgba(15, 23, 42, 0.18);
  stroke-width: 1.25;
}

.employee-axis-grid {
  stroke: rgba(15, 23, 42, 0.08);
  stroke-width: 1;
}

.employee-axis-label {
  fill: #64748b !important;
  font-size: 11px;
  font-weight: 600;
}

.employee-axis-title {
  fill: #475569 !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.employee-task-table th:nth-child(1),
.employee-task-table td:nth-child(1) {
  width: 42%;
}

.employee-task-table th:nth-child(2),
.employee-task-table td:nth-child(2) {
  width: 30%;
}

.employee-task-table th:nth-child(3),
.employee-task-table td:nth-child(3) {
  width: 18%;
}

.employee-task-table th:nth-child(4),
.employee-task-table td:nth-child(4) {
  width: 10%;
  text-align: center;
}

@media (max-width: 1180px) {
  .employee-task-charts,
  .employee-task-trend-row,
  .employee-task-bottom-row,
  .employee-task-info-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .employee-dashboard-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .employee-dashboard-filters,
  .employee-dashboard-filters .app-select {
    width: 100%;
  }

  .employee-secondary-insights,
  .employee-workload-grid,
  .employee-priority-chart {
    grid-template-columns: 1fr;
  }

  .employee-status-row {
    grid-template-columns: 1fr 56px;
  }

  .employee-status-row i {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Task Status Overview / Tasks by Priority: capped, equal-height row. Only
   these two panels (scoped via the parent row) are capped -- every other
   employee-dashboard-panel (Trend, Workload, Upcoming, Attention, My Tasks,
   Recent Activity) keeps its existing height behavior untouched. */
.employee-task-charts > .employee-dashboard-panel {
  max-height: 250px;
  min-height: 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.employee-task-charts > .employee-dashboard-panel > .sa-ref-panel-head {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.employee-task-charts .employee-status-chart,
.employee-task-charts .employee-priority-chart {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.employee-task-charts .employee-status-chart {
  gap: 6px;
}

.employee-task-charts .employee-status-row {
  padding: 3px 0;
}

.employee-priority-legend button.hovered {
  color: #111827;
}

.employee-priority-legend button {
  cursor: pointer;
}

/* My Tasks / Recent Task Activity: same fixed height, header and "View All"
   stay outside the scroll area, only the list/table body scrolls. */
.employee-task-bottom-row > .employee-dashboard-panel {
  height: 460px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.employee-task-bottom-row > .employee-dashboard-panel > .sa-ref-panel-head {
  flex: 0 0 auto;
}

.employee-task-bottom-row .employee-task-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.employee-task-bottom-row .employee-activity-list.compact-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
}

@media (max-width: 1180px) {
  .employee-task-charts > .employee-dashboard-panel,
  .employee-task-bottom-row > .employee-dashboard-panel {
    height: auto;
    max-height: none;
  }

  .employee-task-bottom-row .employee-task-table-wrapper,
  .employee-task-bottom-row .employee-activity-list.compact-scroll {
    max-height: 420px;
  }
}

/* Client Portal redesign: service stage tracker, Support page layout, and a
   few small additions specific to the new client-facing pages. */
.service-stage-tracker {
  display: grid;
  gap: 10px;
}

.service-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--app-line);
  background: #f8fafc;
  color: var(--app-muted);
}

.service-stage span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475467;
  font-weight: 800;
  font-size: 13px;
}

.service-stage.done {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.06);
  color: #0f9f6e;
}

.service-stage.done span {
  background: #0f9f6e;
  color: #fff;
}

.service-stage.current {
  border-color: rgba(36, 87, 255, 0.4);
  background: rgba(36, 87, 255, 0.06);
  color: #111827;
  font-weight: 700;
}

.service-stage.current span {
  background: #2457ff;
  color: #fff;
}

.onboarding-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--app-text);
}

.refer-benefits-list {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--app-text);
}

.client-service-catalog-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.support-page-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 2.2fr);
  gap: 24px;
  align-items: start;
}

.support-company-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.support-company-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-company-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--vdx-ink, #111827);
}

.support-company-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.support-contact-list {
  display: grid;
  gap: 16px;
}

.support-contact-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.support-contact-row span {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--app-muted);
}

.support-contact-row strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--vdx-ink, #111827);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.support-contact-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.support-raise-ticket-btn {
  width: 100%;
}

.support-info-col {
  display: grid;
  gap: 20px;
}

.faq-list {
  display: grid;
  gap: 16px;
}

.faq-item {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--app-line);
}

.faq-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.faq-item strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--vdx-ink, #111827);
}

.faq-item p {
  font-size: 14px;
  font-weight: 400;
}

.tickets-table .ticket-status-heading,
.tickets-table .ticket-status-cell {
  min-width: 126px;
  width: 126px;
}

.tickets-table .ticket-status-cell,
.tickets-table .ticket-status-cell .status-badge {
  white-space: nowrap;
}

.ticket-details-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 22px 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 248, 255, 0.9));
  box-shadow: 0 10px 30px rgba(31, 64, 128, 0.07);
}

.ticket-details-hero-copy {
  min-width: 0;
}

.ticket-details-kicker {
  display: block;
  margin-bottom: 7px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.ticket-details-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ticket-details-heading-row h2 {
  margin: 0;
  color: #101828;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
}

.ticket-details-hero-copy > p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.ticket-details-page > .profile-alert {
  margin-bottom: 16px;
}

.ticket-details-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.ticket-details-page .panel {
  padding: 22px;
}

.ticket-section-title {
  margin: 0 0 16px;
  color: #1d2939;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.ticket-info-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.ticket-info-grid .info-field {
  display: grid;
  grid-template-columns: minmax(112px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.ticket-info-grid .info-field:last-child {
  border-bottom: 0;
}

.ticket-info-grid .info-field span {
  color: #667085;
  font-size: 12px;
  font-weight: 500;
}

.ticket-info-grid .info-field strong {
  color: #1d2939;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticket-manage-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--app-line);
}

.ticket-description-text {
  margin: 0;
  color: #344054;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ticket-conversation-card,
.ticket-activity-card {
  margin-bottom: 20px;
}

.ticket-message-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.ticket-message {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.ticket-message > p {
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.ticket-message-internal_note {
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.18);
}

.ticket-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.ticket-reply-box {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--app-line);
}

.ticket-reply-toggle {
  justify-content: flex-start;
}

@media (max-width: 860px) {
  .ticket-details-hero {
    padding: 18px;
  }

  .ticket-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ticket-details-hero {
    gap: 14px;
  }

  .ticket-info-grid .info-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 1080px) {
  .support-page-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr);
  }
}

@media (max-width: 760px) {
  .support-page-grid {
    grid-template-columns: 1fr;
  }
}

/* Client glass treatment (matches My Profile's .profile-section) -- extra
   specificity via .support-page-grid beats the later global "flatten panels
   to solid white" rule targeting body[data-page="dashboard"] .panel. */
body[data-page="dashboard"] .support-page-grid .panel.support-company-card,
body[data-page="dashboard"] .support-page-grid .panel.support-faq-card,
body[data-page="dashboard"] .support-page-grid .panel.support-tickets-card,
body[data-page="dashboard"] .client-tickets-page .panel,
body[data-page="dashboard"] .client-ticket-details-page .panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(22px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
}

/* ================= Vedrix scrollable data tables: Leads / Clients / Task Management =================
   Shared internal vertical-scroll pattern so a growing record count no longer stretches page height --
   the row area scrolls inside a viewport-aware max-height while the toolbar above and the pagination
   footer below stay outside the scroll area. Applied by adding .vedrix-scrollable-table alongside the
   existing .table-responsive (Leads, Clients, Task Management "Table" view) or .task-list-view (Task
   Management "List" view) wrapper -- every other .table-responsive usage in the app (Team, Billing,
   Invoices, Services, etc.) is untouched and keeps its current page-scrolling behavior.

   The clamp() offset is calibrated against the tallest header chrome shared by Leads/Clients (topbar +
   breadcrumb + summary stat cards + table toolbar, ~410px) plus the pagination footer (~63px) and a
   safety buffer, measured against the real running app at 1440x800. Task Management has less header
   chrome (no stat cards) so its table simply has a little extra breathing room below it -- still safely
   inside the viewport, never overflowing it. */

body[data-page="dashboard"] .vedrix-scrollable-table {
  max-height: clamp(420px, calc(100vh - 380px), 860px);
  min-height: 420px;
  overflow-y: auto !important;
  overflow-x: auto;
}

/* Solid sticky header -- .premium-table thead th (Leads/Clients) is translucent
   (background: rgba(255,255,255,.6) !important) elsewhere in this file, so rows would
   show through while scrolling; force a solid background here. Also covers .crm-table
   (Task Management "Table" view), which has no sticky thead treatment of its own. */
body[data-page="dashboard"] .vedrix-scrollable-table table thead th {
  position: sticky !important;
  top: 0;
  z-index: 3;
  background: #f5f7fb !important;
}

/* The shared .table class sets overflow: hidden (to clip square table corners inside a
   rounded card) which, per spec, makes the <table> itself a candidate "nearest ancestor
   with a scrolling box" for position: sticky -- hijacking the sticky reference away from
   the actual scrolling .vedrix-scrollable-table div and silently breaking the sticky
   header above. Restore visible overflow on just the table inside our scroll container;
   every other .table in the app keeps its corner-clipping overflow: hidden untouched. */
body[data-page="dashboard"] .vedrix-scrollable-table > table {
  overflow: visible;
}

/* Consultations table: Client is the 2nd column (Consultation ID, Client,
   Subject, ...). With no explicit width the browser's auto table layout was
   squeezing it down to ~110px, wrapping company names like "Acme Healthcare
   Private Limited" across 4 lines. Scoped to .consultations-page only so
   Leads/Clients/Task Management tables sharing the same .premium-table /
   .vedrix-scrollable-table classes are unaffected. */
body[data-page="dashboard"] .consultations-page .vedrix-scrollable-table th:nth-child(2),
body[data-page="dashboard"] .consultations-page .vedrix-scrollable-table td:nth-child(2) {
  min-width: 220px;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .vedrix-scrollable-table {
    max-height: clamp(380px, calc(100vh - 360px), 760px);
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .vedrix-scrollable-table {
    max-height: clamp(340px, calc(100vh - 320px), 680px);
  }
}

/* Leads table: wider Lead / Service columns, extra room enabled via the shared
   horizontal scroll already on .vedrix-scrollable-table. */
body[data-page="dashboard"] .leads-table {
  min-width: 1420px;
  margin-left: 0;
  transform: none;
}
body[data-page="dashboard"] .leads-table .col-lead-id { width: 110px !important; min-width: 110px; }
body[data-page="dashboard"] .leads-table .col-lead-wide {
  min-width: 220px;
  max-width: 240px;
}
body[data-page="dashboard"] .leads-table .col-lead-email { width: 240px; min-width: 240px; max-width: 240px; }
body[data-page="dashboard"] .leads-table .col-lead-country { min-width: 140px; }
body[data-page="dashboard"] .leads-table .col-service-wide {
  min-width: 190px;
  max-width: 240px;
}
body[data-page="dashboard"] .leads-table .col-lead-stage { min-width: 130px; }
body[data-page="dashboard"] .leads-table .col-lead-source { min-width: 150px; }
body[data-page="dashboard"] .leads-table .col-lead-created { min-width: 140px; }

body[data-page="dashboard"] .leads-table th.lead-action-column,
body[data-page="dashboard"] .leads-table td.lead-action-column {
  width: 88px !important;
  min-width: 88px;
  max-width: 88px !important;
  padding-left: 12px;
  padding-right: 12px;
  text-align: center !important;
  white-space: nowrap !important;
  box-sizing: border-box;
}
body[data-page="dashboard"] .leads-table td.lead-action-column .lead-action-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  transform: none;
}

/* Dashboard controls use their existing active/hover treatment without an
   additional browser or Bootstrap focus ring. */
body[data-page="dashboard"] .side-link:focus,
body[data-page="dashboard"] .side-link:focus-visible,
body[data-page="dashboard"] button:focus,
body[data-page="dashboard"] button:focus-visible,
body[data-page="dashboard"] .btn:focus,
body[data-page="dashboard"] .btn:focus-visible {
  outline: none !important;
}

body[data-page="dashboard"] .btn:focus,
body[data-page="dashboard"] .btn:focus-visible {
  box-shadow: none !important;
}

body[data-page="dashboard"] .client-table .client-mobile-cell {
  min-width: 160px;
  max-width: 180px;
  white-space: nowrap;
}

body[data-page="dashboard"] .client-table-wrapper {
  overflow-x: auto !important;
  overflow-y: auto !important;
}

body[data-page="dashboard"] .client-table {
  min-width: 1250px;
}

body[data-page="dashboard"] .client-table .col-company-name {
  min-width: 240px !important;
}

body[data-page="dashboard"] .client-table .col-contact-person {
  min-width: 200px !important;
}

body[data-page="dashboard"] .client-table .col-country {
  min-width: 150px !important;
}

body[data-page="dashboard"] .client-table .col-assigned-service {
  min-width: 220px !important;
}

/* Multi-service table cells (Leads "Service", Clients "Assigned Service"):
   cap the visible area at roughly 5-6 rows and let the cell itself scroll
   internally rather than stretching the table row -- the shared universal
   thin-scrollbar rule (`*::-webkit-scrollbar`) styles this automatically. */
body[data-page="dashboard"] .service-list-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
  padding: 2px 6px 2px 0;
}

body[data-page="dashboard"] .service-list-item {
  font-size: .82rem;
  line-height: 1.35;
  white-space: nowrap;
}

/* Action columns scroll with their table on every dashboard page. Keep header
   cells vertically sticky, but never pin the final column to either side. */
body[data-page="dashboard"] table th:last-child {
  right: auto !important;
  left: auto !important;
}

body[data-page="dashboard"] table tbody td:last-child {
  position: static !important;
  right: auto !important;
  left: auto !important;
  z-index: auto !important;
}

/* Shared Action-column sizing and alignment for every dashboard table. */
body[data-page="dashboard"] table th:last-child,
body[data-page="dashboard"] table td:last-child {
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  padding-right: 20px !important;
  padding-left: 20px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

body[data-page="dashboard"] table th:last-child {
  z-index: 4;
}

body[data-page="dashboard"] table td:last-child > .action-dropdown,
body[data-page="dashboard"] table td:last-child > .table-action-menu,
body[data-page="dashboard"] table td:last-child .task-actions,
body[data-page="dashboard"] table td:last-child .lead-action-dropdown,
body[data-page="dashboard"] table td:last-child .client-action-dropdown,
body[data-page="dashboard"] table td:last-child .team-action-dropdown {
  position: relative !important;
  width: 40px;
  height: 40px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  transform: none !important;
  overflow: visible;
}

body[data-page="dashboard"] table td:last-child .table-action-trigger {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  transform: none !important;
}
/* Consultations module */
.consultations-page,.consultation-detail{display:flex;flex-direction:column;gap:20px;min-width:0}
.consultation-book-card{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;padding:24px;border:1px solid rgba(255,255,255,.78);border-radius:22px;background:linear-gradient(135deg,rgba(236,244,255,.96),rgba(226,235,255,.86));box-shadow:0 16px 36px rgba(37,61,143,.12)}
.consultation-book-card h2,.consultation-list-head h2,.consultation-form-head h2,.consultation-detail h3{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}
.consultation-book-card p,.consultation-form-head p{margin:0;color:#68758d;font-size:14px}
.consultation-book-icon{display:grid;place-items:center;width:54px;height:54px;border-radius:17px;color:#fff;background:linear-gradient(135deg,#173eff,#6074ff)}
.consultation-book-icon svg{width:26px;height:26px}
.consultation-list-card{padding:20px;min-width:0}
.consultation-list-head,.consultation-form-head,.consultation-detail-hero,.consultation-detail-actions,.consultation-form-actions{display:flex;align-items:center;justify-content:space-between;gap:16px}
.consultation-list-head{margin-bottom:18px}.consultation-list-head span{color:#69758b;font-size:13px;font-weight:600}
.consultation-list-tools{display:flex;gap:12px;min-width:min(100%,480px)}.consultation-list-tools .form-control{flex:1}.consultation-list-tools .form-select{width:180px}
.consultation-table-wrap{max-height:610px;overflow:auto}.consultation-table{min-width:1320px}.consultation-table th{position:sticky;top:0;z-index:2;background:#f5f7fc}.consultation-table td,.consultation-table th{vertical-align:middle;white-space:nowrap}
.consultation-form{padding:24px}.consultation-form-grid,.consultation-kv-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.consultation-form-actions{justify-content:flex-end;margin-top:18px}
.consultation-detail-hero{padding:22px}.consultation-detail-hero h2{margin:5px 0 10px}.consultation-detail-grid{display:grid;grid-template-columns:3fr 2fr;gap:20px}.consultation-detail-grid>.panel,.consultation-schedule-form,.consultation-timeline{padding:22px}
.consultation-kv-grid{margin-top:16px}.consultation-kv-grid div{display:flex;flex-direction:column;gap:4px}.consultation-kv-grid span{font-size:12px;color:#758198}.consultation-kv-grid strong{font-size:14px;color:#172033}
.consultation-activity{position:relative;display:grid;grid-template-columns:18px 1fr;gap:10px;padding:0 0 18px}.consultation-activity:before{content:"";position:absolute;left:5px;top:12px;bottom:-2px;width:1px;background:#d7def2}.consultation-activity:last-child:before{display:none}.consultation-activity-dot{width:11px;height:11px;margin-top:4px;border-radius:50%;background:#2345ff}.consultation-activity p{margin:3px 0;color:#64718a}.consultation-activity small{color:#8a95aa}
.consultation-client-actions{display:flex;justify-content:flex-end;gap:12px}.consultation-reschedule-form{padding:22px}
@media(max-width:900px){.consultation-book-card{grid-template-columns:auto 1fr}.consultation-book-card .btn{grid-column:1/-1}.consultation-detail-grid{grid-template-columns:1fr}.consultation-list-head{align-items:stretch;flex-direction:column}.consultation-list-tools{width:100%}}
@media(max-width:640px){.consultation-form-grid,.consultation-kv-grid{grid-template-columns:1fr}.consultation-list-tools{flex-direction:column}.consultation-list-tools .form-select{width:100%}.consultation-detail-hero{align-items:flex-start;flex-direction:column}}

/* Super Admin Consultation Details only: shared detail-page alignment,
   typography tokens, and a restrained connected activity timeline. */
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail {
  --crm-widget-title-size: 14px;
  --crm-widget-title-weight: 400;
  gap: var(--app-section-gap, 16px) !important;
  min-width: 0;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail > * { width: 100%; min-width: 0; }
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-hero { align-items: flex-start; }
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-hero > div:first-child { min-width: 0; }
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-hero h2,
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-hero p { overflow-wrap: anywhere; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-actions {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-grid {
  grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  gap: var(--app-section-gap, 16px);
  align-items: stretch;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-grid > .panel {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  align-items: stretch;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .panel > h3 { margin: 0 0 12px !important; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-kv-grid {
  margin-top: 0;
  gap: 14px 18px;
  align-items: start;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-kv-grid > div,
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-kv-grid strong { min-width: 0; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-kv-grid strong,
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-grid p { overflow-wrap: anywhere; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-info-card > .btn {
  align-self: flex-start;
  margin-top: 16px;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-grid > .panel > p { margin: 0; }
body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-grid > .panel > p + h3 { margin-top: 20px !important; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-timeline {
  position: relative;
  overflow: hidden;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0 0 16px;
  align-items: start;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity:last-child { padding-bottom: 0; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity::before {
  left: 5px;
  top: 11px;
  bottom: 0;
  width: 1px;
  background: rgba(103, 116, 145, 0.22);
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #526bca;
  box-shadow: 0 0 0 1px rgba(82, 107, 202, 0.24);
  box-sizing: border-box;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity > div {
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(71, 84, 103, 0.08);
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity:last-child > div { padding-bottom: 0; border-bottom: 0; }

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity strong {
  display: block;
  color: #344054;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity p {
  margin: 3px 0 4px;
  color: #667085;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-activity small {
  display: block;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body[data-page="dashboard"] .layout.super-admin-layout .super-admin-consultation-detail .consultation-detail-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
.invoice-detail-page{padding-bottom:110px}
.invoice-sticky-action-bar{position:sticky;z-index:25;bottom:16px;display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;padding:14px 18px;border:1px solid rgba(209,218,239,.95);border-radius:20px;background:#fff;box-shadow:0 18px 42px rgba(26,42,94,.18)}
.invoice-sticky-action-bar.client-readonly{justify-content:flex-end}
.invoice-payment-control{display:flex;align-items:center;gap:14px}.invoice-payment-control>span{font-size:13px;font-weight:650;color:#66738b}
.invoice-payment-toggle{display:grid;grid-template-columns:1fr 1fr;padding:4px;border-radius:13px;background:#f0f3f9}.invoice-payment-toggle button{min-width:82px;padding:8px 13px;border:0;border-radius:10px;background:transparent;color:#657188;font-weight:700}.invoice-payment-toggle.unpaid button:first-child.active{background:#fff3d5;color:#a05b00;box-shadow:0 2px 8px rgba(89,64,12,.12)}.invoice-payment-toggle.paid button:last-child.active{background:#dff8ee;color:#08795b;box-shadow:0 2px 8px rgba(8,121,91,.12)}
.invoice-sticky-actions{display:flex;align-items:center;gap:10px}
@media(max-width:640px){.invoice-detail-page{padding-bottom:150px}.invoice-sticky-action-bar{align-items:stretch;flex-direction:column}.invoice-payment-control{justify-content:space-between}.invoice-sticky-actions{justify-content:flex-end}}
@page { size: A4; margin: 16mm 14mm; }
/* .classic-invoice-template's own base rule (794px / 1123px / 54px 58px
   padding) is the A4-at-96dpi design shared by Preview, Download PDF, and
   Print -- 794px is exactly A4's 210mm width at 96dpi. @page margin is 0 so
   that design's own padding supplies 100% of the visual margin instead of
   stacking a second, different margin on top of it (which previously made
   Print's spacing/proportions diverge from Preview/PDF). */
@page {
  size: A4;
  margin: 0;
}

@media print {
  body > :not(.invoice-print-document) {
    display: none !important;
  }
  .invoice-print-document {
    display: block !important;
    width: 100% !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  /* Force background colors/images (the Grand Total navy bar, status pills,
     etc.) to print regardless of the browser's own "Background graphics"
     print-dialog toggle -- matches what Preview/PDF already show. */
  .invoice-print-document,
  .invoice-print-document * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* Stay in normal document flow (not position:absolute) so a long invoice
     paginates naturally across multiple printed pages instead of being
     clipped to the first one. Width/max-width/padding are deliberately left
     to the base .classic-invoice-template rule above -- overriding them here
     to 100%/none/0 is what previously made the printed layout stretch edge
     to edge instead of matching Preview/PDF's fixed A4 proportions. */
  .classic-invoice-template {
    position: static !important;
    margin: 0 auto !important;
  }
  .classic-invoice-header,
  .classic-bill-to,
  .classic-invoice-table tr,
  .classic-invoice-lower,
  .classic-payment-details,
  .classic-signature,
  .classic-totals,
  .classic-totals-group,
  .classic-totals-row,
  .classic-grand-total,
  .classic-totals-status,
  .classic-thanks,
  .classic-invoice-footer {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .classic-invoice-table thead { display: table-header-group; }
  /* Payment Instructions is a CRM-only widget rendered as a sibling of
     .classic-invoice-template, never a descendant of it -- this rule is
     defensive belt-and-braces on top of the `body * { visibility: hidden }`
     rule above. */
  .payment-instructions-widget { display: none !important; }
}

/* Admin and Super Admin: Service Details metric values */
body[data-page="dashboard"] .service-detail-page .service-summary-grid .team-info-card > strong {
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

body[data-page="dashboard"] .service-detail-page .service-pricing-card .service-price-row > strong,
body[data-page="dashboard"] .service-detail-page .service-pricing-card .service-price-row > input,
body[data-page="dashboard"] .service-detail-page .service-pricing-card .service-price-row > select {
  justify-self: end;
  text-align: right;
}

body[data-page="dashboard"] .service-detail-page .service-pricing-card .service-total-row > strong {
  margin-left: auto;
  text-align: right;
}

body[data-page="dashboard"] .task-detail-page .client-profile-hero {
  position: relative;
  padding-right: 130px;
}

body[data-page="dashboard"] .task-detail-page .client-profile-hero > .toolbar-actions {
  position: absolute;
  top: 22px;
  right: 22px;
  width: auto;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  body[data-page="dashboard"] .task-detail-page .client-profile-hero {
    padding-right: 22px;
    padding-top: 80px;
  }
}

/* Lead Details Hero Refactor */
.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-title-area h2 {
  margin: 0;
}

.hero-title-area p {
  margin: 0;
}

.lead-detail-page .client-profile-hero .toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .lead-detail-page .client-profile-hero .toolbar-actions {
    justify-content: flex-start;
  }
}

/* Lead Details Split Section Refactor */
.lead-detail-split-grid > .detail-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
}

.lead-detail-split-grid > .detail-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1e293b;
}

/* Premium Internal Notes Card */
.internal-notes-card {
  background: #ffffff;
  border: 1px solid var(--app-line, #e2e8f0);
}

.internal-notes-card .card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 12px;
	/* border-bottom: 1px solid #f1f5f9; */
}

.internal-notes-card .card-header h3 {
  margin: 0 !important;
}

.internal-notes-card .header-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.internal-notes-card .note-icon {
  color: #64748b;
  font-size: 16px;
}

.internal-notes-card .notes-badge {
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.internal-notes-card .notes-workspace {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.internal-notes-card .notes-textarea {
  flex-grow: 1;
  min-height: 120px;
  resize: vertical;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  transition: all 150ms ease;
  margin-bottom: 16px;
}

.internal-notes-card .notes-textarea:focus {
  outline: none;
}

.internal-notes-card .notes-textarea::placeholder {
  color: #94a3b8;
}

.internal-notes-card .notes-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: auto;
}

.internal-notes-card .notes-helper {
  font-size: 12px;
  color: #64748b;
}

.internal-notes-card .notes-save-btn {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

/* Premium Form Summary Card Customizations */
.form-summary-card {
  padding: 24px !important;
}

.form-summary-card h3 {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1e293b;
  margin-bottom: 18px !important;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.16) !important;
}

.form-summary-row {
  padding: 14px 0 !important;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.16) !important;
}

.form-summary-row:last-child {
  border-bottom: 0 !important;
}

.form-summary-row span {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

.form-summary-row strong {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
}

/* Edit Task Header Context Row styling */
.task-edit-context-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(16, 20, 38, 0.03);
}

.task-edit-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.task-edit-subtitle .context-label {
  color: #64748b;
}

.task-edit-subtitle .context-value {
  color: #1e293b;
  font-weight: 600;
}

.task-edit-subtitle .context-separator {
  color: #cbd5e1;
  font-weight: bold;
}

.task-edit-subtitle .context-unsaved-badge {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Sidebar Actions Panel */
.edit-actions-panel {
  padding: 16px 20px !important;
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 4px 12px rgba(16, 20, 38, 0.03) !important;
}

.panel.edit-actions-panel.edit-actions-spacing:hover {
	transform: translateY(0px) !important;
}
.panel.edit-actions-panel.edit-actions-spacing {
	margin-top: 12px !important;
}

.edit-actions-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.edit-actions-wrapper .right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-actions-wrapper .cancel-btn {
  color: #64748b !important;
  font-weight: 500 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 13px;
  height: 38px;
  display: inline-flex;
  align-items: center;
}

.edit-actions-wrapper .cancel-btn:hover {
  color: #1e293b !important;
  text-decoration: underline !important;
}

.edit-actions-wrapper .draft-btn {
  height: 38px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid var(--app-line, #e2e8f0) !important;
  background: #ffffff !important;
  color: #334155 !important;
}

.edit-actions-wrapper .draft-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(16, 20, 38, 0.05) !important;
}

/* Connected Split Button Group */
.split-btn-group {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  border-radius: 8px;
  overflow: visible;
}

.split-btn-group .btn {
  height: 38px;
  border: 1px solid var(--app-primary, #2563eb) !important;
  background: var(--app-primary, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.split-btn-group .btn.btn-app.main-action-btn {
	border-radius: 12px 0px 0px 12px !important;
	border-right: none !important;
	padding: 0 16px !important;
}

.split-btn-group .btn.btn-app.dropdown-toggle-btn {
	border-radius: 0px 12px 12px 0px !important;
	border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
	margin-left: 0 !important; /* remove any gap */
	padding: 0 10px !important;
}

.split-btn-group .btn:hover {
  background: var(--app-primary-hover, #1d4ed8) !important;
  border-color: var(--app-primary-hover, #1d4ed8) !important;
}

.split-btn-group .save-dropdown-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  z-index: 50;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--app-line, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1), 0 -8px 10px -6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.split-btn-group .save-dropdown-menu .dropdown-item {
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
  transition: background 100ms ease;
}

.split-btn-group .save-dropdown-menu .dropdown-item:hover {
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

@media (max-width: 768px) {
  .task-edit-context-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

/* Employee Dashboard My Tasks visual refactoring */
.employee-task-table-wrapper {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.employee-task-table {
  display: block !important;
  width: 100% !important;
  border-collapse: collapse;
}

.employee-task-table thead {
  display: none !important;
}

.employee-task-table tbody {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
}

.employee-task-table tbody tr {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 16px 20px !important;
  background: #ffffff !important;
  border: 1px solid var(--app-line, #e2e8f0) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05) !important;
  cursor: pointer !important;
  transition: all 200ms ease !important;
}

.employee-task-table tbody tr:hover {
  transform: translateY(-2px) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 8px 20px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03) !important;
}

/* Row cells reset */
.employee-task-table tbody tr td {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Task Title and ID cell */
.employee-task-table tbody tr td:nth-child(1) {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex-grow: 1 !important;
  min-width: 0 !important;
  align-items: flex-start !important;
  text-align: left !important;
}

.employee-task-table tbody tr td:nth-child(1) strong {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
}

.employee-task-table tbody tr td:nth-child(1) small {
  font-size: 11px !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  font-weight: 600 !important;
}

/* Service Category Cell */
.employee-task-table tbody tr td:nth-child(2) {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 12px !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  padding: 4px 10px !important;
  border-radius: 9999px !important;
  font-weight: 500 !important;
  margin-right: 16px !important;
  white-space: nowrap !important;
}

/* Due Date Cell */
.employee-task-table tbody tr td:nth-child(3) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  color: #64748b !important;
  margin-right: 16px !important;
  white-space: nowrap !important;
}

.employee-task-table tbody tr td:nth-child(3)::before {
  content: "\f073" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 400 !important;
  color: #94a3b8 !important;
  font-size: 12px !important;
}

/* Action Dropdown Cell */
.employee-task-table tbody tr td:nth-child(4) {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-shrink: 0 !important;
}

/* Responsive adjustment for small screens */
@media (max-width: 768px) {
  .employee-task-table tbody tr {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  
  .employee-task-table tbody tr td {
    width: 100% !important;
    margin-right: 0 !important;
  }
  
  .employee-task-table tbody tr td:nth-child(2) {
    display: inline-flex !important;
    width: auto !important;
  }
  
  .employee-task-table tbody tr td:nth-child(3) {
    display: inline-flex !important;
    width: auto !important;
  }
  
  .employee-task-table tbody tr td:nth-child(4) {
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 12px !important;
    width: 100% !important;
  }
}

/* Page-specific styling for Client Dashboard when breadcrumb is hidden */
body[data-page="dashboard"] .content.no-breadcrumb .app-page-container {
  padding-top: 24px !important; /* ensures consistent premium top spacing under the header */
}

/* Page-specific overrides for Super Admin Create Invoice page visual refinement */
.create-invoice-page .create-invoice-grid {
  gap: 24px !important;
  margin-top: 24px !important;
}

.create-invoice-page .panel.invoice-form-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 22px 60px rgba(31, 64, 128, 0.08) !important;
  backdrop-filter: blur(22px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(155%) !important;
  border-radius: 22px !important;
  padding: 30px !important;
  transition: box-shadow 220ms ease, transform 220ms ease !important;
}

.create-invoice-page .panel.invoice-form-panel:hover {
  box-shadow: 0 26px 68px rgba(31, 64, 128, 0.12) !important;
  transform: translateY(-1px) !important;
}

/* Card Headings */
.create-invoice-page .panel.invoice-form-panel h3 {
  font-size: 16px !important;
  font-weight: 750 !important;
  color: var(--vdx-ink, #0f172a) !important;
  margin: 0 0 20px 0 !important;
  letter-spacing: -0.01em !important;
}

/* Form Labels */
.create-invoice-page .form-field span {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  margin-bottom: 6px !important;
  display: block !important;
}

/* Form Inputs, Selects, and Textareas */
.create-invoice-page .form-control,
.create-invoice-page .form-select,
.create-invoice-page textarea {
  min-height: 42px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  border-radius: 10px !important;
  transition: all 160ms ease !important;
}

.create-invoice-page .form-control:hover,
.create-invoice-page .form-select:hover,
.create-invoice-page textarea:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

.create-invoice-page .form-control:focus,
.create-invoice-page .form-select:focus,
.create-invoice-page textarea:focus {
  outline: none;
}

/* Hero Header refinements */
.create-invoice-page .invoice-create-hero {
  padding: 24px 0 !important;
  margin-bottom: 24px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.create-invoice-page .invoice-create-hero h2 {
  font-size: 26px !important;
  font-weight: 800 !important;
  color: var(--vdx-ink, #0f172a) !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 6px !important;
}

.create-invoice-page .invoice-create-hero p {
  font-size: 14px !important;
  color: #64748b !important;
}

/* Consistent field spacing for the whole Create/Edit Invoice form (see the
   invoice tax/discount refactor, item 1): a flat reserved padding-bottom on
   every field used to hold space for an absolutely-positioned validation
   message whether or not one was showing, which is what produced the
   inconsistent/excessive empty space below fields. The message now flows in
   normal layout -- it only takes space when an error is actually rendered. */
.create-invoice-page .profile-form-grid {
  row-gap: 20px !important;
  column-gap: 18px !important;
}

.create-invoice-page .profile-form-grid > .form-field {
  align-self: start;
}

.create-invoice-page .form-field > .validation-message,
.create-invoice-page .invoice-signature-field > .validation-message,
.create-invoice-page .selected-services > .validation-message {
  display: block !important;
  color: #dc2626 !important;
  font-size: 11.5px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  margin: 4px 0 0 !important;
}

.create-invoice-page .form-field.has-error > .form-control,
.create-invoice-page .form-field.has-error > .form-select,
.create-invoice-page .form-field.has-error > .invoice-client-select .form-control {
  border-color: rgba(220, 38, 38, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08) !important;
}

.create-invoice-page .invoice-service-table input.is-invalid,
.create-invoice-page .invoice-service-table select.is-invalid {
  border-color: rgba(220, 38, 38, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08) !important;
}

.create-invoice-page .invoice-service-table.has-error {
  border: 1px solid rgba(220, 38, 38, 0.45);
  border-radius: var(--app-radius, 10px);
}

.create-invoice-page .invoice-items-empty-wrap.has-error .empty-state {
  border-color: rgba(220, 38, 38, 0.5);
}

.create-invoice-page .invoice-type-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.create-invoice-page .invoice-type-tab {
  position: relative;
  min-height: 40px;
  padding: 0 2px 11px;
  border: 0;
  color: #64748b;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: color 160ms ease;
}

.create-invoice-page .invoice-type-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--app-primary, #2563eb);
  content: "";
  opacity: 0;
  transform: scaleX(0.55);
  transition: opacity 160ms ease, transform 160ms ease;
}

.create-invoice-page .invoice-type-tab:hover {
  color: #334155;
}

.create-invoice-page .invoice-type-tab.active,
.create-invoice-page .invoice-type-tab[aria-selected="true"] {
  color: var(--app-primary, #2563eb);
}

.create-invoice-page .invoice-type-tab.active::after,
.create-invoice-page .invoice-type-tab[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.create-invoice-page .invoice-type-tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 600px) {
  .create-invoice-page .invoice-type-tabs {
    width: 100%;
    gap: 0;
  }

  .create-invoice-page .invoice-type-tab {
    flex: 1 1 50%;
    text-align: center;
  }
}

/* Hero Actions */
.create-invoice-page .service-icon-actions {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
}

.create-invoice-page .service-icon-actions .icon-action-btn {
  display: inline-grid !important;
  width: 38px !important;
  height: 38px !important;
  place-items: center !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05) !important;
  transition: all 180ms ease !important;
}

.create-invoice-page .service-icon-actions .icon-action-btn:hover {
  transform: translateY(-1px) !important;
  background: #ffffff !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.05) !important;
}

/* Unified searchable client selector */
.create-invoice-page .invoice-client-select {
  position: relative;
  width: 100%;
}

.create-invoice-page .invoice-client-combobox {
  position: relative;
}

.create-invoice-page .invoice-client-combobox > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: #64748b;
  pointer-events: none;
  transform: translateY(-50%);
}

.create-invoice-page .invoice-client-combobox .form-control {
  padding-right: 38px !important;
  padding-left: 40px !important;
}

.create-invoice-page .invoice-client-chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.create-invoice-page .invoice-client-select.open .invoice-client-chevron {
  transform: translateY(-30%) rotate(225deg);
}

.create-invoice-page .invoice-client-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 80;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.create-invoice-page .invoice-client-option {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #1e293b;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.create-invoice-page .invoice-client-option:hover,
.create-invoice-page .invoice-client-option.active,
.create-invoice-page .invoice-client-option[aria-selected="true"] {
  background: rgba(37, 99, 235, 0.08);
}

.create-invoice-page .invoice-client-option strong {
  font-size: 13.5px;
  font-weight: 650;
}

.create-invoice-page .invoice-client-option span {
  color: #64748b !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.create-invoice-page .invoice-client-empty {
  padding: 18px 12px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

/* Selected Services / Table Visual Refinement */
.create-invoice-page .selected-services .panel-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  margin-bottom: 16px !important;
}

.create-invoice-page .selected-services .panel-head h3 {
  margin-bottom: 0 !important;
}

.create-invoice-page .premium-table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.create-invoice-page .premium-table th {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  text-align: left !important;
  background: transparent !important;
}

.create-invoice-page .premium-table td {
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04) !important;
  font-size: 13.5px !important;
  color: #334155 !important;
  background: transparent !important;
}

.create-invoice-page .premium-table tr:last-child td {
  border-bottom: none !important;
}

.create-invoice-page .premium-table .form-control,
.create-invoice-page .premium-table .form-select {
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

/* Sticky Save Bar -- the shared .profile-save-actions base (used by My
   Profile/Client edit too, left untouched there) is a semi-transparent
   blurred bar, which is exactly the "transparent overlap" item 29 of the
   invoice tax/discount refactor asks not to rely on: scrolled-under content
   was dimly visible/interactive through it. Opaque here instead, plus enough
   bottom padding on the page for the last section to clear the bar entirely
   (~64px bar incl. its own padding + 14px sticky offset + buffer). */
/* !important + matching selector shape: body[data-page="dashboard"]
   .page-content > .module-page resets padding-bottom to 0 !important on
   every module page (elsewhere in this file) at equal specificity to a
   plain "body[data-page] .create-invoice-page" -- mirror its exact
   ".page-content >" structure so this wins the tie by source order instead. */
body[data-page="dashboard"] .page-content > .create-invoice-page {
  padding-bottom: 110px !important;
}

.create-invoice-page .invoice-create-actions {
  background: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(209, 218, 239, 0.95) !important;
  box-shadow: 0 18px 42px rgba(26, 42, 94, 0.18) !important;
}

/* Action Buttons inside Sticky Save Bar */
.create-invoice-page .invoice-create-actions .btn {
  height: 40px !important;
  padding: 0 20px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 180ms ease !important;
  cursor: pointer !important;
}

.create-invoice-page .invoice-create-actions .btn.btn-app {
  color: #ffffff !important;
  background: var(--app-primary, #2563eb) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16) !important;
}

.create-invoice-page .invoice-create-actions .btn.btn-app:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24) !important;
}

.create-invoice-page .invoice-create-actions .btn.btn-secondary-app {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08) !important;
  border: 1px solid rgba(37, 99, 235, 0.15) !important;
  box-shadow: none !important;
}

.create-invoice-page .invoice-create-actions .btn.btn-secondary-app:hover {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
  transform: translateY(-1px) !important;
}

.create-invoice-page .invoice-create-actions .btn.btn-export-app,
.create-invoice-page .invoice-create-actions .btn.btn-outline-app {
  height: 40px !important;
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05) !important;
}

.create-invoice-page .invoice-create-actions .btn.btn-export-app:hover,
.create-invoice-page .invoice-create-actions .btn.btn-outline-app:hover {
  background: #f8fafc !important;
  color: #1e293b !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.05) !important;
  transform: translateY(-1px) !important;
}

.create-invoice-page .validation-error {
  color: #ef4444 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  margin-top: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ==========================================================================
   ANALYTICS: LEAD CONVERSION TREND WIDGET ALIGNMENT
   ========================================================================== */

/* Vertically center chart within Lead Conversion Trend card */
body[data-page="dashboard"] .lead-conversion-trend-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

body[data-page="dashboard"] .lead-conversion-trend-card .analytics-axis-chart-wrap {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ==========================================================================
   ANALYTICS: REVENUE OVERVIEW WIDGET ALIGNMENT
   ========================================================================== */

/* Vertically center chart within Revenue Overview card */
body[data-page="dashboard"] .revenue-overview-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

body[data-page="dashboard"] .revenue-overview-card .analytics-axis-chart-wrap {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ==========================================================================
   ANALYTICS: MY PROFILE PAGE LAYOUT REFINEMENTS
   ========================================================================== */

/* Page layout to single column on desktop so all cards span full width */
body[data-page="dashboard"] .my-profile-page .profile-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

/* Ensure all cards have identical premium styling */
body[data-page="dashboard"] .my-profile-page .profile-summary-card,
body[data-page="dashboard"] .my-profile-page .profile-section,
body[data-page="dashboard"] .my-profile-page .profile-password-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(22px) !important;
  -webkit-backdrop-filter: blur(22px) !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin: 0 !important;
}

/* Section titles visual hierarchy */
body[data-page="dashboard"] .my-profile-page .profile-section-head h2,
body[data-page="dashboard"] .my-profile-page .profile-password-card h3 {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  color: var(--vdx-ink, #0f172a) !important;
  margin: 0 !important;
  padding-bottom: 12px !important;
}

/* Super Admin profile summary alignment. Scoped because the underlying
   profile component is shared with employee and client profile pages. */
body[data-page="dashboard"] .super-admin-profile-page .profile-summary-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

body[data-page="dashboard"] .super-admin-profile-page .profile-summary-content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

body[data-page="dashboard"] .super-admin-profile-page .profile-summary-header,
body[data-page="dashboard"] .super-admin-profile-page .profile-summary-meta-row {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

body[data-page="dashboard"] .super-admin-profile-page .profile-summary-header {
  align-items: flex-start;
}

body[data-page="dashboard"] .super-admin-profile-page .profile-summary-copy,
body[data-page="dashboard"] .super-admin-profile-page .profile-summary-meta {
  min-width: 0;
}

body[data-page="dashboard"] .super-admin-profile-page .profile-summary-actions {
  position: static;
  flex: 0 0 auto;
  justify-content: flex-end;
}

body[data-page="dashboard"] .super-admin-profile-page .profile-contact-actions {
  flex: 0 0 auto;
  margin-top: 0;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  body[data-page="dashboard"] .super-admin-profile-page .profile-summary-header,
  body[data-page="dashboard"] .super-admin-profile-page .profile-summary-meta-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  body[data-page="dashboard"] .super-admin-profile-page .profile-summary-actions,
  body[data-page="dashboard"] .super-admin-profile-page .profile-contact-actions {
    justify-content: flex-start;
  }
}

/* Shared Super Admin data-table system. The explicit role class prevents the
   shell, table, scrollbar, and footer treatment from leaking into Admin,
   Employee, or client-dark layouts. */
body[data-page="dashboard"] .layout.super-admin-layout {
  --sa-table-radius: 18px;
  --sa-table-border: rgba(255, 255, 255, 0.78);
  --sa-table-divider: rgba(71, 84, 103, 0.095);
  --sa-table-surface: rgba(255, 255, 255, 0.58);
  --sa-table-header: rgba(244, 247, 252, 0.92);
  --sa-table-footer: rgba(248, 250, 253, 0.72);
}

/* Task Details uses the shared module heading rule with the Super Admin
   detail-page typography tokens, avoiding a second competing h3 selector. */
body[data-page="dashboard"] .layout.super-admin-layout .task-detail-page {
  --crm-widget-title-size: 14px;
  --crm-widget-title-weight: 400;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card {
  position: relative;
  overflow: hidden !important;
  padding: 0 !important;
  border: 1px solid var(--sa-table-border) !important;
  border-radius: var(--sa-table-radius) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68), var(--sa-table-surface)) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 38px rgba(31, 64, 128, 0.09) !important;
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  transform: none !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card:hover {
  border-color: var(--sa-table-border) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 38px rgba(31, 64, 128, 0.09) !important;
  transform: none !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .table-responsive {
  width: 100%;
  margin: 0;
  padding-bottom: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 105, 135, 0.34) rgba(91, 105, 135, 0.07);
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .table-responsive::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .table-responsive::-webkit-scrollbar-track {
  background: rgba(91, 105, 135, 0.07);
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .table-responsive::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(91, 105, 135, 0.34);
  background-clip: padding-box;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 84, 103, 0.48);
  background-clip: padding-box;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table thead th {
  padding: 13px 14px;
  border: 0 !important;
  border-bottom: 1px solid rgba(71, 84, 103, 0.12) !important;
  background: var(--sa-table-header) !important;
  color: #475467 !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.68);
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody td {
  padding: 13px 14px;
  border: 0 !important;
  border-bottom: 1px solid var(--sa-table-divider) !important;
  background: rgba(255, 255, 255, 0.08);
  color: #263654;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  vertical-align: middle;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody tr {
  background: transparent;
  transition: background-color 150ms var(--app-ease);
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody tr:hover {
  background: rgba(82, 102, 142, 0.045) !important;
  transform: none;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table .status-badge,
body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table .pill {
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(71, 84, 103, 0.1);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.42);
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table thead th:last-child {
  z-index: 10 !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody td:last-child {
  position: relative !important;
  z-index: 1 !important;
  vertical-align: middle !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody td:last-child .action-dropdown,
body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody td:last-child .table-action-menu,
body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody td:last-child .table-action-trigger {
  z-index: 1 !important;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .pagination-row {
  min-height: 58px;
  margin: 0;
  padding: 11px 14px;
  border-top: 1px solid rgba(71, 84, 103, 0.1);
  background: var(--sa-table-footer);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.54);
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .pagination-row > span {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .pagination-row .btn {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 8px !important;
  font-size: 11.5px;
  box-shadow: none;
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card {
    --sa-table-radius: 14px;
  }

  body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table thead th,
  body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card .premium-table tbody td {
    padding-right: 12px;
    padding-left: 12px;
  }

  body[data-page="dashboard"] .layout.super-admin-layout .module-page .data-table-card > .pagination-row {
    align-items: flex-start;
    gap: 9px;
    flex-direction: column;
  }
}

body[data-page="dashboard"] .my-profile-page .profile-section-head {
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08) !important;
  margin-bottom: 20px !important;
  padding-bottom: 0 !important;
}

/* Spacing and alignments of rows/inputs */
body[data-page="dashboard"] .my-profile-page .profile-form-grid,
body[data-page="dashboard"] .my-profile-page .profile-security-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px 24px !important;
}

body[data-page="dashboard"] .my-profile-page .profile-field {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 6px !important;
}

body[data-page="dashboard"] .my-profile-page .profile-field span {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: var(--vdx-muted, #64748b) !important;
  margin-bottom: 2px !important;
}

/* Consistent height alignment between text fields and readonly blocks */
body[data-page="dashboard"] .my-profile-page .profile-readonly,
body[data-page="dashboard"] .my-profile-page .form-control {
  height: 40px !important;
  min-height: 40px !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--vdx-ink, #0f172a) !important;
}

body[data-page="dashboard"] .my-profile-page .profile-readonly {
  background: rgba(255, 255, 255, 0.46) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body[data-page="dashboard"] .my-profile-page .form-control {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  transition: all 0.2s ease !important;
}

body[data-page="dashboard"] .my-profile-page .form-control:focus {
  outline: none !important;
}

/* Ensure secondary row has correct side-by-side split inside full width container */
body[data-page="dashboard"] .my-profile-page .profile-secondary-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}

/* Responsive queries */
@media (max-width: 768px) {
  body[data-page="dashboard"] .my-profile-page .profile-form-grid,
  body[data-page="dashboard"] .my-profile-page .profile-security-grid,
  body[data-page="dashboard"] .my-profile-page .profile-secondary-row {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   CLIENT MY PROFILE: vertical password fields + capped Recent Activity.
   Scoped to client-only classes so Super Admin/Admin/Employee My Profile
   (which reuses the same .profile-form-grid / .profile-activity-list base
   classes) stays on its existing 2-column / unbounded-height behaviour.
   ========================================================================== */
body[data-page="dashboard"] .my-profile-page .change-password-form {
  grid-template-columns: 1fr !important;
  gap: 16px !important;
}

body[data-page="dashboard"] .my-profile-page .change-password-form .profile-field,
body[data-page="dashboard"] .my-profile-page .client-password-card {
  width: 100%;
}

body[data-page="dashboard"] .my-profile-page .client-password-card {
  display: flex;
  flex-direction: column;
}

body[data-page="dashboard"] .my-profile-page .client-password-submit {
  align-self: flex-start;
}

.client-recent-activity-section {
  min-height: 0;
}

body[data-page="dashboard"] .my-profile-page .client-profile-secondary-row .profile-activity-list.recent-activity-list {
  max-height: 336px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

@media (max-width: 768px) {
  body[data-page="dashboard"] .my-profile-page .client-profile-secondary-row .profile-activity-list.recent-activity-list {
    max-height: 320px;
  }
}

/* ==========================================================================
   SUPER ADMIN: LEADS TABLE INTERACTION REFINEMENTS
   ========================================================================== */

/* Elevate the sticky table header to be the topmost layer */
body[data-page="dashboard"] .vedrix-scrollable-table table.leads-table thead th {
  position: sticky !important;
  top: 0;
  z-index: 10 !important;
  background: #f5f7fb !important;
}

/* Keep rows and individual action triggers at a lower stack index */
body[data-page="dashboard"] .leads-table tbody tr {
  position: relative !important;
  z-index: 1 !important;
}

body[data-page="dashboard"] .leads-table tbody td {
  position: relative !important;
  z-index: 1 !important;
}

body[data-page="dashboard"] .leads-table td.lead-action-column .lead-action-dropdown {
  position: relative !important;
  z-index: 1 !important;
}

body[data-page="dashboard"] .leads-table td.lead-action-column .table-action-trigger {
  z-index: 1 !important;
}

/* Super Admin Task Management: keep row actions inside the table body stacking
   layer so the closed trigger cannot paint over the sticky ACTIONS header. */
body[data-page="dashboard"] .task-management-page .vedrix-scrollable-table .premium-table thead th {
  z-index: 10 !important;
}

body[data-page="dashboard"] .task-management-page .vedrix-scrollable-table .premium-table tbody td.table-action-cell {
  position: relative !important;
  z-index: 1 !important;
}

body[data-page="dashboard"] .task-management-page .table-action-cell .task-actions,
body[data-page="dashboard"] .task-management-page .table-action-cell .table-action-trigger {
  z-index: 1 !important;
}

/* System Notifications sidebar count: the menu item is the sole positioning
   context, keeping the badge independent from the icon and label flow. */
body[data-page="dashboard"] .side-link[data-tooltip="System Notifications"] .system-notifications-badge {
  position: absolute !important;
  top: 4px;
  right: auto;
  left: 26px;
  z-index: 3;
  display: inline-flex;
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 20, 38, 0.2);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

body[data-page="dashboard"] .sidebar.collapsed .side-link[data-tooltip="System Notifications"] .system-notifications-badge {
  top: 3px;
  right: 3px;
  left: auto;
}

/* Super Admin > Leads > New Lead only. Shared create-form and chip primitives
   remain unchanged for every other create/edit flow. */
body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .create-form-side {
  position: sticky;
  top: 0px;
  min-width: 0;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.56) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035), 0 12px 30px rgba(31, 64, 128, 0.075) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest > h3 {
  margin: 0 0 15px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(71, 84, 103, 0.09);
  color: #344054;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-selected-services {
  gap: 8px;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-selected-services > span {
  color: #667085;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-selected-services > span em {
  color: #d92d20;
  font-weight: 650;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .service-interest-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: stretch;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest .form-check-chip {
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  gap: 8px;
  border: 1px solid rgba(71, 84, 103, 0.13);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.48);
  color: #475467;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.52);
  transition: border-color 150ms var(--app-ease), background-color 150ms var(--app-ease), color 150ms var(--app-ease);
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest .form-check-chip:hover {
  border-color: rgba(37, 91, 255, 0.26);
  background: rgba(255, 255, 255, 0.72);
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest .form-check-chip:has(input:checked) {
  border-color: rgba(37, 91, 255, 0.3);
  background: rgba(37, 91, 255, 0.075);
  color: #243b73;
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest .form-check-chip input {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
  accent-color: var(--app-blue);
}

body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest .form-check-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .new-lead-service-interest {
    padding: 16px;
    border-radius: 14px !important;
  }

  body[data-page="dashboard"] .layout.super-admin-layout .new-lead-page .service-interest-grid {
    grid-template-columns: 1fr;
  }
}

/* Scoped Leads table email column 2-line clamp */
body[data-page="dashboard"] .leads-table td.col-lead-email {
  width: 240px !important;
  min-width: 240px !important;
  max-width: 240px !important;
  word-break: break-all !important;
  overflow: hidden !important;
  white-space: normal !important;
}

body[data-page="dashboard"] .leads-table td.col-lead-email .table-ellipsis {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  word-break: break-all !important;
  line-height: 1.4 !important;
  max-height: 2.8em !important;
}

/* Super Admin employee Login & Security widget */
.login-security-card {
  margin-top: 20px;
}

.login-security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 14px 0 18px;
}

.login-security-field {
  display: grid;
  gap: 6px;
}

.login-security-field .field-label {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.login-security-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.login-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.form-error-banner {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 14px;
}

.reset-password-modal-panel {
  max-width: 440px;
  display: grid;
  gap: 14px;
}

.btn-link-app {
  background: none;
  border: none;
  color: #2457f5;
  font-weight: 500;
  font-size: 13px;
  padding: 0;
  text-align: left;
  width: fit-content;
  cursor: pointer;
}

.btn-link-app:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .login-security-grid {
    grid-template-columns: 1fr;
  }

  .login-security-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .login-security-actions button {
    width: 100%;
  }
}

/* Invoice partial-payment summary strip (Create/Edit Invoice live preview,
   Invoice View sticky bar left side) */
.invoice-payment-live-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(36, 87, 245, 0.06);
}

.invoice-payment-live-preview > div {
  display: grid;
  gap: 4px;
  min-width: 130px;
}

.invoice-payment-live-preview span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.invoice-payment-live-preview strong {
  font-size: 16px;
  font-weight: 500;
  color: #111827;
}

.payment-history-table-wrap {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
}

.record-payment-modal-panel {
  max-width: 460px;
  display: grid;
  gap: 14px;
}

.bank-account-modal-panel {
  max-width: 640px;
  width: 100%;
  display: grid;
  gap: 16px;
  max-height: 88vh;
  overflow-y: auto;
}

.billing-config-modal-panel {
  max-width: 620px;
}

.billing-config-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.billing-config-modal-head h2 {
  margin-bottom: 5px;
}

.billing-config-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.billing-config-button svg {
  width: 15px;
  height: 15px;
}

.bank-account-toggle-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.bank-account-toggle-row .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

.bank-account-toggle-row .form-check input {
  width: 16px;
  height: 16px;
}

.bank-account-default-pill {
  margin-left: 8px;
  font-size: 10px;
  padding: 2px 8px;
}

.bank-accounts-section .table-responsive {
  overflow-x: auto;
}

@media (max-width: 640px) {
  .invoice-payment-live-preview {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================================================
   Shared toast/alert notification system. Default styling here is the
   light/internal theme (Super Admin, Admin, Employee); .client-dark.css
   supplies the dark-portal variant via .toast-container-dark. This is
   immediate action feedback only -- unrelated to the persistent Notifications
   bell/module.
   ========================================================================== */
.toast-container {
  position: fixed;
  right: 24px;
  bottom: calc(24px + var(--toast-bottom-offset, 0px));
  z-index: 60000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 360px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
  box-sizing: border-box;
}

.toast-card:first-child {
  margin-top: 0;
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 17px;
}

.toast-success .toast-icon { color: #16a34a; }
.toast-error .toast-icon { color: #ef4444; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info .toast-icon { color: var(--app-primary, #2563eb); }

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}

.toast-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #344054;
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 140ms ease, color 140ms ease;
}

.toast-close:hover,
.toast-close:focus-visible {
  background: rgba(15, 23, 42, 0.06);
  color: #344054;
  outline: none;
}

.toast-enter {
  animation: toastSlideIn 280ms ease both;
}

.toast-leave {
  animation: toastSlideOut 260ms ease both;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

@media (prefers-reduced-motion: reduce) {
  .toast-enter, .toast-leave {
    animation-duration: 1ms;
    animation-name: toastFade;
  }
  @keyframes toastFade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (max-width: 600px) {
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: calc(16px + var(--toast-bottom-offset, 0px));
    width: auto;
    max-width: none;
  }
}

/* Dark toast variant, also needed on the auth pages (login/forgot-password/
   reset-password/signup) -- those pages don't load client-dark.css, only
   app.css, so this duplicates client-dark.css's .toast-container-dark rules
   verbatim (class-scoped, not ancestor-scoped, so the duplication is inert
   wherever both stylesheets happen to load together). */
.toast-container-dark .toast-card {
  background: rgba(23, 27, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.toast-container-dark .toast-title {
  color: #f4f6fb;
}

.toast-container-dark .toast-message {
  color: rgba(244, 246, 251, 0.78);
}

.toast-container-dark .toast-close {
  color: rgba(244, 246, 251, 0.55);
}

.toast-container-dark .toast-close:hover,
.toast-container-dark .toast-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f6fb;
}

.toast-container-dark .toast-success .toast-icon { color: #4ade80; }
.toast-container-dark .toast-error .toast-icon { color: #f87171; }
.toast-container-dark .toast-warning .toast-icon { color: #fbbf24; }
.toast-container-dark .toast-info .toast-icon { color: #6fa0ff; }

/* ==========================================================================
   Shared application-wide scrollbar (Super Admin, Admin, Employee, Client --
   light and dark). Single source of truth: the values below are lifted
   verbatim from the Client Dashboard "My Services" widget (previously
   .cdp-service-rows-scroll in client.css), which is the reference sleek
   scrollbar look the rest of the app is standardized on. Every other
   page/component's own scrollbar CSS has been removed in favor of this one
   rule -- do not add new page-specific ::-webkit-scrollbar overrides; extend
   the --scrollbar-thumb variables below (or add a new theme-scoped override
   of them, see .client-dark and .side-menu below) instead.

   This is intentionally a low-specificity universal rule (`*`, `!important`)
   so it applies uniformly without needing every container to opt in, while
   still losing cleanly to the two deliberate, documented exceptions below:
   the sidebar's own outer scrollbar (hidden entirely) and the always-dark
   sidebar nav list (needs a light-on-dark thumb regardless of page theme). */
:root {
  --scrollbar-size: 4px;
  --scrollbar-thumb: rgba(37, 99, 235, 0.75);
  --scrollbar-thumb-hover: rgba(37, 99, 235, 0.95);
}

/* scrollbar-width/scrollbar-color (Firefox) are spec-inherited properties,
   but relying on inheritance from `html` alone left some nested scroll
   containers computing "auto" instead of "thin" in testing. Declaring them
   directly on `*` (like the webkit rules below) sidesteps that: each element
   resolves var(--scrollbar-thumb) itself, and CSS custom properties inherit
   reliably, so theme-scoped overrides (.client-dark) still reach their
   descendants correctly through the variable, not through this property. */
* {
  scrollbar-width: thin !important;
  scrollbar-color: var(--scrollbar-thumb) transparent !important;
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size) !important;
  height: var(--scrollbar-size) !important;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent !important;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb) !important;
  border-radius: 999px !important;
  border: none !important;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover) !important;
}

*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* A handful of containers deliberately hide their scrollbar entirely
   (scrollbar-width: none / width: 0) rather than show a styled one -- the
   universal !important rule above must not resurrect those. */
.sidebar,
.layout:has(.sa-dashboard) .sidebar {
  scrollbar-width: none !important;
}

.sidebar::-webkit-scrollbar,
.layout:has(.sa-dashboard) .sidebar::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* The sidebar's own scroll areas sit on a permanently dark navy panel
   regardless of page theme (not tied to Client dark mode), so they need a
   light thumb for contrast instead of the blue-grey default above. */
.sidebar-scroll,
.side-menu {
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent !important;
}

.sidebar-scroll::-webkit-scrollbar-thumb,
.side-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25) !important;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.side-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4) !important;
}
