:root {
  --brand: #b6ff2e;
  --brand-deep: #5e9200;
  --ink: #0b0d0c;
  --muted: #6e756f;
  --paper: #f3f5f1;
  --panel: #ffffff;
  --line: #dfe4df;
  --danger: #b72d2d;
  --warning: #a36a00;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  overflow-x: clip;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.brand img {
  object-fit: contain;
}

.brand-light {
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  color: var(--ink);
  background: var(--brand);
}

.button-primary:hover {
  background: #a8ef26;
}

.button-secondary {
  color: #303530;
  border-color: #ccd2cc;
  background: #fff;
}

.button-secondary:hover {
  border-color: #818981;
}

.button-wide {
  width: 100%;
}

.login-view {
  min-height: 100vh;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(182, 255, 46, 0.045), transparent 42%),
    #080a09;
}

.login-header {
  width: min(1180px, calc(100% - 48px));
  height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #272b28;
}

.login-header > span {
  color: #8e958f;
  font-size: 10px;
  font-weight: 600;
}

.login-main {
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 86px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 90px;
  align-items: center;
  padding: 54px 0 84px;
}

.login-context {
  max-width: 650px;
}

.login-context h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 600;
  line-height: 1.04;
}

.login-context > p:not(.eyebrow) {
  max-width: 560px;
  margin: 28px 0 0;
  color: #a5aca6;
  font-size: 14px;
  line-height: 1.7;
}

.login-context-meta {
  margin-top: 46px;
  display: flex;
  gap: 10px;
}

.login-context-meta span {
  border: 1px solid #303531;
  border-radius: 5px;
  padding: 8px 11px;
  color: #b8beb9;
  font-size: 9px;
  font-weight: 600;
}

