:root {
  --crm-bg: #f8f5f0;
  --crm-ink: #1a1814;
  --crm-ink-soft: rgba(26, 24, 20, 0.68);
  --crm-muted: rgba(26, 24, 20, 0.5);
  --crm-line: rgba(26, 24, 20, 0.12);
  --crm-panel: #fffdf8;
  --crm-panel-strong: #1a1814;
  --crm-gold: #c8a96e;
  --crm-gold-dark: #8a6a2f;
  --crm-green: #557a61;
  --crm-red: #8c4c42;
  --crm-blue: #516d8d;
  --crm-shadow: 0 18px 48px rgba(26, 24, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body.crm-body {
  min-height: 100vh;
  margin: 0;
  background: var(--crm-bg);
  color: var(--crm-ink);
  font-family: "IRANYekanX", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.75;
}

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

.crm-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(26, 24, 20, 0.94), rgba(26, 24, 20, 0.78)),
    url("../images/fargah/hero/hero-light.jpg") center / cover;
}

.crm-login-panel {
  width: min(440px, 100%);
  padding: 34px;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: var(--crm-shadow);
}

.crm-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--crm-gold-dark);
  font-weight: 800;
}

.crm-login-brand img {
  width: 92px;
  height: auto;
}

.crm-login-panel h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 900;
}

.crm-login-panel p {
  margin: 0 0 24px;
  color: var(--crm-ink-soft);
}

.crm-login-form,
.crm-edit-form,
.crm-activity-form {
  display: grid;
  gap: 14px;
}

.crm-login-form label,
.crm-edit-form label,
.crm-activity-form label {
  display: grid;
  gap: 7px;
  color: var(--crm-ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.crm-login-form input,
.crm-edit-form input,
.crm-edit-form select,
.crm-edit-form textarea,
.crm-activity-form input,
.crm-activity-form select,
.crm-activity-form textarea,
.crm-search input,
.crm-filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--crm-ink);
  outline: 0;
  padding: 8px 12px;
  min-width: 0;
  max-width: 100%;
}

.crm-login-form input:focus,
.crm-edit-form input:focus,
.crm-edit-form select:focus,
.crm-edit-form textarea:focus,
.crm-activity-form input:focus,
.crm-activity-form textarea:focus,
.crm-search input:focus,
.crm-filters select:focus {
  border-color: var(--crm-gold);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.18);
}

.crm-check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

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

.crm-form-error {
  color: var(--crm-red);
  font-size: 0.78rem;
}

.crm-primary-btn,
.crm-secondary-btn,
.crm-filters button,
.crm-userbar button,
.crm-search button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.crm-primary-btn {
  min-height: 44px;
  background: var(--crm-panel-strong);
  color: #fffdf8;
}

.crm-primary-btn[aria-busy="true"] {
  position: relative;
  color: transparent;
  cursor: wait;
}

.crm-primary-btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: crm-spin 0.75s linear infinite;
}

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

.crm-secondary-btn,
.crm-filters button {
  min-height: 42px;
  background: rgba(26, 24, 20, 0.08);
  color: var(--crm-ink);
}

.crm-primary-btn:hover,
.crm-secondary-btn:hover,
.crm-filters button:hover,
.crm-userbar button:hover,
.crm-search button:hover {
  transform: translateY(-1px);
}

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

.crm-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: var(--crm-panel-strong);
  color: #f8f5f0;
}

.crm-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
}

.crm-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.crm-nav {
  display: grid;
  gap: 6px;
}

.crm-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(248, 245, 240, 0.72);
  text-decoration: none;
  font-weight: 800;
}

.crm-nav a.active,
.crm-nav a:hover {
  background: rgba(200, 169, 110, 0.14);
  color: #fffdf8;
}

.crm-nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--crm-gold);
}

.crm-connection-panel {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(248, 245, 240, 0.12);
}

.crm-panel-label,
.crm-kicker {
  margin: 0;
  color: var(--crm-gold-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.crm-sidebar .crm-panel-label {
  color: rgba(248, 245, 240, 0.48);
}

.crm-connection {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(248, 245, 240, 0.62);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.crm-connection:hover {
  color: #fffdf8;
}

.crm-connection i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(248, 245, 240, 0.28);
}

.crm-connection.is-on i {
  background: var(--crm-green);
  box-shadow: 0 0 0 4px rgba(85, 122, 97, 0.22);
}

.crm-main {
  min-width: 0;
  padding: 22px;
}

.crm-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 520px) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.crm-topbar h1 {
  margin: 2px 0 0;
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: 0;
}

.crm-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-search button {
  width: 42px;
  height: 42px;
  background: var(--crm-panel-strong);
  color: #fffdf8;
  font-size: 1.1rem;
}

.crm-userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--crm-ink-soft);
  font-weight: 800;
  white-space: nowrap;
}

.crm-userbar button {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(26, 24, 20, 0.08);
  color: var(--crm-ink);
}

.crm-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(85, 122, 97, 0.25);
  border-radius: 8px;
  background: rgba(85, 122, 97, 0.1);
  color: #36543f;
  font-weight: 800;
}

.crm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.crm-kpis article,
.crm-stage-rail a,
.crm-leads-panel,
.crm-detail-panel {
  background: var(--crm-panel);
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(26, 24, 20, 0.04);
}

.crm-kpis article {
  padding: 16px;
}

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

.crm-kpis strong {
  font-size: 1.7rem;
  font-weight: 950;
}

.crm-stage-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.crm-stage-rail a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--crm-ink);
  text-decoration: none;
  font-weight: 900;
}

.crm-stage-rail a.active,
.crm-stage-rail a:hover {
  border-color: rgba(200, 169, 110, 0.55);
  background: #fbf4e5;
}

.crm-stage-rail strong {
  color: var(--crm-gold-dark);
}

.crm-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.crm-leads-panel,
.crm-detail-panel {
  padding: 14px;
  min-width: 0;
}

.crm-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 92px;
  gap: 10px;
  margin-bottom: 12px;
}

.crm-table-wrap {
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

.crm-table th {
  padding: 10px 12px;
  color: var(--crm-muted);
  border-bottom: 1px solid var(--crm-line);
  font-size: 0.76rem;
  font-weight: 900;
}

.crm-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(26, 24, 20, 0.08);
  color: var(--crm-ink-soft);
  vertical-align: middle;
  font-size: 0.84rem;
}

.crm-table tr.selected td {
  background: #fbf4e5;
}

.crm-table td a {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.crm-table td strong {
  color: var(--crm-ink);
  font-weight: 900;
}

.crm-table td span {
  color: var(--crm-muted);
}

.crm-stage-badge,
.crm-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(26, 24, 20, 0.07);
  color: var(--crm-ink);
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.stage-won,
.priority-low {
  background: rgba(85, 122, 97, 0.14);
  color: #36543f;
}

.stage-lost {
  background: rgba(140, 76, 66, 0.14);
  color: var(--crm-red);
}

.stage-proposal,
.priority-high,
.priority-urgent {
  background: rgba(200, 169, 110, 0.22);
  color: var(--crm-gold-dark);
}

.crm-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.crm-detail-head h2 {
  margin: 2px 0;
  font-size: 1.25rem;
  font-weight: 950;
}

.crm-detail-head p {
  margin: 0;
  color: var(--crm-muted);
  font-weight: 700;
}

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

.crm-lead-meta div {
  padding: 10px;
  border: 1px solid rgba(26, 24, 20, 0.08);
  border-radius: 8px;
  background: rgba(26, 24, 20, 0.025);
}

.crm-lead-meta dt {
  color: var(--crm-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.crm-lead-meta dd {
  margin: 3px 0 0;
  color: var(--crm-ink);
  font-weight: 850;
}

.crm-message {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-right: 3px solid var(--crm-gold);
  background: #fbf4e5;
  color: var(--crm-ink-soft);
  border-radius: 8px;
  white-space: pre-line;
}

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

.crm-form-grid > * {
  min-width: 0;
}

.crm-edit-form,
.crm-activity-form {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--crm-line);
}

.crm-timeline {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--crm-line);
}

.crm-timeline h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 950;
}

