:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-muted: #eef4fb;
  --ink: #101828;
  --muted: #667085;
  --line: #dde6f0;
  --line-soft: #edf2f7;
  --blue: #0a84ff;
  --blue-soft: #eaf4ff;
  --green: #0b7f62;
  --green-soft: #e7f6ef;
  --amber: #b7791f;
  --amber-soft: #fff4db;
  --red: #b42318;
  --red-soft: #fff0ee;
  --cyan: #0891b2;
  --cyan-soft: #e5f8fb;
  --shadow: 0 16px 34px rgba(16, 24, 40, 0.055);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "YS Text", "Yandex Sans Text", "Yandex Sans", Arial, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "tnum", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  padding: 14px 10px 14px;
}

.brand {
  display: grid;
  gap: 0;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.brand img {
  width: 138px;
  height: auto;
}

.brand span {
  color: #33465e;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding: 12px 0;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-group p {
  margin: 0 7px 7px;
  color: #66778d;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #25364a;
  padding: 8px 8px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.18;
}

.nav-item span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.nav-item::before {
  width: 22px;
  height: 22px;
  background: currentColor;
  content: "";
  mask: var(--icon) center / 22px 22px no-repeat;
}

.nav-item[data-icon="home"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m3 11 9-8 9 8M5 10v10h14V10M9 20v-6h6v6' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="message"], .nav-item[data-icon="dialog"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16v11H7l-3 3V5Z' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="cart"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4h2l2.4 11.3a2 2 0 0 0 2 1.7H18a2 2 0 0 0 2-1.6L21 8H7M9 20h.01M18 20h.01' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="check"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='4' width='16' height='16' rx='3' stroke='black' stroke-width='2' fill='none'/%3E%3Cpath d='m8 12 3 3 5-6' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="users"], .nav-item[data-icon="team"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8M22 21v-2a4 4 0 0 0-3-3.8' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="phone"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='7' y='2' width='10' height='20' rx='2' stroke='black' stroke-width='2' fill='none'/%3E%3Cpath d='M11 18h2' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="store"], .nav-item[data-icon="bag"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 10h16l-1-5H5l-1 5ZM6 10v10h12V10M9 20v-5h6v5' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="archive"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='4' width='18' height='5' rx='1' stroke='black' stroke-width='2' fill='none'/%3E%3Cpath d='M5 9v11h14V9M10 13h4' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="money"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='9' stroke='black' stroke-width='2' fill='none'/%3E%3Cpath d='M12 7v10M15 9.5c-1-1.1-5-1.4-5 1 0 3 5 1.5 5 4 0 2.4-4 2.1-5 .8' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="chart"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 19V5M4 19h17m-14-4 4-4 3 3 5-7' stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav-item[data-icon="platform"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1.5'/%3E%3Cpath d='M15 16h5M17.5 13.5v5'/%3E%3C/g%3E%3C/svg%3E"); }
.nav-item[data-icon="settings"] { --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='black' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Cpath d='M12 2.8v2.3M12 18.9v2.3M4.2 4.2l1.6 1.6M18.2 18.2l1.6 1.6M2.8 12h2.3M18.9 12h2.3M4.2 19.8l1.6-1.6M18.2 5.8l1.6-1.6'/%3E%3Cpath d='M8.2 3.8 9 6M15 18l.8 2.2M3.8 15.8 6 15M18 9l2.2-.8M3.8 8.2 6 9M18 15l2.2.8M8.2 20.2 9 18M15 6l.8-2.2'/%3E%3C/g%3E%3C/svg%3E"); }

.nav-item:hover,
.nav-item.active {
  background: #e7f2ff;
  color: var(--blue);
}

.nav-item b,
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  min-height: 21px;
  border-radius: 999px;
  background: #dceaff;
  color: var(--blue);
  padding: 3px 7px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 30px 24px 24px;
}

body.orders-page .main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

body.settings-page .main {
  overflow: hidden;
  padding: 0;
}

body.settings-page .app-shell {
  overflow-x: hidden;
}

body.settings-page .topbar {
  display: none;
}

body.settings-page .nav-item[data-view="settings"].active {
  position: relative;
  z-index: 2;
  width: 100%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--blue);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: start;
  gap: 22px;
  margin-bottom: 16px;
}

.topbar-title-block {
  min-width: 0;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.orders-title-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.orders-title-tools[hidden] {
  display: none;
}

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

h1 {
  margin: 0 0 6px;
  font-size: 29px;
  font-weight: 500;
  line-height: 1.15;
}

h2 {
  margin: 0 0 5px;
  font-size: 19px;
  font-weight: 500;
}

h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
}

#viewSubtitle,
.panel-header p,
.muted,
.tiny,
.eyebrow {
  color: var(--muted);
}

#viewSubtitle {
  margin: 0;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-actions[hidden] {
  display: none;
}

.global-search,
.primary-button,
.secondary-button,
.icon-button,
.segment,
input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #304258;
}

.global-search {
  display: flex;
  align-items: center;
  width: 310px;
  padding: 0 14px;
  color: #728196;
  font-size: 14px;
  font-weight: 400;
}

.primary-button,
.secondary-button {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(10, 132, 255, 0.18);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.9);
}

.text-button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 6px;
  font-size: 14px;
  font-weight: 500;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#ordersView.active {
  display: flex;
  min-height: 0;
}

body.orders-page #ordersView.active {
  height: 100%;
}

.view-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.home-subnav {
  width: fit-content;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  gap: 8px;
}

.segment {
  min-height: 34px;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 500;
}

.segment.active {
  border-color: #b7d8ff;
  background: var(--blue-soft);
  color: var(--blue);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1.08fr .88fr;
  gap: 14px;
}

.dashboard-team-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
}

.panel,
.metric,
.entity-card,
.setting-item,
.workspace-card,
.kanban-column {
  min-width: 0;
  border: 1px solid rgba(221, 230, 240, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel,
.workspace-card {
  padding: 16px;
}

.span-2 {
  grid-column: 1 / -1;
}

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

.panel-header p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.panel-tools {
  display: flex;
  gap: 8px;
}

.gear-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #56677b;
}

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

.metric {
  min-height: 96px;
  padding: 13px;
  background: rgba(251, 253, 255, 0.9);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 500;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 500;
}

.home-progress {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.platform-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr);
  gap: 14px;
}

