:root {
  --navy: #19283b;
  --teal: #2b8aa0;
  --cyan: #2eacbb;
  --frost: #87dae2;
  --gold: #2eacbb;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e6ea;
  --bg: #f8f7f8;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(135, 218, 226, .18), transparent 30%),
    linear-gradient(135deg, #19283b, #24475b 54%, #2b8aa0);
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

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

.brand-lockup.inline {
  margin-bottom: 0;
}

.brand-lockup h1 {
  margin-bottom: 2px;
  letter-spacing: 0;
}

.brand-lockup small {
  color: var(--teal);
  font-weight: 700;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

h1, h2, p {
  margin-top: 0;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
  font-size: 13px;
}

input, select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  resize: vertical;
  background: #fff;
}

button, .portal-header a {
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 10px 15px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.secondary-btn {
  background: #e2e8f0;
  color: var(--navy);
}

.danger-btn {
  background: var(--danger) !important;
  color: #fff !important;
}

.auth-card button {
  width: 100%;
  margin-top: 18px;
}

.tenant-badge {
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, white);
  border-radius: 8px;
  background: color-mix(in srgb, var(--frost) 18%, white);
  color: var(--navy);
  font-weight: 800;
  text-align: center;
}

.landing-page {
  min-height: 100vh;
  background: var(--bg);
}

.landing-hero {
  min-height: 76vh;
  background:
    linear-gradient(120deg, rgba(25, 40, 59, .94), rgba(43, 138, 160, .84)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
  padding: 26px clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-rows: auto 1fr;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-nav a,
.landing-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 16px;
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  font-weight: 900;
}

.landing-copy {
  align-self: center;
  max-width: 760px;
}

.landing-copy span {
  color: var(--frost);
  font-weight: 900;
}

.landing-copy h2 {
  margin: 12px 0;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.08;
}

.landing-copy p {
  color: #e8f6f8;
  font-size: 18px;
  max-width: 640px;
}

.landing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.landing-actions a:first-child {
  background: var(--gold);
  color: #fff;
}

.landing-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.landing-band article {
  min-height: 150px;
  padding: 28px;
  background: #fff;
}

.landing-band strong,
.landing-band span {
  display: block;
}

.landing-band strong {
  color: var(--navy);
  font-size: 22px;
  margin-bottom: 8px;
}

.landing-band span {
  color: var(--muted);
  line-height: 1.7;
}

.error {
  min-height: 22px;
  color: var(--danger);
  margin-top: 12px;
  font-size: 13px;
}

.portal-header {
  min-height: 88px;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-header h1 {
  margin-bottom: 4px;
}

.portal-header p {
  margin-bottom: 0;
}

.portal-header nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.portal-header button {
  background: var(--navy);
}

.lang-select {
  width: 120px;
  height: 40px;
  font-weight: 800;
  color: var(--navy);
}

.portal-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

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

.stack {
  display: grid;
  gap: 10px;
}

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

.data-row {
  display: grid;
  grid-template-columns: repeat(var(--column-count, 5), minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  min-width: max-content;
}

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

.module-check {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: center;
  cursor: pointer;
}

.module-check input {
  width: 16px;
  height: 16px;
}

.module-check span {
  font-weight: 800;
}

.module-check small {
  grid-column: 2;
  color: var(--muted);
}

.module-shell {
  padding: 24px;
}

.module-hero {
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 18px;
  overflow: hidden;
}

.module-hero span {
  display: inline-block;
  color: var(--frost);
  font-weight: 800;
  margin-bottom: 10px;
}

.module-hero h2 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.25;
}

.module-hero p {
  color: #dceff2;
  margin-bottom: 0;
  max-width: 680px;
}

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

.module-card {
  min-height: 250px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--module-color);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.module-card.disabled {
  opacity: .55;
}

.module-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--module-color) 14%, white);
  color: var(--module-color);
  font-weight: 900;
  font-size: 22px;
}

.module-card strong {
  color: var(--module-color);
  letter-spacing: 0;
}

.module-card h3 {
  margin: 6px 0;
}

.module-card p {
  font-size: 13px;
}

.module-card a,
.module-locked {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.module-locked {
  background: #e2e8f0;
  color: var(--muted);
}

.data-row:first-child {
  background: #f8fafc;
  font-weight: 800;
}

.data-row button {
  background: var(--navy);
  padding: 8px 10px;
}

.owner-overview {
  grid-column: 1 / -1;
}

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

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
  margin-top: 14px;
}

.analytics-panel {
  padding: 0;
  overflow: hidden;
}

.analytics-panel .panel-head {
  margin-bottom: 0;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.analytics-panel .panel-head p {
  margin: 0;
  font-size: 12px;
}

.analytics-bars,
.recent-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.analytics-bar-row {
  display: grid;
  gap: 7px;
}

.analytics-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy);
  font-size: 12px;
}

.analytics-label span {
  color: var(--muted);
  font-weight: 800;
}

.analytics-track {
  height: 9px;
  border-radius: 99px;
  background: #edf4f6;
  overflow: hidden;
}

.analytics-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
}