.crm-timeline article {
  display: grid;
  gap: 3px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(26, 24, 20, 0.08);
}

.crm-timeline article span,
.crm-timeline article time,
.crm-muted {
  color: var(--crm-muted);
}

.crm-timeline article strong {
  font-weight: 900;
}

.crm-timeline article p {
  margin: 0;
  color: var(--crm-ink-soft);
}

.crm-empty,
.crm-empty-detail {
  padding: 28px;
  text-align: center;
  color: var(--crm-muted);
}

.crm-pagination {
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .crm-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .crm-logo span,
  .crm-nav a,
  .crm-connection-panel {
    font-size: 0;
  }

  .crm-nav a {
    justify-content: center;
  }

  .crm-workspace,
  .crm-topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .crm-shell {
    display: block;
  }

  .crm-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .crm-sidebar::-webkit-scrollbar {
    display: none;
  }

  .crm-logo span,
  .crm-nav a {
    font-size: 0.82rem;
  }

  .crm-logo {
    min-width: max-content;
  }

  .crm-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
  }

  .crm-nav a {
    justify-content: flex-start;
    min-width: max-content;
  }

  .crm-connection-panel {
    display: none;
  }

  .crm-main {
    padding: 14px;
  }

  .crm-kpis,
  .crm-stage-rail,
  .crm-filters,
  .crm-form-grid,
  .crm-lead-meta {
    grid-template-columns: 1fr;
  }
}

/* Fargah OS CRM — premium dark workspace */
:root {
  --crm-bg: #080807;
  --crm-ink: #f6f0e4;
  --crm-ink-soft: rgba(246, 240, 228, 0.72);
  --crm-muted: rgba(246, 240, 228, 0.46);
  --crm-line: rgba(226, 187, 105, 0.16);
  --crm-panel: rgba(20, 19, 16, 0.88);
  --crm-panel-strong: #0d0c0b;
  --crm-gold: #d9ae5f;
  --crm-gold-dark: #b98535;
  --crm-green: #63a978;
  --crm-red: #c46d62;
  --crm-blue: #769bc5;
  --crm-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

body.crm-body {
  background:
    radial-gradient(circle at 82% -8%, rgba(217, 174, 95, 0.18), transparent 32rem),
    radial-gradient(circle at 18% 110%, rgba(125, 83, 30, 0.16), transparent 36rem),
    var(--crm-bg);
  font-size: 15px;
}

body.crm-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

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

.crm-sidebar {
  padding: 28px 20px;
  border-left: 1px solid rgba(226, 187, 105, 0.12);
  background: rgba(9, 9, 8, 0.92);
  backdrop-filter: blur(24px);
}

.crm-logo {
  gap: 14px;
}

.crm-logo img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 8px 18px rgba(217, 174, 95, 0.28));
}

.crm-logo > span {
  display: grid;
  line-height: 1.2;
}

.crm-logo strong {
  font-size: 1.08rem;
  letter-spacing: 0.04em;
}

