:root {
  color-scheme: dark;
  --bg: #080d16;
  --bg-soft: #0d1421;
  --surface: #111a29;
  --surface-raised: #172235;
  --surface-hover: #1c2940;
  --line: #27354a;
  --line-strong: #354761;
  --ink: #f4f7ff;
  --muted: #ffffff;
  --muted-strong: #ffffff;
  --accent: #9c8cff;
  --accent-strong: #b7aaff;
  --accent-soft: rgba(156, 140, 255, .13);
  --good: #4fd0ad;
  --good-soft: rgba(79, 208, 173, .12);
  --warning: #f1b75c;
  --warning-soft: rgba(241, 183, 92, .13);
  --danger: #ff7886;
  --danger-soft: rgba(255, 120, 134, .12);
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 86% -8%, rgba(94, 72, 190, .16), transparent 32rem),
    radial-gradient(circle at -6% 25%, rgba(39, 112, 129, .10), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(183, 170, 255, .42);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .48;
}

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

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 2.4vw, 36px) 36px;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 2.4vw, 36px) 36px;
}

.crm-dashboard-view {
  margin-top: 22px;
}

.crm-dashboard-intro {
  margin-bottom: 14px;
}

.panel.crm-dashboard-panel {
  height: clamp(620px, 76vh, 920px);
  padding: 0;
  overflow: hidden;
}

.crm-dashboard-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(39, 53, 74, .75);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-lockup > .brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(156, 140, 255, .28);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(156, 140, 255, .19), rgba(156, 140, 255, .05));
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.brand-lockup h1 {
  margin: 1px 0 2px;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.15;
  letter-spacing: -.025em;
}

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

.brand-mark {
  color: var(--accent-strong);
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

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

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

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: #0a0d16;
}

.button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button.secondary,
.button.ghost {
  border-color: var(--line);
  background: var(--surface);
}

.button.secondary:hover:not(:disabled),
.button.ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.button.ghost {
  background: transparent;
}

.button.danger {
  background: var(--danger);
  color: #18080c;
}

.button.full {
  width: 100%;
  margin-top: 8px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.text-button {
  min-height: 36px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 750;
}

.text-button:hover {
  text-decoration: underline;
}

.danger-text {
  color: var(--danger);
}

.user-chip {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(17, 26, 41, .72);
}

.user-chip > span {
  max-width: 145px;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(270px, .82fr) minmax(0, 3.5fr);
  gap: 12px;
  margin: 22px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(13, 20, 33, .82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(270px, .82fr) minmax(0, 3.5fr);
  gap: 12px;
  margin: 22px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(13, 20, 33, .82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
}

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

.calendar-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 3px;
  margin-bottom: 4px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.calendar-empty {
  min-width: 0;
  aspect-ratio: 1;
}

.calendar-toolbar > strong {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-control {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(156, 140, 255, .14), rgba(17, 26, 41, .7));
  color: var(--ink);
  text-align: left;
}

.date-control:hover {
  border-color: rgba(156, 140, 255, .58);
}

.date-control > span:not(.chevron) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.date-control small,
.filter-field > span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: .04em;
}

.date-control strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-control .chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.filter-field {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
}

.filter-field:focus-within {
  border-color: rgba(156, 140, 255, .45);
}

.filter-field select {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 20px 0 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.filter-field select option,
select option {
  background: var(--surface);
  color: var(--ink);
}

.report-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 13.5px;
}

.report-context > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.report-context p {
  margin: 0;
}

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

.lead-conversion-card {
  grid-column: span 2;
}

.sales-revenue-card .split-values strong {
  font-size: clamp(20px, 2vw, 26px);
}

.metric-section-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 3px 9px;
}

.metric-section-label span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.metric-section-label small {
  color: var(--muted);
  font-size: 13px;
}

.metric-section-label.crm-label {
  margin-top: 14px;
}

.inline-data-note {
  display: block;
  margin: 0 0 12px;
  padding: 10px 13px;
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: 12px;
  background: rgba(245, 158, 11, .08);
  color: var(--warning);
  font-size: 13px;
}

.metric-card,
.panel,
.goal-card,
.admin-stats article {
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(23, 34, 53, .92), rgba(17, 26, 41, .92));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 12px 32px rgba(0, 0, 0, .12);
}

