:root {
  --ink: #18212f;
  --muted: #667085;
  --line: #dce2ea;
  --soft: #f5f7fb;
  --paper: #ffffff;
  --blue: #276ef1;
  --teal: #168c7e;
  --amber: #c77a13;
  --red: #c2413b;
  --green: #178f55;
  --shadow: 0 18px 55px rgba(34, 47, 62, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef2f7;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #ffffff;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  display: grid;
  width: min(440px, 100%);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-card h2,
.login-card p {
  margin: 0;
}

.login-card p {
  color: var(--muted);
}

.login-card label,
.account-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-note {
  font-size: 12px;
}

.brand-block.dark .eyebrow {
  color: var(--muted);
}

.brand-block.dark h1 {
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px 18px;
  color: #0f172a;
  background: #172032;
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: #10202f;
  background: #7ddfc7;
  font-weight: 800;
}

.brand-logo {
  width: 62px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
}

.login-card .brand-logo {
  width: 92px;
  height: 54px;
  background: transparent;
}

.brand-block h1,
.topbar h2,
.panel h3,
.portal-hero h3,
.table-toolbar h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 20px;
}

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

.sidebar .eyebrow {
  color: #8fb2d8;
}

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

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #1e3a5f;
  padding: 0 14px;
  color: #d9e6f5;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: #1d4ed8;
  background: #bfdbfe;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card strong {
  display: block;
  margin-bottom: 8px;
}

.sidebar-card span {
  color: #b7c7da;
  font-size: 14px;
}

.main-area {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  font-size: 30px;
}

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

select,
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper);
}

.primary-button,
.secondary-button,
.segmented {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.operating-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.map-step {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.map-step span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 99px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.map-step strong {
  display: block;
  margin: 12px 0 6px;
}

.map-step small {
  color: var(--muted);
}

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.metric-card,
.panel,
.portal-hero,
.integration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(22, 35, 51, 0.03);
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

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

.panel {
  padding: 18px;
}

.panel-header,
.table-toolbar,
.portal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 99px;
  padding: 0 10px;
  color: #245064;
  background: #e7f5f1;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.warning {
  color: #824a00;
  background: #fff1d8;
}

.status-pill.success {
  color: #12633d;
  background: #def7e9;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.pipeline-column,
.kanban-column {
  min-height: 260px;
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.pipeline-column h4,
.kanban-column h4 {
  margin: 0 0 12px;
  font-size: 14px;
}

.booking-card,
.campaign-card,
.rank-row,
.appointment-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.booking-card + .booking-card,
.campaign-card + .campaign-card,
.rank-row + .rank-row,
.appointment-row + .appointment-row {
  margin-top: 10px;
}

.pipeline-mode-btn {
  padding: 6px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pipeline-mode-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.pipeline-mode-btn:hover:not(.active) {
  border-color: #94a3b8;
  color: #0f172a;
}

.booking-card.lead-card {
  border-left: 3px solid #f97316;
  background: #fff7ed;
}

.lead-badge {
  display: inline-block;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.booking-card strong,
.campaign-card strong,
.appointment-row strong {
  display: block;
  margin-bottom: 4px;
}

.booking-card span,
.campaign-card span,
.appointment-row span {
  color: var(--muted);
  font-size: 13px;
}

.booking-card small {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 99px;
  padding: 4px 8px;
  color: #245064;
  background: rgba(231, 245, 241, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.checklist,
.detail-stack,
.system-build,
.approval-list,
.alert-list,
.task-list,
.funnel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.check-row,
.detail-card,
.system-row,
.approval-row,
.alert-row,
.task-card,
.funnel-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.check-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
}

.check-row span {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border-radius: 99px;
  color: #824a00;
  background: #fff1d8;
  font-size: 12px;
  font-weight: 800;
}

.check-row.done span {
  color: #12633d;
  background: #def7e9;
}

.detail-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-card strong {
  line-height: 1.45;
}

.system-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.approval-row {
  color: var(--muted);
}

.funnel-row {
  display: grid;
  grid-template-columns: 110px 1fr 54px;
  gap: 12px;
  align-items: center;
}

.funnel-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8edf4;
}

.funnel-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #33b79d, #276ef1);
}

.alert-row {
  display: grid;
  gap: 4px;
}

.alert-row span {
  color: var(--muted);
  font-size: 13px;
}

.alert-row.danger {
  border-color: #f2b8b5;
  background: #fff7f6;
}

.alert-row.warning {
  border-color: #f1d199;
  background: #fffaf0;
}

.alert-row.good {
  border-color: #b8e7ca;
  background: #f4fff8;
}

.task-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.task-card h3 {
  margin: 10px 0 4px;
  font-size: 18px;
}

.task-card p {
  margin: 0 0 4px;
  color: var(--ink);
}

.task-card small {
  color: var(--muted);
}

.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.rank-row small {
  color: var(--muted);
}

.table-toolbar {
  margin-bottom: 14px;
}

.table-toolbar input {
  width: min(340px, 100%);
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

.campaign-list,
.rank-list,
.appointment-list {
  margin-top: 16px;
}

.campaign-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.campaign-card progress {
  width: 100%;
  height: 8px;
  accent-color: var(--teal);
}

.chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 285px;
  padding-top: 20px;
}

.chart-bar {
  display: grid;
  flex: 1;
  align-content: end;
  gap: 8px;
  height: 240px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-bar i {
  display: block;
  min-height: 20px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #33b79d, #276ef1);
}

.pipeline-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.segmented {
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line);
}

.segmented.active {
  color: #ffffff;
  background: #172032;
}

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

.pipeline-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}

.simple-kanban {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow-x: auto;
  padding-bottom: 10px;
}

.calendar-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(22, 35, 51, 0.03);
}

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

.calendar-event,
.calendar-empty,
.exception-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.calendar-event {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--teal);
}

.calendar-event span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.calendar-event small,
.calendar-empty,
.exception-card span {
  color: var(--muted);
}

.exception-panel {
  margin-top: 18px;
}

.exception-panel > div {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.exception-card {
  display: grid;
  gap: 4px;
}

.appointment-followup {
  margin-top: 18px;
}

.followup-header,
.ownership-strip,
.next-action,
.followup-empty,
.followup-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

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

.followup-header h3 {
  margin: 0 0 4px;
}

.followup-header span,
.ownership-strip span,
.next-action span {
  color: var(--muted);
  font-size: 13px;
}

.ownership-strip {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  border-color: rgba(90, 140, 255, 0.32);
  background: linear-gradient(135deg, rgba(236, 253, 255, 0.78), rgba(255, 242, 255, 0.72));
}

.next-action,
.followup-actions,
.followup-timeline,
.followup-note {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

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

.followup-actions button {
  min-height: 38px;
  border: 1px solid rgba(84, 174, 214, 0.26);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.followup-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(90, 140, 255, 0.14);
}

.followup-actions .undo-action {
  grid-column: 1 / -1;
  border-color: rgba(217, 119, 6, 0.34);
  background: rgba(255, 247, 237, 0.9);
  color: #92400e;
}

.recent-undo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(217, 119, 6, 0.26);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.9);
  color: #92400e;
  font-weight: 800;
  font-size: 0.86rem;
}

.recent-undo .undo-action {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(217, 119, 6, 0.36);
  border-radius: 8px;
  color: #92400e;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.followup-timeline article {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
}

.followup-timeline span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.followup-note textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(84, 174, 214, 0.26);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
}