.crm-logo small {
  margin-top: 4px;
  color: var(--crm-muted);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.crm-nav {
  gap: 8px;
  margin-top: 12px;
}

.crm-nav a {
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.9rem;
}

.crm-nav a.active,
.crm-nav a:hover {
  border-color: rgba(217, 174, 95, 0.18);
  background: linear-gradient(110deg, rgba(217, 174, 95, 0.17), rgba(217, 174, 95, 0.04));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.crm-nav-icon {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(217, 174, 95, 0.24);
  border-radius: 9px;
}

.crm-main {
  padding: 30px clamp(18px, 2.6vw, 42px) 44px;
}

.crm-topbar {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 480px) auto;
  margin-bottom: 24px;
}

.crm-topbar h1 {
  margin-top: 6px;
  color: #fffaf0;
  font-size: clamp(1.55rem, 2vw, 2.1rem);
}

.crm-kicker {
  color: var(--crm-gold);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.crm-search input,
.crm-filters select,
.crm-login-form input,
.crm-edit-form input,
.crm-edit-form select,
.crm-edit-form textarea,
.crm-activity-form input,
.crm-activity-form select,
.crm-activity-form textarea {
  min-height: 46px;
  border-color: rgba(226, 187, 105, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--crm-ink);
}

.crm-search input::placeholder,
.crm-edit-form textarea::placeholder,
.crm-activity-form input::placeholder,
.crm-activity-form textarea::placeholder {
  color: var(--crm-muted);
}

.crm-search button,
.crm-userbar button {
  border: 1px solid rgba(217, 174, 95, 0.2);
  border-radius: 12px;
  background: rgba(217, 174, 95, 0.09);
  color: var(--crm-gold);
}

.crm-user-avatar,
.crm-contact-avatar {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(217, 174, 95, 0.42);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #e8c77f, #815b24);
  color: #120f09;
  font-weight: 950;
  box-shadow: 0 0 0 4px rgba(217, 174, 95, 0.07);
}

.crm-user-avatar {
  width: 42px;
  height: 42px;
}

.crm-user-name {
  display: grid;
  line-height: 1.25;
}

.crm-user-name small {
  color: var(--crm-muted);
  font-size: 0.68rem;
}

.crm-kpis {
  gap: 14px;
  margin-bottom: 22px;
}

.crm-kpis article,
.crm-stage-rail a,
.crm-leads-panel,
.crm-detail-panel {
  border-color: rgba(226, 187, 105, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    var(--crm-panel);
  box-shadow: var(--crm-shadow);
  backdrop-filter: blur(18px);
}

.crm-kpis article {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 20px;
}

.crm-kpis article::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  inset: auto -26px -42px auto;
  border: 1px solid rgba(217, 174, 95, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(217, 174, 95, 0.025);
}

.crm-kpis article > i {
  position: absolute;
  inset: 18px auto auto 18px;
  color: rgba(217, 174, 95, 0.55);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

.crm-kpis span {
  margin: 0 0 8px;
  color: var(--crm-ink-soft);
}

.crm-kpis strong {
  display: block;
  color: #fff8e9;
  font-size: 2.35rem;
  line-height: 1.1;
}

.crm-kpis small {
  display: block;
  margin-top: 10px;
  color: var(--crm-muted);
}

.crm-stage-section {
  margin-bottom: 22px;
}

.crm-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 2px 12px;
}

.crm-section-heading h2 {
  margin: 3px 0 0;
  color: #fff8ea;
  font-size: 1.15rem;
  font-weight: 950;
}

.crm-section-heading > span {
  color: var(--crm-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.crm-stage-rail {
  gap: 12px;
  margin-bottom: 0;
}

.crm-stage-rail a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 72px;
  padding: 13px;
}

.crm-stage-rail a > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 9px;
  border: 1px solid rgba(217, 174, 95, 0.2);
  border-radius: 50%;
  color: var(--crm-gold);
  font-size: 0.64rem;
  font-style: normal;
}

.crm-stage-rail a.active,
.crm-stage-rail a:hover,
.crm-table tr.selected td {
  border-color: rgba(217, 174, 95, 0.42);
  background: linear-gradient(120deg, rgba(217, 174, 95, 0.16), rgba(217, 174, 95, 0.035));
}

.crm-workspace {
  grid-template-columns: minmax(0, 1.5fr) minmax(390px, 0.72fr);
  gap: 18px;
}

.crm-leads-panel,
.crm-detail-panel {
  padding: 18px;
}

.crm-filters {
  gap: 11px;
}

.crm-filters button,
.crm-primary-btn,
.crm-secondary-btn {
  min-height: 46px;
  border: 1px solid rgba(217, 174, 95, 0.24);
  border-radius: 13px;
}

.crm-primary-btn {
  background: linear-gradient(135deg, #e0ba6a, #a97931);
  color: #100d08;
  box-shadow: 0 10px 26px rgba(169, 121, 49, 0.2);
}

.crm-secondary-btn,
.crm-filters button {
  background: rgba(217, 174, 95, 0.09);
  color: var(--crm-gold);
}

.crm-table th {
  padding: 13px 12px;
  color: var(--crm-muted);
}

.crm-table td {
  padding: 14px 12px;
  border-bottom-color: rgba(226, 187, 105, 0.09);
  color: var(--crm-ink-soft);
  font-size: 0.88rem;
}

.crm-table td strong,
.crm-detail-head h2,
.crm-lead-meta dd,
.crm-timeline article strong {
  color: var(--crm-ink);
}

.crm-stage-badge,
.crm-priority {
  border: 1px solid rgba(217, 174, 95, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--crm-ink-soft);
}

.crm-detail-head {
  align-items: center;
}

.crm-contact-avatar {
  float: right;
  width: 48px;
  height: 48px;
  margin: 5px 0 0 12px;
}

.crm-lead-meta div,
.crm-message {
  border-color: rgba(226, 187, 105, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.crm-message {
  border-right-color: var(--crm-gold);
}

.crm-edit-form,
.crm-activity-form,
.crm-timeline {
  border-top-color: rgba(226, 187, 105, 0.12);
}

.crm-timeline article {
  border-bottom-color: rgba(226, 187, 105, 0.09);
}

.crm-alert {
  border-radius: 13px;
  background: rgba(99, 169, 120, 0.12);
  color: #b5e3c1;
}

.crm-login-shell {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 22%, rgba(217, 174, 95, 0.3), transparent 28rem),
    linear-gradient(135deg, rgba(6, 6, 5, 0.97), rgba(19, 15, 10, 0.95)),
    url("../images/fargah/hero/hero-light.jpg") center / cover;
}

.crm-login-shell::before,
.crm-login-shell::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(217, 174, 95, 0.2);
  border-radius: 50%;
  pointer-events: none;
}

.crm-login-shell::before {
  width: 44vw;
  height: 44vw;
  inset: -18vw auto auto -10vw;
  box-shadow: 0 0 0 50px rgba(217, 174, 95, 0.025), 0 0 0 100px rgba(217, 174, 95, 0.015);
}

.crm-login-shell::after {
  width: 30vw;
  height: 30vw;
  inset: auto -10vw -14vw auto;
}

.crm-login-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  padding: 40px;
  border-color: rgba(217, 174, 95, 0.24);
  border-radius: 22px;
  background: rgba(16, 15, 13, 0.86);
  backdrop-filter: blur(24px);
}

.crm-login-brand img {
  width: 112px;
}

.crm-login-eyebrow {
  margin-bottom: 6px !important;
  color: var(--crm-gold) !important;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.crm-login-panel h1 {
  color: #fff8e9;
  font-size: 1.8rem;
}

.crm-form-error {
  color: #f2a39a;
}

@media (max-width: 1180px) {
  .crm-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .crm-logo > span {
    display: none;
  }

  .crm-topbar,
  .crm-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .crm-main {
    padding: 18px 14px 32px;
  }

  .crm-user-name {
    display: none;
  }

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

  .crm-stage-rail {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .crm-stage-rail a {
    min-width: 180px;
  }
}

@media (max-width: 520px) {
  .crm-kpis {
    grid-template-columns: 1fr;
  }

  .crm-login-panel {
    padding: 28px 22px;
  }
}

/* Live CRM workspace — compact client flow */
.crm-live-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  background: radial-gradient(circle at 30% -20%, rgba(213, 166, 71, .08), transparent 38%), #070706;
}

.crm-live-shell .crm-main {
  width: 100%;
  max-width: none;
  padding: 24px clamp(18px, 2.5vw, 42px) 48px;
}

.crm-live-topbar {
  min-height: 66px;
  margin-bottom: 20px;
}

.crm-command-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.crm-command-head h1 {
  margin: 3px 0 6px;
  color: var(--crm-ink);
  font-size: clamp(1.55rem, 2vw, 2.25rem);
  font-weight: 950;
}

.crm-command-head p:last-child {
  margin: 0;
  color: var(--crm-muted);
  font-size: .83rem;
}

.crm-head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.crm-head-actions button,
.crm-projects-block button {
  min-height: 44px;
  padding-inline: 20px;
}

.crm-live-kanban {
  display: grid;
  grid-template-columns: repeat(11, minmax(224px, 1fr));
  width: 100%;
  max-height: calc(100vh - 210px);
  min-height: 520px;
  gap: 10px;
  overflow: auto;
  padding: 0 0 14px;
  scroll-snap-type: x proximity;
}

.crm-live-kanban .crm-kanban-column {
  min-height: 480px;
  padding: 11px;
  border-radius: 15px;
  scroll-snap-align: start;
}

.crm-live-kanban .crm-kanban-column > header {
  min-height: 42px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(215, 171, 80, .1);
}

.crm-live-kanban .crm-kanban-column > header strong {
  max-width: 144px;
  font-size: .76rem;
  line-height: 1.45;
}

.crm-live-kanban .crm-kanban-cards {
  align-content: start;
  min-height: 410px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding: 9px 1px;
  scrollbar-width: thin;
}

.crm-compact-client {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 11px 12px;
  border: 1px solid rgba(215, 171, 80, .18);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
  color: var(--crm-ink);
  text-decoration: none;
  cursor: grab;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.crm-compact-client:hover,
.crm-compact-client:focus-visible {
  border-color: rgba(225, 182, 92, .52);
  background: rgba(215, 171, 80, .07);
  transform: translateY(-1px);
}

.crm-compact-client strong { overflow: hidden; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.crm-compact-client span { color: var(--crm-ink-soft); font-size: .68rem; }
.crm-compact-client time { grid-column: 1 / -1; color: var(--crm-muted); font-size: .63rem; }
.crm-compact-client.is-dragging { opacity: .45; }
.crm-kanban-cards.is-drop-target { outline: 1px dashed var(--crm-gold); outline-offset: -4px; background: rgba(215,171,80,.045); }
.crm-live-kanban .crm-kanban-empty { min-height: 72px; font-size: .68rem; }

.crm-customer-workspace { display: grid; gap: 18px; }
.crm-leads-panel,
.crm-client-panel { border: 1px solid rgba(226,187,105,.12); border-radius: 18px; background: rgba(15,14,12,.78); box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.crm-leads-panel { padding: 18px; }
.crm-customer-table-wrap { max-height: min(48vh, 520px); overflow: auto; }
.crm-customer-table { min-width: 760px; }
.crm-customer-table th,
.crm-customer-table td { padding: 13px 15px; font-size: .78rem; }
.crm-customer-table tbody tr { cursor: pointer; }
.crm-customer-table tbody tr:hover,
.crm-customer-table tbody tr.selected { background: rgba(215,171,80,.065); }
.crm-customer-table td a { display: grid; color: var(--crm-ink); text-decoration: none; }
.crm-customer-table td a span { color: var(--crm-muted); font-size: .65rem; }

.crm-client-panel { padding: clamp(18px, 2.2vw, 30px); }
.crm-client-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid rgba(226,187,105,.12); }
.crm-client-panel-head h2 { margin: 5px 0; color: var(--crm-ink); font-size: 1.55rem; font-weight: 950; }
.crm-client-panel-head p { margin: 0; color: var(--crm-muted); }
.crm-client-head-state { display: grid; justify-items: end; gap: 7px; }
.crm-client-head-state > strong { color: var(--crm-gold); font-size: .78rem; }
.crm-client-meta { grid-template-columns: repeat(5,minmax(0,1fr)); margin: 18px 0; }

.crm-projects-block { margin: 20px 0; padding: 18px; border: 1px solid rgba(226,187,105,.11); border-radius: 15px; background: rgba(255,255,255,.018); }
.crm-project-list { display: grid; gap: 8px; }
.crm-project-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 18px; padding: 13px 14px; border-top: 1px solid rgba(255,255,255,.055); }
.crm-project-row:first-child { border-top: 0; }
.crm-project-row > div { display: grid; gap: 4px; }
.crm-project-row strong { color: var(--crm-ink); font-size: .82rem; }
.crm-project-row span,
.crm-project-row small { color: var(--crm-muted); font-size: .66rem; }
.crm-project-row form { margin: 0; }
.crm-project-row button { min-height: 38px; padding: 0 13px; font-size: .68rem; }

.crm-record-editor { margin-top: 18px; border: 1px solid rgba(226,187,105,.12); border-radius: 14px; }
.crm-record-editor > summary { padding: 15px 18px; color: var(--crm-ink); font-size: .78rem; font-weight: 900; cursor: pointer; }
.crm-record-editor-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; padding: 0 18px 18px; }

.crm-dialog {
  width: min(760px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  border: 1px solid rgba(226,187,105,.28);
  border-radius: 20px;
  background: #100f0d;
  color: var(--crm-ink);
  box-shadow: 0 35px 100px rgba(0,0,0,.72);
}
.crm-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.crm-dialog-panel { display: grid; gap: 18px; padding: 24px; }
.crm-dialog-panel > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(226,187,105,.12); }
.crm-dialog-panel h2 { margin: 4px 0; font-size: 1.45rem; font-weight: 950; }
.crm-dialog-panel p { margin: 0; color: var(--crm-muted); font-size: .74rem; }
.crm-dialog-close { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; background: transparent; color: var(--crm-ink); font-size: 1.3rem; }
.crm-dialog-panel label { display: grid; gap: 7px; color: var(--crm-ink-soft); font-size: .72rem; font-weight: 800; }
.crm-dialog-panel input,
.crm-dialog-panel select,
.crm-dialog-panel textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(226,187,105,.16); border-radius: 11px; background: rgba(255,255,255,.035); color: var(--crm-ink); font: inherit; }
.crm-dialog-panel footer { display: flex; justify-content: flex-end; gap: 9px; }
.crm-dialog-errors { padding: 11px 13px; border: 1px solid rgba(220,95,82,.25); border-radius: 10px; background: rgba(220,95,82,.08); color: #f0aaa1; font-size: .75rem; }

@media (max-width: 1180px) {
  .crm-live-shell { display: block; }
  .crm-live-shell .crm-main { padding-top: 18px; }
  .crm-live-kanban { max-height: none; min-height: 540px; }
}

@media (max-width: 760px) {
  .crm-command-head,
  .crm-client-panel-head { align-items: stretch; flex-direction: column; }
  .crm-head-actions { width: 100%; }
  .crm-head-actions button { flex: 1; }
  .crm-client-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-project-row { grid-template-columns: 1fr; }
  .crm-record-editor-grid,
  .crm-dialog-panel .crm-form-grid { grid-template-columns: 1fr; }
  .crm-live-kanban { grid-template-columns: repeat(11, minmax(210px, 82vw)); }
}

/* CRM pipeline, intelligence dashboard and connected call workspace */
.crm-view-switcher {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid var(--crm-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.crm-view-switcher a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 11px;
  color: var(--crm-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 900;
}

.crm-view-switcher a.active,
.crm-view-switcher a:hover {
  background: linear-gradient(135deg, rgba(217, 174, 95, 0.2), rgba(217, 174, 95, 0.07));
  color: var(--crm-gold);
}

.crm-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(280px, 1fr));
  gap: 13px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-color: rgba(217, 174, 95, 0.36) rgba(255, 255, 255, 0.03);
}

.crm-kanban-column {
  min-height: 520px;
  padding: 13px;
  border: 1px solid rgba(226, 187, 105, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}

.crm-kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 3px;
}

.crm-kanban-column > header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.crm-kanban-column > header i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--crm-line);
  border-radius: 50%;
  color: var(--crm-gold);
  font-size: 0.6rem;
  font-style: normal;
}

.crm-kanban-column > header strong {
  color: var(--crm-ink);
  font-size: 0.86rem;
}

.crm-kanban-column > header > span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(217, 174, 95, 0.1);
  color: var(--crm-gold);
  font-size: 0.74rem;
  font-weight: 900;
}

.crm-kanban-cards {
  display: grid;
  gap: 10px;
}

.crm-kanban-cards > article {
  padding: 13px;
  border: 1px solid rgba(226, 187, 105, 0.15);
  border-radius: 15px;
  background: rgba(10, 10, 9, 0.74);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.crm-kanban-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.crm-kanban-card-head .crm-contact-avatar {
  width: 34px;
  height: 34px;
  margin: 0;
  float: none;
}

.crm-kanban-card-head > div {
  display: grid;
  min-width: 0;
}

.crm-kanban-card-head strong {
  overflow: hidden;
  color: var(--crm-ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-kanban-card-head span {
  color: var(--crm-muted);
  font-size: 0.68rem;
}

.crm-kanban-card-head b {
  color: var(--crm-gold);
  font-size: 0.74rem;
}

.crm-kanban-cards > article > p {
  min-height: 50px;
  margin: 12px 0;
  color: var(--crm-ink-soft);
  font-size: 0.73rem;
  line-height: 1.8;
}

.crm-kanban-meta,
.crm-kanban-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-kanban-meta {
  color: var(--crm-muted);
  font-size: 0.65rem;
}

.crm-kanban-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 187, 105, 0.1);
}

.crm-kanban-actions a {
  flex: 1;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(217, 174, 95, 0.09);
  color: var(--crm-gold);
  text-align: center;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 900;
}

.crm-kanban-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 20px;
  border: 1px dashed rgba(226, 187, 105, 0.18);
  border-radius: 15px;
  color: var(--crm-muted);
  text-align: center;
}

.crm-kanban-empty span {
  color: var(--crm-gold);
  font-size: 1.6rem;
}

.crm-kanban-empty p {
  margin: 0;
  font-size: 0.72rem;
}

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

.crm-insight-card {
  min-height: 280px;
  padding: 20px;
  border: 1px solid var(--crm-line);
  border-radius: 19px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    var(--crm-panel);
  box-shadow: var(--crm-shadow);
}

.crm-insight-card.is-wide {
  grid-column: 1 / -1;
}

.crm-insight-card > header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.crm-insight-card > header > div {
  padding: 14px;
  border: 1px solid rgba(226, 187, 105, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.crm-insight-card > header span,
.crm-insight-card > header small {
  display: block;
  color: var(--crm-muted);
  font-size: 0.7rem;
}

.crm-insight-card > header strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--crm-ink);
  font-size: 1.45rem;
}

.crm-performance-chart {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 160px;
  margin-top: 18px;
  padding: 16px 10px 0;
  border-bottom: 1px solid rgba(226, 187, 105, 0.16);
  background:
    linear-gradient(rgba(217, 174, 95, 0.04) 1px, transparent 1px);
  background-size: 100% 40px;
}

.crm-performance-chart i {
  flex: 1;
  height: var(--point);
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #e2bd70, rgba(169, 121, 49, 0.28));
  box-shadow: 0 -8px 28px rgba(217, 174, 95, 0.14);
}

.crm-call-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-call-section-title h2,
.crm-call-section-title h3 {
  margin: 0;
  color: var(--crm-ink);
  font-size: 1rem;
  font-weight: 950;
}

.crm-call-section-title span {
  color: var(--crm-muted);
  font-size: 0.68rem;
}

.crm-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  margin: 28px auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--crm-gold) var(--value), rgba(255, 255, 255, 0.07) 0);
}