.platform-command {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
  padding: 18px;
}

.platform-command-copy h2 {
  max-width: 760px;
  margin: 4px 0 8px;
  font-size: 26px;
  font-weight: 550;
}

.platform-command-copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.platform-action-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.platform-command-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.platform-pulse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
  color: #52657a;
  padding: 8px 10px;
  font-size: 12.5px;
}

.platform-pulse b {
  color: #1f2f45;
  font-weight: 560;
}

.platform-pulse.green { background: var(--green-soft); color: var(--green); }
.platform-pulse.blue { background: var(--blue-soft); color: var(--blue); }
.platform-pulse.amber { background: var(--amber-soft); color: var(--amber); }

.platform-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.platform-tenants-panel {
  grid-row: span 3;
}

.platform-tenant-table,
.platform-roadmap {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.platform-tenant-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, .9fr) minmax(130px, .75fr) minmax(170px, 1fr) minmax(120px, .72fr) minmax(130px, .78fr) 76px;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  font-size: 13px;
}

.platform-tenant-row:first-child {
  border-top: 0;
}

.platform-tenant-row.head {
  min-height: 38px;
  background: #f1f4f8;
  color: #52657a;
  font-size: 12px;
  font-weight: 550;
}

.platform-tenant-row span {
  min-width: 0;
}

.platform-tenant-row strong,
.platform-tenant-row small {
  display: block;
}

.platform-tenant-name {
  position: relative;
  padding-left: 18px;
}

.platform-tenant-name i {
  position: absolute;
  top: 4px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #9aa7b5;
}

.platform-tenant-name i.green { background: var(--green); }
.platform-tenant-name i.blue { background: var(--blue); }
.platform-tenant-name i.amber { background: var(--amber); }

.platform-tenant-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

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

.platform-compact-list {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.platform-compact-list .compact-row {
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: rgba(255, 255, 255, .72);
}

.platform-compact-list .compact-row:first-child {
  border-top: 0;
}

.platform-roadmap-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  padding: 11px 12px;
  font-size: 13px;
}

.platform-roadmap-item:first-child {
  border-top: 0;
}

.platform-roadmap-item span:not(.badge) {
  color: var(--muted);
}

.platform-side-drawer {
  width: min(540px, 100vw);
}

.platform-side-drawer .team-drawer-header {
  align-items: flex-start;
}

.platform-side-drawer .team-drawer-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.platform-wizard-body {
  gap: 16px;
}

.platform-wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f7f9fc;
  padding: 4px;
}

.platform-wizard-steps button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #52657a;
  font: inherit;
  font-size: 13px;
}

.platform-wizard-steps button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(25, 42, 70, .1);
}

.platform-wizard-form {
  display: grid;
  gap: 14px;
}

.platform-wizard-panel {
  display: none;
  gap: 12px;
}

.platform-wizard-panel.active {
  display: grid;
}

.platform-domain-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.platform-domain-field input {
  border-radius: 8px 0 0 8px;
}

.platform-domain-field span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f7f9fc;
  color: #53667c;
  padding: 0 10px;
  font-size: 13px;
}

.platform-support-check {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  padding: 8px 0;
}

.platform-template-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(247, 249, 252, .76);
  padding: 14px 16px;
}

.platform-template-card strong {
  display: block;
  margin-bottom: 10px;
  color: #1e2b3a;
  font-weight: 620;
}

.platform-template-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #405165;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 1180px) {
  .platform-layout,
  .platform-command {
    grid-template-columns: 1fr;
  }

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

  .platform-tenant-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .8fr) minmax(110px, .7fr) minmax(150px, .9fr) minmax(110px, .7fr) minmax(110px, .7fr) 72px;
  }
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

.progress-bar {
  height: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, rgba(10, 132, 255, .12) 0 12px, rgba(10, 132, 255, .04) 12px 23px);
}

.progress-bar i {
  display: block;
  width: 74%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66b087, var(--blue));
}

.table-list,
.compact-list,
.timeline,
.quick-pick-list,
.line-items,
.settings-grid,
.entity-grid {
  display: grid;
  gap: 10px;
}

.table-row,
.compact-row,
.timeline-row,
.request-row,
.task-card,
.line-item,
.field-toggle {
  min-height: 52px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.9);
  padding: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: 100px 110px minmax(150px, 1fr) minmax(180px, 1.15fr) 120px 120px 110px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.table-row.header {
  min-height: 42px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 500;
}

.order-open-trigger {
  cursor: pointer;
}

.order-open-trigger:hover,
.thread-row:hover,
.task-card:hover,
.nav-item:hover {
  border-color: #b7d8ff;
}

.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge.gray { background: #edf2f7; color: #405165; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 220px;
  gap: 10px;
  margin-bottom: 14px;
}

.orders-module {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: calc(100vh - 126px);
}

body.orders-page .orders-module {
  height: 100%;
  min-height: 0;
}

.orders-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

.orders-view-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.orders-view-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #53667c;
  font-size: 18px;
}

.orders-view-button:last-child {
  border-right: 0;
}

.orders-view-button.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.orders-search {
  position: relative;
  display: block;
  width: 260px;
  max-width: 36vw;
}

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

.orders-search input {
  height: 40px;
  background: rgba(255, 255, 255, .96);
}

.orders-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.orders-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.orders-settings-menu {
  position: relative;
}

.orders-settings-button {
  display: inline-grid;
  grid-template-columns: 18px 12px;
  place-items: center;
  gap: 5px;
  min-width: 57px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #405165;
  padding: 0 11px;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.orders-settings-button:hover,
.orders-settings-button[aria-expanded="true"] {
  border-color: #cbd8e7;
  background: #f8fbff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, .06);
}

.orders-settings-gear,
.orders-settings-arrow {
  display: block;
  background: currentColor;
}

.orders-settings-gear {
  width: 18px;
  height: 18px;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z'/%3E%3Cpath d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A8 8 0 0 0 7 6L4.6 5l-2 3.5 2 1.5A8.7 8.7 0 0 0 4.5 12c0 .5 0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a8 8 0 0 0 2.6 1.5L10 22h4l.4-2.5A8 8 0 0 0 17 18l2.4 1 2-3.5-2-1.5Z'/%3E%3C/g%3E%3C/svg%3E") center / 18px 18px no-repeat;
}

.orders-settings-arrow {
  width: 11px;
  height: 11px;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5 6 7.5l3-3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
  transition: transform .16s ease;
}

.orders-settings-button[aria-expanded="true"] .orders-settings-arrow {
  transform: rotate(180deg);
}

.orders-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #dbe8f7;
  border-radius: 8px;
  background: #eef6ff;
  padding: 10px;
}

