:root {
  --bg: #eef4fa;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --text: #20262b;
  --muted: #939a9e;
  --line: rgba(147, 154, 158, 0.35);
  --primary: #50a7f4;
  --primary-strong: #2f8fe6;
  --soft-gray: #d4d4d4;
  --danger: #dc2626;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 280px at 15% -10%, rgba(80, 167, 244, 0.2) 0%, transparent 58%),
    radial-gradient(720px 260px at 90% -16%, rgba(212, 212, 212, 0.32) 0%, transparent 52%),
    var(--bg);
}

#app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 18px 32px;
}

.hidden { display: none; }
.hidden-pane { display: none; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(24, 37, 50, 0.08);
}

.login-card {
  max-width: 420px;
  margin: 74px auto;
  padding: 34px;
  background: #ffffff;
  border-color: rgba(147, 154, 158, 0.3);
}

.login-card h1,
.login-card .muted {
  text-align: center;
}

#login-form {
  margin-top: 18px;
}

#login-form button {
  width: 100%;
}

.logo {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  object-fit: contain;
}

.logo-wide {
  width: min(360px, 100%);
  height: auto;
  border-radius: 14px;
  padding: 8px 12px;
  display: block;
  margin: 0 auto 8px;
  object-fit: contain;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

.muted {
  color: var(--muted);
  margin: 8px 0 0;
}

form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

input, select, button {
  font: inherit;
  border-radius: 14px;
}

input, select, textarea {
  border: 1px solid rgba(147, 154, 158, 0.45);
  background: #fff;
  color: var(--text);
  padding: 11px 13px;
}

textarea {
  font: inherit;
  border-radius: 14px;
  resize: vertical;
  min-height: 92px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(80, 167, 244, 0.9);
  box-shadow: 0 0 0 4px rgba(80, 167, 244, 0.18);
}

button {
  border: none;
  color: #fff;
  background: linear-gradient(180deg, #66b5f8 0%, #50a7f4 100%);
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px rgba(80, 167, 244, 0.28);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(80, 167, 244, 0.32);
}

button:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.16);
}

button.secondary {
  background: #f7f9fb;
  color: #334049;
  border: 1px solid rgba(147, 154, 158, 0.35);
  box-shadow: 0 3px 8px rgba(18, 40, 60, 0.08);
}

button.danger {
  background: #f4f9ff;
  color: #2f8fe6;
  border: 1px solid rgba(80, 167, 244, 0.45);
  box-shadow: 0 3px 8px rgba(18, 40, 60, 0.08);
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.icon-action svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.error { color: var(--danger); min-height: 20px; }

.shell {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
}

.content-area,
.modules-wrap {
  min-width: 0;
}

.side-menu {
  padding: 14px 12px;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #ffffff;
  border-color: rgba(147, 154, 158, 0.32);
  box-shadow: 0 10px 22px rgba(34, 56, 78, 0.08);
}

.brand {
  padding: 6px 4px 12px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.25);
  margin-bottom: 10px;
  text-align: center;
}

.menu-logo-wide {
  width: 100%;
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
  padding: 4px 0;
  object-fit: contain;
}

.company-branding-block {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.86);
}

.company-branding-side {
  display: grid;
  gap: 12px;
  align-content: center;
  min-width: 0;
}

.company-logo-preview {
  width: 108px;
  height: 108px;
  padding: 10px;
  object-fit: contain;
  background: #fff;
}

.company-branding-copy {
  display: grid;
  gap: 6px;
}

.company-branding-actions {
  display: flex;
  justify-content: flex-start;
}

.company-branding-copy strong {
  color: #20313e;
  font-size: 0.96rem;
  line-height: 1.25;
}

.company-branding-copy span {
  color: #67757f;
  font-size: 0.85rem;
  line-height: 1.55;
}

.menu-list {
  display: grid;
  gap: 7px;
}

.menu-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 10px 6px;
  min-height: 72px;
  border: 1px solid rgba(147, 154, 158, 0.3);
  background: #ffffff;
  color: #3f4d56;
}

.menu-link:hover {
  background: rgba(80, 167, 244, 0.09);
  box-shadow: 0 6px 14px rgba(21, 71, 118, 0.12);
}

.menu-link.is-active {
  background: linear-gradient(180deg, #66b5f8 0%, #50a7f4 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(47, 143, 230, 0.3);
}

.menu-icon {
  width: 22px;
  height: 22px;
  text-align: center;
  opacity: 0.95;
}

.menu-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.menu-text {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.1;
}

.menu-overlay { display: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  border-color: rgba(147, 154, 158, 0.24);
  box-shadow: 0 10px 22px rgba(34, 56, 78, 0.06);
}

.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.topbar-title-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

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

.topbar-followups {
  position: relative;
}

.topbar-followups-trigger {
  position: relative;
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(80, 167, 244, 0.18);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.98) 0%, rgba(238, 247, 255, 0.98) 100%);
  color: #1f5fa3;
  box-shadow: 0 8px 18px rgba(34, 56, 78, 0.05);
}

.topbar-followups-trigger:hover,
.topbar-followups-trigger[aria-expanded="true"] {
  border-color: rgba(80, 167, 244, 0.26);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(227, 240, 255, 0.98) 100%);
  color: #174d85;
}

.topbar-followups-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-followups-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.topbar-followups-count {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.28);
}

.topbar-followups-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 251, 255, 0.98) 100%);
  box-shadow: 0 20px 40px rgba(20, 44, 67, 0.14);
}

.topbar-followups-panel.hidden {
  display: none !important;
}

.topbar-followups-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topbar-followups-panel-head strong {
  display: block;
  color: #20313e;
  font-size: 0.96rem;
}

.topbar-followups-panel-head span {
  display: block;
  margin-top: 3px;
  color: #67757f;
  font-size: 0.78rem;
  line-height: 1.45;
}

.topbar-followups-list {
  display: grid;
  gap: 12px;
  max-height: min(520px, 70vh);
  overflow: auto;
}

.topbar-followups-empty {
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(147, 154, 158, 0.26);
  background: rgba(255, 255, 255, 0.9);
  color: #58656d;
  font-size: 0.84rem;
  text-align: center;
}

.topbar-followups-group {
  display: grid;
  gap: 8px;
}

.topbar-followups-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #53616b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-followups-group-list {
  display: grid;
  gap: 8px;
}

.topbar-followups-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  background: #fff;
  text-align: left;
  box-shadow: 0 8px 18px rgba(29, 46, 63, 0.04);
}

.topbar-followups-item:hover,
.topbar-followups-item:focus,
.topbar-followups-item:focus-visible {
  border-color: rgba(80, 167, 244, 0.26);
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
}

.topbar-followups-item strong {
  color: #20313e;
  font-size: 0.9rem;
  line-height: 1.3;
}

.topbar-followups-item span,
.topbar-followups-item small {
  color: #67757f;
  line-height: 1.4;
}

.topbar-followups-item small {
  font-size: 0.76rem;
}

.topbar-followups-item-state,
.lead-followup-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar-followups-item-state[data-followup-state="overdue"],
.lead-followup-status-badge[data-followup-state="overdue"] {
  background: rgba(239, 68, 68, 0.12);
  color: #b42318;
}

.topbar-followups-item-state[data-followup-state="today"],
.lead-followup-status-badge[data-followup-state="today"] {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.topbar-followups-item-state[data-followup-state="upcoming"],
.lead-followup-status-badge[data-followup-state="upcoming"] {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.topbar-followups-item-state[data-followup-state="pending"],
.lead-followup-status-badge[data-followup-state="pending"] {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.topbar-followups-item-state[data-followup-state="completed"],
.lead-followup-status-badge[data-followup-state="completed"] {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 7px 10px 7px 8px;
  border-radius: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 18px rgba(34, 56, 78, 0.05);
}

.topbar-session-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.topbar-session-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1fc16b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(31, 193, 107, 0.14);
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.user-company {
  font-size: 0.74rem;
  font-weight: 700;
  color: #6a7882;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#module-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2a3f52;
}

.icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon-only svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 16px;
  border-color: rgba(80, 167, 244, 0.18);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.98) 0%, rgba(238, 247, 255, 0.98) 100%);
  color: #1f5fa3;
  box-shadow: 0 8px 18px rgba(34, 56, 78, 0.05);
}

.logout-btn:hover {
  border-color: rgba(80, 167, 244, 0.24);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(229, 241, 255, 0.98) 100%);
  color: #174d85;
}

.logout-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 167, 244, 0.12);
  color: inherit;
  flex: 0 0 auto;
}

.logout-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(80, 167, 244, 0.38);
  background: #fff;
  box-shadow: 0 6px 14px rgba(20, 44, 67, 0.12);
}

.user-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #2d4251;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #f6f9fc;
  border: 1px solid rgba(147, 154, 158, 0.34);
  padding: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: #30404b;
}

.module-pane.is-entering { animation: pane-in 260ms ease both; }
.module-pane.is-leaving { animation: pane-out 200ms ease both; }

@keyframes pane-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.stagger-item {
  opacity: 0;
  animation: stagger-in 320ms ease both;
  animation-delay: var(--stagger-delay, 0ms);
}

@keyframes stagger-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background:
    radial-gradient(circle at top right, rgba(61, 165, 255, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(255, 255, 255, 1));
}

.dashboard-hero-copy {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.dashboard-eyebrow {
  color: #0f6cbd;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-hero-copy h3 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.15;
  color: #18344d;
}

.dashboard-hero-copy p {
  margin: 0;
  color: #5b6d79;
  font-size: 0.94rem;
  line-height: 1.7;
  max-width: 56ch;
}

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

.dashboard-kpi-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(26, 45, 67, 0.05);
}

.dashboard-kpi-card span {
  color: #68808f;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-kpi-card strong {
  color: #173652;
  font-size: 1.45rem;
  line-height: 1.1;
}

.dashboard-kpi-card small {
  color: #6d7d88;
  font-size: 0.82rem;
  line-height: 1.45;
}

.dashboard-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.dashboard-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: 0 10px 24px rgba(26, 45, 67, 0.05);
}

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

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-card-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: #0f6cbd;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-card-head h3 {
  margin: 0;
  color: #1d3448;
  font-size: 1rem;
  line-height: 1.25;
}

.dashboard-series-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.dashboard-series-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #576a77;
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-series-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.dashboard-monthly-chart {
  display: grid;
  gap: 16px;
  min-height: 280px;
}

.dashboard-monthly-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 240px;
}

.dashboard-month-col {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.dashboard-month-col strong {
  color: #617684;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-month-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
  gap: 5px;
  width: 100%;
  min-height: 220px;
  padding: 8px 6px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(247, 250, 254, 0.75), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(to top, rgba(145, 160, 173, 0.08) 0 1px, transparent 1px 44px);
}

.dashboard-month-bar {
  width: 100%;
  min-width: 0;
  height: var(--bar-height, 0%);
  align-self: end;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bar-color) 78%, white 22%), var(--bar-color));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--bar-color) 24%, transparent);
  transform-origin: bottom;
  animation: dashboard-bar-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--bar-delay, 0ms);
}

.dashboard-month-bar.is-zero {
  height: 6px;
  opacity: 0.18;
  box-shadow: none;
}

.dashboard-line-card {
  display: grid;
  gap: 16px;
}

.dashboard-line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.dashboard-line-grid {
  stroke: rgba(123, 141, 156, 0.18);
  stroke-width: 1;
}

.dashboard-line-area {
  fill: rgba(80, 167, 244, 0.12);
  animation: dashboard-line-fade 0.8s ease both;
}

.dashboard-line-path {
  fill: none;
  stroke: #0f6cbd;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: dashboard-line-draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.dashboard-line-point {
  fill: #ffffff;
  stroke: #0f6cbd;
  stroke-width: 3;
  transform-origin: center;
  animation: dashboard-point-pop 0.55s ease both;
}