.portal-hero {
  margin-bottom: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff, #edf7f5);
}

.portal-hero p:last-child {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 14px;
}

.account-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.setup-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.setup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.setup-row small {
  color: var(--muted);
}

.client-mode .admin-only {
  display: none;
}

.client-mode #clientsView,
.client-mode #accountsView,
.client-mode #onboardingView,
.client-mode #systemView,
.client-mode #settingsView {
  display: none;
}

.integration-card {
  padding: 18px;
}

.integration-card p {
  color: var(--muted);
}

.integration-card button {
  width: 100%;
}

.n8n-setup {
  margin-bottom: 16px;
  padding: 18px;
}

.n8n-form {
  display: grid;
  gap: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  accent-color: #8f7cf8;
}

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

.integration-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(10, 18, 30, 0.55);
}

.modal-backdrop.active {
  display: grid;
}

.modal {
  display: grid;
  width: min(460px, 100%);
  gap: 14px;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

  .sidebar {
    position: static;
    display: block;
  }

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

  .sidebar-card {
    display: none;
  }

  .metric-grid,
  .metric-grid.compact,
  .split-layout,
  .operating-map,
  .integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .pipeline-workspace,
  .simple-kanban {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .main-area {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .panel-header,
  .table-toolbar,
  .portal-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list,
  .metric-grid,
  .metric-grid.compact,
  .split-layout,
  .operating-map,
  .pipeline-board,
  .kanban,
  .pipeline-workspace,
  .simple-kanban,
  .integration-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions select,
  .topbar-actions button {
    width: 100%;
  }

  .task-card,
  .system-row,
  .funnel-row {
    grid-template-columns: 1fr;
  }
}

/* Futuristic ClinicBrain visual layer */
:root {
  --ink: #141822;
  --muted: #6c7280;
  --line: rgba(113, 227, 226, 0.28);
  --soft: rgba(247, 250, 255, 0.72);
  --paper: rgba(255, 255, 255, 0.74);
  --blue: #5a8cff;
  --teal: #52e4dc;
  --pink: #f1a7ff;
  --violet: #b8a8ff;
  --shadow: 0 24px 70px rgba(82, 119, 165, 0.18);
  --glow: 0 0 32px rgba(82, 228, 220, 0.28);
}

body {
  background:
    linear-gradient(135deg, rgba(236, 253, 255, 0.96), rgba(255, 246, 255, 0.92) 45%, rgba(245, 244, 255, 0.96)),
    linear-gradient(115deg, rgba(82, 228, 220, 0.12), transparent 36%, rgba(241, 167, 255, 0.14) 72%, transparent);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(20, 24, 34, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 24, 34, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.18));
}

.login-screen {
  background: #ffffff;
}

.login-card,
.modal {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px);
  animation: floatIn 600ms ease both;
}

