:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-strong: #e2e8f0;
  --ink: #111827;
  --muted: #64748b;
  --muted-strong: #475569;
  --line: #dbe3ec;
  --line-strong: #cbd5e1;
  --primary: #131b2e;
  --primary-2: #27364f;
  --primary-soft: #d3e4fe;
  --primary-soft-2: #edf4ff;
  --green: #15803d;
  --green-soft: #dcfce7;
  --orange: #ea580c;
  --orange-soft: #ffedd5;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --sidebar: 260px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at 18% 15%, rgba(37, 99, 235, 0.18), transparent 34%),
    linear-gradient(135deg, #0b1220 0%, #17243b 58%, #243552 100%);
}

.login-card {
  display: grid;
  width: min(430px, 100%);
  gap: 22px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.34);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 18px;
}

.login-brand span,
.login-copy {
  color: var(--muted);
  font-size: 13px;
}

.login-card h1 {
  margin: 4px 0 8px;
  font-size: 26px;
}

.login-copy {
  margin: 0;
  line-height: 1.5;
}

.login-error {
  margin: -8px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.login-submit {
  justify-content: center;
  min-height: 46px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  flex: 0 0 auto;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
  color: #eef5ff;
  background: var(--primary);
  border-right: 1px solid rgba(211, 228, 254, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #aebbd3;
  font-size: 12px;
}

.sidebar-action {
  width: 100%;
  justify-content: center;
}

.sidebar-nav,
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(211, 228, 254, 0.14);
}

.nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 12px;
  padding: 10px 12px;
  color: #aebbd3;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: var(--radius);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #ffffff;
  background: rgba(211, 228, 254, 0.08);
  outline: none;
}

.nav-link.active {
  color: #0f172a;
  background: var(--primary-soft);
  border-left-color: #ffffff;
  font-weight: 700;
}

.nav-link.subtle {
  min-height: 40px;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 68px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.mobile-menu {
  display: none;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 520px;
}

.global-search svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.global-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 42px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  outline: none;
}

.global-search input:focus {
  background: #ffffff;
  border-color: rgba(19, 27, 46, 0.28);
  box-shadow: 0 0 0 4px rgba(19, 27, 46, 0.08);
}

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

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  padding-left: 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border-left: 1px solid var(--line);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.profile-chip:hover,
.profile-chip:focus-visible {
  color: var(--primary-2);
  outline: none;
}

.profile-chip strong,
.profile-chip span {
  display: block;
}

.profile-chip strong {
  font-size: 13px;
  line-height: 1.2;
}

.profile-chip span {
  color: var(--muted);
  font-size: 11px;
}

.view-shell {
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.view-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.button,
.icon-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:active,
.icon-button:active,
.chip-button:active {
  transform: scale(0.98);
}

.button {
  padding: 0 14px;
}

.button svg,
.icon-button svg,
.nav-link svg,
.chip-button svg,
.inline-icon {
  width: 18px;
  height: 18px;
}

.button-primary {
  color: #ffffff;
  background: var(--primary);
  box-shadow: var(--shadow-soft);
}

.button-primary:hover {
  background: var(--primary-2);
}

.button-secondary {
  color: var(--primary);
  background: var(--primary-soft);
}

.button-secondary:hover {
  background: #c2d8f8;
}

.button-light {
  color: var(--primary);
  background: #ffffff;
}

.button-light:hover {
  background: var(--primary-soft);
}

.button-ghost {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.button-ghost:hover {
  background: var(--surface-soft);
}

.button-danger {
  color: var(--red);
  background: var(--red-soft);
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  color: var(--muted-strong);
  background: #ffffff;
  border-color: var(--line);
}

.icon-button:hover {
  color: var(--primary);
  background: var(--surface-soft);
}

.notification-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.metric-card,
.panel,
.table-wrap,
.kanban-card,
.lead-summary,
.calendar-shell,
.settings-shell,
.message-editor,
.template-list,
.drawer,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-height: 142px;
  padding: 18px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius);
}

.metric-icon.success {
  color: var(--green);
  background: var(--green-soft);
}

.metric-icon.alert {
  color: var(--orange);
  background: var(--orange-soft);
}