.orders-filter-panel.compact {
  display: none;
}

.orders-saved-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
}

.filter-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-pill {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #304258;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
}

.filter-pill.active {
  border-color: #b7d8ff;
  background: var(--blue-soft);
  color: var(--blue);
}

.my-filters-panel {
  display: none;
  flex-basis: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  padding: 8px;
}

.my-filters-panel.open {
  display: grid;
  gap: 6px;
}

.my-filters-empty {
  color: var(--muted);
  padding: 8px;
  font-size: 13px;
}

.my-filter-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 8px;
}

.my-filter-name {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: #304258;
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.my-filter-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.my-filter-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: #405165;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 500;
}

.my-filter-actions button[data-filter-remove] {
  color: var(--red);
}

.my-filter-actions button:disabled {
  cursor: default;
  opacity: .42;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 24, 40, .22);
}

.filter-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  display: grid;
  gap: 14px;
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 24, 40, .22);
  padding: 16px;
  transform: translate(-50%, -50%);
}

.filter-modal[hidden],
.modal-backdrop[hidden] {
  display: none;
}

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

.filter-modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.filter-modal-body {
  display: grid;
  gap: 12px;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.filter-summary span {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 500;
}

.filter-modal-footer {
  align-items: center;
  justify-content: flex-end;
}

.order-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #405165;
  font-size: 13px;
  font-weight: 500;
}

.order-filter-chip span {
  padding: 0 0 0 10px;
  color: #61738a;
  white-space: nowrap;
}

.order-filter-chip select {
  min-height: 34px;
  width: auto;
  min-width: 78px;
  border: 0;
  background: transparent;
  padding: 0 9px 0 5px;
  color: #304258;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.orders-surface {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(221, 230, 240, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.orders-view-panel {
  display: none;
}

.orders-view-panel.active {
  display: block;
  height: 100%;
}

.orders-table-scroll {
  height: 100%;
  max-height: calc(100vh - 286px);
  overflow: auto;
  border-radius: 8px 8px 0 0;
}

.orders-data-table {
  min-width: max-content;
  font-size: 13px;
}

.orders-table-row {
  display: grid;
  grid-template-columns: var(--orders-grid-template);
  min-height: 54px;
  border-bottom: 1px solid var(--line-soft);
}

.orders-table-row:hover:not(.orders-table-header) {
  background: #f8fbff;
}

.orders-table-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 42px;
  background: #f0f3f7;
  color: #56677b;
}

.orders-table-cell {
  display: grid;
  align-content: center;
  min-width: 0;
  border-right: 1px solid var(--line-soft);
  padding: 9px 10px;
}

.orders-table-cell span,
.orders-table-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-table-cell small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-header-cell {
  position: relative;
  padding: 0;
  cursor: grab;
}

.orders-header-cell.dragging {
  opacity: .55;
}

.orders-header-cell.drag-over {
  background: #e7f2ff;
  outline: 2px solid #b7d8ff;
  outline-offset: -2px;
}

.orders-header-cell button {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 18px 0 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}

.orders-header-cell:active {
  cursor: grabbing;
}

.column-drag-active {
  user-select: none;
  cursor: grabbing;
}

.orders-header-cell button span {
  color: #95a3b5;
  font-size: 12px;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 4;
  width: 7px;
  height: 100%;
  cursor: col-resize;
}

.column-resizer:hover {
  background: rgba(10, 132, 255, .16);
}

.orders-count {
  padding: 12px;
  color: #405165;
  font-size: 13px;
}

.order-thumb {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 500;
}

.orders-columns-popover {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 20;
  width: 360px;
  max-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  background-clip: padding-box;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .16);
  padding: 10px;
}

.orders-columns-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.orders-columns-hint {
  margin: -2px 4px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.orders-columns-list {
  display: grid;
  gap: 6px;
  max-height: 454px;
  overflow: auto;
  padding-right: 2px;
}

.orders-column-config {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 7px;
}

.orders-column-config:hover {
  background: var(--surface-soft);
}

.orders-kanban-field-config {
  cursor: pointer;
}

.orders-column-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 31px;
  border-radius: 7px;
  padding: 0;
  color: #405165;
  font-size: 13px;
}

.orders-column-toggle:hover {
  background: transparent;
}

.orders-column-extra {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.orders-column-extra select {
  width: 100%;
  min-height: 32px;
  border-radius: 7px;
  padding: 0 8px;
  color: #304258;
  font-size: 12.5px;
}

.order-cell-extra {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.orders-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 10px;
  height: 100%;
  padding: 10px;
  overflow: auto;
}

.orders-kanban-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  min-height: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.orders-kanban-column.blue { background: #edf5ff; }
.orders-kanban-column.green { background: #e9f7ef; }
.orders-kanban-column.amber { background: #fff1d8; }
.orders-kanban-column.cyan { background: #e7f8fb; }
.orders-kanban-column.red { background: #fff0ee; }
.orders-kanban-column.gray { background: #f1f3f5; }

.orders-kanban-column.drop-target {
  border-color: rgba(10, 132, 255, .38);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .18), 0 18px 34px rgba(16, 24, 40, .1);
  transform: translateY(-1px);
}

.orders-kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: #304258;
}

.orders-kanban-column header span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #405165;
  font-size: 12px;
  font-weight: 500;
}

.orders-kanban-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 160px;
  overflow: auto;
}

.orders-kanban-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(221, 230, 240, .96);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .055);
  cursor: grab;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
  will-change: transform;
}

.kanban-card-main {
  color: #172233;
  font-weight: 560;
}

.kanban-card-line,
.kanban-card-date {
  color: #53667c;
  font-size: 12.5px;
  line-height: 1.35;
}

.kanban-card-date {
  color: #2f6fbb;
}

.kanban-status-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.kanban-status-config span,
.kanban-status-config div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.kanban-status-config i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8a98a8;
}