.crm-donut::before {
  content: "";
  position: absolute;
  inset: 19px;
  border: 1px solid rgba(226, 187, 105, 0.12);
  border-radius: inherit;
  background: #11100e;
}

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

.crm-donut strong {
  align-self: end;
  color: var(--crm-ink);
  font-size: 2rem;
}

.crm-donut span {
  align-self: start;
  color: var(--crm-muted);
  font-size: 0.7rem;
}

.crm-source-bars,
.crm-stage-health {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.crm-source-bars > div,
.crm-stage-health > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
}

.crm-source-bars span,
.crm-stage-health span {
  color: var(--crm-ink-soft);
  font-size: 0.75rem;
}

.crm-source-bars i,
.crm-stage-health i {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.crm-source-bars i::after,
.crm-stage-health i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, #8a632e, #e2bd70);
}

.crm-source-bars strong,
.crm-stage-health strong {
  color: var(--crm-gold);
  font-size: 0.72rem;
  text-align: left;
}

.crm-call-launch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid rgba(217, 174, 95, 0.26);
  border-radius: 14px;
  background: linear-gradient(110deg, rgba(217, 174, 95, 0.17), rgba(217, 174, 95, 0.045));
  color: var(--crm-gold);
  text-decoration: none;
}

.crm-call-launch > span:first-child {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(217, 174, 95, 0.28);
  border-radius: 50%;
}