.dashboard-line-labels {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-line-label {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.dashboard-line-label strong {
  color: #617684;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-line-label span {
  color: #18344d;
  font-size: 0.8rem;
  font-weight: 700;
}

@keyframes dashboard-bar-rise {
  from {
    opacity: 0.18;
    transform: scaleY(0.05);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes dashboard-line-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dashboard-line-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboard-point-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reports-module {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.reports-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background:
    radial-gradient(circle at top right, rgba(61, 165, 255, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(255, 255, 255, 1));
}

.reports-head-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.reports-head-copy h3 {
  margin: 0;
  color: #1d3448;
  font-size: 1.35rem;
  line-height: 1.2;
}

.reports-head-copy p {
  margin: 0;
  max-width: 70ch;
  color: #5f707c;
  font-size: 0.92rem;
  line-height: 1.7;
}

.reports-switcher {
  flex-wrap: wrap;
}

.reports-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.reports-filters .lead-field {
  display: grid;
  gap: 6px;
}

.reports-filters .lead-field span {
  color: #667784;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

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

.reports-summary-grid .client-related-summary-card {
  min-height: 104px;
  justify-content: space-between;
}

.reports-table-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.reports-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.reports-table-head h4 {
  margin: 0 0 4px;
  color: #1d3448;
  font-size: 1rem;
}

.reports-table-head span {
  color: #647582;
  font-size: 0.86rem;
  line-height: 1.6;
}

.report-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(80, 167, 244, 0.12);
  color: #1c5d9d;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bars-chart {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 94px 1fr auto;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 0.8rem;
  color: #5a6770;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf3f9;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #73bcf8 0%, #50a7f4 100%);
}

.bar-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4b5961;
}

.bars-empty {
  font-size: 0.82rem;
  color: var(--muted);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}

.donut-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(147, 154, 158, 0.22);
  background: conic-gradient(#e9edf2 0 360deg);
}

.donut-legend {
  display: grid;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #4b5961;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.module { padding: 14px; }

.module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.module-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.module-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.module-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-tools input {
  flex: 1 1 280px;
  min-width: 200px;
  width: auto;
}

.module-tools .btn-with-icon {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lead-list-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(147, 154, 158, 0.18);
  box-shadow: 0 18px 34px rgba(28, 43, 54, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 253, 255, 0.99) 100%);
}

.lead-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.16);
  background:
    linear-gradient(180deg, rgba(249, 251, 254, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.lead-list-toolbar-left,
.lead-list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-list-toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
}

.lead-list-toolbar-right {
  flex: 0 0 auto;
}

.lead-list-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(430px, 100%);
  flex: 1 1 420px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.22);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.lead-list-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: #7b8791;
}

.lead-list-search input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 0;
  box-shadow: none;
}

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

.lead-list-search:focus-within {
  border-color: rgba(80, 167, 244, 0.4);
  box-shadow: 0 0 0 3px rgba(80, 167, 244, 0.12);
}

.lead-list-filter-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 172px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.22);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.lead-list-filter {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 18px 12px 0;
  box-shadow: none;
  color: #30404b;
  font-weight: 600;
}

.lead-list-filter:focus {
  outline: none;
}

.lead-list-filter-wrap:focus-within {
  border-color: rgba(80, 167, 244, 0.4);
  box-shadow: 0 0 0 3px rgba(80, 167, 244, 0.12);
}

.lead-list-count {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: #4b5961;
}

.lead-list-toolbar-note {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #73818b;
}

.lead-table-wrap {
  padding: 0 14px 14px;
}

.table-wrap { overflow: auto; }

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(147, 154, 158, 0.24);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

th, td {
  text-align: left;
  padding: 12px 11px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.23);
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f9fd;
  font-weight: 700;
  color: #4b5961;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

tbody tr {
  transition: background-color 0.18s ease;
}

tbody tr:hover {
  background: rgba(80, 167, 244, 0.09);
}

td.actions {
  display: flex;
  gap: 6px;
}

td.actions button {
  padding: 0;
  font-size: 0.84rem;
}

.table-subtext {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

#tabla-leads,
#tabla-clientes,
#tabla-contacts {
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 16px;
  overflow: hidden;
}

#tabla-leads thead th,
#tabla-clientes thead th,
#tabla-contacts thead th {
  background: transparent;
  border-bottom: none;
  color: #445761;
  text-transform: none;
  font-size: 0.84rem;
  letter-spacing: 0;
  padding-top: 15px;
  padding-bottom: 15px;
}

#tabla-leads tbody td,
#tabla-clientes tbody td,
#tabla-contacts tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
}

#tabla-leads tbody tr:hover,
#tabla-clientes tbody tr:hover,
#tabla-contacts tbody tr:hover {
  background: rgba(80, 167, 244, 0.06);
}

.lead-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: auto;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent !important;
  color: inherit;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  outline: none;
  box-shadow: none !important;
  transform: none !important;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.lead-sort-btn:hover {
  background: transparent !important;
  color: #1f3e56;
  box-shadow: none !important;
  transform: none !important;
}

.lead-sort-btn.is-active {
  color: var(--primary);
}

.lead-sort-btn:focus,
.lead-sort-btn:focus-visible,
.lead-sort-btn:active {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.lead-sort-btn.is-active .lead-sort-btn-indicator {
  color: var(--primary);
}

.lead-sort-btn-indicator {
  min-width: 12px;
  color: #5c7ea1;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
}

.lead-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.lead-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: currentColor;
}

.lead-status-badge[data-status="new"] {
  background: rgba(80, 167, 244, 0.12);
  border-color: rgba(80, 167, 244, 0.2);
  color: #1f5fa3;
}

.lead-status-badge[data-status="contacted"] {
  background: rgba(95, 151, 212, 0.12);
  border-color: rgba(95, 151, 212, 0.2);
  color: #315e91;
}

.lead-status-badge[data-status="qualified"] {
  background: rgba(37, 161, 135, 0.12);
  border-color: rgba(37, 161, 135, 0.2);
  color: #18745f;
}

.lead-status-badge[data-status="proposal"] {
  background: rgba(246, 173, 85, 0.14);
  border-color: rgba(246, 173, 85, 0.22);
  color: #a55d13;
}

.lead-status-badge[data-status="won"] {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.2);
  color: #1b7f43;
}

.lead-status-badge[data-status="active"] {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.2);
  color: #1b7f43;
}

.lead-status-badge[data-status="prospect"] {
  background: rgba(80, 167, 244, 0.12);
  border-color: rgba(80, 167, 244, 0.2);
  color: #1f5fa3;
}

.lead-status-badge[data-status="inactive"] {
  background: rgba(156, 163, 175, 0.16);
  border-color: rgba(156, 163, 175, 0.22);
  color: #5f6971;
}

.lead-status-badge[data-status="lost"],
.lead-status-badge[data-status="discarded"] {
  background: rgba(156, 163, 175, 0.16);
  border-color: rgba(156, 163, 175, 0.22);
  color: #5f6971;
}

.lead-status-badge[data-status="draft"] {
  background: rgba(95, 151, 212, 0.12);
  border-color: rgba(95, 151, 212, 0.2);
  color: #315e91;
}

.lead-status-badge[data-status="sent"] {
  background: rgba(246, 173, 85, 0.14);
  border-color: rgba(246, 173, 85, 0.22);
  color: #a55d13;
}

.lead-status-badge[data-status="approved"] {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.2);
  color: #1b7f43;
}

.lead-status-badge[data-status="rejected"] {
  background: rgba(156, 163, 175, 0.16);
  border-color: rgba(156, 163, 175, 0.22);
  color: #5f6971;
}

.lead-actions-col {
  width: 116px;
}

dialog {
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border: none;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 26px 52px rgba(25, 45, 67, 0.25);
  background: #ffffff;
  border: 1px solid rgba(147, 154, 158, 0.28);
}

dialog::backdrop {
  background: rgba(18, 18, 20, 0.38);
}

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

.dialog-form-lead {
  min-width: min(94vw, 980px);
}

.lead-detail-page {
  display: grid;
  gap: 18px;
  margin-top: 0;
}

.detail-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-back-row .secondary {
  padding-inline: 14px;
  border-radius: 999px;
  font-weight: 700;
}

.detail-back-row .btn-with-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.lead-module-head-left {
  display: grid;
  gap: 10px;
}

.lead-subnav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  width: fit-content;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.lead-subnav.hidden {
  display: none !important;
}

.lead-subnav-top {
  margin-left: 0;
}

.lead-subnav-compact {
  padding: 0;
}

.lead-subnav-link {
  min-width: 0;
  background: transparent;
  color: #62717c;
  border: none;
  border-bottom: 2px solid transparent;
  box-shadow: none;
  padding: 4px 0 10px;
  font-weight: 700;
  border-radius: 0;
}

.lead-subnav-link:hover {
  transform: none;
  box-shadow: none;
  background: transparent;
  color: #233947;
  border-bottom-color: rgba(80, 167, 244, 0.22);
}

.lead-subnav-link.is-active {
  background: transparent;
  color: #1f4f82;
  border-bottom-color: var(--primary);
  box-shadow: none;
}

.lead-module-head {
  align-items: flex-start;
}

.lead-record-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(147, 154, 158, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  box-shadow: 0 8px 18px rgba(29, 46, 63, 0.05);
}

.lead-details-shell {
  display: grid;
  gap: 16px;
}

#crm-view.contextual-contact-detail .shell {
  grid-template-columns: 1fr;
}

#crm-view.contextual-contact-detail .side-menu,
#crm-view.contextual-contact-detail .menu-overlay,
#crm-view.contextual-contact-detail #btn-menu {
  display: none !important;
}

#crm-view.contextual-contact-detail .content-area,
#crm-view.contextual-contact-detail #contact-detail-pane,
#crm-view.contextual-contact-detail .lead-detail-page,
#crm-view.contextual-contact-detail .lead-details-shell,
#crm-view.contextual-contact-detail .lead-record-header,
#crm-view.contextual-contact-detail .lead-detail-card {
  width: 100%;
  min-width: 0;
}

#crm-view.contextual-contact-detail .topbar {
  padding-left: 22px;
  padding-right: 22px;
}

#crm-view.contextual-estimate-detail .shell {
  grid-template-columns: 1fr;
}

#crm-view.contextual-estimate-detail .side-menu,
#crm-view.contextual-estimate-detail .menu-overlay,
#crm-view.contextual-estimate-detail #btn-menu {
  display: none !important;
}

#crm-view.contextual-estimate-detail .content-area,
#crm-view.contextual-estimate-detail #estimate-detail-pane,
#crm-view.contextual-estimate-detail .lead-detail-page,
#crm-view.contextual-estimate-detail .lead-details-shell,
#crm-view.contextual-estimate-detail .lead-record-header,
#crm-view.contextual-estimate-detail .lead-detail-card {
  width: 100%;
  min-width: 0;
}

#crm-view.contextual-estimate-detail .topbar {
  padding-left: 22px;
  padding-right: 22px;
}

.estimate-detail-page {
  gap: 20px;
}

.estimate-detail-page .lead-details-shell {
  gap: 18px;
}

.lead-record-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.lead-record-main-compact {
  align-items: flex-start;
}

.lead-record-id-block {
  display: grid;
  gap: 2px;
  min-width: 84px;
  padding-right: 16px;
  border-right: 1px solid rgba(147, 154, 158, 0.18);
}

.lead-record-id-block strong {
  color: #1e3140;
  line-height: 1.2;
  font-size: 1rem;
  font-weight: 800;
}

.lead-record-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.lead-record-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: #485863;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.lead-record-meta-line strong {
  color: #1f3546;
  font-weight: 800;
}

.lead-record-meta-divider {
  color: rgba(74, 92, 106, 0.56);
  font-weight: 700;
}

.lead-record-title h3 {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 700;
  color: #1e3140;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-record-status-wrap {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
  min-width: 154px;
  padding-left: 16px;
  border-left: 1px solid rgba(147, 154, 158, 0.18);
}

.lead-record-status-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a6b76;
}