.kanban-status-config.blue i { background: var(--blue); }
.kanban-status-config.green i { background: var(--green); }
.kanban-status-config.amber i { background: #c77b00; }
.kanban-status-config.cyan i { background: #0791a7; }
.kanban-status-config.red i { background: var(--red); }

.kanban-status-config button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: #405165;
  padding: 0 8px;
  font-size: 12px;
}

.kanban-status-config button:disabled {
  opacity: .42;
}

.orders-kanban-card:hover {
  border-color: rgba(10, 132, 255, .24);
  box-shadow: 0 14px 30px rgba(16, 24, 40, .09);
  transform: translateY(-2px);
}

.orders-kanban-card.dragging {
  opacity: .28;
  transform: none;
}

.kanban-drag-ghost {
  position: fixed;
  z-index: 500;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(10, 132, 255, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 26px 70px rgba(16, 24, 40, .26);
  padding: 12px;
  cursor: grabbing;
  pointer-events: none;
  transform: rotate(.6deg);
}

body.kanban-dragging,
body.kanban-dragging * {
  cursor: grabbing;
}

body.kanban-dragging .orders-kanban-card.dragging,
.kanban-drag-ghost {
  pointer-events: none;
}

.orders-kanban-card small,
.orders-kanban-card em {
  color: var(--muted);
}

.orders-empty-mini {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: #53667c;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .orders-kanban-column,
  .orders-kanban-card {
    transition: none;
  }
}

.orders-calendar-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.orders-calendar-head strong {
  text-align: center;
  font-size: 18px;
}

.orders-calendar-tools {
  display: flex;
  gap: 6px;
}

.orders-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  min-height: 520px;
  overflow: auto;
}

.orders-calendar-day {
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(#f5f7fa 0 46px, transparent 46px), repeating-linear-gradient(180deg, transparent 0 72px, rgba(221, 230, 240, .55) 72px 73px);
  padding: 58px 8px 8px;
  position: relative;
}

.orders-calendar-day header {
  position: absolute;
  inset: 0 0 auto;
  height: 46px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: #405165;
  font-weight: 500;
}

.orders-calendar-event {
  display: grid;
  gap: 3px;
  border: 1px solid #cfe2ff;
  border-radius: 8px;
  background: #f6fbff;
  padding: 9px;
  font-size: 12px;
}

.orders-calendar-event span,
.orders-calendar-empty {
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 11px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

.entity-card {
  min-height: 140px;
  padding: 16px;
}

.finance-layout,
.inbox-layout,
.shop-layout,
.team-layout,
.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .78fr);
  gap: 14px;
}

.inbox-layout {
  grid-template-columns: 340px minmax(0, 1fr);
}

.settings-workspace {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  background: #fff;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  padding: 14px 10px;
}

.settings-nav-group {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.settings-nav-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-nav-heading {
  display: flex;
  align-items: center;
  min-height: 24px;
  color: #8a98a8;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 620;
  line-height: 1;
  text-transform: uppercase;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #25364a;
  padding: 0 12px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.settings-nav-item:hover {
  background: #f3f8ff;
  color: var(--blue);
}

.settings-nav-item.active {
  border-color: #d8e9ff;
  background: #e7f2ff;
  color: var(--blue);
}

.settings-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.settings-content-head,
.settings-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-content-head {
  border-bottom: 1px solid var(--line);
  min-height: 52px;
  padding: 10px 22px;
  align-items: center;
}

.settings-content-head h2,
.settings-section-title h3 {
  margin: 0;
}

.settings-content-head p,
.settings-section-title p,
.settings-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.settings-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 22px;
}

.settings-tab {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #5b6b7d;
  padding: 8px 12px;
  font-weight: 520;
  white-space: nowrap;
}

.settings-tab.active {
  border-color: var(--blue);
  color: var(--ink);
}

.settings-detail {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 30px;
}

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

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 360px));
  gap: 14px;
}

.settings-form-grid label {
  display: grid;
  gap: 6px;
  color: #405165;
  font-weight: 520;
}

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

.settings-upload {
  display: grid;
  place-items: center;
  gap: 8px;
  width: min(320px, 100%);
  min-height: 180px;
  border: 1px dashed #c8d6e6;
  border-radius: 10px;
  background: #fbfdff;
  color: #405165;
  text-align: center;
  padding: 22px;
}

.settings-upload span {
  color: var(--muted);
  line-height: 1.45;
}

.settings-legal-layout {
  display: grid;
  align-items: start;
  max-width: 760px;
}

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

.legal-field {
  display: grid;
  grid-template-columns: 170px minmax(260px, 360px);
  align-items: center;
  gap: 6px;
  color: #405165;
  font-size: 14px;
  font-weight: 520;
}

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

.legal-field.wide textarea,
.legal-field.wide input,
.legal-field.wide select {
  max-width: 360px;
}

.settings-table code {
  width: fit-content;
  border: 1px solid #dbe8f7;
  border-radius: 6px;
  background: #f6faff;
  color: #2867b7;
  padding: 3px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 520;
}

.legal-field small {
  color: var(--muted);
  font-weight: 450;
}

.legal-inline-actions {
  display: block;
  padding-top: 2px;
}

.legal-toggle {
  display: grid;
  grid-template-columns: 170px minmax(260px, 360px);
  align-items: center;
  gap: 6px;
  color: #405165;
  font-size: 14px;
  font-weight: 500;
}

.legal-toggle span {
  min-width: 0;
}

.legal-toggle b {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef2f6;
  color: #405165;
  padding: 0 12px;
  font-size: 13px;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-toggle input {
  width: auto;
}

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

.custom-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  max-width: 572px;
}

.custom-field-settings-button {
  width: 34px;
  height: 34px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #fff;
  color: #5d6c7d;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .16s ease, transform .16s ease, border-color .16s ease, color .16s ease;
}

.custom-field-row:hover .custom-field-settings-button,
.custom-field-settings-button:focus-visible {
  opacity: 1;
  transform: translateX(0);
}

.custom-field-settings-button:hover {
  border-color: #b8d7ff;
  color: var(--blue);
}

