:root {
  color-scheme: light;
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --ink: #142033;
  --muted: #64748b;
  --line: #d7e2f2;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eaf2ff;
  --blue-pale: #f4f8ff;
  --orange: #e57900;
  --orange-soft: #fff6ea;
  --orange-line: #ffd39d;
  --amber: #b7791f;
  --red: #dc2626;
  --shadow: 0 18px 45px rgba(37, 99, 235, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  font-size: 1.35rem;
}

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

.brand div > span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

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

.nav-section {
  display: grid;
  gap: 10px;
}

.nav-heading {
  color: #9aa6b8;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 0 14px;
  border-radius: 8px;
  color: #5f6f89;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 650;
}

.nav-item.active,
.nav-item:hover {
  background: #e9efff;
  color: #2563eb;
}

.nav-item [data-icon] {
  width: 28px;
  height: 28px;
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--blue-pale);
}

.sidebar-panel strong {
  display: block;
  font-size: 1.9rem;
  margin: 6px 0 2px;
}

.mini-label,
.sidebar-panel span:last-of-type {
  color: var(--muted);
  font-size: 0.82rem;
}

.sparkline {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 48px;
  margin-top: 14px;
}

.sparkline i {
  flex: 1;
  min-width: 0;
  border-radius: 4px 4px 0 0;
  background: var(--blue);
}

.content {
  min-width: 0;
  padding: 26px;
}

.mobile-topbar,
.page-header,
.toolbar,
.list-header,
.detail-hero,
.detail-actions {
  display: flex;
  align-items: center;
}

.mobile-topbar {
  display: none;
}

.page-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
}

h2 {
  margin-bottom: 4px;
  font-size: 1.3rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

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

.icon-button,
.primary-action,
.secondary-action,
.segment {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.menu-button {
  display: none;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 750;
  white-space: nowrap;
}

.primary-action {
  background: var(--blue);
  color: white;
}

.primary-action:hover {
  background: var(--blue-dark);
}

.secondary-action {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

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

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-header h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.dashboard-header p {
  margin-bottom: 0;
  color: #66758d;
  font-size: 1.18rem;
}

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

.period-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 168px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0 20px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}

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

.dashboard-kpi,
.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-kpi {
  position: relative;
  min-height: 122px;
  padding: 20px 18px;
}

.dashboard-kpi.highlighted {
  border-color: #8cadff;
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.kpi-label {
  display: block;
  margin-bottom: 10px;
  color: #66758d;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-kpi strong {
  display: block;
  color: #0f172a;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  line-height: 0.95;
}

.dashboard-kpi small {
  display: block;
  margin-top: 14px;
  color: #6b7890;
  font-size: 1rem;
}

.kpi-icon {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 24px;
  height: 24px;
  color: #97a4b8;
}

.work-order-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--orange-line);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 18px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
}

.work-order-alert strong,
.work-order-alert small {
  display: block;
}

.work-order-alert strong {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.work-order-alert small {
  color: #66758d;
  font-size: 1rem;
}

.work-order-alert b {
  color: var(--orange);
  font-size: 2.7rem;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}

.dashboard-card {
  overflow: hidden;
}

.dashboard-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.dashboard-card h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.dashboard-card p {
  margin-bottom: 0;
  color: #66758d;
  font-size: 1rem;
}

.dashboard-card > header [data-icon] {
  width: 26px;
  height: 26px;
  color: #6b7890;
}

.bar-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  align-items: end;
  gap: 34px;
  min-height: 382px;
  padding: 42px 36px 34px;
}

.chart-lines {
  position: absolute;
  inset: 38px 36px 72px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.chart-lines i {
  border-top: 1px dashed #dce5f3;
}

.bar-item {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  justify-items: center;
  height: 300px;
}

.bar {
  width: min(86%, 170px);
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: #4678ee;
}

.bar.light {
  background: #7197ef;
}

.bar.empty {
  opacity: 0.28;
}

.bar-item b {
  margin-top: 12px;
  color: #6b7890;
  font-size: 0.94rem;
  font-weight: 650;
}

.new-enquiry-stat {
  padding: 18px 20px 24px;
  border-bottom: 1px solid var(--line);
}

.new-enquiry-stat span {
  display: block;
  color: #66758d;
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.new-enquiry-stat strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 3rem;
  line-height: 1;
}

.new-enquiry-stat small {
  display: block;
  margin-top: 14px;
  color: #66758d;
  font-size: 0.95rem;
}

.new-enquiry-stat b {
  color: var(--red);
}

.enquiry-table {
  display: grid;
}

.enquiry-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 90px 120px;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.enquiry-row:last-child {
  border-bottom: 0;
}

.enquiry-row.heading {
  color: #66758d;
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enquiry-row strong,
.enquiry-row b {
  text-align: right;
}

.enquiry-row b {
  color: #66758d;
}

.enquiry-row span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--blue);
}

.dot.soft {
  background: #7ea2f5;
}

.dot.red {
  background: #f06b6b;
}

.metric,
.toolbar,
.access-panel,
.lead-list,
.detail-panel,
.user-form,
.team-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(18, 32, 37, 0.03);
}

.metric {
  padding: 16px;
}

.metric span,
.list-header span,
.lead-meta,
.detail-panel span,
.detail-section p,
.stage-control label {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 1.7rem;
}

.metric small {
  font-weight: 800;
}

.positive {
  color: var(--blue-dark);
}

.warning {
  color: var(--amber);
}

.toolbar {
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 240px;
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segment {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.segment.active {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: 0 1px 4px rgba(20, 36, 42, 0.08);
}

.access-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.access-current h2 {
  margin-bottom: 3px;
}

.select-field,
.form-grid label {
  display: grid;
  gap: 6px;
}

.select-field span,
.form-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.select-field.compact {
  width: min(260px, 100%);
}

.select-field select,
.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.user-form,
.team-panel {
  padding: 14px;
  box-shadow: none;
}

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

.section-title h3 {
  margin-bottom: 0;
}

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

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

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

.team-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.team-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-card strong,
.team-card span {
  display: block;
}

.team-card small {
  color: var(--muted);
  font-weight: 750;
}

.user-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  contain: paint;
}

.user-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: white;
}

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