.lead-record-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(147, 154, 158, 0.18);
  box-shadow: 0 10px 20px rgba(29, 46, 63, 0.05);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.lead-record-status-select {
  appearance: none;
  min-width: 168px;
  justify-content: flex-start;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.lead-record-status-select:focus {
  outline: none;
  border-color: rgba(80, 167, 244, 0.42);
  box-shadow: 0 0 0 4px rgba(80, 167, 244, 0.14);
}

.lead-record-header[data-status="new"] {
  background: linear-gradient(135deg, rgba(80, 167, 244, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(80, 167, 244, 0.22);
}

.lead-record-header[data-status="new"] .lead-record-status {
  color: #1f5fa3;
}

.lead-record-header[data-status="contacted"] {
  background: linear-gradient(135deg, rgba(95, 151, 212, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(95, 151, 212, 0.22);
}

.lead-record-header[data-status="contacted"] .lead-record-status {
  color: #315e91;
}

.lead-record-header[data-status="qualified"] {
  background: linear-gradient(135deg, rgba(37, 161, 135, 0.16) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(37, 161, 135, 0.22);
}

.lead-record-header[data-status="qualified"] .lead-record-status {
  color: #18745f;
}

.lead-record-header[data-status="proposal"] {
  background: linear-gradient(135deg, rgba(246, 173, 85, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(246, 173, 85, 0.24);
}

.lead-record-header[data-status="proposal"] .lead-record-status {
  color: #a55d13;
}

.lead-record-header[data-status="won"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(34, 197, 94, 0.22);
}

.lead-record-header[data-status="won"] .lead-record-status {
  color: #1b7f43;
}

.lead-record-header[data-status="active"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(34, 197, 94, 0.22);
}

.lead-record-header[data-status="active"] .lead-record-status {
  color: #1b7f43;
}

.lead-record-header[data-status="prospect"] {
  background: linear-gradient(135deg, rgba(80, 167, 244, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(80, 167, 244, 0.22);
}

.lead-record-header[data-status="prospect"] .lead-record-status {
  color: #1f5fa3;
}

.lead-record-header[data-status="lost"],
.lead-record-header[data-status="discarded"],
.lead-record-header[data-status="inactive"] {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(156, 163, 175, 0.22);
}

.lead-record-header[data-status="lost"] .lead-record-status,
.lead-record-header[data-status="discarded"] .lead-record-status,
.lead-record-header[data-status="inactive"] .lead-record-status {
  color: #5f6971;
}

.lead-record-header[data-status="draft"] {
  background: linear-gradient(135deg, rgba(95, 151, 212, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(95, 151, 212, 0.22);
}

.lead-record-header[data-status="draft"] .lead-record-status {
  color: #315e91;
}

.lead-record-header[data-status="sent"] {
  background: linear-gradient(135deg, rgba(246, 173, 85, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(246, 173, 85, 0.24);
}

.lead-record-header[data-status="sent"] .lead-record-status {
  color: #a55d13;
}

.lead-record-header[data-status="approved"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(34, 197, 94, 0.22);
}

.lead-record-header[data-status="approved"] .lead-record-status {
  color: #1b7f43;
}

.lead-record-header[data-status="rejected"] {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.18) 0%, rgba(255, 255, 255, 0.96) 72%);
  border-color: rgba(156, 163, 175, 0.22);
}

.lead-record-header[data-status="rejected"] .lead-record-status {
  color: #5f6971;
}

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

.lead-notes-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  min-height: 420px;
}

.lead-notes-sidebar {
  min-width: 0;
}

.lead-notes-nav {
  display: grid;
  gap: 8px;
}

.lead-note-nav-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: #fff;
  text-align: left;
  box-shadow: 0 6px 14px rgba(29, 46, 63, 0.04);
}

.lead-note-nav-item.is-active {
  border-color: rgba(80, 167, 244, 0.3);
  background: linear-gradient(180deg, rgba(243, 249, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 10px 20px rgba(80, 167, 244, 0.12);
}

.lead-note-nav-item strong {
  color: #20313e;
  font-size: 0.94rem;
  line-height: 1.3;
}

.lead-note-nav-item span {
  color: #67757f;
  font-size: 0.78rem;
  line-height: 1.35;
}

.lead-note-nav-item small {
  color: #4f5e68;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lead-estimate-nav-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.lead-estimate-nav-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lead-estimate-nav-main strong {
  color: #20313e;
  font-size: 0.94rem;
  line-height: 1.28;
}

.lead-estimate-nav-main span {
  color: #67757f;
  font-size: 0.78rem;
  line-height: 1.35;
}

.lead-estimate-nav-main small {
  color: #4f5e68;
  font-size: 0.82rem;
  line-height: 1.4;
}

.lead-estimate-nav-status {
  display: grid;
  gap: 2px;
  min-width: 108px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(180deg, rgba(242, 245, 248, 0.98) 0%, rgba(234, 238, 242, 0.98) 100%);
  text-align: right;
}

.lead-estimate-nav-status span {
  color: #73818b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-estimate-nav-status strong {
  color: #586670;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.lead-estimate-nav-item.is-active .lead-estimate-nav-status {
  border-color: rgba(80, 167, 244, 0.24);
  background: linear-gradient(180deg, rgba(80, 167, 244, 0.18) 0%, rgba(225, 239, 252, 0.98) 100%);
}

.lead-estimate-nav-item.is-active .lead-estimate-nav-status span,
.lead-estimate-nav-item.is-active .lead-estimate-nav-status strong {
  color: #1e5b92;
}

.lead-note-preview-pane {
  min-width: 0;
}

.lead-note-preview-card {
  display: grid;
  gap: 16px;
  min-height: 100%;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 255, 0.92) 100%);
  box-shadow: 0 12px 24px rgba(29, 46, 63, 0.05);
}

.lead-note-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.lead-note-preview-copy {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
}

.lead-note-preview-copy span {
  color: #6a7882;
  font-size: 0.8rem;
  line-height: 1.35;
}

.lead-note-preview-copy strong {
  color: #20313e;
  font-size: 1.08rem;
  line-height: 1.3;
}

.lead-note-preview-body {
  color: #41515c;
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: normal;
}

.lead-estimates-workspace {
  min-height: 460px;
}

.lead-followups-workspace {
  min-height: 460px;
}

.lead-payments-workspace {
  min-height: 460px;
}

.lead-payments-summary-grid {
  margin-bottom: 14px;
}

.payment-balance-strip {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(80, 167, 244, 0.16);
  background: linear-gradient(180deg, rgba(241, 247, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.payment-balance-strip span {
  color: #527087;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-balance-strip strong {
  color: #173652;
  font-size: 1rem;
  line-height: 1.2;
}

.payment-balance-strip small {
  color: #60717d;
  font-size: 0.82rem;
  line-height: 1.45;
}

.payment-balance-strip[data-balance-state="exhausted"] {
  border-color: rgba(208, 84, 84, 0.18);
  background: linear-gradient(180deg, rgba(255, 245, 245, 0.96), rgba(255, 255, 255, 0.98));
}

.payment-balance-strip[data-balance-state="overflow"] {
  border-color: rgba(208, 84, 84, 0.24);
  background: linear-gradient(180deg, rgba(255, 239, 239, 0.98), rgba(255, 255, 255, 0.98));
}

.payment-balance-strip[data-balance-state="overflow"] strong,
.payment-balance-strip[data-balance-state="exhausted"] strong {
  color: #af2a2a;
}

.lead-followup-nav-item span,
.lead-followup-nav-item small,
.lead-payment-nav-item span,
.lead-payment-nav-item small {
  display: block;
}

.lead-followup-preview-card {
  align-content: start;
}

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

.lead-followup-preview-block {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

.lead-followup-preview-block span {
  color: #66757f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lead-followup-preview-block p {
  margin: 0;
  color: #40515c;
  font-size: 0.92rem;
  line-height: 1.7;
}

.lead-followup-preview-foot {
  color: #5f6d76;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lead-payment-preview-card {
  align-content: start;
}

.lead-payment-preview-grid {
  align-items: start;
}

.lead-payment-receipt-block {
  gap: 12px;
}

.payment-receipt-preview {
  display: grid;
  gap: 10px;
}

.payment-receipt-head {
  padding-bottom: 0;
}

.payment-receipt-body {
  min-height: 280px;
  border-radius: 14px;
  overflow: hidden;
}

.payment-receipt-image,
.payment-receipt-frame {
  width: 100%;
  min-height: 280px;
  border: 0;
}

.payment-receipt-fallback {
  min-height: 220px;
}

.lead-estimate-preview-card {
  gap: 18px;
}

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

.lead-estimate-preview-actions .icon-action {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
}

.lead-estimate-preview-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-estimate-preview-meta-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  background: #f8fbff;
}

.lead-estimate-preview-meta-item span,
.lead-estimate-preview-observations span,
.lead-estimate-preview-products-head span {
  color: #6a7882;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-estimate-preview-meta-item strong {
  color: #20313e;
  font-size: 0.98rem;
  line-height: 1.35;
}

.lead-estimate-preview-meta-item small {
  color: #54636d;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lead-estimate-preview-observations {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  background: rgba(248, 251, 255, 0.9);
}

.lead-estimate-preview-observations p {
  margin: 0;
  color: #41515c;
  line-height: 1.7;
}

.lead-estimate-preview-products {
  display: grid;
  gap: 12px;
}

.lead-estimate-preview-products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lead-estimate-preview-products-head strong {
  color: #233947;
  font-size: 0.9rem;
}

.lead-estimate-preview-product-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.lead-estimate-preview-product-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  background: #fff;
}

.lead-estimate-preview-product-media {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(147, 154, 158, 0.14);
}

.lead-estimate-preview-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lead-estimate-preview-product-media span {
  color: #2e577f;
  font-size: 1rem;
  font-weight: 800;
}

.lead-estimate-preview-product-main,
.lead-estimate-preview-product-side {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lead-estimate-preview-product-main strong,
.lead-estimate-preview-product-side strong {
  color: #20313e;
  font-size: 0.92rem;
}

.lead-estimate-preview-product-main span,
.lead-estimate-preview-product-side span,
.lead-estimate-preview-items-empty {
  color: #66757f;
  font-size: 0.82rem;
  line-height: 1.45;
}

.lead-estimate-preview-product-side {
  text-align: right;
}

.lead-estimate-preview-totals {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.lead-note-empty-shell {
  min-height: 340px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.92) 100%);
}

.lead-note-empty-shell .attachment-preview-empty-rich {
  min-height: 340px;
}

.lead-note-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: #fff;
  box-shadow: 0 10px 20px rgba(29, 46, 63, 0.05);
}

.lead-note-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lead-note-card-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.lead-note-card-copy strong {
  font-size: 0.98rem;
  color: #20313e;
  line-height: 1.3;
}

.lead-note-card-copy span {
  font-size: 0.82rem;
  color: #6b7981;
  line-height: 1.45;
}

.lead-note-card-body {
  color: #41515c;
  font-size: 0.92rem;
  line-height: 1.7;
}

.lead-note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-lead-note .estimate-form {
  grid-template-columns: minmax(0, 1fr);
}

.lead-note-form-grid {
  padding-top: 8px;
}

.lead-note-form-field {
  grid-column: span 2;
}

.lead-note-form-field-full {
  grid-column: 1 / -1;
}

.lead-details-shell {
  padding: 0;
}

#lead-detail-pane,
#client-detail-pane,
#contact-detail-pane,
#catalog-detail-pane,
#estimate-detail-pane,
#user-detail-pane,
#company-detail-pane {
  width: 100%;
}

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

.lead-detail-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(147, 154, 158, 0.22);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(29, 46, 63, 0.05);
}

#estimate-detail-pane .estimate-detail-main-card {
  width: 100%;
}

.lead-section-title {
  display: grid;
  gap: 4px;
}

.lead-section-title h4 {
  margin: 0;
  font-size: 0.98rem;
}

.lead-section-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

#lead-detail-pane .lead-detail-card > .detail-card-head,
#lead-detail-pane .lead-detail-card > .lead-section-title,
#lead-detail-pane .client-workspace-head,
#client-detail-pane .lead-detail-card > .detail-card-head,
#client-detail-pane .lead-detail-card > .lead-section-title,
#client-detail-pane .client-workspace-head,
#contact-detail-pane .lead-detail-card > .detail-card-head,
#contact-detail-pane .lead-detail-card > .lead-section-title,
#catalog-detail-pane .lead-detail-card > .detail-card-head,
#catalog-detail-pane .lead-detail-card > .lead-section-title,
#catalog-detail-pane .client-workspace-head,
#estimate-detail-pane .lead-detail-card > .detail-card-head,
#estimate-detail-pane .lead-detail-card > .lead-section-title,
#user-detail-pane .lead-detail-card > .detail-card-head,
#user-detail-pane .lead-detail-card > .lead-section-title,
#company-detail-pane .lead-detail-card > .detail-card-head,
#company-detail-pane .lead-detail-card > .lead-section-title {
  margin: -18px -18px 6px;
  padding: 11px 14px;
  border-radius: 16px 16px 12px 12px;
  background:
    linear-gradient(180deg, rgba(225, 239, 252, 0.96) 0%, rgba(243, 248, 255, 0.98) 100%);
  border-bottom: 1px solid rgba(80, 167, 244, 0.14);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.82);
}

#lead-detail-pane .detail-card-head,
#client-detail-pane .detail-card-head,
#contact-detail-pane .detail-card-head,
#catalog-detail-pane .detail-card-head,
#estimate-detail-pane .detail-card-head,
#user-detail-pane .detail-card-head {
  min-height: 58px;
}

#company-detail-pane .detail-card-head {
  min-height: 58px;
}

#lead-detail-pane .detail-card-head-static,
#client-detail-pane .detail-card-head-static,
#contact-detail-pane .detail-card-head-static,
#catalog-detail-pane .detail-card-head-static,
#estimate-detail-pane .detail-card-head-static,
#user-detail-pane .detail-card-head-static {
  justify-content: flex-start;
}

#company-detail-pane .detail-card-head-static {
  justify-content: flex-start;
}

#lead-detail-pane .lead-section-title,
#client-detail-pane .lead-section-title,
#contact-detail-pane .lead-section-title,
#catalog-detail-pane .lead-section-title,
#estimate-detail-pane .lead-section-title,
#user-detail-pane .lead-section-title,
#company-detail-pane .lead-section-title {
  gap: 2px;
}

#lead-detail-pane .lead-section-title h4,
#client-detail-pane .lead-section-title h4,
#contact-detail-pane .lead-section-title h4,
#catalog-detail-pane .lead-section-title h4,
#estimate-detail-pane .lead-section-title h4,
#user-detail-pane .lead-section-title h4,
#company-detail-pane .lead-section-title h4 {
  color: #1c4f80;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.15;
}