.add-custom-field-button {
  width: 220px;
  min-height: 34px;
  border: 1px dashed #80afff;
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  font-weight: 520;
  margin: 4px 0 0 170px;
}

.compact-title {
  display: block;
}

.compact-settings-table .settings-table-row {
  grid-auto-columns: minmax(170px, 1fr);
}

.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(29, 39, 52, .42);
  padding: 24px;
}

.settings-modal-backdrop[hidden] {
  display: none;
}

.settings-modal {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  border: 1px solid #c9dcf4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 36, 54, .22);
  padding: 22px;
}

.settings-modal h3 {
  margin: 0;
}

.settings-modal-note {
  margin: -4px 0 2px;
  color: var(--muted);
}

.settings-modal label {
  display: grid;
  gap: 6px;
  color: #405165;
  font-size: 14px;
  font-weight: 520;
}

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

.danger-outline-button {
  border: 1px solid #ffc7d0;
  border-radius: 8px;
  background: #fff5f7;
  color: #d9233f;
  padding: 10px 13px;
  font-weight: 620;
}

.danger-outline-button:hover {
  border-color: #ff9aaa;
  background: #ffecef;
}

.modal-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f3f6fa;
  color: #405165;
  font-size: 20px;
  line-height: 1;
}

.danger-settings-panel {
  max-width: 760px;
}

.danger-box {
  border: 1px solid #ffd69a;
  border-radius: 12px;
  background: #fff8eb;
  color: #915d11;
  padding: 16px;
}

.danger-box p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.danger-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #405165;
}

.danger-button {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  background: #ef334e;
  color: #fff;
  padding: 11px 16px;
  font-weight: 620;
}

.settings-table {
  display: grid;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.settings-tabs[hidden] {
  display: none;
}

.settings-table-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  min-width: max-content;
  border-bottom: 1px solid var(--line-soft);
}

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

.settings-table-row span {
  min-width: 0;
  padding: 11px 12px;
}

.settings-table-row.head {
  background: #f3f6fa;
  color: #53667c;
  font-weight: 560;
}

.team-settings-panel {
  position: relative;
  gap: 16px;
}

.team-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-table,
.team-roles-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #fff;
}

.team-table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(170px, .8fr) minmax(220px, 1fr) minmax(170px, .8fr) minmax(110px, .55fr) minmax(90px, .45fr);
  align-items: center;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: #304258;
  padding: 0;
  text-align: left;
  font: inherit;
}

.team-table-row span {
  min-width: 0;
  overflow: hidden;
  padding: 9px 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-head {
  min-height: 42px;
  background: #f7f9fc;
  color: #53667c;
  font-weight: 520;
}

.team-group-row,
.team-list-title {
  min-height: 40px;
  border-bottom: 1px solid var(--line-soft);
  background: #eef0f3;
  color: #253247;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 560;
}

.team-user-row:hover,
.team-role-row:hover {
  background: #f7fbff;
}

.team-user-row:focus-visible,
.team-role-row:focus-visible {
  outline: 2px solid #9dc9ff;
  outline-offset: -2px;
}

.team-positive {
  color: #12a05c;
}

.team-role-row {
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: #304258;
  padding: 0 18px;
  text-align: left;
  font: inherit;
}

.team-role-row.active {
  background: #edf4ff;
}

.team-role-row b {
  font-weight: 620;
}

.team-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(12, 20, 30, .34);
}

.team-drawer-backdrop[hidden] {
  display: none;
}

.team-side-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 60;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(560px, 100vw);
  border-left: 1px solid #dbe3ee;
  background: #fff;
  box-shadow: -18px 0 46px rgba(23, 36, 54, .18);
  transform: translateX(104%);
  transition: transform 180ms ease;
}

.team-side-drawer.open {
  transform: translateX(0);
}

.team-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 20px;
}

.team-drawer-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 560;
}

.team-close-button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #2f3f54;
  font-size: 28px;
  line-height: 1;
}

.team-drawer-body {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  padding: 22px 22px 90px;
}

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

.employee-field {
  display: grid;
  gap: 6px;
  color: #7a8594;
  font-size: 13px;
  font-weight: 520;
}

.employee-field input,
.employee-field select,
.employee-field textarea {
  width: 100%;
  min-height: 34px;
  font-size: 14px;
}

.employee-field textarea {
  min-height: 74px;
  resize: vertical;
}

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

.employee-inline-input {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(90px, 1fr);
}

.employee-inline-input input {
  border-radius: 8px 0 0 8px;
}

.employee-inline-input select {
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.employee-access,
.role-permissions {
  display: grid;
  gap: 8px;
}

.employee-access h3 {
  margin: 0;
  color: #7a8594;
  font-size: 14px;
}

.team-check-row {
  display: grid;
  grid-template-columns: 22px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #405165;
  font-size: 14px;
}

.team-check-row.indented {
  margin-left: 26px;
}

.team-check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.team-check-row a {
  color: #6b9ff5;
  font-size: 13px;
}

.team-check-icon {
  color: #56677b;
}

.team-drawer-footer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .96);
  padding: 14px 18px;
}

.team-more-button,
.danger-icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #53667c;
  font-size: 20px;
}

.danger-icon-button {
  color: #ff2f48;
}

.team-action-menu {
  position: absolute;
  right: 14px;
  bottom: 58px;
  display: grid;
  min-width: 180px;
  border: 1px solid #c8d6e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(23, 36, 54, .18);
  padding: 8px;
}

.team-action-menu[hidden] {
  display: none;
}

.team-action-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #405165;
  padding: 0 10px;
  text-align: left;
}

.team-action-menu button:hover {
  background: #f3f6fa;
}

.role-drawer-body {
  padding-bottom: 92px;
}

.team-collapse-all {
  width: fit-content;
  padding: 0;
}

.role-permission-group {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.role-permission-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 0;
  background: #f1f2f4;
  color: #405165;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.role-permission-head b {
  font-weight: 560;
}

.role-permission-head span {
  color: #8d9bac;
  font-size: 18px;
  transition: transform 140ms ease;
}

.role-permission-head:hover {
  background: #e9edf2;
}

.role-permission-group.collapsed .role-permission-head span {
  transform: rotate(-90deg);
}

.role-permission-body {
  display: grid;
  gap: 8px;
}