.crm-call-launch > span:nth-child(2) {
  display: grid;
}

.crm-call-launch strong {
  color: var(--crm-ink);
  font-size: 0.82rem;
}

.crm-call-launch small {
  color: var(--crm-muted);
  font-size: 0.67rem;
}

.crm-call-shell {
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(circle at 50% -10%, rgba(217, 174, 95, 0.15), transparent 35rem),
    var(--crm-bg);
}

.crm-call-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border: 1px solid var(--crm-line);
  border-radius: 17px;
  background: rgba(16, 15, 13, 0.86);
  backdrop-filter: blur(22px);
}

.crm-call-back {
  justify-self: start;
  color: var(--crm-ink-soft);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 900;
}

.crm-call-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.crm-call-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.crm-call-brand > span {
  display: grid;
  text-align: center;
}

.crm-call-brand strong {
  color: var(--crm-ink);
  font-size: 0.9rem;
}

.crm-call-brand small {
  color: var(--crm-muted);
  font-size: 0.64rem;
}

.crm-call-status {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  color: var(--crm-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.crm-call-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crm-muted);
}

.crm-call-status.is-live {
  color: #9ce0ae;
}

.crm-call-status.is-live i {
  background: #61c77c;
  box-shadow: 0 0 0 5px rgba(97, 199, 124, 0.12);
  animation: crm-pulse 1.4s ease-in-out infinite;
}

@keyframes crm-pulse {
  50% { box-shadow: 0 0 0 9px rgba(97, 199, 124, 0); }
}

.crm-call-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(500px, 1.65fr) minmax(280px, 0.78fr);
  gap: 14px;
  align-items: start;
}

.crm-call-client,
.crm-call-console,
.crm-call-coach {
  min-width: 0;
}

.crm-call-client,
.crm-call-stage,
.crm-call-notes,
.crm-call-coach-card {
  border: 1px solid var(--crm-line);
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    var(--crm-panel);
  box-shadow: var(--crm-shadow);
}

.crm-call-client {
  padding: 18px;
}

.crm-call-client-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.crm-call-client-head .crm-contact-avatar {
  width: 58px;
  height: 58px;
  margin: 0;
  float: none;
}

.crm-call-client-head h1 {
  margin: 2px 0;
  color: var(--crm-ink);
  font-size: 1.3rem;
}

.crm-call-client-head a {
  color: var(--crm-gold);
  text-decoration: none;
  direction: ltr;
}

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

.crm-call-facts div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(226, 187, 105, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.crm-call-facts dt {
  color: var(--crm-muted);
  font-size: 0.64rem;
}

.crm-call-facts dd {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--crm-ink);
  font-size: 0.75rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-call-history {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--crm-line);
}

.crm-call-history article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(226, 187, 105, 0.08);
}

.crm-call-history article > i {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border: 2px solid #17140f;
  border-radius: 50%;
  background: var(--crm-gold);
  box-shadow: 0 0 0 1px rgba(217, 174, 95, 0.3);
}

.crm-call-history article > div {
  display: grid;
}

.crm-call-history strong {
  color: var(--crm-ink);
  font-size: 0.74rem;
}

.crm-call-history p,
.crm-call-history time {
  margin: 2px 0 0;
  color: var(--crm-muted);
  font-size: 0.65rem;
}

.crm-call-console {
  display: grid;
  gap: 14px;
}

.crm-call-stage,
.crm-call-notes {
  padding: 18px;
}

.crm-call-stage {
  text-align: center;
}

.crm-call-person {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}

.crm-call-person .crm-contact-avatar {
  width: 44px;
  height: 44px;
  margin: 0;
  float: none;
}

.crm-call-person > div {
  display: grid;
  text-align: right;
}

.crm-call-person strong {
  color: var(--crm-ink);
}

.crm-call-person span {
  color: var(--crm-muted);
  font-size: 0.7rem;
}

.crm-call-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 110px;
  margin: 14px 0;
  opacity: 0.45;
}