#lead-detail-pane .lead-section-title span,
#client-detail-pane .lead-section-title span,
#contact-detail-pane .lead-section-title span,
#catalog-detail-pane .lead-section-title span,
#estimate-detail-pane .lead-section-title span,
#user-detail-pane .lead-section-title span,
#company-detail-pane .lead-section-title span {
  color: #5b7183;
  font-size: 0.74rem;
  line-height: 1.25;
}

#company-detail-pane .client-workspace-card {
  grid-column: 1 / -1;
}

#company-detail-pane .client-related-list {
  min-height: 420px;
}

#lead-detail-pane .detail-card-head .icon-action,
#lead-detail-pane .client-workspace-head .lead-subnav,
#client-detail-pane .detail-card-head .icon-action,
#client-detail-pane .client-workspace-head .lead-subnav,
#catalog-detail-pane .detail-card-head .icon-action,
#catalog-detail-pane .client-workspace-head .lead-subnav {
  position: relative;
  z-index: 1;
}

#lead-detail-pane .detail-card-head .icon-action,
#client-detail-pane .detail-card-head .icon-action,
#catalog-detail-pane .detail-card-head .icon-action {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(80, 167, 244, 0.18);
  box-shadow: 0 6px 14px rgba(80, 167, 244, 0.1);
}

.lead-record-main-compact {
  gap: 14px;
}

.lead-record-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.lead-record-nav .icon-action {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.lead-record-nav .icon-action:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.lead-record-position {
  min-width: 62px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #587084;
  letter-spacing: 0.03em;
}

.detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.detail-readonly-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.98));
}

.detail-readonly-item span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8790;
}

.detail-readonly-item strong {
  color: #20313e;
  font-size: 0.94rem;
  line-height: 1.35;
}

.lead-form-head,
.lead-form-grid {
  display: grid;
  gap: 12px;
}

.lead-form-head {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-field {
  display: grid;
  gap: 6px;
}

.lead-field-full {
  grid-column: 1 / -1;
}

.lead-summary-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lead-summary-inline div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  background: #f8fbff;
}

.lead-summary-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-summary-inline span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-summary-inline strong {
  color: #243746;
  line-height: 1.35;
}

.lead-summary-inline small {
  color: #6d7a83;
  line-height: 1.45;
}

.lead-assignment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.lead-assignment-summary {
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lead-assignment-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.lead-attachments-box {
  margin-top: 0;
}

.client-workspace-card {
  gap: 16px;
}

.client-workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.client-workspace-nav {
  flex-shrink: 0;
}

.client-detail-tab-panel {
  display: grid;
  gap: 14px;
}

.client-detail-tab-panel.hidden {
  display: none !important;
}

.client-related-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 4px 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.client-related-toolbar-left,
.client-related-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.client-related-toolbar-right {
  margin-left: auto;
  justify-content: flex-end;
}

.client-estimates-toolbar-left {
  flex: 1 1 540px;
  min-width: 0;
}

.client-estimates-search {
  min-width: 280px;
  max-width: 460px;
}

.client-estimates-filter-wrap {
  min-width: 180px;
}

.client-related-copy {
  display: grid;
  gap: 6px;
}

.client-related-copy strong {
  color: #20313e;
  font-size: 0.98rem;
  line-height: 1.3;
}

.client-related-copy span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8790;
}

.client-photo-card {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.client-photo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.client-primary-contact-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(80, 167, 244, 0.12);
  color: #1f5fa3;
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}

.client-table-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-table-photo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f7fb;
  border: 1px solid rgba(147, 154, 158, 0.18);
  flex: 0 0 42px;
}

.client-table-copy {
  min-width: 0;
}

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

.company-user-nav-item {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.company-user-nav-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 42px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: #f3f7fb;
}

.company-user-nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.company-user-nav-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-user-preview-head {
  align-items: flex-start;
}

.company-user-preview-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.company-user-preview-photo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(147, 154, 158, 0.22);
  background: #f3f7fb;
  flex: 0 0 72px;
}

.company-user-access-shell {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.company-user-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.company-user-access-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.company-user-access-item.is-active {
  border-color: rgba(80, 167, 244, 0.36);
  box-shadow: 0 10px 24px rgba(80, 167, 244, 0.08);
}

.company-user-access-item.is-disabled {
  opacity: 0.58;
}

.company-user-access-item input {
  margin-top: 2px;
}

.company-user-access-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-user-access-copy strong {
  color: #20313e;
  font-size: 0.88rem;
  line-height: 1.2;
}

.company-user-access-copy small {
  color: #6f7d87;
  line-height: 1.4;
}

.company-user-access-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #6f7d87;
  font-size: 0.84rem;
}

.company-workspace-card {
  grid-column: 1 / -1;
}

.company-workspace-card .lead-detail-grid {
  gap: 18px;
}

.company-terms-grid {
  align-items: start;
}

.company-terms-textarea {
  min-height: 320px;
  resize: vertical;
}

.company-terms-preview {
  display: grid;
  gap: 12px;
  min-height: 320px;
  padding: 18px 20px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.company-terms-preview p {
  margin: 0;
  color: #22313f;
  line-height: 1.7;
  white-space: normal;
}

.company-terms-preview-empty {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 100%;
  color: #6e7b84;
}

.company-terms-preview-empty strong {
  color: #20313e;
  font-size: 0.96rem;
}

.company-terms-preview-empty span {
  line-height: 1.55;
}

.client-related-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-related-summary-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: #fff;
  box-shadow: 0 8px 18px rgba(29, 46, 63, 0.04);
}

.client-related-summary-card span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8790;
}

.client-related-summary-card strong {
  color: #20313e;
  font-size: 1rem;
  line-height: 1.35;
}

.client-related-note {
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(147, 154, 158, 0.24);
  background: rgba(248, 251, 255, 0.82);
  color: #67757f;
  font-size: 0.9rem;
  line-height: 1.55;
}

.client-related-section-title {
  margin-top: 4px;
}

.client-related-associated-list {
  display: grid;
  gap: 8px;
}

.client-related-empty {
  padding: 28px 22px;
  border: 1px dashed rgba(147, 154, 158, 0.28);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.82);
  color: #67757f;
  font-size: 0.9rem;
}

.client-related-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(29, 46, 63, 0.04);
}

.client-related-contact-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.client-related-contact-name {
  color: #20313e;
  font-size: 0.95rem;
  line-height: 1.25;
}

.client-related-contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #67757f;
  font-size: 0.78rem;
  line-height: 1.35;
}

.client-related-contact-meta span {
  position: relative;
}

.client-related-contact-meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(103, 117, 127, 0.36);
  transform: translateY(-50%);
}

.client-related-contact-side {
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-items: end;
  gap: 10px;
}

.client-related-contact-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.estimate-assignment-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.estimate-products-card {
  gap: 16px;
}

.estimate-products-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.estimate-products-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.estimate-detail-items {
  display: grid;
  gap: 12px;
}

.estimate-totals-panel {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.98));
}

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

.estimate-total-row span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8790;
}

.estimate-total-row strong {
  color: #20313e;
  font-size: 1rem;
  line-height: 1.2;
}

.estimate-discount-row input {
  width: 220px;
  max-width: 100%;
  text-align: right;
}

.estimate-tax-row {
  padding-top: 4px;
}

.estimate-tax-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #20313e;
}

.estimate-tax-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.catalog-tax-field {
  gap: 10px;
}

.catalog-tax-field > span:first-child {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8790;
}

.estimate-total-row-final {
  padding-top: 12px;
  border-top: 1px solid rgba(147, 154, 158, 0.18);
}

.estimate-total-row-final strong {
  font-size: 1.18rem;
  color: var(--primary);
}

.estimate-items-empty {
  padding: 28px 22px;
  border: 1px dashed rgba(147, 154, 158, 0.24);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.82);
  color: #67757f;
  font-size: 0.9rem;
}

.estimate-item-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(84px, 92px) minmax(104px, 116px) minmax(96px, 108px) 40px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(29, 46, 63, 0.04);
}