.metric-card {
  display: flex;
  flex-direction: column;
  min-height: 155px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.metric-value {
  display: block;
  margin: 7px 0 1px;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 850;
  letter-spacing: -.04em;
}

.metric-meta {
  display: grid;
  min-height: 21px;
  color: var(--muted-strong);
  font-size: 13.5px;
}

.metric-trend {
  margin-top: 11px;
  font-size: 12px;
  font-weight: 750;
}

.country-mini-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.country-mini-list > div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.country-mini-list b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
}

.country-mini-list span {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-mini-list strong {
  font-size: 13px;
}

.country-mini-list small {
  grid-column: 2 / -1;
  margin-top: -6px;
  color: var(--muted);
  font-size: 12px;
}

.empty-inline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.split-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.split-values.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.split-values > div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 13, 22, .28);
}

.split-values small {
  color: var(--muted);
  font-size: 12px;
}

.split-values strong {
  font-size: 25px;
}

.split-values em {
  color: var(--accent-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.split-metric p {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.good,
.positive {
  color: var(--good);
}

.bad,
.negative {
  color: var(--danger);
}

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

.neutral {
  color: var(--muted-strong);
}

.report-section,
.admin-section {
  margin-top: 14px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-lg);
}

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

.section-heading h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.subtle {
  color: var(--muted);
  font-size: 12.5px;
}

.funnel-list {
  display: grid;
  gap: 11px;
}

.funnel-row {
  display: grid;
  grid-template-columns: minmax(205px, .72fr) minmax(180px, 1.28fr);
  align-items: center;
  gap: 14px;
}

.funnel-copy {
  display: grid;
  grid-template-columns: 1fr auto 46px;
  align-items: baseline;
  gap: 8px;
}

.funnel-copy span {
  color: var(--muted-strong);
  font-size: 13px;
}

.funnel-copy strong {
  font-size: 15px;
}

.funnel-copy small {
  color: var(--muted);
  text-align: right;
}

.funnel-track,
.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #26364e;
}

.funnel-track span,
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7868e8, var(--accent-strong));
}

.source-list {
  display: grid;
  gap: 16px;
}

.source-item > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.source-item span {
  color: var(--muted-strong);
}

.source-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.mini-stats > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(39, 53, 74, .9);
  border-radius: 11px;
  background: rgba(8, 13, 22, .28);
}

.mini-stats span {
  color: var(--muted);
  font-size: 12px;
}

.mini-stats strong {
  font-size: 14px;
}

.segmented {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 13, 22, .4);
  scrollbar-width: thin;
}

.segment,
.segmented button {
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.segment:hover,
.segment.active,
.segmented button:hover,
.segmented button.active {
  background: var(--surface-hover);
  color: var(--ink);
}

.segment.active,
.segmented button.active {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
}

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

.performance-table {
  min-width: 1460px;
}

.staff-table {
  min-width: 1380px;
}

.staff-heading {
  align-items: flex-end;
  gap: 22px;
}

.section-description {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.staff-team-summary {
  display: flex;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.staff-team-summary span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 13, 22, .32);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.staff-team-summary b {
  color: var(--ink);
  font-size: 14px;
}

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

.staff-scorecard {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(126, 108, 238, .12), transparent 38%),
    rgba(13, 21, 34, .68);
}

.staff-card-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px;
  border-bottom: 1px solid var(--line);
}

.staff-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.staff-rank {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(156, 140, 255, .35);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.staff-identity > div {
  min-width: 0;
}

.staff-identity h3 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-identity p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.staff-sale-badge {
  display: grid;
  min-width: 62px;
  padding: 8px 10px;
  border: 1px solid rgba(79, 208, 173, .28);
  border-radius: 12px;
  background: var(--good-soft);
  text-align: center;
}

.staff-sale-badge strong {
  color: var(--good);
  font-size: 20px;
  line-height: 1;
}

.staff-sale-badge span {
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.staff-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.staff-rate-grid > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 13px 14px;
  background: rgba(10, 17, 29, .92);
}

.staff-rate-grid span,
.staff-rate-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-rate-grid strong {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: -.025em;
}

.staff-funnel {
  display: grid;
  gap: 9px;
  padding: 15px 17px;
}

.staff-funnel-row {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.staff-funnel-row > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.staff-funnel-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-funnel-row strong {
  color: var(--ink);
  font-size: 13px;
}

.staff-funnel-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .06);
}