.analytics-bar-row:nth-child(2n) .analytics-track span {
  background: linear-gradient(90deg, var(--navy), var(--teal));
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.recent-item strong,
.recent-item span {
  display: block;
}

.recent-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.recent-item b {
  color: var(--teal);
  white-space: nowrap;
}

.metric-card,
.overview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric-card span,
.overview-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-card strong,
.overview-card strong {
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.workspace {
  padding: 24px;
}

.workspace-hero {
  background: var(--navy);
  border-radius: 8px;
  color: #fff;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.workspace-hero span {
  display: block;
  color: var(--frost);
  font-weight: 800;
  margin-bottom: 8px;
}

.workspace-hero h2 {
  font-size: clamp(24px, 4vw, 38px);
  margin-bottom: 8px;
}

.workspace-hero p {
  color: #dceff2;
  margin-bottom: 0;
}

.workspace-hero button {
  background: var(--cyan);
  flex: 0 0 auto;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  margin-top: 16px;
}

.workspace-tools {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.workspace-tools button {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.workspace-tools button.active,
.workspace-tools button:hover {
  background: var(--navy);
  color: #fff;
}

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

.panel-head h2 {
  margin-bottom: 4px;
}

.panel-head p {
  margin-bottom: 0;
}

.panel-head input {
  max-width: 260px;
}

.module-table {
  display: grid;
  gap: 8px;
}

.module-row {
  display: grid;
  grid-template-columns: repeat(var(--column-count, 7), minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  min-width: max-content;
}

.records-panel {
  overflow-x: auto;
}

.module-row-head {
  background: #f8fafc;
  font-weight: 800;
}

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

.row-actions button {
  padding: 7px 9px;
  background: var(--navy);
  font-size: 12px;
}

.row-actions button:last-child {
  background: #b91c1c;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: #fff;
}

.hidden {
  display: none !important;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-column {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 220px;
}

.kanban-head {
  display: flex;
  justify-content: space-between;
  color: var(--navy);
  font-weight: 900;
  margin-bottom: 10px;
}

.kanban-head span {
  color: var(--teal);
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.kanban-card p {
  font-size: 12px;
  margin: 6px 0 10px;
}

.kanban-card button {
  padding: 7px 10px;
  background: var(--teal);
  font-size: 12px;
}

.kanban-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 18px 4px;
}

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

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activity-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.activity-item.done {
  opacity: .62;
}

.activity-item button {
  background: var(--navy);
  padding: 8px 10px;
}

.insight-list,
.note-list {
  display: grid;
  gap: 8px;
}

.insight-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--teal);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.6;
}

.note-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.note-item strong,
.note-item span {
  display: block;
}

.note-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.note-item p {
  margin: 8px 0 0;
  color: var(--ink);
}

.bottom-grid {
  align-items: start;
}

.crm-app {
  padding: 24px;
}

.crm-hero {
  background: linear-gradient(135deg, var(--navy), #24475b 58%, var(--teal));
  color: #fff;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.crm-hero span {
  display: block;
  color: var(--frost);
  font-weight: 900;
  margin-bottom: 8px;
}

.crm-hero h2 {
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.18;
  max-width: 860px;
  margin-bottom: 8px;
}

.crm-hero p {
  max-width: 760px;
  color: #e8f6f8;
  margin-bottom: 0;
}

.crm-hero button {
  background: #fff;
  color: var(--navy);
  flex: 0 0 auto;
}

.crm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.crm-tabs button {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.crm-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.crm-tab-panel {
  display: grid;
  gap: 16px;
}

.crm-alert,
.crm-loading {
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.crm-alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.crm-loading {
  background: #eef9fb;
  color: var(--navy);
  border: 1px solid var(--line);
}

.crm-toolbar {
  display: grid;
  grid-template-columns: 1.2fr repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.crm-toolbar.compact {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.crm-toolbar input,
.crm-toolbar select {
  min-width: 0;
}

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

.crm-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.crm-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.crm-card strong {
  color: var(--navy);
  font-size: 28px;
}

.crm-split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}

.crm-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

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

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

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

.crm-list-row {
  display: grid;
  grid-template-columns: 1.3fr repeat(5, minmax(90px, 1fr)) auto;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
}

.crm-list-row.header {
  background: #f8fafc;
  color: var(--navy);
  font-weight: 900;
}

.crm-list-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef9fb;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

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

.crm-actions button {
  padding: 7px 9px;
  background: var(--navy);
  font-size: 12px;
}

.crm-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.crm-kanban {
  display: grid;
  grid-template-columns: repeat(8, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.crm-kanban-column {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 320px;
}

.crm-kanban-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--navy);
  font-weight: 900;
  margin-bottom: 10px;
}

.crm-lead-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  display: grid;
  gap: 8px;
}

.crm-lead-card p {
  margin: 0;
  font-size: 12px;
}

.crm-overdue {
  color: #b91c1c;
  font-weight: 900;
}

.crm-detail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.crm-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.crm-placeholder {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.crm-stage-row,
.crm-setting-row {
  display: grid;
  grid-template-columns: 1fr 90px 120px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.crm-setting-row {
  grid-template-columns: 180px 1fr auto;
}

.crm-chart-row {
  display: grid;
  gap: 7px;
}

.crm-chart-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--navy);
  font-weight: 900;
}

.crm-chart-track {
  height: 9px;
  border-radius: 99px;
  background: #edf4f6;
  overflow: hidden;
}

.crm-chart-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
}

.crm-code {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  font-size: 12px;
}

/* CRM OS polish inspired by modern SaaS workspaces: clearer hierarchy, calmer surfaces, and better scanability. */
:root {
  --surface: #ffffff;
  --surface-soft: #f4f8fb;
  --shadow-sm: 0 8px 24px rgba(25, 40, 59, .07);
  --shadow-md: 0 18px 46px rgba(25, 40, 59, .12);
  --focus: 0 0 0 3px rgba(46, 172, 187, .18);
}

body {
  background:
    linear-gradient(180deg, #f6fbfd 0, #f8f7f8 360px),
    var(--bg);
}

button,
.portal-header a,
input,
select,
textarea {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

button:hover,
.portal-header a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--focus);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  box-shadow: 0 1px 0 rgba(25, 40, 59, .04);
}

.brand-mark {
  box-shadow: inset 0 -10px 20px rgba(25, 40, 59, .14);
}

.crm-app {
  max-width: 1720px;
  margin: 0 auto;
  padding: 22px clamp(14px, 2.5vw, 34px) 34px;
}

.crm-hero {
  border: 1px solid rgba(255, 255, 255, .32);
  box-shadow: var(--shadow-md);
  min-height: 172px;
  align-items: center;
}

.crm-hero h2 {
  letter-spacing: 0;
}

.crm-tabs {
  position: sticky;
  top: 77px;
  z-index: 15;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.crm-tabs button {
  white-space: nowrap;
  min-height: 38px;
  background: transparent;
  border-color: transparent;
  color: #385064;
}

.crm-tabs button.active {
  background: var(--navy);
  box-shadow: 0 10px 24px rgba(25, 40, 59, .16);
}

.panel,
.crm-card,
.crm-form,
.crm-detail,
.crm-list-row,
.crm-kanban-column,
.crm-lead-card,
.empty-state,
.crm-placeholder {
  box-shadow: var(--shadow-sm);
}

.panel,
.crm-form,
.crm-detail {
  border-color: #dce8ed;
}

.crm-card {
  min-height: 112px;
  position: relative;
  overflow: hidden;
}

.crm-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--teal));
}

.crm-card strong {
  font-size: clamp(24px, 2.4vw, 34px);
}

.crm-list-row.header,
.module-row-head,
.data-row:first-child {
  border-color: #cfe0e7;
  background: #eef6f8;
}

.crm-kanban {
  gap: 12px;
}

.crm-kanban-column {
  background: #f3f8fa;
}

.crm-kanban-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.crm-lead-card {
  border-inline-start: 4px solid var(--cyan);
}

.crm-pill {
  background: #e6f7f9;
}

.crm-actions button,
.row-actions button {
  min-height: 34px;
}

.crm-chart-row + .crm-chart-row {
  margin-top: 10px;
}

.crm-chart-track {
  height: 10px;
}

.crm-form h2,
.panel h2 {
  color: var(--navy);
}

html[dir="rtl"] .crm-card::before,
body[dir="rtl"] .crm-card::before {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

@media (max-width: 760px) {
  .portal-header,
  .portal-grid {
    display: block;
  }

  .portal-header nav {
    margin-top: 14px;
  }

  .panel {
    margin-bottom: 16px;
  }

  .module-grid,
  .module-picker,
  .landing-band,
  .overview-grid,
  .analytics-grid,
  .metric-grid,
  .workspace-grid,
  .crm-dashboard-grid,
  .crm-cards-grid,
  .crm-split,
  .crm-form-grid,
  .crm-detail-grid,
  .crm-placeholder-grid,
  .crm-toolbar,
  .crm-toolbar.compact,
  .crm-stage-row,
  .crm-setting-row {
    grid-template-columns: 1fr;
  }

  .workspace-hero,
  .activity-item,
  .crm-hero {
    display: block;
  }

  .workspace-hero button,
  .activity-item button,
  .crm-hero button {
    margin-top: 12px;
  }
}

@media (max-width: 1100px) {
  .module-grid,
  .overview-grid,
  .analytics-grid,
  .metric-grid,
  .crm-dashboard-grid,
  .crm-cards-grid,
  .crm-detail-grid,
  .crm-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .module-grid,
  .module-picker,
  .overview-grid,
  .analytics-grid,
  .metric-grid,
  .workspace-grid,
  .crm-dashboard-grid,
  .crm-cards-grid,
  .crm-split,
  .crm-form-grid,
  .crm-detail-grid,
  .crm-placeholder-grid,
  .crm-toolbar,
  .crm-toolbar.compact,
  .crm-stage-row,
  .crm-setting-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  .portal-header,
  .workspace-tools,
  form,
  .row-actions,
  button {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .workspace,
  .module-shell {
    padding: 0;
  }

  .panel,
  .metric-card,
  .workspace-hero {
    box-shadow: none;
    break-inside: avoid;
  }
}