.login-panel {
  border: 1px solid #dfe3df;
  border-radius: 8px;
  padding: 38px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.login-panel h2 {
  margin: 0;
  font-size: 28px;
}

.login-copy {
  margin: 12px 0 26px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label > span {
  color: #515852;
  font-size: 10px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid #ccd2cc;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #79ab1c;
  box-shadow: 0 0 0 3px rgba(182, 255, 46, 0.18);
}

.form-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
}

.test-note {
  margin: 18px 0 0;
  border-left: 3px solid #e0ad19;
  padding: 10px 12px;
  color: #5b4a15;
  background: #fff8dc;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.5;
}

.admin-view {
  min-height: 100vh;
}

.admin-header {
  width: min(1440px, calc(100% - 32px));
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
}

.admin-header-bar {
  height: 66px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 10px 0 13px;
  color: #fff;
  background: rgba(8, 10, 9, 0.9);
  box-shadow: 0 15px 40px rgba(8, 10, 9, 0.17);
  backdrop-filter: blur(20px);
}

.admin-badge {
  border: 1px solid #3a403b;
  border-radius: 4px;
  padding: 5px 7px;
  color: var(--brand);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.navigation-toggle {
  display: none;
}

.header-icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #343936;
  border-radius: 6px;
  color: var(--brand);
  background: #151816;
  margin-left: auto;
}

.header-icon-button svg {
  width: 17px;
  height: 17px;
}

.account-button {
  min-width: 184px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  color: #fff;
  background: #1b1e1c;
  text-align: left;
}

.account-button > span:first-child {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #263500;
  background: var(--brand);
  font-size: 9px;
  font-weight: 700;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-copy strong,
.account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 9px;
}

.account-copy small {
  color: #969d97;
  font-size: 7px;
}

.account-button > svg {
  width: 14px;
  height: 14px;
  margin-left: auto;
}

.account-menu {
  width: 220px;
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  gap: 12px;
  border: 1px solid #292e2a;
  border-radius: 7px;
  padding: 16px;
  color: #a7aea8;
  background: rgba(10, 12, 11, 0.97);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
  font-size: 9px;
}

.account-menu button {
  width: max-content;
  border: 0;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.admin-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 18px;
  padding-top: 96px;
}

.workspace-nav {
  height: calc(100vh - 112px);
  position: sticky;
  top: 96px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.workspace-nav button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  color: #707871;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-nav button:hover,
.workspace-nav button.active {
  color: var(--ink);
  background: #f1f4ef;
}

.workspace-nav button.active {
  border-color: #d8dfd5;
  box-shadow: inset 3px 0 0 #75b300;
}

.workspace-nav svg {
  width: 16px;
  height: 16px;
}

.workspace-nav-heading {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e4e8e3;
}

.workspace-nav-heading > div {
  display: grid;
  gap: 4px;
}

.workspace-nav-heading span,
.workspace-nav-footer small {
  color: #8a918a;
  font-size: 7px;
}

.workspace-nav-heading strong {
  font-size: 15px;
}

.workspace-nav-heading button {
  width: 36px;
  min-height: 36px;
  display: none;
  justify-content: center;
  padding: 0;
}

.workspace-nav-heading button svg {
  width: 17px;
  height: 17px;
}

.workspace-nav-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  border-top: 1px solid #e4e8e3;
  padding: 16px 8px 6px;
}

.workspace-nav-footer span {
  font-size: 8px;
  font-weight: 700;
}

.navigation-backdrop {
  display: none;
}

.workspace {
  width: 100%;
  min-width: 0;
  padding: 0 0 72px;
}

.analytics-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.toolbar-group > span {
  color: #737b74;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.segmented-control {
  display: flex;
  border: 1px solid #d9dfd9;
  border-radius: 6px;
  padding: 3px;
  background: #f1f4f0;
}

.segmented-control button {
  min-width: 62px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  padding: 0 10px;
  color: #687069;
  background: transparent;
  font-size: 8px;
  font-weight: 700;
}

.segmented-control button.active {
  color: #111411;
  background: var(--brand);
}

.period-summary {
  margin: 0 0 0 auto;
  color: #7a827b;
  font-size: 8px;
  line-height: 1.45;
  text-align: right;
}

.date-range {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.date-range[hidden] {
  display: none;
}

.date-range label {
  display: grid;
  gap: 4px;
}

.date-range label span {
  color: #737b74;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.date-range input {
  width: 132px;
  height: 38px;
  border-color: #d9dfd9;
  background: #f7f9f6;
  font-size: 9px;
}

.date-range .button {
  min-height: 38px;
}

.tab-panel {
  animation: tab-in 160ms ease;
}

@keyframes tab-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-title {
  min-height: 82px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-title h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.page-title > div > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.filter-control {
  width: 190px;
}

.filter-control select {
  height: 42px;
  font-size: 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.kpi-card {
  min-width: 0;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}

.kpi-card.primary {
  color: #fff;
  background: #0c0e0d;
  border-color: #0c0e0d;
}

.kpi-card > span {
  display: block;
  color: #747c75;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi-card.primary > span {
  color: #abb2ac;
}

.kpi-card strong {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  font-size: 24px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card.primary strong {
  color: var(--brand);
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  color: #929993;
  font-size: 8px;
  line-height: 1.4;
}

.kpi-comparison {
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.35;
}

.kpi-comparison.positive {
  color: #4f7b00;
}

.kpi-comparison.negative {
  color: #b22c2c;
}

.kpi-comparison.neutral {
  color: #858d86;
}

.kpi-card.primary .kpi-comparison.positive {
  color: var(--brand);
}

.kpi-card.primary .kpi-comparison.negative {
  color: #ff9c9c;
}

.kpi-card.primary .kpi-comparison.neutral {
  color: #aab1ab;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
}

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

.dashboard-grid-main + .dashboard-grid-main,
.dashboard-grid-main + .panel,
.panel + .dashboard-grid-main {
  margin-top: 12px;
}

.dashboard-grid-bottom {
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.dashboard-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.fleet-deductions-panel {
  margin-top: 12px;
}

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

.role-card {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 17px;
  background: #fff;
}

.role-card.primary {
  border-color: #252a26;
  color: #fff;
  background: #111411;
}

.role-card strong {
  font-size: 11px;
}

.role-card span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.role-card.primary span {
  color: #b8c0b9;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-heading {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e7ebe7;
}

.panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #757d76;
  font-size: 7px;
  white-space: nowrap;
}

.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend .green {
  background: #75b300;
}

.legend .black {
  margin-left: 5px;
  background: #171a18;
}

.chart {
  min-height: 280px;
  position: relative;
  overflow-x: auto;
  padding: 18px 16px 12px;
}

.chart svg {
  width: 100%;
  height: 245px;
  overflow: visible;
}

.chart-bar {
  cursor: pointer;
  shape-rendering: geometricPrecision;
  stroke: none;
  transition: opacity 150ms ease;
}

.chart-bar:hover,
.chart-bar:focus {
  opacity: 0.78;
}

.chart-bar:focus {
  outline: none;
}

.chart-bar:focus-visible {
  stroke: #a7ff22;
  stroke-width: 3;
}

.chart-grid-line {
  stroke: #e4e8e4;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #69716a;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  paint-order: normal;
  stroke: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  display: grid;
  min-width: 112px;
  max-width: min(220px, calc(100% - 16px));
  gap: 3px;
  padding: 9px 11px;
  border-radius: 6px;
  background: #0b0d0c;
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 13, 12, 0.22);
  pointer-events: none;
  text-align: left;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip::after {
  position: absolute;
  left: var(--tooltip-arrow-left, 50%);
  width: 8px;
  height: 8px;
  background: #0b0d0c;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.chart-tooltip[data-placement="above"]::after {
  bottom: -4px;
}

.chart-tooltip[data-placement="below"]::after {
  top: -4px;
}

.chart-tooltip[data-placement="inside"]::after {
  display: none;
}

.chart-tooltip strong {
  font-size: 10px;
  font-weight: 600;
}

.chart-tooltip span {
  color: #c9ff68;
  font-size: 10px;
  font-weight: 500;
}

.chart-empty,
.list-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #8a918b;
  text-align: center;
  font-size: 10px;
}

.link-button {
  border: 0;
  padding: 6px 0;
  color: #4e7900;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.compact-list {
  min-height: 250px;
}

.compact-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 20px;
  border-bottom: 1px solid #e9ece9;
}

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

.compact-row strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row small {
  display: block;
  margin-top: 4px;
  color: #8c938d;
  font-size: 8px;
}

.compact-value {
  color: #426900;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 5px;
  padding: 0 8px;
  color: #525a53;
  background: #ecefec;
  font-size: 8px;
  font-weight: 700;
}

.status-pill.new {
  color: #3f6500;
  background: #e6f9bf;
}

.status-pill.converted {
  color: #fff;
  background: #3e7200;
}

.bar-list {
  min-height: 250px;
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 22px 20px;
}

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

.bar-row span,
.bar-row strong {
  font-size: 9px;
}

.bar-row span {
  overflow: hidden;
  color: #4d544e;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row strong {
  text-align: right;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf0ed;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: #79b900;
}

.table-panel {
  margin-top: 12px;
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 58px;
  border-bottom: 1px solid #e8ebe8;
  padding: 0 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  height: 40px;
  color: #7c847d;
  background: #f7f8f6;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfcfa;
}

td {
  color: #303630;
  font-size: 9px;
  font-weight: 500;
}

td strong {
  display: block;
  font-size: 10px;
}

td small {
  display: block;
  margin-top: 4px;
  color: #8a918b;
  font-size: 8px;
}

.lead-status-select,
.role-select {
  height: 32px;
  min-width: 118px;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 8px;
  font-weight: 600;
}

.user-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  font-weight: 600;
}

.user-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #77b700;
  content: "";
}

.user-status.inactive::before {
  background: #a7ada8;
}

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

.table-action {
  height: 30px;
  border: 1px solid #d5dad5;
  border-radius: 5px;
  padding: 0 9px;
  color: #555c56;
  background: #fff;
  font-size: 8px;
  font-weight: 700;
}

.table-action:hover {
  border-color: #7daa2c;
  color: #3e6500;
}

.modal {
  width: min(460px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
}

.modal::backdrop {
  background: rgba(7, 9, 8, 0.68);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 30px 22px;
  border-bottom: 1px solid var(--line);
}

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

.modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d9ded9;
  border-radius: 6px;
  color: #4f5650;
  background: #f7f8f6;
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.modal form {
  padding: 24px 30px 30px;
}

.toast {
  max-width: min(380px, calc(100% - 32px));
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  border-radius: 7px;
  padding: 13px 16px;
  color: #fff;
  background: #121512;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  font-size: 10px;
  font-weight: 600;
}

@media (max-width: 980px) {
  .login-main {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .login-context {
    padding-top: 34px;
  }

  .login-panel {
    width: min(520px, 100%);
  }

  .account-button {
    min-width: 44px;
    width: 44px;
    padding: 0 7px;
  }

  .account-copy,
  .account-button > svg {
    display: none;
  }

  .navigation-toggle {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid #343936;
    border-radius: 6px;
    color: var(--brand);
    background: #151816;
  }

  .navigation-toggle svg {
    width: 18px;
    height: 18px;
  }

  .admin-shell {
    width: min(100% - 24px, 920px);
    display: block;
    padding-top: 94px;
  }

  .workspace-nav {
    width: min(304px, calc(100% - 24px));
    height: calc(100vh - 24px);
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 45;
    transform: translateX(calc(-100% - 28px));
    transition: transform 180ms ease;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 18px 0 55px rgba(7, 9, 8, 0.23);
  }

  .admin-view.nav-open .workspace-nav {
    transform: translateX(0);
  }

  .workspace-nav-heading button {
    display: flex;
  }

  .navigation-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    background: rgba(7, 9, 8, 0.48);
    backdrop-filter: blur(3px);
  }

  .admin-view.nav-open .navigation-backdrop {
    display: block;
  }

  .dashboard-grid-main,
  .dashboard-grid-bottom,
  .dashboard-grid-three {
    grid-template-columns: 1fr;
  }

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

  .analytics-toolbar {
    align-items: flex-end;
    flex-wrap: wrap;
  }

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

  .period-summary {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

@media (min-width: 651px) and (max-width: 760px) {
  .analytics-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .toolbar-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    min-width: 0;
    flex: 1;
  }

  .date-range {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
  }

  .date-range input {
    width: 100%;
  }

  .date-range .button {
    min-width: 126px;
    padding: 0 16px;
  }

  .period-summary {
    width: 100%;
    margin: 0;
    border-top: 1px solid #e4e8e3;
    padding-top: 10px;
    text-align: left;
  }
}

@media (max-width: 650px) {
  .bar-list {
    min-height: 0;
  }

  .login-header,
  .login-main {
    width: calc(100% - 32px);
  }

  .login-header > span {
    display: none;
  }

  .login-context {
    padding-top: 16px;
  }

  .login-context h1 {
    font-size: 37px;
  }

  .login-context-meta {
    margin-top: 28px;
  }

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

  .admin-header {
    width: calc(100% - 16px);
    top: 8px;
  }

  .admin-header-bar {
    height: 62px;
    gap: 7px;
    padding: 0 8px;
  }

  .admin-header .brand {
    gap: 8px;
    font-size: 12px;
  }

  .admin-header .brand img {
    width: 38px;
    height: 38px;
  }

  .admin-badge {
    display: none;
  }

  .header-icon-button {
    margin-left: auto;
  }

  .workspace {
    padding: 0 0 52px;
  }

  .admin-shell {
    width: calc(100% - 24px);
    padding-top: 82px;
  }

  .analytics-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .toolbar-group {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .date-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .date-range input {
    width: 100%;
  }

  .date-range .button {
    grid-column: 1 / -1;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    min-width: 0;
    flex: 1;
  }

  .page-title {
    min-height: 0;
    display: grid;
    gap: 18px;
  }

  .page-title h1 {
    font-size: 25px;
  }

  .page-title .button,
  .filter-control {
    width: 100%;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    min-height: 132px;
    padding: 16px;
  }

  .kpi-card strong {
    font-size: 21px;
  }

  .panel-heading {
    padding: 16px;
  }

  .legend {
    display: none;
  }

  .chart {
    min-height: 235px;
    padding: 14px 8px 8px;
  }

  .chart svg {
    height: 205px;
  }

  .bar-row {
    grid-template-columns: 90px minmax(0, 1fr) 36px;
    gap: 8px;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table {
    min-width: 720px;
  }

  .responsive-table {
    padding: 12px;
  }

  .responsive-table table,
  .responsive-table tbody {
    width: 100%;
    min-width: 0;
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: grid;
    gap: 10px;
  }

  .responsive-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    border: 1px solid #e1e5e1;
    border-radius: 6px;
    padding: 15px;
    background: #fff;
  }

  .responsive-table tbody tr:hover {
    background: #fff;
  }

  .responsive-table td {
    height: auto;
    min-width: 0;
    border: 0;
    padding: 0;
    overflow-wrap: anywhere;
    font-size: 10px;
  }

  .responsive-table td::before {
    display: block;
    margin-bottom: 5px;
    color: #8a918b;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .responsive-table td:first-child,
  .leads-table td:nth-child(6),
  .users-table td:nth-child(2),
  .users-table td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .leads-table td:nth-child(1)::before { content: "Клиент"; }
  .leads-table td:nth-child(2)::before { content: "Телефон"; }
  .leads-table td:nth-child(3)::before { content: "Форма"; }
  .leads-table td:nth-child(4)::before { content: "Источник"; }
  .leads-table td:nth-child(5)::before { content: "Дата"; }
  .leads-table td:nth-child(6)::before { content: "Статус"; }

  .referrers-table td:nth-child(1)::before { content: "Участник"; }
  .referrers-table td:nth-child(2)::before { content: "Телефон"; }
  .referrers-table td:nth-child(3)::before { content: "Приглашено"; }
  .referrers-table td:nth-child(4)::before { content: "Поездки"; }
  .referrers-table td:nth-child(5)::before { content: "Начислено"; }

  .users-table td:nth-child(1)::before { content: "Пользователь"; }
  .users-table td:nth-child(2)::before { content: "Роль"; }
  .users-table td:nth-child(3)::before { content: "Последний вход"; }
  .users-table td:nth-child(4)::before { content: "Статус"; }
  .users-table td:nth-child(5)::before { content: "Действия"; }

  .responsive-table .lead-status-select,
  .responsive-table .role-select {
    width: 100%;
  }

  .responsive-table .row-actions {
    justify-content: flex-start;
  }

  .modal-header {
    padding: 24px 22px 19px;
  }

  .modal form {
    padding: 22px;
  }
}

@media (max-width: 390px) {
  .admin-header .brand span {
    max-width: 102px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

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