.role-permission-group.collapsed .role-permission-body {
  display: none;
}

.role-permission-group .team-check-row {
  grid-template-columns: 22px minmax(0, 1fr);
  padding-left: 26px;
}

.role-select {
  padding-left: 26px;
}

.location-settings-panel {
  position: relative;
}

.location-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #fff;
}

.location-table-row {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(300px, .8fr) minmax(420px, 1fr);
  align-items: center;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: #304258;
  padding: 0;
  text-align: left;
  font: inherit;
}

.location-table-row > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 9px 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-head {
  min-height: 42px;
  background: #f7f9fc;
  color: #53667c;
  font-weight: 520;
}

.location-row:hover {
  background: #f7fbff;
}

.location-row i,
.location-color-input b {
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--location-color);
}

.drag-dots {
  color: #a1adbc;
  font-size: 22px;
  line-height: 1;
}

.location-side-drawer {
  width: min(620px, 100vw);
}

.location-side-drawer .team-drawer-header h2 {
  overflow: hidden;
  max-width: 520px;
  color: #6d7480;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-drawer-body {
  gap: 14px;
}

.location-phone-color-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
}

.location-phones {
  display: grid;
  gap: 8px;
  color: #7a8594;
  font-size: 13px;
  font-weight: 520;
}

.location-phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.location-phone-row input {
  min-height: 34px;
  border-radius: 8px 0 0 8px;
}

.location-phone-row button {
  min-width: 42px;
  min-height: 34px;
  border-radius: 0 8px 8px 0;
  padding: 0;
}

.location-remove-phone {
  border: 1px solid #ff3b57;
  background: #ff3b57;
  color: #fff;
  font-size: 22px;
}

.location-color-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.location-color-input input {
  border-radius: 8px 0 0 8px;
}

.location-color-input b {
  display: grid;
  place-self: stretch;
  width: auto;
  height: auto;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.location-add-field {
  width: 100%;
  max-width: none;
  margin: 0;
}

.location-accordion {
  display: grid;
  gap: 12px;
}

.location-accordion-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  background: #f0f1f3;
  color: #405165;
  padding: 0 14px;
  text-align: left;
  font-size: 15px;
  font-weight: 560;
}

.location-accordion-head span {
  color: #8d99a8;
  transition: transform 160ms ease;
}

.location-accordion:not(.open) .location-accordion-head span {
  transform: rotate(-90deg);
}

.location-accordion-body {
  display: none;
  gap: 12px;
}

.location-accordion.open .location-accordion-body {
  display: grid;
}

.location-help-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border: 1px solid #ffb56a;
  border-radius: 6px;
  background: #fff1e2;
  color: #0a84ff;
  padding: 0 18px;
  text-align: left;
  font-weight: 560;
}

.location-numbering-table {
  display: grid;
  gap: 6px;
}

.location-numbering-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 108px 108px 106px;
  align-items: center;
  gap: 8px;
  color: #53667c;
  font-size: 14px;
}

.location-numbering-row.head {
  color: #8a95a4;
  font-size: 13px;
  font-weight: 560;
}

.location-numbering-row input {
  min-height: 34px;
  text-align: right;
}

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

.location-access-list .team-check-row {
  grid-template-columns: 22px minmax(0, 1fr);
  border-bottom: 1px solid var(--line-soft);
  padding: 4px 0 8px;
}

.prices-settings-panel {
  width: min(660px, 100%);
  gap: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.prices-table,
.prices-defaults-table {
  display: grid;
  overflow: visible;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #fff;
}

.prices-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 210px 210px 42px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line-soft);
}

.prices-row:last-child,
.prices-default-row:last-of-type {
  border-bottom: 0;
}

.prices-head {
  min-height: 40px;
  background: #f2f4f7;
  color: #405165;
  font-weight: 560;
}

.prices-row > span,
.prices-head > span,
.prices-default-row > span {
  min-width: 0;
  padding: 9px 14px;
}

.price-name-cell,
.price-select-cell,
.price-add-cell {
  display: block;
  min-width: 0;
  padding: 5px 8px;
}

.price-name-cell input,
.price-add-cell input,
.price-select-cell select {
  width: 100%;
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  color: #2f3f54;
  font: inherit;
}

.price-name-cell input[readonly] {
  cursor: default;
}

.prices-row.editable .price-name-cell input:focus,
.prices-row.editable .price-name-cell input:hover {
  border-color: #ff9b45;
  background: #fff;
}

.price-select-cell select:hover,
.price-select-cell select:focus,
.price-add-cell input:focus {
  border-color: #77a9ff;
  background: #fff;
}

.price-actions {
  display: flex;
  justify-content: center;
  padding: 0 8px;
}

.price-delete-button,
.price-add-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: #fff0f2;
  color: #ff3048;
  font-size: 16px;
}

.price-add-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-size: 20px;
}

.prices-default-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 210px 210px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line-soft);
}

.price-minimum-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  color: #405165;
}

.price-minimum-toggle input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--blue);
}

.ro-prices-settings {
  display: grid;
  gap: 28px;
  padding: 2px 0 48px;
}

.ro-price-decimals,
.ro-price-workspace {
  display: grid;
  grid-template-columns: 220px minmax(320px, 520px);
  gap: 34px;
  align-items: start;
}

.ro-price-decimals h3,
.ro-price-copy h3,
.ro-price-main h3 {
  margin: 0;
  color: #253247;
  font-size: 18px;
  font-weight: 620;
}

.ro-price-copy {
  display: grid;
  gap: 8px;
}

.ro-price-copy p,
.ro-muted {
  margin: 0;
  color: #748294;
  font-size: 13px;
  line-height: 1.45;
}

.ro-decimal-control {
  display: grid;
  justify-items: start;
  gap: 8px;
  color: #405165;
  font-size: 13px;
}

.ro-segmented,
.ro-discount-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #cfd8e4;
  border-radius: 4px;
  background: #fff;
}

.ro-segmented button,
.ro-discount-switch button {
  min-width: 40px;
  min-height: 32px;
  border: 0;
  border-right: 1px solid #cfd8e4;
  background: #fff;
  color: #405165;
  padding: 0 13px;
  font: inherit;
}

.ro-segmented button:last-child,
.ro-discount-switch button:last-child {
  border-right: 0;
}