.estimate-item-media {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(145deg, rgba(235, 243, 251, 0.96), rgba(248, 251, 255, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.estimate-item-media.has-image {
  background: #fff;
}

.estimate-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.estimate-item-media span {
  padding: 0 10px;
  text-align: center;
  color: #6d7a83;
  font-size: 0.72rem;
  font-weight: 700;
}

.estimate-item-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.estimate-item-name {
  color: #20313e;
  font-size: 0.98rem;
  line-height: 1.3;
}

.estimate-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  color: #67757f;
  font-size: 0.8rem;
}

.estimate-item-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.estimate-item-field input {
  width: 100%;
  min-width: 0;
}

.estimate-item-field span,
.estimate-item-total-box span,
.estimate-product-picker-copy .client-contact-picker-meta {
  line-height: 1.4;
}

.estimate-item-field span,
.estimate-item-total-box span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8790;
}

.estimate-item-total-box {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.estimate-item-total-box strong {
  color: #20313e;
  font-size: 1rem;
  line-height: 1.2;
}

.estimate-item-tax-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.estimate-item-tax-badge[data-taxable="true"] {
  background: rgba(58, 149, 193, 0.12);
  color: #196f95;
}

.estimate-item-tax-badge[data-taxable="false"] {
  background: rgba(111, 122, 132, 0.12);
  color: #52616d;
}

.estimate-product-picker-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.estimate-product-picker-main {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.estimate-product-picker-thumb {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(145deg, rgba(235, 243, 251, 0.96), rgba(248, 251, 255, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.estimate-product-picker-thumb.has-image {
  background: #fff;
}

.estimate-product-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.estimate-product-picker-thumb span {
  padding: 0 8px;
  text-align: center;
  color: #6d7a83;
  font-size: 0.7rem;
  font-weight: 700;
}

.estimate-product-picker-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.estimate-product-picker-new-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 0;
}

.catalog-image-col {
  width: 88px;
}

.catalog-table-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: linear-gradient(145deg, rgba(235, 243, 251, 0.96), rgba(248, 251, 255, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.catalog-table-thumb.has-image {
  background: #fff;
}

.catalog-table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-table-thumb span {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4473a6;
}

.catalog-images-box {
  display: grid;
  gap: 12px;
}

.catalog-images-actions {
  justify-content: space-between;
  align-items: center;
}

.catalog-images-actions input[type="file"] {
  max-width: 360px;
}

.catalog-images-workspace {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.catalog-images-sidebar {
  padding: 10px;
}

.catalog-image-list {
  gap: 10px;
}

.catalog-image-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(147, 154, 158, 0.22);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.catalog-image-item.is-active {
  border-color: rgba(80, 167, 244, 0.35);
  background: rgba(80, 167, 244, 0.07);
  box-shadow: inset 0 0 0 1px rgba(80, 167, 244, 0.12);
}

.catalog-image-select {
  min-height: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  text-align: left;
}

.catalog-image-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(235, 243, 251, 0.96);
  border: 1px solid rgba(147, 154, 158, 0.16);
  flex-shrink: 0;
}

.catalog-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-image-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.catalog-image-copy strong {
  color: #20313e;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-image-copy span {
  color: #6c7982;
  font-size: 0.78rem;
  line-height: 1.35;
}

.catalog-image-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.catalog-image-primary-btn {
  min-height: 34px;
  padding-inline: 12px;
}

.catalog-primary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(80, 167, 244, 0.12);
  color: #22649d;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.catalog-image-preview {
  min-height: 100%;
}

.catalog-image-preview-empty {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed rgba(147, 154, 158, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(255, 255, 255, 0.98));
  text-align: center;
  color: #67757f;
}

.catalog-image-preview-empty strong {
  color: #20313e;
}

.catalog-image-preview-body {
  display: grid;
  gap: 16px;
}

.catalog-image-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.catalog-image-preview-stage {
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(255, 255, 255, 0.98));
  padding: 16px;
  min-height: 380px;
  display: grid;
  place-items: center;
}

.catalog-image-preview-img {
  max-width: 100%;
  max-height: 520px;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 18px 34px rgba(29, 46, 63, 0.12);
}

.client-related-action {
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  color: #1f4f82;
  font-weight: 700;
}

.client-related-action:hover,
.client-related-action:focus,
.client-related-action:focus-visible,
.client-related-action:active {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  color: #153c66;
}

.client-related-action.is-danger {
  color: #b44747;
}

.client-related-action.is-danger:hover,
.client-related-action.is-danger:focus,
.client-related-action.is-danger:focus-visible,
.client-related-action.is-danger:active {
  color: #913535;
}

.list-context-chip {
  min-height: auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(80, 167, 244, 0.18);
  background: rgba(80, 167, 244, 0.1);
  color: #1f4f82;
  font-weight: 700;
  box-shadow: none;
}

.list-context-chip:hover,
.list-context-chip:focus,
.list-context-chip:focus-visible,
.list-context-chip:active {
  background: rgba(80, 167, 244, 0.14);
  color: #183f69;
  box-shadow: none;
  transform: none;
}

.dialog-client-contact-picker {
  width: min(980px, 96vw);
}

.client-contact-picker-form {
  gap: 0;
}

.client-contact-picker-nav {
  margin: 0 24px;
  padding-top: 14px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.16);
}

.client-contact-picker-panel {
  display: grid;
  gap: 0;
}

.client-contact-picker-panel.hidden {
  display: none !important;
}

.client-contact-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.18);
}

.client-contact-picker-head h3 {
  margin: 0;
  font-size: 1.16rem;
}

.client-contact-picker-head .muted {
  margin-top: 6px;
}

.client-contact-picker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.12);
  background: rgba(248, 251, 255, 0.88);
}

.client-contact-picker-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-contact-picker-list {
  display: grid;
  gap: 10px;
  padding: 20px 24px;
  max-height: min(56vh, 620px);
  overflow: auto;
}

.client-contact-picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(29, 46, 63, 0.04);
}

.client-contact-picker-row.is-linked {
  background: rgba(248, 251, 255, 0.9);
}

.client-contact-picker-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-contact-picker-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.client-contact-picker-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.client-contact-picker-main strong {
  color: #20313e;
  line-height: 1.25;
}

.client-contact-picker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #67757f;
  font-size: 0.84rem;
}

.client-contact-picker-meta span {
  position: relative;
}

.client-contact-picker-meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(103, 117, 127, 0.36);
  transform: translateY(-50%);
}

.client-contact-picker-empty {
  padding: 28px 22px;
  border: 1px dashed rgba(147, 154, 158, 0.24);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.82);
  color: #67757f;
  font-size: 0.9rem;
}

.client-contact-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(147, 154, 158, 0.12);
}

.dialog-opportunity-assignment {
  width: min(1480px, 98vw);
  max-height: 94vh;
}

.estimate-form.opportunity-assignment-form {
  grid-template-columns: minmax(0, 1fr);
}

.opportunity-assignment-form {
  grid-template-columns: minmax(0, 1fr);
  min-height: min(92vh, 980px);
}

.dialog-opportunity-assignment .estimate-form-main {
  width: 100%;
  max-width: none;
}

.opportunity-assignment-main {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  padding: 0;
  min-height: 0;
}

.opportunity-assignment-head {
  border-bottom-color: rgba(147, 154, 158, 0.16);
}

.opportunity-assignment-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: #4b83b9;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.opportunity-assignment-step-nav,
.opportunity-assignment-mode-nav {
  margin: 0 24px;
}

.opportunity-assignment-step-nav {
  padding-top: 14px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.16);
  gap: 10px;
}

.opportunity-assignment-step-nav .lead-subnav-link {
  border-radius: 12px 12px 0 0;
  padding-inline: 10px;
}

.opportunity-assignment-step-nav .lead-subnav-link.is-active {
  background: linear-gradient(180deg, rgba(80, 167, 244, 0.12), rgba(80, 167, 244, 0.04));
  color: #1f4f82;
  border-bottom-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(80, 167, 244, 0.16);
}

.opportunity-assignment-step-nav .lead-subnav-link.is-complete {
  color: #1f6bb7;
  border-bottom-color: rgba(80, 167, 244, 0.34);
}

.opportunity-assignment-mode-nav {
  padding-top: 14px;
}

.opportunity-assignment-step {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  min-height: 0;
}

.opportunity-assignment-step.hidden,
.opportunity-assignment-panel.hidden {
  display: none !important;
}

.opportunity-assignment-panel {
  display: grid;
  gap: 0;
  min-height: 0;
}

.opportunity-assignment-step > .client-contact-picker-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, #ffffff 28%);
  backdrop-filter: blur(10px);
}

.opportunity-assignment-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 24px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.14);
}

.opportunity-assignment-stage-head > div:first-child {
  min-width: 0;
  flex: 1 1 280px;
}

.opportunity-assignment-stage-cancel {
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}

.opportunity-assignment-stage-head strong {
  color: #20313e;
  font-size: 0.98rem;
  line-height: 1.25;
}

.opportunity-assignment-stage-head span {
  display: block;
  margin-top: 5px;
  color: #67757f;
  font-size: 0.84rem;
  line-height: 1.5;
}

.opportunity-assignment-panel .client-contact-picker-list {
  max-height: min(64vh, 760px);
  min-height: 0;
  padding-top: 18px;
  padding-bottom: 18px;
}

.opportunity-assignment-create-card {
  display: grid;
  gap: 18px;
  margin: 22px 24px 18px;
  padding: 22px 24px 24px;
  border: 1px solid rgba(147, 154, 158, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(80, 167, 244, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), #ffffff);
  box-shadow: 0 18px 42px rgba(29, 46, 63, 0.06);
}

.opportunity-assignment-create-head {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.14);
}

.opportunity-assignment-create-head strong {
  color: #20313e;
  font-size: 1rem;
  line-height: 1.25;
}

.opportunity-assignment-create-head span {
  color: #67757f;
  font-size: 0.84rem;
  line-height: 1.5;
}

.opportunity-assignment-context {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin: 0;
  min-width: 180px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(80, 167, 244, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 167, 244, 0.08), rgba(80, 167, 244, 0.04));
}

.opportunity-assignment-context span {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c7a83;
}

.opportunity-assignment-context strong {
  color: #20313e;
  line-height: 1.35;
  font-size: 0.84rem;
  word-break: break-word;
}

.opportunity-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.opportunity-assignment-row.is-active .opportunity-assignment-row-edit {
  border-color: rgba(80, 167, 244, 0.26);
  color: var(--primary);
  background: rgba(80, 167, 244, 0.08) !important;
}

.opportunity-assignment-option {
  width: 100%;
  height: 100%;
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 16px;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(29, 46, 63, 0.04) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  transform: none !important;
  text-align: left;
  color: inherit;
}

.opportunity-assignment-option:hover,
.opportunity-assignment-option:focus,
.opportunity-assignment-option:focus-visible,
.opportunity-assignment-option:active {
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(29, 46, 63, 0.07) !important;
  transform: none !important;
}

.opportunity-assignment-option.is-active {
  border-color: rgba(80, 167, 244, 0.28);
  background: linear-gradient(180deg, rgba(243, 249, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(80, 167, 244, 0.18), 0 10px 24px rgba(29, 46, 63, 0.06) !important;
}

.opportunity-assignment-option-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.opportunity-assignment-option-main strong {
  color: #20313e;
  font-size: 0.95rem;
  line-height: 1.3;
}

.opportunity-assignment-option-main .client-contact-picker-meta {
  margin: 0;
}

.opportunity-assignment-step-nav .lead-subnav-link:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.opportunity-assignment-row-edit {
  min-height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  border-radius: 16px;
  background: #f8fbff !important;
  box-shadow: none !important;
  transform: none !important;
  color: #33536d;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.opportunity-assignment-row-edit:hover,
.opportunity-assignment-row-edit:focus,
.opportunity-assignment-row-edit:focus-visible {
  background: #eef6ff !important;
  border-color: rgba(80, 167, 244, 0.24);
  color: var(--primary);
  box-shadow: none !important;
  transform: none !important;
}

.opportunity-assignment-row-edit svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.lead-user-picker-form {
  grid-template-columns: minmax(0, 1fr);
}

.opportunity-assignment-side-meta strong {
  line-height: 1.35;
}

.client-contact-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
}

.opportunity-assignment-create-card .client-contact-create-grid {
  grid-template-columns: repeat(2, minmax(220px, 340px));
  justify-content: flex-start;
  gap: 16px 18px;
  padding: 0;
}

.opportunity-assignment-create-card .lead-field {
  max-width: 340px;
}

.opportunity-assignment-create-card .lead-field label {
  margin-bottom: 8px;
  color: #5b6a74;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.opportunity-assignment-create-card .lead-field input,
.opportunity-assignment-create-card .lead-field select {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  border-color: rgba(147, 154, 158, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.opportunity-assignment-create-card .lead-field input:focus,
.opportunity-assignment-create-card .lead-field select:focus {
  border-color: rgba(80, 167, 244, 0.42);
  box-shadow: 0 0 0 4px rgba(80, 167, 244, 0.08);
}

.lead-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-estimate {
  width: min(1180px, 96vw);
  padding: 0;
  overflow: hidden;
}

.estimate-form {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 360px);
  gap: 0;
}

.estimate-form-main {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.estimate-form-main h3 {
  font-size: 1.2rem;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 248, 253, 0.86);
  backdrop-filter: blur(10px);
}

.app-loading.hidden {
  display: none !important;
}

.app-loading-card {
  min-width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 32px;
  border: 1px solid rgba(91, 120, 148, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(31, 52, 74, 0.16);
  text-align: center;
}

.app-loading-card strong {
  color: #20313e;
  font-size: 1.05rem;
  line-height: 1.2;
}

.app-loading-card p {
  margin: 0;
  color: #67757f;
  font-size: 0.94rem;
  line-height: 1.55;
}

.app-loading-spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(80, 167, 244, 0.18);
  border-top-color: #50a7f4;
  border-radius: 50%;
  animation: app-loading-spin 0.85s linear infinite;
}

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

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

.estimate-items-box {
  margin-top: 8px;
  border: 1px solid rgba(147, 154, 158, 0.34);
  border-radius: 12px;
  padding: 12px;
  background: #f9fbfd;
}

.estimate-items-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.estimate-items-head h4 {
  margin: 0;
  font-size: 0.92rem;
}

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

.estimate-item-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1.4fr) 120px 140px 120px 42px;
  gap: 14px;
  align-items: center;
}

.estimate-side-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
  border-left: 1px solid rgba(147, 154, 158, 0.22);
}

.estimate-side-card h4 {
  margin: 0;
  font-size: 1rem;
}

.estimate-side-meta {
  display: grid;
  gap: 12px;
}

.estimate-side-meta div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(147, 154, 158, 0.2);
}

