.visual-version-switch {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(36px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #dfe6ec;
  border-radius: 12px;
  background: #f1f4f7;
}

.visual-version-switch button {
  min-width: 38px;
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #71808e;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.visual-version-switch button:hover {
  color: #257fce;
}

.visual-version-switch button.is-active {
  background: #ffffff;
  color: #257fce;
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.09);
}

.owner-shell .owner-topbar .owner-brand-version {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.owner-brand-version .brand-title {
  min-width: 0;
}

body[data-crm-version="v4"] {
  background: #f3f6f9;
}

.owner-shell.is-v4-mode {
  --v4-blue: var(--blue-6, #3390ec);
  --v4-blue-strong: var(--blue-7, #257fce);
  --v4-blue-soft: var(--blue-0, #eaf5ff);
  --v4-ink: var(--gray-9, #17212b);
  --v4-muted: var(--gray-6, #71808e);
  --v4-line: var(--gray-3, #dfe6ec);
  --v4-surface: var(--gray-0, #ffffff);
  background: #f3f6f9;
  color: var(--v4-ink);
  font-family: "Golos Text", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.owner-shell.is-v4-mode .app-header {
  position: sticky;
  top: 0;
  z-index: 120;
  display: block;
  padding: 14px 0 0;
  border: 0;
  background: rgba(243, 246, 249, 0.92);
  box-shadow: none;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.owner-shell.is-v4-mode .v4-owner-topbar {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1.4fr) auto;
  gap: 12px;
  padding: 0 20px;
}

.v4-brand-tile,
.owner-shell.is-v4-mode .v4-search-tile,
.owner-shell.is-v4-mode .v4-user-tile,
.owner-shell.is-v4-mode .v4-bento-nav {
  border: 1px solid var(--v4-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 24px rgba(23, 33, 43, 0.045);
}

.v4-brand-tile {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 9px 16px;
  border-radius: 20px;
}

.v4-brand-tile > div:first-child {
  min-width: 0;
}

.v4-brand-tile span,
.v4-brand-tile strong {
  display: block;
}

.v4-brand-tile span {
  margin-bottom: 2px;
  color: var(--v4-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v4-brand-tile strong {
  overflow: hidden;
  color: var(--v4-ink);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-shell.is-v4-mode .v4-search-tile {
  min-width: 0;
  min-height: 62px;
  grid-column: auto;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  padding: 0 17px;
  border-radius: 20px;
}

.owner-shell.is-v4-mode .v4-search-tile:focus-within {
  border-color: #9bcdf5;
  box-shadow: 0 0 0 4px rgba(51, 144, 236, 0.12);
}

.owner-shell.is-v4-mode .v4-search-tile .search-symbol {
  color: var(--v4-blue);
}

.owner-shell.is-v4-mode .v4-user-tile {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 15px;
  border-radius: 20px;
  color: #53616e;
  font-size: 12px;
}

.owner-shell.is-v4-mode .v4-user-tile .button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #e1e7ec;
  border-radius: 11px;
  background: #f5f7f9;
  color: #53616e;
  box-shadow: none;
}

.owner-shell.is-v4-mode .v4-bento-nav {
  position: relative;
  width: auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 11px 20px 14px;
  padding: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--v4-line);
  border-radius: 19px;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 7px;
  scrollbar-width: thin;
}

.owner-shell.is-v4-mode .v4-bento-nav .nav-button {
  width: auto;
  min-width: max-content;
  min-height: 38px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 21px auto;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #5b6976;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.owner-shell.is-v4-mode .v4-bento-nav .nav-button:hover {
  border-color: #dfebf4;
  background: #f5faff;
  color: var(--v4-blue-strong);
  transform: none;
}

.owner-shell.is-v4-mode .v4-bento-nav .nav-button.is-active {
  border-color: #d4e9fb;
  background: var(--v4-blue-soft);
  color: var(--v4-blue-strong);
  box-shadow: none;
}

.owner-shell.is-v4-mode .v4-bento-nav .nav-icon {
  width: 21px;
  height: 21px;
  border-color: #dfe7ed;
  border-radius: 7px;
  background: #ffffff;
  color: #6f7e8a;
}

.owner-shell.is-v4-mode .v4-bento-nav .nav-button.is-active .nav-icon {
  border-color: #b9dcf7;
  background: #ffffff;
  color: var(--v4-blue-strong);
}

.owner-shell.is-v4-mode .v4-bento-nav .nav-count {
  display: none;
}

.owner-shell.is-v4-mode .main {
  background: #f3f6f9;
}

.owner-shell.is-v4-mode .content {
  width: min(100%, 1480px);
  margin-inline: auto;
  padding: 10px 24px 32px;
}

.v4-bento-dashboard {
  min-width: 0;
  display: grid;
  gap: 22px;
  isolation: isolate;
}

.v4-dashboard-intro {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 4px 8px;
}

.v4-dashboard-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -70px;
  left: 50%;
  width: min(420px, 100%);
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(51, 144, 236, 0.1), rgba(51, 144, 236, 0) 70%);
  transform: translateX(-50%);
  pointer-events: none;
}

.v4-tile-kicker i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #35c486;
  box-shadow: 0 0 0 5px rgba(53, 196, 134, 0.12);
  animation: v4LivePulse 2.2s ease-in-out infinite;
}

.v4-dashboard-intro h1 {
  margin: 0;
  color: #152231;
  font-size: clamp(36px, 4.4vw, 62px);
  font-weight: 720;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.v4-dashboard-intro h1 em {
  color: var(--v4-blue);
  font-style: normal;
}

.v4-dashboard-utility {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid #dfe6ec;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(23, 33, 43, 0.05);
}

.v4-dashboard-utility button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #536372;
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease-spring-2, ease);
}

.v4-dashboard-utility button:hover {
  background: #edf6ff;
  color: var(--v4-blue-strong);
}

.v4-dashboard-utility button:active {
  transform: scale(0.97);
}

.v4-dashboard-utility button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.v4-dashboard-utility button > span {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #dce6ee;
  font-size: 13px;
}

.v4-dashboard-utility button.is-refreshing > span {
  animation: v4RefreshSpin 900ms linear infinite;
}

.v4-bento-mosaic {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "money money money money money money money money command command command command"
    "money money money money money money money money attention attention attention attention"
    "economy economy economy economy economy economy economy economy economy economy economy economy"
    "partners partners partners partners partners partners partners partners team team team team"
    "orders orders orders orders months months months months months months months months";
  gap: 14px;
}

.v4-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe6ec;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 13px 35px rgba(29, 44, 60, 0.055);
  animation: v4TileArrive 560ms var(--ease-spring-3, cubic-bezier(0.2, 0.8, 0.2, 1)) backwards;
  transition: transform 240ms var(--ease-spring-3, ease), border-color 240ms ease, box-shadow 240ms ease;
}

.v4-bento-mosaic > :nth-child(2) { animation-delay: 45ms; }
.v4-bento-mosaic > :nth-child(3) { animation-delay: 90ms; }
.v4-bento-mosaic > :nth-child(4) { animation-delay: 135ms; }
.v4-bento-mosaic > :nth-child(5) { animation-delay: 180ms; }
.v4-bento-mosaic > :nth-child(6) { animation-delay: 225ms; }
.v4-bento-mosaic > :nth-child(7) { animation-delay: 270ms; }
.v4-bento-mosaic > :nth-child(8) { animation-delay: 315ms; }

.v4-tile-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.v4-tile-heading > div:first-child {
  min-width: 0;
}

.v4-tile-heading h2 {
  margin: 5px 0 0;
  color: #182534;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.v4-tile-heading > span {
  color: #72808d;
  font-size: 12px;
  font-weight: 650;
}

.v4-tile-heading.is-on-dark h2 {
  color: #ffffff;
}

.v4-tile-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7c8c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.is-on-dark .v4-tile-kicker {
  color: #9fb2c5;
}

.v4-private-money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.v4-private-money.is-masked {
  letter-spacing: 0.08em;
}

.v4-money-orbit {
  grid-area: money;
  min-height: 544px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 27px 28px 24px;
  border-color: #172536;
  background:
    radial-gradient(circle at 12% 8%, rgba(77, 165, 255, 0.27), transparent 31%),
    radial-gradient(circle at 90% 94%, rgba(87, 236, 184, 0.13), transparent 28%),
    #111b28;
  color: #ffffff;
  box-shadow: 0 22px 50px rgba(16, 27, 40, 0.19);
}

.v4-money-orbit::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.4) 0.7px, transparent 0.8px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(115deg, transparent 5%, #000 45%, transparent 95%);
  mask-image: linear-gradient(115deg, transparent 5%, #000 45%, transparent 95%);
  pointer-events: none;
}

.v4-money-orbit-body {
  position: relative;
  z-index: 1;
  min-height: 336px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(290px, 1.1fr);
  align-items: center;
  gap: 22px;
}

.v4-cash-anchor {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.v4-cash-anchor > strong {
  max-width: 100%;
  margin: 0 0 14px;
  color: #ffffff;
  font-size: clamp(46px, 5.3vw, 78px);
  font-weight: 730;
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.v4-cash-revenue {
  min-width: 188px;
  display: grid;
  gap: 4px;
  margin-top: 25px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
}

.v4-cash-revenue > span {
  color: #8296a9;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.v4-cash-revenue > strong {
  color: #70efba;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.v4-cash-revenue > small {
  color: #70859a;
  font-size: 12px;
}

.v4-orbit-visual {
  position: relative;
  width: min(100%, 292px);
  aspect-ratio: 1;
  justify-self: center;
}

.v4-orbit-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: conic-gradient(#55aaff var(--v4-orbit-fill), rgba(255, 255, 255, 0.09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 0);
  animation: v4OrbitBreathe 4.8s ease-in-out infinite;
}

.v4-orbit-ring::before,
.v4-orbit-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.v4-orbit-ring::before { inset: 24px; }
.v4-orbit-ring::after { inset: 49px; border-style: dashed; }

.v4-orbit-ring i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 18px rgba(101, 181, 255, 0.75);
}

.v4-orbit-ring i:nth-child(1) { top: 9%; left: 27%; }
.v4-orbit-ring i:nth-child(2) { right: 5%; top: 50%; background: #70efba; }
.v4-orbit-ring i:nth-child(3) { bottom: 10%; left: 24%; opacity: 0.55; }

.v4-orbit-center {
  position: absolute;
  inset: 70px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(10, 21, 33, 0.82);
  box-shadow: inset 0 0 35px rgba(75, 157, 235, 0.1);
}

.v4-orbit-center > span {
  color: #8197ab;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.v4-orbit-center strong {
  margin-top: 7px;
  color: #ffffff;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 720;
  letter-spacing: -0.05em;
}

.v4-orbit-visual.is-negative .v4-orbit-ring {
  background: conic-gradient(#ff8a7a var(--v4-orbit-fill), rgba(255, 255, 255, 0.09) 0);
}

.v4-orbit-chip {
  position: absolute;
  z-index: 2;
  min-width: 122px;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  background: rgba(20, 34, 49, 0.88);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.v4-orbit-chip > span {
  color: #8397aa;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.v4-orbit-chip > b {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.v4-orbit-chip.is-ruslan { top: 6px; right: -3px; }
.v4-orbit-chip.is-ruslan b { color: #88c9ff; }
.v4-orbit-chip.is-sergey { bottom: 4px; left: -8px; }
.v4-orbit-chip.is-sergey b { color: #70efba; }

.v4-forecast-equation {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 17px;
  background: rgba(5, 14, 24, 0.4);
}

.v4-forecast-equation > span {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.v4-forecast-equation > span[data-operator]::before {
  content: attr(data-operator);
  position: absolute;
  top: 50%;
  left: -7px;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111b28;
  color: #70869a;
  font-size: 12px;
  transform: translateY(-50%);
}

.v4-forecast-equation small {
  min-width: 0;
  overflow: hidden;
  color: #71869a;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.045em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.v4-forecast-equation b {
  min-width: 0;
  overflow: hidden;
  color: #d7e3ee;
  font-size: 12px;
  text-overflow: ellipsis;
}

.v4-forecast-equation .is-result {
  background: rgba(60, 147, 229, 0.14);
}

.v4-forecast-equation .is-result b {
  color: #ffffff;
}

.v4-command-dock {
  grid-area: command;
  min-height: 200px;
  padding: 22px;
  background: linear-gradient(145deg, #ffffff, #f3f8fc);
}

.v4-command-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 20px;
}

.v4-command-stack button {
  min-width: 0;
  min-height: 91px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 11px;
  border: 0;
  border-radius: 15px;
  background: #e8f4ff;
  color: #285f92;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms var(--ease-spring-3, ease), box-shadow 180ms ease;
}

.v4-command-stack button:nth-child(2) { background: #f1f4f7; color: #536d82; }
.v4-command-stack button:nth-child(3) { background: #edf7f3; color: #3f7862; }
.v4-command-stack button:nth-child(4) { background: #f5f3ef; color: #766b59; }

.v4-command-stack button > span {
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.58;
}

.v4-command-stack button > strong {
  font-size: 12px;
  font-weight: 720;
}

.v4-command-stack button > i {
  align-self: flex-end;
  font-style: normal;
  transition: transform 180ms ease;
}

.v4-command-stack button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 19px rgba(37, 77, 112, 0.1);
}

.v4-command-stack button:hover > i { transform: translate(3px, 3px); }

.v4-attention-stack {
  grid-area: attention;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 23px;
  background:
    radial-gradient(circle at 100% 0, rgba(225, 178, 64, 0.11), transparent 35%),
    #fffdf8;
  border-color: #e8e3d6;
}

.v4-attention-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.v4-attention-head h2 {
  margin: 5px 0 0;
  color: #25303b;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.v4-attention-head > strong {
  color: #c48a24;
  font-size: 46px;
  font-weight: 720;
  line-height: 0.86;
  letter-spacing: -0.07em;
}

.v4-order-slips {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0;
  margin: 14px -4px 10px;
  padding: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.v4-order-slip {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 5px;
  margin-top: -7px;
  padding: 13px 14px;
  appearance: none;
  border: 1px solid rgba(77, 66, 39, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(87, 71, 31, 0.09);
  color: inherit;
  font: inherit;
  text-align: left;
  transform: rotate(calc((var(--v4-slip) - 1) * 0.38deg));
  transition: transform 180ms var(--ease-spring-3, ease), box-shadow 180ms ease;
  cursor: pointer;
}

.v4-order-slip:first-child { margin-top: 0; }
.v4-order-slip:hover { z-index: 3; transform: translateY(-3px) rotate(0); box-shadow: 0 12px 24px rgba(87, 71, 31, 0.14); }

.v4-order-slip > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: #7d7461;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-order-slip > span b {
  color: #3a3325;
  font-size: 12px;
}

.v4-order-slip > strong {
  min-width: 0;
  overflow: hidden;
  color: #282419;
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-order-slip time {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 7px;
  background: #fff0c4;
  color: #a46800;
  font-size: 12px;
  font-weight: 750;
}

.v4-order-slip.is-red time { background: #ffe7df; color: #b44e38; }
.v4-order-slip > i { position: absolute; right: 13px; bottom: 13px; color: #8c8067; font-size: 15px; font-style: normal; }
.v4-order-slip:focus-visible { z-index: 4; outline: 3px solid rgba(51, 144, 236, .28); outline-offset: 2px; transform: translateY(-2px) rotate(0); }

.v4-order-slips.is-clear {
  place-items: center;
  flex: 1;
}

.v4-attention-clear {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.v4-attention-clear > i {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border: 1px solid #cde8d7;
  border-radius: 50%;
  background: #eaf8ef;
  color: #2aa164;
  font-size: 24px;
  font-style: normal;
  box-shadow: 0 0 0 10px rgba(42, 161, 100, 0.07);
}

.v4-attention-clear strong { font-size: 14px; }
.v4-attention-clear span { color: #81775e; font-size: 12px; }

.v4-attention-foot {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: #7d7155;
  font-size: 12px;
}

.v4-attention-foot button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
  color: #785b17;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.v4-attention-foot button i { font-style: normal; transition: transform 180ms ease; }
.v4-attention-foot button[aria-expanded="true"] i { transform: rotate(180deg); }

.v4-period-capsule {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #dde6ed;
  border-radius: 999px;
  background: #f7f9fb;
  color: #71808d !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v4-economy-map {
  grid-area: economy;
  min-height: 280px;
  padding: 25px 26px 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(51, 144, 236, 0.07), transparent 34%),
    #ffffff;
}

.v4-economy-flow {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(68px, 0.48fr) minmax(145px, 1fr) minmax(84px, 0.55fr) minmax(145px, 1fr) minmax(74px, 0.52fr) minmax(145px, 1fr) minmax(78px, 0.52fr) minmax(145px, 1fr);
  align-items: center;
  gap: 7px;
  margin-top: 24px;
}

.v4-economy-node {
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  border: 1px solid #e3e9ee;
  border-radius: 18px;
  background: #f8fafb;
}

.v4-economy-node > span {
  color: #73818e;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.055em;
  line-height: 1.3;
  text-transform: uppercase;
}

.v4-economy-node > strong {
  min-width: 0;
  margin-top: 9px;
  overflow: hidden;
  color: #1d2d3c;
  font-size: clamp(17px, 1.65vw, 24px);
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
}

.v4-economy-node > small {
  margin-top: 5px;
  color: #91a0ab;
  font-size: 12px;
}

.v4-economy-node.is-income {
  border-color: #d4e8f8;
  background: #f3f9fe;
}

.v4-economy-node.is-positive strong { color: #237b5a; }
.v4-economy-node.is-negative strong { color: #ad5548; }
.v4-economy-node.is-result { border-color: #cce4da; background: #eff8f4; }

.v4-economy-link {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.v4-economy-link > span {
  color: #8c6a5f;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.v4-economy-link > b {
  max-width: 100%;
  overflow: hidden;
  color: #a05c4f;
  font-size: 12px;
  text-overflow: ellipsis;
}

.v4-economy-link > i {
  width: 100%;
  height: 1px;
  position: relative;
  margin-top: 3px;
  background: #d7e0e7;
  color: #8da0af;
  font-size: 12px;
  font-style: normal;
  line-height: 0;
}

.v4-economy-link > i::after {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 4px solid #a9b8c3;
}

.v4-economy-link.is-neutral > span { color: #7790a3; }
.v4-economy-link.is-neutral > i { margin-top: 14px; }

.v4-order-radar {
  grid-area: orders;
  min-height: 250px;
  padding: 22px;
  border-color: #dce5ec;
  background:
    radial-gradient(circle at 5% 100%, rgba(51, 144, 236, 0.1), transparent 38%),
    #f9fbfd;
}

.v4-radar-body {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 21px;
}

.v4-radar-ring {
  width: 126px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#4b9fdb var(--v4-order-share), rgba(75, 159, 219, 0.12) 0);
  box-shadow: inset 0 0 0 1px rgba(55, 130, 185, 0.08);
}

.v4-radar-ring > div {
  width: 88px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(48, 100, 139, 0.09);
}

.v4-radar-ring strong { color: #285f88; font-size: 31px; line-height: 0.9; letter-spacing: -0.06em; }
.v4-radar-ring span { margin-top: 6px; color: #7890a2; font-size: 12px; font-weight: 750; text-transform: uppercase; }

.v4-status-cloud {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.v4-status-cloud > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #657a8a;
  font-size: 12px;
}

.v4-status-cloud i { width: 7px; height: 7px; border-radius: 50%; background: #7e9caf; }
.v4-status-cloud .is-status-1 i { background: #4b9fdc; }
.v4-status-cloud .is-status-2 i { background: #e8a649; }
.v4-status-cloud .is-status-3 i { background: #4fbd8b; }
.v4-status-cloud b { color: #2d4150; font-size: 12px; }

.v4-partner-ledger {
  grid-area: partners;
  min-height: 514px;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(51, 144, 236, 0.065), transparent 34%),
    #ffffff;
}

.v4-partner-total {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid #dce8f1;
  border-radius: 999px;
  background: #f3f8fc;
  color: #4c6a80 !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

.v4-partner-cards {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 21px;
}

.v4-partner-card {
  min-width: 0;
  min-height: 416px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #dfe7ed;
  border-radius: 21px;
  background: #fafcfd;
}

.v4-partner-card.is-negative { border-color: #eeddd8; }

.v4-partner-card > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v4-partner-card > header > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.v4-partner-card > header > div > span {
  color: #6f7f8c;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.v4-partner-card > header strong {
  min-width: 0;
  overflow: hidden;
  color: #1d3446;
  font-size: clamp(24px, 2.5vw, 35px);
  line-height: 1;
  letter-spacing: -0.055em;
  text-overflow: ellipsis;
}

.v4-partner-card.is-negative > header strong { color: #a85246; }

.v4-partner-card > header > i {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #d2e4f2;
  border-radius: 14px;
  background: #edf7ff;
  color: #2b81c8;
  font-size: 14px;
  font-style: normal;
  font-weight: 780;
}

.v4-partner-card:nth-child(2) > header > i {
  border-color: #d8e8e0;
  background: #eff8f4;
  color: #3e8265;
}

.v4-partner-formula {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 9px;
  border: 1px solid #e4eaef;
  border-radius: 15px;
  background: #ffffff;
}

.v4-partner-formula > span {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 4px;
  min-height: 57px;
  align-content: center;
  padding: 8px 9px;
  border-radius: 11px;
  background: #f5f8fa;
}

.v4-partner-formula .is-result {
  grid-column: 1 / -1;
  background: #edf7f2;
}

.v4-partner-formula > span[data-operator]::before {
  content: attr(data-operator);
  position: absolute;
  top: 50%;
  left: -7px;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #9aabb7;
  font-size: 12px;
  transform: translateY(-50%);
}

.v4-partner-formula small,
.v4-partner-formula b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-partner-formula small { color: #8a97a1; font-size: 12px; font-weight: 740; text-transform: uppercase; }
.v4-partner-formula b { color: #405566; font-size: 12px; }
.v4-partner-formula .is-result b { color: #267b5b; }

.v4-partner-lines {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.v4-partner-lines > span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f2f5f7;
}

.v4-partner-lines small {
  min-width: 0;
  overflow: hidden;
  color: #7c8b97;
  font-size: 12px;
  font-weight: 710;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-partner-lines b {
  min-width: 0;
  overflow: hidden;
  color: #344a5b;
  font-size: 12px;
  text-overflow: ellipsis;
}

.v4-partner-lines .is-warning b { color: #94692f; }

.v4-team-pod {
  grid-area: team;
  min-height: 514px;
  display: flex;
  flex-direction: column;
  padding: 23px;
  border-color: #cfe2f1;
  background:
    radial-gradient(circle at 100% 0, rgba(51, 144, 236, 0.2), transparent 37%),
    linear-gradient(155deg, #f4faff, #eaf4fc);
}

.v4-team-core {
  min-height: 0;
  display: grid;
  gap: 19px;
  margin-top: 24px;
}

.v4-team-reserve {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  border: 1px solid rgba(61, 133, 191, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.85), transparent 32%),
    #ddecf8;
}

.v4-team-reserve > span { color: #66839a; font-size: 12px; font-weight: 780; letter-spacing: 0.06em; text-transform: uppercase; }
.v4-team-reserve strong { margin-top: 8px; color: #173c59; font-size: clamp(24px, 2.7vw, 36px); letter-spacing: -0.055em; }
.v4-team-reserve small { margin-top: 4px; color: #7690a4; font-size: 12px; }

.v4-team-people {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.v4-team-person {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.67);
  transition: background 180ms ease, transform 180ms var(--ease-spring-2, ease);
}

.v4-team-person:hover { transform: translateX(3px); background: #ffffff; }

.v4-team-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #3390ec;
  color: #ffffff;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 7px 14px rgba(51, 144, 236, 0.2);
}

.v4-team-person:nth-child(2) .v4-team-avatar { background: #7b6ddd; box-shadow: 0 7px 14px rgba(123, 109, 221, 0.18); }
.v4-team-person:nth-child(3) .v4-team-avatar { background: #ef8e70; box-shadow: 0 7px 14px rgba(239, 142, 112, 0.18); }
.v4-team-person:nth-child(4) .v4-team-avatar { background: #45ae81; box-shadow: 0 7px 14px rgba(69, 174, 129, 0.18); }

.v4-team-person > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.v4-team-person > span:nth-child(2) strong,
.v4-team-person > span:nth-child(2) small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-team-person > span:nth-child(2) strong { color: #25455c; font-size: 12px; }
.v4-team-person > span:nth-child(2) small { color: #7890a1; font-size: 12px; }

.v4-team-person > i {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(44, 104, 148, 0.12);
}

.v4-team-person > i b { display: block; height: 100%; border-radius: inherit; background: #3390ec; animation: v4FlowGrow 700ms var(--ease-spring-3, ease) backwards; }

.v4-team-empty { padding: 24px; color: #7990a1; text-align: center; font-size: 12px; }

.v4-team-foot {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid rgba(55, 112, 153, 0.12);
}

.v4-team-foot > span { color: #6e899c; font-size: 12px; font-weight: 750; text-transform: uppercase; }
.v4-team-foot strong { overflow: hidden; color: #214b69; font-size: 17px; text-overflow: ellipsis; }

.v4-month-rhythm {
  grid-area: months;
  min-height: 365px;
  padding: 22px 24px 17px;
  background:
    linear-gradient(rgba(223, 230, 236, 0.35) 1px, transparent 1px),
    #ffffff;
  background-size: 100% 42px;
}

.v4-month-bars {
  min-width: 0;
  height: 244px;
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  align-items: end;
  gap: 8px;
  margin-top: 14px;
}

.v4-month-bars > button {
  position: relative;
  min-width: 0;
  height: 240px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 5px;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #71818e;
  font: inherit;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.v4-month-bars > button:hover,
.v4-month-bars > button:focus {
  z-index: 10;
  background: linear-gradient(180deg, transparent 0 45%, rgba(238, 246, 252, 0.82) 45%);
  color: #2d79b8;
}

.v4-month-popover {
  position: absolute;
  z-index: 8;
  top: 8px;
  left: 50%;
  width: 230px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(17, 27, 40, 0.96);
  color: #dce7f0;
  box-shadow: 0 13px 26px rgba(17, 27, 40, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.98);
  transition: opacity 150ms ease, transform 180ms var(--ease-spring-2, ease);
}

.v4-month-bars > button:first-child .v4-month-popover { left: 0; transform: translate(0, 6px) scale(0.98); }
.v4-month-bars > button:last-child .v4-month-popover { right: 0; left: auto; transform: translate(0, 6px) scale(0.98); }

.v4-month-popover > strong {
  grid-column: 1 / -1;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  text-align: left;
}

.v4-month-popover > span {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 3px;
  color: #91a6b8;
  font-size: 12px;
  font-weight: 690;
}

.v4-month-popover b {
  overflow: hidden;
  color: #e8f0f6;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .v4-month-bars > button:hover .v4-month-popover,
  .v4-month-bars > button:focus-visible .v4-month-popover {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  .v4-month-bars > button:first-child:hover .v4-month-popover,
  .v4-month-bars > button:first-child:focus-visible .v4-month-popover,
  .v4-month-bars > button:last-child:hover .v4-month-popover,
  .v4-month-bars > button:last-child:focus-visible .v4-month-popover {
    transform: translate(0, 0) scale(1);
  }

  .v4-month-bars > button:hover .v4-month-columns,
  .v4-month-bars > button:focus-visible .v4-month-columns {
    opacity: 0.16;
  }
}

@media (hover: none) {
  .v4-month-bars > button:focus .v4-month-popover {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  .v4-month-bars > button:first-child:focus .v4-month-popover,
  .v4-month-bars > button:last-child:focus .v4-month-popover {
    transform: translate(0, 0) scale(1);
  }

  .v4-month-bars > button:focus .v4-month-columns {
    opacity: 0.16;
  }
}

.v4-month-columns {
  width: 100%;
  height: 86px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.v4-month-columns i {
  width: min(18px, 32%);
  height: var(--v4-income-height);
  min-height: 5px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #5ab5ff, #3390ec);
  transform-origin: bottom;
  animation: v4BarRise 650ms var(--ease-spring-3, ease) backwards;
}

.v4-month-columns i:last-child {
  height: var(--v4-expense-height);
  background: linear-gradient(180deg, #ffb29e, #e98370);
  animation-delay: 80ms;
}

.v4-month-bars button > strong { justify-self: center; font-size: 12px; }
.v4-month-bars button > small { justify-self: center; color: #98a4ad; font-size: 12px; }

.v4-month-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 9px;
  color: #82909b;
  font-size: 12px;
}

.v4-month-legend span { display: inline-flex; align-items: center; gap: 5px; }
.v4-month-legend i { width: 7px; height: 7px; border-radius: 3px; background: #3390ec; }
.v4-month-legend i.is-outflow { background: #e98370; }
.v4-month-empty { grid-column: 1 / -1; align-self: center; color: #8795a1; text-align: center; font-size: 12px; }

.v4-zone-money,
.v4-zone-economy,
.v4-zone-partners,
.v4-zone-team {
  scroll-margin-top: 178px;
}

.v4-bento-dashboard button:focus-visible {
  outline: 3px solid rgba(51, 144, 236, 0.27);
  outline-offset: 2px;
}

@media (hover: hover) {
  .v4-tile:not(.v4-money-orbit):hover {
    transform: translateY(-3px);
    border-color: #cbdce9;
    box-shadow: 0 18px 42px rgba(29, 44, 60, 0.095);
  }

  .v4-money-orbit:hover {
    transform: translateY(-2px);
    box-shadow: 0 27px 58px rgba(16, 27, 40, 0.24);
  }
}

@keyframes v4TileArrive {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes v4LivePulse {
  0%, 100% { transform: scale(0.86); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes v4OrbitBreathe {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(85, 170, 255, 0.08)); transform: scale(0.99); }
  50% { filter: drop-shadow(0 0 15px rgba(85, 170, 255, 0.2)); transform: scale(1.01); }
}

@keyframes v4FlowGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes v4BarRise {
  from { transform: scaleY(0); opacity: 0.4; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes v4RefreshSpin {
  to { transform: rotate(360deg); }
}

.v4-bento-placeholder {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(30px, 6vw, 72px);
  border: 1px solid var(--v4-line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(23, 33, 43, 0.045);
}

.v4-bento-placeholder > span {
  color: var(--v4-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v4-bento-placeholder h1 {
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.055em;
}

.v4-bento-placeholder p {
  max-width: 560px;
  margin: 16px 0 24px;
  color: var(--v4-muted);
  font-size: 15px;
  line-height: 1.6;
}

.v4-bento-placeholder button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 13px;
  background: var(--v4-blue);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* V4 Orders — independent Bento composition. */
.v4-orders-page,
.v4-order-workspace,
.v4-order-editor {
  min-width: 0;
  color: var(--v4-ink);
  font-family: "Golos Text", Inter, ui-sans-serif, system-ui, sans-serif;
  animation: v4OrderPageIn 420ms var(--ease-spring-3, ease) both;
}

.v4-orders-page :where(button, input, select, textarea),
.v4-order-workspace :where(button, input, select, textarea),
.v4-order-editor :where(button, input, select, textarea) {
  font: inherit;
}

.v4-orders-page :where(button, [role="button"]),
.v4-order-workspace :where(button, [role="button"]),
.v4-order-editor :where(button, [role="button"]) {
  -webkit-tap-highlight-color: transparent;
}

.v4-orders-page :where(button, [role="button"]):focus-visible,
.v4-order-workspace :where(button, [role="button"]):focus-visible,
.v4-order-editor :where(button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(51, 144, 236, 0.24);
  outline-offset: 3px;
}

.v4-orders-intro {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 4px 25px;
}

.v4-orders-title-block { min-width: 0; }

.v4-orders-kicker,
.v4-order-workspace-head > div > span,
.v4-order-editor-head > div > span {
  display: block;
  color: var(--v4-blue);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.v4-orders-title-block h1,
.v4-order-workspace-head h1,
.v4-order-editor-head h1 {
  margin: 5px 0 0;
  color: #152231;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 720;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.v4-orders-title-block p {
  margin: 12px 0 0;
  color: #71808e;
  font-size: 15px;
  line-height: 1.45;
}

.v4-orders-title-block p strong { color: #27394a; }

.v4-orders-create {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 17px 10px 10px;
  border: 0;
  border-radius: 17px;
  background: var(--v4-blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 13px 28px rgba(51, 144, 236, 0.2);
  cursor: pointer;
  transition: transform 180ms var(--ease-spring-3, ease), box-shadow 180ms ease;
}

.v4-orders-create > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 22px;
  font-weight: 400;
}

.v4-order-filter-dock {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.v4-filter-status-tile,
.v4-filter-focus-tile,
.v4-filter-control-tile,
.v4-filter-advanced,
.v4-active-filter-line {
  min-width: 0;
  border: 1px solid var(--v4-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 9px 25px rgba(23, 33, 43, 0.045);
}

.v4-filter-status-tile {
  grid-column: span 6;
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 16px 17px;
  border-radius: 22px;
}

.v4-filter-focus-tile {
  grid-column: span 4;
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 16px 17px;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f4f9fd);
}

.v4-filter-control-tile {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 5px 10px;
  padding: 14px;
  border-radius: 22px;
}

.v4-filter-label,
.v4-filter-option > span {
  color: #71808d;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.v4-filter-statuses,
.v4-filter-focuses {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.v4-filter-statuses::-webkit-scrollbar,
.v4-filter-focuses::-webkit-scrollbar { display: none; }

.v4-filter-statuses button,
.v4-filter-focuses button {
  min-height: 37px;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #e1e8ed;
  border-radius: 11px;
  background: #f7f9fb;
  color: #62717e;
  font-size: 14px;
  font-weight: 620;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.v4-filter-statuses button.is-active,
.v4-filter-focuses button.is-active {
  border-color: #bdddf5;
  background: var(--v4-blue-soft);
  color: var(--v4-blue-strong);
}

.v4-filter-focuses button.is-warning {
  border-color: #ead9aa;
  background: #fff8e7;
  color: #94692f;
}

.v4-filter-focuses button.is-danger {
  border-color: #eed5cf;
  background: #fff0ec;
  color: #ad5548;
}

.v4-filter-control-tile > strong {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  color: #263a4c;
  font-size: 29px;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.v4-filter-control-tile > div {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.v4-filter-control-tile > div button {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  background: #f2f6f9;
  color: #526778;
  font-size: 14px;
  cursor: pointer;
}

.v4-filter-control-tile > div button.is-active { background: var(--v4-blue-soft); color: var(--v4-blue-strong); }
.v4-filter-control-tile button i { font-style: normal; }
.v4-filter-control-tile button b { min-width: 22px; text-align: right; }

.v4-filter-advanced {
  position: relative;
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 22px;
  animation: v4FilterOpen 230ms var(--ease-spring-3, ease) both;
}

.v4-filter-advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.v4-filter-option {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e7ecf0;
  border-radius: 14px;
  background: #f9fbfc;
}

.v4-filter-option > span { font-size: 13px; }

.v4-filter-option > button {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #435768;
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #e0e7ec;
}

.v4-filter-option > button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-filter-option > button i { color: #8b9aa5; font-style: normal; }
.v4-filter-option > button.is-active { background: var(--v4-blue-soft); color: var(--v4-blue-strong); box-shadow: inset 0 0 0 1px #cde5f8; }

.v4-filter-menu {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #d6e4ee;
  border-radius: 17px;
  background: #ffffff;
  box-shadow: 0 17px 35px rgba(23, 44, 61, 0.11);
}

.v4-filter-menu > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v4-filter-menu > header > div { display: grid; gap: 2px; }
.v4-filter-menu > header span { color: #8795a0; font-size: 13px; text-transform: uppercase; }
.v4-filter-menu > header strong { color: #263b4d; font-size: 16px; }
.v4-filter-menu > header button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #f2f5f7; color: #647480; font-size: 22px; cursor: pointer; }

.v4-filter-menu > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 240px;
  overflow-y: auto;
}

.v4-filter-menu > div button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #e1e8ed;
  border-radius: 11px;
  background: #f7f9fb;
  color: #5b6d7b;
  font-size: 14px;
  cursor: pointer;
}

.v4-filter-menu > div button.is-active { border-color: #b9daf3; background: var(--v4-blue-soft); color: var(--v4-blue-strong); }

.v4-active-filter-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 17px;
  scrollbar-width: thin;
}

.v4-active-filter-line > span { flex: 0 0 auto; color: #7c8994; font-size: 14px; }

.v4-active-filter-line button {
  min-height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border: 1px solid #d9e7f1;
  border-radius: 10px;
  background: #f2f8fd;
  color: #526b7e;
  font-size: 14px;
  cursor: pointer;
}

.v4-active-filter-line button i { margin-left: 3px; color: #8699a8; font-size: 18px; font-style: normal; line-height: 0.8; }
.v4-active-filter-line button.is-reset { margin-left: auto; border-color: transparent; background: transparent; color: #ad5548; }

.v4-order-card-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.v4-order-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid #dfe6ec;
  border-radius: 25px;
  background: #ffffff;
  box-shadow: 0 11px 29px rgba(29, 44, 60, 0.052);
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 430px;
  animation: v4OrderCardIn 440ms var(--ease-spring-3, ease) calc(var(--v4-order-index) * 28ms) both;
  transition: transform 210ms var(--ease-spring-3, ease), border-color 210ms ease, box-shadow 210ms ease;
}

.v4-order-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  width: 66px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--v4-blue);
}

.v4-order-card.is-overdue::before { background: #e98370; }

.v4-order-card-head {
  min-width: 0;
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
}

.v4-order-card-head > div { min-width: 0; }
.v4-order-number { color: #7a8995; font-size: 14px; font-weight: 700; }

.v4-order-card-head h2 {
  min-width: 0;
  margin: 4px 0 0;
  overflow: hidden;
  color: #172636;
  font-size: 22px;
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-order-status {
  min-height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #dde6ed;
  border-radius: 11px;
  background: #f3f6f8;
  color: #61727f;
  font-size: 14px;
  font-weight: 690;
  white-space: nowrap;
}

.v4-order-status.status-new { border-color: #cfe5f5; background: #edf7ff; color: #2b81c8; }
.v4-order-status.status-work { border-color: #bcdcf4; background: #e8f4ff; color: #286faa; }
.v4-order-status.status-ready { border-color: #d7e8df; background: #eff8f4; color: #3e8265; }
.v4-order-status.status-done { border-color: #cee5d9; background: #eaf8ef; color: #2b8158; }
.v4-order-status.status-cancel { border-color: #edd9d4; background: #fff0ec; color: #ad5548; }

.v4-order-people {
  min-width: 0;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 15px;
  background: #f5f8fa;
}

.v4-order-people > span { min-width: 0; display: grid; gap: 2px; }
.v4-order-people > span small { color: #8997a2; font-size: 13px; }
.v4-order-people > span strong { overflow: hidden; color: #3c5263; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-people > i { width: 1px; height: 30px; flex: 0 0 auto; background: #dde5ea; }

.v4-order-unread {
  margin-left: auto;
  padding: 6px 8px;
  border-radius: 9px;
  background: var(--v4-blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.v4-order-task-block {
  min-width: 0;
  min-height: 116px;
  grid-column: span 7;
  padding: 14px;
  border: 1px solid #e3e9ee;
  border-radius: 17px;
  background: #fafcfd;
}

.v4-order-task-block > span,
.v4-order-contact-block small,
.v4-order-finance-block small {
  color: #83919c;
  font-size: 13px;
  font-weight: 710;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v4-order-task-block p {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: #263746;
  font-size: 16px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.v4-order-contact-block {
  min-width: 0;
  grid-column: span 5;
  display: grid;
  gap: 7px;
}

.v4-order-contact-block > span,
.v4-order-contact-block > button,
.v4-order-contact-block > time {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  background: #f3f8fc;
  color: #334c5f;
  text-align: left;
}

.v4-order-contact-block > button { cursor: copy; }
.v4-order-contact-block small { grid-column: 1 / -1; }
.v4-order-contact-block strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-contact-block i { color: var(--v4-blue); font-size: 17px; font-style: normal; }
.v4-order-contact-block time.is-red { background: #fff0ec; color: #ad5548; }
.v4-order-contact-block time.is-amber { background: #fff8e7; color: #94692f; }
.v4-order-contact-block time.is-green { background: #eff8f4; color: #3e8265; }

.v4-order-finance-block {
  min-width: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid #dce7ef;
  border-radius: 17px;
  background: #f3f8fc;
}

.v4-order-finance-block > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 11px;
  background: #ffffff;
}

.v4-order-finance-block strong { min-width: 0; overflow: hidden; color: #263a4a; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-finance-block .is-warning strong { color: #94692f; }
.v4-order-finance-block .is-positive strong,
.v4-order-finance-block .is-profit strong { color: #267b5b; }
.v4-order-finance-block .is-secondary { background: #f7f9fa; }

.v4-order-open-cue {
  grid-column: 1 / -1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #718493;
  font-size: 14px;
  font-weight: 650;
}

.v4-order-open-cue i { color: var(--v4-blue); font-style: normal; transition: transform 180ms ease; }

.v4-orders-empty {
  min-height: 340px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  border: 1px solid #dfe6ec;
  border-radius: 26px;
  background: #ffffff;
  text-align: center;
}

.v4-orders-empty > span { color: #d6e4ef; font-size: 72px; font-weight: 720; line-height: 1; }
.v4-orders-empty h2 { margin: 8px 0 0; font-size: 24px; }
.v4-orders-empty p { max-width: 440px; margin: 10px 0 18px; color: #738391; font-size: 15px; line-height: 1.55; }
.v4-orders-empty button { min-height: 44px; padding: 9px 14px; border: 0; border-radius: 13px; background: var(--v4-blue-soft); color: var(--v4-blue-strong); font-size: 14px; font-weight: 700; cursor: pointer; }

.v4-order-workspace-head,
.v4-order-editor-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  padding: 12px 4px 24px;
}

.v4-order-back {
  min-height: 44px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #dce5eb;
  border-radius: 13px;
  background: #ffffff;
  color: #536675;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.v4-order-back span { color: var(--v4-blue); font-size: 19px; }

.v4-order-workspace-head h1,
.v4-order-editor-head h1 {
  overflow: hidden;
  font-size: clamp(32px, 4vw, 50px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-order-workspace-actions,
.v4-order-editor-head > div:last-child,
.v4-order-editor-foot > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.v4-order-workspace-actions button,
.v4-order-editor-head > div:last-child button,
.v4-order-editor-foot button {
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #dce5eb;
  border-radius: 12px;
  background: #ffffff;
  color: #506474;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.v4-order-workspace-actions button.is-primary,
.v4-order-editor-head button.is-primary,
.v4-order-editor-foot button.is-primary { border-color: var(--v4-blue); background: var(--v4-blue); color: #ffffff; }
.v4-order-workspace-actions button.is-danger { border-color: #edd9d4; background: #fff5f2; color: #ad5548; }

.v4-order-workspace-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "task task task task task task task control control control control control"
    "finance finance finance finance finance finance finance contact contact contact contact contact"
    "thread thread thread thread thread thread thread ledger ledger ledger ledger ledger"
    "thread thread thread thread thread thread thread history history history history history";
  gap: 14px;
}

.v4-order-space-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe6ec;
  border-radius: 25px;
  background: #ffffff;
  box-shadow: 0 12px 31px rgba(29, 44, 60, 0.052);
  animation: v4OrderCardIn 430ms var(--ease-spring-3, ease) both;
}

.v4-order-space-tile > header,
.v4-order-thread-tile .v4-thread-surface > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v4-order-space-tile > header > span,
.v4-order-space-tile > header > div > span,
.v4-order-thread-tile .v4-thread-surface > header span {
  color: #748592;
  font-size: 14px;
  font-weight: 740;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v4-order-space-tile > header > strong,
.v4-order-space-tile > header > div > strong,
.v4-order-thread-tile .v4-thread-surface > header strong {
  color: #2b4253;
  font-size: 15px;
}

.v4-order-task-tile { grid-area: task; min-height: 255px; padding: 23px; background: linear-gradient(145deg, #ffffff, #f7fafc); }
.v4-order-task-tile > p { margin: 25px 0 0; color: #1d2e3d; font-size: clamp(22px, 2vw, 31px); font-weight: 570; line-height: 1.35; letter-spacing: -0.025em; white-space: pre-wrap; }
.v4-order-task-tile > div { margin-top: 24px; padding: 15px; border-radius: 15px; background: #f1f5f8; }
.v4-order-task-tile > div span { color: #7d8c97; font-size: 14px; font-weight: 700; }
.v4-order-task-tile > div p { margin: 7px 0 0; color: #465b6b; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }

.v4-order-control-tile { grid-area: control; min-height: 255px; padding: 22px; }
.v4-order-deadline-focus { display: grid; gap: 4px; margin: 19px 0 16px; padding: 14px; border-radius: 16px; background: #f3f8fc; }
.v4-order-deadline-focus span { color: #7790a2; font-size: 14px; }
.v4-order-deadline-focus strong { color: #25455c; font-size: 24px; letter-spacing: -0.04em; }
.v4-order-deadline-focus small { color: #8395a2; font-size: 14px; }
.v4-order-deadline-focus.is-red { background: #fff0ec; }
.v4-order-deadline-focus.is-red strong { color: #ad5548; }
.v4-order-deadline-focus.is-amber { background: #fff8e7; }
.v4-order-deadline-focus.is-amber strong { color: #94692f; }
.v4-order-deadline-focus.is-green { background: #eff8f4; }
.v4-order-deadline-focus.is-green strong { color: #3e8265; }

.v4-order-status-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.v4-order-status-flow button { min-height: 36px; padding: 7px 10px; border: 1px solid #e0e7ec; border-radius: 10px; background: #f7f9fa; color: #5a6d7b; font-size: 14px; cursor: pointer; }
.v4-order-status-flow button.is-active { border-color: #b8daf3; background: var(--v4-blue-soft); color: var(--v4-blue-strong); }
.v4-order-status-flow button.is-cancel { margin-left: auto; border-color: #edd9d4; color: #ad5548; }
.v4-order-status-flow button:disabled { cursor: default; opacity: 1; }

.v4-order-finance-tile {
  grid-area: finance;
  min-height: 395px;
  padding: 24px;
  border-color: #172536;
  background: radial-gradient(circle at 8% 0, rgba(77, 165, 255, 0.24), transparent 35%), #111b28;
  color: #ffffff;
  box-shadow: 0 20px 45px rgba(16, 27, 40, 0.18);
}

.v4-order-finance-tile > header > div { display: grid; gap: 4px; }
.v4-order-finance-tile > header > div span { color: #9fb2c5; }
.v4-order-finance-tile > header > div strong { color: #ffffff; }
.v4-order-finance-tile > header > i { padding: 7px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); color: #88c9ff; font-size: 14px; font-style: normal; }
.v4-order-finance-hero { display: grid; gap: 3px; margin-top: 27px; }
.v4-order-finance-hero span { color: #8197ab; font-size: 14px; }
.v4-order-finance-hero strong { color: #ffffff; font-size: clamp(39px, 4.2vw, 61px); line-height: 1; letter-spacing: -0.07em; }
.v4-order-finance-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr) auto) minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 25px; }
.v4-order-finance-flow > span { min-width: 0; display: grid; gap: 5px; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.055); }
.v4-order-finance-flow small,
.v4-order-finance-details small { color: #8296a9; font-size: 13px; }
.v4-order-finance-flow strong,
.v4-order-finance-details strong { min-width: 0; overflow: hidden; color: #dbe7f1; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-finance-flow > i { color: #62798d; font-style: normal; }
.v4-order-finance-flow .is-warning strong { color: #fff0c4; }
.v4-order-finance-flow .is-positive strong,
.v4-order-finance-flow .is-result strong { color: #70efba; }
.v4-order-finance-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 9px; }
.v4-order-finance-details > span { min-width: 0; display: grid; gap: 5px; padding: 10px 11px; border: 1px solid rgba(255,255,255,.075); border-radius: 13px; background: rgba(5,14,24,.35); }

.v4-order-contact-tile { grid-area: contact; min-height: 395px; padding: 22px; background: linear-gradient(145deg, #ffffff, #f3f8fc); }
.v4-order-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 19px; }
.v4-order-contact-grid > span { min-width: 0; display: grid; gap: 4px; padding: 11px; border: 1px solid #e3e9ee; border-radius: 14px; background: rgba(255,255,255,.85); }
.v4-order-contact-grid small,
.v4-order-copy-contact small { color: #84939f; font-size: 13px; }
.v4-order-contact-grid strong,
.v4-order-copy-contact strong { min-width: 0; overflow: hidden; color: #314859; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-copy-contact { width: 100%; min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; padding: 11px; border: 1px solid #cfe4f4; border-radius: 15px; background: var(--v4-blue-soft); color: #2b81c8; text-align: left; cursor: copy; }
.v4-order-copy-contact > span { min-width: 0; display: grid; gap: 3px; }
.v4-order-copy-contact > i { flex: 0 0 auto; font-size: 14px; font-style: normal; font-weight: 650; }
.v4-order-copy-contact.is-empty { cursor: default; }

.v4-order-thread-tile { grid-area: thread; min-height: 660px; }
.v4-thread-surface { min-height: 660px; display: grid; grid-template-rows: auto auto minmax(220px, 1fr) auto auto; }
.v4-thread-surface > header { padding: 22px 22px 17px; }
.v4-thread-surface > header > div { display: grid; gap: 4px; }
.v4-thread-surface > header > b { color: #718493; font-size: 14px; font-weight: 650; }
.v4-order-thread-tile .thread-retention { margin: 0 18px 10px; border-radius: 13px; font-size: 14px; }
.v4-order-thread-tile .v4-thread-timeline { min-height: 250px; max-height: 470px; padding: 16px 18px; border-block: 1px solid #e7edf1; background: #f7fafc; }
.v4-order-thread-tile .thread-item { font-size: 14px; }
.v4-order-thread-tile .thread-item-meta strong,
.v4-order-thread-tile .thread-item-meta span,
.v4-order-thread-tile .thread-file-card > div small { font-size: 13px; }
.v4-order-thread-tile .thread-item > p,
.v4-order-thread-tile .thread-file-card > div strong { font-size: 15px; }
.v4-order-thread-tile .thread-upload-progress { margin: 10px 18px 0; border-radius: 13px; }
.v4-order-thread-tile .thread-upload-progress > div { font-size: 13px; }
.v4-order-thread-tile .v4-thread-composer { position: static; padding: 14px 18px 18px; border: 0; background: #ffffff; }
.v4-order-thread-tile .v4-thread-composer .textarea { min-height: 82px; border-color: #dce6ed; border-radius: 14px; background: #f8fafb; color: #253847; font-size: 15px; }
.v4-order-thread-tile .thread-composer-actions .button { min-height: 42px; border-radius: 12px; font-size: 14px; }

.v4-thread-state { min-height: 330px; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 30px; color: #758895; text-align: center; }
.v4-thread-state > i { width: 40px; height: 40px; margin-bottom: 5px; border: 3px solid #dbe8f2; border-top-color: var(--v4-blue); border-radius: 50%; animation: v4RefreshSpin 900ms linear infinite; }
.v4-thread-state strong { color: #334c5e; font-size: 17px; }
.v4-thread-state span { font-size: 14px; }
.v4-thread-state.is-error strong { color: #ad5548; }
.v4-thread-state button { min-height: 40px; margin-top: 6px; padding: 8px 12px; border: 0; border-radius: 11px; background: var(--v4-blue-soft); color: var(--v4-blue-strong); font-size: 14px; cursor: pointer; }

.v4-order-ledger-tile { grid-area: ledger; min-height: 330px; padding: 22px; }
.v4-order-history-tile { grid-area: history; min-height: 315px; padding: 22px; }
.v4-order-ledger-list,
.v4-order-history-list { display: grid; gap: 0; margin-top: 17px; }
.v4-order-ledger-list > div,
.v4-order-history-list > div { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #edf1f4; }
.v4-order-ledger-list > div:last-child,
.v4-order-history-list > div:last-child { border-bottom: 0; }
.v4-order-ledger-list i,
.v4-order-history-list i { width: 8px; height: 8px; border-radius: 50%; background: #8ba4b6; }
.v4-order-ledger-list .is-income i { background: #3390ec; }
.v4-order-ledger-list .is-expense i { background: #e98370; }
.v4-order-ledger-list span,
.v4-order-history-list span { min-width: 0; display: grid; gap: 3px; }
.v4-order-ledger-list span strong,
.v4-order-history-list span strong { min-width: 0; overflow: hidden; color: #354b5b; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-ledger-list span small,
.v4-order-history-list span small { color: #8795a0; font-size: 13px; }
.v4-order-ledger-list > div > b { color: #2d4354; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v4-order-ledger-list .is-income > b { color: #267b5b; }
.v4-order-ledger-list .is-expense > b { color: #ad5548; }
.v4-order-history-list > div > b { max-width: 100px; overflow: hidden; padding: 5px 7px; border-radius: 8px; background: #f1f5f7; color: #71818d; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-ledger-empty,
.v4-order-history-empty { min-height: 180px; display: grid; place-content: center; color: #7c8d99; font-size: 14px; text-align: center; }

.v4-order-editor > form { min-width: 0; }
.v4-order-editor-grid { min-width: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.v4-editor-tile { min-width: 0; margin: 0; padding: 21px; border: 1px solid #dfe6ec; border-radius: 24px; background: #ffffff; box-shadow: 0 12px 30px rgba(29,44,60,.05); }
.v4-editor-tile legend { display: flex; align-items: center; gap: 9px; padding: 0 8px; color: #2b4253; font-size: 17px; font-weight: 700; }
.v4-editor-tile legend span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--v4-blue-soft); color: var(--v4-blue-strong); font-size: 13px; }
.v4-editor-client { grid-column: span 7; }
.v4-editor-work { grid-column: span 5; }
.v4-editor-responsibility { grid-column: span 4; }
.v4-editor-timing { grid-column: span 4; }
.v4-editor-money { grid-column: span 4; }
.v4-editor-fields { display: grid; gap: 11px; margin-top: 10px; }
.v4-editor-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v4-editor-field { min-width: 0; display: grid; gap: 7px; margin-top: 11px; }
.v4-editor-field > span { color: #657987; font-size: 14px; font-weight: 650; }
.v4-editor-field input,
.v4-editor-field select,
.v4-editor-field textarea { width: 100%; min-width: 0; min-height: 45px; padding: 10px 12px; border: 1px solid #dce5eb; border-radius: 12px; outline: 0; background: #f8fafb; color: #213442; font-size: 15px; line-height: 1.45; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.v4-editor-field textarea { resize: vertical; }
.v4-editor-field input:focus,
.v4-editor-field select:focus,
.v4-editor-field textarea:focus { border-color: #9bcdf5; background: #ffffff; box-shadow: 0 0 0 4px rgba(51,144,236,.1); }
.v4-editor-money > p { margin: 16px 0 0; padding: 12px; border-radius: 13px; background: #f2f7fb; color: #627887; font-size: 14px; line-height: 1.5; }
.v4-order-editor-foot { position: sticky; z-index: 20; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 15px; padding: 10px 12px 10px 16px; border: 1px solid #dce5eb; border-radius: 17px; background: rgba(255,255,255,.92); box-shadow: 0 15px 35px rgba(23,33,43,.12); backdrop-filter: blur(16px); }
.v4-order-editor-foot > span { color: #758693; font-size: 14px; }

#orderDialog.v4-delete-order-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; overflow: visible; border: 0; border-radius: 25px; background: transparent; }
#orderDialog.v4-delete-order-dialog::backdrop { background: rgba(17,27,40,.36); backdrop-filter: blur(5px); }
.v4-delete-order-shell { padding: 25px; border: 1px solid #e3e8ec; border-radius: 25px; background: #ffffff; box-shadow: 0 25px 65px rgba(17,27,40,.24); }
.v4-delete-order-shell > span { color: #ad5548; font-size: 14px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.v4-delete-order-shell h2 { margin: 7px 0 0; color: #1c2c3a; font-size: 27px; letter-spacing: -.04em; }
.v4-delete-order-shell > p { margin: 8px 0 0; color: #6e7e8a; font-size: 15px; }
.v4-delete-order-shell > div { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 20px; }
.v4-delete-order-shell > div span { display: grid; gap: 4px; padding: 13px; border-radius: 14px; background: #f3f6f8; }
.v4-delete-order-shell > div small { color: #7b8b96; font-size: 14px; }
.v4-delete-order-shell > div strong { color: #2c4151; font-size: 24px; }
.v4-delete-order-shell > p.is-warning { padding: 12px; border-radius: 13px; background: #fff0ec; color: #ad5548; line-height: 1.45; }
.v4-delete-order-shell footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.v4-delete-order-shell footer button { min-height: 43px; padding: 9px 13px; border: 1px solid #dce5eb; border-radius: 12px; background: #ffffff; color: #556875; font-size: 14px; font-weight: 650; cursor: pointer; }
.v4-delete-order-shell footer button.is-danger { border-color: #ad5548; background: #ad5548; color: #ffffff; }

@media (hover: hover) {
  .v4-orders-create:hover { transform: translateY(-2px); box-shadow: 0 17px 33px rgba(51,144,236,.26); }
  .v4-filter-statuses button:hover,
  .v4-filter-focuses button:hover,
  .v4-filter-menu > div button:hover { transform: translateY(-1px); border-color: #c9dfef; }
  .v4-order-card:hover { transform: translateY(-4px); border-color: #c7dce9; box-shadow: 0 19px 40px rgba(29,44,60,.105); }
  .v4-order-card:hover .v4-order-open-cue i { transform: translate(3px, -3px); }
  .v4-order-workspace-actions button:hover,
  .v4-order-back:hover,
  .v4-order-editor-head button:hover,
  .v4-order-editor-foot button:hover { border-color: #bbd8ec; }
}

@keyframes v4OrderPageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes v4OrderCardIn {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes v4FilterOpen {
  from { opacity: 0; transform: translateY(-7px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1180px) {
  .v4-bento-mosaic {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-areas:
      "money money money money money command command command"
      "money money money money money attention attention attention"
      "economy economy economy economy economy economy economy economy"
      "partners partners partners partners partners team team team"
      "orders orders orders months months months months months";
  }

  .v4-money-orbit {
    min-height: 544px;
  }

  .v4-attention-stack {
    min-height: 330px;
  }

  .v4-economy-flow {
    grid-template-columns: minmax(0, 1fr) minmax(48px, 0.42fr) minmax(0, 1fr) minmax(58px, 0.48fr) minmax(0, 1fr) minmax(54px, 0.45fr) minmax(0, 1fr) minmax(56px, 0.47fr) minmax(0, 1fr);
  }
}

@media (max-width: 900px) and (min-width: 701px) {
  .v4-bento-mosaic {
    grid-template-areas:
      "money money money money money command command command"
      "money money money money money attention attention attention"
      "economy economy economy economy economy economy economy economy"
      "partners partners partners partners partners partners partners partners"
      "team team team team team team team team"
      "orders orders orders months months months months months";
  }

  .v4-partner-card {
    min-height: 380px;
  }

  .v4-team-core {
    grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
  }
}

@media (max-width: 980px) {
  .owner-shell.is-v4-mode .v4-owner-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .owner-shell.is-v4-mode .v4-search-tile {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .owner-shell.is-v4-mode .v4-user-tile {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 700px) {
  .owner-shell .owner-topbar .owner-brand-version {
    gap: 7px;
  }

  .owner-brand-version .brand-title {
    font-size: 13px;
  }

  .visual-version-switch {
    border-radius: 10px;
  }

  .visual-version-switch button {
    min-width: 34px;
    min-height: 28px;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 12px;
  }

  .owner-shell.is-v4-mode .app-header {
    padding-top: 8px;
  }

  .owner-shell.is-v4-mode .v4-owner-topbar {
    gap: 8px;
    padding-inline: 8px;
  }

  .v4-brand-tile {
    min-height: 54px;
    padding: 7px 7px 7px 12px;
    border-radius: 16px;
  }

  .v4-brand-tile span {
    display: none;
  }

  .v4-brand-tile strong {
    max-width: 150px;
    font-size: 12px;
  }

  .owner-shell.is-v4-mode .v4-user-tile {
    min-height: 54px;
    padding: 7px;
    border-radius: 16px;
  }

  .owner-shell.is-v4-mode .v4-user-tile > span {
    display: none;
  }

  .owner-shell.is-v4-mode .v4-search-tile {
    min-height: 48px;
    padding-inline: 13px;
    border-radius: 16px;
  }

  .owner-shell.is-v4-mode .v4-bento-nav {
    min-height: 50px;
    margin: 8px;
    padding: 6px;
    border-radius: 16px;
  }

  .owner-shell.is-v4-mode .v4-bento-nav .nav-button {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .owner-shell.is-v4-mode .content {
    padding: 10px 14px 24px;
  }

  .v4-bento-dashboard {
    gap: 16px;
  }

  .v4-dashboard-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
    padding: 8px 2px 2px;
  }

  .v4-dashboard-intro h1 {
    font-size: clamp(35px, 11vw, 49px);
  }

  .v4-dashboard-utility {
    width: 100%;
  }

  .v4-dashboard-utility button {
    flex: 1 1 0;
    justify-content: center;
  }

  .v4-bento-mosaic {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "money"
      "command"
      "attention"
      "economy"
      "partners"
      "orders"
      "months"
      "team";
    gap: 11px;
  }

  .v4-tile {
    border-radius: 23px;
  }

  .v4-money-orbit {
    min-height: auto;
    padding: 23px 20px 20px;
  }

  .v4-money-orbit-body {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-top: 0;
  }

  .v4-cash-anchor > strong {
    font-size: clamp(43px, 13.7vw, 61px);
  }

  .v4-orbit-visual {
    width: min(100%, 276px);
    margin-block: 10px 4px;
  }

  .v4-forecast-equation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  .v4-forecast-equation .is-result {
    grid-column: 1 / -1;
  }

  .v4-command-dock,
  .v4-attention-stack,
  .v4-economy-map,
  .v4-partner-ledger,
  .v4-order-radar,
  .v4-team-pod,
  .v4-month-rhythm {
    min-height: auto;
  }

  .v4-command-dock,
  .v4-economy-map,
  .v4-partner-ledger,
  .v4-order-radar,
  .v4-team-pod {
    padding: 20px;
  }

  .v4-command-stack button {
    min-height: 84px;
  }

  .v4-attention-stack {
    max-height: none;
  }

  .v4-order-slips {
    max-height: 340px;
  }

  .v4-economy-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 19px;
  }

  .v4-economy-node {
    min-height: 96px;
  }

  .v4-economy-link {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: start;
    gap: 4px 10px;
    padding-inline: 12px;
    text-align: left;
  }

  .v4-economy-link > i {
    width: 1px;
    height: 18px;
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 0 !important;
  }

  .v4-economy-link > i::after {
    top: auto;
    right: -2px;
    bottom: -1px;
    border-top: 4px solid #a9b8c3;
    border-right: 3px solid transparent;
    border-bottom: 0;
    border-left: 3px solid transparent;
  }

  .v4-partner-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .v4-partner-card {
    min-height: auto;
  }

  .v4-team-core {
    grid-template-columns: minmax(0, 1fr);
  }

  .v4-month-rhythm {
    padding: 20px 17px 15px;
  }

  .v4-month-bars {
    grid-template-columns: repeat(6, minmax(66px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .v4-month-bars > button:nth-child(-n + 2) .v4-month-popover {
    right: auto;
    left: 0;
    transform: translate(0, 6px) scale(0.98);
  }

  .v4-month-bars > button:nth-last-child(-n + 2) .v4-month-popover {
    right: 0;
    left: auto;
    transform: translate(0, 6px) scale(0.98);
  }

  .v4-month-bars > button:nth-child(-n + 2):is(:hover, :focus) .v4-month-popover,
  .v4-month-bars > button:nth-last-child(-n + 2):is(:hover, :focus) .v4-month-popover {
    transform: translate(0, 0) scale(1);
  }

  .v4-zone-money,
  .v4-zone-economy,
  .v4-zone-partners,
  .v4-zone-team {
    scroll-margin-top: 184px;
  }

  .v4-bento-placeholder {
    min-height: 360px;
    padding: 28px;
    border-radius: 23px;
  }
}

@media (max-width: 450px) {
  .v4-dashboard-utility button {
    padding-inline: 8px;
    font-size: 12px;
  }

  .v4-command-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .v4-command-stack button {
    min-height: 78px;
    padding: 9px;
  }

  .v4-command-stack button > strong {
    font-size: 12px;
  }

  .v4-radar-body {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .v4-status-cloud {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v4-forecast-equation {
    grid-template-columns: minmax(0, 1fr);
  }

  .v4-forecast-equation .is-result {
    grid-column: auto;
  }

  .v4-partner-lines small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 1180px) {
  .v4-filter-status-tile { grid-column: span 7; }
  .v4-filter-focus-tile { grid-column: span 3; }
  .v4-filter-control-tile { grid-column: span 2; }
  .v4-filter-focuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-filter-focuses button { min-width: 0; }
  .v4-filter-advanced-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .v4-order-card-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-order-card { contain-intrinsic-size: 350px; }
  .v4-order-workspace-grid {
    grid-template-areas:
      "task task task task task task task control control control control control"
      "finance finance finance finance finance finance finance contact contact contact contact contact"
      "thread thread thread thread thread thread thread thread thread thread thread thread"
      "ledger ledger ledger ledger ledger ledger history history history history history history";
  }
  .v4-order-thread-tile,
  .v4-thread-surface { min-height: 600px; }
  .v4-editor-client,
  .v4-editor-work { grid-column: span 6; }
  .v4-editor-responsibility,
  .v4-editor-timing,
  .v4-editor-money { grid-column: span 4; }
}

@media (max-width: 860px) {
  .v4-orders-intro { align-items: flex-start; }
  .v4-order-filter-dock { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .v4-filter-status-tile { grid-column: 1 / -1; }
  .v4-filter-focus-tile { grid-column: span 5; }
  .v4-filter-control-tile { grid-column: span 3; }
  .v4-filter-focuses { display: flex; }
  .v4-filter-advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-order-workspace-head,
  .v4-order-editor-head { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .v4-order-workspace-actions,
  .v4-order-editor-head > div:last-child { grid-column: 1 / -1; justify-content: flex-end; }
  .v4-order-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "task" "control" "finance" "contact" "thread" "ledger" "history";
  }
  .v4-order-task-tile,
  .v4-order-control-tile,
  .v4-order-finance-tile,
  .v4-order-contact-tile,
  .v4-order-ledger-tile,
  .v4-order-history-tile { min-height: auto; }
  .v4-order-finance-tile { min-height: 390px; }
  .v4-editor-client,
  .v4-editor-work,
  .v4-editor-responsibility,
  .v4-editor-timing,
  .v4-editor-money { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .v4-orders-intro { flex-direction: column; gap: 18px; padding: 8px 2px 19px; }
  .v4-orders-title-block h1 { font-size: clamp(39px, 13vw, 52px); }
  .v4-orders-create { width: 100%; justify-content: center; }
  .v4-order-filter-dock { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .v4-filter-status-tile,
  .v4-filter-focus-tile,
  .v4-filter-control-tile,
  .v4-filter-advanced,
  .v4-active-filter-line { grid-column: auto; border-radius: 19px; }
  .v4-filter-focuses { display: flex; }
  .v4-filter-control-tile { grid-template-columns: minmax(0, 1fr) auto; }
  .v4-filter-control-tile > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-filter-advanced-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-active-filter-line button.is-reset { margin-left: 0; }

  .v4-order-card { gap: 9px; padding: 15px; border-radius: 22px; contain-intrinsic-size: 520px; }
  .v4-order-card-head h2 { font-size: 20px; }
  .v4-order-people { align-items: stretch; flex-wrap: wrap; }
  .v4-order-people > span { flex: 1 1 120px; }
  .v4-order-people > i { display: none; }
  .v4-order-unread { flex: 1 0 100%; margin-left: 0; text-align: center; }
  .v4-order-task-block,
  .v4-order-contact-block { grid-column: 1 / -1; }
  .v4-order-task-block { min-height: 112px; }
  .v4-order-contact-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-order-contact-block > time { grid-column: 1 / -1; }
  .v4-order-finance-block { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v4-order-finance-block > span { padding: 8px; }
  .v4-order-finance-block strong { font-size: 14px; }

  .v4-order-workspace-head,
  .v4-order-editor-head { grid-template-columns: minmax(0, 1fr); gap: 13px; padding: 7px 1px 20px; }
  .v4-order-back { justify-self: start; }
  .v4-order-workspace-head h1,
  .v4-order-editor-head h1 { white-space: normal; font-size: 35px; }
  .v4-order-workspace-actions,
  .v4-order-editor-head > div:last-child { grid-column: auto; justify-content: stretch; overflow-x: auto; }
  .v4-order-workspace-actions button,
  .v4-order-editor-head > div:last-child button { flex: 1 0 auto; }
  .v4-order-workspace-grid,
  .v4-order-editor-grid { gap: 10px; }
  .v4-order-space-tile,
  .v4-editor-tile { border-radius: 21px; }
  .v4-order-task-tile,
  .v4-order-control-tile,
  .v4-order-finance-tile,
  .v4-order-contact-tile,
  .v4-order-ledger-tile,
  .v4-order-history-tile,
  .v4-editor-tile { padding: 18px; }
  .v4-order-task-tile > p { margin-top: 18px; font-size: 21px; }
  .v4-order-status-flow button.is-cancel { margin-left: 0; }
  .v4-order-finance-tile { min-height: auto; }
  .v4-order-finance-hero strong { font-size: clamp(38px, 12vw, 52px); }
  .v4-order-finance-flow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .v4-order-finance-flow > i { display: none; }
  .v4-order-finance-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-order-contact-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-order-thread-tile,
  .v4-thread-surface { min-height: 560px; }
  .v4-order-thread-tile .v4-thread-timeline { max-height: 430px; padding-inline: 13px; }
  .v4-order-thread-tile .v4-thread-composer { padding-inline: 13px; }
  .v4-order-thread-tile .thread-composer-actions { flex-direction: column; }
  .v4-order-thread-tile .thread-composer-actions > * { width: 100%; justify-content: center; }
  .v4-order-ledger-list > div,
  .v4-order-history-list > div { align-items: start; }
  .v4-order-history-list > div > b { grid-column: 2; justify-self: start; max-width: 100%; }
  .v4-editor-fields.two { grid-template-columns: minmax(0, 1fr); }
  .v4-order-editor-foot { align-items: stretch; flex-direction: column; bottom: 8px; }
  .v4-order-editor-foot > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 450px) {
  .v4-filter-status-tile,
  .v4-filter-focus-tile { padding: 14px; }
  .v4-filter-focuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-filter-statuses button,
  .v4-filter-focuses button { font-size: 14px; }
  .v4-order-card-head { align-items: start; flex-direction: column; }
  .v4-order-status { align-self: flex-start; }
  .v4-order-contact-block { grid-template-columns: minmax(0, 1fr); }
  .v4-order-contact-block > time { grid-column: auto; }
  .v4-order-finance-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-order-open-cue { justify-self: start; }
  .v4-order-workspace-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .v4-order-workspace-actions button { min-width: 0; }
  .v4-order-workspace-actions button.is-danger { grid-column: 1 / -1; }
  .v4-order-finance-details { grid-template-columns: minmax(0, 1fr); }
  .v4-order-copy-contact { align-items: flex-start; flex-direction: column; }
  .v4-delete-order-shell { padding: 20px; }
  .v4-delete-order-shell footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Orders deliberately use a larger floor than the dashboard overview. */
.v4-orders-page :is(small, .v4-order-task-block > span, .v4-order-unread, .v4-filter-option > span, .v4-filter-menu > header span),
.v4-order-workspace :is(small, .thread-item-meta > strong, .thread-item-meta > span, .v4-order-thread-tile .thread-upload-progress > div, .v4-order-history-list > div > b),
.v4-order-editor small {
  font-size: 14px;
  line-height: 1.4;
}

/* V4 uses a readable 12 px floor for supporting text instead of micro-labels. */
.v4-bento-dashboard :where(button, span, small, time, p) {
  line-height: 1.35;
}

.v4-forecast-equation small,
.v4-partner-formula small,
.v4-partner-lines small {
  overflow: visible;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.v4-forecast-equation b,
.v4-partner-formula b,
.v4-partner-lines b,
.v4-month-popover b {
  font-size: 13px;
  line-height: 1.25;
}

/* V4 Orders polish: floating filters, status language and Telegram Bento thread. */
.v4-orders-page,
.v4-order-workspace,
.v4-order-editor,
.v4-order-space-tile,
.v4-order-card {
  animation: none;
}

.v4-orders-page.is-entering,
.v4-order-workspace.is-entering,
.v4-order-editor.is-entering {
  animation: v4OrderPageIn 300ms cubic-bezier(.2,.72,.26,1) both;
}

.v4-orders-page.is-entering .v4-order-card {
  animation: v4OrderCardIn 330ms cubic-bezier(.2,.72,.26,1) calc(var(--v4-order-index) * 20ms) both;
}

.v4-orders-title-block h1 { margin-top: 0; }

.v4-order-filter-dock {
  position: relative;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 10px;
}

.v4-order-filter-dock:has(.v4-filter-panel) { z-index: 80; }
.v4-filter-status-tile { grid-column: span 11; padding: 14px 15px; }
.v4-filter-focus-tile { grid-column: span 9; padding: 14px 15px; }
.v4-filter-control-tile { grid-column: span 4; }

.v4-filter-statuses {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  gap: 5px;
}

.v4-filter-focuses {
  display: grid;
  grid-template-columns: 1.05fr .72fr 1fr 1.2fr;
  gap: 6px;
  overflow: visible;
}

.v4-filter-statuses button,
.v4-filter-focuses button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  overflow: hidden;
}

.v4-filter-statuses button { white-space: nowrap; }
.v4-filter-focuses button { width: 100%; padding-inline: 5px; line-height: 1.15; white-space: normal; }

.v4-filter-statuses button:not(:first-child)::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--v4-status-color, #8ba1b1);
  vertical-align: 1px;
}

.v4-filter-statuses button.is-active {
  border-color: var(--v4-status-border, #bdddf5);
  background: var(--v4-status-soft, var(--v4-blue-soft));
  color: var(--v4-status-ink, var(--v4-blue-strong));
}

.v4-active-filter-line {
  flex-wrap: wrap;
  overflow: visible;
}

.v4-active-filter-line > span,
.v4-active-filter-line button { flex: 0 0 auto; }
.v4-active-filter-line button.is-reset { margin-left: auto; }

.v4-filter-panel-scrim {
  position: fixed;
  z-index: 60;
  inset: 0;
  border: 0;
  background: rgba(23, 33, 43, .07);
  backdrop-filter: blur(1.5px);
  cursor: default;
}

.v4-filter-panel {
  position: fixed;
  z-index: 61;
  top: 152px;
  right: 24px;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100dvh - 176px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #d7e3eb;
  border-radius: 24px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 28px 75px rgba(23, 33, 43, .2);
  animation: v4FilterOpen 190ms cubic-bezier(.2,.72,.26,1) both;
  backdrop-filter: blur(18px);
}

.v4-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid #e7edf1;
}

.v4-filter-panel-head > div:first-child { display: grid; gap: 3px; }
.v4-filter-panel-head > div:first-child span,
.v4-filter-values > header span {
  color: #81909c;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.v4-filter-panel-head > div:first-child strong { color: #203444; font-size: 20px; letter-spacing: -.025em; }
.v4-filter-panel-head > div:last-child { display: flex; align-items: center; gap: 9px; }
.v4-filter-panel-head > div:last-child b { padding: 7px 9px; border-radius: 10px; background: var(--v4-blue-soft); color: var(--v4-blue-strong); font-size: 14px; }
.v4-filter-panel-head > div:last-child button { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #f1f5f7; color: #5e7180; font-size: 23px; line-height: 1; cursor: pointer; }

.v4-filter-panel-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.v4-filter-categories {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  border-right: 1px solid #e7edf1;
  background: #f5f8fa;
  overflow-y: auto;
}

.v4-filter-categories button {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #526777;
  text-align: left;
  cursor: pointer;
}

.v4-filter-categories button span { overflow: hidden; font-size: 14px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.v4-filter-categories button small { grid-column: 1; overflow: hidden; color: #8897a2; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-filter-categories button i { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #91a1ad; font-size: 18px; font-style: normal; }
.v4-filter-categories button.is-selected { border-color: #cde2f2; background: #ffffff; color: #266fa8; box-shadow: 0 7px 18px rgba(37, 84, 117, .07); }
.v4-filter-categories button.is-active i { color: var(--v4-blue); }

.v4-filter-values { min-width: 0; display: grid; align-content: start; gap: 14px; padding: 19px; }
.v4-filter-values > header { display: grid; gap: 3px; }
.v4-filter-values > header strong { color: #2c4354; font-size: 18px; }
.v4-filter-values > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 280px; overflow-y: auto; }
.v4-filter-values > div button {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #dfe7ed;
  border-radius: 12px;
  background: #f8fafb;
  color: #526675;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.v4-filter-values > div button i { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #cedae2; border-radius: 7px; color: #ffffff; font-size: 12px; font-style: normal; }
.v4-filter-values > div button.is-active { border-color: #bcdcf4; background: var(--v4-blue-soft); color: var(--v4-blue-strong); }
.v4-filter-values > div button.is-active i { border-color: var(--v4-blue); background: var(--v4-blue); }

.v4-filter-panel > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 18px;
  border-top: 1px solid #e7edf1;
  background: #fbfcfd;
  color: #7b8b97;
  font-size: 14px;
}

.v4-filter-panel > footer button { min-height: 37px; padding: 7px 10px; border: 0; border-radius: 11px; background: #fff0ec; color: #ad5548; font-size: 14px; font-weight: 680; cursor: pointer; }

.v4-orders-page .status-new,
.v4-order-workspace .status-new { --v4-status-color: #7e9caf; --v4-status-soft: #eef4f8; --v4-status-border: #cfdee7; --v4-status-ink: #526d7d; }
.v4-orders-page .status-work,
.v4-order-workspace .status-work { --v4-status-color: #3390ec; --v4-status-soft: #edf7ff; --v4-status-border: #bcdcf4; --v4-status-ink: #286faa; }
.v4-orders-page .status-revision,
.v4-order-workspace .status-revision { --v4-status-color: #e8a649; --v4-status-soft: #fff8e7; --v4-status-border: #ead9aa; --v4-status-ink: #94692f; }
.v4-orders-page .status-ready,
.v4-order-workspace .status-ready { --v4-status-color: #4fbd8b; --v4-status-soft: #eff8f4; --v4-status-border: #cce7da; --v4-status-ink: #337c5d; }
.v4-orders-page .status-delivered,
.v4-order-workspace .status-delivered { --v4-status-color: #17212b; --v4-status-soft: #edf1f4; --v4-status-border: #cbd4db; --v4-status-ink: #17212b; }
.v4-orders-page .status-cancel,
.v4-order-workspace .status-cancel { --v4-status-color: #e98370; --v4-status-soft: #fff0ec; --v4-status-border: #edd3cc; --v4-status-ink: #ad5548; }

.v4-order-card {
  --v4-status-color: #7e9caf;
  --v4-status-soft: #eef4f8;
  --v4-status-border: #cfdee7;
  --v4-status-ink: #526d7d;
}

.v4-order-card::before {
  z-index: 3;
  left: 26px;
  width: 96px;
  height: 5px;
  background: var(--v4-status-color);
}

.v4-order-card.is-overdue::before { background: var(--v4-status-color); }

.v4-order-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -90px;
  right: -80px;
  width: 330px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--v4-status-soft) 0 30%, transparent 72%);
  opacity: .95;
  pointer-events: none;
}

.v4-order-card > * { position: relative; z-index: 1; }
.v4-order-card.is-status-menu-open { z-index: 30; overflow: visible; content-visibility: visible; }
.v4-order-card.is-status-menu-open::after { right: 0; }

.v4-order-status,
.v4-order-status.status-new,
.v4-order-status.status-work,
.v4-order-status.status-revision,
.v4-order-status.status-ready,
.v4-order-status.status-delivered,
.v4-order-status.status-cancel {
  border-color: var(--v4-status-border, #d7e2e9);
  background: var(--v4-status-soft, #f3f6f8);
  color: var(--v4-status-ink, #61727f);
}

.v4-order-status-trigger {
  gap: 8px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.v4-order-status-trigger > i { color: var(--v4-status-color); font-size: 16px; font-style: normal; line-height: 1; }
.v4-order-status-trigger[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--v4-status-soft); }
.v4-order-status-trigger:disabled { cursor: wait; opacity: .72; }

.v4-order-status-menu {
  position: absolute;
  z-index: 35;
  top: 63px;
  right: 15px;
  width: 235px;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #d8e3ea;
  border-radius: 17px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 50px rgba(23, 33, 43, .2);
  backdrop-filter: blur(16px);
}

.v4-order-status-menu > span { padding: 3px 5px 6px; color: #7d8c98; font-size: 14px; font-weight: 700; }
.v4-order-status-menu button {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #536777;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.v4-order-status-menu button > i { width: 9px; height: 9px; border-radius: 50%; background: var(--v4-status-color); }
.v4-order-status-menu button > b { color: var(--v4-status-color); }
.v4-order-status-menu button:hover,
.v4-order-status-menu button:focus-visible,
.v4-order-status-menu button.is-current { border-color: var(--v4-status-border); background: var(--v4-status-soft); color: var(--v4-status-ink); }
.v4-order-status-menu button:disabled { cursor: default; opacity: 1; }

.v4-order-status-flow button {
  border-color: var(--v4-status-border, #e0e7ec);
  background: #ffffff;
  color: var(--v4-status-ink, #5a6d7b);
}
.v4-order-status-flow button::before { content: ""; width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--v4-status-color, #8ba1b1); }
.v4-order-status-flow button.is-active { border-color: var(--v4-status-border); background: var(--v4-status-soft); color: var(--v4-status-ink); }
.v4-order-control-tile[aria-busy="true"] { opacity: .72; }

.v4-order-thread-tile { border-color: #d5e2ea; background: #eef3f6; }
.v4-thread-surface { grid-template-rows: auto minmax(220px, 1fr) auto auto; }
.v4-order-thread-tile .v4-thread-head {
  min-height: 52px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #dbe5eb;
  background: rgba(255, 255, 255, .96);
}
.v4-order-thread-tile .v4-thread-surface > header.v4-thread-head > strong { color: #203746; font-size: 18px; letter-spacing: -.02em; }
.v4-order-thread-tile .v4-thread-head > .v4-thread-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7a8b97;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.v4-thread-summary b { color: #3e596b; font-variant-numeric: tabular-nums; }
.v4-thread-summary i { color: #afbbc3; font-style: normal; }

.v4-order-thread-tile .thread-retention,
.v4-order-thread-tile .thread-retention.is-active {
  gap: 9px;
  margin: 10px 14px;
  padding: 10px 12px;
  border: 1px solid #e0e8ed;
  border-radius: 13px;
  background: #f5f8fa;
  color: #6d7f8c;
}
.v4-order-thread-tile .thread-retention strong { color: #40596a; }
.v4-order-thread-tile .thread-retention.is-active { border-color: #ead9aa; background: #fff8e7; color: #7d653b; }
.v4-order-thread-tile .thread-retention.is-active strong { color: #94692f; }

.v4-order-thread-tile .v4-thread-timeline {
  gap: 9px;
  padding: 18px;
  border-block: 1px solid #e4ebf0;
  background: #eef3f6;
  background-image: radial-gradient(circle at 1px 1px, rgba(126, 156, 175, .13) 1px, transparent 0);
  background-size: 19px 19px;
}

.v4-order-thread-tile .thread-item {
  width: min(82%, 560px);
  gap: 7px;
  padding: 11px 13px;
  border-color: #dce5eb;
  border-radius: 16px 16px 16px 5px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(35, 55, 72, .055);
}
.v4-order-thread-tile .thread-item.is-mine { border-color: #c8e2f5; border-radius: 16px 16px 5px 16px; background: #e8f4ff; }
.v4-order-thread-tile .thread-item-meta strong { color: #3f6076; }
.v4-order-thread-tile .thread-item-meta span { color: #81919d; }
.v4-order-thread-tile .thread-item > p { color: #253846; line-height: 1.5; }
.v4-order-thread-tile .thread-item.is-deleted { border-color: #dfe6ea; background: #f3f6f8; }
.v4-order-thread-tile .thread-tombstone { color: #748592; }
.v4-order-thread-tile .thread-delete { color: #ad5548; font-size: 14px; font-weight: 650; }

.v4-order-thread-tile .thread-file-card { padding: 7px; border: 1px solid #d7e5ef; border-radius: 13px; background: rgba(255,255,255,.7); }
.v4-order-thread-tile .thread-file-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--v4-blue-soft); color: var(--v4-blue); }
.v4-order-thread-tile .thread-file-card > div strong { color: #2d4659; }
.v4-order-thread-tile .thread-file-card > div small { color: #758996; }
.v4-order-thread-tile .thread-file-card .button { min-height: 36px; padding: 7px 9px; border: 0; border-radius: 10px; background: var(--v4-blue); color: #ffffff; font-size: 14px; }
.v4-order-thread-tile .thread-empty { color: #718592; }
.v4-order-thread-tile .thread-empty strong { color: #3d586b; }

.v4-order-thread-tile .thread-upload-progress {
  margin: 10px 14px 0;
  padding: 11px 12px;
  border: 1px solid #d8e5ee;
  border-radius: 13px;
  background: #f1f7fb;
}
.v4-order-thread-tile .thread-upload-progress > div { color: #506b7e; }
.v4-order-thread-tile .thread-upload-progress i { background: #d7e6f1; }
.v4-order-thread-tile .thread-upload-progress i b { background: var(--v4-blue); }

.v4-order-thread-tile .v4-thread-composer { padding: 12px 14px 14px; background: #ffffff; }
.v4-thread-composer-box { padding: 6px; border: 1px solid #d7e2e9; border-radius: 18px; background: #f6f9fb; transition: border-color 160ms ease, box-shadow 160ms ease; }
.v4-thread-composer-box:focus-within { border-color: #9bcdf5; box-shadow: 0 0 0 4px rgba(51,144,236,.1); }
.v4-order-thread-tile .v4-thread-composer .textarea { min-height: 64px; max-height: 150px; padding: 10px 11px 5px; border: 0; outline: 0; border-radius: 13px; background: transparent; box-shadow: none; color: #253847; font-size: 15px; }
.v4-order-thread-tile .thread-composer-actions { align-items: center; padding: 3px; }
.v4-order-thread-tile .thread-composer-actions .button { min-height: 39px; border: 0; border-radius: 12px; font-size: 14px; }
.v4-order-thread-tile .thread-file-picker { padding: 7px 10px; background: #eaf0f4; color: #526b7c; }
.v4-order-thread-tile .thread-file-picker > i { color: var(--v4-blue); font-size: 19px; font-style: normal; }
.v4-order-thread-tile .thread-file-picker small { font-size: 14px; }
.v4-order-thread-tile .thread-composer-actions .primary { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px 7px 13px; background: var(--v4-blue); color: #ffffff; }
.v4-order-thread-tile .thread-composer-actions .primary i { font-style: normal; }

.v4-thread-state > i { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 5px; border: 0; border-radius: 14px; background: var(--v4-blue-soft); color: var(--v4-blue); font-size: 24px; font-style: normal; animation: none; }

.v4-order-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  padding: 9px 3px 23px;
}
.v4-order-editor-head > .v4-order-editor-toolbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.v4-order-editor-toolbar > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.v4-order-editor-number { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid #d9e4eb; border-radius: 13px; background: #f4f7f9; color: #52697a; font-size: 14px; font-weight: 700; white-space: nowrap; }
.v4-order-editor-actions { flex: 0 0 auto; }
.v4-order-editor-actions button { min-height: 43px; padding: 9px 12px; border: 1px solid #dce5eb; border-radius: 12px; background: #ffffff; color: #506474; font-size: 14px; font-weight: 650; cursor: pointer; }
.v4-order-editor .v4-order-editor-head > div.v4-order-editor-title { min-width: 0; display: grid; justify-content: stretch; gap: 4px; overflow: visible; }
.v4-order-editor-title > span { color: var(--v4-blue); font-size: 14px; font-weight: 760; letter-spacing: .075em; text-transform: uppercase; }
.v4-order-editor-head .v4-order-editor-title h1 { margin: 0; overflow: visible; font-size: clamp(34px, 4vw, 50px); line-height: 1.04; text-overflow: clip; white-space: normal; }

.v4-editor-tile { padding: 20px; box-shadow: 0 7px 20px rgba(29,44,60,.035); }
.v4-editor-section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.v4-editor-section-head > span { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--v4-blue-soft); color: var(--v4-blue-strong); font-size: 14px; font-weight: 750; }
.v4-editor-section-head h2 { margin: 0; color: #2b4253; font-size: 18px; line-height: 1.25; }
.v4-editor-fields { margin-top: 0; }
.v4-editor-field { margin-top: 0; }

@media (hover: hover) {
  .v4-order-status-trigger:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(23,33,43,.08); }
  .v4-filter-categories button:hover,
  .v4-filter-values > div button:hover { border-color: #c7ddea; }
}

@media (max-width: 1180px) {
  .v4-order-filter-dock { grid-template-columns: repeat(24, minmax(0, 1fr)); }
  .v4-filter-status-tile { grid-column: 1 / -1; }
  .v4-filter-focus-tile { grid-column: span 16; }
  .v4-filter-control-tile { grid-column: span 8; }
  .v4-filter-focuses { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .v4-order-filter-dock { grid-template-columns: repeat(24, minmax(0, 1fr)); }
  .v4-filter-focus-tile { grid-column: span 15; }
  .v4-filter-control-tile { grid-column: span 9; }
  .v4-filter-focuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-order-editor-head { grid-template-columns: minmax(0, 1fr); }
  .v4-order-editor-toolbar { grid-column: auto; }
}

@media (max-width: 700px) {
  .v4-order-filter-dock { grid-template-columns: minmax(0, 1fr); }
  .v4-filter-status-tile,
  .v4-filter-focus-tile,
  .v4-filter-control-tile,
  .v4-active-filter-line { grid-column: 1; }
  .v4-filter-focuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-filter-panel {
    position: fixed;
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 24px;
  }
  .v4-filter-panel-head { position: sticky; z-index: 2; top: 0; padding: 16px; background: rgba(255,255,255,.98); }
  .v4-filter-panel-head > div:first-child span { display: none; }
  .v4-filter-panel-head > div:first-child strong { font-size: 18px; }
  .v4-filter-panel-body { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .v4-filter-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; border-right: 0; border-bottom: 1px solid #e7edf1; }
  .v4-filter-categories button { min-height: 46px; }
  .v4-filter-categories button small { display: none; }
  .v4-filter-categories button i { grid-row: 1; }
  .v4-filter-values { padding: 16px; }
  .v4-filter-values > div { max-height: 230px; }
  .v4-filter-panel > footer { position: sticky; bottom: 0; background: #fbfcfd; }

  .v4-order-status-menu { top: 58px; right: 12px; width: min(235px, calc(100% - 24px)); }
  .v4-thread-counters { align-items: flex-end; flex-direction: column; }
  .v4-thread-counters > span { padding: 5px 7px; }
  .v4-order-thread-tile .thread-item { width: 91%; }
  .v4-order-thread-tile .thread-composer-actions { flex-direction: row; }
  .v4-order-thread-tile .thread-composer-actions > * { width: auto; }
  .v4-order-thread-tile .thread-file-picker small { display: none; }

  .v4-order-editor-head > .v4-order-editor-toolbar { align-items: stretch; flex-direction: column; }
  .v4-order-editor-toolbar > div { width: 100%; }
  .v4-order-editor-toolbar > div:first-child { justify-content: space-between; }
  .v4-order-editor-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-order-editor-actions button { width: 100%; }
}

@media (max-width: 450px) {
  .v4-filter-panel-head > div:last-child b { display: none; }
  .v4-filter-values > div { grid-template-columns: minmax(0, 1fr); }
  .v4-order-card-head { position: relative; }
  .v4-order-status-menu { top: 100px; }
  .v4-thread-head-title > i { display: none; }
  .v4-thread-counters > span { font-size: 14px; }
  .v4-order-thread-tile .thread-file-card { grid-template-columns: auto minmax(0, 1fr); }
  .v4-order-thread-tile .thread-file-card .button { grid-column: 1 / -1; width: 100%; }
  .v4-order-editor-toolbar > div:first-child { align-items: stretch; flex-direction: column; }
  .v4-order-editor-number { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .visual-version-switch button,
  .owner-shell.is-v4-mode * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* V4 funnel: an independent Telegram Bento composition. */
.v4-funnel-page {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.v4-funnel-page .status-new { --v4-funnel-accent: #7e9caf; --v4-funnel-soft: #eef4f8; --v4-funnel-border: #cfdee7; --v4-funnel-ink: #526d7d; }
.v4-funnel-page .status-work { --v4-funnel-accent: #3390ec; --v4-funnel-soft: #edf7ff; --v4-funnel-border: #bcdcf4; --v4-funnel-ink: #286faa; }
.v4-funnel-page .status-revision { --v4-funnel-accent: #e8a649; --v4-funnel-soft: #fff8e7; --v4-funnel-border: #ead9aa; --v4-funnel-ink: #94692f; }
.v4-funnel-page .status-ready { --v4-funnel-accent: #4fbd8b; --v4-funnel-soft: #eff8f4; --v4-funnel-border: #cce7da; --v4-funnel-ink: #337c5d; }
.v4-funnel-page .status-delivered { --v4-funnel-accent: #17212b; --v4-funnel-soft: #edf1f4; --v4-funnel-border: #cbd4db; --v4-funnel-ink: #17212b; }
.v4-funnel-page .status-cancel { --v4-funnel-accent: #e98370; --v4-funnel-soft: #fff0ec; --v4-funnel-border: #edd3cc; --v4-funnel-ink: #ad5548; }

.v4-funnel-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid #dfe6ec;
  border-radius: 25px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(23, 33, 43, .045);
}

.v4-funnel-head > div:first-child { min-width: 0; display: grid; gap: 5px; }
.v4-funnel-head h1 { margin: 0; color: #17212b; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.055em; }
.v4-funnel-head p { margin: 0; color: #71808e; font-size: 15px; }
.v4-funnel-head p strong { color: #2b4354; font-variant-numeric: tabular-nums; }

.v4-funnel-scope {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce5eb;
  border-radius: 15px;
  background: #f1f5f8;
}

.v4-funnel-scope button {
  min-height: 42px;
  padding: 8px 15px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #657886;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.v4-funnel-scope button.is-active { background: #ffffff; color: #257fce; box-shadow: 0 3px 11px rgba(23, 33, 43, .08); }

.v4-funnel-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.v4-funnel-summary article {
  min-width: 0;
  min-height: 116px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 7px 10px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dfe6ec;
  border-radius: 21px;
  background: #ffffff;
  box-shadow: 0 7px 22px rgba(23, 33, 43, .035);
}

.v4-funnel-summary article > i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #3390ec; box-shadow: 0 0 0 6px #edf7ff; }
.v4-funnel-summary article.is-danger > i { background: #e98370; box-shadow: 0 0 0 6px #fff0ec; }
.v4-funnel-summary article.is-neutral > i { background: #7e9caf; box-shadow: 0 0 0 6px #eef4f8; }
.v4-funnel-summary article.is-warning > i { background: #e8a649; box-shadow: 0 0 0 6px #fff8e7; }
.v4-funnel-summary article > span { min-width: 0; color: #71808e; font-size: 14px; font-weight: 650; }
.v4-funnel-summary article > strong { grid-column: 1 / -1; align-self: end; overflow: hidden; color: #243746; font-size: clamp(26px, 3vw, 38px); line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

.v4-funnel-command {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px 14px;
  padding: 13px;
  border: 1px solid #dfe6ec;
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 7px 22px rgba(23,33,43,.035);
}

.v4-funnel-quick-filters,
.v4-funnel-command-actions,
.v4-funnel-active-filters { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.v4-funnel-command button,
.v4-funnel-active-filters button {
  min-height: 39px;
  padding: 7px 11px;
  border: 1px solid #dce5eb;
  border-radius: 12px;
  background: #f5f8fa;
  color: #5a6f7e;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.v4-funnel-command button b { min-width: 21px; display: inline-grid; place-items: center; margin-left: 4px; padding: 2px 5px; border-radius: 7px; background: rgba(126,156,175,.13); color: inherit; font-size: 14px; }
.v4-funnel-command button.is-active { border-color: #bcdcf4; background: #edf7ff; color: #257fce; }
.v4-funnel-command button.is-active.is-danger { border-color: #edd3cc; background: #fff0ec; color: #ad5548; }
.v4-funnel-command button.is-active.is-warning { border-color: #ead9aa; background: #fff8e7; color: #94692f; }
.v4-funnel-command button.is-archive { background: #edf1f4; color: #2f4352; }
.v4-funnel-active-filters { grid-column: 1 / -1; padding-top: 2px; }
.v4-funnel-active-filters > span { color: #81909c; font-size: 14px; font-weight: 650; }
.v4-funnel-active-filters button { min-height: 34px; padding: 5px 9px; border-color: #cfe1ed; background: #f1f8fd; color: #3977a7; }
.v4-funnel-active-filters button i { font-style: normal; }
.v4-funnel-command-result { color: #71808e; font-size: 14px; white-space: nowrap; }
.v4-funnel-command-result b { color: #30495b; font-variant-numeric: tabular-nums; }

.v4-funnel-board {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.v4-funnel-island {
  min-width: 0;
  height: auto;
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr);
  overflow: hidden;
  border: 1px solid var(--v4-funnel-border);
  border-radius: 25px;
  background: linear-gradient(180deg, var(--v4-funnel-soft) 0, #ffffff 104px);
  box-shadow: 0 9px 28px rgba(23,33,43,.045), inset 0 4px 0 var(--v4-funnel-accent);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.v4-funnel-island > header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--v4-funnel-border), transparent 20%);
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(12px);
}
.v4-funnel-island > header > div { min-width: 0; display: flex; align-items: center; }
.v4-funnel-island > header span { overflow: hidden; color: var(--v4-funnel-ink); font-size: 18px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-island > header b { min-width: 35px; min-height: 32px; display: grid; place-items: center; padding: 4px 8px; border: 1px solid var(--v4-funnel-border); border-radius: 11px; background: #ffffff; color: var(--v4-funnel-ink); font-size: 14px; font-variant-numeric: tabular-nums; }

.v4-funnel-island-list {
  min-width: 0;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow: visible;
}

.v4-funnel-card {
  position: relative;
  min-width: 0;
  flex: 0 0 auto;
  display: grid;
  gap: 11px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid #dfe6ec;
  border-radius: 18px;
  outline: 0;
  background: #ffffff;
  box-shadow: 0 6px 17px rgba(23,33,43,.045);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.v4-funnel-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--v4-funnel-accent); }
.v4-funnel-card.is-overdue { box-shadow: 0 6px 17px rgba(23,33,43,.045), inset 0 0 0 1px rgba(233,131,112,.13); }
.v4-funnel-card:focus-visible { border-color: var(--v4-funnel-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--v4-funnel-accent), transparent 84%); }
.v4-funnel-card.is-dragging { opacity: .45; transform: scale(.985); }
.v4-funnel-card > header { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.v4-funnel-card > header span { color: var(--v4-funnel-ink); font-size: 14px; font-weight: 780; white-space: nowrap; }
.v4-funnel-card > header strong { overflow: hidden; color: #263b4b; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-card > header i { color: #8a9ba7; font-size: 16px; font-style: normal; }
.v4-funnel-card-people,
.v4-funnel-card-signals { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.v4-funnel-card-people > span,
.v4-funnel-card-signals > span { min-width: 0; display: grid; gap: 3px; padding: 9px 10px; border-radius: 12px; background: #f5f8fa; }
.v4-funnel-card-people small,
.v4-funnel-card-signals small { color: #81909c; font-size: 14px; }
.v4-funnel-card-people strong,
.v4-funnel-card-signals strong { overflow: hidden; color: #3a5263; font-size: 14px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-card-people > span.is-empty { background: #f4f5f6; }
.v4-funnel-card-signals > span.is-red { background: #fff0ec; }
.v4-funnel-card-signals > span.is-red strong { color: #ad5548; }
.v4-funnel-card-signals > span.is-warning { background: #fff8e7; }
.v4-funnel-card-signals > span.is-warning strong { color: #94692f; }
.v4-funnel-card-signals > span.is-paid { background: #eff8f4; }
.v4-funnel-card-signals > span.is-paid strong { color: #337c5d; }
.v4-funnel-card > footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v4-funnel-chat { min-width: 0; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 0; border-radius: 11px; background: #edf7ff; color: #257fce; font: inherit; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-funnel-chat b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-chat.is-unread { background: #3390ec; color: #ffffff; }
.v4-funnel-move-actions { flex: 0 0 auto; display: inline-flex; gap: 5px; }
.v4-funnel-move-actions button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #dce5eb; border-radius: 11px; background: #ffffff; color: #536b7b; font: inherit; font-size: 17px; cursor: pointer; }
.v4-funnel-move-actions button:disabled { opacity: .32; cursor: default; }
.v4-funnel-empty { min-height: 150px; display: grid; place-items: center; padding: 20px; border: 1px dashed var(--v4-funnel-border); border-radius: 17px; background: rgba(255,255,255,.55); color: #80909c; font-size: 14px; text-align: center; }
.v4-funnel-island.is-drop-target { border-color: var(--v4-funnel-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--v4-funnel-accent), transparent 82%), 0 16px 36px rgba(23,33,43,.09), inset 0 4px 0 var(--v4-funnel-accent); transform: translateY(-2px); }

.v4-funnel-overlay-scrim {
  position: fixed;
  z-index: 190;
  inset: 0;
  border: 0;
  background: rgba(31,48,61,.22);
  backdrop-filter: blur(3px);
  cursor: default;
  animation: v4FunnelFade 150ms ease both;
}

.v4-funnel-filter-panel,
.v4-funnel-archive {
  position: fixed;
  z-index: 191;
  overflow: hidden;
  border: 1px solid #d8e3ea;
  background: rgba(255,255,255,.985);
  box-shadow: 0 28px 75px rgba(23,33,43,.24);
  backdrop-filter: blur(20px);
}

.v4-funnel-filter-panel {
  top: max(116px, 14vh);
  left: 50%;
  width: min(760px, calc(100vw - 48px));
  max-height: min(610px, calc(100dvh - 148px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 25px;
  transform: translateX(-50%);
  animation: v4FunnelPanelIn 180ms ease both;
}
.v4-funnel-filter-panel > header,
.v4-funnel-archive > header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #e3e9ee; }
.v4-funnel-filter-panel > header > div,
.v4-funnel-archive > header > div { min-width: 0; display: grid; gap: 2px; }
.v4-funnel-filter-panel > header span,
.v4-funnel-archive > header span { color: #7e8e9a; font-size: 14px; font-weight: 700; }
.v4-funnel-filter-panel > header strong,
.v4-funnel-archive > header strong { color: #263c4d; font-size: 20px; }
.v4-funnel-filter-panel > header button,
.v4-funnel-archive > header button { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid #dce5eb; border-radius: 12px; background: #f4f7f9; color: #637786; font: inherit; font-size: 23px; cursor: pointer; }
.v4-funnel-filter-body { min-height: 0; display: grid; grid-template-columns: minmax(225px, .82fr) minmax(0, 1.18fr); }
.v4-funnel-filter-body > nav { min-width: 0; display: grid; align-content: start; gap: 6px; padding: 13px; overflow-y: auto; border-right: 1px solid #e3e9ee; background: #f6f8fa; }
.v4-funnel-filter-body > nav button { min-width: 0; min-height: 57px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 9px; padding: 9px 11px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #536979; font: inherit; text-align: left; cursor: pointer; }
.v4-funnel-filter-body > nav button span { overflow: hidden; font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-filter-body > nav button small { overflow: hidden; color: #8998a3; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-filter-body > nav button i { grid-column: 2; grid-row: 1 / span 2; color: #93a2ac; font-size: 20px; font-style: normal; }
.v4-funnel-filter-body > nav button.is-selected { border-color: #c5dded; background: #ffffff; color: #257fce; box-shadow: 0 4px 13px rgba(23,33,43,.045); }
.v4-funnel-filter-body > nav button.is-active::after { content: ""; width: 7px; height: 7px; position: absolute; border-radius: 50%; background: #3390ec; }
.v4-funnel-filter-body > nav button { position: relative; }
.v4-funnel-filter-values { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 18px; }
.v4-funnel-filter-values > header { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.v4-funnel-filter-values > header span { color: #263c4d; font-size: 17px; font-weight: 780; }
.v4-funnel-filter-values > header strong { overflow: hidden; color: #6f8290; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-filter-values > div { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; overflow-y: auto; }
.v4-funnel-filter-values button { min-width: 0; min-height: 46px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #e0e7ec; border-radius: 12px; background: #ffffff; color: #526879; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.v4-funnel-filter-values button i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: #f0f4f6; color: #3390ec; font-size: 14px; font-style: normal; }
.v4-funnel-filter-values button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-filter-values button.is-active { border-color: #bcdcf4; background: #edf7ff; color: #257fce; font-weight: 720; }
.v4-funnel-filter-values button.is-active i { background: #3390ec; color: #ffffff; }
.v4-funnel-filter-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-top: 1px solid #e3e9ee; background: #f8fafb; }
.v4-funnel-filter-panel > footer span { color: #7b8c98; font-size: 14px; }
.v4-funnel-filter-panel > footer button { min-height: 38px; padding: 7px 11px; border: 1px solid #dce5eb; border-radius: 11px; background: #ffffff; color: #526879; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

.v4-funnel-archive {
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(560px, calc(100vw - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-color: #cbd9e2;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(20, 38, 52, .28);
  animation: v4FunnelArchiveIn 200ms ease both;
}
.v4-funnel-archive > header { padding: 20px 22px; background: #ffffff; }
.v4-funnel-archive > header span { color: #667b8b; }
.v4-funnel-archive > header strong { color: #172f40; font-size: 24px; letter-spacing: -.025em; }
.v4-funnel-archive-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; border-bottom: 1px solid #dce6ed; background: #edf3f7; }
.v4-funnel-archive-tabs button { min-height: 46px; padding: 9px 12px; border: 1px solid var(--v4-funnel-border); border-radius: 13px; background: #ffffff; color: var(--v4-funnel-ink); font: inherit; font-size: 15px; font-weight: 760; cursor: pointer; }
.v4-funnel-archive-tabs button.is-active { border-color: var(--v4-funnel-accent); background: var(--v4-funnel-soft); box-shadow: inset 0 -3px 0 var(--v4-funnel-accent), 0 5px 14px rgba(33, 55, 72, .08); }
.v4-funnel-archive-tabs button b { margin-left: 4px; font-size: 14px; }
.v4-funnel-archive-list { min-height: 0; display: flex; flex-direction: column; gap: 11px; padding: 16px; overflow-y: auto; background: #eef3f6; }
.v4-funnel-archive-card { position: relative; min-width: 0; flex: 0 0 auto; display: grid; gap: 12px; padding: 17px 17px 16px 21px; overflow: hidden; border: 1px solid #cedae3; border-radius: 19px; outline: 0; background: #ffffff; box-shadow: 0 8px 22px rgba(25, 48, 65, .08); cursor: pointer; }
.v4-funnel-archive-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--v4-funnel-accent); }
.v4-funnel-archive-card-title { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.v4-funnel-archive-card-title > span { color: var(--v4-funnel-ink); font-size: 14px; font-weight: 800; white-space: nowrap; }
.v4-funnel-archive-card-title > strong { overflow: hidden; color: #203849; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-archive-card-title > em { padding: 5px 8px; border: 1px solid var(--v4-funnel-border); border-radius: 9px; background: var(--v4-funnel-soft); color: var(--v4-funnel-ink); font-size: 14px; font-style: normal; font-weight: 740; white-space: nowrap; }
.v4-funnel-archive-card > p { display: -webkit-box; margin: 0; overflow: hidden; color: #435b6b; font-size: 15px; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.v4-funnel-archive-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v4-funnel-archive-card-meta > span { min-width: 0; display: grid; gap: 3px; padding: 9px 10px; border-radius: 12px; background: #f3f7f9; }
.v4-funnel-archive-card small { color: #718493; font-size: 14px; }
.v4-funnel-archive-card-meta strong { overflow: hidden; color: #334c5e; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-funnel-archive-card > footer { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 1px; }
.v4-funnel-archive-card > footer > span { display: grid; gap: 2px; }
.v4-funnel-archive-card > footer b { color: #203849; font-size: 17px; font-variant-numeric: tabular-nums; }
.v4-funnel-archive-card > footer button { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 11px; background: #e8f4ff; color: #257fce; font: inherit; font-size: 14px; font-weight: 740; cursor: pointer; }
.v4-funnel-archive-card > footer button.is-unread { background: #3390ec; color: #ffffff; }
.v4-funnel-archive-card:focus-visible { border-color: var(--v4-funnel-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--v4-funnel-accent), transparent 84%); }
.v4-funnel-archive-empty { min-height: 220px; display: grid; place-items: center; padding: 25px; color: #536b7b; font-size: 15px; text-align: center; }

.v4-funnel-page.is-entering .v4-funnel-head,
.v4-funnel-page.is-entering .v4-funnel-summary,
.v4-funnel-page.is-entering .v4-funnel-command { animation: v4FunnelRise 320ms ease both; }
.v4-funnel-page.is-entering .v4-funnel-summary { animation-delay: 45ms; }
.v4-funnel-page.is-entering .v4-funnel-command { animation-delay: 85ms; }
.v4-funnel-page.is-entering .v4-funnel-island { animation: v4FunnelRise 360ms ease both; animation-delay: calc(105ms + var(--v4-funnel-island-index) * 38ms); }

@keyframes v4FunnelRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes v4FunnelFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes v4FunnelPanelIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.99); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes v4FunnelArchiveIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }

/* Final V4 order polish requested together with the funnel. */
.v4-order-finance-meta { justify-content: flex-end; }
.v4-order-finance-tile > header.v4-order-finance-meta > i { margin-left: auto; }
.v4-order-ledger-head { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; }
.v4-order-ledger-head > span { min-width: 0; }
.v4-order-ledger-head > strong { flex: 0 0 auto; }
.v4-order-thread-tile .v4-thread-head-title > strong { overflow: hidden; color: #253b4d; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.v4-order-thread-tile .thread-upload-progress > div.is-waiting i b { background: #9cabb5; }
.v4-order-thread-tile .thread-upload-progress > div.is-uploading i b { background: #3390ec; }
.v4-order-thread-tile .thread-upload-progress > div.is-done { color: #337c5d; }
.v4-order-thread-tile .thread-upload-progress > div.is-done i b { background: #4fbd8b; }
.v4-order-thread-tile .thread-upload-progress > div.is-error { color: #ad5548; }
.v4-order-thread-tile .thread-upload-progress > div.is-error i b { background: #e98370; }
.v4-order-thread-tile .thread-upload-progress > div.is-done strong { color: #337c5d; }
.v4-order-thread-tile .thread-upload-progress > div.is-error strong { color: #ad5548; }

@media (hover: hover) {
  .v4-funnel-card:hover { border-color: var(--v4-funnel-border); box-shadow: 0 10px 24px rgba(23,33,43,.075); transform: translateY(-1px); }
  .v4-funnel-command button:hover,
  .v4-funnel-scope button:hover,
  .v4-funnel-filter-values button:hover { border-color: #bcdcf4; }
}

@media (max-width: 1180px) {
  .v4-funnel-command { grid-template-columns: minmax(0, 1fr) auto; }
  .v4-funnel-command-result { grid-column: 1 / -1; justify-self: end; }
  .v4-funnel-island-list { padding: 10px; }
  .v4-funnel-card { padding: 13px; }
}

@media (max-width: 860px) {
  .v4-funnel-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-funnel-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-funnel-summary article { min-height: 105px; }
  .v4-funnel-command { grid-template-columns: minmax(0, 1fr); }
  .v4-funnel-command-actions { justify-content: flex-start; }
  .v4-funnel-command-result { grid-column: 1; }
  .v4-funnel-island { height: auto; }
}

@media (max-width: 700px) {
  .owner-shell.is-v4-mode .v4-bento-nav .nav-button[data-view="funnel"] { display: none; }
  .owner-shell.is-v4-mode .content { padding-inline: 12px; }
  .v4-funnel-page { gap: 12px; }
  .v4-funnel-head { align-items: stretch; padding: 19px; border-radius: 21px; }
  .v4-funnel-head h1 { font-size: 37px; }
  .v4-funnel-scope { align-self: center; grid-template-columns: repeat(2, minmax(64px, 1fr)); }
  .v4-funnel-summary { gap: 8px; }
  .v4-funnel-summary article { min-height: 100px; padding: 14px; border-radius: 17px; }
  .v4-funnel-summary article > strong { font-size: clamp(24px, 8vw, 32px); }
  .v4-funnel-command { padding: 10px; border-radius: 17px; }
  .v4-funnel-quick-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-funnel-quick-filters button { width: 100%; min-width: 0; white-space: normal; }
  .v4-funnel-command-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v4-funnel-command-actions button { min-width: 0; padding-inline: 6px; white-space: normal; }
  .v4-funnel-board { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .v4-funnel-island { height: auto; border-radius: 21px; }
  .v4-funnel-island-list { padding: 10px; }
  .v4-funnel-overlay-scrim { z-index: 190; }
  .v4-funnel-filter-panel,
  .v4-funnel-archive {
    z-index: 191;
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom));
    border-radius: 24px;
    transform: none;
    animation: v4FunnelSheetIn 190ms ease both;
  }
  .v4-funnel-filter-panel { grid-template-rows: auto minmax(0, 1fr) auto; }
  .v4-funnel-filter-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .v4-funnel-filter-body > nav { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border-right: 0; border-bottom: 1px solid #e3e9ee; }
  .v4-funnel-filter-body > nav button { min-height: 49px; }
  .v4-funnel-filter-body > nav button small,
  .v4-funnel-filter-body > nav button i { display: none; }
  .v4-funnel-filter-values { min-height: 250px; padding: 14px; }
  .v4-funnel-filter-values > div { max-height: 250px; }
  .v4-funnel-archive { grid-template-rows: auto auto minmax(190px, 1fr); }
  .v4-order-ledger-head { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 450px) {
  .v4-funnel-head { flex-direction: column; }
  .v4-funnel-scope { width: 100%; }
  .v4-funnel-summary article > span { line-height: 1.2; }
  .v4-funnel-card-people,
  .v4-funnel-card-signals { grid-template-columns: minmax(0, 1fr); }
  .v4-funnel-filter-values > div { grid-template-columns: minmax(0, 1fr); }
  .v4-funnel-filter-body > nav { grid-template-columns: minmax(0, 1fr); }
  .v4-funnel-filter-body > nav button { min-height: 43px; }
  .v4-funnel-filter-panel > footer span { display: none; }
}

@keyframes v4FunnelSheetIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .v4-funnel-page *,
  .v4-funnel-overlay-scrim,
  .v4-funnel-filter-panel,
  .v4-funnel-archive { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* V4 clients: deliberately small, direct and order-first. */
.v4-clients-page {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 4px 0 30px;
  color: #17212b;
}

.v4-clients-page :where(button) {
  font-family: inherit;
}

.v4-clients-page :where(button, [tabindex]):focus-visible {
  outline: 3px solid rgba(51, 144, 236, .24);
  outline-offset: 2px;
}

.v4-clients-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid #dce5eb;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(23, 33, 43, .045);
}

.v4-clients-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.v4-clients-head h1 {
  margin: 0;
  color: #17212b;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -.055em;
}

.v4-clients-head p {
  margin: 0;
  color: #738391;
  font-size: 15px;
}

.v4-clients-head p strong {
  color: #2b4354;
  font-variant-numeric: tabular-nums;
}

.v4-clients-debt {
  min-width: 170px;
  display: grid;
  gap: 3px;
  padding: 13px 16px;
  border: 1px solid #dce5eb;
  border-radius: 17px;
  background: #f4f7f9;
}

.v4-clients-debt span {
  color: #748693;
  font-size: 14px;
  font-weight: 700;
}

.v4-clients-debt strong {
  color: #263c4d;
  font-size: 21px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.v4-clients-debt.is-warning {
  border-color: #ead9aa;
  background: #fff8e7;
}

.v4-clients-debt.is-warning strong {
  color: #94692f;
}

.v4-clients-focus {
  width: min(100%, 620px);
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid #dce5eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 33, 43, .04);
}

.v4-clients-focus button {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f4f7f9;
  color: #5f7484;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.v4-clients-focus button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-clients-focus button b {
  min-width: 25px;
  min-height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 2px 6px;
  border-radius: 8px;
  background: #ffffff;
  color: #667b8b;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.v4-clients-focus button.is-active {
  border-color: #bcdcf4;
  background: #edf7ff;
  color: #257fce;
}

.v4-clients-focus button.is-active b {
  background: #3390ec;
  color: #ffffff;
}

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

.v4-client-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 13px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #d9e3e9;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 9px 26px rgba(23, 33, 43, .045);
}

.v4-client-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #9bb0be;
}

.v4-client-card.is-active::before { background: #3390ec; }
.v4-client-card.is-debt::before { background: #e8a649; }

.v4-client-card > header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

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

.v4-client-card h2 {
  margin: 0;
  overflow: hidden;
  color: #203849;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-client-card > header span {
  display: -webkit-box;
  overflow: hidden;
  color: #788995;
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.v4-client-card > header > strong {
  padding: 6px 8px;
  border-radius: 10px;
  background: #edf3f7;
  color: #536979;
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.v4-client-contact {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.v4-client-contact > span {
  min-width: 0;
  color: #718493;
  font-size: 14px;
  line-height: 1.35;
}

.v4-client-contact button {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #c9dfef;
  border-radius: 10px;
  background: #edf7ff;
  color: #257fce;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.v4-client-contact button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-client-contact button small {
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 7px;
  background: #ffffff;
  color: #5789ad;
  font-size: 14px;
}

.v4-client-money {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.v4-client-money > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 13px;
  background: #f4f7f9;
}

.v4-client-money small {
  overflow: hidden;
  color: #758795;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-client-money strong {
  overflow: hidden;
  color: #2e4657;
  font-size: 15px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-client-money > span.is-warning {
  background: #fff8e7;
}

.v4-client-money > span.is-warning :is(small, strong) {
  color: #94692f;
}

.v4-client-orders {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding-top: 1px;
}

.v4-client-order-link {
  --v4-client-order-accent: #8ea5b4;
  --v4-client-order-soft: #f2f6f8;
  min-width: 0;
  min-height: 51px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 12px;
  border: 1px solid #dce5eb;
  border-left: 4px solid var(--v4-client-order-accent);
  border-radius: 12px;
  background: var(--v4-client-order-soft);
  color: #334c5e;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.v4-client-order-link.status-new { --v4-client-order-accent: #7e9caf; --v4-client-order-soft: #eef4f8; }
.v4-client-order-link.status-work { --v4-client-order-accent: #3390ec; --v4-client-order-soft: #edf7ff; }
.v4-client-order-link.status-revision { --v4-client-order-accent: #e8a649; --v4-client-order-soft: #fff8e7; }
.v4-client-order-link.status-ready { --v4-client-order-accent: #4fbd8b; --v4-client-order-soft: #eff8f4; }
.v4-client-order-link.status-delivered { --v4-client-order-accent: #17212b; --v4-client-order-soft: #edf1f4; }
.v4-client-order-link.status-cancel { --v4-client-order-accent: #e98370; --v4-client-order-soft: #fff0ec; }

.v4-client-order-link > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.v4-client-order-link strong {
  color: #294153;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.v4-client-order-link small {
  overflow: hidden;
  color: #647987;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-client-order-link em {
  padding: 5px 7px;
  border-radius: 8px;
  background: #ffffff;
  color: #536979;
  font-size: 14px;
  font-style: normal;
  font-weight: 720;
  white-space: nowrap;
}

.v4-client-orders-more {
  justify-self: end;
  color: #7c8d99;
  font-size: 14px;
}

.v4-clients-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  border: 1px solid #dce5eb;
  border-radius: 24px;
  background: #ffffff;
  color: #748693;
  font-size: 14px;
  text-align: center;
}

.v4-clients-empty strong {
  color: #294153;
  font-size: 21px;
}

.v4-clients-empty button {
  min-height: 40px;
  margin-top: 5px;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  background: #e8f4ff;
  color: #257fce;
  font-size: 14px;
  font-weight: 740;
  cursor: pointer;
}

@media (hover: hover) {
  .v4-clients-focus button:hover { border-color: #bcdcf4; }
  .v4-client-contact button:hover { border-color: #9bcdf5; }
  .v4-client-order-link:hover { border-color: var(--v4-client-order-accent); transform: translateY(-1px); }
}

@media (max-width: 1180px) {
  .v4-client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .v4-clients-page { gap: 12px; padding-top: 0; }
  .v4-clients-head { align-items: stretch; padding: 19px; border-radius: 21px; }
  .v4-clients-head h1 { font-size: 39px; }
  .v4-clients-debt { min-width: 132px; padding: 11px 13px; }
  .v4-clients-debt strong { font-size: 18px; }
  .v4-clients-focus { width: 100%; }
  .v4-client-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-client-card { padding: 16px; border-radius: 19px; }
}

@media (max-width: 450px) {
  .v4-clients-head { flex-direction: column; }
  .v4-clients-debt { width: 100%; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .v4-clients-focus button { min-height: 50px; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 4px; }
  .v4-client-money { gap: 5px; }
  .v4-client-money > span { padding: 9px 7px; }
  .v4-client-money strong { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .v4-clients-page * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* V4 finance journals: shared Telegram Bento shell */
.v4-journal-page {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding-bottom: 38px;
  color: #263b4d;
  font-family: "Golos Text", system-ui, sans-serif;
}

.v4-journal-page :where(button, input, select, textarea) { font: inherit; }

.v4-journal-page :where(button, [tabindex], input, select, textarea):focus-visible,
dialog.v4-transaction-dialog :where(button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(51, 144, 236, .22);
  outline-offset: 2px;
}

.v4-journal-intro {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 25px 27px;
  overflow: hidden;
  border: 1px solid #d8e4eb;
  border-radius: 26px;
  background:
    radial-gradient(circle at 78% -80%, rgba(51, 144, 236, .18), transparent 42%),
    #ffffff;
  box-shadow: 0 14px 38px rgba(35, 65, 84, .07);
}

.v4-journal-intro > div { min-width: 0; display: grid; gap: 4px; }
.v4-journal-intro > div > span { color: #3390ec; font-size: 14px; font-weight: 780; letter-spacing: .045em; text-transform: uppercase; }
.v4-journal-intro h1 { margin: 0; color: #172b3a; font-size: clamp(42px, 4.2vw, 58px); line-height: .98; letter-spacing: -.055em; }
.v4-journal-intro p { margin: 4px 0 0; color: #7b8c98; font-size: 15px; }
.v4-journal-intro p strong { color: #294153; font-variant-numeric: tabular-nums; }
.v4-journal-intro.is-expense {
  background:
    radial-gradient(circle at 78% -80%, rgba(238, 153, 74, .19), transparent 42%),
    #ffffff;
}

.v4-journal-create {
  min-height: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 0;
  border-radius: 16px;
  background: #3390ec;
  color: #ffffff;
  font-size: 15px;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(51, 144, 236, .23);
  cursor: pointer;
}

.v4-journal-create span { font-size: 22px; font-weight: 450; line-height: 1; }
.v4-journal-create.is-expense { background: #df8a3d; box-shadow: 0 12px 26px rgba(223, 138, 61, .23); }

.v4-journal-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.v4-journal-metric {
  min-width: 0;
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 17px 18px;
  border: 1px solid #dde6eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(35, 65, 84, .045);
}

.v4-journal-metric > span,
.v4-journal-metric small { color: #788a97; font-size: 14px; }
.v4-journal-metric strong { overflow: hidden; color: #263e50; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.05; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-journal-metric.is-income { background: linear-gradient(150deg, #172b3a, #233f52); border-color: #172b3a; }
.v4-journal-metric.is-income :is(span, small) { color: #b9cad6; }
.v4-journal-metric.is-income strong { color: #ffffff; }
.v4-journal-metric.is-blue { background: #edf7ff; border-color: #cfe6f8; }
.v4-journal-metric.is-blue strong { color: #257fce; }
.v4-journal-metric.is-mint { background: #eff9f5; border-color: #d3ebdf; }
.v4-journal-metric.is-mint strong { color: #388966; }
.v4-journal-metric.is-expense { background: linear-gradient(150deg, #352b27, #554037); border-color: #352b27; }
.v4-journal-metric.is-expense :is(span, small) { color: #dbc9bf; }
.v4-journal-metric.is-expense strong { color: #ffffff; }
.v4-journal-metric.is-amber { background: #fff7ed; border-color: #f0ddc5; }
.v4-journal-metric.is-amber strong { color: #bd6d2a; }
.v4-journal-metric.is-warning { background: #fff1ed; border-color: #f1d0c7; }
.v4-journal-metric.is-warning strong { color: #b55848; }

.v4-journal-dock {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 10px;
}

.v4-journal-dock:has(.v4-filter-panel) { z-index: 140; }

.v4-journal-focus-tile,
.v4-journal-control-tile,
.v4-journal-active-filters {
  min-width: 0;
  border: 1px solid #dce5eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(35, 65, 84, .045);
}

.v4-journal-focus-tile { grid-column: span 16; display: grid; gap: 9px; padding: 14px 15px; }
.v4-journal-control-tile { grid-column: span 8; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 13px; padding: 14px 15px; }
.v4-journal-focus-tile > span,
.v4-journal-control-tile > span { color: #7f8f9a; font-size: 14px; font-weight: 660; }
.v4-journal-control-tile > strong { grid-row: 2; color: #243c4d; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }

.v4-journal-focus-tile > div,
.v4-journal-control-tile > div { min-width: 0; display: grid; gap: 7px; }
.v4-journal-focus-tile > div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.v4-journal-control-tile > div { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.v4-journal-focus-tile button,
.v4-journal-control-tile button {
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid #e0e7ec;
  border-radius: 12px;
  background: #f5f7f9;
  color: #536979;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.v4-journal-control-tile button { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v4-journal-control-tile button i { color: #8798a4; font-style: normal; }
.v4-journal-control-tile button b { min-width: 22px; text-align: right; }
.v4-journal-focus-tile button.is-active,
.v4-journal-control-tile button.is-active { border-color: #bcdcf4; background: #eaf6ff; color: #257fce; }

.v4-journal-active-filters { grid-column: 1 / -1; }

.v4-journal-filter-values > .v4-journal-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: none;
  overflow: visible;
}

.v4-journal-custom-dates {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px;
  border: 1px solid #dfe8ed;
  border-radius: 14px;
  background: #f6f9fb;
}
.v4-journal-filter-values > .v4-journal-custom-dates { max-height: none; overflow: visible; }
.v4-journal-filter-panel .v4-filter-values > div button i { font-size: 14px; }

.v4-journal-custom-dates[hidden] { display: none !important; }
.v4-journal-custom-dates label { min-width: 0; display: grid; gap: 6px; color: #6f8290; font-size: 14px; font-weight: 680; }
.v4-journal-custom-dates input { min-width: 0; min-height: 43px; padding: 8px 10px; border: 1px solid #d5e1e8; border-radius: 11px; background: #ffffff; color: #2d4658; font-size: 14px; }

.v4-journal-feed { min-width: 0; display: grid; gap: 12px; }

.v4-journal-day {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce5eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(35, 65, 84, .05);
}

.v4-journal-day > header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 17px;
  border-bottom: 1px solid #e5ebef;
  background: #f6f9fb;
}

.v4-journal-day > header > div { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.v4-journal-day > header > div:last-child { justify-content: flex-end; }
.v4-journal-day h2 { margin: 0; color: #2b4355; font-size: 18px; letter-spacing: -.02em; }
.v4-journal-day > header span { color: #80909b; font-size: 14px; }
.v4-journal-day > header strong { color: #2c4658; font-size: 17px; font-variant-numeric: tabular-nums; }
.v4-journal-day > div { min-width: 0; display: grid; }

.v4-journal-row {
  min-width: 0;
  min-height: 79px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, .7fr) 118px 150px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #edf1f3;
}

.v4-journal-row:last-child { border-bottom: 0; }
.v4-journal-row button { border: 0; background: transparent; color: inherit; cursor: pointer; }

.v4-journal-row-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 4px;
  text-align: left;
}

.v4-journal-row-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #eaf6ff; color: #257fce; font-size: 20px; font-weight: 760; }
.v4-journal-row-copy { min-width: 0; display: grid; gap: 4px; }
.v4-journal-row-copy strong { overflow: hidden; color: #263f51; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.v4-journal-row-copy small { overflow: hidden; color: #748795; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

.v4-journal-row-tags { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.v4-journal-row-tags span { max-width: 100%; padding: 5px 8px; overflow: hidden; border-radius: 9px; background: #f1f5f7; color: #607583; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-journal-row.is-income .v4-journal-row-tags span:first-child { background: #edf8f3; color: #3d8767; }
.v4-journal-row.is-expense { grid-template-columns: minmax(250px, .9fr) minmax(320px, 1.25fr) 118px 150px; }
.v4-journal-row.is-expense .v4-journal-row-icon { background: #fff3e8; color: #cc752f; }
.v4-journal-row.is-expense .v4-journal-row-tags span:first-child { background: #eef6fc; color: #4b7899; }
.v4-journal-row.is-expense .v4-journal-row-tags span.is-due { background: #fff0ec; color: #ad5548; }
.v4-journal-row.is-expense .v4-journal-row-amount strong { color: #bc6743; }

.v4-journal-row-order { min-width: 0; display: flex; justify-content: flex-end; }
.v4-journal-row-order button,
.v4-journal-row-order > span { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 10px; color: #257fce; font-size: 14px; font-weight: 730; white-space: nowrap; }
.v4-journal-row-order button { background: #edf7ff; }
.v4-journal-row-order > span { color: #84939d; background: #f3f5f6; }
.v4-journal-row-order i { font-style: normal; }

.v4-journal-row-amount { min-width: 0; display: grid; justify-items: end; gap: 3px; padding: 4px; text-align: right; }
.v4-journal-row-amount strong { color: #2c815e; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v4-journal-row-amount span { color: #82929d; font-size: 14px; white-space: nowrap; }

.v4-journal-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  border: 1px solid #dce5eb;
  border-radius: 24px;
  background: #ffffff;
  color: #748693;
  font-size: 14px;
  text-align: center;
}
.v4-journal-empty > span { color: #3390ec; font-size: 42px; font-weight: 780; }
.v4-journal-empty h2 { margin: 0; color: #294153; font-size: 22px; }
.v4-journal-empty p { margin: 0; }
.v4-journal-empty button { min-height: 40px; margin-top: 6px; padding: 8px 12px; border: 0; border-radius: 11px; background: #e8f4ff; color: #257fce; font-size: 14px; font-weight: 740; cursor: pointer; }

/* V4 transaction editor */
dialog.v4-transaction-dialog {
  width: min(980px, calc(100vw - 88px));
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 24px);
  inset: 50% auto auto 50%;
  margin: 0;
  translate: -50% -50%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d6e1e8;
  border-radius: 24px;
  background: #f7f9fb;
  box-shadow: 0 30px 80px rgba(23, 33, 43, .25);
}

dialog.v4-transaction-dialog::backdrop { background: rgba(30, 48, 63, .32); backdrop-filter: blur(5px); }

.v4-transaction-sheet { min-width: 0; height: auto; max-height: calc(100dvh - 24px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #2b4355; font-family: "Golos Text", system-ui, sans-serif; }
.v4-transaction-sheet-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid #e1e8ed; background: rgba(255,255,255,.98); }
.v4-transaction-sheet-head > div { min-width: 0; display: grid; gap: 3px; }
.v4-transaction-sheet-head span { color: #3390ec; font-size: 14px; font-weight: 760; text-transform: uppercase; }
.v4-transaction-sheet-head h2 { margin: 0; color: #203647; font-size: 22px; letter-spacing: -.03em; }
.v4-transaction-sheet-head > button { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 12px; background: #eff3f5; color: #627582; font-size: 23px; cursor: pointer; }

.v4-transaction-sheet-body { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px 10px; padding: 10px 12px; overflow-y: auto; }
.v4-transaction-order-context { min-width: 0; display: grid; grid-column: 1 / -1; gap: 3px; padding: 11px 13px; border: 1px solid #cce3f4; border-radius: 15px; background: #edf7ff; }
.v4-transaction-order-context > span { color: #5e8db1; font-size: 14px; }
.v4-transaction-order-context strong { overflow: hidden; color: #276eaa; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.v4-transaction-order-context small { overflow: hidden; color: #65849b; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-transaction-order-context.is-empty { border-color: #dce5eb; background: #f2f5f7; }
.v4-transaction-order-context.is-empty :is(span, small) { color: #82919b; }
.v4-transaction-order-context.is-empty strong { color: #526878; }
.v4-transaction-order-context.is-expense { border-color: #efd9bf; background: #fff7ed; }
.v4-transaction-order-context.is-expense > span { color: #a97448; }
.v4-transaction-order-context.is-expense strong { color: #a85f29; }
.v4-transaction-order-context.is-expense small { color: #8f765f; }

.v4-transaction-section { min-width: 0; display: grid; align-content: start; gap: 9px; padding: 12px; border: 1px solid #dee7ec; border-radius: 16px; background: #ffffff; }
.v4-transaction-section.is-details,
.v4-payroll-protection,
.v4-expense-reimbursement,
.v4-transaction-form-error { grid-column: 1 / -1; }
.v4-transaction-section > header { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; }
.v4-transaction-section > header > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #eaf6ff; color: #257fce; font-size: 14px; font-weight: 780; }
.v4-transaction-section > header > div { min-width: 0; display: grid; gap: 2px; }
.v4-transaction-section > header strong { color: #2c4455; font-size: 16px; }
.v4-transaction-section > header small { color: #82919b; font-size: 14px; }
.v4-transaction-fields { min-width: 0; display: grid; gap: 8px; }
.v4-transaction-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v4-transaction-fields .field,
.v4-transaction-comment { min-width: 0; display: grid; gap: 5px; margin: 0 !important; }
.v4-transaction-fields .field > label,
.v4-transaction-fields .field > span,
.v4-transaction-comment > span { color: #6d808e; font-size: 14px; font-weight: 670; }
.v4-transaction-fields :is(input, select),
.v4-transaction-comment textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #d6e1e7; border-radius: 11px; background: #f8fafb; color: #2b4355; font-size: 14px; }
.v4-transaction-fields input[readonly] { color: #667b89; background: #edf2f4; }
.v4-transaction-comment textarea { resize: vertical; }
.v4-transaction-note { margin: 0; padding: 8px 10px; border-radius: 11px; background: #f3f6f8; color: #718491; font-size: 14px; line-height: 1.35; }
.v4-transaction-note.expense-funding-note { background: #fff7ed; color: #8d704e; }
.v4-transaction-form-error { padding: 11px 13px; border: 1px solid #f0c3ba; border-radius: 13px; background: #fff0ec; color: #ad5548; font-size: 14px; font-weight: 650; }

.v4-payroll-protection { min-width: 0; display: grid; gap: 5px; padding: 16px 17px; border: 1px solid #efd2c7; border-radius: 17px; background: #fff2ee; }
.v4-payroll-protection span { color: #ad6252; font-size: 14px; font-weight: 720; }
.v4-payroll-protection strong { color: #823f34; font-size: 18px; }
.v4-payroll-protection small { color: #8a716b; font-size: 14px; line-height: 1.45; }

.v4-expense-reimbursement { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 8px; border: 1px solid #efd7c8; border-radius: 16px; background: #fffaf7; }
.v4-expense-reimbursement > header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v4-expense-reimbursement > header,
.v4-expense-reimbursement-history,
.v4-inline-reimbursement { grid-column: 1 / -1; }
.v4-expense-reimbursement > header > div { min-width: 0; display: grid; gap: 2px; }
.v4-expense-reimbursement > header span { color: #a67861; font-size: 14px; }
.v4-expense-reimbursement > header strong { color: #714d40; font-size: 17px; }
.v4-expense-reimbursement > header > b { flex: 0 0 auto; padding: 7px 9px; border-radius: 10px; background: #edf8f3; color: #438061; font-size: 14px; }
.v4-expense-reimbursement > header > b.is-due { background: #fff0ec; color: #ad5548; }
.v4-expense-reimbursement-summary { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.v4-expense-reimbursement-summary > div { min-width: 0; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 7px; border: 1px solid #eadfd9; border-radius: 10px; background: #ffffff; }
.v4-expense-reimbursement-summary span { color: #8c7b72; font-size: 14px; }
.v4-expense-reimbursement-summary strong { overflow: hidden; color: #5c463d; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-expense-reimbursement-summary .is-due { border-color: #efc9bf; background: #fff2ee; }
.v4-expense-reimbursement-summary .is-due strong { color: #ad5548; }
.v4-expense-reimbursement-summary .is-settled strong { color: #438061; }
.v4-expense-reimbursement-history { min-width: 0; display: grid; overflow: hidden; border: 1px solid #eadfd9; border-radius: 13px; background: #ffffff; }
.v4-expense-reimbursement-history > div { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 9px 10px; border-bottom: 1px solid #eee6e1; }
.v4-expense-reimbursement-history > div:last-child { border-bottom: 0; }
.v4-expense-reimbursement-history span { min-width: 0; display: grid; gap: 2px; }
.v4-expense-reimbursement-history span strong,
.v4-expense-reimbursement-history > div > b { color: #604b42; font-size: 14px; font-variant-numeric: tabular-nums; }
.v4-expense-reimbursement-history small { overflow: hidden; color: #8b7b73; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-expense-reimbursement-history i { padding: 4px 6px; border-radius: 8px; background: #f2f4f5; color: #7f8d95; font-size: 14px; font-style: normal; }
.v4-expense-reimbursement-history button { width: 31px; height: 31px; border: 0; border-radius: 9px; background: #fff0ec; color: #ad5548; font-size: 19px; cursor: pointer; }
.v4-expense-reimbursement-empty { display: none; }
.v4-expense-reimbursement-settled { margin: 0; padding: 8px 10px; border-radius: 11px; background: #f3f6f8; color: #748692; font-size: 14px; }
.v4-expense-reimbursement-settled { background: #edf8f3; color: #438061; }
.v4-expense-reimbursement-toggle,
.v4-inline-reimbursement-save { min-height: 42px; border: 0; border-radius: 12px; background: #dc8740; color: #ffffff; font-size: 14px; font-weight: 740; cursor: pointer; }
.v4-expense-reimbursement-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; }
.v4-expense-reimbursement > .v4-expense-reimbursement-toggle,
.v4-expense-reimbursement > .v4-expense-reimbursement-settled { grid-column: 2; grid-row: 2; min-width: 170px; align-self: stretch; }
.v4-expense-reimbursement-toggle span { font-size: 20px; }
.v4-inline-reimbursement { min-width: 0; display: grid; gap: 10px; padding: 12px; border: 1px solid #ead6ca; border-radius: 14px; background: #ffffff; }
.v4-inline-reimbursement[hidden] { display: none !important; }
.v4-inline-reimbursement-save { padding: 8px 12px; }
.v4-inline-reimbursement[aria-busy="true"] { opacity: .72; cursor: progress; }

.v4-transaction-sheet-foot { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid #e0e7ec; background: rgba(255,255,255,.98); }
.v4-transaction-sheet-foot > div { display: flex; align-items: center; gap: 8px; }
.v4-transaction-sheet-foot button { min-height: 41px; padding: 8px 13px; border: 1px solid #d9e3e9; border-radius: 12px; background: #f3f6f8; color: #526879; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-transaction-sheet-foot button.is-primary { border-color: #3390ec; background: #3390ec; color: #ffffff; }
.v4-transaction-sheet-foot button.is-danger { border-color: #f0c8c0; background: #fff0ec; color: #ad5548; }
.v4-transaction-sheet[aria-busy="true"] { cursor: progress; }

@media (hover: hover) {
  .v4-journal-create:hover,
  .v4-journal-focus-tile button:hover,
  .v4-journal-control-tile button:hover,
  .v4-journal-row button:hover { transform: translateY(-1px); }
  .v4-journal-row:hover { background: #fbfdfe; }
}

@media (max-width: 1024px) {
  .v4-journal-focus-tile { grid-column: span 15; }
  .v4-journal-control-tile { grid-column: span 9; }
  .v4-journal-row { grid-template-columns: minmax(240px, 1fr) minmax(170px, .65fr) 110px 142px; gap: 8px; }
  .v4-journal-row.is-expense { grid-template-columns: minmax(230px, .8fr) minmax(290px, 1.2fr) 110px 142px; }
}

@media (max-width: 860px) {
  .v4-journal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-journal-focus-tile,
  .v4-journal-control-tile { grid-column: 1 / -1; }
  .v4-journal-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; }
  .v4-journal-row.is-expense { grid-template-columns: minmax(0, 1fr) auto; }
  .v4-journal-row-tags { grid-column: 1; padding-left: 54px; }
  .v4-journal-row-order { grid-column: 2; grid-row: 1; align-self: end; }
  .v4-journal-row-amount { grid-column: 2; grid-row: 2; align-self: start; }
}

@media (max-width: 700px) {
  .v4-journal-page { gap: 12px; padding-top: 0; }
  .v4-journal-intro { align-items: stretch; padding: 19px; border-radius: 21px; }
  .v4-journal-intro h1 { font-size: 39px; }
  .v4-journal-create { align-self: center; }
  .v4-journal-metric { min-height: 103px; padding: 14px; border-radius: 17px; }
  .v4-journal-focus-tile,
  .v4-journal-control-tile,
  .v4-journal-active-filters { border-radius: 18px; }
  .v4-journal-day { border-radius: 19px; }
  .v4-journal-filter-values > .v4-journal-period-grid { grid-template-columns: minmax(0, 1fr); }
  dialog.v4-transaction-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 88px);
    inset: auto 8px 8px;
    margin: 0;
    translate: none;
    border-radius: 22px 22px 16px 16px;
  }
  .v4-transaction-sheet { height: min(790px, calc(100dvh - 88px)); }
  .v4-transaction-sheet-head { padding: 15px 16px; }
  .v4-transaction-sheet-body { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .v4-expense-reimbursement { grid-template-columns: minmax(0, 1fr); }
  .v4-expense-reimbursement > :where(header, .v4-expense-reimbursement-summary, .v4-expense-reimbursement-history, .v4-expense-reimbursement-empty, .v4-expense-reimbursement-toggle, .v4-expense-reimbursement-settled, .v4-inline-reimbursement) { grid-column: 1; grid-row: auto; }
  .v4-expense-reimbursement-empty { display: block; }
  .v4-expense-reimbursement-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .v4-journal-intro { flex-direction: column; }
  .v4-journal-create { width: 100%; }
  .v4-journal-focus-tile > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-journal-control-tile { grid-template-columns: minmax(0, 1fr); }
  .v4-journal-control-tile > strong { grid-row: auto; }
  .v4-journal-control-tile > div { grid-column: 1; grid-row: auto; }
  .v4-journal-day > header { align-items: flex-start; padding: 12px 14px; }
  .v4-journal-day > header > div { display: grid; gap: 2px; }
  .v4-journal-day > header > div:last-child { justify-items: end; text-align: right; }
  .v4-journal-row { padding: 12px; }
  .v4-journal-row-main { grid-template-columns: 37px minmax(0, 1fr); gap: 9px; }
  .v4-journal-row-icon { width: 37px; height: 37px; }
  .v4-journal-row-tags { padding-left: 0; }
  .v4-journal-row-order button { min-height: 34px; padding: 6px 8px; }
  .v4-journal-row-amount strong { font-size: 16px; }
  .v4-journal-custom-dates,
  .v4-transaction-fields.two { grid-template-columns: minmax(0, 1fr); }
  .v4-transaction-sheet-foot { align-items: stretch; }
  .v4-transaction-sheet-foot > div:last-child { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-expense-reimbursement > header { align-items: flex-start; }
  .v4-expense-reimbursement-history > div { grid-template-columns: minmax(0, 1fr) auto; }
  .v4-expense-reimbursement-history > div > :last-child { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .v4-journal-page *,
  dialog.v4-transaction-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* V4 employees: operational team and payroll */
.v4-employees-page,
.v4-employee-profile {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding-bottom: 38px;
  color: #263b4d;
  font-family: "Golos Text", system-ui, sans-serif;
}

.v4-employees-page :where(button, input, select, textarea),
.v4-employee-profile :where(button, input, select, textarea) { font: inherit; }

.v4-employees-page :where(button, [tabindex], input, select, textarea):focus-visible,
.v4-employee-profile :where(button, [tabindex], input, select, textarea):focus-visible,
dialog.v4-employee-dialog :where(button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(51, 144, 236, .22);
  outline-offset: 2px;
}

.v4-employees-intro {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 25px 27px;
  overflow: hidden;
  border: 1px solid #d8e4eb;
  border-radius: 26px;
  background: radial-gradient(circle at 76% -100%, rgba(79, 181, 145, .2), transparent 44%), #fff;
  box-shadow: 0 14px 38px rgba(35, 65, 84, .07);
}

.v4-employees-intro > div:first-child { min-width: 0; display: grid; gap: 5px; }
.v4-employees-intro h1 { margin: 0; color: #172b3a; font-size: clamp(42px, 4.2vw, 58px); line-height: .98; letter-spacing: -.055em; }
.v4-employees-intro p { margin: 4px 0 0; color: #7b8c98; font-size: 15px; }
.v4-employees-intro p strong { color: #294153; font-variant-numeric: tabular-nums; }
.v4-employees-intro-actions { min-width: 0; display: flex; align-items: flex-end; gap: 10px; }

.v4-employee-month-control { min-width: 220px; display: grid; gap: 5px; color: #718592; font-size: 14px; font-weight: 660; }
.v4-employee-month-control > span:last-child,
.v4-employee-profile-toolbar label { display: grid; grid-template-columns: 40px minmax(135px, 1fr) 40px; overflow: hidden; border: 1px solid #d8e3ea; border-radius: 14px; background: #f6f9fa; }
.v4-employee-month-control button,
.v4-employee-profile-toolbar label button { border: 0; background: #edf3f6; color: #547083; font-size: 18px; cursor: pointer; }
.v4-employee-month-control input,
.v4-employee-profile-toolbar input { min-width: 0; min-height: 45px; padding: 7px 9px; border: 0; border-inline: 1px solid #d8e3ea; background: #fff; color: #2c4556; font-size: 14px; font-weight: 700; }

.v4-employees-create {
  min-height: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 0;
  border-radius: 16px;
  background: #3390ec;
  color: #fff;
  font-size: 15px;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(51, 144, 236, .23);
  cursor: pointer;
}
.v4-employees-create span { font-size: 22px; font-weight: 450; }

.v4-employee-metric.is-danger { border-color: #efcfc8; background: #fff1ee; }
.v4-employee-metric.is-danger strong { color: #b65348; }
.v4-employee-metric.is-warning { border-color: #efdcb7; background: #fff8e9; }
.v4-employee-metric.is-warning strong { color: #9c6b27; }
.v4-employee-profile-kpis { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.v4-employee-focus-tile button.is-danger { border-color: #efcbc4; background: #fff0ed; color: #ad5548; }
.v4-employee-focus-tile button.is-warning { border-color: #ecd9b8; background: #fff7e8; color: #966722; }
.v4-employee-focus-tile { grid-column: span 14; }
.v4-employee-control-tile { grid-column: span 10; grid-template-columns: auto minmax(0, 1fr); align-content: center; }
.v4-employee-control-tile > span { grid-column: 1; grid-row: 1; align-self: center; }
.v4-employee-control-tile > strong { grid-column: 2; grid-row: 1; align-self: center; justify-self: start; font-size: 19px; }
.v4-employee-control-tile > div { grid-column: 1 / -1; grid-row: 2; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); }
.v4-employee-active-filters { grid-column: 1 / -1; }
.v4-employee-filter-panel { z-index: 150; }
.v4-employee-month-options { display: grid; gap: 8px; }
.v4-employee-month-options > label { display: grid; gap: 6px; padding: 10px; border: 1px solid #dfe7ec; border-radius: 13px; background: #f7f9fa; color: #71838f; font-size: 14px; }
.v4-employee-month-options input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #d7e2e8; border-radius: 10px; background: #fff; color: #2d4657; font-size: 14px; }

.v4-employee-roster { min-width: 0; display: grid; gap: 9px; }
.v4-employee-roster > header { min-width: 0; display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 2px 3px; }
.v4-employee-roster > header > div { display: grid; gap: 2px; }
.v4-employee-roster > header span { color: #7d8e99; font-size: 14px; }
.v4-employee-roster > header h2 { margin: 0; color: #263f51; font-size: 23px; letter-spacing: -.025em; }
.v4-employee-roster > header > strong { min-width: 38px; padding: 7px 10px; border-radius: 11px; background: #eaf5ff; color: #257fce; font-size: 16px; text-align: center; }
.v4-employee-roster.is-inactive { margin-top: 4px; padding-top: 13px; border-top: 1px solid #dce5eb; }
.v4-employee-roster.is-inactive > header > strong { background: #edf1f3; color: #71818c; }
.v4-employee-list { min-width: 0; display: grid; gap: 9px; }

.v4-employee-card { min-width: 0; overflow: hidden; border: 1px solid #dce5eb; border-radius: 20px; background: #fff; box-shadow: 0 8px 24px rgba(35, 65, 84, .045); }
.v4-employee-card.has-overdue { border-color: #edc9c2; box-shadow: 0 8px 24px rgba(151, 72, 60, .055); }
.v4-employee-card.is-inactive { border-color: #dfe4e7; background: #f8fafb; }
.v4-employee-card-main { position: relative; width: 100%; min-width: 0; display: grid; grid-template-columns: 48px minmax(140px, 1.05fr) minmax(115px, .65fr) minmax(125px, .7fr) minmax(170px, 1fr) minmax(145px, .82fr) 22px; align-items: center; gap: 12px; padding: 15px 16px; border: 0; background: transparent; color: #30495a; text-align: left; cursor: pointer; }
.v4-employee-card-main:hover { background: #fbfdfe; }
.v4-employee-avatar,
.v4-employee-profile-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: #e5f5ee; color: #378361; font-size: 20px; font-weight: 800; }
.v4-employee-card.has-overdue .v4-employee-avatar { background: #fff0ed; color: #ad5548; }
.v4-employee-card.is-inactive .v4-employee-avatar { background: #e9eef1; color: #72848f; }
.v4-employee-identity,
.v4-employee-work,
.v4-employee-money,
.v4-employee-goal,
.v4-employee-salary { min-width: 0; display: grid; gap: 4px; }
.v4-employee-identity strong { overflow: hidden; color: #213a4c; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-identity small,
.v4-employee-card-main small,
.v4-employee-card-main em { overflow: hidden; color: #7b8c98; font-size: 14px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-card-main :is(.v4-employee-work, .v4-employee-money, .v4-employee-salary) strong { overflow: hidden; color: #2d4657; font-size: 16px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-work em.is-danger { color: #ad5548; font-weight: 700; }
.v4-employee-goal > span { height: 7px; overflow: hidden; border-radius: 999px; background: #eaf0f3; }
.v4-employee-goal > span i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #55b58e, #3390ec); }
.v4-employee-salary { padding: 9px 10px; border-radius: 13px; background: #f2f6f8; }
.v4-employee-salary.is-due { background: #fff7e8; }
.v4-employee-salary.is-due strong { color: #966722 !important; }
.v4-employee-salary.is-settled strong { color: #3f8665 !important; }
.v4-employee-card-arrow { color: #8aa0ae; font-size: 21px; font-style: normal; }
.v4-employee-card > footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-top: 1px solid #e6ecef; background: #fafcfd; }
.v4-employee-card > footer > span { color: #7d8d98; font-size: 14px; }
.v4-employee-card > footer > div { display: flex; gap: 7px; }
.v4-employee-card > footer button { min-height: 36px; padding: 7px 11px; border: 1px solid #dae4ea; border-radius: 11px; background: #fff; color: #4b687c; font-size: 14px; font-weight: 700; cursor: pointer; }

.v4-employee-empty { min-height: 270px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 25px; border: 1px solid #dce5eb; border-radius: 23px; background: #fff; text-align: center; }
.v4-employee-empty.is-compact { min-height: 150px; }
.v4-employee-empty > span { color: #3390ec; font-size: 40px; font-weight: 800; }
.v4-employee-empty :is(h2, h3) { margin: 0; color: #294153; }
.v4-employee-empty p { margin: 0; color: #778a97; font-size: 14px; }
.v4-employee-empty button { min-height: 40px; margin-top: 5px; padding: 8px 12px; border: 0; border-radius: 11px; background: #e8f4ff; color: #257fce; font-size: 14px; font-weight: 730; cursor: pointer; }

.v4-orders-context-back { justify-self: start; min-height: 39px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #d9e4ea; border-radius: 12px; background: #fff; color: #416278; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-orders-context-back span { color: #3390ec; font-size: 18px; }

/* Employee profile */
.v4-employee-profile-head { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid #d8e4eb; border-radius: 22px; background: radial-gradient(circle at 85% -100%, rgba(51, 144, 236, .18), transparent 45%), #fff; box-shadow: 0 12px 32px rgba(35, 65, 84, .065); }
.v4-employee-profile-back { justify-self: start; min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dce6eb; border-radius: 11px; background: #f6f9fa; color: #4b687c; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-employee-profile-back i { color: #3390ec; font-size: 18px; font-style: normal; }
.v4-employee-profile-person { min-width: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; }
.v4-employee-profile-avatar { width: 52px; height: 52px; border-radius: 17px; font-size: 21px; }
.v4-employee-profile-person > div { min-width: 0; display: grid; gap: 3px; }
.v4-employee-profile-person h1 { margin: 0; overflow: hidden; color: #183143; font-size: clamp(28px, 3vw, 38px); line-height: 1.05; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-profile-person p { min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; overflow: hidden; color: #758894; font-size: 14px; white-space: nowrap; }
.v4-employee-access { flex: 0 0 auto; padding: 4px 7px; border-radius: 8px; background: #edf1f3; color: #6f818c; font-size: 14px; font-weight: 720; }
.v4-employee-access.is-active { background: #eaf7f1; color: #3c8865; }
.v4-employee-profile-actions { display: flex; align-items: center; gap: 8px; }
.v4-employee-profile-actions button,
.v4-employee-payroll-card footer button,
.v4-employee-profile-panel > header button { min-height: 42px; padding: 8px 12px; border: 1px solid #d9e4ea; border-radius: 12px; background: #f6f9fa; color: #4b687c; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-employee-profile-actions button.is-primary,
.v4-employee-payroll-card footer button.is-primary { border-color: #3390ec; background: #3390ec; color: #fff; }

.v4-employee-profile-toolbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #dce5eb; border-radius: 18px; background: #fff; }
.v4-employee-profile-toolbar > div { display: grid; gap: 2px; }
.v4-employee-profile-toolbar > div span { color: #7a8c98; font-size: 14px; }
.v4-employee-profile-toolbar > div strong { color: #2c4556; font-size: 17px; }
.v4-employee-profile-toolbar label { min-width: 220px; }

.v4-employee-payroll-card { min-width: 0; display: grid; gap: 13px; padding: 18px; border: 1px solid #d3e6dc; border-radius: 23px; background: radial-gradient(circle at 85% -120%, rgba(74, 176, 137, .17), transparent 46%), #fff; box-shadow: 0 8px 24px rgba(35, 65, 84, .045); }
.v4-employee-payroll-card > header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.v4-employee-payroll-card > header > div:first-child { min-width: 0; display: grid; gap: 3px; }
.v4-employee-payroll-card > header span { color: #54846e; font-size: 14px; font-weight: 720; }
.v4-employee-payroll-card > header h2 { margin: 0; color: #234636; font-size: 32px; font-variant-numeric: tabular-nums; }
.v4-employee-payroll-card > header p { margin: 0; color: #6e897b; font-size: 14px; }
.v4-employee-payroll-card > header > div:last-child { flex: 0 0 auto; display: grid; justify-items: end; gap: 3px; padding: 11px 13px; border-radius: 14px; background: #eef7f2; }
.v4-employee-payroll-card > header > div:last-child.is-due { background: #fff5df; }
.v4-employee-payroll-card > header > div:last-child strong { color: #2f7455; font-size: 22px; font-variant-numeric: tabular-nums; }
.v4-employee-payroll-card > header > div:last-child.is-due :is(span, strong) { color: #95651f; }
.v4-employee-payroll-card > header small { color: #788b80; font-size: 14px; }
.v4-employee-payroll-grid { min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.v4-employee-payroll-grid > div { min-width: 0; display: grid; gap: 5px; padding: 11px; border: 1px solid #e0e9e4; border-radius: 14px; background: rgba(255,255,255,.82); }
.v4-employee-payroll-grid span,
.v4-employee-payroll-grid small { overflow: hidden; color: #778b80; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-payroll-grid strong { overflow: hidden; color: #2d4d3e; font-size: 17px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-payroll-grid > div.is-due { border-color: #ead7af; background: #fff8e9; }
.v4-employee-payroll-grid > div.is-due strong { color: #95651f; }
.v4-employee-payroll-grid > div.is-settled strong { color: #3c8865; }
.v4-employee-payroll-progress { display: grid; gap: 6px; }
.v4-employee-payroll-progress > span { height: 9px; overflow: hidden; border-radius: 999px; background: #e6efea; }
.v4-employee-payroll-progress > span i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #4fb58d, #3390ec); }
.v4-employee-payroll-progress small { color: #6f887b; font-size: 14px; }
.v4-employee-payroll-card > footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v4-employee-payroll-card > footer > span { color: #70877b; font-size: 14px; }
.v4-employee-payroll-card > footer > div { display: flex; gap: 8px; }
.v4-employee-payroll-card button[disabled] { opacity: .55; cursor: not-allowed; }

.v4-employee-profile-grid { min-width: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.v4-employee-profile-panel { min-width: 0; display: grid; align-content: start; gap: 12px; padding: 16px; overflow: hidden; border: 1px solid #dce5eb; border-radius: 21px; background: #fff; box-shadow: 0 8px 24px rgba(35, 65, 84, .04); }
.v4-employee-profile-panel.is-finance,
.v4-employee-profile-panel.is-orders { grid-column: 1 / -1; }
.v4-employee-profile-panel.is-statuses { grid-column: span 5; }
.v4-employee-profile-panel.is-trend { grid-column: span 7; }
.v4-employee-profile-panel.is-expenses { grid-column: span 7; }
.v4-employee-profile-panel.is-salary-history { grid-column: span 5; }
.v4-employee-profile-panel > header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v4-employee-profile-panel > header > div { min-width: 0; display: grid; gap: 2px; }
.v4-employee-profile-panel > header span { color: #7b8d98; font-size: 14px; }
.v4-employee-profile-panel > header h2 { margin: 0; color: #294253; font-size: 21px; letter-spacing: -.025em; }
.v4-employee-profile-panel > header > strong { color: #294253; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v4-employee-profile-panel > header > strong.is-positive { color: #3f8665; }
.v4-employee-profile-panel > header > strong.is-negative { color: #ad5548; }
.v4-employee-finance-grid { min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.v4-employee-finance-grid > div { min-width: 0; display: grid; gap: 5px; padding: 11px; border-radius: 14px; background: #f4f7f9; }
.v4-employee-finance-grid span,
.v4-employee-finance-grid small { overflow: hidden; color: #748692; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-finance-grid strong { overflow: hidden; color: #294253; font-size: 17px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-finance-grid > div.is-positive { background: #eef8f3; }
.v4-employee-finance-grid > div.is-positive strong { color: #3f8665; }
.v4-employee-finance-grid > div.is-negative { background: #fff0ed; }
.v4-employee-finance-grid > div.is-negative strong { color: #ad5548; }

.v4-employee-order-list,
.v4-employee-expense-list { min-width: 0; display: grid; overflow: hidden; border: 1px solid #e0e7eb; border-radius: 15px; }
.v4-employee-order-row { min-width: 0; min-height: 65px; display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(120px, .45fr) minmax(130px, .45fr) 20px; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-bottom: 1px solid #e7ecef; background: #fff; color: #314b5c; text-align: left; cursor: pointer; }
.v4-employee-order-row:last-child,
.v4-employee-expense-row:last-child { border-bottom: 0; }
.v4-employee-order-row:hover,
.v4-employee-expense-row:hover { background: #f8fbfd; }
.v4-employee-order-row.is-overdue { box-shadow: inset 4px 0 #df7564; }
.v4-employee-order-row > span:first-child { min-width: 0; display: grid; gap: 3px; }
.v4-employee-order-row > span:first-child strong,
.v4-employee-order-row > span:first-child small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-order-row > span:first-child strong { color: #294253; font-size: 15px; }
.v4-employee-order-row > span:first-child small,
.v4-employee-order-row time small,
.v4-employee-order-money small { color: #7c8d98; font-size: 14px; }
.v4-employee-order-row > em { padding: 6px 8px; border-radius: 9px; background: #edf2f5; color: #587080; font-size: 14px; font-style: normal; font-weight: 700; white-space: nowrap; }
.v4-employee-order-row > em.status-new { background: #eaf5ff; color: #257fce; }
.v4-employee-order-row > em.status-work { background: #fff5df; color: #9a6a27; }
.v4-employee-order-row > em.status-revision { background: #fff0ed; color: #ad5548; }
.v4-employee-order-row > em.status-ready { background: #eaf7f1; color: #3f8665; }
.v4-employee-order-row time,
.v4-employee-order-money { min-width: 0; display: grid; gap: 3px; }
.v4-employee-order-row time strong,
.v4-employee-order-money strong { overflow: hidden; color: #345064; font-size: 14px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-order-row time.is-red strong { color: #ad5548; }
.v4-employee-order-row > i { color: #8aa0ae; font-size: 18px; font-style: normal; }

.v4-employee-status-list { min-width: 0; display: grid; gap: 9px; }
.v4-employee-status-list > div { min-width: 0; display: grid; grid-template-columns: minmax(95px, auto) minmax(60px, 1fr) auto auto; align-items: center; gap: 8px; }
.v4-employee-status-list > div > span { padding: 5px 7px; border-radius: 8px; background: #eef3f6; color: #587080; font-size: 14px; font-weight: 700; }
.v4-employee-status-list > div > i { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1f3; }
.v4-employee-status-list > div > i b { height: 100%; display: block; border-radius: inherit; background: #76b7ea; }
.v4-employee-status-list > div > strong,
.v4-employee-status-list > div > small { color: #476276; font-size: 14px; font-variant-numeric: tabular-nums; }

.v4-employee-trend { min-width: 0; min-height: 210px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 8px; padding-top: 8px; }
.v4-employee-trend > div { min-width: 0; height: 100%; display: grid; grid-template-rows: minmax(100px, 1fr) auto auto; align-items: end; gap: 5px; text-align: center; }
.v4-employee-trend > div > span { height: 100%; display: flex; align-items: end; justify-content: center; gap: 5px; padding: 0 4px; border-bottom: 1px solid #dfe6ea; }
.v4-employee-trend > div > span i { width: min(18px, 38%); min-height: 2px; border-radius: 5px 5px 1px 1px; }
.v4-employee-trend i.is-paid { background: #55b58e; }
.v4-employee-trend i.is-cost { background: #e19a58; }
.v4-employee-trend strong,
.v4-employee-trend small { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-trend strong { color: #526b7b; }
.v4-employee-trend small { color: #81919b; font-variant-numeric: tabular-nums; }
.v4-employee-trend-legend { display: flex; gap: 9px; }
.v4-employee-trend-legend span::before { content: ""; width: 8px; height: 8px; display: inline-block; margin-right: 5px; border-radius: 50%; }
.v4-employee-trend-legend span.is-paid::before { background: #55b58e; }
.v4-employee-trend-legend span.is-cost::before { background: #e19a58; }

.v4-employee-expense-categories { min-width: 0; display: grid; gap: 8px; }
.v4-employee-expense-categories > div { min-width: 0; display: grid; grid-template-columns: minmax(120px, .7fr) minmax(60px, 1fr) auto; align-items: center; gap: 8px; }
.v4-employee-expense-categories span,
.v4-employee-expense-categories strong { overflow: hidden; color: #526b7b; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-expense-categories i { height: 7px; overflow: hidden; border-radius: 999px; background: #f1ece7; }
.v4-employee-expense-categories i b { height: 100%; display: block; border-radius: inherit; background: #e19a58; }
.v4-employee-expense-row { min-width: 0; min-height: 57px; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; padding: 9px 11px; border: 0; border-bottom: 1px solid #e7ecef; background: #fff; color: #324d5e; text-align: left; cursor: pointer; }
.v4-employee-expense-row > span { min-width: 0; display: grid; gap: 3px; }
.v4-employee-expense-row > span:last-of-type { justify-items: end; }
.v4-employee-expense-row strong,
.v4-employee-expense-row small { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-expense-row strong { color: #334e60; font-variant-numeric: tabular-nums; }
.v4-employee-expense-row small { color: #7c8d98; }
.v4-employee-expense-row > i { color: #8aa0ae; font-size: 18px; font-style: normal; }
.v4-employee-expense-row.is-salary { background: #f7fbf9; }
.v4-employee-panel-empty { min-height: 110px; display: grid; place-items: center; padding: 18px; border-radius: 14px; background: #f5f8f9; color: #7b8c97; font-size: 14px; text-align: center; }
.v4-employee-formula-note { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 13px; padding: 14px 16px; border: 1px solid #dce5eb; border-radius: 18px; background: #f8fafb; }
.v4-employee-formula-note strong { color: #3c5769; font-size: 14px; }
.v4-employee-formula-note span { color: #718591; font-size: 14px; line-height: 1.5; }

/* V4 employee dialogs */
dialog.v4-employee-dialog {
  width: min(760px, calc(100vw - 88px));
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 24px);
  inset: 50% auto auto 50%;
  margin: 0;
  padding: 0;
  translate: -50% -50%;
  overflow: hidden;
  border: 1px solid #d6e1e8;
  border-radius: 24px;
  background: #f7f9fb;
  box-shadow: 0 30px 80px rgba(23, 33, 43, .25);
}
dialog.v4-employee-dialog.is-payroll { width: min(820px, calc(100vw - 88px)); }
dialog.v4-employee-dialog::backdrop { background: rgba(30, 48, 63, .32); backdrop-filter: blur(5px); }
.v4-employee-modal-form { min-width: 0; max-height: calc(100dvh - 24px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #2b4355; font-family: "Golos Text", system-ui, sans-serif; }
.v4-employee-modal-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; border-bottom: 1px solid #e1e8ed; background: rgba(255,255,255,.98); }
.v4-employee-modal-head > div { min-width: 0; display: grid; gap: 3px; }
.v4-employee-modal-head span { color: #3390ec; font-size: 14px; font-weight: 760; text-transform: uppercase; }
.v4-employee-modal-head h2 { margin: 0; color: #203647; font-size: 25px; letter-spacing: -.03em; }
.v4-employee-modal-head p { margin: 0; color: #718491; font-size: 14px; line-height: 1.4; }
.v4-employee-modal-head > button { width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 12px; background: #eff3f5; color: #627582; font-size: 23px; cursor: pointer; }
.v4-employee-modal-body { min-width: 0; display: grid; align-content: start; gap: 11px; padding: 13px; overflow-y: auto; }
.v4-employee-form-section { min-width: 0; display: grid; gap: 10px; padding: 13px; border: 1px solid #dee7ec; border-radius: 17px; background: #fff; }
.v4-employee-form-section > header { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; }
.v4-employee-form-section > header > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #eaf6ff; color: #257fce; font-size: 14px; font-weight: 780; }
.v4-employee-form-section > header > div { display: grid; gap: 2px; }
.v4-employee-form-section > header strong { color: #2c4455; font-size: 16px; }
.v4-employee-form-section > header small { color: #82919b; font-size: 14px; }
.v4-employee-form-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.v4-employee-form-field { min-width: 0; display: grid; gap: 5px; color: #6d808e; font-size: 14px; font-weight: 670; }
.v4-employee-form-field.is-wide { grid-column: 1 / -1; }
.v4-employee-form-field :is(input, select) { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #d6e1e7; border-radius: 11px; background: #f8fafb; color: #2b4355; font-size: 14px; }
.v4-employee-access-toggle { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; padding: 13px; border: 1px solid #d7e7df; border-radius: 15px; background: #f1f9f5; cursor: pointer; }
.v4-employee-access-toggle input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #4ba77f; }
.v4-employee-access-toggle > span { min-width: 0; display: grid; gap: 4px; }
.v4-employee-access-toggle strong { color: #356a52; font-size: 15px; }
.v4-employee-access-toggle small { color: #668173; font-size: 14px; line-height: 1.4; }
.v4-employee-security-note { padding: 12px 13px; border: 1px solid #d9e5ec; border-radius: 15px; background: #f2f7fa; }
.v4-employee-security-note strong { color: #416075; font-size: 14px; }
.v4-employee-security-note p { margin: 5px 0 0; color: #708491; font-size: 14px; line-height: 1.45; }
.v4-employee-dialog-summary { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.v4-employee-dialog-summary > div { min-width: 0; display: grid; gap: 5px; padding: 11px; border: 1px solid #dfe7ec; border-radius: 13px; background: #fff; }
.v4-employee-dialog-summary span { color: #768894; font-size: 14px; }
.v4-employee-dialog-summary strong { overflow: hidden; color: #2d4657; font-size: 18px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-employee-dialog-summary > div.is-due { border-color: #ecd8b1; background: #fff8e9; }
.v4-employee-dialog-summary > div.is-due strong { color: #95651f; }
.v4-employee-form-error { padding: 11px 13px; border: 1px solid #f0c3ba; border-radius: 13px; background: #fff0ec; color: #ad5548; font-size: 14px; font-weight: 650; }
.v4-employee-modal-foot { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-top: 1px solid #e0e7ec; background: rgba(255,255,255,.98); }
.v4-employee-modal-foot > span { color: #778995; font-size: 14px; }
.v4-employee-modal-foot > div { display: flex; gap: 8px; }
.v4-employee-modal-foot button { min-height: 42px; padding: 8px 13px; border: 1px solid #d9e3e9; border-radius: 12px; background: #f3f6f8; color: #526879; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-employee-modal-foot button.is-primary { border-color: #3390ec; background: #3390ec; color: #fff; }
.v4-employee-modal-form[aria-busy="true"] { opacity: .72; cursor: progress; }

@media (max-width: 1100px) {
  .v4-employee-card-main { grid-template-columns: 48px repeat(2, minmax(0, 1fr)); align-items: start; }
  .v4-employee-identity { grid-column: 2 / -1; align-self: center; padding-right: 26px; }
  .v4-employee-work { grid-column: 2; }
  .v4-employee-money { grid-column: 3; }
  .v4-employee-goal { grid-column: 2; }
  .v4-employee-salary { grid-column: 3; }
  .v4-employee-card-arrow { position: absolute; top: 29px; right: 17px; }
  .v4-employee-payroll-grid,
  .v4-employee-finance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .v4-employees-intro { align-items: stretch; flex-direction: column; }
  .v4-employees-intro-actions { justify-content: space-between; }
  .v4-employee-focus-tile,
  .v4-employee-control-tile { grid-column: 1 / -1; }
  .v4-employee-profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .v4-employee-profile-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .v4-employee-profile-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-payroll-card > header,
  .v4-employee-payroll-card > footer { align-items: stretch; flex-direction: column; }
  .v4-employee-payroll-card > header > div:last-child { justify-items: start; }
  .v4-employee-profile-panel { grid-column: 1 / -1 !important; }
  .v4-employee-order-row { grid-template-columns: minmax(0, 1fr) auto; }
  .v4-employee-order-row > :is(time, .v4-employee-order-money) { grid-column: span 1; }
  .v4-employee-order-row > i { display: none; }
}

@media (max-width: 700px) {
  .v4-employees-page,
  .v4-employee-profile { gap: 12px; padding-top: 0; }
  .v4-employees-intro { padding: 19px; border-radius: 21px; }
  .v4-employees-intro h1 { font-size: 39px; }
  .v4-employees-intro-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .v4-employee-month-control { min-width: 0; }
  .v4-employees-create { width: 100%; }
  .v4-employee-card { border-radius: 18px; }
  .v4-employee-card-main { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 13px; }
  .v4-employee-avatar { width: 44px; height: 44px; border-radius: 14px; }
  .v4-employee-identity { grid-column: 2; }
  .v4-employee-work,
  .v4-employee-money,
  .v4-employee-goal,
  .v4-employee-salary { grid-column: 1 / -1; }
  .v4-employee-card-arrow { top: 25px; right: 13px; }
  .v4-employee-card > footer { align-items: stretch; flex-direction: column; }
  .v4-employee-card > footer > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-profile-head { padding: 14px; border-radius: 19px; }
  .v4-employee-profile-person { grid-template-columns: 46px minmax(0, 1fr); }
  .v4-employee-profile-avatar { width: 46px; height: 46px; border-radius: 15px; }
  .v4-employee-profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-profile-toolbar { align-items: stretch; flex-direction: column; }
  .v4-employee-profile-toolbar label { min-width: 0; }
  .v4-employee-payroll-grid,
  .v4-employee-finance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-payroll-card > footer > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-trend { min-height: 190px; gap: 4px; }
  .v4-employee-trend > div > span { gap: 3px; padding-inline: 1px; }
  .v4-employee-trend small { display: none; }
  .v4-employee-formula-note { grid-template-columns: minmax(0, 1fr); }
  dialog.v4-employee-dialog,
  dialog.v4-employee-dialog.is-payroll { width: calc(100vw - 16px); max-height: calc(100dvh - 88px); inset: auto 8px 8px; margin: 0; translate: none; border-radius: 22px 22px 16px 16px; }
  .v4-employee-modal-form { height: min(760px, calc(100dvh - 88px)); }
  .v4-employee-modal-head { padding: 15px 16px; }
  .v4-employee-modal-body { padding: 12px; }
}

@media (max-width: 520px) {
  .v4-employee-metrics,
  .v4-employee-profile-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-payroll-card > footer > div,
  .v4-employee-form-grid,
  .v4-employee-dialog-summary { grid-template-columns: minmax(0, 1fr); }
  .v4-employee-form-field.is-wide { grid-column: 1; }
  .v4-employee-payroll-grid,
  .v4-employee-finance-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-employee-order-row { grid-template-columns: minmax(0, 1fr); }
  .v4-employee-order-row > :is(em, time, .v4-employee-order-money) { grid-column: 1; justify-self: start; }
  .v4-employee-status-list > div { grid-template-columns: minmax(90px, auto) minmax(40px, 1fr) auto; }
  .v4-employee-status-list > div small { grid-column: 1 / -1; }
  .v4-employee-modal-foot { align-items: stretch; flex-direction: column; }
  .v4-employee-modal-foot > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-employee-profile-back span { display: none; }
  .v4-employee-profile-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .v4-employees-page *,
  .v4-employee-profile *,
  dialog.v4-employee-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* V4 analytics */
.v4-analytics-page {
  min-width: 0;
  display: grid;
  gap: 13px;
}

.v4-analytics-intro {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 3px 18px;
}

.v4-analytics-intro > div { min-width: 0; display: grid; gap: 4px; }
.v4-analytics-intro > div > span { color: #3390ec; font-size: 14px; font-weight: 760; letter-spacing: .075em; text-transform: uppercase; }
.v4-analytics-intro h1 { margin: 0; color: #172b3a; font-size: clamp(42px, 4.4vw, 60px); line-height: .98; letter-spacing: -.055em; }
.v4-analytics-intro p { margin: 3px 0 0; color: #7b8c98; font-size: 14px; }
.v4-analytics-intro p strong { color: #2a4355; }
.v4-analytics-intro > button {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid #d9e4ea;
  border-radius: 14px;
  background: #fff;
  color: #4b687c;
  font-size: 14px;
  font-weight: 740;
  white-space: nowrap;
  cursor: pointer;
}
.v4-analytics-intro > button b { min-width: 24px; padding: 3px 6px; border-radius: 8px; background: #edf3f6; font-size: 14px; }
.v4-analytics-intro > button.is-active { border-color: #bcdcf4; background: #eaf6ff; color: #257fce; }

.v4-analytics-dock {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dce5eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35,65,84,.04);
}
.v4-analytics-dock > span { flex: 0 0 auto; color: #7a8c98; font-size: 14px; font-weight: 680; }
.v4-analytics-dock > div { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.v4-analytics-dock button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #e0e7ec;
  border-radius: 11px;
  background: #f5f8fa;
  color: #536979;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.v4-analytics-dock button.is-active { border-color: #bcdcf4; background: #eaf6ff; color: #257fce; }
.v4-analytics-active-filters { border: 1px solid #dce5eb; border-radius: 18px; background: #fff; }

.v4-analytics-overview {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.65fr);
  gap: 11px;
}
.v4-analytics-ebitda {
  min-width: 0;
  min-height: 254px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  border: 1px solid #172b3a;
  border-radius: 26px;
  background: radial-gradient(circle at 95% 0, rgba(77,180,139,.28), transparent 42%), linear-gradient(145deg, #172b3a, #25475b);
  color: #fff;
  box-shadow: 0 17px 38px rgba(29,54,70,.13);
}
.v4-analytics-ebitda.is-negative { background: radial-gradient(circle at 95% 0, rgba(233,131,112,.27), transparent 42%), linear-gradient(145deg, #302a2a, #594039); }
.v4-analytics-ebitda > span { color: #b9cad5; font-size: 14px; font-weight: 690; }
.v4-analytics-ebitda h2 { margin: 0; color: #d9e7ef; font-size: 17px; letter-spacing: .02em; }
.v4-analytics-ebitda > strong { overflow-wrap: anywhere; font-size: clamp(38px, 4.4vw, 62px); line-height: .98; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.v4-analytics-ebitda p { margin: 9px 0 0; color: #bbccd6; font-size: 14px; line-height: 1.45; }

.v4-analytics-metric-grid { min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.v4-analytics-metric-grid > * { grid-column: span 2; }
.v4-analytics-metric-grid > :nth-child(4),
.v4-analytics-metric-grid > :nth-child(5) { grid-column: span 3; }
.v4-analytics-metric {
  min-width: 0;
  min-height: 122px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px;
  border: 1px solid #dce5eb;
  border-radius: 20px;
  background: #fff;
  color: #284153;
  font: inherit;
  text-align: left;
  box-shadow: 0 8px 24px rgba(35,65,84,.045);
}
button.v4-analytics-metric { cursor: pointer; }
button.v4-analytics-metric:hover { border-color: #bfdcf0; background: #fbfdff; }
.v4-analytics-metric > span:first-child { color: #758894; font-size: 14px; font-weight: 670; }
.v4-analytics-metric > strong { overflow: hidden; color: #263f51; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.06; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-analytics-metric > small { margin-top: auto; overflow: hidden; color: #82919b; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; }
.v4-analytics-delta { width: max-content; max-width: 100%; display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 8px; background: #eef2f4; color: #6f818c; font-size: 14px; font-weight: 720; font-variant-numeric: tabular-nums; }
.v4-analytics-delta.is-good { background: #e9f7f0; color: #35805f; }
.v4-analytics-delta.is-bad { background: #fff0ec; color: #b35447; }
.v4-analytics-delta.is-muted { background: rgba(239,244,247,.15); color: #b9cad5; }
.v4-analytics-metric .v4-analytics-delta.is-muted { background: #f0f4f6; color: #7b8d98; }

.v4-analytics-chart-card {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid #dce5eb;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 9px 26px rgba(35,65,84,.045);
}
.v4-analytics-chart-card > header { min-width: 0; display: flex; align-items: end; justify-content: space-between; gap: 12px 20px; }
.v4-analytics-chart-card > header > div:first-child { min-width: 0; display: grid; gap: 3px; }
.v4-analytics-chart-card > header > div:first-child span { color: #7b8c98; font-size: 14px; font-weight: 690; }
.v4-analytics-chart-card h2 { margin: 0; color: #263f51; font-size: 22px; letter-spacing: -.025em; }
.v4-analytics-legend { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px 13px; }
.v4-analytics-legend span { display: inline-flex; align-items: center; gap: 6px; color: #708390; font-size: 14px; }
.v4-analytics-legend i { width: 9px; height: 9px; border-radius: 3px; background: #3390ec; }
.v4-analytics-legend i.is-expense { background: #e7a14d; }
.v4-analytics-legend i.is-ebitda { background: #4fb889; }
.v4-analytics-chart { min-width: 0; height: 260px; padding: 10px 5px 0; border-top: 1px solid #edf1f3; }
.v4-analytics-chart-points { height: 100%; min-width: 0; display: grid; grid-template-columns: repeat(var(--v4-analytics-points), minmax(0, 1fr)); align-items: end; gap: clamp(1px, .35vw, 5px); }
.v4-analytics-chart-point { position: relative; min-width: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) 22px; align-items: end; outline: none; }
.v4-analytics-chart-bars { height: 100%; min-width: 0; display: flex; align-items: end; justify-content: center; gap: min(2px, 12%); }
.v4-analytics-chart-bars i { width: 28%; min-width: 1px; max-width: 8px; height: var(--income); border-radius: 4px 4px 2px 2px; background: #3390ec; }
.v4-analytics-chart-bars i.is-expense { height: var(--expenses); background: #e7a14d; }
.v4-analytics-chart-bars i.is-ebitda { height: var(--ebitda); background: #4fb889; }
.v4-analytics-chart-bars i.is-ebitda.is-negative { background: #e98370; }
.v4-analytics-chart-point > small { min-width: 0; overflow: visible; color: #82919b; font-size: 14px; line-height: 22px; text-align: center; white-space: nowrap; }
.v4-analytics-chart-tip {
  position: absolute;
  z-index: 8;
  bottom: calc(100% - 18px);
  left: 50%;
  width: 226px;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #d7e2e8;
  border-radius: 13px;
  background: rgba(255,255,255,.98);
  color: #536979;
  box-shadow: 0 14px 34px rgba(23,33,43,.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 7px);
  transition: opacity 130ms ease, transform 130ms ease;
}
.v4-analytics-chart-point:first-child .v4-analytics-chart-tip { left: 0; transform: translate(0, 7px); }
.v4-analytics-chart-point:last-child .v4-analytics-chart-tip { right: 0; left: auto; transform: translate(0, 7px); }
.v4-analytics-chart-tip strong { color: #294254; font-size: 14px; }
.v4-analytics-chart-tip i { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-style: normal; }
.v4-analytics-chart-tip b { color: #273f51; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v4-analytics-chart-point:is(:hover,:focus-visible) .v4-analytics-chart-tip { opacity: 1; transform: translate(-50%, 0); }
.v4-analytics-chart-point:first-child:is(:hover,:focus-visible) .v4-analytics-chart-tip,
.v4-analytics-chart-point:last-child:is(:hover,:focus-visible) .v4-analytics-chart-tip { transform: translate(0, 0); }
.v4-analytics-chart-point:focus-visible .v4-analytics-chart-bars { outline: 3px solid rgba(51,144,236,.18); outline-offset: 2px; border-radius: 5px; }
.v4-analytics-chart-empty { min-height: 210px; display: grid; place-items: center; color: #7c8e99; font-size: 14px; text-align: center; }

.v4-analytics-salary {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid #d3e6dc;
  border-radius: 22px;
  background: radial-gradient(circle at 86% -110%, rgba(79,184,137,.16), transparent 45%), #fff;
}
.v4-analytics-salary > div:first-child { min-width: 0; display: grid; gap: 4px; }
.v4-analytics-salary > div:first-child span { color: #478568; font-size: 14px; font-weight: 740; }
.v4-analytics-salary h2 { margin: 0; color: #294554; font-size: 22px; }
.v4-analytics-salary p { margin: 3px 0 0; color: #758994; font-size: 14px; line-height: 1.42; }
.v4-analytics-salary > div:last-child { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; }
.v4-analytics-salary > div:last-child > span { min-width: 0; display: grid; gap: 4px; padding: 11px; border: 1px solid #dfe8e3; border-radius: 14px; background: rgba(255,255,255,.78); }
.v4-analytics-salary > div:last-child small { color: #73868f; font-size: 14px; }
.v4-analytics-salary > div:last-child strong { overflow: hidden; color: #2c4657; font-size: 19px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-analytics-salary > div:last-child span.is-due { border-color: #ecd9b7; background: #fff8e9; }
.v4-analytics-salary > div:last-child span.is-due strong { color: #966722; }
.v4-analytics-salary > div:last-child span.is-settled strong { color: #378361; }
.v4-analytics-salary button { min-height: 100%; padding: 9px 12px; border: 0; border-radius: 13px; background: #e8f4ff; color: #257fce; font-size: 14px; font-weight: 720; cursor: pointer; }

.v4-analytics-breakdowns { min-width: 0; display: grid; gap: 9px; }
.v4-analytics-breakdown { min-width: 0; overflow: hidden; border: 1px solid #dce5eb; border-radius: 20px; background: #fff; box-shadow: 0 7px 20px rgba(35,65,84,.035); }
.v4-analytics-breakdown.is-open { border-color: #cddfe9; }
.v4-analytics-breakdown-head { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto 35px; align-items: center; gap: 14px; padding: 14px 16px; border: 0; background: #fff; color: #294254; font: inherit; text-align: left; cursor: pointer; }
.v4-analytics-breakdown-head:hover { background: #fbfdfe; }
.v4-analytics-breakdown-head > span { min-width: 0; display: grid; gap: 3px; }
.v4-analytics-breakdown-head > span:first-child small { color: #7d8e99; font-size: 14px; }
.v4-analytics-breakdown-head > span:first-child strong { color: #294254; font-size: 18px; }
.v4-analytics-breakdown-head > span:nth-child(2) { justify-items: end; }
.v4-analytics-breakdown-head > span:nth-child(2) b { color: #2d4657; font-size: 18px; font-variant-numeric: tabular-nums; }
.v4-analytics-breakdown-head > span:nth-child(2) small { color: #80909b; font-size: 14px; }
.v4-analytics-breakdown-head > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #edf4f8; color: #487086; font-size: 21px; font-style: normal; }
.v4-analytics-breakdown-body { min-width: 0; display: grid; border-top: 1px solid #e8edf0; }
.v4-analytics-breakdown-row { min-width: 0; display: grid; grid-template-columns: minmax(190px, 1.35fr) repeat(3, minmax(105px, .68fr)) auto; align-items: center; gap: 12px; padding: 12px 15px; border-bottom: 1px solid #edf1f3; }
.v4-analytics-breakdown-row:last-of-type { border-bottom: 0; }
.v4-analytics-breakdown-row > div:first-child { min-width: 0; display: grid; gap: 3px; }
.v4-analytics-breakdown-row > div:first-child strong { overflow: hidden; color: #294254; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.v4-analytics-breakdown-row > div:first-child small { overflow: hidden; color: #81909b; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-analytics-breakdown-row > span { min-width: 0; display: grid; gap: 3px; }
.v4-analytics-breakdown-row > span small { overflow: hidden; color: #81909b; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v4-analytics-breakdown-row > span b,
.v4-analytics-breakdown-row > b { overflow: hidden; color: #2b4456; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.v4-analytics-breakdown-row .is-positive b { color: #378361; }
.v4-analytics-breakdown-row .is-negative b { color: #ad5548; }
.v4-analytics-breakdown-row > button,
.v4-analytics-row-actions button { min-height: 37px; padding: 7px 10px; border: 0; border-radius: 10px; background: #eaf5ff; color: #257fce; font-size: 14px; font-weight: 710; white-space: nowrap; cursor: pointer; }
.v4-analytics-breakdown-row.is-category { grid-template-columns: minmax(220px, 1fr) minmax(110px, auto) auto; }
.v4-analytics-breakdown-row.is-card { grid-template-columns: minmax(170px, 1fr) repeat(3, minmax(105px, .68fr)) auto; }
.v4-analytics-row-actions { display: flex; gap: 5px; }
.v4-analytics-row-actions button:last-child { background: #fff2ed; color: #ad5b49; }
.v4-analytics-show-all { min-height: 42px; margin: 9px 14px 13px; padding: 8px 12px; border: 1px solid #d9e4ea; border-radius: 11px; background: #f5f8fa; color: #526a7a; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-analytics-breakdown-empty { min-height: 90px; display: grid; place-items: center; padding: 18px; color: #7c8e99; font-size: 14px; text-align: center; }

.v4-analytics-state { min-height: 330px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 28px; border: 1px solid #dce5eb; border-radius: 24px; background: #fff; color: #718590; text-align: center; }
.v4-analytics-state > i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: #eaf5ff; color: #3390ec; font-size: 28px; font-style: normal; }
.v4-analytics-state strong { color: #294254; font-size: 19px; }
.v4-analytics-state span { font-size: 14px; }
.v4-analytics-state button { min-height: 40px; padding: 8px 12px; border: 0; border-radius: 11px; background: #eaf5ff; color: #257fce; font-size: 14px; font-weight: 720; cursor: pointer; }
.v4-analytics-state.is-error { border-color: #efcfc8; background: #fff7f5; }

.v4-analytics-filter-panel { z-index: 161; }
.v4-analytics-filter-values > header small { color: #8a774f; font-size: 14px; line-height: 1.4; }
.v4-analytics-filter-values > .v4-analytics-period-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: none; overflow: visible; }
.v4-analytics-filter-values > .v4-journal-custom-dates { max-height: none; overflow: visible; }

.v4-analytics-origin {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #cce2f2;
  border-radius: 16px;
  background: #f0f8ff;
}
.v4-analytics-origin > button { min-height: 39px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid #c8dfef; border-radius: 11px; background: #fff; color: #257fce; font-size: 14px; font-weight: 730; cursor: pointer; }
.v4-analytics-origin > div { min-width: 0; display: grid; gap: 2px; }
.v4-analytics-origin strong { color: #2777b6; font-size: 14px; }
.v4-analytics-origin span { overflow: hidden; color: #708797; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .v4-analytics-overview { grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); }
  .v4-analytics-breakdown-row { grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(90px, .65fr)) auto; gap: 9px; }
  .v4-analytics-breakdown-row.is-card { grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(90px, .65fr)) auto; }
}

@media (max-width: 860px) {
  .v4-analytics-overview { grid-template-columns: minmax(0, 1fr); }
  .v4-analytics-ebitda { min-height: 220px; }
  .v4-analytics-salary { grid-template-columns: minmax(0, 1fr); }
  .v4-analytics-salary > div:last-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v4-analytics-salary button { grid-column: 1 / -1; min-height: 42px; }
  .v4-analytics-breakdown-row,
  .v4-analytics-breakdown-row.is-card { grid-template-columns: minmax(160px, 1.25fr) repeat(3, minmax(85px, .62fr)); }
  .v4-analytics-breakdown-row > button,
  .v4-analytics-row-actions { grid-column: 1 / -1; justify-self: end; }
  .v4-analytics-breakdown-row.is-category { grid-template-columns: minmax(200px, 1fr) minmax(100px, auto) auto; }
  .v4-analytics-breakdown-row.is-category > button { grid-column: auto; }
}

@media (max-width: 700px) {
  .v4-analytics-page { gap: 10px; }
  .v4-analytics-intro { align-items: stretch; flex-direction: column; padding-top: 0; }
  .v4-analytics-intro h1 { font-size: 42px; }
  .v4-analytics-intro > button { width: 100%; }
  .v4-analytics-dock { align-items: stretch; flex-direction: column; }
  .v4-analytics-dock > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-analytics-dock button:last-child { grid-column: 1 / -1; }
  .v4-analytics-overview { gap: 9px; }
  .v4-analytics-ebitda { min-height: 205px; border-radius: 22px; }
  .v4-analytics-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v4-analytics-metric-grid > *,
  .v4-analytics-metric-grid > :nth-child(4),
  .v4-analytics-metric-grid > :nth-child(5) { grid-column: auto; }
  .v4-analytics-metric { min-height: 126px; padding: 13px; border-radius: 17px; }
  .v4-analytics-chart-card { padding: 14px 10px; border-radius: 20px; }
  .v4-analytics-chart-card > header { align-items: stretch; flex-direction: column; padding-inline: 3px; }
  .v4-analytics-chart-card h2 { font-size: 19px; }
  .v4-analytics-legend { justify-content: flex-start; }
  .v4-analytics-chart { height: 225px; padding-inline: 0; }
  .v4-analytics-chart-point > small { font-size: 14px; }
  .v4-analytics-chart-tip { width: min(220px, calc(100vw - 42px)); }
  .v4-analytics-chart-point:nth-child(-n+6) .v4-analytics-chart-tip { right: auto; left: 0; transform: translate(0, 7px); }
  .v4-analytics-chart-point:nth-last-child(-n+6) .v4-analytics-chart-tip { right: 0; left: auto; transform: translate(0, 7px); }
  .v4-analytics-chart-point:nth-child(-n+6):is(:hover,:focus-visible) .v4-analytics-chart-tip,
  .v4-analytics-chart-point:nth-last-child(-n+6):is(:hover,:focus-visible) .v4-analytics-chart-tip { transform: translate(0, 0); }
  .v4-analytics-salary { padding: 15px; border-radius: 19px; }
  .v4-analytics-salary > div:last-child { grid-template-columns: minmax(0, 1fr); }
  .v4-analytics-salary button { grid-column: auto; min-height: 42px; }
  .v4-analytics-breakdown { border-radius: 18px; }
  .v4-analytics-breakdown-head { grid-template-columns: minmax(0, 1fr) 34px; padding: 13px; }
  .v4-analytics-breakdown-head > span:nth-child(2) { grid-column: 1; grid-row: 2; justify-items: start; grid-template-columns: auto auto; align-items: baseline; gap: 8px; }
  .v4-analytics-breakdown-head > i { grid-column: 2; grid-row: 1 / span 2; }
  .v4-analytics-breakdown-row,
  .v4-analytics-breakdown-row.is-card,
  .v4-analytics-breakdown-row.is-category { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 13px; }
  .v4-analytics-breakdown-row > div:first-child { grid-column: 1 / -1; }
  .v4-analytics-breakdown-row > span { padding: 8px; border-radius: 10px; background: #f5f8fa; }
  .v4-analytics-breakdown-row > button,
  .v4-analytics-row-actions,
  .v4-analytics-breakdown-row.is-category > button { grid-column: 1 / -1; width: 100%; justify-self: stretch; }
  .v4-analytics-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-analytics-breakdown-row.is-category > b { align-self: center; font-size: 17px; }
  .v4-analytics-filter-values > .v4-analytics-period-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-analytics-origin { align-items: stretch; flex-direction: column; }
  .v4-analytics-origin > button { align-self: start; }
  .v4-analytics-origin span { white-space: normal; }
}

@media (max-width: 430px) {
  .v4-analytics-metric-grid { grid-template-columns: minmax(0, 1fr); }
  .v4-analytics-metric { min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .v4-analytics-page * { transition: none !important; scroll-behavior: auto !important; }
}

/* V4 final unification: login, notifications, card balance ring, employee cabinet and audit. */
body[data-crm-role="guest"] {
  min-width: 320px;
  background: #eef4f8;
}

.studby-boot-page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  background:
    radial-gradient(circle at 14% 12%, rgba(51, 144, 236, .18), transparent 30rem),
    radial-gradient(circle at 88% 88%, rgba(91, 224, 178, .17), transparent 28rem),
    linear-gradient(145deg, #f8fbfd 0%, #edf4f8 55%, #e9f6f3 100%);
  color: #17212b;
  font-family: "Golos Text", Inter, ui-sans-serif, system-ui, sans-serif;
}

.studby-boot-page::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .34;
  background-image: radial-gradient(rgba(67, 118, 155, .22) .8px, transparent .8px);
  background-size: 23px 23px;
  pointer-events: none;
}

.studby-boot-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.studby-boot-orb.is-one { width: 170px; height: 170px; top: 11%; right: 13%; border: 33px solid rgba(51, 144, 236, .075); }
.studby-boot-orb.is-two { width: 105px; height: 105px; bottom: 13%; left: 14%; background: rgba(91, 224, 178, .11); }

.studby-boot-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  overflow: hidden;
  border: 1px solid rgba(195, 211, 222, .95);
  border-radius: 28px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 30px 90px rgba(34, 67, 91, .16), 0 2px 5px rgba(34, 67, 91, .05);
  backdrop-filter: blur(22px);
  animation: studbyBootEnter .34s ease-out both;
}

.studby-boot-card > header { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 16px; padding: 25px 26px 21px; border-bottom: 1px solid #e5edf2; }
.studby-boot-logo { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e6dfea; border-radius: 19px; background: linear-gradient(145deg, #fff8f2, #f7f0fb); box-shadow: 0 10px 26px rgba(70, 34, 92, .12); }
.studby-boot-logo img { width: 84%; height: 84%; object-fit: contain; }
.studby-boot-card > header > div { min-width: 0; }
.studby-boot-card > header > div > span { display: block; margin-bottom: 5px; color: #3f1557; font-size: 14px; font-weight: 780; }
.studby-boot-card h1 { margin: 0; color: #17212b; font-size: 28px; line-height: 1.05; letter-spacing: -.045em; }
.studby-boot-body { display: grid; gap: 13px; padding: 20px 26px 24px; }
.studby-boot-body p { margin: 0; color: #718696; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.studby-boot-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e7eef3; }
.studby-boot-progress i { width: 42%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #401256 0%, #f25b45 46%, #3390ec 100%); animation: studbyBootProgress 1.15s ease-in-out infinite; }
.studby-boot-retry { min-height: 46px; border: 0; border-radius: 14px; background: #3390ec; color: #fff; font: inherit; font-size: 14px; font-weight: 780; cursor: pointer; }
.studby-boot-retry:hover, .studby-boot-retry:focus-visible { outline: 0; background: #2783d8; box-shadow: 0 0 0 4px rgba(51, 144, 236, .15); }
.studby-boot-page.is-error .studby-boot-card { border-color: #efc9c1; }
.studby-boot-page.is-error .studby-boot-card > header { border-bottom-color: #f2ddd8; }
.studby-boot-page.is-error .studby-boot-body p { color: #a95044; }

@keyframes studbyBootEnter { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes studbyBootProgress { from { transform: translateX(-105%); } to { transform: translateX(245%); } }

.login-bento-page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 14% 12%, rgba(51, 144, 236, .18), transparent 30rem),
    radial-gradient(circle at 88% 88%, rgba(91, 224, 178, .17), transparent 28rem),
    linear-gradient(145deg, #f8fbfd 0%, #edf4f8 55%, #e9f6f3 100%);
  color: #17212b;
  font-family: "Golos Text", Inter, ui-sans-serif, system-ui, sans-serif;
}

.login-bento-page::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .34;
  background-image: radial-gradient(rgba(67, 118, 155, .22) .8px, transparent .8px);
  background-size: 23px 23px;
  pointer-events: none;
}

.login-bento-orb { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.login-bento-orb.is-one { width: 180px; height: 180px; top: 10%; right: 12%; border: 35px solid rgba(51, 144, 236, .08); }
.login-bento-orb.is-two { width: 110px; height: 110px; bottom: 12%; left: 14%; background: rgba(91, 224, 178, .1); }

.login-bento-card {
  position: relative;
  z-index: 1;
  width: min(510px, 100%);
  overflow: visible;
  border: 1px solid rgba(195, 211, 222, .95);
  border-radius: 30px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 30px 90px rgba(34, 67, 91, .16), 0 2px 5px rgba(34, 67, 91, .05);
  backdrop-filter: blur(22px);
}

.login-bento-head { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 18px; padding: 30px 30px 23px; border-bottom: 1px solid #e5edf2; }
.login-bento-logo { position: relative; width: 62px; height: 62px; display: grid; place-items: center; overflow: hidden; border-radius: 20px; background: linear-gradient(145deg, #48a5f4, #2785d8); box-shadow: 0 13px 27px rgba(45, 139, 222, .25); color: #fff; }
.login-bento-logo i { position: absolute; width: 34px; height: 34px; border: 7px solid rgba(255,255,255,.3); border-radius: 50%; }
.login-bento-logo b { position: relative; font-size: 30px; line-height: 1; transform: translateX(1px); }
.login-bento-head > div > span { display: block; margin: 1px 0 7px; color: #3390ec; font-size: 14px; font-weight: 750; }
.login-bento-head h1 { margin: 0; font-size: 31px; line-height: 1.05; letter-spacing: -.045em; }
.login-bento-head p { margin: 9px 0 0; color: #718696; font-size: 14px; line-height: 1.5; }
.login-bento-fields { display: grid; gap: 17px; padding: 24px 30px 27px; }
.login-bento-field, .login-account-field { position: relative; display: grid; gap: 8px; color: #506779; font-size: 14px; font-weight: 700; }
.login-bento-field > input, .login-password-control, .login-account-trigger { width: 100%; min-height: 58px; border: 1px solid #d7e2e9; border-radius: 17px; background: #f6f9fb; color: #203747; font: inherit; font-size: 16px; }
.login-bento-field > input { padding: 0 16px; }
.login-password-control { display: grid; grid-template-columns: minmax(0, 1fr) 54px; overflow: hidden; }
.login-password-control input { min-width: 0; border: 0; outline: 0; padding: 0 16px; background: transparent; color: inherit; font: inherit; font-size: 16px; }
.login-password-control button { border: 0; border-left: 1px solid #e1e9ee; background: transparent; color: #7790a2; font-size: 20px; cursor: pointer; }
.login-password-control button:hover, .login-password-control button.is-visible { color: #2686dc; background: #eaf5ff; }
.login-bento-field > input:focus, .login-password-control:focus-within, .login-account-trigger:focus-visible { outline: 3px solid rgba(51, 144, 236, .18); border-color: #75b9f4; background: #fff; }
.login-account-trigger { display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; align-items: center; gap: 11px; padding: 8px 14px; text-align: left; cursor: pointer; }
.login-account-trigger.is-open { border-color: #69b3f2; background: #fff; }
.login-account-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: #e4f3ff; color: #287fc8; font-size: 17px; font-style: normal; font-weight: 800; }
.login-account-trigger > span:nth-child(2), .login-account-option > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.login-account-trigger strong, .login-account-option strong { overflow: hidden; color: #21394a; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.login-account-trigger small, .login-account-option small { color: #7a91a2; font-size: 14px; font-weight: 500; }
.login-account-trigger > i { justify-self: end; color: #7890a2; font-size: 18px; font-style: normal; transform: translateY(-2px); }
.login-account-trigger.is-open > i { transform: rotate(180deg) translateY(1px); }
.login-account-placeholder { grid-column: 1 / 3; color: #8397a5; font-size: 15px; font-weight: 550; }
.login-account-list { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; left: 0; max-height: min(350px, 45vh); overflow: auto; display: grid; gap: 4px; padding: 7px; border: 1px solid #d7e3ea; border-radius: 18px; background: #fff; box-shadow: 0 22px 55px rgba(32, 68, 93, .2); }
.login-account-option { min-height: 56px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; align-items: center; gap: 11px; padding: 7px 9px; border: 0; border-radius: 13px; background: transparent; text-align: left; cursor: pointer; }
.login-account-option:hover, .login-account-option:focus-visible { outline: 0; background: #f0f7fc; }
.login-account-option.is-selected { background: #e7f4ff; }
.login-account-option > i { justify-self: center; color: #2486da; font-size: 17px; font-style: normal; }
.login-account-fallback { margin: -8px 0 0; color: #7b8f9c; font-size: 14px; line-height: 1.45; }
.login-bento-error { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #f1c5bd; border-radius: 14px; background: #fff2ef; color: #aa493b; }
.login-bento-error > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #ffdcd5; font-weight: 900; }
.login-bento-error p { margin: 0; font-size: 14px; line-height: 1.4; }
.login-bento-submit { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 17px; background: linear-gradient(135deg, #42a2f3, #2787dc); box-shadow: 0 12px 24px rgba(43, 139, 222, .23); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.login-bento-submit:hover { filter: brightness(1.035); transform: translateY(-1px); }
.login-bento-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.login-bento-card > footer { padding: 14px 30px 17px; border-top: 1px solid #edf2f5; color: #8a9ba8; font-size: 14px; text-align: center; }

.toast-stack { position: fixed; z-index: 1200; top: 20px; right: 20px; width: min(390px, calc(100vw - 32px)); display: grid; gap: 9px; pointer-events: none; }
.toast-stack .toast { position: static; max-width: none; min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 30px; align-items: center; gap: 10px; margin: 0; padding: 10px 10px 10px 12px; border: 1px solid #d9e4eb; border-radius: 17px; background: rgba(255,255,255,.97); box-shadow: 0 18px 48px rgba(30, 60, 82, .18); color: #203747; font-size: 14px; font-weight: 650; pointer-events: auto; backdrop-filter: blur(16px); animation: v4ToastIn .22s ease-out both; }
.toast-stack .toast.is-leaving { animation: v4ToastOut .18s ease-in both; }
.toast-stack .toast-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #e6f6ef; color: #298365; font-size: 17px; font-weight: 900; }
.toast-stack .toast p { margin: 0; line-height: 1.4; }
.toast-stack .toast > button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: #8193a0; font-size: 20px; cursor: pointer; }
.toast-stack .toast > button:hover { background: #f0f4f7; color: #344f61; }
.toast-stack .toast.is-error { border-color: #f0c9c1; }
.toast-stack .toast.is-error .toast-icon { background: #ffe5df; color: #c04e3e; }
.toast-stack .toast.is-warning { border-color: #ecd9a8; }
.toast-stack .toast.is-warning .toast-icon { background: #fff3d6; color: #a56c16; }
.toast-stack .toast.is-info { border-color: #bfdcf3; }
.toast-stack .toast.is-info .toast-icon { background: #e5f3ff; color: #277fc8; }
@keyframes v4ToastIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes v4ToastOut { to { opacity: 0; transform: translateX(12px) scale(.98); } }

.v4-orbit-ring { background: conic-gradient(#65e7b1 0 var(--v4-sergey-share), #55aaff var(--v4-sergey-share) 100%); }
.v4-orbit-visual.is-negative .v4-orbit-ring { background: conic-gradient(#65e7b1 0 var(--v4-sergey-share), #55aaff var(--v4-sergey-share) 100%); }
.v4-orbit-visual.is-empty .v4-orbit-ring,
.v4-orbit-visual.is-private .v4-orbit-ring { background: rgba(255, 255, 255, .1); }
.v4-orbit-chip.is-negative b { color: #ff8f81; }
.v4-orbit-caption { position: absolute; right: 0; bottom: -24px; left: 0; color: #72889c; font-size: 14px; line-height: 1.25; text-align: center; }

.v4-audit-page { min-width: 0; display: grid; gap: 15px; padding-bottom: 34px; color: #1c3140; }
.v4-audit-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 15px 3px 5px; }
.v4-audit-intro h1 { margin: 0; font-size: clamp(38px, 4.5vw, 58px); line-height: 1; letter-spacing: -.06em; }
.v4-audit-intro p { margin: 9px 0 0; color: #738797; font-size: 15px; }
.v4-audit-intro > span { min-width: 110px; display: grid; justify-items: end; color: #8294a1; font-size: 14px; }
.v4-audit-intro > span strong { color: #2487dc; font-size: 30px; line-height: 1; }
.v4-audit-focus { display: flex; gap: 7px; overflow-x: auto; padding: 10px; border: 1px solid #dce6ec; border-radius: 19px; background: #fff; box-shadow: 0 9px 25px rgba(44, 77, 99, .055); scrollbar-width: none; }
.v4-audit-focus::-webkit-scrollbar { display: none; }
.v4-audit-focus button { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid transparent; border-radius: 13px; background: #f2f6f8; color: #647b8c; font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.v4-audit-focus button b { min-width: 23px; padding: 2px 6px; border-radius: 8px; background: rgba(116, 143, 161, .12); font-size: 14px; text-align: center; }
.v4-audit-focus button.is-active { border-color: #b9dcf8; background: #e8f5ff; color: #277fc8; }
.v4-audit-days { display: grid; gap: 15px; }
.v4-audit-day { overflow: hidden; border: 1px solid #dae5eb; border-radius: 21px; background: #fff; box-shadow: 0 12px 34px rgba(44, 77, 99, .06); }
.v4-audit-day > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 17px; border-bottom: 1px solid #e6edf1; background: #f8fafb; }
.v4-audit-day > header h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.v4-audit-day > header span { min-width: 30px; padding: 5px 8px; border-radius: 10px; background: #e9f4fc; color: #2d82c7; font-size: 14px; font-weight: 800; text-align: center; }
.v4-audit-row { width: 100%; min-height: 66px; display: grid; grid-template-columns: 55px minmax(120px, .6fr) 90px minmax(220px, 2fr) minmax(125px, .7fr); align-items: center; gap: 13px; padding: 11px 17px; border: 0; border-bottom: 1px solid #edf2f5; background: #fff; color: inherit; font: inherit; font-size: 14px; text-align: left; }
.v4-audit-row:last-child { border-bottom: 0; }
.v4-audit-row.is-clickable { cursor: pointer; }
.v4-audit-row.is-clickable:hover { background: #f6fbff; }
.v4-audit-row > time { color: #7d91a0; font-variant-numeric: tabular-nums; }
.v4-audit-author { min-width: 0; display: flex; align-items: center; gap: 8px; }
.v4-audit-author i { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #edf4f8; color: #58768b; font-size: 14px; font-style: normal; font-weight: 800; }
.v4-audit-author strong, .v4-audit-message, .v4-audit-object { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.v4-audit-type { justify-self: start; padding: 5px 8px; border-radius: 9px; background: #edf2f5; color: #687e8e; font-size: 14px; font-weight: 700; }
.v4-audit-type.is-create { background: #e5f6ef; color: #2b8667; }
.v4-audit-type.is-update, .v4-audit-type.is-replace, .v4-audit-type.is-rollback { background: #fff1d8; color: #9a691d; }
.v4-audit-type.is-delete { background: #ffe8e3; color: #b84f40; }
.v4-audit-message { line-height: 1.45; white-space: normal; }
.v4-audit-object { display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: #277fc8; font-weight: 700; text-align: right; white-space: nowrap; }
.v4-audit-object i { font-style: normal; }
.v4-audit-row:not(.is-clickable) .v4-audit-object { color: #8092a0; font-weight: 600; }
.v4-audit-more { display: grid; place-items: center; padding: 5px; }
.v4-audit-more button { min-height: 46px; padding: 10px 22px; border: 1px solid #bddbf2; border-radius: 14px; background: #eaf5ff; color: #267fc9; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.v4-audit-empty { min-height: 230px; display: grid; place-content: center; justify-items: center; gap: 7px; border: 1px dashed #cfdde6; border-radius: 21px; background: #f8fbfc; color: #7b8f9d; text-align: center; }
.v4-audit-empty i { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: #e4f5ee; color: #278264; font-size: 22px; font-style: normal; }
.v4-audit-empty strong { color: #294253; font-size: 18px; }
.v4-audit-empty span { font-size: 14px; }

body[data-crm-role="employee"] { min-width: 320px; background: #f1f5f8; }
.employee-bento-shell { --employee-accent: #3390ec; --employee-accent-dark: #247fcf; --employee-accent-soft: #e7f4ff; --employee-ink: #192d3b; --employee-muted: #718695; --employee-line: #d9e4ea; min-height: 100dvh; background: radial-gradient(circle at 8% 0%, rgba(51,144,236,.12), transparent 31rem), radial-gradient(circle at 94% 25%, rgba(88,218,178,.1), transparent 28rem), #f1f5f8; color: var(--employee-ink); font-family: "Golos Text", Inter, ui-sans-serif, system-ui, sans-serif; }
.employee-bento-shell :is(button, input, select, textarea) { font-family: inherit; }
.employee-bento-shell small { font-size: 14px; }
.employee-bento-header { top: 12px; width: min(1440px, calc(100% - 32px)); min-height: 70px; grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr); margin: 0 auto; padding: 10px 13px; border: 1px solid rgba(202,216,225,.95); border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: 0 15px 40px rgba(40,72,94,.1); backdrop-filter: blur(20px); }
.employee-bento-header .employee-brand-mark { width: 45px; height: 45px; border-radius: 15px; background: linear-gradient(145deg, #48a5f4, #2785d8); box-shadow: 0 10px 22px rgba(43,139,222,.22); color: #fff; }
.employee-bento-header .employee-brand strong, .employee-bento-header .employee-user strong { color: #213a4b; font-size: 14px; }
.employee-bento-header .employee-brand small, .employee-bento-header .employee-user small { color: #8295a3; font-size: 14px; }
.employee-bento-header .employee-nav { border-color: #dce7ed; background: #f0f5f8; }
.employee-bento-header .employee-nav-button { min-height: 44px; color: #6d8292; font-size: 14px; }
.employee-bento-header .employee-nav-button:hover, .employee-bento-header .employee-nav-button.is-active { background: #fff; color: #2784d2; box-shadow: 0 5px 15px rgba(44,107,153,.11); }
.employee-bento-header .employee-nav-button b { background: #e4f2fd; color: #277fc8; font-size: 14px; }
.employee-bento-header .employee-user .button { min-height: 42px; border-color: #d9e4ea; border-radius: 13px; background: #f5f8fa; color: #536c7d; font-size: 14px; }
.employee-bento-shell .employee-main { width: min(1440px, 100%); padding: 38px clamp(16px, 3.8vw, 55px) 82px; }
.employee-bento-shell .employee-page-head { align-items: center; margin-bottom: 18px; }
.employee-bento-shell .employee-eyebrow { color: #2e87d4; font-size: 14px; letter-spacing: .08em; }
.employee-bento-shell .employee-page-head h1 { color: #192f3f; font-size: clamp(34px, 4vw, 52px); }
.employee-bento-shell .employee-page-head p { color: #708695; font-size: 15px; }
.employee-bento-shell .employee-dashboard .employee-page-head { padding: 25px 27px; border: 1px solid #cce0ed; border-radius: 24px; background: linear-gradient(135deg, #fff 0%, #eef7fe 67%, #eaf8f4 100%); box-shadow: 0 16px 42px rgba(43,92,125,.09); }
.employee-bento-shell .employee-dashboard .employee-page-head h1 { color: #193346; }
.employee-bento-shell .employee-dashboard .employee-page-head p { color: #6f8595; }
.employee-bento-shell .employee-dashboard .employee-eyebrow { color: #2785d4; }
.employee-bento-shell .employee-dashboard .employee-segmented { border-color: #d6e5ee; background: rgba(255,255,255,.82); }
.employee-bento-shell .employee-dashboard .employee-segmented button { color: #60798b; font-size: 14px; }
.employee-bento-shell .employee-dashboard .employee-segmented button:hover, .employee-bento-shell .employee-dashboard .employee-segmented button.is-active { background: #e6f3fd; color: #267fc8; }
.employee-bento-shell .employee-payroll-card { overflow: hidden; border: 1px solid #cfe1ec; border-radius: 24px; background: #fff; box-shadow: 0 15px 40px rgba(45,78,99,.075); }
.employee-bento-shell .employee-payroll-hero { background: linear-gradient(135deg, #1f75b9, #3390ec 68%, #56b3f8); }
.employee-bento-shell .employee-payroll-hero span, .employee-bento-shell .employee-payroll-hero small { color: rgba(255,255,255,.78); }
.employee-bento-shell .employee-payroll-hero strong { color: #fff; }
.employee-bento-shell .employee-payroll-status { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.14); }
.employee-bento-shell .employee-payroll-facts > div, .employee-bento-shell .employee-payroll-progress { border-color: #e2eaf0; background: #f7fafc; }
.employee-bento-shell .employee-payroll-progress > span i { background: linear-gradient(90deg, #3390ec, #61d8af); }
.employee-bento-shell .employee-kpi { min-height: 142px; border: 1px solid #d9e5eb; border-radius: 20px; background: #fff; box-shadow: 0 11px 29px rgba(42,76,98,.06); }
.employee-bento-shell .employee-kpi:hover { transform: translateY(-2px); box-shadow: 0 17px 37px rgba(42,76,98,.11); }
.employee-bento-shell .employee-kpi > span, .employee-bento-shell .employee-kpi small { font-size: 14px; }
.employee-bento-shell .employee-kpi:is(.is-violet,.is-blue,.is-green,.is-amber,.is-red,.is-slate) > span,
.employee-bento-shell .employee-kpi:is(.is-violet,.is-blue,.is-green,.is-amber,.is-red,.is-slate) > small { color: #718695; }
.employee-bento-shell .employee-kpi strong { color: #1a3446; }
.employee-bento-shell .employee-kpi.is-blue, .employee-bento-shell .employee-kpi.is-violet { background: linear-gradient(145deg, #fff, #edf7ff); }
.employee-bento-shell .employee-panel { border: 1px solid #d9e4ea; border-radius: 22px; background: #fff; box-shadow: 0 13px 34px rgba(43,75,96,.06); }
.employee-bento-shell .employee-panel-head span, .employee-bento-shell .employee-panel-head small, .employee-bento-shell .employee-panel-head button { font-size: 14px; }
.employee-bento-shell .employee-status-track i, .employee-bento-shell .employee-month-bar i { background: linear-gradient(180deg, #50aaf3, #2c87d6); }
.employee-bento-shell .employee-orders-head { padding: 22px 24px; border: 1px solid #d6e3eb; border-radius: 22px; background: #fff; box-shadow: 0 12px 32px rgba(44,76,96,.06); }
.employee-bento-shell .employee-search { min-height: 50px; border-color: #d5e2e9; border-radius: 15px; background: #f5f9fb; }
.employee-bento-shell .employee-search input { font-size: 15px; }
.employee-bento-shell .employee-order-toolbar { border: 1px solid #d9e5eb; border-radius: 19px; background: #fff; }
.employee-bento-shell .employee-filter-chips button, .employee-bento-shell .employee-order-sort label, .employee-bento-shell .employee-order-result span { font-size: 14px; }
.employee-bento-shell .employee-filter-chips button.is-active { border-color: #bcdcf5; background: #e7f4ff; color: #277fc8; }
.employee-bento-shell .employee-order-card { border: 1px solid #d7e3ea; border-radius: 21px; background: #fff; box-shadow: 0 11px 30px rgba(42,76,98,.065); }
.employee-bento-shell .employee-order-card.is-overdue { border-color: #edc8c0; }
.employee-bento-shell .employee-order-card :is(button, select, span, small, em) { font-size: 14px; }
.employee-bento-shell .employee-order-card .button.primary { border-color: #3390ec; background: #3390ec; color: #fff; }

.employee-funnel-page { min-width: 0; }
.employee-funnel-head { padding: 22px 24px; border: 1px solid #d6e3eb; border-radius: 22px; background: linear-gradient(135deg, #fff, #f0f8fe); box-shadow: 0 13px 34px rgba(42,76,98,.07); }
.employee-funnel-tools { display: flex; align-items: center; gap: 9px; }
.employee-funnel-tools label { min-width: 230px; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid #d5e2e9; border-radius: 14px; background: #fff; color: #7a91a1; }
.employee-funnel-tools input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #223c4d; font-size: 14px; }
.employee-funnel-tools > button { min-height: 48px; padding: 9px 14px; border: 1px solid #c9dfef; border-radius: 14px; background: #e9f5ff; color: #277fc8; font-size: 14px; font-weight: 750; cursor: pointer; }
.employee-funnel-board { min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 12px; overflow: visible; margin: 0; padding: 0; scroll-snap-type: none; }
.employee-funnel-column { min-width: 0; min-height: 0 !important; overflow: visible; border: 1px solid #d8e4ea; border-radius: 21px; background: rgba(255,255,255,.72); box-shadow: 0 12px 31px rgba(42,76,98,.055); }
.employee-funnel-column > header { position: static; min-height: 58px; padding: 13px 15px; border-bottom: 1px solid #e2eaf0; background: transparent; }
.employee-funnel-column > header span { display: flex; align-items: center; gap: 8px; color: #284557; font-size: 15px; font-weight: 800; }
.employee-funnel-column > header span i { width: 9px; height: 9px; border-radius: 50%; background: #86aabd; }
.employee-funnel-column.status-work > header span i { background: #3390ec; }
.employee-funnel-column.status-revision > header span i { background: #e8ab3e; }
.employee-funnel-column.status-ready > header span i { background: #48bc8f; }
.employee-funnel-column > header b { min-width: 30px; border-radius: 10px; background: #edf3f6; color: #547083; font-size: 14px; }
.employee-funnel-column .funnel-column-list { min-height: 135px; max-height: none; overflow: visible; display: grid; align-content: start; gap: 10px; padding: 10px; }
.employee-funnel-card { min-width: 0; display: grid; gap: 12px; padding: 13px; border: 1px solid #dbe5eb; border-left: 4px solid #8eb2c5; border-radius: 16px; background: #fff; box-shadow: 0 7px 20px rgba(42,75,96,.06); }
.status-work .employee-funnel-card { border-left-color: #3390ec; }
.status-revision .employee-funnel-card { border-left-color: #e7a83c; }
.status-ready .employee-funnel-card { border-left-color: #45b98c; }
.employee-funnel-card.is-overdue { border-color: #edc7bf; border-left-color: #df6654; }
.employee-funnel-card > header { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.employee-funnel-card > header > button { min-width: 0; display: grid; gap: 2px; border: 0; background: transparent; color: #213b4c; text-align: left; cursor: pointer; }
.employee-funnel-card > header > button span, .employee-funnel-card > header > span { color: #718899; font-size: 14px; }
.employee-funnel-card > header > button strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.employee-funnel-card > header > span.is-red { color: #c75444; font-weight: 700; }
.employee-funnel-task { min-height: 43px; padding: 10px; border: 0; border-radius: 11px; background: #f3f7f9; color: #344f60; font-size: 14px; line-height: 1.4; text-align: left; cursor: pointer; }
.employee-funnel-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.employee-funnel-facts span { min-width: 0; display: grid; gap: 3px; padding: 8px 9px; border-radius: 11px; background: #f5f8fa; }
.employee-funnel-facts small { color: #7b90a0; font-size: 14px; }
.employee-funnel-facts strong { overflow: hidden; color: #2c4556; font-size: 14px; text-overflow: ellipsis; }
.employee-funnel-facts .is-due { background: #fff5df; }
.employee-funnel-facts .is-due strong { color: #9c6a1d; }
.employee-funnel-facts .is-paid { background: #eaf7f1; }
.employee-funnel-facts .is-paid strong { color: #2c8265; }
.employee-funnel-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.employee-funnel-thread { min-height: 37px; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 0; border-radius: 10px; background: #e9f5ff; color: #287fc8; font-size: 14px; font-weight: 700; cursor: pointer; }
.employee-funnel-thread.is-unread { background: #3390ec; color: #fff; }
.employee-funnel-card .funnel-move-actions { display: flex; gap: 5px; }
.employee-funnel-card .funnel-move-actions button { width: 37px; height: 37px; border: 1px solid #d8e3e9; border-radius: 10px; background: #fff; color: #526e80; font-size: 17px; cursor: pointer; }
.employee-funnel-card .funnel-move-actions button:disabled { opacity: .3; cursor: default; }
.employee-funnel-column .funnel-empty { min-height: 112px; display: grid; place-items: center; padding: 15px; border: 1px dashed #d1dfe7; border-radius: 14px; background: rgba(247,250,252,.8); color: #8699a6; font-size: 14px; text-align: center; }
.employee-funnel-archive { margin-top: 14px; border: 1px solid #d9e4ea; border-radius: 21px; background: #fff; box-shadow: 0 12px 31px rgba(42,76,98,.055); }
.employee-funnel-archive :is(span, small, button) { font-size: 14px; }

dialog.dialog.employee-bento-order-dialog, dialog.dialog.employee-bento-thread-dialog { width: min(820px, calc(100vw - 36px)); max-width: none; max-height: min(86dvh, 900px); overflow: hidden; padding: 0; border: 1px solid #cbdce6; border-radius: 26px; background: #f5f8fa; box-shadow: 0 30px 90px rgba(25,50,68,.28); }
body[data-crm-role="employee"] #orderDialog.dialog.employee-bento-order-dialog,
body[data-crm-role="employee"] #threadDialog.dialog.employee-bento-thread-dialog { width: min(820px, calc(100vw - 36px)); max-width: none; max-height: min(86dvh, 900px); border-radius: 26px; }
dialog.employee-bento-order-dialog::backdrop, dialog.employee-bento-thread-dialog::backdrop { background: rgba(31,51,65,.37); backdrop-filter: blur(8px); }
.employee-bento-order-dialog .employee-order-editor, .employee-bento-thread-dialog .thread-shell { max-height: min(86dvh, 900px); display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.employee-bento-order-dialog .employee-order-editor-head, .employee-bento-thread-dialog .thread-head { padding: 20px 22px; border-bottom: 1px solid #dce6ec; background: #fff; }
.employee-bento-order-dialog .employee-order-editor-head > div > span, .employee-bento-thread-dialog .thread-head > div > span { color: #2b86d3; font-size: 14px; }
.employee-bento-order-dialog .employee-order-editor-head h2, .employee-bento-thread-dialog .thread-head h2 { color: #1c3546; font-size: 27px; }
.employee-bento-order-dialog .employee-order-editor-head p, .employee-bento-thread-dialog .thread-head p { color: #748998; font-size: 14px; }
.employee-bento-order-dialog .employee-order-editor-head .icon-button, .employee-bento-thread-dialog .thread-head .icon-button { width: 44px; height: 44px; border: 1px solid #d9e4ea; border-radius: 13px; background: #f2f6f8; color: #587183; font-size: 24px; }
.employee-bento-order-dialog .employee-order-editor-body { overflow-y: auto; padding: 18px 22px; }
.employee-order-form-error { margin-top: 13px; padding: 11px 13px; border: 1px solid #efc3bb; border-radius: 13px; background: #fff0ed; color: #b54b3d; font-size: 14px; font-weight: 650; }
.employee-bento-order-dialog .employee-editor-money > div, .employee-bento-order-dialog .employee-editor-context { border-color: #dce6ec; background: #fff; }
.employee-bento-order-dialog :is(label, input, select, span, small, p, dt, dd, button), .employee-bento-thread-dialog :is(span, small, p, button, textarea) { font-size: 14px; }
.employee-bento-order-dialog .employee-order-editor-foot { padding: 14px 18px; border-top: 1px solid #dce6ec; background: #fff; }
.employee-bento-order-dialog .employee-order-editor-foot .button.primary, .employee-bento-thread-dialog .thread-composer .button.primary { border-color: #3390ec; background: #3390ec; color: #fff; }
.employee-bento-thread-dialog .thread-retention { border-color: #dce6ec; background: #eef7fe; }
.employee-bento-thread-dialog .thread-timeline { min-height: 180px; overflow-y: auto; background: #f3f7f9; }
.employee-bento-thread-dialog .thread-composer { border-top-color: #dce6ec; background: #fff; }

@media (max-width: 980px) {
  .employee-bento-header { grid-template-columns: minmax(160px,1fr) auto auto; }
  .employee-bento-header .employee-user { display: flex; }
  .employee-bento-header .employee-user > span { display: none; }
  .employee-funnel-board { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
  .studby-boot-page { padding: 14px; }
  .studby-boot-card { border-radius: 24px; }
  .studby-boot-card > header { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 21px 19px 18px; }
  .studby-boot-logo { width: 52px; height: 52px; border-radius: 17px; }
  .studby-boot-card h1 { font-size: 25px; }
  .studby-boot-body { padding: 18px 19px 21px; }
  .login-bento-page { align-items: center; padding: 14px; }
  .login-bento-card { border-radius: 24px; }
  .login-bento-head { grid-template-columns: 52px minmax(0,1fr); gap: 14px; padding: 22px 19px 18px; }
  .login-bento-logo { width: 52px; height: 52px; border-radius: 17px; }
  .login-bento-head h1 { font-size: 27px; }
  .login-bento-fields { padding: 19px; }
  .login-bento-card > footer { padding-inline: 19px; }
  .toast-stack { top: auto; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .v4-orbit-caption { bottom: -18px; }
  .v4-audit-intro { align-items: start; }
  .v4-audit-intro h1 { font-size: 42px; }
  .v4-audit-intro p { font-size: 14px; }
  .v4-audit-row { grid-template-columns: 48px minmax(0,1fr) auto; gap: 7px 10px; padding: 12px 13px; }
  .v4-audit-author { grid-column: 2; grid-row: 1; }
  .v4-audit-type { grid-column: 3; grid-row: 1; }
  .v4-audit-message { grid-column: 1 / -1; grid-row: 2; padding-left: 0; }
  .v4-audit-object { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; text-align: left; }
  .employee-bento-header { position: static; width: calc(100% - 20px); min-height: 64px; grid-template-columns: minmax(0,1fr) auto; margin-top: 10px; border-radius: 19px; }
  .employee-bento-header .employee-brand > div small { display: none; }
  .employee-bento-header .employee-nav { display: none; }
  .employee-bento-header .employee-user { display: flex; }
  .employee-bento-header .employee-user > span { display: none; }
  .employee-bento-header .employee-user .button { min-height: 40px; }
  .employee-bento-shell .employee-main { padding: 18px 10px calc(96px + env(safe-area-inset-bottom)); }
  .employee-bento-shell .employee-page-head, .employee-funnel-head { align-items: stretch; flex-direction: column; padding: 18px; }
  .employee-bento-shell .employee-page-head h1 { font-size: 36px; }
  .employee-bento-shell .employee-dashboard .employee-page-head { padding: 19px; }
  .employee-bento-shell .employee-period-controls { width: 100%; }
  .employee-bento-shell .employee-segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .employee-bento-shell .employee-segmented button { min-width: 0; }
  .employee-bento-shell .employee-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .employee-bento-shell .employee-kpi { min-height: 126px; }
  .employee-bento-shell .employee-dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .employee-funnel-tools { align-items: stretch; flex-direction: column; }
  .employee-funnel-tools label { min-width: 0; width: 100%; }
  .employee-funnel-tools > button { width: 100%; }
  .employee-funnel-board { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .employee-funnel-column .funnel-column-list { min-height: 85px; }
  .employee-bento-shell .employee-mobile-nav { border-color: #d3e1e9; background: rgba(255,255,255,.94); box-shadow: 0 -10px 30px rgba(41,75,96,.12); backdrop-filter: blur(18px); }
  .employee-bento-shell .employee-mobile-nav button { color: #708696; font-size: 14px; }
  .employee-bento-shell .employee-mobile-nav button.is-active { color: #2785d3; }
  dialog.dialog.employee-bento-order-dialog, dialog.dialog.employee-bento-thread-dialog { width: 100vw; max-width: none; height: auto; max-height: 91dvh; margin: auto 0 0; border-width: 1px 0 0; border-radius: 25px 25px 0 0; }
  body[data-crm-role="employee"] #orderDialog.dialog.employee-bento-order-dialog,
  body[data-crm-role="employee"] #threadDialog.dialog.employee-bento-thread-dialog { width: 100vw; max-width: none; height: auto; max-height: 91dvh; margin: auto 0 0; border-width: 1px 0 0; border-radius: 25px 25px 0 0; }
  .employee-bento-order-dialog .employee-order-editor, .employee-bento-thread-dialog .thread-shell { max-height: 91dvh; }
  .employee-bento-order-dialog .employee-order-editor-head, .employee-bento-thread-dialog .thread-head { padding: 17px; }
  .employee-bento-order-dialog .employee-order-editor-body { padding: 14px; }
  .employee-bento-order-dialog .employee-order-editor-foot { flex-wrap: wrap; padding: 12px; }
}

@media (max-width: 430px) {
  .login-bento-head p { display: none; }
  .login-bento-fields { gap: 14px; }
  .v4-audit-intro > span { display: none; }
  .v4-audit-focus { border-radius: 16px; }
  .employee-bento-shell .employee-kpi-grid { grid-template-columns: minmax(0,1fr); }
  .employee-bento-shell .employee-kpi { min-height: 112px; }
  .employee-funnel-facts { grid-template-columns: minmax(0,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .studby-boot-page *, .login-bento-page *, .toast-stack *, .employee-bento-shell *, .v4-audit-page * { animation: none !important; transition: none !important; }
  .studby-boot-progress i { width: 62%; }
}

/* Studby UI: единый брендинг, персональные уведомления и спокойный Telegram-blue чат. */
.v4-brand-tile { justify-content: flex-start; padding-inline: 20px; }
.v4-brand-tile > strong { color: #1e3545; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }

.login-bento-logo,
.employee-bento-header .employee-brand-mark {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e6dfea;
  background: linear-gradient(145deg, #fff8f2, #f7f0fb);
  box-shadow: 0 10px 26px rgba(70, 34, 92, .12);
}
.login-bento-logo img,
.employee-bento-header .employee-brand-mark img { width: 84%; height: 84%; object-fit: contain; }
.employee-bento-header .employee-brand strong { font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.employee-bento-header .employee-brand > div { display: flex; align-items: center; }

.login-account-trigger.is-loading { grid-template-columns: auto minmax(0,1fr); justify-content: start; cursor: wait; }
.login-account-fallback { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -5px 0 0; color: #718696; font-size: 14px; line-height: 1.4; }
.login-account-fallback button { flex: 0 0 auto; min-height: 38px; padding: 7px 11px; border: 1px solid #c7def0; border-radius: 12px; background: #edf7ff; color: #277fc8; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.notification-spinner { width: 19px; height: 19px; display: inline-block; flex: 0 0 auto; border: 2px solid #c6dceb; border-top-color: #3390ec; border-radius: 50%; animation: notification-spin .7s linear infinite; }
@keyframes notification-spin { to { transform: rotate(360deg); } }

.notification-bell {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #d9e5ec;
  border-radius: 14px;
  background: #f5f9fb;
  color: #607789;
  cursor: pointer;
}
.notification-bell:hover,
.notification-bell:focus-visible { border-color: #9dcdf1; outline: 0; background: #eaf6ff; color: #2784d2; box-shadow: 0 0 0 4px rgba(51,144,236,.12); }
.notification-bell svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-bell.has-unread { border-color: #b8d9f2; background: #eaf6ff; color: #2681cd; }
.notification-bell > b { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: #3390ec; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }

.notification-root { position: relative; z-index: 260; }
.notification-scrim { position: fixed; z-index: 260; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(31,53,69,.26); backdrop-filter: blur(3px); cursor: default; }
.notification-panel { position: fixed; z-index: 261; top: 16px; right: 16px; bottom: 16px; width: min(430px, calc(100vw - 32px)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid #d7e4eb; border-radius: 27px; background: #f4f8fa; box-shadow: 0 24px 80px rgba(29,55,73,.24); color: #203746; font-family: "Golos Text", Inter, ui-sans-serif, system-ui, sans-serif; }
.notification-panel-head { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px 15px 21px; border-bottom: 1px solid #dde8ee; background: rgba(255,255,255,.94); }
.notification-panel-head > div:first-child { min-width: 0; }
.notification-panel-head > div:first-child > span { color: #3087cf; font-size: 14px; font-weight: 750; }
.notification-panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 3px 0 0; font-size: 24px; line-height: 1.1; letter-spacing: -.035em; }
.notification-panel-head h2 b { min-width: 25px; padding: 4px 7px; border-radius: 9px; background: #e7f4ff; color: #2982cd; font-size: 14px; text-align: center; }
.notification-panel-head > div:last-child { display: flex; align-items: center; gap: 7px; }
.notification-panel-head button { min-height: 40px; padding: 8px 11px; border: 1px solid #d7e4eb; border-radius: 12px; background: #f5f9fb; color: #526b7d; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.notification-panel-head .notification-close { width: 40px; padding: 0; font-size: 25px; font-weight: 400; line-height: 1; }
.notification-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 9px; padding: 12px; overscroll-behavior: contain; }
.notification-card { width: 100%; min-width: 0; display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: start; gap: 11px; padding: 13px; border: 1px solid #dce7ed; border-radius: 18px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.notification-card:hover { border-color: #b9d8ee; background: #f8fcff; }
.notification-card.is-read { opacity: .73; }
.notification-card.is-unread { border-color: #bedcf2; box-shadow: inset 4px 0 0 #52a6ea; }
.notification-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: #e8f4fd; color: #2d83ca; font-size: 19px; font-weight: 800; }
.notification-card.is-file .notification-card-icon { background: #e8f7f1; color: #318466; }
.notification-card.is-status .notification-card-icon { background: #eef1fb; color: #6579bd; }
.notification-card-copy { min-width: 0; display: grid; gap: 6px; }
.notification-card-top { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.notification-card-top strong { min-width: 0; overflow: hidden; color: #213b4c; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.notification-card-top time { flex: 0 0 auto; color: #8a9ba8; font-size: 14px; }
.notification-card-content { overflow: hidden; display: -webkit-box; color: #304c5e; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-card-context { overflow: hidden; color: #7a8f9e; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.notification-empty { min-height: 230px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 25px; color: #7b8e9b; text-align: center; }
.notification-empty > span:not(.notification-spinner) { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: #e6f6ef; color: #2f8968; font-size: 22px; }
.notification-empty strong { color: #2a4353; font-size: 17px; }
.notification-empty small,
.notification-empty > span { font-size: 14px; }
.notification-empty.is-error strong { color: #af5147; }
.notification-empty button,
.notification-panel > footer button { min-height: 43px; padding: 9px 15px; border: 1px solid #bddbf1; border-radius: 13px; background: #e9f5ff; color: #287fc9; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.notification-panel > footer { display: grid; place-items: center; padding: 10px 14px 14px; border-top: 1px solid #e0e9ee; background: #fff; }
body.notifications-open { overflow: hidden; }

@media (min-width: 701px) {
  body[data-crm-role="owner"] .toast-stack { top: 156px; }
  body[data-crm-role="employee"] .toast-stack { top: 98px; }
}

.employee-bento-shell .employee-payroll-card { padding: 14px; border-radius: 28px; }
.employee-bento-shell .employee-payroll-hero { padding: 25px 27px; border-radius: 21px; }
.employee-bento-shell .employee-payroll-facts { margin-inline: 3px; }
.employee-bento-shell .employee-payroll-progress { margin: 16px 3px 3px; padding: 15px; border: 1px solid #e2eaf0; border-radius: 16px; }
.employee-bento-shell .employee-order-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px; }
.employee-bento-shell .employee-filter-chips { overflow: visible; padding: 0; }
.employee-bento-shell .employee-filter-chips button b,
.employee-bento-shell .employee-order-sort select { font-size: 14px; }
.employee-bento-shell .employee-order-sort { align-items: center; }

.funnel-card-thread button.is-unread,
.button.is-unread,
.v4-funnel-chat.is-unread,
.v4-funnel-archive-card > footer button.is-unread,
.employee-funnel-thread.is-unread {
  border-color: #b9dcf5;
  background: #e6f4ff;
  color: #267fc8;
  box-shadow: none;
}
.funnel-card-thread button.is-unread::before,
.button.is-unread::before { display: none; content: none; }

.thread-shell { min-width: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto auto; }
.thread-item { position: relative; }
.thread-item:has(.thread-delete) { padding-right: 45px; }
.thread-delete,
.v4-order-thread-tile .thread-delete {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  justify-self: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8295a2;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.thread-delete:hover,
.thread-delete:focus-visible { outline: 0; background: #ffe9e5; color: #b95246; }
.thread-upload-progress { width: 100%; min-width: 0; max-height: 220px; gap: 8px; background: #f5f9fb; }
.thread-upload-progress > div,
.v4-order-thread-tile .thread-upload-progress > div {
  --upload-progress: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 7px 12px;
  padding: 11px 13px;
  border: 1px solid #d6e4ec;
  border-radius: 14px;
  background: #fff;
  color: #4d687a;
  font-size: 14px;
}
.thread-upload-progress > div { width: 100%; min-width: 0; }
.thread-upload-progress button { font-size: 14px; }
.thread-upload-progress > div::before { position: absolute; z-index: -1; inset: 0 auto 0 0; width: var(--upload-progress); background: #e1f2ff; content: ""; transition: width 110ms linear; }
.thread-upload-progress > div.is-waiting::before { background: #edf3f6; }
.thread-upload-progress > div.is-done { border-color: #b9dfcf; color: #2d7359; background: #eff9f5; }
.thread-upload-progress > div.is-done::before { width: 100%; background: #dff4eb; }
.thread-upload-progress > div.is-error { border-color: #ecc7c0; color: #aa5045; background: #fff5f3; }
.thread-upload-progress > div.is-error::before { background: #ffe4df; }
.thread-upload-progress > div > span:first-child { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.thread-upload-progress > div > strong { color: inherit; font-size: 14px; white-space: nowrap; }
.thread-upload-actions { grid-column: 1 / -1; }

@media (max-width: 980px) {
  .employee-bento-shell .employee-order-toolbar { grid-template-columns: minmax(0,1fr); align-items: stretch; }
  .employee-bento-shell .employee-filter-chips { flex-wrap: wrap; }
  .employee-bento-shell .employee-order-sort { justify-content: space-between; }
}

@media (max-width: 700px) {
  .notification-panel { top: auto; right: 8px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 8px; width: auto; max-height: min(76dvh, 720px); border-radius: 25px; }
  .notification-panel-head { min-height: 76px; padding: 14px 13px 13px 17px; }
  .notification-panel-head h2 { font-size: 22px; }
  .notification-panel-head > div:last-child > button:first-child:not(.notification-close) { padding-inline: 9px; }
  .notification-list { padding: 9px; }
  .notification-card { grid-template-columns: 36px minmax(0,1fr); gap: 9px; padding: 11px; border-radius: 16px; }
  .notification-card-icon { width: 36px; height: 36px; border-radius: 12px; }
  .notification-card-top time { display: none; }
  .login-account-fallback { align-items: stretch; flex-direction: column; }
  .login-account-fallback button { width: 100%; }
  .employee-bento-header .employee-brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .employee-bento-header .employee-brand strong { font-size: 15px; }
  .employee-bento-header .notification-bell { width: 40px; height: 40px; }
  .employee-bento-shell .employee-payroll-card { padding: 9px; border-radius: 24px; }
  .employee-bento-shell .employee-payroll-hero { padding: 20px; border-radius: 18px; }
  .employee-bento-shell .employee-order-sort { align-items: stretch; flex-direction: column; }
  .thread-upload-progress > div { grid-template-columns: minmax(0,1fr); }
  .thread-upload-progress > div > strong { white-space: normal; }
}