.staff-funnel-track i {
  display: block;
  width: max(7px, var(--staff-progress));
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.staff-funnel-track i.stage-2 {
  background: linear-gradient(90deg, #ca7ddb, #f09bd7);
}

.staff-funnel-track i.stage-3 {
  background: linear-gradient(90deg, #2ca783, var(--good));
}

.staff-funnel-track i.zero {
  width: 0;
}

.staff-signals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0 17px 17px;
}

.identity-warning {
  margin-bottom: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(241, 183, 92, .28);
  border-radius: 14px;
  background: var(--warning-soft);
}

.identity-warning strong {
  color: var(--ink);
  font-size: 13px;
}

.identity-warning p,
.identity-warning small {
  display: block;
  margin: 5px 0 0;
  color: var(--muted-strong);
  font-size: 12.5px;
  line-height: 1.5;
}

.technical-pool-card {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.32);
}

.technical-pool-card .staff-rank {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.staff-monthly-stats article small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.section-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.staff-filter-bar {
  display: grid;
  grid-template-columns: 120px 150px minmax(210px, 1fr);
  gap: 10px;
}

.staff-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 750;
}

.staff-filter-bar select {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.staff-selection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted-strong);
}

.staff-selection-title strong {
  color: var(--ink);
  font-size: 16px;
}

.staff-selection-title span {
  font-size: 13px;
}

.staff-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.staff-overview-grid article {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(150deg, rgba(23, 34, 53, .92), rgba(17, 26, 41, .92));
}

.staff-overview-grid span,
.staff-overview-grid small {
  color: var(--muted);
  font-size: 12.5px;
}

.staff-overview-grid strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

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

.monthly-staff-table {
  min-width: 980px;
}

.monthly-staff-table td:nth-child(2) small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.staff-signals > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 13, 22, .3);
}

.staff-signals > div.needs-attention {
  border-color: rgba(241, 183, 92, .22);
  background: var(--warning-soft);
}

.staff-signals span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-signals strong {
  color: var(--ink);
  font-size: 14px;
}

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

.data-table th {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--muted-strong);
  font-size: 14px;
}

.data-table td:first-child,
.data-table td strong {
  color: var(--ink);
}

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

.data-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.muted-dash {
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
}

.pagination button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.pagination span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-data-list {
  display: none;
}

.mobile-data-card {
  display: grid;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(15, 24, 39, .72);
}

.mobile-data-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-data-card > header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mobile-data-card > header strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.mobile-data-card > header small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.mobile-data-card > header b {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 13px;
}

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

.mobile-data-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 11px;
  background: rgba(8, 13, 22, .38);
}

.mobile-data-grid span {
  color: var(--muted);
  font-size: 12.5px;
}

.mobile-data-grid strong {
  color: var(--ink);
  font-size: 14px;
}

.filter-summary {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 99px;
  background: rgba(255, 255, 255, .025);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.status.positive {
  background: var(--good-soft);
}

.status.warning {
  background: var(--warning-soft);
}

.status.negative {
  background: var(--danger-soft);
}

.status.neutral {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .025);
}

.comparison-list {
  display: grid;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto minmax(66px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.comparison-row > span {
  color: var(--muted-strong);
  font-size: 12px;
}

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

.comparison-row > em {
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  text-align: right;
}

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

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.alert-item:last-child {
  border-bottom: 0;
}

.alert-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .025);
}

.alert-item strong {
  font-size: 12px;
}

.alert-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.table-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-cell,
.empty-state {
  padding: 24px !important;
  color: var(--muted) !important;
  text-align: center !important;
}

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

.goal-card {
  padding: 16px;
  border-radius: 16px;
}

.goal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.goal-top span:not(.status) {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.goal-top h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.goal-scope {
  min-height: 20px;
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.goal-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.goal-values > div {
  display: grid;
  gap: 1px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 13, 22, .25);
}

.goal-values span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.goal-values strong {
  font-size: 14px;
}

.goal-progress {
  margin-top: 13px;
}

.goal-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.goal-foot strong {
  color: var(--muted-strong);
  text-align: right;
}

.goal-actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px -6px -5px 0;
}