.metric-card p,
.panel-title p {
  margin: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.trend,
.badge,
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.trend.up,
.badge.success {
  color: var(--green);
  background: var(--green-soft);
}

.trend.warn,
.badge.warn {
  color: var(--orange);
  background: var(--orange-soft);
}

.trend.danger,
.badge.danger {
  color: var(--red);
  background: var(--red-soft);
}

.badge.info,
.stage-pill {
  color: var(--primary);
  background: var(--primary-soft);
}

.badge.neutral {
  color: var(--muted-strong);
  background: var(--surface-soft);
}

.panel {
  min-width: 0;
  padding: 18px;
}

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

.panel h2,
.panel h3,
.table-wrap h3,
.message-editor h3,
.template-list h3,
.settings-shell h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

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

.source-chart {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 22px;
}

.donut {
  position: relative;
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 45%, #50627c 45% 74%, #94a3b8 74% 100%);
}

.donut::after {
  position: absolute;
  width: 118px;
  height: 118px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 28px;
}

.source-list,
.follow-list,
.doc-list,
.timeline,
.template-cards,
.settings-list,
.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-row,
.follow-row,
.doc-row,
.settings-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.follow-row {
  align-items: flex-start;
}

.follow-row.overdue {
  border-left: 4px solid var(--red);
}

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

.dot-primary {
  background: var(--primary);
}

.dot-secondary {
  background: #50627c;
}

.dot-muted {
  background: #94a3b8;
}

.priority-high {
  background: var(--red);
}

.priority-medium {
  background: var(--orange);
}

.priority-low {
  background: var(--blue);
}

.table-wrap {
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:hover td {
  background: #f8fbff;
}

.lead-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  background: #50627c;
}

.mono,
.currency {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.currency {
  font-weight: 800;
}

.toolbar,
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.filters {
  align-items: end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.field {
  display: flex;
  min-width: 150px;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.editor-title {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.editor-title:focus {
  border-color: rgba(19, 27, 46, 0.45);
  box-shadow: 0 0 0 4px rgba(19, 27, 46, 0.08);
}

.kanban-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tabs,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted-strong);
  background: #ffffff;
  border-color: var(--line);
}

.chip-button.active,
.chip-button:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(19, 27, 46, 0.18);
}

.kanban-board {
  display: grid;
  grid-auto-columns: minmax(290px, 1fr);
  grid-auto-flow: column;
  gap: 16px;
  min-height: 580px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  display: flex;
  min-width: 290px;
  flex-direction: column;
  gap: 12px;
}

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

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-pill {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.kanban-lane {
  display: flex;
  min-height: 510px;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  background: rgba(241, 245, 249, 0.8);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.kanban-card {
  padding: 14px;
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.kanban-card:hover {
  border-color: rgba(19, 27, 46, 0.28);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.kanban-card-top,
.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kanban-card h4 {
  margin: 12px 0 3px;
  font-size: 15px;
}

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

.kanban-meta {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted-strong);
  font-size: 12px;
}

.kanban-meta span,
.lead-contact span,
.payment-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-detail-grid {
  grid-template-columns: minmax(340px, 0.85fr) minmax(420px, 1.15fr);
}

.lead-summary {
  padding: 20px;
}

.lead-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.lead-id {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.fact label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fact span,
.fact strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-actions .whatsapp {
  grid-column: 1 / -1;
  color: #ffffff;
  background: #128c7e;
}

.documents-panel {
  margin-top: 16px;
}

.doc-row {
  background: #ffffff;
  border-color: var(--line);
}

.doc-row.missing {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.25);
}

.timeline-panel {
  padding: 0;
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.timeline {
  position: relative;
  gap: 0;
  padding: 18px;
}

.timeline::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 30px;
  width: 1px;
  content: "";
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 0 0 24px;
}

.timeline-dot {
  z-index: 1;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
}

.timeline-body {
  padding-top: 2px;
}

.timeline-body strong,
.timeline-body span {
  display: block;
}

.timeline-body span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-note {
  margin-top: 8px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  color: var(--muted-strong);
  font-size: 14px;
}

.note-form {
  display: flex;
  gap: 10px;
  padding: 18px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.note-form input {
  flex: 1;
}

.messages-grid {
  grid-template-columns: 330px minmax(0, 1fr) 360px;
}

.template-list,
.message-editor,
.chat-preview {
  min-height: 640px;
}

.template-list,
.message-editor {
  padding: 16px;
}

.template-cards {
  margin-top: 14px;
}

.template-card {
  width: 100%;
  padding: 14px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.template-card.active,
.template-card:hover {
  background: var(--primary-soft-2);
  border-color: rgba(19, 27, 46, 0.22);
}

.template-card strong {
  display: block;
}

.template-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.editor-title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.message-textarea {
  min-height: 310px;
  resize: vertical;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: "JetBrains Mono", Consolas, monospace;
  line-height: 1.6;
}

.chat-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.phone {
  max-width: 320px;
  margin: 0 auto;
  padding: 16px;
  background: #1f2937;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.phone-screen {
  min-height: 520px;
  padding: 18px 12px;
  background: #e5ddd5;
  border-radius: 18px;
}

.chat-bubble {
  position: relative;
  margin-top: 34px;
  padding: 12px 12px 24px;
  white-space: pre-line;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  line-height: 1.45;
}

.chat-time {
  position: absolute;
  right: 10px;
  bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

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

.calendar-shell {
  overflow: hidden;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  overflow-x: auto;
}

.calendar-day,
.calendar-label {
  min-height: 138px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-label {
  min-height: auto;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted-strong);
  font-weight: 800;
  border-radius: 50%;
}

.day-number.today {
  color: #ffffff;
  background: var(--primary);
}

.payment-pill {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--primary-soft-2);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius);
}

.payment-pill.alert {
  background: var(--orange-soft);
  border-color: rgba(234, 88, 12, 0.22);
}

.payment-pill strong,
.payment-pill span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-pill span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.payment-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-list li {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.settings-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
}

.settings-list {
  gap: 4px;
  padding: 14px;
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
}

.settings-list button {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  border: 0;
}

.settings-list button.active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.settings-panel {
  padding: 22px;
}

.integration-row,
.user-row,
.preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--line-strong);
  border: 0;
  border-radius: 999px;
}

.switch::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
  transition: transform 160ms ease;
}

.switch.on {
  background: var(--primary);
}

.switch.on::after {
  transform: translateX(20px);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-shadow: var(--shadow);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-body {
  padding: 18px;
}

.drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 55;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(430px, 100%);
  height: 100%;
  overflow: auto;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.drawer-head,
.drawer-body,
.drawer-foot {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 360px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

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

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

  .dashboard-grid,
  .lead-detail-grid,
  .messages-grid,
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .source-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .messages-grid .chat-preview,
  .template-list,
  .message-editor {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .profile-chip {
    display: none;
  }

  .topbar {
    padding: 0 14px;
  }

  .view-shell {
    padding: 16px;
  }

  .filters,
  .toolbar,
  .kanban-toolbar,
  .view-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions .button {
    display: none;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .grid-4,
  .grid-3,
  .grid-2,
  .lead-facts,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .view-title {
    font-size: 24px;
  }

  .global-search input {
    min-width: 0;
  }

  .quick-actions .whatsapp {
    grid-column: auto;
  }
}