.login-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(120deg, transparent, rgba(82, 228, 220, 0.16), rgba(241, 167, 255, 0.14), transparent);
  transform: translateX(-100%);
  animation: scanLine 5s ease-in-out infinite;
}

.app-shell {
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  overflow: hidden;
  padding: 26px 18px 18px;
  background: #dbeafe;
  box-shadow: 18px 0 60px rgba(40, 55, 78, 0.08);
  isolation: isolate;
}

.sidebar::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.24;
}

.brand-mark {
  color: #111827;
  background: linear-gradient(135deg, var(--teal), #e8d5ff 48%, var(--pink));
  box-shadow: var(--glow);
}

.nav-item {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.nav-item.active,
.nav-item:hover {
  background: #bfdbfe;
  color: #1d4ed8;
  box-shadow: none;
  transform: translateX(3px);
}

.sidebar-card {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

.main-area,
.view.active {
  animation: viewIn 360ms ease both;
}

select,
input {
  border-color: rgba(84, 174, 214, 0.26);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

select:focus,
input:focus {
  outline: none;
  border-color: rgba(82, 228, 220, 0.92);
  box-shadow: 0 0 0 4px rgba(82, 228, 220, 0.18);
}

.primary-button {
  background: linear-gradient(135deg, #282f46, var(--blue) 48%, #d98df4);
  box-shadow: 0 12px 28px rgba(90, 140, 255, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.secondary-button,
.segmented,
.icon-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(84, 174, 214, 0.26);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.segmented:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(90, 140, 255, 0.18);
}

.metric-card,
.panel,
.portal-hero,
.integration-card,
.data-table-wrap,
.check-row,
.detail-card,
.system-row,
.approval-row,
.alert-row,
.task-card,
.funnel-row,
.setup-row,
.booking-card,
.campaign-card,
.rank-row,
.appointment-row {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
}

.metric-card,
.panel,
.integration-card,
.map-step,
.booking-card,
.campaign-card,
.rank-row,
.appointment-row,
.task-card {
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  inset: auto 14px 0;
  height: 3px;
  border-radius: 99px 99px 0 0;
  content: "";
  background: linear-gradient(90deg, var(--teal), var(--violet), var(--pink));
  opacity: 0.74;
}

.metric-card:hover,
.panel:hover,
.integration-card:hover,
.map-step:hover,
.booking-card:hover,
.campaign-card:hover,
.rank-row:hover,
.appointment-row:hover,
.task-card:hover {
  border-color: rgba(82, 228, 220, 0.46);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.booking-card[draggable="true"] {
  cursor: grab;
}

.booking-card.dragging {
  cursor: grabbing;
  opacity: 0.55;
  transform: rotate(1deg) scale(0.98);
}

.booking-card.selected {
  border-color: rgba(90, 140, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(90, 140, 255, 0.14), var(--shadow);
}

.kanban-column.drag-over {
  border-color: rgba(82, 228, 220, 0.88);
  background: linear-gradient(180deg, rgba(236, 253, 255, 0.92), rgba(255, 242, 255, 0.74));
  box-shadow: inset 0 0 0 1px rgba(82, 228, 220, 0.42), 0 18px 44px rgba(82, 228, 220, 0.2);
}

.map-step {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  animation: riseIn 420ms ease both;
}

.map-step span {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 24px rgba(82, 228, 220, 0.26);
}

.status-pill {
  background: rgba(231, 245, 241, 0.72);
}

.pipeline-column,
.kanban-column {
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: rgba(248, 251, 255, 0.68);
  backdrop-filter: blur(12px);
}

.chart-bar i {
  background: linear-gradient(180deg, var(--pink), var(--teal), var(--blue));
  box-shadow: 0 0 22px rgba(82, 228, 220, 0.22);
  animation: barGrow 700ms ease both;
}

.segmented.active {
  background: linear-gradient(135deg, #151b2a, #5a8cff, #d98df4);
}

.portal-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(236, 253, 255, 0.72), rgba(255, 242, 255, 0.76));
}

.funnel-row i {
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--pink));
  box-shadow: 0 0 18px rgba(82, 228, 220, 0.2);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

@keyframes scanLine {
  0%,
  55% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(110%);
  }
}

@keyframes barGrow {
  from {
    transform: scaleY(0.2);
    transform-origin: bottom;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

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

/* ─── Contacts view ─────────────────────────────────────────────────── */

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

.contact-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.contact-card:hover {
  border-color: rgba(82, 228, 220, 0.46);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.contact-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--teal), var(--pink));
  display: grid;
  place-items: center;
  color: #141822;
  font-weight: 800;
  font-size: 15px;
}

.contact-name {
  margin: 0 0 2px;
  font-weight: 800;
  font-size: 15px;
}

.contact-treatment {
  color: var(--muted);
  font-size: 13px;
}

.contact-phone {
  display: block;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.contact-phone:hover {
  text-decoration: underline;
}

.contact-email {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.contact-reason {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  word-break: break-word;
}

.followup-reason {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.followup-reason strong {
  color: inherit;
}

.contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.contact-empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────────── */

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

}