.goal-actions .text-button {
  min-height: 30px;
  font-size: 10px;
}

.admin-view {
  margin-top: 28px;
}

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

.admin-intro h1 {
  margin: 5px 0 7px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.admin-intro p:not(.eyebrow) {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
}

.permission-note,
.demo-access {
  border: 1px solid rgba(241, 183, 92, .28);
  border-radius: 13px;
  background: var(--warning-soft);
  color: var(--muted-strong);
}

.permission-note {
  margin-bottom: 14px;
  padding: 12px 14px;
}

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

.admin-stats article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 15px;
}

.admin-stats span {
  color: var(--muted);
  font-size: 12px;
}

.admin-stats strong {
  font-size: 24px;
}

.manager-table {
  min-width: 940px;
}

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

.settings-form label,
.dialog-form label,
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 750;
}

.settings-form input,
.settings-form select,
.dialog-form input,
.dialog-form select,
.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--bg);
  color: var(--ink);
}

.settings-form input:focus,
.settings-form select:focus,
.dialog-form input:focus,
.dialog-form select:focus,
.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--accent);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
}

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

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(86, 67, 175, .27), transparent 33rem),
    linear-gradient(180deg, rgba(13, 20, 33, .2), var(--bg));
}

.login-card {
  width: min(450px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(17, 26, 41, .94);
  box-shadow: var(--shadow);
}

.login-card > .brand-mark {
  margin-bottom: 22px;
}

.login-card h1 {
  margin: 5px 0 8px;
  font-size: 31px;
  letter-spacing: -.04em;
}

.login-card .muted {
  margin-bottom: 24px;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.login-card input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--bg);
  color: var(--ink);
}

.login-card input:focus {
  border-color: var(--accent);
}

.demo-access {
  display: grid;
  gap: 2px;
  margin-top: 20px;
  padding: 12px 14px;
}

.demo-access span,
.demo-access small {
  color: var(--muted);
  font-size: 10px;
}

.form-error {
  min-height: 20px;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(2, 6, 13, .78);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .58);
}

.modal-panel.small {
  width: min(440px, 100%);
}

.modal-panel.wide {
  width: min(1040px, 100%);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-close {
  border-color: transparent;
  background: transparent;
}

.modal-body {
  max-height: calc(min(88vh, 900px) - 80px);
  padding: 20px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-intro,
.confirm-copy p {
  color: var(--muted);
}

.dialog-form > label {
  margin-bottom: 12px;
}

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

.goal-preview {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
}

.goal-preview span,
.goal-preview small {
  color: var(--muted);
  font-size: 10px;
}

.goal-preview strong {
  font-size: 20px;
}

.date-picker-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
}

.preset-list {
  display: grid;
  align-content: start;
  gap: 5px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.preset-button {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
  text-align: left;
}

.preset-button:hover,
.preset-button.active {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--ink);
}

.preset-button.active {
  border-color: rgba(156, 140, 255, .45);
  background: var(--accent-soft);
}

.calendar-area {
  min-width: 0;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-toolbar > span {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.calendar-month {
  min-width: 0;
}

.calendar-month h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-align: center;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 3px;
}

.weekday-row {
  margin-bottom: 4px;
}

.weekday-row span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.calendar-day,
.calendar-blank {
  min-width: 0;
  aspect-ratio: 1;
}

.calendar-day {
  position: relative;
  min-height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
}

.calendar-day:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink);
}

.calendar-day.in-range {
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--ink);
}

.calendar-day.range-start,
.calendar-day.range-end {
  border-color: var(--accent);
  background: var(--accent);
  color: #090d16;
}

.calendar-day.today::after {
  position: absolute;
  right: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: currentColor;
  content: '';
  transform: translateX(50%);
}

.calendar-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
}

#toast-root {
  position: fixed;
  z-index: 1200;
  right: 18px;
  bottom: 18px;
  pointer-events: none;
}