.estimate-side-meta span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.estimate-side-meta strong {
  font-size: 0.96rem;
  color: #243746;
  line-height: 1.35;
}

.estimate-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(147, 154, 158, 0.22);
  padding-top: 10px;
  font-size: 0.95rem;
}

.estimate-side-note {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #58656d;
}

.lead-followup-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(80, 167, 244, 0.08), rgba(212, 212, 212, 0.12));
}

#modal-lead-followup .estimate-form {
  grid-template-columns: minmax(0, 1fr);
}

.lead-followup-form-grid {
  padding-top: 8px;
}

.lead-followup-complete-toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(147, 154, 158, 0.16);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.9);
  color: #40515c;
  font-weight: 700;
}

.lead-followup-complete-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.estimate-form-actions {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(147, 154, 158, 0.18);
}

.clinical-form {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 420px);
}

.clinical-form-main {
  align-content: start;
}

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

.clinical-header .muted {
  margin-top: 6px;
}

.clinical-side-card {
  gap: 14px;
}

.clinical-header-compact {
  margin-bottom: 2px;
}

.odontogram-editor {
  display: grid;
  gap: 12px;
}

.odontogram-selection {
  display: grid;
  gap: 4px;
}

.odontogram-step {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.odontogram-surface-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.odontogram-surface-selector button {
  min-height: 40px;
  font-size: 0.82rem;
}

.odontogram-surface-selector button.is-active {
  background: linear-gradient(180deg, #66b5f8 0%, #50a7f4 100%);
  color: #fff;
  border-color: transparent;
}

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

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

.odontogram-selection-summary {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #5a6770;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(147, 154, 158, 0.18);
}

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

.odontogram-tooth {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 128px;
  padding: 8px 6px 10px;
  border-radius: 18px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: #ffffff;
  color: #223443;
  box-shadow: 0 4px 10px rgba(34, 56, 78, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.odontogram-tooth:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(34, 56, 78, 0.12);
}

.odontogram-tooth.is-selected {
  border-color: rgba(80, 167, 244, 0.72);
  box-shadow: 0 0 0 3px rgba(80, 167, 244, 0.15), 0 8px 16px rgba(34, 56, 78, 0.08);
}

.odontogram-tooth-code {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7780;
}

.odontogram-surface-map {
  display: grid;
  grid-template-columns: 18px 34px 18px;
  grid-template-rows: 16px 34px 16px;
  gap: 4px;
  width: 74px;
  height: 74px;
  align-items: center;
  justify-content: center;
}

.tooth-surface {
  border-radius: 8px;
  border: 2px solid rgba(82, 95, 109, 0.14);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(34, 56, 78, 0.06);
}

.tooth-surface.is-current-surface {
  box-shadow: 0 0 0 3px rgba(80, 167, 244, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-color: rgba(80, 167, 244, 0.92);
}

.tooth-surface-occlusal {
  grid-column: 2;
  grid-row: 1;
}

.tooth-surface-mesial {
  grid-column: 1;
  grid-row: 2;
}

.tooth-surface-distal {
  grid-column: 3;
  grid-row: 2;
}

.tooth-surface-vestibular {
  grid-column: 2;
  grid-row: 2;
}

.tooth-surface-lingual {
  grid-column: 2;
  grid-row: 3;
}

.tooth-surface-occlusal,
.tooth-surface-lingual {
  border-radius: 999px;
}

.tooth-surface-mesial,
.tooth-surface-distal {
  border-radius: 999px;
}

.odontogram-tooth-state {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: #5a6770;
  line-height: 1.2;
}

.tooth-surface.is-healthy {
  background: #ffffff;
}

.tooth-surface.is-caries {
  background: #fecaca;
  border-color: rgba(185, 28, 28, 0.24);
}

.tooth-surface.is-restoration {
  background: #bfdbfe;
  border-color: rgba(37, 99, 235, 0.24);
}

.tooth-surface.is-fracture {
  background: #fbcfe8;
  border-color: rgba(190, 24, 93, 0.22);
}

.tooth-surface.is-missing {
  background: #d1d5db;
  border-color: rgba(75, 85, 99, 0.22);
}

.tooth-surface.is-wear {
  background: #fde68a;
  border-color: rgba(180, 83, 9, 0.22);
}

.tooth-surface.is-observation {
  background: #ddd6fe;
  border-color: rgba(109, 40, 217, 0.2);
}

.odontogram-portal {
  display: grid;
  gap: 12px;
}

.odontogram-current-card,
.odontogram-records {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(147, 154, 158, 0.18);
}

.odontogram-current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.odontogram-current-grid div,
.odontogram-record-row {
  display: grid;
  gap: 4px;
}

.odontogram-current-grid span,
.odontogram-records-head span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.odontogram-records-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

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

.odontogram-record-row {
  grid-template-columns: 48px 1fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(147, 154, 158, 0.16);
  font-size: 0.82rem;
}

.clinical-form {
  grid-template-columns: 1fr;
}

.attachments-box {
  margin-top: 8px;
  border: 1px solid rgba(147, 154, 158, 0.34);
  border-radius: 12px;
  padding: 12px;
  background: #f9fbfd;
}

.user-photo-box {
  margin-top: 8px;
  border: 1px solid rgba(147, 154, 158, 0.34);
  border-radius: 12px;
  padding: 12px;
  background: #f9fbfd;
}

.user-photo-box h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.user-photo-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.user-photo-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(80, 167, 244, 0.35);
  background: #fff;
}

.user-photo-help {
  margin: 8px 0 0;
  font-size: 0.8rem;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.79rem;
  color: #6c7a83;
}

.user-detail-photo-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 4px 2px;
}

.user-detail-photo-preview-wrap {
  margin: 0;
  justify-content: flex-start;
}

.user-detail-photo-preview {
  width: 112px;
  height: 112px;
}

.user-detail-photo-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.attachments-box h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.attachments-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.attachments-actions input[type="file"] {
  flex: 1;
}

.attachments-list {
  margin-top: 0;
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}

.attachments-workspace {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.attachments-sidebar {
  min-width: 0;
  border: 1px solid rgba(147, 154, 158, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px;
}

.attachments-preview-pane {
  min-width: 0;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.86rem;
  background: #fff;
  border: 1px solid rgba(147, 154, 158, 0.32);
  border-radius: 10px;
  padding: 10px 10px;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.attachment-item.is-active {
  border-color: rgba(80, 167, 244, 0.35);
  background: rgba(80, 167, 244, 0.08);
  box-shadow: inset 0 0 0 1px rgba(80, 167, 244, 0.12);
}

.attachment-preview-trigger {
  min-height: auto;
  flex: 1;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  color: #1f4f82;
  font: inherit;
  font-weight: 700;
  text-align: left;
  box-shadow: none !important;
  transform: none !important;
  white-space: normal;
  overflow: hidden;
}

.attachment-preview-trigger:hover,
.attachment-preview-trigger:focus,
.attachment-preview-trigger:focus-visible,
.attachment-preview-trigger:active {
  background: transparent !important;
  color: #1d639d;
  box-shadow: none !important;
  transform: none !important;
}

.attachment-file-name {
  display: block;
  color: #1f4f82;
  font-weight: 700;
  line-height: 1.35;
}

.attachment-file-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  color: #76838d;
  font-weight: 600;
  line-height: 1.3;
}

.attachment-item a,
.attachment-open-link {
  color: var(--primary);
  text-decoration: none;
}

.attachment-item a:hover,
.attachment-open-link:hover {
  text-decoration: underline;
}

.attachment-item > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(147, 154, 158, 0.25);
  background: #fff;
}

.attachment-open-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.attachment-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.attachment-preview {
  border: 1px solid rgba(147, 154, 158, 0.24);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.attachment-preview-empty,
.attachment-preview-fallback {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: #5e6b73;
  font-size: 0.84rem;
}

.attachment-preview-empty {
  align-content: center;
  min-height: 320px;
}

.attachment-preview-empty-rich {
  justify-items: center;
  text-align: center;
  padding: 28px 26px;
  gap: 16px;
}

.attachment-preview-empty-rich strong {
  font-size: 1.12rem;
  color: #22333f;
  line-height: 1.2;
}

.attachment-preview-empty-rich p {
  margin: 0;
  max-width: 420px;
  color: #687780;
  line-height: 1.55;
  font-size: 0.92rem;
}

.attachment-preview-empty-illustration {
  position: relative;
  width: 158px;
  height: 132px;
}

.attachment-empty-sheet {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(147, 154, 158, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 18px 36px rgba(29, 46, 63, 0.08);
}

.attachment-empty-sheet-back {
  transform: rotate(-8deg) translate(-10px, 6px);
  opacity: 0.72;
}

.attachment-empty-sheet-middle {
  transform: rotate(6deg) translate(10px, 10px);
  opacity: 0.82;
}

.attachment-empty-sheet-front {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 28px 22px;
  border-color: rgba(80, 167, 244, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 249, 255, 0.98) 100%);
}

.attachment-empty-sheet-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(80, 167, 244, 0.18) 0%, rgba(80, 167, 244, 0.08) 100%);
}

.attachment-empty-sheet-line.short {
  width: 62%;
}

.attachment-preview-empty-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.attachment-preview-empty-steps span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(147, 154, 158, 0.18);
  background: rgba(248, 251, 255, 0.92);
  color: #54626c;
  font-size: 0.82rem;
}

.attachment-preview-empty-steps em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(80, 167, 244, 0.12);
  color: var(--primary);
  font-style: normal;
  font-weight: 800;
}

.attachment-preview-empty-steps strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: #344756;
}

.attachment-preview-fallback a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.attachment-preview-head {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(147, 154, 158, 0.16);
  background: #f8fbfe;
}

.attachment-preview-head strong {
  font-size: 0.9rem;
  color: #22333f;
}

.attachment-preview-head span {
  font-size: 0.78rem;
  color: #66757e;
}

.attachment-preview-body {
  min-height: 0;
  background: #ffffff;
}

.attachment-preview-frame {
  display: block;
  width: 100%;
  height: 420px;
  border: none;
  background: #fff;
}

.attachment-preview-image {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: #fff;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .icon-btn { display: inline-flex; }

  .content-area,
  .modules-wrap,
  .card,
  .module {
    min-width: 0;
  }

  .side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(74vw, 230px);
    overflow-y: auto;
    transform: translateX(-102%);
    border-radius: 0 24px 24px 0;
    transition: transform 0.24s ease;
    z-index: 25;
  }

  body.menu-open .side-menu { transform: translateX(0); }

  .menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 20;
  }

  body.menu-open .menu-overlay { display: block; }

  .module-head,
  .module-tools,
  .lead-module-head,
  .client-workspace-head,
  .gantt-workspace-head,
  .kanban-head,
  .reports-table-head {
    flex-direction: column;
    align-items: stretch;
  }

  .module-title-wrap,
  .lead-module-head-left,
  .topbar-left {
    min-width: 0;
  }

  .module-tools input,
  .module-tools select {
    min-width: 0;
    width: 100%;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .dashboard-monthly-grid {
    gap: 8px;
  }

  .reports-head,
  .reports-filters {
    grid-template-columns: 1fr;
  }

  .reports-head {
    justify-items: start;
  }

  .reports-filters-actions {
    justify-content: flex-start;
  }

  .reports-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-user-access-grid {
    grid-template-columns: 1fr;
  }

  .dialog-estimate {
    width: min(96vw, 760px);
    max-height: 92vh;
  }

  .dialog-opportunity-assignment,
  .dialog-estimate,
  dialog {
    max-width: calc(100vw - 16px);
  }

  .attachments-workspace {
    grid-template-columns: 1fr;
  }

  .attachments-list {
    max-height: 220px;
  }

  .attachment-preview {
    min-height: 320px;
  }

  .attachment-preview-frame,
  .attachment-preview-image {
    height: 300px;
  }

  .estimate-form {
    grid-template-columns: 1fr;
  }

  .client-contact-create-grid,
  .detail-readonly-grid,
  .opportunity-assignment-form,
  .opportunity-assignment-main,
  .company-branding-block,
  .company-user-access-shell {
    grid-template-columns: 1fr;
  }

  .clinical-form {
    grid-template-columns: 1fr;
  }

  .estimate-side-card {
    border-left: 0;
    border-top: 1px solid rgba(147, 154, 158, 0.22);
  }

  .catalog-image-preview-stage {
    min-height: 280px;
  }
}