.crm-call-wave i {
  width: 4px;
  height: calc(var(--bar) * 7px);
  border-radius: 99px;
  background: linear-gradient(180deg, #f0cf86, #8b6029);
}

.crm-call-wave.is-active {
  opacity: 1;
}

.crm-call-wave.is-active i {
  animation: crm-wave 1.1s ease-in-out infinite alternate;
  animation-delay: calc(var(--bar) * -70ms);
}

@keyframes crm-wave {
  to { transform: scaleY(0.34); opacity: 0.46; }
}

.crm-call-timer {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  margin: 0 auto 12px;
  border: 1px solid rgba(217, 174, 95, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 174, 95, 0.13), transparent 68%);
  box-shadow: 0 0 0 12px rgba(217, 174, 95, 0.025);
}

.crm-call-timer span {
  align-self: end;
  color: var(--crm-muted);
  font-size: 0.68rem;
}

.crm-call-timer strong {
  align-self: start;
  color: var(--crm-gold);
  font-size: 1.5rem;
  direction: ltr;
}

.crm-call-start {
  display: grid;
  gap: 12px;
  text-align: right;
}

.crm-call-start label,
.crm-call-notes label {
  display: grid;
  gap: 6px;
  color: var(--crm-ink-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.crm-call-start textarea,
.crm-call-notes textarea,
.crm-call-notes select,
.crm-call-notes input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 187, 105, 0.14);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--crm-ink);
  resize: vertical;
}

.crm-call-provider-note {
  margin: 0;
  color: var(--crm-muted);
  font-size: 0.66rem;
  text-align: center;
}

.crm-call-notes {
  display: grid;
  gap: 12px;
}

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

.crm-call-coach {
  display: grid;
  gap: 12px;
}

.crm-call-coach-card {
  padding: 16px;
}

.crm-call-coach-card.is-highlight {
  border-color: rgba(217, 174, 95, 0.3);
  background: linear-gradient(135deg, rgba(217, 174, 95, 0.17), rgba(19, 17, 13, 0.92));
}

.crm-call-coach-card h2 {
  margin: 0 0 10px;
  color: var(--crm-ink);
  font-size: 0.9rem;
}

.crm-call-coach-card p,
.crm-call-coach-card li {
  color: var(--crm-ink-soft);
  font-size: 0.72rem;
  line-height: 1.85;
}

.crm-call-coach-card ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-right: 18px;
}

.crm-call-progress {
  display: grid;
  gap: 12px;
}

.crm-call-progress > span {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--crm-ink-soft);
  font-size: 0.68rem;
}

.crm-call-progress i {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.crm-call-progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, #93682d, #e7c475);
}

.crm-call-previous {
  display: grid;
  padding: 9px 0;
  border-bottom: 1px solid rgba(226, 187, 105, 0.08);
}

.crm-call-previous strong {
  color: var(--crm-ink);
  font-size: 0.72rem;
}

.crm-call-previous span {
  color: var(--crm-muted);
  font-size: 0.64rem;
}

.crm-call-errors {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(196, 109, 98, 0.34);
  border-radius: 13px;
  background: rgba(196, 109, 98, 0.1);
  color: #f0aaa1;
}

.crm-call-errors p {
  margin: 0;
}

@media (max-width: 1280px) {
  .crm-call-grid {
    grid-template-columns: minmax(260px, 0.72fr) minmax(480px, 1.5fr);
  }

  .crm-call-coach {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .crm-call-grid,
  .crm-insight-grid {
    grid-template-columns: 1fr;
  }

  .crm-call-coach {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-call-topbar {
    grid-template-columns: 1fr auto;
  }

  .crm-call-brand {
    display: none;
  }
}

@media (max-width: 620px) {
  .crm-call-shell {
    padding: 10px;
  }

  .crm-call-coach,
  .crm-call-form-grid,
  .crm-insight-card > header {
    grid-template-columns: 1fr;
  }

  .crm-view-switcher {
    display: flex;
    overflow-x: auto;
  }

  .crm-view-switcher a {
    min-width: max-content;
  }
}

/* Full-width client project workspace and private document vault */
.crm-logo {
  min-height: 58px;
}

.crm-logo img {
  width: 154px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
  object-position: right center;
}

.crm-logo > span {
  align-self: end;
  margin: 0 -84px -4px 0;
  pointer-events: none;
}

.crm-logo small {
  padding: 2px 7px;
  border: 1px solid rgba(217, 174, 95, 0.2);
  border-radius: 999px;
  background: rgba(8, 8, 7, 0.72);
  color: #dfbd72;
  white-space: nowrap;
}

.crm-workspace {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100%;
}

.crm-leads-panel,
.crm-detail-panel {
  width: 100%;
}

.crm-detail-panel {
  padding: clamp(18px, 2.2vw, 32px);
}

.crm-detail-panel .crm-lead-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.crm-detail-panel .crm-edit-form,
.crm-detail-panel .crm-activity-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.34fr);
  gap: 14px;
  align-items: end;
}

.crm-detail-panel .crm-edit-form .crm-form-grid,
.crm-detail-panel .crm-activity-form .crm-form-grid {
  grid-column: 1 / -1;
}

.crm-detail-panel .crm-edit-form > label,
.crm-detail-panel .crm-activity-form > label {
  margin: 0;
}

.crm-detail-panel .crm-edit-form > button,
.crm-detail-panel .crm-activity-form > button {
  height: 100%;
  min-height: 72px;
}

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

.crm-timeline h3,
.crm-timeline > .crm-muted {
  grid-column: 1 / -1;
}

.crm-timeline article {
  min-height: 126px;
  padding: 14px;
  border: 1px solid rgba(226, 187, 105, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.crm-client-files {
  margin: 22px 0 8px;
  padding: clamp(18px, 2.3vw, 30px);
  border: 1px solid rgba(226, 187, 105, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 0%, rgba(217, 174, 95, 0.12), transparent 28rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.crm-client-files-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.crm-client-files-head h3 {
  margin: 5px 0;
  color: #fff8e9;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 950;
}

.crm-client-files-head p:not(.crm-kicker) {
  margin: 0;
  color: var(--crm-muted);
}

.crm-vault-role {
  display: grid;
  min-width: 160px;
  padding: 11px 14px;
  border: 1px solid rgba(217, 174, 95, 0.18);
  border-radius: 13px;
  color: var(--crm-muted);
  font-size: 0.72rem;
}

.crm-vault-role strong {
  margin-top: 3px;
  color: var(--crm-gold);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.crm-workflow-rail {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin: 22px 0;
  padding: 4px 0 12px;
  scrollbar-color: rgba(217, 174, 95, 0.28) transparent;
}

.crm-workflow-rail > div {
  position: relative;
  flex: 1 0 130px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #77736b;
  font-size: 0.68rem;
  font-weight: 850;
  text-align: center;
}

.crm-workflow-rail > div::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 16px;
  right: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.crm-workflow-rail i {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  background: #12110f;
  color: #77736b;
  font-size: 0.62rem;
  font-style: normal;
}

.crm-workflow-rail .is-done,
.crm-workflow-rail .is-current {
  color: var(--crm-ink-soft);
}

.crm-workflow-rail .is-done::before,
.crm-workflow-rail .is-current::before {
  background: rgba(217, 174, 95, 0.5);
}

.crm-workflow-rail .is-done i {
  border-color: rgba(217, 174, 95, 0.45);
  background: rgba(217, 174, 95, 0.12);
  color: var(--crm-gold);
}

.crm-workflow-rail .is-current i {
  border-color: #e5c373;
  background: linear-gradient(135deg, #e3bd6d, #8d6227);
  color: #100d08;
  box-shadow: 0 0 0 6px rgba(217, 174, 95, 0.1);
}

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

.crm-folder-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  padding: 17px;
  border: 1px solid rgba(226, 187, 105, 0.13);
  border-radius: 17px;
  background: rgba(8, 8, 7, 0.5);
  transition: border-color 160ms ease, transform 160ms ease;
}

.crm-folder-card:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 187, 105, 0.3);
}

.crm-folder-card.is-locked {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.01) 0 8px, transparent 8px 16px),
    rgba(8, 8, 7, 0.55);
}

.crm-folder-card > header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
}