.inline-select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.user-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.user-table tr:last-child td {
  border-bottom: 0;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

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

.leads-page-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

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

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

.lead-stat-card {
  position: relative;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.lead-stat-card span {
  display: block;
  margin-bottom: 8px;
  color: #66758d;
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-stat-card strong {
  display: block;
  color: #0f172a;
  font-size: 2.2rem;
  line-height: 1;
}

.lead-stat-card small {
  display: block;
  margin-top: 12px;
  color: #6b7890;
  font-size: 1rem;
}

.lead-stat-card i {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 22px;
  height: 22px;
  color: #7a879b;
}

.lead-stat-card i.success {
  color: #35c773;
}

.lead-filter-panel,
.lead-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: visible;
}

.lead-filter-panel {
  margin-bottom: 16px;
}

.filter-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.lead-feedback {
  display: none;
  margin: 12px 14px 0;
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f4f8ff;
  color: var(--blue-dark);
  font-weight: 700;
}

.lead-feedback.show {
  display: block;
}

.filter-title,
.filter-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-title [data-icon] {
  width: 22px;
  height: 22px;
  color: #66758d;
}

.filter-summary {
  color: #66758d;
}

.filter-summary b {
  color: #0f172a;
  font-size: 1.7rem;
}

.filter-controls {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(180px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(180px, 1fr) minmax(170px, 1fr) 120px auto;
  gap: 10px;
  padding: 14px;
  align-items: center;
}

.filter-input,
.filter-select {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface-2);
  color: #6b7890;
}

.filter-input input,
.filter-select select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.filter-select span {
  white-space: nowrap;
  color: var(--ink);
}

.filter-select.small {
  min-width: 118px;
}

.lead-table-card {
  overflow: hidden;
}

.lead-table-wrap {
  max-height: 680px;
  overflow: auto;
}

.lead-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

.lead-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: white;
}

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

.lead-table th {
  color: #66758d;
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-table td {
  color: var(--ink);
  font-size: 1rem;
}

.lead-table td strong,
.lead-table td span {
  display: block;
}

.lead-table td span {
  margin-top: 4px;
  color: #6b7890;
}

.lead-table td b {
  color: #0f172a;
  font-size: 1.15rem;
}

.status-pill {
  display: inline-flex !important;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: #0f172a !important;
  font-size: 0.82rem;
  font-weight: 750;
}

.status-pill.converted {
  border-color: #b7ebce;
  background: #effdf5;
  color: #0c7a43 !important;
}

.status-pill.dropped {
  background: #f8fafc;
}

.row-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.row-actions .icon-button {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.row-menu {
  position: absolute;
  z-index: 5;
  top: 38px;
  right: 0;
  display: none;
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: white;
  box-shadow: var(--shadow);
}

.row-menu.open {
  display: grid;
}

.row-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.row-menu button:hover {
  background: var(--blue-pale);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 18px;
  color: #66758d;
  border-top: 1px solid var(--line);
}

.table-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: #66758d;
}

.modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.lead-modal-card {
  width: min(980px, calc(100vw - 28px));
  padding: 0;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.lead-modal-card .modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 18px;
  background: white;
}

.modal-header p {
  margin-bottom: 0;
  color: #66758d;
}

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

.lead-form-sections {
  display: grid;
  gap: 24px;
  padding: 18px;
}

.lead-form-section {
  display: grid;
  gap: 18px;
}

.lead-form-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #66758d;
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-form-section h3 small {
  color: #66758d;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

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

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

.lead-form-grid span {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
}

.lead-form-grid span b {
  color: var(--red);
}

.lead-form-grid input,
.lead-form-grid select,
.lead-form-grid textarea {
  min-width: 0;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 24px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1rem;
}

.lead-form-grid select {
  border-radius: 999px;
}

.lead-form-grid textarea {
  min-height: 116px;
  padding-block: 18px;
  resize: vertical;
}

.lead-form-grid input::placeholder,
.lead-form-grid textarea::placeholder {
  color: #65738a;
}

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

.modal-actions {
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.lead-modal-card .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 16px 18px;
  background: white;
}

#userForm .lead-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
}

#userForm .lead-form-grid label {
  gap: 6px;
}

#userForm .lead-form-grid span {
  color: #66758d;
  font-size: 0.82rem;
  font-weight: 750;
}

#userForm .lead-form-grid input,
#userForm .lead-form-grid select {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  font-size: inherit;
}

.user-page-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

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

.user-stat-card {
  position: relative;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.user-stat-card span {
  display: block;
  margin-bottom: 8px;
  color: #66758d;
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-stat-card strong {
  display: block;
  color: #0f172a;
  font-size: 2.2rem;
  line-height: 1;
}

.user-stat-card small {
  display: block;
  margin-top: 12px;
  color: #6b7890;
  font-size: 1rem;
}

.user-stat-card i {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 22px;
  height: 22px;
  color: #7a879b;
}

.user-stat-card i.success {
  color: #35c773;
}

.member-filter-panel,
.member-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.member-filter-panel {
  margin-bottom: 16px;
}

.member-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: #66758d;
}

.member-filter-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.member-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.member-avatar {
  display: grid !important;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #edf3ff;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 850;
}

.member-role,
.member-status {
  display: inline-flex !important;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 750;
}

.member-role.manager {
  border: 1px solid #b8cdfd;
  background: #edf3ff;
  color: var(--blue);
}

.member-role.executive,
.member-role.director {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #66758d;
}

.member-role.admin {
  border: 1px solid #fecaca;
  background: #fff1f1;
  color: var(--red);
}

.member-status.active {
  border: 1px solid #b7ebce;
  background: #effdf5;
  color: #22c55e;
}

.member-status.inactive {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #66758d;
}

.hidden-admin-controls {
  display: none;
}

.performance-page-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.performance-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
  margin: 2px 0 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f6fd;
}

.performance-tabs button {
  min-height: 48px;
  border-radius: 6px;
  padding: 0 22px;
  color: #65738a;
  font-weight: 800;
  background: transparent;
}

.performance-tabs button.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

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

.performance-stat-card {
  position: relative;
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.performance-stat-card span {
  display: block;
  color: #6a778d;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.performance-stat-card strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
}

.performance-stat-card small {
  display: block;
  margin-top: 12px;
  color: #6b7890;
  font-size: 1rem;
}

.performance-stat-card i {
  position: absolute;
  top: 22px;
  right: 20px;
  width: 21px;
  height: 21px;
  color: #7a879b;
}

.performance-stat-card i.success {
  color: #35c773;
}

.performance-filter-panel,
.performance-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.performance-filter-panel {
  margin-bottom: 16px;
}

.performance-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.performance-filter-title .filter-title b {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  margin-left: 6px;
  place-items: center;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 0.85rem;
}

.performance-filter-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #6b7890;
  font-weight: 750;
}

.clear-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b7890;
  background: transparent;
  font-weight: 800;
}

.clear-link [data-icon] {
  width: 18px;
  height: 18px;
}

.performance-filter-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px;
}

.performance-panel {
  display: none;
}

.performance-panel.active {
  display: block;
}

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

.performance-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.performance-card h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.performance-card p {
  margin-bottom: 0;
  color: #6b7890;
}

.performance-card > header [data-icon] {
  color: var(--blue);
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 16px 18px 0;
  color: #7591d8;
  font-weight: 750;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-blue {
  background: #7ea2f4;
}

.legend-orange {
  background: #f59e0b;
}

.performance-bar-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(46px, 1fr));
  align-items: end;
  gap: 16px;
  min-height: 320px;
  padding: 34px 22px 36px;
  overflow-x: auto;
}