@media (max-width: 680px) {
  #app {
    padding: 12px 10px 20px;
  }

  .module,
  .card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .login-card {
    margin: 14px auto;
    padding: 18px 14px;
    border-radius: 14px;
  }

  .logo-wide {
    width: min(240px, 92%);
    padding: 6px 8px;
  }

  #login-form {
    gap: 8px;
  }

  #login-form label {
    font-size: 0.86rem;
    color: #5b6972;
  }

  #login-form input,
  #login-form button {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .topbar-left {
    width: 100%;
    align-items: flex-start;
  }

  .topbar-title-stack,
  .user-meta {
    min-width: 0;
  }

  #module-title {
    font-size: 1.08rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
    gap: 6px;
  }

  .topbar-session {
    max-width: none;
    width: 100%;
    min-height: 44px;
    padding: 6px 8px 6px 6px;
    gap: 8px;
  }

  .topbar-actions button { flex: 0 0 auto; }
  .topbar-actions .icon-only { flex: 0 0 auto; }
  .topbar-actions .user-avatar { width: 34px; height: 34px; }
  .topbar-actions .user-name {
    max-width: none;
    font-size: 0.82rem;
  }
  .topbar-session-dot {
    width: 9px;
    height: 9px;
  }
  .logout-btn {
    min-height: 44px;
    padding: 8px 10px;
    gap: 6px;
    width: 100%;
    justify-content: center;
  }
  .logout-btn-icon {
    width: 24px;
    height: 24px;
  }
  .logout-btn span {
    font-size: 0.84rem;
  }

  table {
    min-width: 0;
    border: none;
    background: transparent;
  }
  thead {
    display: none;
  }
  tbody tr {
    display: block;
    background: #fff;
    border: 1px solid rgba(147, 154, 158, 0.22);
    border-radius: 12px;
    padding: 6px 8px;
    margin-bottom: 10px;
  }
  tbody td {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 8px;
    align-items: center;
    white-space: normal;
    border-bottom: 1px dashed rgba(147, 154, 158, 0.2);
    padding: 8px 4px;
    font-size: 0.84rem;
  }
  tbody td:last-child {
    border-bottom: none;
  }
  tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #5a6770;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  td.actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 10px;
  }
  td.actions::before {
    display: none;
  }

  .catalog-image-item {
    grid-template-columns: 1fr;
  }

  .catalog-image-item-actions,
  .catalog-image-preview-toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .catalog-table-thumb {
    width: 42px;
    height: 42px;
  }

  dialog {
    width: min(96vw, 96vw);
    max-height: 92vh;
    padding: 14px;
  }

  .dialog-opportunity-assignment,
  .dialog-estimate {
    width: min(100vw - 12px, 100vw - 12px);
    max-height: 94dvh;
    border-radius: 16px;
  }
  .dialog-form {
    gap: 8px;
  }

  .dialog-estimate {
    padding: 0;
  }

  .estimate-form-main,
  .estimate-side-card,
  .estimate-form-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .estimate-form-actions,
  .lead-detail-actions,
  .client-related-toolbar-right,
  .gantt-workspace-actions,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .estimate-form-actions > *,
  .lead-detail-actions > *,
  .client-related-toolbar-right > *,
  .gantt-workspace-actions > *,
  .topbar-actions > * {
    width: 100%;
  }

  .estimate-items-head {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-items-head button {
    width: 100%;
  }

  .estimate-dates,
  .estimate-item-row {
    grid-template-columns: 1fr;
  }

  .estimate-products-head,
  .estimate-product-picker-new-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-assignment-summary,
  .lead-summary-inline,
  .detail-readonly-grid {
    grid-template-columns: 1fr;
  }

  .lead-form-head,
  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .lead-list-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .lead-list-toolbar-left,
  .lead-list-toolbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .lead-list-search {
    min-width: 0;
    width: 100%;
  }

  .lead-list-filter-wrap {
    width: 100%;
    min-width: 0;
  }

  .lead-list-count {
    min-height: 38px;
  }

  .lead-list-toolbar-note {
    display: none;
  }

  .lead-list-toolbar-right .btn-with-icon {
    width: 100%;
    justify-content: center;
  }

  .lead-detail-grid,
  .lead-summary-inline {
    grid-template-columns: 1fr;
  }

  .lead-assignment-card,
  .opportunity-assignment-option {
    grid-template-columns: 1fr;
  }

  .lead-record-header,
  .lead-record-main {
    flex-direction: column;
    align-items: stretch;
  }

  .lead-record-id-block {
    min-width: 0;
    padding-right: 0;
    padding-bottom: 10px;
    border-right: none;
    border-bottom: 1px solid rgba(147, 154, 158, 0.16);
  }

  .lead-record-title h3 {
    white-space: normal;
  }

  .lead-record-meta-line {
    gap: 4px 6px;
  }

  .lead-record-nav {
    width: 100%;
    justify-content: flex-start;
    margin-top: 4px;
  }

  .lead-record-status-wrap {
    min-width: 0;
    justify-items: start;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(147, 154, 158, 0.16);
    padding-top: 12px;
  }

  .lead-record-status-select {
    width: 100%;
  }

  .lead-notes-workspace {
    grid-template-columns: 1fr;
  }

  .lead-estimates-workspace,
  .client-estimates-workspace,
  .attachments-workspace {
    grid-template-columns: 1fr;
  }

  .lead-followup-preview-grid {
    grid-template-columns: 1fr;
  }

  .lead-estimate-nav-item {
    grid-template-columns: 1fr;
  }

  .lead-estimate-nav-status {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .lead-estimate-preview-actions {
    width: 100%;
    justify-content: stretch;
  }

  .lead-estimate-preview-actions .secondary,
  .lead-estimate-preview-actions .danger {
    flex: 1 1 100%;
  }

  .lead-estimate-preview-meta-grid {
    grid-template-columns: 1fr;
  }

  .lead-estimate-preview-product-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .lead-estimate-preview-product-media {
    width: 64px;
    height: 64px;
  }

  .lead-estimate-preview-product-side {
    text-align: left;
  }

  .lead-module-head-left {
    width: 100%;
  }

  .lead-subnav {
    width: 100%;
    justify-content: stretch;
  }

  .lead-subnav-top {
    margin-left: 0;
  }

  .topbar-followups {
    width: 100%;
  }

  .topbar-followups-trigger {
    width: 100%;
  }

  .topbar-followups-panel {
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(70vh, 560px);
  }

  .lead-subnav-link {
    flex: 1 1 0;
  }

  .client-workspace-head,
  .client-related-toolbar,
  .client-related-toolbar-left,
  .client-related-toolbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .client-related-contact-row {
    grid-template-columns: 1fr;
  }

  .client-related-summary {
    grid-template-columns: 1fr;
  }

  .company-branding-block {
    padding: 14px;
  }

  .company-logo-preview,
  .client-photo-preview {
    width: 88px;
    height: 88px;
  }

  .client-related-toolbar-right {
    margin-left: 0;
    justify-content: flex-start;
  }

  .client-related-contact-side {
    justify-items: start;
  }

  .client-related-contact-actions {
    justify-content: flex-start;
  }

  .client-contact-picker-head,
  .client-contact-picker-nav,
  .client-contact-picker-toolbar,
  .client-contact-picker-toolbar-right,
  .client-contact-picker-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .client-contact-picker-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .opportunity-assignment-row {
    grid-template-columns: 1fr;
  }

  .opportunity-assignment-row-edit {
    justify-content: center;
    min-height: 42px;
  }

  .opportunity-assignment-form {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .opportunity-assignment-side-card {
    border-left: 0;
    border-top: 1px solid rgba(147, 154, 158, 0.18);
  }

  .user-detail-photo-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .user-detail-photo-preview-wrap {
    justify-content: center;
  }

  .estimate-product-picker-main {
    grid-template-columns: 1fr;
  }

  .estimate-total-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .estimate-discount-row input {
    width: 100%;
    text-align: left;
  }

  .estimate-tax-option {
    letter-spacing: 0.05em;
  }

  .client-contact-create-grid {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .opportunity-assignment-create-card {
    margin-left: 16px;
    margin-right: 16px;
    padding: 18px;
  }

  .opportunity-assignment-create-card .client-contact-create-grid {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .client-contact-picker-check {
    justify-content: flex-start;
  }

  .opportunity-assignment-step-nav,
  .opportunity-assignment-mode-nav {
    margin-left: 16px;
    margin-right: 16px;
  }

  .opportunity-assignment-context {
    margin-left: 16px;
    margin-right: 16px;
  }

  .lead-detail-actions {
    flex-direction: column;
  }

  .odontogram-surface-selector {
    grid-template-columns: 1fr;
  }

  .odontogram-fields {
    grid-template-columns: 1fr;
  }

  .odontogram-actions {
    flex-direction: column;
  }

  .odontogram-current-grid,
  .odontogram-record-row {
    grid-template-columns: 1fr;
  }

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

  .odontogram-tooth {
    min-height: 136px;
    padding: 8px 6px 10px;
  }

  .odontogram-surface-map {
    width: 72px;
    height: 78px;
    grid-template-columns: 15px 28px 15px;
    grid-template-rows: 14px 28px 14px;
    padding: 10px 8px 12px;
  }

  .odontogram-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  input, select, button {
    min-height: 42px;
  }

  .module-head {
    flex-direction: column;
    align-items: stretch;
  }

  .module-title-wrap {
    justify-content: space-between;
    align-items: center;
  }

  .module-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .module-tools input { width: 100%; }

  .dashboard-hero,
  .dashboard-card {
    padding: 16px;
  }

  .dashboard-kpi-grid,
  .dashboard-stat-stack {
    grid-template-columns: 1fr;
  }

  .reports-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-monthly-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

.dashboard-month-bars {
    min-height: 180px;
  }

  .dashboard-donut-wrap {
    grid-template-columns: 92px 1fr;
    gap: 10px;
  }

  .donut-chart {
    width: 92px;
    height: 92px;
  }
}

.lead-status-badge[data-status="planning"] {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.lead-status-badge[data-status="on-hold"] {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.lead-status-badge[data-status="completed"] {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.gantt-project-cell {
  display: grid;
  gap: 4px;
}

.gantt-project-cell strong {
  font-size: 0.96rem;
}

.gantt-project-cell span {
  color: var(--muted);
  font-size: 0.84rem;
}

.gantt-progress-cell {
  display: grid;
  gap: 8px;
}

.gantt-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.gantt-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f8fe6 0%, #50a7f4 100%);
}

.gantt-project-range {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  color: #0f172a;
  font-weight: 600;
}

.gantt-project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gantt-detail-page {
  gap: 14px;
}

.gantt-detail-page .lead-details-shell {
  gap: 12px;
}

.gantt-detail-page .lead-record-header {
  align-items: flex-start;
}

.gantt-project-details-card {
  gap: 10px;
  padding: 14px 16px 16px;
}

.gantt-detail-page .gantt-project-details-card > .lead-section-title {
  margin: -14px -16px 4px;
  padding: 9px 13px;
}

.gantt-detail-page .gantt-project-details-card .lead-section-title h4 {
  font-size: 0.94rem;
}

.gantt-detail-page .gantt-project-details-card .lead-section-title span {
  font-size: 0.78rem;
}

.gantt-detail-page .gantt-project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
}

.gantt-detail-page .gantt-project-grid > .lead-field:first-child,
.gantt-detail-page .gantt-project-grid > .lead-field-full {
  grid-column: 1 / -1;
}

.gantt-detail-page .gantt-project-grid textarea {
  min-height: 92px;
}

.gantt-header-status-select {
  min-width: 170px;
}

.gantt-workspace-card {
  overflow: hidden;
  padding: 14px 16px 16px;
  min-height: 640px;
}

.gantt-detail-page .gantt-workspace-card > .gantt-workspace-head {
  margin: -14px -16px 6px;
  padding: 10px 13px 12px;
  border-radius: 16px 16px 12px 12px;
  background: linear-gradient(180deg, rgba(225, 239, 252, 0.96) 0%, rgba(243, 248, 255, 0.98) 100%);
  border-bottom: 1px solid rgba(80, 167, 244, 0.14);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.82);
}

.gantt-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.gantt-workspace-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gantt-overview-head {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
}

.gantt-overview-tools {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.gantt-overview-tools > input[type="search"] {
  min-width: 320px;
}

.gantt-overview-tools .lead-list-filter-wrap {
  min-width: 180px;
}

.gantt-task-search {
  min-width: 280px;
}

.gantt-scale-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(80, 167, 244, 0.08);
}

.gantt-scale-switcher .secondary {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: #4b5563;
  box-shadow: none;
}

.gantt-scale-switcher .secondary.is-active {
  background: #ffffff;
  color: #156cc3;
  box-shadow: 0 8px 20px rgba(47, 143, 230, 0.16);
}

.gantt-workspace {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  min-height: 560px;
  background:
    linear-gradient(180deg, rgba(246, 250, 255, 0.94) 0%, rgba(255,255,255,0.98) 100%);
  padding: 0;
  overflow: auto;
}

.gantt-overview-workspace {
  min-height: 640px;
}

.gantt-empty-state {
  padding: 28px;
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: left;
}

.gantt-board {
  min-width: max-content;
}

.gantt-board-row {
  display: grid;
  grid-template-columns: 300px max-content;
  min-width: max-content;
}

.gantt-board-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.gantt-board-side {
  position: sticky;
  left: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.gantt-board-corner {
  min-height: 78px;
  padding: 12px 16px;
  display: grid;
  gap: 3px;
  align-content: center;
}

.gantt-board-corner strong {
  font-size: 0.9rem;
}

.gantt-board-corner span {
  color: var(--muted);
  font-size: 0.77rem;
}

.gantt-board-main {
  background: rgba(255, 255, 255, 0.94);
}

.gantt-month-row,
.gantt-day-row,
.gantt-timeline-row {
  display: grid;
}

.gantt-month-cell {
  min-width: 0;
  padding: 10px 10px 6px;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  color: #526173;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gantt-day-cell {
  min-height: 44px;
  padding: 5px 2px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: grid;
  gap: 2px;
  place-items: center;
  font-size: 0.68rem;
  color: #708090;
}

.gantt-day-cell strong {
  color: #243342;
  font-size: 0.76rem;
  font-weight: 700;
}

.gantt-day-cell.is-today {
  background: linear-gradient(180deg, rgba(47, 143, 230, 0.06), rgba(47, 143, 230, 0.02));
}

.gantt-task-meta {
  min-height: 78px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.gantt-phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: linear-gradient(180deg, rgba(241, 246, 252, 0.98), rgba(248, 251, 255, 0.94));
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

.gantt-phase-row strong {
  font-size: 0.75rem;
  color: #2c5f92;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gantt-phase-row span {
  font-size: 0.7rem;
  color: #7a8998;
}

.gantt-overview-group-head {
  padding: 9px 12px;
}

.gantt-overview-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gantt-overview-group-label img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(47, 143, 230, 0.16);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.gantt-overview-group-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #50a7f4, #1e6fd9);
  box-shadow: 0 0 0 4px rgba(80, 167, 244, 0.12);
}

.gantt-overview-group-label > div {
  display: grid;
  gap: 2px;
}

.gantt-task-meta.is-active {
  background: linear-gradient(90deg, rgba(47, 143, 230, 0.08) 0%, rgba(255,255,255,0.98) 100%);
}

.gantt-overview-task-meta {
  grid-template-columns: minmax(0, 1fr);
}

.gantt-overview-task-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.gantt-overview-task-summary {
  gap: 3px;
}

.gantt-overview-task-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #607182;
  font-size: 0.72rem;
}

.gantt-overview-task-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(80, 167, 244, 0.1);
  color: #1e6fd9;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gantt-overview-open {
  align-self: start;
}

.gantt-overview-actions {
  justify-content: flex-end;
}

.gantt-task-summary {
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 2px;
  text-align: left;
  min-height: auto;
  justify-items: start;
}

.gantt-task-summary strong {
  color: #111827;
  font-size: 0.88rem;
  font-weight: 700;
}

.gantt-task-summary span {
  color: #6b7a89;
  font-size: 0.73rem;
}

.gantt-task-meta-actions {
  display: inline-flex;
  gap: 6px;
  align-self: start;
  justify-self: end;
}

.gantt-task-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.gantt-task-people.empty {
  color: #94a3b8;
  font-size: 0.74rem;
}

.gantt-task-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 52px;
}

.gantt-task-person img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(47, 143, 230, 0.16);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.gantt-task-person span {
  font-size: 0.63rem;
  line-height: 1.2;
  color: #465666;
  text-align: center;
}

.gantt-task-dialog-form .estimate-form-main {
  display: grid;
  gap: 14px;
}

.gantt-task-dialog-form h3 {
  margin-bottom: 2px;
}

.gantt-task-form-grid {
  gap: 14px 16px;
}

.gantt-task-form-grid .lead-field {
  align-content: start;
}

.gantt-task-dialog-form .lead-field > label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #60707d;
}

.gantt-color-picker-shell {
  display: grid;
  gap: 10px;
}

.gantt-color-input {
  width: 100%;
  min-height: 48px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #fff;
  cursor: pointer;
}

.gantt-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gantt-color-preset {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: var(--gantt-preset-color, #50a7f4);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2), 0 6px 12px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gantt-color-preset:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(80, 167, 244, 0.24), 0 10px 18px rgba(15, 23, 42, 0.12);
}

.gantt-color-preset.is-selected {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(21, 108, 195, 0.2), 0 12px 22px rgba(21, 108, 195, 0.18);
}

.gantt-assignee-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.gantt-assignee-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.gantt-assignee-option:hover,
.gantt-assignee-option.is-selected {
  border-color: rgba(47, 143, 230, 0.42);
  box-shadow: 0 12px 24px rgba(47, 143, 230, 0.12);
  transform: translateY(-1px);
}

.gantt-assignee-option input {
  width: 16px;
  height: 16px;
  accent-color: #2f8fe6;
}

.gantt-assignee-option img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

.gantt-assignee-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gantt-assignee-option strong {
  font-size: 0.82rem;
  color: #0f172a;
}

.gantt-assignee-option small {
  font-size: 0.72rem;
  color: #64748b;
}

.gantt-assignee-empty {
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  color: #64748b;
  text-align: center;
  font-size: 0.82rem;
}

.gantt-timeline-row {
  align-items: stretch;
  min-height: 56px;
  position: relative;
}

.gantt-grid-cell {
  min-height: 56px;
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.gantt-grid-cell.is-today {
  background:
    linear-gradient(180deg, rgba(47, 143, 230, 0.055), rgba(47, 143, 230, 0.025));
}

.gantt-task-bar {
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  margin: 0 6px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  padding: 5px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%),
    var(--gantt-task-color, #50a7f4);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(47, 143, 230, 0.14);
  cursor: pointer;
  transform-origin: left center;
  animation: ganttTaskReveal 320ms ease both;
  overflow: hidden;
  position: relative;
}

.gantt-task-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.36);
}

.gantt-task-bar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-task-bar strong {
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.gantt-task-bar.is-active {
  outline: 1px solid rgba(17, 24, 39, 0.22);
  outline-offset: 1px;
}

.kanban-module {
  display: grid;
  gap: 18px;
}

.kanban-head {
  display: grid;
  gap: 16px;
}

.kanban-head-copy {
  display: grid;
  gap: 8px;
}

.kanban-head-copy h3 {
  margin: 0;
  font-size: 1.45rem;
  color: #163048;
}

.kanban-head-copy p {
  margin: 0;
  max-width: 880px;
  color: #60717f;
}

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

.kanban-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 250, 253, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.kanban-summary-card span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #678196;
}

.kanban-summary-card strong {
  font-size: 2rem;
  line-height: 1;
  color: #14324d;
}

.kanban-toolbar {
  align-items: center;
}

.kanban-board {
  display: grid;
}

.kanban-empty-state {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
  text-align: left;
}

.kanban-empty-state strong {
  color: #163048;
  font-size: 1rem;
}

.kanban-empty-state span {
  color: #64748b;
  max-width: 560px;
}

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

.kanban-column {
  display: grid;
  gap: 12px;
  min-height: 560px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(244, 248, 252, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.kanban-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 0;
}

.kanban-column-head strong {
  display: block;
  font-size: 0.95rem;
  color: #18344d;
}

.kanban-column-head span {
  font-size: 0.8rem;
  color: #64748b;
}

.kanban-column-body {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 440px;
  padding: 2px;
  border-radius: 18px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.kanban-column-body.is-drop-target {
  background: rgba(80, 167, 244, 0.08);
  box-shadow: inset 0 0 0 1px rgba(80, 167, 244, 0.22);
}

.kanban-column-empty {
  min-height: 120px;
  display: grid;
  place-content: center;
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  color: #8a98a7;
  font-size: 0.82rem;
  text-align: center;
}

.kanban-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  cursor: grab;
}

.kanban-card.is-dragging {
  opacity: 0.58;
  transform: rotate(1deg);
}

.kanban-card-top,
.kanban-card-dates,
.kanban-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kanban-phase-chip,
.kanban-progress-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.kanban-phase-chip {
  background: rgba(47, 143, 230, 0.1);
  color: #156cc3;
}

.kanban-progress-pill {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.kanban-card-title {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.35;
}

.kanban-card-project {
  font-size: 0.88rem;
  font-weight: 700;
  color: #243b53;
}

.kanban-card-client {
  font-size: 0.82rem;
  color: #64748b;
}

.kanban-card-dates {
  font-size: 0.78rem;
  color: #64748b;
}

.kanban-card-people {
  display: grid;
  gap: 8px;
}

.kanban-card-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kanban-card-person img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(47, 143, 230, 0.14);
}

.kanban-card-person span,
.kanban-card-people-empty {
  color: #4a5c6a;
  font-size: 0.76rem;
}

.kanban-card-people-empty {
  min-height: 28px;
}

.kanban-card-actions {
  align-items: end;
}

.kanban-card-status-select {
  min-width: 0;
  flex: 1 1 auto;
}

.kanban-card-actions .secondary {
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: 14px;
}

@keyframes ganttTaskReveal {
  from {
    opacity: 0;
    transform: scaleX(0.82);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (max-width: 1100px) {
  .kanban-summary-grid,
  .kanban-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gantt-detail-page .gantt-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gantt-workspace-head {
    flex-direction: column;
  }

  .gantt-task-search {
    min-width: 0;
    width: 100%;
  }

  .gantt-overview-tools > input[type="search"],
  .gantt-overview-tools .lead-list-filter-wrap {
    min-width: 0;
    width: 100%;
  }

  .gantt-board-row {
    grid-template-columns: 260px max-content;
  }
}

@media (max-width: 720px) {
  .kanban-summary-grid,
  .kanban-columns {
    grid-template-columns: 1fr;
  }

  .gantt-project-grid {
    grid-template-columns: 1fr;
  }

  .gantt-project-details-card {
    padding: 14px;
  }

  .gantt-detail-page .gantt-project-details-card > .lead-section-title,
  .gantt-detail-page .gantt-workspace-card > .gantt-workspace-head {
    margin-left: -14px;
    margin-right: -14px;
  }

  .gantt-workspace-actions {
    width: 100%;
    justify-content: stretch;
  }

  .gantt-overview-task-top {
    grid-template-columns: 1fr;
  }

  .kanban-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gantt-scale-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .company-user-preview-identity {
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  #app {
    padding: 8px 8px 16px;
  }

  .side-menu {
    width: min(86vw, 280px);
    border-radius: 0 18px 18px 0;
  }

  .module,
  .card {
    border-radius: 14px;
  }

  tbody td {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }

  tbody td::before {
    margin-bottom: 2px;
  }

  td.actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .lead-subnav,
  .lead-subnav-top,
  .gantt-scale-switcher,
  .module-tools,
  .gantt-overview-tools {
    width: 100%;
  }

  .lead-subnav-link,
  .gantt-scale-switcher .secondary {
    width: 100%;
  }

  .gantt-board-row {
    grid-template-columns: 220px max-content;
  }

  .kanban-column,
  .gantt-workspace,
  .gantt-overview-workspace {
    min-height: 420px;
  }
}