.ro-segmented button.active,
.ro-discount-switch button.active {
  background: #eef4ff;
  color: #0b66e4;
}

.ro-decimal-control small {
  color: #8a96a7;
}

.ro-section-divider {
  height: 1px;
  background: var(--line-soft);
}

.ro-price-main {
  display: grid;
  gap: 12px;
}

.ro-price-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 34px;
  border-bottom: 1px solid var(--line-soft);
}

.ro-price-tabs button {
  align-self: stretch;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #53667c;
  padding: 0 0 8px;
  font: inherit;
}

.ro-price-tabs button.active {
  border-color: var(--blue);
  color: var(--blue);
}

.ro-add-price-button {
  width: fit-content;
}

.ro-price-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #fff;
}

.ro-price-table[hidden] {
  display: none;
}

.ro-price-table-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 96px 130px;
  align-items: center;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: #304258;
  padding: 0;
  text-align: left;
  font: inherit;
}

.ro-price-table-row:last-child {
  border-bottom: 0;
}

.ro-price-table-row.head {
  background: #eef0f3;
  color: #405165;
  font-weight: 560;
}

.ro-price-table-row:not(.head):hover {
  background: #f7fbff;
}

.ro-price-table-row span {
  min-width: 0;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-default-prices {
  margin-top: 8px;
}

.ro-default-selects {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.ro-default-selects label {
  display: grid;
  gap: 6px;
  color: #405165;
  font-size: 13px;
  font-weight: 560;
}

.ro-default-select select,
.price-location-picker select {
  width: 100%;
  min-height: 34px;
  background: #fff;
}

.ro-discounts {
  align-items: start;
}

.ro-discount-label {
  color: #405165;
  font-size: 13px;
  font-weight: 560;
}

.price-side-drawer {
  width: min(520px, 100vw);
}

.price-side-drawer .team-drawer-header {
  justify-content: space-between;
}

.price-drawer-body {
  gap: 16px;
}

.employee-field b {
  color: #ff3149;
  font-weight: 620;
}

.price-location-picker {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(160px, 1fr);
  align-items: end;
  gap: 8px;
  color: #7a8594;
  font-size: 13px;
  font-weight: 520;
}

.price-location-picker > span {
  grid-column: 1 / -1;
}

.price-access-panel {
  display: grid;
  gap: 0;
}

.price-access-panel h3 {
  margin: 0;
  background: #f1f2f4;
  color: #405165;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 620;
}

.price-access-panel .team-check-row {
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 34px;
  border-bottom: 1px solid var(--line-soft);
  background: #edf4ff;
  padding: 0 8px;
}

.status-settings-panel {
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.status-settings-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
}

.status-settings-intro p {
  margin: 0;
  color: #405165;
}

.compact-primary {
  min-height: 34px;
  padding: 8px 14px;
}

.status-groups-header {
  min-height: 34px;
  background: #edf0f4;
  color: #536174;
  padding: 9px 16px 9px 38px;
  font-size: 14px;
  font-weight: 520;
}

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

.status-group-block {
  display: grid;
  overflow-x: auto;
  background: #eef6ff;
  padding: 0 14px 10px;
}

.status-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #344458;
  padding: 0 0 0 4px;
  text-align: left;
  font-size: 14px;
  font-weight: 520;
}

.status-group-title b {
  margin-left: auto;
  border: 1px solid #d7e5f7;
  border-radius: 999px;
  background: #fff;
  color: #7a8797;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 520;
}

.status-group-chevron {
  color: #9aa8b8;
  font-size: 18px;
  line-height: 1;
}

.status-grid {
  display: grid;
  grid-template-columns: 190px 120px minmax(260px, 1fr) minmax(260px, 1fr) 118px;
  min-width: 980px;
}

.status-grid span {
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, .75);
  padding: 9px 10px;
}

.status-grid span:first-child {
  border-left: 0;
}

.status-grid-head {
  background: #e8eaed;
  color: #536174;
  font-size: 13px;
  font-weight: 520;
}

.status-row {
  min-height: 38px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e2e9f2;
  background: #fff;
  color: #344458;
  cursor: pointer;
  font-size: 13px;
  font: inherit;
  text-align: left;
}

.status-row:hover {
  background: #f8fbff;
}

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

.status-row em {
  display: inline-block;
  margin-left: 8px;
  color: #9aa6b5;
  font-size: 12px;
  font-style: normal;
}

.custom-status-pill {
  border: 1px solid #d8e5f5;
  border-radius: 999px;
  background: #f7fbff;
  color: #53667c;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 520;
}

.status-side-drawer {
  width: min(620px, 100vw);
}

.status-drawer-body {
  gap: 16px;
}

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

.status-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #405165;
  font-size: 14px;
  font-weight: 520;
}

.status-switch-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.status-drawer-section {
  display: grid;
  gap: 8px;
}

.status-drawer-section h3 {
  margin: 0;
  background: #f1f2f4;
  color: #405165;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 620;
}