.crm-folder-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217, 174, 95, 0.24);
  border-radius: 12px;
  color: var(--crm-gold);
  font-size: 0.7rem;
  font-weight: 950;
}

.crm-folder-card header small {
  color: var(--crm-muted);
  font-size: 0.62rem;
}

.crm-folder-card h4 {
  margin: 2px 0 0;
  color: #fff8ea;
  font-size: 0.98rem;
  font-weight: 950;
}

.crm-folder-card > p {
  min-height: 42px;
  margin: 12px 0;
  color: var(--crm-muted);
  font-size: 0.74rem;
  line-height: 1.8;
}

.crm-folder-count,
.crm-folder-lock {
  padding: 5px 8px;
  border: 1px solid rgba(217, 174, 95, 0.16);
  border-radius: 999px;
  color: var(--crm-muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.crm-folder-lock {
  border-color: rgba(213, 122, 108, 0.28);
  color: #e1a29a;
}

.crm-folder-files {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.crm-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.crm-file-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(217, 174, 95, 0.1);
  color: var(--crm-gold);
}

.crm-file-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.crm-file-row strong {
  overflow: hidden;
  color: var(--crm-ink);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-file-row small {
  color: var(--crm-muted);
  font-size: 0.58rem;
}

.crm-file-row > a,
.crm-file-menu summary {
  color: var(--crm-gold);
  font-size: 0.68rem;
  font-weight: 900;
  text-decoration: none;
}

.crm-file-menu {
  position: relative;
}

.crm-file-menu summary {
  cursor: pointer;
  list-style: none;
}

.crm-file-menu[open] {
  grid-column: 1 / -1;
}

.crm-file-menu form {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.crm-file-menu input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(217, 174, 95, 0.15);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--crm-ink);
}

.crm-file-menu button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(217, 174, 95, 0.18);
  border-radius: 9px;
  background: rgba(217, 174, 95, 0.08);
  color: var(--crm-gold);
  font-size: 0.65rem;
}

.crm-file-menu button.is-danger {
  border-color: rgba(213, 122, 108, 0.2);
  background: rgba(213, 122, 108, 0.08);
  color: #e4a49b;
}

.crm-folder-empty,
.crm-folder-private {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  color: var(--crm-muted);
  font-size: 0.68rem;
  text-align: center;
}

.crm-folder-private {
  grid-template-columns: auto 1fr;
  gap: 9px;
  text-align: right;
  line-height: 1.75;
}

.crm-folder-private span {
  color: #d49b91;
}

.crm-upload-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
}

.crm-upload-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.crm-upload-form label,
.crm-upload-form button {
  min-height: 40px;
  border: 1px solid rgba(217, 174, 95, 0.18);
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 900;
}

.crm-upload-form label {
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
  color: var(--crm-ink-soft);
}

.crm-upload-form label:has(input:focus-visible) {
  outline: 2px solid var(--crm-gold);
}

.crm-upload-form button {
  padding: 0 13px;
  background: linear-gradient(135deg, #dfba6a, #986c2c);
  color: #100d08;
}

.crm-document-audit {
  margin-top: 16px;
  border: 1px solid rgba(226, 187, 105, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.crm-document-audit > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--crm-ink);
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.crm-document-audit > summary span {
  color: var(--crm-muted);
  font-size: 0.66rem;
}

.crm-document-audit > div {
  display: grid;
  gap: 4px;
  padding: 0 16px 14px;
}

.crm-document-audit article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.crm-document-audit article i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crm-gold);
}

.crm-document-audit article span {
  display: grid;
}

.crm-document-audit article strong {
  color: var(--crm-ink);
  font-size: 0.7rem;
}

.crm-document-audit article small,
.crm-document-audit article b {
  color: var(--crm-muted);
  font-size: 0.6rem;
}

.crm-call-brand img {
  width: 132px;
  height: auto;
  max-height: 44px;
}

@media (min-width: 1540px) {
  .crm-folder-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .crm-shell {
    display: block;
  }

  .crm-sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(226, 187, 105, 0.13);
    scrollbar-width: none;
  }

  .crm-sidebar::-webkit-scrollbar {
    display: none;
  }

  .crm-logo img {
    width: 124px;
  }

  .crm-logo > span {
    display: none;
  }

  .crm-logo {
    flex: 0 0 auto;
    min-height: 46px;
  }

  .crm-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    margin: 0;
  }

  .crm-nav a {
    justify-content: flex-start;
    min-width: max-content;
    min-height: 42px;
    font-size: 0.76rem;
  }

  .crm-connection-panel {
    display: none;
  }

  .crm-main {
    padding-top: 20px;
  }

  .crm-detail-panel .crm-lead-meta,
  .crm-detail-panel .crm-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .crm-logo img {
    width: 118px;
  }

  .crm-client-files-head {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-folder-grid,
  .crm-detail-panel .crm-lead-meta,
  .crm-detail-panel .crm-form-grid,
  .crm-detail-panel .crm-edit-form,
  .crm-detail-panel .crm-activity-form,
  .crm-timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-detail-panel .crm-edit-form > button,
  .crm-detail-panel .crm-activity-form > button {
    min-height: 46px;
  }
}