.toast {
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid rgba(79, 208, 173, .38);
  border-radius: 12px;
  background: #12251f;
  box-shadow: var(--shadow);
  color: #dffbf3;
  font-size: 12px;
  font-weight: 700;
  animation: toast-in .22s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.print-only {
  display: none;
}

@media (max-width: 1240px) {
  .control-bar,
  .report-toolbar {
    grid-template-columns: 260px 1fr;
  }

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

  .funnel-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

@media (max-width: 940px) {
  .topbar,
  .admin-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .control-bar,
  .report-toolbar {
    grid-template-columns: 1fr;
  }

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

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

  .two-column {
    grid-template-columns: 1fr;
  }

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

  .responsive-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1 0 auto;
  }

  .report-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .staff-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-team-summary {
    justify-content: flex-start;
  }

  .staff-scorecard-grid {
    grid-template-columns: 1fr;
  }

  .staff-filter-bar {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .shell,
  .app-shell {
    padding: 15px 12px 24px;
  }

  .topbar {
    gap: 16px;
    padding-bottom: 16px;
  }

  .brand-lockup > .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .top-actions .button,
  .topbar-actions .button {
    flex: 1 1 auto;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .control-bar,
  .report-toolbar {
    margin-top: 16px;
    padding: 9px;
    border-radius: 16px;
  }

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

  .metric-grid {
    gap: 8px;
  }

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

  .lead-conversion-card {
    grid-column: auto;
  }

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

  .staff-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .staff-filter-bar label:last-child {
    grid-column: 1 / -1;
  }

  .metric-label,
  .metric-meta,
  .split-values small,
  .staff-signals span,
  .staff-signals small,
  .mobile-data-grid span,
  .mobile-data-grid small,
  .monthly-staff-card header small,
  .filter-control span,
  .section-note,
  .identity-warning p,
  .identity-warning small {
    font-size: 12px;
  }

  .desktop-data-table {
    display: none;
  }

  .mobile-data-list {
    display: grid;
    gap: 10px;
  }

  .pagination {
    justify-content: flex-start;
  }

  .pagination button {
    min-width: 38px;
    min-height: 38px;
  }

  .metric-card {
    min-height: 140px;
    padding: 14px;
    border-radius: 15px;
  }

  .metric-value {
    font-size: 24px;
  }

  .panel {
    padding: 15px;
    border-radius: 16px;
  }

  .section-heading {
    gap: 10px;
  }

  .staff-team-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .staff-team-summary span {
    justify-content: center;
  }

  .mini-stats,
  .admin-stats,
  .settings-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .comparison-row {
    grid-template-columns: 1fr auto;
  }

  .comparison-row > small,
  .comparison-row > em {
    text-align: right;
  }

  .date-picker-layout {
    grid-template-columns: 1fr;
  }

  .preset-list {
    display: flex;
    padding: 0 0 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preset-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .calendar-pair {
    grid-template-columns: 1fr;
  }

  .calendar-pair .calendar-month:nth-child(2) {
    display: none;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-panel,
  .modal-panel.small,
  .modal-panel.wide {
    width: 100%;
    max-height: 94vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .modal-body {
    max-height: calc(94vh - 76px);
    padding: 16px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .login-card {
    padding: 27px 22px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .staff-filter-bar,
  .staff-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .staff-filter-bar label:last-child {
    grid-column: 1 / -1;
  }

  .staff-selection-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-context > div {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .metric-label {
    min-height: 36px;
  }

  .metric-meta {
    min-height: 34px;
  }

  .metric-trend {
    min-height: 30px;
  }

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

  .split-values > div {
    padding: 10px 8px;
  }

  .split-values strong {
    font-size: 22px;
  }

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

  .staff-card-header {
    padding: 14px;
  }

  .staff-identity h3 {
    font-size: 15px;
  }

  .staff-rate-grid > div {
    padding: 11px 9px;
  }

  .staff-rate-grid strong {
    font-size: 17px;
  }

  .staff-funnel {
    padding: 14px;
  }

  .staff-funnel-row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 9px;
  }

  .staff-signals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 14px 14px;
  }

  .goal-values {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 36px;
  }
}

@media (max-width: 360px) {
  .staff-team-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-identity {
    gap: 8px;
  }

  .staff-rank {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .staff-identity h3 {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .staff-sale-badge {
    min-width: 54px;
    padding: 7px;
  }

  .staff-rate-grid {
    grid-template-columns: 1fr 1fr;
  }

  .staff-rate-grid > div:nth-child(3) {
    grid-column: 1 / -1;
  }

  .staff-rate-grid span,
  .staff-rate-grid small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .staff-funnel-row {
    grid-template-columns: 84px minmax(0, 1fr);
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  :root {
    color-scheme: light;
  }

  body {
    background: #fff !important;
    color: #111827 !important;
    font-size: 10px;
  }

  .shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .topbar,
  .control-bar,
  .report-toolbar,
  .report-context,
  .site-footer,
  .section-heading .button,
  .segmented,
  #toast-root {
    display: none !important;
  }

  .print-only {
    display: block;
    margin-bottom: 7mm;
    color: #111827;
  }

  .print-only h1 {
    margin-bottom: 2mm;
    font-size: 22px;
  }

  .print-only p {
    color: #4b5563;
  }

  .metric-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 3mm;
  }

  .metric-card,
  .panel,
  .goal-card {
    break-inside: avoid;
    border: 1px solid #d5d9e1 !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #111827 !important;
  }

  .metric-card {
    min-height: 0;
    padding: 4mm;
  }

  .metric-value {
    font-size: 21px;
  }

  .metric-label,
  .metric-meta,
  .subtle,
  .source-item small,
  .goal-scope,
  .goal-foot,
  .data-table td,
  .data-table th,
  .eyebrow,
  small,
  .funnel-copy span,
  .comparison-row > span,
  .comparison-row > small,
  .alert-item p {
    color: #4b5563 !important;
  }

  .two-column {
    grid-template-columns: 1.2fr .8fr;
    gap: 3mm;
  }

  .report-section {
    margin-top: 3mm;
  }

  .panel {
    padding: 4mm;
  }

  .table-scroll {
    overflow: visible;
  }

  .data-table {
    min-width: 0;
  }

  .data-table th,
  .data-table td {
    padding: 2.3mm 1.5mm;
    border-color: #e5e7eb;
    font-size: 8px;
    white-space: normal;
  }

  .goal-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3mm;
  }

  .status {
    border-color: #9ca3af !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
  }

  .funnel-track,
  .progress-track {
    background: #e5e7eb;
  }

  .funnel-track span,
  .progress-track span {
    background: #7868e8;
  }
}

@media screen {
  body {
    font-size: 15px;
    line-height: 1.55;
  }

  body small {
    font-size: 13px !important;
    line-height: 1.45;
  }

  .eyebrow,
  .metric-label,
  .metric-meta,
  .filter-field > span,
  .data-table th,
  .data-table td,
  .muted,
  .filter-summary,
  .calendar-help,
  .staff-identity p,
  .staff-signals span,
  .staff-signals small,
  .staff-funnel-row span,
  .pagination,
  .mobile-data-card span,
  .mobile-data-card small {
    font-size: 13px;
    line-height: 1.45;
  }

  .button,
  .text-button,
  select,
  input,
  label {
    font-size: 14px;
  }

  .deal-steps,
  .lead-steps {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }

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

  .health-grid article,
  .staff-detail-grid article {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
    display: grid;
    gap: 6px;
  }

  .health-grid article > span,
  .staff-detail-grid article > span {
    color: var(--muted);
    font-size: 13px;
  }

  .health-grid article > strong,
  .staff-detail-grid article > strong {
    font-size: 21px;
  }

  .staff-scorecard[role="button"] {
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
  }

  .staff-scorecard[role="button"]:hover,
  .staff-scorecard[role="button"]:focus-visible {
    border-color: rgba(93,178,255,.62);
    background: rgba(93,178,255,.045);
    transform: translateY(-2px);
    outline: none;
  }

  .staff-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .staff-detail-head h3 {
    margin: 4px 0 0;
    font-size: 24px;
  }

  .staff-detail-head > strong {
    font-size: 24px;
    color: var(--positive);
  }

  .loss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 12px 0 18px;
  }

  .loss-grid span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
  }

  .loss-grid b { color: var(--text); }

  .session-list {
    display: grid;
    gap: 10px;
  }

  .session-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .session-list article > div {
    display: grid;
    gap: 4px;
  }

  .session-list small { color: var(--muted); font-size: 13px; }
}

@media screen and (max-width: 940px) {
  .health-grid,
  .staff-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 720px) {
  body { font-size: 15px; }

  .topbar-actions {
    align-items: stretch;
  }

  .topbar-actions > .button,
  .topbar-actions .user-chip {
    min-height: 44px;
  }

  .health-grid,
  .staff-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-panel.drawer {
    align-self: flex-end;
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
  }

  .session-list article {
    align-items: stretch;
    flex-direction: column;
  }
}

@media screen and (max-width: 390px) {
  .health-grid,
  .staff-detail-grid {
    grid-template-columns: 1fr;
  }

  .staff-detail-head {
    flex-direction: column;
  }
}

@media screen {
  .country-combobox {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
  }

  .country-combobox input {
    width: 100%;
    min-width: 0;
    height: 26px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
  }

  .country-combobox input::placeholder {
    color: var(--muted);
    opacity: .85;
  }

  .country-combobox button {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-strong);
    font-size: 20px;
    line-height: 1;
  }

  .country-combobox button:hover {
    background: var(--surface-hover);
    color: var(--ink);
  }

  .report-section,
  .admin-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 520px;
  }

  body.report-loading .report-main {
    cursor: progress;
  }

  .manager-table th:last-child,
  .manager-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 190px;
    background: #111a29;
    box-shadow: -12px 0 18px rgba(8, 13, 22, .86);
  }

  .manager-table th:last-child {
    z-index: 3;
  }

  .manager-table .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .manager-table .row-actions .text-button {
    justify-content: flex-start;
    text-align: left;
  }

  .manager-table .danger-text {
    order: -1;
    border: 1px solid rgba(255, 120, 134, .28);
    border-radius: 8px;
    background: var(--danger-soft);
  }
}

@media screen and (max-width: 720px) {
  .modal-backdrop {
    backdrop-filter: none;
  }

  .manager-table {
    min-width: 760px;
  }

  .manager-table th:last-child,
  .manager-table td:last-child {
    min-width: 176px;
  }
}

@media (prefers-reduced-motion: reduce), (max-width: 720px) {
  .button,
  .staff-scorecard[role="button"] {
    transition: none;
  }
}

@media screen {
  .country-filter {
    position: relative;
  }

  .country-filter.open {
    z-index: 120;
    border-color: rgba(156, 140, 255, .48);
  }

  .country-filter > label {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 750;
    letter-spacing: .04em;
  }

  .country-menu {
    position: absolute;
    z-index: 130;
    top: calc(100% + 8px);
    left: 0;
    width: max(100%, 240px);
    max-height: 280px;
    padding: 7px;
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: #111a29;
    box-shadow: 0 22px 46px rgba(0, 0, 0, .48);
  }

  .country-menu[hidden],
  .mobile-app-nav,
  .mobile-user-section {
    display: none;
  }

  .country-menu button {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
  }

  .country-menu [data-country-option][hidden],
  .country-menu .country-empty[hidden] {
    display: none;
  }

  .country-menu button:hover,
  .country-menu button:focus-visible,
  .country-menu button[aria-selected="true"] {
    background: var(--accent-soft);
    color: var(--ink);
    outline: 0;
  }

  .country-empty {
    margin: 0;
    padding: 12px 10px;
    color: var(--muted);
    font-size: 13px;
  }

  .install-guide {
    display: grid;
    gap: 12px;
  }

  .install-guide > div {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
  }

  .install-guide strong {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
  }
}

@media screen and (max-width: 780px) {
  html {
    background: #080d16;
    overscroll-behavior-y: none;
  }

  body {
    background: #080d16;
    -webkit-tap-highlight-color: transparent;
  }

  .app-shell {
    width: 100%;
    padding: 0 12px calc(92px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    z-index: 80;
    top: 0;
    align-items: center;
    flex-direction: row;
    min-height: calc(64px + env(safe-area-inset-top));
    margin: 0 -12px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    border-bottom: 1px solid rgba(53, 71, 97, .72);
    background: rgba(10, 15, 25, .98);
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-lockup > .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 14px;
  }

  .brand-lockup h1 {
    margin: 0;
    font-size: 18px;
  }

  .brand-lockup span,
  .topbar-actions > .button {
    display: none;
  }

  .topbar-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .user-chip {
    width: auto;
    min-height: 40px;
    gap: 2px;
    padding: 2px 3px;
    border: 0;
    background: transparent;
  }

  .user-chip > span {
    display: none;
  }

  .user-chip .text-button {
    min-height: 36px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .mobile-app-nav {
    position: fixed;
    z-index: 900;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    min-height: 66px;
    padding: 6px;
    border: 1px solid rgba(53, 71, 97, .88);
    border-radius: 20px;
    background: rgba(17, 26, 41, .98);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .52);
  }

  .mobile-app-nav button {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 2px;
    padding: 6px 3px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-app-nav button[hidden] {
    display: none;
  }

  .mobile-app-nav button.active,
  .mobile-app-nav button:active {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .mobile-app-nav .icon {
    width: 21px;
    height: 21px;
  }

  .report-main,
  .admin-view,
  .crm-dashboard-view {
    padding-top: 12px;
  }

  .crm-dashboard-view {
    margin-top: 0;
  }

  .panel.crm-dashboard-panel {
    height: calc(100dvh - 176px - env(safe-area-inset-bottom));
    min-height: 520px;
    border-radius: 18px;
  }

  .report-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin: 0 0 12px;
    padding: 9px;
    border-radius: 18px;
    background: #0d1421;
    box-shadow: none;
  }

  .date-control {
    min-height: 58px;
    border-radius: 13px;
  }

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

  .country-filter {
    grid-column: 1 / -1;
  }

  .filter-field {
    min-height: 58px;
    padding: 7px 9px;
    border-color: rgba(39, 53, 74, .72);
  }

  .country-menu {
    width: 100%;
    max-height: min(42vh, 310px);
  }

  .report-context {
    min-height: 46px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid rgba(39, 53, 74, .65);
    border-radius: 13px;
    background: #0d1421;
  }

  .report-context .status,
  .country-mini-list b,
  .lead-steps em,
  .staff-sale-badge span {
    font-size: 12px;
  }

  .metric-section-label {
    margin: 20px 2px 9px;
  }

  .metric-section-label > span {
    font-size: 16px;
  }

  .metric-section-label > small {
    display: none;
  }

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

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

  .metric-card {
    min-height: 128px;
    padding: 14px;
    border-radius: 17px;
    box-shadow: none;
  }

  .metric-card .metric-value {
    font-size: clamp(23px, 7vw, 30px);
  }

  .country-metric {
    min-height: 128px;
  }

  .lead-steps,
  .deal-steps,
  .sales-revenue-card .split-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .panel {
    border-radius: 18px;
    box-shadow: none;
  }

  .report-section {
    margin-top: 12px;
  }

  .responsive-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  .segmented button {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .mobile-data-card,
  .monthly-staff-card,
  .staff-scorecard {
    border-radius: 17px;
    background: #111a29;
    box-shadow: none;
  }

  .admin-intro,
  .staff-tracking-intro {
    gap: 14px;
    padding: 17px;
    border-radius: 18px;
    background: #0d1421;
  }

  .admin-intro h1,
  .staff-tracking-intro h1 {
    font-size: 23px;
  }

  .admin-stats,
  .staff-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-stats article,
  .staff-overview-grid article {
    min-height: 84px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #111a29;
  }

  .desktop-user-section {
    display: none;
  }

  .mobile-user-section {
    display: block;
    margin: 12px 0;
  }

  .mobile-user-list {
    display: grid;
    gap: 10px;
  }

  .mobile-user-card {
    display: grid;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #111a29;
  }

  .mobile-user-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-user-card header > div,
  .mobile-user-meta {
    display: grid;
    gap: 3px;
  }

  .mobile-user-card header small,
  .mobile-user-meta {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-user-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-user-actions .button {
    min-height: 42px;
    padding: 8px;
    font-size: 12px;
  }

  .modal-backdrop {
    padding-top: env(safe-area-inset-top);
  }

  .modal-panel,
  .modal-panel.small,
  .modal-panel.wide {
    max-height: calc(94dvh - env(safe-area-inset-top));
  }

  .standalone-app .topbar {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
}

@media screen and (max-width: 410px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .metric-card {
    min-height: 122px;
    padding: 12px;
  }

  .country-mini-list div {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .country-mini-list strong,
  .country-mini-list small {
    grid-column: 2;
  }

  .health-grid,
  .staff-detail-grid {
    grid-template-columns: 1fr;
  }
}