.performance-grid-lines {
  position: absolute;
  inset: 34px 22px 72px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.performance-grid-lines i {
  border-top: 1px dashed #dce6f5;
}

.performance-bar-item {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
  height: 250px;
  color: #66758d;
}

.performance-bar-item small {
  width: 100%;
  min-height: 34px;
  color: #66758d;
  font-weight: 750;
  text-align: center;
  transform: rotate(-28deg);
  transform-origin: center;
}

.performance-bar-item b {
  min-height: 18px;
  color: #66758d;
  font-size: 0.72rem;
  font-weight: 750;
}

.performance-bar {
  display: block;
  width: 42px;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
}

.performance-bar.green {
  background: #22c55e;
}

.performance-bar.blue {
  width: 24px;
  background: #7ea2f4;
}

.performance-bar.orange {
  width: 14px;
  background: #f59e0b;
}

.bar-pair {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  width: 52px;
  height: 100%;
}

.performance-table-wrap {
  max-width: 100%;
  overflow: auto;
  contain: paint;
}

.performance-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

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

.performance-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.performance-table tr:last-child td {
  border-bottom: 0;
}

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

.lead-list {
  min-width: 0;
  overflow: hidden;
}

.list-header {
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.lead-cards {
  display: grid;
}

.empty-state {
  display: grid;
  gap: 6px;
  min-height: 180px;
  place-content: center;
  padding: 24px;
  text-align: center;
}

.empty-state span {
  color: var(--muted);
}

.lead-card {
  display: grid;
  grid-template-columns: auto minmax(160px, 1.3fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(92px, 0.5fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.lead-card:hover,
.lead-card.selected {
  background: var(--blue-pale);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 850;
}

.avatar.large {
  width: 62px;
  height: 62px;
  font-size: 1.2rem;
}

.lead-main strong,
.lead-main span,
.lead-meta strong,
.lead-meta span {
  display: block;
}

.lead-main span,
.lead-meta span {
  margin-top: 4px;
  font-size: 0.84rem;
}

.lead-meta strong {
  font-size: 0.94rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e9f0fb;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
}

.pill.new {
  background: #eef2f4;
  color: #55636a;
}

.pill.contacted {
  background: #fff4df;
  color: var(--amber);
}

.pill.qualified,
.pill.won {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.score {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f6;
  font-weight: 850;
}

.detail-panel {
  position: sticky;
  top: 26px;
  padding: 18px;
}

.detail-hero {
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 0;
}

.quick-stats span {
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
  font-size: 0.78rem;
}

.quick-stats b {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.stage-control {
  display: grid;
  gap: 7px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.stage-control select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
}

.detail-section {
  padding-top: 16px;
}

.detail-section p {
  margin-bottom: 0;
  line-height: 1.5;
}

.detail-actions {
  gap: 10px;
  margin-top: 18px;
}

.detail-actions button {
  flex: 1;
}

.mobile-nav {
  display: none;
}

[data-icon] {
  display: inline-block;
  width: 19px;
  height: 19px;
  background: currentColor;
  flex: 0 0 auto;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

[data-icon="layout"],
[data-icon="dashboard"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='14' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3C/svg%3E"); }
[data-icon="database"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/%3E%3Cpath d='M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E"); }
[data-icon="key"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m11.5 11.5 9-9'/%3E%3Cpath d='m15 7 2 2'/%3E%3Cpath d='m18 4 2 2'/%3E%3C/svg%3E"); }
[data-icon="logout"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3C/svg%3E"); }
[data-icon="briefcase"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/%3E%3Crect width='20' height='14' x='2' y='6' rx='2'/%3E%3C/svg%3E"); }
[data-icon="users"],
[data-icon="leads"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
[data-icon="calendar"],
[data-icon="follow-up"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M12 14v3l2 1'/%3E%3C/svg%3E"); }
[data-icon="chart"],
[data-icon="performance"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 16V9'/%3E%3Cpath d='M12 16V5'/%3E%3Cpath d='M17 16v-3'/%3E%3C/svg%3E"); }
[data-icon="funnel"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h5l4 5h4l5 6'/%3E%3Cpath d='M18 17h3v-3'/%3E%3Cpath d='M3 12h4l3 4h4'/%3E%3C/svg%3E"); }
[data-icon="menu"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
[data-icon="chevron-down"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-icon="chevron-right"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
[data-icon="refresh"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M3 21v-5h5'/%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M16 8h5V3'/%3E%3C/svg%3E"); }
[data-icon="trend-up"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 17 6-6 4 4 8-8'/%3E%3Cpath d='M14 7h7v7'/%3E%3C/svg%3E"); }
[data-icon="flame"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A4.5 4.5 0 0 0 12 22a4.5 4.5 0 0 0 3.5-7.5c-.7-.8-1.2-1.6-1.3-2.8-1.2.7-2.5 1.9-2.8 3.4-1.1-1.7-1.4-4.2.2-7.1C7.6 10.5 5 13.5 5 17a7 7 0 0 0 14 0c0-4.2-2.4-7.8-5.4-10.8.2 2.2-.4 3.7-1.2 4.8'/%3E%3C/svg%3E"); }
[data-icon="trophy"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8'/%3E%3Cpath d='M12 17v4'/%3E%3Cpath d='M7 4h10v5a5 5 0 0 1-10 0V4Z'/%3E%3Cpath d='M5 5H3v3a4 4 0 0 0 4 4'/%3E%3Cpath d='M19 5h2v3a4 4 0 0 1-4 4'/%3E%3C/svg%3E"); }
[data-icon="rupee"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12'/%3E%3Cpath d='M6 8h12'/%3E%3Cpath d='M6 13h6a5 5 0 0 0 0-10'/%3E%3Cpath d='m6 13 8 8'/%3E%3C/svg%3E"); }
[data-icon="package"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9-5-9 5 9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3Cpath d='m7.5 5.5 9 5'/%3E%3C/svg%3E"); }
[data-icon="bell"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3C/svg%3E"); }
[data-icon="plus"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E"); }
[data-icon="search"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
[data-icon="download"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E"); }
[data-icon="upload"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M17 8l-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%3E%3C/svg%3E"); }
[data-icon="phone"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.8 19.8 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.12 4.2 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.95.34 1.88.65 2.76a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.32-1.22a2 2 0 0 1 2.11-.45c.88.31 1.81.53 2.76.65A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
[data-icon="mail"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
[data-icon="user-plus"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6'/%3E%3Cpath d='M22 11h-6'/%3E%3C/svg%3E"); }
[data-icon="user-cog"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 19v-1a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v1'/%3E%3Ccircle cx='8' cy='7' r='4'/%3E%3Ccircle cx='18' cy='15' r='3'/%3E%3Cpath d='M18 11v1M18 18v1M14.5 13l.9.5M20.6 16.5l.9.5M14.5 17l.9-.5M20.6 13.5l.9-.5'/%3E%3C/svg%3E"); }
[data-icon="user-x"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='m17 8 5 5'/%3E%3Cpath d='m22 8-5 5'/%3E%3C/svg%3E"); }
[data-icon="user-check"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='m16 11 2 2 4-4'/%3E%3C/svg%3E"); }
[data-icon="user-minus"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M17 11h5'/%3E%3C/svg%3E"); }
[data-icon="shield"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.7 8.8a1 1 0 0 1-.6 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.2-2.4a1.4 1.4 0 0 1 1.6 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1v7Z'/%3E%3C/svg%3E"); }
[data-icon="check-circle"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E"); }
[data-icon="calendar-plus"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M12 14v5'/%3E%3Cpath d='M9.5 16.5h5'/%3E%3C/svg%3E"); }
[data-icon="sliders"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21v-7'/%3E%3Cpath d='M4 10V3'/%3E%3Cpath d='M12 21v-9'/%3E%3Cpath d='M12 8V3'/%3E%3Cpath d='M20 21v-5'/%3E%3Cpath d='M20 12V3'/%3E%3Cpath d='M2 14h4'/%3E%3Cpath d='M10 8h4'/%3E%3Cpath d='M18 16h4'/%3E%3C/svg%3E"); }
[data-icon="dots"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 12h.01M19 12h.01M5 12h.01'/%3E%3C/svg%3E"); }
[data-icon="close"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }

.alert-icon[data-icon] {
  display: grid;
  width: 48px;
  height: 48px;
}

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

  .sidebar {
    padding-inline: 12px;
    gap: 18px;
  }

  .brand div,
  .nav-item,
  .nav-heading {
    font-size: 0;
  }

  .nav-list {
    gap: 14px;
  }

  .nav-section {
    gap: 6px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
    min-height: 52px;
  }

  .sidebar-panel {
    display: none;
  }

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

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

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

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

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

  .performance-chart-grid {
    grid-template-columns: 1fr;
  }

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

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

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

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

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

  .detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 70px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: 300px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

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

  .brand div,
  .nav-item,
  .nav-heading {
    font-size: initial;
  }

  .nav-list {
    gap: 24px;
  }

  .nav-heading {
    font-size: 0.82rem;
  }

  .nav-item {
    justify-content: flex-start;
    min-height: 58px;
    padding: 0 14px;
  }

  .content {
    padding: 18px 14px;
  }

  .menu-button {
    display: grid;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
  }

  .dashboard-header {
    align-items: start;
    display: grid;
  }

  .dashboard-actions {
    justify-content: space-between;
  }

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

  .work-order-alert {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
  }

  .work-order-alert > [data-icon="chevron-right"] {
    display: none;
  }

  .work-order-alert b {
    font-size: 2.2rem;
  }

  .bar-chart {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 12px;
    min-height: 300px;
    padding: 36px 18px 28px;
    overflow-x: auto;
  }

  .chart-lines {
    inset: 34px 18px 62px;
  }

  .bar-item {
    height: 230px;
  }

  .enquiry-row {
    grid-template-columns: minmax(120px, 1fr) 64px 94px;
    padding-inline: 14px;
  }

  .primary-action,
  .secondary-action {
    padding-inline: 12px;
  }

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

  .metric {
    padding: 12px;
  }

  .metric strong {
    font-size: 1.35rem;
  }

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

  .leads-page-header,
  .filter-title-row,
  .table-footer {
    align-items: start;
    display: grid;
  }

  .lead-page-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .lead-page-actions button {
    width: 100%;
  }

  .lead-stats-grid,
  .user-stats-grid,
  .performance-stats-grid,
  .filter-controls {
    grid-template-columns: 1fr;
  }

  .user-page-header,
  .member-filter-title,
  .performance-filter-title {
    align-items: start;
    display: grid;
  }

  .user-page-header .primary-action {
    width: 100%;
  }

  .member-filter-controls {
    grid-template-columns: 1fr;
  }

  .performance-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .performance-tabs button {
    padding-inline: 10px;
  }

  .performance-filter-summary {
    align-items: start;
    display: grid;
    gap: 8px;
  }

  .performance-filter-controls {
    grid-template-columns: 1fr;
  }

  .performance-bar-chart {
    grid-template-columns: repeat(10, minmax(54px, 1fr));
    min-height: 300px;
    padding-inline: 18px;
  }

  .performance-bar-item {
    height: 226px;
  }

  .chart-legend {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .lead-table-wrap {
    max-height: 620px;
  }

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

  #userForm .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .access-current,
  .section-title {
    display: grid;
  }

  .section-title span {
    text-align: left;
  }

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

  .search-box {
    min-width: 0;
  }

  .segmented {
    overflow-x: auto;
  }

  .lead-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    min-height: 92px;
  }

  .lead-card .lead-meta,
  .lead-card .score {
    display: none;
  }

  .score {
    width: 34px;
    height: 34px;
  }

  .detail-panel {
    padding: 15px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 8;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-nav a {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 9px 4px 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 750;
  }

  .mobile-nav a.active {
    color: var(--blue-dark);
  }
}

@media (max-width: 420px) {
  .content {
    padding-inline: 10px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .dashboard-actions {
    grid-template-columns: 1fr auto;
    display: grid;
    width: 100%;
  }

  .period-button {
    min-width: 0;
  }

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

  .list-header {
    align-items: start;
    flex-direction: column;
    justify-content: center;
    padding-block: 10px;
  }

  .lead-card {
    padding-inline: 12px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }
}

/* v1.0.2 interaction and missing-page fixes retained */
.period-control {
  display: inline-flex;
}

.period-control .period-button {
  appearance: none;
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, #66758d 50%), linear-gradient(135deg, #66758d 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.filter-controls {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.filter-controls > .filter-input:first-child {
  grid-column: span 2;
}

.compact-controls {
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) minmax(200px, 1fr) auto;
}

.compact-controls > .filter-input:first-child {
  grid-column: auto;
}

.followup-table {
  min-width: 980px;
}

.table-action-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mini-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

.mini-action:hover {
  border-color: #9db8ff;
  background: var(--blue-pale);
  color: var(--blue-dark);
}

.mini-action.success {
  border-color: #b7ebce;
  background: #effdf5;
  color: #0c7a43;
}

.funnel-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.funnel-stage-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.funnel-stage-card:hover,
.funnel-stage-card:focus-visible {
  border-color: #8cadff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
  outline: 0;
}

.funnel-stage-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-weight: 850;
}

.funnel-stage-card strong {
  font-size: 1rem;
}

.funnel-stage-card b {
  font-size: 2.4rem;
  line-height: 1;
}

.funnel-stage-card small {
  color: var(--blue-dark);
  font-size: 1.1rem;
  font-weight: 850;
}

.funnel-stage-card i {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: normal;
}

.settings-card {
  max-width: 980px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  background: var(--surface);
}

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

.settings-grid label:not(.toggle-field) {
  display: grid;
  gap: 8px;
}

.settings-grid label > span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.settings-grid input,
.settings-grid select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--ink);
}

.toggle-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-field input {
  width: 18px;
  min-height: 18px;
}

.settings-note {
  margin-top: 20px;
  border: 1px solid #c9dafd;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f5f8ff;
  color: #52627b;
  line-height: 1.55;
}

.settings-note code {
  color: #1d4ed8;
  font-weight: 750;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-feedback {
  margin-right: auto;
  color: var(--muted);
  font-weight: 700;
}

.app-toast {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 28px));
  border: 1px solid #a7e0bf;
  border-radius: 10px;
  padding: 13px 16px;
  background: #effdf5;
  color: #0c6b3c;
  box-shadow: var(--shadow);
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-toast[data-type="error"] {
  border-color: #ffc2c2;
  background: #fff3f3;
  color: #a12424;
}

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

.row-menu.floating {
  position: fixed;
  z-index: 110;
  right: auto;
  bottom: auto;
}

.user-table-wrap {
  contain: none;
}

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

@media (max-width: 720px) {
  .mobile-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .compact-controls,
  .settings-grid,
  .funnel-board {
    grid-template-columns: 1fr;
  }

  .filter-controls > .filter-input:first-child {
    grid-column: auto;
  }

  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-feedback {
    margin-right: 0;
  }

  .settings-actions button {
    width: 100%;
  }
}


/* v1.0.3 compact ProjectCode-inspired desktop layout */
.secondary-action { text-decoration: none; }
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.app-topbar-title { color: var(--ink); font-size: 0.82rem; font-weight: 750; }
.maharshi-wordmark { color: #1e3a8a; font-size: 0.9rem; letter-spacing: 0.04em; }

@media (min-width: 721px) {
  body { font-size: 13px; background: #f8fafc; }
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { gap: 12px; padding: 12px 8px; }
  .brand { gap: 9px; padding: 2px 4px 10px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 6px; font-size: 1rem; }
  .brand strong { font-size: 0.84rem; }
  .brand div > span { font-size: 0.68rem; margin-top: 0; }
  .nav-list { gap: 14px; }
  .nav-section { gap: 3px; }
  .nav-heading { padding: 0 5px; font-size: 0.62rem; letter-spacing: 0.05em; }
  .nav-item { gap: 10px; min-height: 38px; padding: 0 9px; border-radius: 5px; font-size: 0.78rem; }
  .nav-item [data-icon] { width: 17px; height: 17px; }
  .sidebar-panel { padding: 10px; border-radius: 6px; }
  .sidebar-panel strong { margin: 3px 0 0; font-size: 1.25rem; }
  .mini-label, .sidebar-panel span:last-of-type { font-size: 0.66rem; }
  .sparkline { height: 28px; margin-top: 7px; gap: 3px; }

  .content { padding: 0; }
  .view { padding: 14px 16px 24px; }
  .page-header { margin-bottom: 12px; }
  h1, .dashboard-header h1 { margin-bottom: 3px; font-size: 1.35rem; line-height: 1.15; }
  h2 { font-size: 0.98rem; }
  .page-header p, .dashboard-header p { font-size: 0.76rem; }
  .dashboard-header { align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 10px; }
  .dashboard-actions { gap: 7px; }
  .period-button { min-width: 120px; min-height: 34px; padding: 0 12px; border-radius: 18px; font-size: 0.72rem; }
  .icon-button { width: 34px; height: 34px; border-radius: 6px; }
  .primary-action, .secondary-action { min-height: 34px; padding: 0 11px; border-radius: 6px; font-size: 0.72rem; }

  .dashboard-kpis, .metrics-grid, .lead-stats-grid, .followup-stats-grid { gap: 8px; margin-bottom: 10px; }
  .dashboard-kpi { min-height: 88px; padding: 11px 12px; border-radius: 6px; }
  .kpi-label { margin-bottom: 6px; font-size: 0.62rem; letter-spacing: 0.05em; }
  .dashboard-kpi strong { font-size: 1.85rem; line-height: 1; }
  .dashboard-kpi small { margin-top: 7px; font-size: 0.7rem; }
  .kpi-icon { top: 12px; right: 11px; width: 15px; height: 15px; }
  .work-order-alert { gap: 11px; min-height: 53px; padding: 8px 13px; margin-bottom: 10px; border-radius: 6px; }
  .alert-icon { width: 30px; height: 30px; }
  .work-order-alert strong { margin-bottom: 1px; font-size: 0.8rem; }
  .work-order-alert small { font-size: 0.68rem; }
  .work-order-alert b { font-size: 1.75rem; }

  .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.9fr); gap: 10px; }
  .dashboard-card { border-radius: 6px; }
  .dashboard-card > header { min-height: 48px; padding: 9px 12px; }
  .dashboard-card h2 { margin-bottom: 2px; font-size: 0.8rem; }
  .dashboard-card p { font-size: 0.67rem; }
  .dashboard-card > header [data-icon] { width: 17px; height: 17px; }
  .bar-chart { gap: 20px; min-height: 250px; padding: 26px 22px 22px; }
  .chart-lines { inset: 23px 22px 55px; }
  .bar-item { height: 190px; }
  .bar { width: min(82%, 118px); border-radius: 4px 4px 0 0; }
  .bar-item b { margin-top: 8px; font-size: 0.68rem; }
  .new-enquiry-stat { padding: 11px 12px 13px; }
  .new-enquiry-stat span { font-size: 0.62rem; }
  .new-enquiry-stat strong { margin-top: 4px; font-size: 1.7rem; }
  .new-enquiry-stat small { margin-top: 7px; font-size: 0.67rem; }
  .enquiry-row { grid-template-columns: minmax(130px, 1fr) 66px 86px; min-height: 39px; padding: 0 12px; font-size: 0.72rem; }
  .enquiry-row.heading { font-size: 0.61rem; }
  .dot { width: 8px; height: 8px; }

  .lead-stat-card, .metric-card, .followup-stat-card, .performance-stat-card { min-height: 84px; padding: 12px; }
  .lead-stat-card strong, .metric-value, .followup-stat-card strong, .performance-stat-card strong { font-size: 1.6rem; }
  .lead-filter-panel, .table-card, .performance-card, .settings-card { border-radius: 6px; }
  .lead-filter-panel { padding: 12px; }
  .filter-controls { gap: 7px; }
  .filter-input, .filter-select { min-height: 34px; font-size: 0.72rem; }
  .lead-table-wrap { max-height: 650px; }
  .lead-table, .user-table, .performance-table { font-size: 0.72rem; }
  .lead-table th, .lead-table td, .user-table th, .user-table td, .performance-table th, .performance-table td { padding-top: 9px; padding-bottom: 9px; }
  .modal-card { font-size: 0.78rem; }
  .modal-header { padding: 14px 16px; }
  .lead-form-section { padding: 14px 16px; }
  .lead-form-grid { gap: 10px 12px; }
  .lead-form-grid input, .lead-form-grid select, .lead-form-grid textarea, .settings-grid input, .settings-grid select { min-height: 38px; }
  .lead-form-grid textarea { min-height: 82px; }
  .settings-card { max-width: 860px; padding: 16px; }
  .settings-grid { gap: 12px; }
  .funnel-board { gap: 9px; }
  .funnel-stage-card { min-height: 150px; padding: 13px; }
  .funnel-stage-card b { font-size: 1.7rem; }
  .performance-bar-chart { min-height: 260px; }
}

@media (max-width: 720px) {
  .app-topbar { display: none; }
}

/* v1.0.4: exact compact typography and row density for 100% desktop zoom */
@media (min-width: 721px) {
  html { font-size: 12px; }
  body {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.28;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  .app-shell { grid-template-columns: 256px minmax(0, 1fr); }
  .sidebar { gap: 12px; padding: 12px 10px; }
  .brand { gap: 9px; padding: 2px 4px 10px; }
  .brand-mark { width: 30px; height: 30px; font-size: 1rem; }
  .brand strong { font-size: 0.92rem; font-weight: 700; }
  .brand div > span { font-size: 0.72rem; }
  .nav-list { gap: 14px; }
  .nav-section { gap: 3px; }
  .nav-heading {
    padding: 0 5px;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.035em;
  }
  .nav-item {
    gap: 9px;
    min-height: 35px;
    padding: 0 9px;
    font-size: 0.9rem;
    font-weight: 500;
  }
  .nav-item [data-icon] { width: 16px; height: 16px; }
  .sidebar-panel { padding: 10px; }
  .sidebar-panel strong { font-size: 1.38rem; font-weight: 700; }
  .mini-label,
  .sidebar-panel span:last-of-type { font-size: 0.7rem; }

  .app-topbar { min-height: 42px; padding: 0 18px; }
  .app-topbar-title { font-size: 0.88rem; font-weight: 650; }
  .maharshi-wordmark { font-size: 0.9rem; font-weight: 750; }
  .view { padding: 14px 18px 24px; }

  h1,
  .dashboard-header h1 {
    margin-bottom: 3px;
    font-size: 1.5rem;
    font-weight: 650;
    line-height: 1.12;
  }
  h2 { font-size: 1rem; font-weight: 650; }
  h3 { font-size: 0.9rem; font-weight: 650; }
  .page-header p,
  .dashboard-header p { font-size: 0.84rem; line-height: 1.35; }
  .page-header { margin-bottom: 10px; }
  .leads-page-header { padding-bottom: 10px; }

  .primary-action,
  .secondary-action {
    min-height: 31px;
    padding: 0 10px;
    gap: 6px;
    border-radius: 5px;
    font-size: 0.86rem;
    font-weight: 600;
  }
  .primary-action [data-icon],
  .secondary-action [data-icon] { width: 14px; height: 14px; }
  .icon-button { width: 31px; height: 31px; }

  .lead-stats-grid,
  .dashboard-kpis,
  .metrics-grid,
  .followup-stats-grid { gap: 8px; margin-bottom: 9px; }
  .lead-stat-card,
  .metric-card,
  .followup-stat-card,
  .performance-stat-card {
    min-height: 76px;
    padding: 10px 12px;
    border-radius: 6px;
  }
  .lead-stat-card span,
  .metric-card > span,
  .followup-stat-card span,
  .performance-stat-card span {
    margin-bottom: 4px;
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.045em;
  }
  .lead-stat-card strong,
  .metric-value,
  .followup-stat-card strong,
  .performance-stat-card strong {
    font-size: 1.7rem;
    font-weight: 650;
    line-height: 1;
  }
  .lead-stat-card small,
  .metric-card small,
  .followup-stat-card small,
  .performance-stat-card small {
    margin-top: 6px;
    font-size: 0.78rem;
  }
  .lead-stat-card i,
  .followup-stat-card i,
  .performance-stat-card i {
    top: 11px;
    right: 11px;
    width: 16px;
    height: 16px;
  }

  .lead-filter-panel { margin-bottom: 9px; padding: 0; }
  .filter-title-row {
    min-height: 38px;
    padding: 0 12px;
    gap: 10px;
  }
  .filter-title { gap: 7px; font-size: 0.84rem; }
  .filter-title strong { font-weight: 650; }
  .filter-title [data-icon] { width: 15px; height: 15px; }
  .filter-summary { gap: 7px; font-size: 0.8rem; }
  .filter-summary b { font-size: 1.34rem; font-weight: 650; }
  .lead-feedback { margin: 8px 9px 0; padding: 7px 9px; font-size: 0.8rem; }

  .filter-controls {
    grid-template-columns: minmax(190px, 1.25fr) minmax(135px, .75fr) minmax(125px, .72fr) minmax(125px, .72fr) minmax(135px, .78fr) minmax(125px, .72fr) 105px 100px;
    gap: 6px;
    padding: 8px;
  }
  .filter-input,
  .filter-select {
    min-height: 30px;
    gap: 6px;
    padding: 0 9px;
    border-radius: 5px;
    font-size: 0.82rem;
  }
  .filter-input [data-icon] { width: 13px; height: 13px; }
  .filter-input input,
  .filter-select select { font-size: 0.82rem; }
  .filter-select span { font-size: 0.78rem; font-weight: 550; }
  .filter-controls .secondary-action { min-height: 30px; font-size: 0.8rem; }

  .lead-table-wrap { max-height: 650px; }
  .lead-table { min-width: 1080px; }
  .lead-table th,
  .lead-table td {
    padding: 7px 12px;
    line-height: 1.2;
  }
  .lead-table th {
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.045em;
  }
  .lead-table td {
    font-size: 0.84rem;
    font-weight: 400;
  }
  .lead-table td strong {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.16;
  }
  .lead-table td span {
    margin-top: 2px;
    font-size: 0.76rem;
    line-height: 1.15;
  }
  .lead-table td b {
    font-size: 0.88rem;
    font-weight: 650;
  }
  .status-pill {
    min-height: 20px;
    padding: 0 7px;
    font-size: 0.7rem;
    font-weight: 600;
  }
  .row-menu-button { width: 26px; height: 26px; }
  .row-menu { font-size: 0.8rem; }
  .table-footer { min-height: 38px; padding: 7px 10px; font-size: 0.78rem; }

  .dashboard-header { padding-bottom: 9px; margin-bottom: 9px; }
  .period-button {
    min-width: 116px;
    min-height: 31px;
    padding: 0 11px;
    font-size: 0.8rem;
    font-weight: 550;
  }
  .dashboard-kpi { min-height: 80px; padding: 10px 12px; }
  .kpi-label { margin-bottom: 5px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.045em; }
  .dashboard-kpi strong { font-size: 1.9rem; font-weight: 650; }
  .dashboard-kpi small { margin-top: 6px; font-size: 0.78rem; }
  .kpi-icon { top: 11px; right: 11px; width: 15px; height: 15px; }
  .work-order-alert { min-height: 48px; padding: 7px 12px; }
  .work-order-alert strong { font-size: 0.84rem; font-weight: 650; }
  .work-order-alert small { font-size: 0.74rem; }
  .work-order-alert b { font-size: 1.7rem; font-weight: 650; }
  .dashboard-card > header { min-height: 43px; padding: 8px 11px; }
  .dashboard-card h2 { font-size: 0.86rem; font-weight: 650; }
  .dashboard-card p { font-size: 0.73rem; }
  .bar-item b,
  .enquiry-row,
  .new-enquiry-stat small { font-size: 0.76rem; }

  .user-table,
  .performance-table,
  .followup-table { font-size: 0.82rem; }
  .user-table th,
  .user-table td,
  .performance-table th,
  .performance-table td,
  .followup-table th,
  .followup-table td {
    padding: 7px 10px;
    font-size: 0.82rem;
    line-height: 1.2;
  }
  .user-table th,
  .performance-table th,
  .followup-table th {
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.04em;
  }
  .role-pill { min-height: 20px; padding: 0 7px; font-size: 0.7rem; font-weight: 600; }

  .modal-card { font-size: 0.86rem; }
  .modal-header { padding: 12px 14px; }
  .modal-header h2 { font-size: 1.05rem; }
  .lead-form-section { padding: 12px 14px; }
  .lead-form-section h3 { font-size: 0.9rem; }
  .lead-form-grid { gap: 8px 10px; }
  .lead-form-grid span { font-size: 0.78rem; }
  .lead-form-grid input,
  .lead-form-grid select,
  .lead-form-grid textarea,
  .settings-grid input,
  .settings-grid select {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.84rem;
  }
  .lead-form-grid textarea { min-height: 72px; padding-top: 8px; }
}

/* v1.1.0 Secure Login, IAM and SQL Backup */
[hidden] { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(420px, 0.95fr);
  background: #f4f7fc;
}
.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow: hidden;
  padding: 38px 48px 58px;
  color: #fff;
  background: linear-gradient(145deg, #0b2d6b 0%, #1255c4 55%, #2e72ef 100%);
}
.auth-brand-panel::before,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.auth-brand-panel::before { width: 420px; height: 420px; right: -180px; top: -140px; }
.auth-brand-panel::after { width: 520px; height: 520px; left: -260px; bottom: -300px; }
.auth-brand, .auth-copy { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-mark { width: 42px; height: 42px; font-size: 25px; background: #fff; color: #1b5ed3; }
.auth-brand div { display: flex; flex-direction: column; gap: 3px; }
.auth-brand strong { font-size: 1rem; }
.auth-brand span:last-child { font-size: .73rem; color: rgba(255,255,255,.75); }
.auth-copy { max-width: 620px; margin: auto 0; }
.auth-eyebrow { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-size: .68rem; font-weight: 750; letter-spacing: .1em; }
.auth-copy h1 { margin: 22px 0 15px; max-width: 590px; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.05; letter-spacing: -.045em; }
.auth-copy > p { max-width: 540px; margin: 0; color: rgba(255,255,255,.78); font-size: 1rem; line-height: 1.65; }
.auth-security-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.auth-security-list span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(255,255,255,.09); font-size: .75rem; }
.auth-form-panel { display: grid; place-items: center; padding: 42px; }
.auth-form-panel.single { grid-column: 1 / -1; }
.auth-card { width: min(100%, 430px); padding: 34px; border: 1px solid #dbe4f1; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(25, 55, 105, .13); }
.auth-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-lock { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: #eaf2ff; color: #1e62dd; }
.auth-card h2 { margin: 0; font-size: 1.42rem; letter-spacing: -.025em; }
.auth-card-heading p { margin: 4px 0 0; color: #697890; font-size: .82rem; }
.auth-card > label, .compact-modal > label { display: grid; gap: 7px; margin: 0 0 16px; }
.auth-card label > span, .compact-modal label > span { color: #35445d; font-size: .77rem; font-weight: 650; }
.auth-card input, .compact-modal input { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid #cfd9e8; border-radius: 8px; outline: none; background: #fff; color: #17233b; font-size: .88rem; }
.auth-card input:focus, .compact-modal input:focus { border-color: #2b6ee8; box-shadow: 0 0 0 3px rgba(43,110,232,.12); }
.password-input { display: grid; grid-template-columns: 1fr auto; border: 1px solid #cfd9e8; border-radius: 8px; overflow: hidden; }
.password-input input { border: 0; border-radius: 0; box-shadow: none !important; }
.password-input button { min-width: 58px; border: 0; background: #f5f8fd; color: #245cb5; font-size: .75rem; font-weight: 650; cursor: pointer; }
.auth-submit { width: 100%; min-height: 43px; border: 0; border-radius: 8px; background: #1f63df; color: #fff; font-size: .86rem; font-weight: 700; cursor: pointer; }
.auth-submit:hover { background: #1856c8; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-error { min-height: 20px; margin: 2px 0 10px; color: #c92828; font-size: .76rem; line-height: 1.4; }
.auth-help, .password-policy { margin: 18px 0 0; color: #75839a; font-size: .72rem; line-height: 1.55; text-align: center; }
.password-change-shell { grid-template-columns: 1fr; }

.sidebar-account { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.sidebar-user > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e7efff; color: #205cca; font-size: .71rem; font-weight: 750; }
.sidebar-user div { display: grid; gap: 2px; min-width: 0; }
.sidebar-user strong { overflow: hidden; font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: var(--muted); font-size: .66rem; }
.sidebar-account button { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: #43546d; font-size: .72rem; text-align: left; cursor: pointer; }
.sidebar-account button:hover { background: #edf3fc; }
.sidebar-account .danger-link { color: #d12b2b; }
.sidebar-account + .sidebar-panel { margin-top: 8px; }

.iam-tabs { display: flex; gap: 4px; margin: 0 0 10px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.iam-tabs button { min-height: 31px; padding: 0 13px; border: 0; border-radius: 6px; background: transparent; color: #617089; font-size: .76rem; font-weight: 650; cursor: pointer; }
.iam-tabs button.active { background: #eaf2ff; color: #1d5ed5; }
.panel-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.panel-heading-row h2 { margin: 0; font-size: .94rem; }
.panel-heading-row p { margin: 3px 0 0; color: var(--muted); font-size: .72rem; }
.role-management-panel, .audit-panel { border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }
.role-layout { display: grid; grid-template-columns: minmax(230px, 28%) 1fr; min-height: 520px; }
.role-list { padding: 10px; border-right: 1px solid var(--line); background: #f8fbff; }
.role-list-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.role-list-item:hover { background: #fff; }
.role-list-item.active { border-color: #bdd2f8; background: #eaf2ff; }
.role-list-item span { display: grid; gap: 3px; min-width: 0; }
.role-list-item strong { font-size: .78rem; }
.role-list-item small { overflow: hidden; color: var(--muted); font-size: .65rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.role-list-item b { display: grid; place-items: center; min-width: 24px; height: 22px; border-radius: 999px; background: #fff; color: #3165bc; font-size: .65rem; }
.role-editor { min-width: 0; padding: 15px; }
.role-editor-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.role-editor-header h3 { margin: 0; font-size: 1rem; }
.role-editor-header p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; }
.permission-count, .schedule-status { padding: 5px 8px; border-radius: 999px; background: #edf3fc; color: #4a607e; font-size: .65rem; font-weight: 700; }
.schedule-status.enabled { background: #e4f7eb; color: #178248; }
.role-fields { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin-bottom: 14px; }
.role-fields label { display: grid; gap: 5px; }
.role-fields span { font-size: .7rem; font-weight: 650; }
.role-fields input, .role-fields textarea { min-height: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: .76rem; resize: vertical; }
.permission-matrix { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.permission-group { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.permission-group header { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f5f8fd; }
.permission-group header strong { font-size: .72rem; }
.permission-group header span { color: var(--muted); font-size: .62rem; }
.permission-group > div { display: grid; padding: 5px 10px; }
.permission-group label { display: flex; align-items: center; gap: 8px; min-height: 30px; border-bottom: 1px solid #edf1f7; font-size: .71rem; }
.permission-group label:last-child { border-bottom: 0; }
.permission-group input { width: 14px; height: 14px; }
.permission-group.individual label { justify-content: space-between; }
.permission-group.individual select { min-width: 86px; min-height: 27px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .67rem; }
.individual-permission-matrix { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.individual-permission-matrix.scrollable { max-height: 390px; padding-right: 4px; overflow: auto; }
.invite-explainer, .backup-warning { display: flex; gap: 10px; margin-top: 13px; padding: 11px; border: 1px solid #cfe0ff; border-radius: 8px; background: #f3f7ff; }
.invite-explainer strong, .backup-warning strong { font-size: .76rem; }
.invite-explainer p, .backup-warning p { margin: 3px 0 0; color: #65758e; font-size: .69rem; line-height: 1.45; }
.permission-overrides { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.permission-overrides summary { color: #285eb8; font-size: .74rem; font-weight: 650; cursor: pointer; }
.member-summary { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px; border-radius: 8px; background: #f3f6fb; }
.member-summary div { display: grid; gap: 2px; }
.member-summary strong { font-size: .79rem; }
.member-summary small, .member-name small { color: var(--muted); font-size: .65rem; }
.member-name > div { display: grid; gap: 2px; }
.individual-permission-heading { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.individual-permission-heading strong { font-size: .78rem; }
.individual-permission-heading p { margin: 3px 0 0; color: var(--muted); font-size: .66rem; }
.text-button { border: 0; background: transparent; color: #1f5fcf; font-size: .7rem; cursor: pointer; }
.iam-edit-card { width: min(900px, calc(100vw - 28px)); }
.modal-permissions { max-height: 400px; overflow: auto; }
.audit-table-wrap, .backup-table-wrap { overflow: auto; }
.audit-table, .backup-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.audit-table th, .audit-table td, .backup-table th, .backup-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; }
.audit-table th, .backup-table th { color: #617089; background: #f8fbff; font-size: .66rem; text-transform: uppercase; letter-spacing: .045em; }
.audit-action { padding: 4px 7px; border-radius: 5px; background: #edf3fc; color: #345d9c; font-family: ui-monospace, monospace; font-size: .64rem; }
.danger-outline { min-height: 32px; padding: 0 11px; border: 1px solid #f0b8b8; border-radius: 7px; background: #fff; color: #c62b2b; font-size: .72rem; cursor: pointer; }
.danger-action { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: #d83131; color: #fff; font-size: .74rem; font-weight: 700; cursor: pointer; }
.row-menu .danger, .backup-actions .danger { color: #cf2929; }

.header-actions, .backup-actions { display: flex; align-items: center; gap: 7px; }
.backup-warning { margin: 0 0 10px; border-color: #f1d39d; background: #fff8ec; }
.backup-schedule-card, .backup-list-card { margin-bottom: 10px; }
.backup-schedule-form { display: grid; grid-template-columns: 1.35fr repeat(5, minmax(110px,1fr)) auto; align-items: end; gap: 10px; padding: 13px 15px; }
.backup-schedule-form > label { display: grid; gap: 5px; }
.backup-schedule-form > label > span { font-size: .68rem; font-weight: 650; }
.backup-schedule-form input, .backup-schedule-form select { min-height: 33px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: .74rem; }
.suffix-input { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.suffix-input input { border: 0; border-radius: 0; }
.suffix-input span { display: grid; place-items: center; padding: 0 8px; background: #f3f6fb; color: var(--muted); font-size: .66rem; }
.backup-table code { color: #273c5d; font-size: .67rem; }
.backup-type { padding: 4px 7px; border-radius: 999px; background: #edf3fc; color: #375f9f; font-size: .65rem; text-transform: capitalize; }
.backup-actions a, .backup-actions button { border: 0; background: transparent; color: #205fcf; font-size: .7rem; text-decoration: none; cursor: pointer; }
.compact-modal { width: min(460px, calc(100vw - 28px)); padding-bottom: 14px; }
.compact-modal > label { padding: 0 14px; }
.settings-grid label small { color: var(--muted); font-size: .64rem; }
.table-empty.error { color: #c72c2c; }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 300px; padding: 28px; }
  .auth-copy h1 { font-size: 2.4rem; }
  .auth-form-panel { padding: 28px 18px; }
  .role-layout { grid-template-columns: 1fr; }
  .role-list { display: flex; gap: 6px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .role-list-item { min-width: 220px; }
  .backup-schedule-form { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .auth-brand-panel { min-height: 240px; padding: 22px; }
  .auth-copy { margin-top: 45px; }
  .auth-copy h1 { font-size: 1.85rem; }
  .auth-security-list { display: none; }
  .auth-card { padding: 24px 20px; }
  .permission-matrix, .individual-permission-matrix, .role-fields { grid-template-columns: 1fr; }
  .iam-tabs { overflow-x: auto; }
  .iam-tabs button { white-space: nowrap; }
  .backup-schedule-form { grid-template-columns: 1fr 1fr; }
  .header-actions { width: 100%; flex-wrap: wrap; }
}

/* v1.1.2: readable 100% desktop typography and double-click lead editing */
@media (min-width: 721px) {
  html {
    font-size: 14px;
  }

  body {
    font-family: "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.36;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

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

  h1,
  .dashboard-header h1 {
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
  }

  .brand strong,
  .app-topbar-title {
    font-weight: 650;
  }

  .nav-item {
    font-size: 0.86rem;
    font-weight: 500;
  }

  .nav-heading {
    font-size: 0.65rem;
    font-weight: 650;
  }

  .page-header p,
  .dashboard-header p {
    font-size: 0.79rem;
  }

  .primary-action,
  .secondary-action,
  .period-button {
    font-size: 0.79rem;
    font-weight: 600;
  }

  .filter-input,
  .filter-select,
  .filter-input input,
  .filter-select select,
  .filter-controls .secondary-action {
    font-size: 0.78rem;
  }

  .filter-select span,
  .filter-title,
  .filter-summary {
    font-size: 0.75rem;
  }

  .lead-table th,
  .user-table th,
  .performance-table th,
  .followup-table th,
  .audit-table th,
  .backup-table th {
    font-size: 0.69rem;
    font-weight: 650;
    letter-spacing: 0.045em;
  }

  .lead-table td,
  .user-table td,
  .performance-table td,
  .followup-table td,
  .audit-table td,
  .backup-table td {
    font-size: 0.79rem;
    font-weight: 400;
    line-height: 1.28;
  }

  .lead-table td strong {
    font-size: 0.81rem;
    font-weight: 600;
    line-height: 1.22;
  }

  .lead-table td span {
    font-size: 0.70rem;
    line-height: 1.2;
  }

  .lead-table td b {
    font-size: 0.81rem;
    font-weight: 650;
  }

  .status-pill,
  .role-pill,
  .backup-type,
  .permission-count,
  .schedule-status {
    font-size: 0.66rem;
    font-weight: 600;
  }

  .sidebar-user strong,
  .role-list-item strong,
  .member-summary strong,
  .member-name strong,
  .panel-heading-row h2,
  .role-editor-header h3 {
    font-weight: 600;
  }

  .sidebar-user strong,
  .role-list-item strong,
  .member-summary strong,
  .member-name > div > strong {
    font-size: 0.76rem;
  }

  .sidebar-user small,
  .role-list-item small,
  .member-summary small,
  .member-name small,
  .panel-heading-row p,
  .role-editor-header p {
    font-size: 0.66rem;
  }

  .iam-tabs button,
  .permission-group label,
  .role-fields input,
  .role-fields textarea,
  .backup-schedule-form input,
  .backup-schedule-form select,
  .backup-actions a,
  .backup-actions button {
    font-size: 0.72rem;
  }
}

.lead-table tbody tr.is-editable {
  cursor: pointer;
}

.lead-table tbody tr.is-editable td {
  transition: background-color 120ms ease;
}

.lead-table tbody tr.is-editable:hover td {
  background: #f5f8ff;
}

.lead-table tbody tr.is-editable:active td {
  background: #edf3ff;
}

/* v1.3.2 unified Sales Records page */
.legacy-advanced-view[hidden]{display:none!important}
.sales-record-actions{align-items:center}
.sales-header-menu{position:relative;display:inline-flex}
.sales-header-menu .row-menu{right:0;left:auto;top:calc(100% + 6px);min-width:230px;z-index:80}
.sales-header-menu .row-menu.open{display:block}
.sales-header-menu .row-menu a,.sales-header-menu .row-menu button{display:flex;width:100%;align-items:center;text-align:left;padding:9px 12px;border:0;background:transparent;color:var(--text,#17233b);font:inherit;text-decoration:none;cursor:pointer}
.sales-header-menu .row-menu a:hover,.sales-header-menu .row-menu button:hover{background:#f2f6fc}
.sales-record-filter-controls{grid-template-columns:minmax(260px,1.7fr) repeat(6,minmax(120px,1fr)) minmax(105px,.65fr) auto}
.sales-record-search{min-width:250px}
.sales-record-table th,.sales-record-table td{vertical-align:middle}
.sales-record-table td:nth-child(3),.sales-record-table td:nth-child(4){min-width:170px}
.sales-record-table td:nth-child(5){min-width:110px}
.sales-record-table td:nth-child(6){min-width:120px}
.sales-record-table td:nth-child(7){min-width:110px}
.sales-record-row{cursor:default}
.sales-record-row.is-editable{cursor:pointer}
.sales-type-badge{display:inline-flex;align-items:center;justify-content:center;min-width:64px;padding:4px 8px;border:1px solid #cfd9ea;border-radius:999px;font-size:11px;font-weight:700;line-height:1;background:#f7f9fc;color:#52627a}
.sales-type-badge.enquiry{background:#edf4ff;border-color:#bed4ff;color:#1558d6}
.sales-type-badge.lead{background:#f6f7fa;border-color:#d8deea;color:#536176}
.sales-enquiry-number{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:nowrap}
.sales-status-cell small{display:block;margin-top:3px;color:#718096;font-size:10px}
.muted-text{color:#8b97aa;font-size:11px}
.table-text-button{border:0;background:transparent;color:#185fd7;font:inherit;font-weight:600;cursor:pointer;padding:4px 6px}
.sales-record-pagination{display:inline-flex;align-items:center;gap:8px;margin-left:auto;margin-right:auto}
.sales-record-stat-card{cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
.sales-record-stat-card:hover,.sales-record-stat-card:focus{border-color:#8eb5ff;box-shadow:0 5px 18px rgba(25,89,190,.10);outline:none}
.sales-record-stat-card:active{transform:translateY(1px)}
@media (max-width:1450px){.sales-record-filter-controls{grid-template-columns:minmax(240px,1.5fr) repeat(4,minmax(125px,1fr));}.sales-record-filter-controls>*{min-width:0}}
@media (max-width:900px){.sales-record-actions{gap:6px}.sales-record-actions .secondary-action,.sales-record-actions .primary-action{padding-left:9px;padding-right:9px}.sales-record-filter-controls{grid-template-columns:1fr 1fr}.sales-record-search{grid-column:1/-1;min-width:0}.sales-record-pagination{order:3;width:100%;justify-content:center}.table-footer{flex-wrap:wrap;gap:8px}}
.sales-import-history-details{margin-top:12px;border:1px solid #dbe3ef;border-radius:10px;background:#fff;overflow:hidden}
.sales-import-history-details>summary{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;font-weight:700;list-style:none}
.sales-import-history-details>summary::-webkit-details-marker{display:none}
.sales-import-history-details>summary small{font-weight:400;color:#718096}
.sales-import-history-details[open]>summary{border-bottom:1px solid #e1e7f0}
.sales-import-history-details .adv-import-history{margin:0;border:0;border-radius:0}