@media (max-width: 520px) {
  .crm-client-files {
    margin-inline: -5px;
    padding: 14px;
  }

  .crm-folder-card > header {
    grid-template-columns: auto 1fr;
  }

  .crm-folder-count,
  .crm-folder-lock {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .crm-file-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .crm-file-menu {
    grid-column: 1 / -1;
  }

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

/* Final cascade lock for the live full-screen workspace. */
.crm-live-shell .crm-main { overflow-x: hidden; }
.crm-live-shell .crm-stage-section,
.crm-live-shell .crm-customer-workspace,
.crm-live-shell .crm-leads-panel,
.crm-live-shell .crm-client-panel { min-width: 0; max-width: 100%; }
.crm-live-shell .crm-live-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: 224px;
  grid-template-rows: minmax(480px, 1fr);
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
}
.crm-live-shell .crm-live-kanban .crm-kanban-column { min-height: 480px; }
.crm-live-shell .crm-live-kanban .crm-kanban-cards {
  align-content: start;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}
.crm-live-shell .crm-customer-table-wrap { width: 100%; max-width: 100%; overflow: auto; }

@media (max-width: 760px) {
  .crm-live-shell .crm-live-kanban { grid-auto-columns: min(82vw, 224px); }
}

/* 2026-07-27 sales intake and security refinement. */
body.crm-body { padding-bottom: 46px; }
.crm-live-topbar { grid-template-columns: minmax(0, 1fr) auto; }
.crm-live-topbar .crm-search { width: 100%; min-width: 0; }
.crm-live-topbar .crm-userbar { justify-self: start; }
.crm-sidebar .crm-logo { display: grid; justify-items: center; gap: 8px; }
.crm-sidebar .crm-logo img { width: min(154px, 100%); height: auto; }
.crm-sidebar .crm-logo strong { color: var(--crm-gold); font-size: .86rem; letter-spacing: .02em; }

.crm-body select {
  color-scheme: dark;
  background-color: #171612 !important;
  color: #f2e9d8 !important;
}
.crm-body select option {
  background: #171612;
  color: #f2e9d8;
}
.crm-body select option:checked { background: #76531f; color: #fff9ed; }

.crm-client-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.crm-alert-error { border-color: rgba(220,95,82,.35); background: rgba(220,95,82,.1); color: #f3aaa1; }
.crm-project-row button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.crm-contract-ready { color: #85c99b !important; }
.crm-contract-missing { color: #e89689 !important; }

.crm-project-dialog { width: min(980px, calc(100vw - 32px)); max-height: 94vh; }
.crm-project-dialog .crm-dialog-panel { max-height: 90vh; overflow-y: auto; scrollbar-width: thin; }
.crm-project-core-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crm-project-core-fields .crm-field-wide { grid-column: 1 / -1; }
.crm-price-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.crm-price-field input { border-radius: 0 11px 11px 0 !important; }
.crm-price-field span { display: grid; place-items: center; min-width: 72px; border: 1px solid rgba(226,187,105,.16); border-right: 0; border-radius: 11px 0 0 11px; background: rgba(215,171,80,.1); color: var(--crm-gold); font-size: .72rem; font-weight: 950; }

.crm-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.crm-drop-upload {
  position: relative;
  display: grid !important;
  justify-items: center;
  gap: 7px !important;
  min-height: 184px;
  padding: 20px;
  border: 1px dashed rgba(224,181,91,.35);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(215,171,80,.055), rgba(255,255,255,.012));
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.crm-drop-upload:hover,
.crm-drop-upload.is-over { border-color: var(--crm-gold); background: rgba(215,171,80,.1); transform: translateY(-1px); }
.crm-drop-upload.has-files { border-style: solid; border-color: rgba(125,199,148,.55); background: rgba(86,155,108,.08); }
.crm-drop-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.crm-drop-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(224,181,91,.25); border-radius: 12px; color: var(--crm-gold); font-size: 1.2rem; }
.crm-drop-icon svg,
.crm-jalali-picker > header > button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.crm-drop-upload strong { color: var(--crm-ink); font-size: .84rem; }
.crm-drop-upload strong em { margin-inline-start: 5px; color: #e89689; font-size: .62rem; font-style: normal; }
.crm-drop-upload small { max-width: 360px; color: var(--crm-muted); font-size: .66rem; line-height: 1.8; }
.crm-drop-upload b { padding: 7px 13px; border-radius: 9px; background: rgba(215,171,80,.12); color: var(--crm-gold); font-size: .67rem; }
.crm-drop-upload output { max-width: 100%; overflow: hidden; color: #8ac99d; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.crm-drop-upload-compact { grid-template-columns: auto minmax(0,1fr) auto; justify-items: start; align-items: center; min-height: 94px; text-align: right; }
.crm-drop-upload-compact .crm-drop-icon { grid-row: 1 / 4; }
.crm-drop-upload-compact b { grid-column: 3; grid-row: 1 / 4; }
.crm-drop-upload-compact output { grid-column: 2; }

.crm-dialog-panel { position: relative; }
.crm-jalali-field { position: static; }
.crm-date-trigger { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(226,187,105,.16); border-radius: 11px; background: rgba(255,255,255,.035); color: var(--crm-ink); font-weight: 800; }
.crm-date-trigger i { display: grid; place-items: center; color: var(--crm-gold); font-style: normal; }
.crm-date-trigger i svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.crm-jalali-picker { position: absolute; z-index: 200; top: 92px; left: 50%; right: auto; width: min(360px, calc(100vw - 54px)); max-height: calc(100% - 120px); overflow-y: auto; padding: 14px; border: 1px solid rgba(224,181,91,.28); border-radius: 18px; background: #11171f; box-shadow: 0 32px 100px rgba(0,0,0,.78); transform: translateX(-50%); }
.crm-jalali-picker[hidden] { display: none !important; }
.crm-jalali-picker > header { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 8px; padding: 0 0 12px; border: 0; }
.crm-jalali-picker > header > div { display: flex; justify-content: center; gap: 5px; }
.crm-jalali-picker button { border: 0; border-radius: 10px; background: #1d293a; color: #eef3fa; font: inherit; font-size: .72rem; font-weight: 850; cursor: pointer; }
.crm-jalali-picker > header button { min-height: 40px; padding: 0 11px; }
.crm-jalali-week,
.crm-jalali-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.crm-jalali-week { margin-bottom: 6px; color: #aeb9c8; font-size: .65rem; }
.crm-jalali-days button { min-height: 36px; background: transparent; }
.crm-jalali-days button:hover,
.crm-jalali-days button.selected,
.crm-jalali-months button.selected,
.crm-jalali-years button.selected { background: linear-gradient(135deg, #dbb35c, #9a6e2e); color: #100d08; }
.crm-jalali-months,
.crm-jalali-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.crm-jalali-months[hidden],
.crm-jalali-years[hidden],
.crm-jalali-week[hidden],
.crm-jalali-days[hidden] { display: none !important; }
.crm-jalali-months button,
.crm-jalali-years button { min-height: 48px; }
.crm-jalali-picker > footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.crm-jalali-picker > footer button { min-height: 44px; }
.crm-jalali-picker > footer button:last-child { background: linear-gradient(135deg, #dbb35c, #9a6e2e); color: #100d08; }

.crm-password-panel { border-color: rgba(224,181,91,.28); background: rgba(12,12,11,.96); color: var(--crm-ink); }
.crm-password-rules { display: grid; gap: 4px; margin: 0; padding-inline-start: 20px; color: var(--crm-muted); font-size: .7rem; }
.crm-global-footer { position: fixed; z-index: 90; right: 248px; bottom: 0; left: 0; display: flex; justify-content: center; gap: 5px; min-height: 38px; padding: 8px 20px; border-top: 1px solid rgba(224,181,91,.12); background: rgba(8,8,7,.94); color: rgba(239,229,208,.62); backdrop-filter: blur(18px); font-size: .68rem; font-weight: 750; }
.crm-global-footer a { color: var(--crm-gold); text-decoration: none; }
.crm-global-footer a:hover { text-decoration: underline; }
.crm-login-shell + .crm-global-footer { right: 0; }

@media (max-width: 1180px) {
  .crm-global-footer { right: 0; }
  .crm-sidebar .crm-logo { display: flex; }
  .crm-live-topbar { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 720px) {
  .crm-live-topbar { grid-template-columns: 1fr; }
  .crm-live-topbar .crm-userbar { grid-row: 2; width: 100%; justify-content: flex-start; }
  .crm-project-core-fields,
  .crm-upload-grid,
  .crm-client-meta { grid-template-columns: 1fr; }
  .crm-drop-upload-compact { grid-template-columns: auto 1fr; }
  .crm-drop-upload-compact b { grid-column: 1 / -1; grid-row: auto; width: 100%; text-align: center; }
  .crm-global-footer { font-size: .61rem; }
}