.status-check-list {
  display: grid;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.status-check-row {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  min-height: 36px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 10px;
}

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

.status-transition-list .status-check-row {
  grid-template-columns: 22px minmax(0, 1fr) minmax(110px, auto);
}

.status-check-row small {
  color: #8895a7;
  font-size: 12px;
}

.status-system-note {
  margin: 0;
  border: 1px solid #ffe3af;
  border-radius: 8px;
  background: #fff7e8;
  color: #8a5b0f;
  padding: 10px 12px;
  font-size: 13px;
}

body.preview-jakarta {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef2f7;
  --ink: #121a2b;
  --muted: #5f6e82;
  --line: #dbe3ee;
  --line-soft: #e7edf5;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #0f8a63;
  --green-soft: #e6f5ee;
  --shadow: 0 14px 32px rgba(18, 26, 43, 0.06);
  background: #f4f6fa;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "tnum";
  text-rendering: geometricPrecision;
}

body.preview-jakarta button,
body.preview-jakarta input,
body.preview-jakarta select,
body.preview-jakarta textarea {
  font-family: inherit;
}

body.preview-jakarta .sidebar,
body.preview-jakarta .settings-sidebar {
  border-color: #dbe3ee;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

body.preview-jakarta .nav-item,
body.preview-jakarta .settings-sidebar-link {
  color: #243349;
  font-size: 14px;
  font-weight: 540;
}

body.preview-jakarta .nav-item.active,
body.preview-jakarta .settings-sidebar-link.active {
  background: #eaf1ff;
  color: #174fc7;
  box-shadow: inset 3px 0 0 #2563eb;
}

body.preview-jakarta #viewTitle,
body.preview-jakarta .settings-detail h2,
body.preview-jakarta .team-settings-panel h3 {
  color: #111827;
  font-weight: 650;
}

body.preview-jakarta .settings-tabs button,
body.preview-jakarta .team-tabs button,
body.preview-jakarta .team-toolbar a {
  color: #44546a;
  font-weight: 560;
}

body.preview-jakarta .settings-tabs button.active,
body.preview-jakarta .team-tabs button.active {
  color: #2563eb;
  border-color: #2563eb;
}

body.preview-jakarta .team-table,
body.preview-jakarta .settings-table,
body.preview-jakarta .team-roles-list,
body.preview-jakarta .settings-panel {
  border-color: #dfe6f0;
  box-shadow: 0 12px 28px rgba(18, 26, 43, 0.045);
}

body.preview-jakarta .team-table-row,
body.preview-jakarta .settings-table-row {
  color: #29384d;
}

body.preview-jakarta .team-table-row.group,
body.preview-jakarta .settings-table-row.head {
  background: #eef2f7;
  color: #26364c;
  font-weight: 650;
}

body.preview-jakarta .team-table-row.selected {
  background: #eaf1ff;
}

body.preview-jakarta .primary-button {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
  font-weight: 650;
}

.status-name-pill {
  display: inline-flex;
  align-items: center;
  min-width: 132px;
  min-height: 22px;
  border-radius: 4px;
  color: #fff;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 560;
}

.status-name-pill.blue {
  background: #2d7de7;
}

.status-name-pill.green {
  background: #0aa05b;
}

.status-name-pill.amber {
  background: #ff9500;
}

.status-name-pill.cyan {
  background: #55c4dc;
}

.status-name-pill.gray {
  background: #9aa1a9;
}

.status-muted {
  color: #8d99a8;
}

.system-lock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #f2f5f8;
  color: #6b7888;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 520;
}

.settings-total {
  margin: 0;
  color: #405165;
}

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

.settings-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 16px;
}

.settings-card h4 {
  margin: 0;
}

.thread-row {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 12px;
  text-align: left;
}

.thread-row.active {
  border-color: #b7d8ff;
  background: var(--blue-soft);
}

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

.message {
  max-width: 620px;
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.message.agent {
  margin-left: auto;
  background: var(--green-soft);
}

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

.kanban-column {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
}

.kanban-column h3 {
  color: var(--muted);
}

.schedule-table {
  display: grid;
  grid-template-columns: 130px repeat(5, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.schedule-cell {
  min-height: 44px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.schedule-cell:nth-child(6n) {
  border-right: 0;
}

.schedule-cell.head {
  background: var(--surface-muted);
  color: #56677b;
  font-weight: 500;
}

.schedule-cell.work {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 500;
}

.schedule-cell.off {
  background: #f7f9fc;
  color: #8492a5;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 24, 40, .22);
}

.order-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1180px, 76vw);
  min-width: min(1180px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(16, 24, 40, .16);
  transform: translateX(104%);
  transition: transform 180ms ease;
}

.order-drawer.open {
  transform: translateX(0);
}

.drawer-header,
.drawer-footer,
.field-settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
}

.drawer-meta,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.drawer-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px 18px 0;
}

.drawer-tab {
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 500;
}

.drawer-tab.active {
  border-color: var(--blue);
  color: var(--ink);
}

.drawer-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  min-height: 0;
  overflow: hidden;
}

.drawer-main-column {
  min-width: 0;
  overflow: auto;
  padding: 16px 18px 92px;
}

.drawer-history-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: #f8fbff;
}

.history-header,
.quick-comment {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.history-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.drawer-timeline {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.quick-comment {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.drawer-panel {
  display: none;
}

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

.order-form,
.drawer-section,
.field-settings-list {
  display: grid;
  gap: 10px;
}

.drawer-section {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.drawer-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.drawer-field-grid,
.dual-column,
.comment-grid,
.payment-grid,
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-field {
  display: grid;
  gap: 5px;
}

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

.drawer-field span,
.comment-card span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.timeline-row strong,
.line-item strong,
.compact-row strong {
  display: block;
  margin-bottom: 3px;
}

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

.comment-card.client {
  border-color: #b7d8ff;
}

.comment-card.internal {
  border-color: #f3d99d;
}

.field-settings {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(440px, 100%);
  padding: 16px;
  border-left: 1px solid var(--line);
  background: #f8fbff;
  box-shadow: -16px 0 36px rgba(16, 24, 40, .12);
}

.field-settings[hidden] {
  display: none;
}

.field-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.field-toggle button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.add-field-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.drawer-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  padding: 12px 18px;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 13px;
}

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

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

  .topbar-actions,
  .view-controls {
    flex-wrap: wrap;
  }

  .dashboard-layout,
  .finance-layout,
  .shop-layout,
  .team-layout,
  .analytics-layout {
    grid-template-columns: 1fr;
  }

  .settings-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 88px);
  }

  .settings-nav {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .order-drawer {
    width: 100vw;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: auto;
  }

  .nav-list {
    max-height: 360px;
  }

  .main {
    padding: 18px 14px;
  }

  body.orders-page .main {
    display: block;
    overflow: auto;
  }

  .global-search {
    width: 100%;
  }

  .metric-grid,
  .drawer-field-grid,
  .dual-column,
  .comment-grid,
  .payment-grid,
  .delivery-grid,
  .entity-grid,
  .settings-legal-layout,
  .settings-card-grid,
  .settings-form-grid,
  .legal-form-grid,
  .toolbar,
  .inbox-layout,
  .task-board {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-columns: 1fr;
  }

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

  .drawer-content {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .drawer-main-column {
    overflow: visible;
    padding-bottom: 16px;
  }

  .drawer-history-sidebar {
    min-height: 360px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .field-settings,
  .add-field-form {
    width: 100%;
    grid-template-columns: 1fr;
  }
}
