:root {
  --blue: #0b8dcb;
  --blue-dark: #077db4;
  --red: #ef4036;
  --green: #26a269;
  --amber: #c58a12;
  --ink: #202733;
  --muted: #7b8491;
  --line: #e5e9ee;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --shadow: 0 18px 46px rgba(27, 42, 63, 0.08);
  --radius: 8px;
  --content-max: 1500px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f2f5f8;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.mobile-app-return {
  position: fixed;
  z-index: 1000;
  top: 12px;
  right: 16px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(11, 141, 203, 0.28);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.mobile-app-return:hover {
  color: #fff;
  background: var(--blue-dark);
}

@media (max-width: 640px) {
  .mobile-app-return {
    top: auto;
    right: 16px;
    bottom: 16px;
  }
}

.top-strip {
  height: 30px;
  border-bottom: 1px solid #b6c8dd;
  background: #edf3fa;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  gap: 14px;
}

.brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-logo {
  display: block;
  width: min(230px, 26vw);
  max-height: 58px;
  object-fit: contain;
}

.brand-product {
  display: grid;
  gap: 3px;
}

.brand-check {
  position: relative;
  width: 44px;
  height: 38px;
}

.brand-check::before,
.brand-check::after {
  position: absolute;
  content: "";
  border-radius: 4px;
  transform-origin: left center;
}

.brand-check::before {
  left: 2px;
  top: 21px;
  width: 18px;
  height: 6px;
  background: var(--blue);
  transform: rotate(48deg);
}

.brand-check::after {
  left: 16px;
  top: 28px;
  width: 34px;
  height: 6px;
  background: var(--red);
  transform: rotate(-52deg);
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  font-size: 24px;
}

.brand-title {
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  color: var(--blue);
}

.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.main-header {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(360px, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 24px clamp(22px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.upload-box {
  display: flex;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  overflow: hidden;
}

.upload-box input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-label {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--muted);
  cursor: pointer;
}

.file-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-icon svg,
.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button,
.small-button,
.ghost-button,
.danger-button,
.nav-item,
.auth-tabs button,
.icon-button {
  border: 0;
  border-radius: var(--radius);
}

.primary-button,
.small-button {
  color: #fff;
  background: var(--blue);
  font-weight: 700;
}

.primary-button {
  min-height: 50px;
  padding: 0 22px;
}

.primary-button:hover,
.small-button:hover {
  background: var(--blue-dark);
}

.primary-button:disabled {
  opacity: 0.6;
}

.primary-button.wide {
  width: 100%;
}

.small-button {
  min-height: 40px;
  padding: 0 15px;
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--ink);
  background: #eef3f7;
}

.danger-button {
  min-height: 40px;
  padding: 0 16px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}

.danger-button:hover {
  background: #d9342c;
}

.ghost-button:disabled,
.danger-button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-account {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
}

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

.user-account strong {
  font-weight: 800;
}

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

.blue-nav {
  background: var(--blue);
}

.nav-inner {
  display: flex;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 30px);
}

.nav-item {
  height: 66px;
  padding: 0 32px;
  color: #fff;
  background: transparent;
  border-radius: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(0, 0, 0, 0.1);
}

.workspace {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 30px) 52px;
}

.notice {
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 650;
}

.notice.success {
  color: #11613e;
  border-color: #bfe8d5;
  background: #ecfbf4;
}

.notice.error {
  color: #a61f18;
  border-color: #f2c1bd;
  background: #fff0ef;
}

.report-manager {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(430px, 0.95fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 35, 52, 0.05);
}

.manager-current {
  min-width: 0;
}

.manager-current strong,
.manager-current small {
  display: block;
}

.manager-current strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-current small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.manager-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.manager-controls select {
  width: 100%;
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.advertising-upload {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #cfe4f3;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #f8fcff;
}

.advertising-upload-copy h2,
.advertising-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
}

.advertising-upload-copy p,
.advertising-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.advertising-file-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.advertising-file-meta strong,
.advertising-file-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advertising-file-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.advertising-file-meta span {
  color: var(--muted);
  font-size: 12px;
}

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

.advertising-upload-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.secondary-file-label {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  padding: 0 13px;
  border: 1px dashed #9fcbe7;
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.secondary-file-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.report-toolbar select,
.report-toolbar input,
.analytics-controls select,
.search-box input,
.bulk-cost input,
.expense-form input,
.auth-form input,
.cost-input,
.cost-row input,
.data-table input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.report-toolbar select,
.analytics-controls select {
  padding: 0 34px 0 12px;
}

.report-toolbar input {
  padding: 0 12px;
}

.period-tools {
  display: grid;
  grid-template-columns: minmax(190px, 220px) 150px 150px auto;
  gap: 10px;
  align-items: end;
}

.toolbar-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  text-align: right;
}

.report-meta strong {
  color: var(--ink);
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.advertising-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #d8e8f4;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 35, 52, 0.04);
}

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

.advertising-attribution {
  max-width: 360px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: #f5f9fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.advertising-kpi {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.advertising-kpi span {
  display: block;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.advertising-kpi strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  white-space: nowrap;
}

.advertising-kpi.red strong { color: var(--red); }
.advertising-kpi.blue strong { color: var(--blue-dark); }
.advertising-kpi.green strong { color: var(--green); }
.advertising-kpi.gray strong { color: #596574; }

.empty-advertising {
  display: flex;
  min-height: 110px;
  align-items: center;
  border-style: dashed;
  background: #fbfdff;
}

.kpi-card {
  min-height: 118px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 26px rgba(18, 35, 52, 0.04);
}

.kpi-card span {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  font-size: clamp(20px, 1.45vw, 27px);
  line-height: 1.12;
  white-space: nowrap;
}

.kpi-card.red {
  border-top-color: var(--red);
}

.kpi-card.green {
  border-top-color: var(--green);
}

.kpi-card.amber {
  border-top-color: var(--amber);
}

.kpi-card.gray {
  border-top-color: #8390a0;
}

.action-strip {
  display: grid;
  grid-template-columns: 1.15fr repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.action-strip button,
.action-score {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 26px rgba(18, 35, 52, 0.04);
  text-align: left;
}

.action-strip button:hover,
.break-card:hover,
.abc-item:hover,
.risk-line:hover {
  border-color: rgba(11, 141, 203, 0.42);
  box-shadow: 0 12px 28px rgba(11, 141, 203, 0.1);
}

.action-strip span,
.action-score span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.action-strip strong,
.action-score strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
}

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

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

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

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

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

.panel-head.compact {
  margin-bottom: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-card {
  min-height: 300px;
}

.line-chart {
  width: 100%;
  height: auto;
  max-height: 300px;
}

.axis {
  stroke: #d8dee6;
  stroke-width: 1;
}

.line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line.revenue {
  stroke: var(--blue);
}

.line.profit {
  stroke: var(--red);
}

.dot {
  stroke: #fff;
  stroke-width: 2;
}

.revenue-dot {
  fill: var(--blue);
}

.profit-dot {
  fill: var(--red);
}

.line-chart text {
  fill: var(--muted);
  font-size: 13px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.chart-legend i {
  width: 20px;
  height: 4px;
  border-radius: 4px;
}

.legend-blue {
  background: var(--blue);
}

.legend-red {
  background: var(--red);
}

.breakdown {
  display: grid;
  gap: 15px;
}

.break-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 13px;
}

.break-row span {
  color: var(--muted);
}

.break-row strong {
  white-space: nowrap;
}

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

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

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

.formula-row,
.formula-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.formula-row span,
.formula-total span {
  color: var(--muted);
  font-size: 13px;
}

.formula-row strong,
.formula-total strong {
  white-space: nowrap;
}

.formula-total {
  margin-top: 4px;
  padding: 13px 0 0;
  border-bottom: 0;
  border-top: 2px solid var(--line);
}

.formula-total span {
  color: var(--ink);
  font-weight: 800;
}

.break-list,
.risk-list {
  display: grid;
  gap: 9px;
}

.break-card,
.risk-line,
.abc-item {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 8px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
}

.break-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.break-card strong,
.risk-line strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.break-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.break-card b,
.risk-line b {
  white-space: nowrap;
}

.break-card i {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--blue);
}

.loan-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.loan-summary > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.loan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loan-tag {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #cfe5f4;
  border-radius: 8px;
  background: #f1f9fe;
  color: var(--ink);
  text-align: left;
}

.loan-tag strong {
  font-size: 13px;
}

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

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

.abc-item {
  min-height: 128px;
  align-content: start;
}

.abc-item span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.abc-item.b span {
  background: var(--green);
}

.abc-item.c span {
  background: var(--amber);
}

.abc-item strong {
  font-size: 13px;
}

.abc-item b {
  color: var(--ink);
}

.abc-item i {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.risk-line {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table-wrap.no-scroll {
  overflow: hidden;
}

.data-table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  background: #fff;
}

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

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #5d6673;
  background: #f7f9fb;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.product-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.product-link {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.32;
  text-align: left;
  text-overflow: ellipsis;
  white-space: normal;
}

.product-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.compact-table .product-link {
  font-size: 14px;
  -webkit-line-clamp: 3;
}

.compact-table th:first-child,
.compact-table td:first-child {
  width: 48%;
}

.order-id {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.positive {
  color: #128653;
  font-weight: 750;
}

.negative {
  color: #d0332b;
  font-weight: 750;
}

.risk {
  display: inline-flex;
  min-width: 74px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.risk.ok {
  color: #0d6d44;
  background: #e1f6ec;
}

.risk.warn {
  color: #906003;
  background: #fff1cd;
}

.provisional {
  display: block;
  margin-top: 3px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.risk.bad {
  color: #a61f18;
  background: #ffe3e1;
}

.risk.muted-risk {
  color: #5d6673;
  background: #edf1f5;
}

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

.expense-form input,
.auth-form input {
  min-width: 0;
  padding: 0 12px;
}

.expense-form .small-button {
  width: 100%;
}

.expense-list {
  display: grid;
  gap: 9px;
}

.expense-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.expense-item strong {
  display: block;
  font-size: 13px;
}

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

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--red);
  background: #fff0ef;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.product-costs {
  display: none;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.cost-list {
  display: grid;
  max-height: 640px;
  overflow: auto;
  gap: 8px;
  padding-right: 4px;
}

.cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.cost-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.cost-row input,
.data-table input {
  width: 100%;
  padding: 0 8px;
}

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

.analytics-head h2 {
  margin: 0;
  font-size: 22px;
}

.analytics-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.summary-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.summary-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-metric strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warn-text {
  color: var(--amber);
}

.analytics-controls {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) repeat(5, minmax(130px, 0.7fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.search-box input {
  width: 100%;
  padding: 0 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

.quick-chips button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.quick-chips button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.bulk-cost {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #cfe8f6;
  border-radius: var(--radius);
  background: #f7fcff;
}

.bulk-cost strong,
.bulk-cost span {
  display: block;
}

.bulk-cost strong {
  font-size: 14px;
}

.bulk-cost span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-panel .table-wrap {
  max-height: 680px;
}

.analytics-panel .data-table {
  min-width: 1180px;
  table-layout: fixed;
}

.analytics-panel .data-table th,
.analytics-panel .data-table td {
  padding: 12px 10px;
  white-space: nowrap;
}

.analytics-panel .data-table th:nth-child(1),
.analytics-panel .data-table td:nth-child(1) {
  width: 86px;
}

.analytics-panel .data-table th:nth-child(3),
.analytics-panel .data-table td:nth-child(3) {
  width: 74px;
}

.analytics-panel .data-table th:nth-child(4),
.analytics-panel .data-table td:nth-child(4) {
  width: 92px;
}

.analytics-panel .data-table th:nth-child(5),
.analytics-panel .data-table td:nth-child(5) {
  width: 132px;
}

.analytics-panel .data-table th:nth-child(6),
.analytics-panel .data-table td:nth-child(6) {
  width: 122px;
}

.analytics-panel .data-table th:nth-child(7),
.analytics-panel .data-table td:nth-child(7) {
  width: 82px;
}

.analytics-panel .data-table th:nth-child(8),
.analytics-panel .data-table td:nth-child(8) {
  width: 92px;
}

.analytics-panel .data-table th:nth-child(2),
.analytics-panel .data-table td:nth-child(2) {
  min-width: 300px;
}

.analytics-panel .product-link {
  font-size: 15px;
}

.analytics-panel .order-id {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: auto;
  padding: 46px 18px;
  background: rgba(14, 25, 38, 0.42);
}

.detail-modal {
  width: min(1080px, 100%);
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.detail-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.modal-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.modal-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.detail-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.detail-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.toggle input {
  width: 17px;
  height: 17px;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 30px;
  align-items: center;
  min-height: 460px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.empty-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
}

.empty-copy p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.empty-panel {
  display: grid;
  gap: 14px;
}

.empty-card,
.empty-grid div,
.preview-kpis div,
.preview-table div,
.preview-line {
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e9f5fb, #f7f9fb);
}

.empty-card.wide {
  height: 160px;
}

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

.empty-grid div {
  height: 86px;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(360px, 640px);
  gap: 48px;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 30px);
  padding: 42px 24px;
}

.auth-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 30px 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f6f9;
}

.auth-tabs button {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.auth-tabs button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 14px rgba(21, 37, 54, 0.08);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.site-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 18px;
  border: 1px solid rgba(11, 141, 203, 0.22);
  border-radius: var(--radius);
  color: var(--blue-dark);
  background: #f6fbff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.site-back-link::before {
  content: "";
  width: 9px;
  height: 9px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.site-back-link:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.site-back-link:hover::before {
  transform: translateX(-2px) rotate(45deg);
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.users-panel {
  max-width: var(--content-max);
}

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

.users-table th,
.users-table td {
  vertical-align: top;
}

.users-table td:nth-child(1),
.users-table td:nth-child(2),
.users-table td:nth-child(3) {
  min-width: 180px;
}

.auth-preview {
  position: relative;
  isolation: isolate;
  min-height: 430px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 12%, rgba(11, 141, 203, 0.16), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(239, 64, 54, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(11, 141, 203, 0.08), rgba(255, 255, 255, 0.9) 46%, rgba(239, 64, 54, 0.05)),
    #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.preview-shine {
  position: absolute;
  z-index: -1;
  width: 240px;
  height: 240px;
  right: -90px;
  bottom: -90px;
  border-radius: 50%;
  background: rgba(11, 141, 203, 0.12);
  filter: blur(12px);
}

.preview-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-headline span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.preview-headline strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 13px;
}

.preview-headline strong::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(30, 166, 116, 0.12);
}

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

.preview-kpi {
  min-height: 108px;
  padding: 16px;
  border: 1px solid rgba(216, 226, 237, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 40px rgba(21, 37, 54, 0.08);
}

.preview-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preview-kpi strong {
  display: block;
  margin-top: 13px;
  font-size: 27px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.preview-kpi small {
  display: inline-block;
  margin-top: 11px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.preview-chart {
  position: relative;
  height: 188px;
  margin: 18px 0;
  padding: 14px 14px 6px;
  border: 1px solid rgba(216, 226, 237, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.preview-chart svg {
  display: block;
  width: 100%;
  height: 150px;
}

.preview-grid path {
  stroke: #dce7f0;
  stroke-width: 1;
}

.preview-area {
  fill: rgba(11, 141, 203, 0.11);
}

.preview-profit-line,
.preview-cost-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: drawPreviewLine 1.35s ease forwards;
}

.preview-profit-line {
  stroke: var(--blue);
  stroke-width: 7;
}

.preview-cost-line {
  stroke: var(--red);
  stroke-width: 4;
  animation-delay: 0.15s;
}

.preview-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 4;
  opacity: 0;
  transform-origin: center;
  animation: popPreviewDot 0.35s ease forwards;
}

.dot-one {
  animation-delay: 0.55s;
}

.dot-two {
  animation-delay: 0.85s;
}

.dot-three {
  animation-delay: 1.1s;
}

.preview-chart-caption {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.preview-ticker {
  height: 138px;
  overflow: hidden;
  border: 1px solid rgba(216, 226, 237, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}

.ticker-track {
  display: grid;
  gap: 9px;
  padding: 10px;
  animation: tickerMove 9s linear infinite;
}

.ticker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid rgba(216, 226, 237, 0.72);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(21, 37, 54, 0.06);
}

.ticker-row strong,
.ticker-row span,
.ticker-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-row strong {
  font-size: 13px;
}

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

.ticker-row b {
  color: var(--green);
  font-size: 13px;
}

@keyframes drawPreviewLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes popPreviewDot {
  from {
    opacity: 0;
    transform: scale(0.55);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tickerMove {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-profit-line,
  .preview-cost-line,
  .preview-dot,
  .ticker-track {
    animation: none;
  }

  .preview-profit-line,
  .preview-cost-line {
    stroke-dashoffset: 0;
  }

  .preview-dot {
    opacity: 1;
  }
}

.muted,
.chart-empty {
  color: var(--muted);
}

@media (max-width: 1320px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .analytics-controls {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, 1fr));
  }

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

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

  .advertising-upload-form {
    grid-column: 1 / -1;
  }

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

@media (max-width: 1080px) {
  .main-header {
    grid-template-columns: 1fr;
  }

  .user-panel {
    justify-content: space-between;
  }

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

  .period-tools,
  .report-manager,
  .bulk-cost {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .span-4,
  .span-5,
  .span-7,
  .span-8 {
    grid-column: 1 / -1;
  }

  .analytics-layout,
  .auth-page,
  .empty-state {
    grid-template-columns: 1fr;
  }

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

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

  .advertising-upload {
    grid-template-columns: 1fr;
  }

  .advertising-upload-form {
    grid-column: auto;
  }

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

@media (max-width: 720px) {
  .top-strip {
    height: 14px;
  }

  .main-header,
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }

  .upload-box,
  .advertising-upload-form,
  .report-toolbar,
  .period-tools,
  .report-manager,
  .manager-controls,
  .expense-form,
  .analytics-controls,
  .analytics-summary,
  .bulk-cost,
  .action-strip,
  .abc-grid {
    grid-template-columns: 1fr;
  }

  .report-toolbar,
  .analytics-head,
  .table-footer {
    display: grid;
  }

  .upload-box {
    display: grid;
  }

  .file-label {
    min-height: 48px;
  }

  .nav-inner {
    padding: 0;
  }

  .nav-item {
    flex: 1;
    height: 58px;
    padding: 0 10px;
    font-size: 12px;
  }

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

  .advertising-panel-head {
    display: grid;
  }

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

  .panel,
  .auth-card,
  .empty-state {
    padding: 16px;
  }

  .auth-preview {
    display: none;
  }

  .brand-logo {
    width: 190px;
  }

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

  .detail-modal {
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .detail-head {
    display: grid;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .detail-head .ghost-button {
    justify-self: start;
  }

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

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

/* ==========================================================================
   RK: гейт «Аналитики Kaspi» + экскурсия «Как это работает»
   ========================================================================== */

/* --- кнопка экскурсии в шапке ------------------------------------------- */
.help-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 15px 0 9px;
  border: 1px solid #cfe6f5;
  border-radius: 999px;
  color: var(--blue);
  background: #f0f8fd;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.help-button:hover {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.help-button:hover .help-badge {
  color: var(--blue);
  background: #fff;
}

/* --- вкладка «Аналитика Kaspi» ------------------------------------------- */
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.nav-item.locked {
  color: rgba(255, 255, 255, 0.62);
  cursor: not-allowed;
}

.nav-item.locked:hover {
  background: rgba(0, 0, 0, 0.14);
}

.nav-lock svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.nav-alert {
  color: #fff;
  background: var(--red);
  animation: navAlertPulse 1.4s ease-in-out infinite;
}

.nav-item.nav-alert:hover {
  background: #d9342c;
}

.nav-flag {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--red);
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

@keyframes navAlertPulse {
  0%,
  100% {
    background: var(--red);
    box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    background: #ff5f52;
    box-shadow: inset 0 -4px 0 0 rgba(255, 255, 255, 0.9);
  }
}

/* --- баннер после загрузки отчёта ---------------------------------------- */
.analytics-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 22px;
  border: 1px solid #f6c9c5;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff5f4, #fffdfd);
  box-shadow: 0 12px 28px rgba(239, 64, 54, 0.1);
}

.analytics-cta-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.analytics-cta-tag {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-cta-copy strong {
  font-size: 17px;
}

.analytics-cta-copy span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.analytics-cta-button {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--red);
  font-weight: 800;
  white-space: nowrap;
}

.analytics-cta-button:hover {
  background: #d9342c;
}

/* --- подсветка формы загрузки -------------------------------------------- */
.upload-box.attention {
  border-color: var(--red);
  animation: uploadAttention 0.6s ease 0s 3;
}

@keyframes uploadAttention {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 64, 54, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(239, 64, 54, 0.18);
  }
}

/* --- пустое состояние ----------------------------------------------------- */
.empty-copy {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.empty-tag {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #eaf5fc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-copy h1,
.empty-copy p {
  margin: 0;
}

.empty-steps {
  display: grid;
  gap: 12px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: emptyStep;
}

.empty-steps li {
  display: grid;
  gap: 2px;
  padding-left: 40px;
  position: relative;
}

.empty-steps li::before {
  counter-increment: emptyStep;
  content: counter(emptyStep);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.empty-steps strong {
  font-size: 15px;
}

.empty-steps span {
  color: var(--muted);
  font-size: 14px;
}

.empty-locked {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 20px;
  border: 1px dashed #c9d9e6;
  border-radius: var(--radius);
  background: #f8fbfd;
  text-align: center;
}

.empty-locked strong {
  font-size: 15px;
}

.empty-locked span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.empty-lock svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- экскурсия ------------------------------------------------------------ */
.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  pointer-events: none;
}

.tour-layer.visible {
  display: block;
}

.tour-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background: rgba(13, 26, 43, 0.58);
  pointer-events: none;
}

.tour-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 3px rgba(11, 141, 203, 0.25);
  transition: top 0.16s ease, left 0.16s ease, width 0.16s ease, height 0.16s ease;
  pointer-events: none;
}

.tour-spotlight.hidden {
  display: none;
}

.tour-card {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 20px 22px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 60px rgba(13, 26, 43, 0.32);
  pointer-events: auto;
}

.tour-card.centered {
  transform: translate(-50%, -50%);
}

.tour-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tour-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #eef3f7;
  font-size: 20px;
  line-height: 1;
}

.tour-close:hover {
  background: #e2e9f0;
}

.tour-dots {
  display: flex;
  gap: 5px;
  margin: 12px 0 14px;
}

.tour-dot {
  flex: 1;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e2e9f0;
}

.tour-dot.done {
  background: #a8d5ee;
}

.tour-dot.current {
  background: var(--blue);
}

.tour-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.tour-card p {
  margin: 0 0 18px;
  color: #4d5765;
  font-size: 14px;
  line-height: 1.55;
}

.tour-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-buttons {
  display: flex;
  gap: 8px;
}

.tour-skip {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tour-skip:hover {
  color: var(--ink);
}

.tour-next {
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.tour-next:hover {
  background: var(--blue-dark);
}

body.tour-open {
  overflow-x: hidden;
}

@media (max-width: 1080px) {
  .help-text {
    display: none;
  }

  .help-button {
    padding: 0 9px;
  }
}

@media (max-width: 720px) {
  .analytics-cta {
    display: grid;
  }

  .analytics-cta-button {
    width: 100%;
  }

  .tour-card,
  .tour-card.centered {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item.nav-alert,
  .upload-box.attention {
    animation: none;
  }

  .nav-item.nav-alert {
    background: var(--red);
    box-shadow: inset 0 -4px 0 0 rgba(255, 255, 255, 0.9);
  }

  .tour-spotlight {
    transition: none;
  }
}

/* ==========================================================================
   RK: заметная загрузка отчёта и «кричащая» себестоимость
   ========================================================================== */

/* --- форма загрузки ------------------------------------------------------- */
.upload-box.urgent {
  border-color: var(--blue);
  animation: uploadCall 2.2s ease-in-out infinite;
}

.upload-box.urgent .upload-submit {
  background: var(--blue);
  animation: uploadButtonCall 2.2s ease-in-out infinite;
}

.upload-box.ready {
  position: relative;
  border-color: var(--green);
  animation: none;
}

.upload-box.ready .upload-submit {
  background: var(--green);
  animation: uploadButtonReady 1.1s ease-in-out infinite;
}

.upload-box.ready .upload-submit:hover {
  background: #1e8a58;
}

/* .upload-box клипует содержимое (overflow: hidden), поэтому «файл выбран»
   показываем внутри строки с именем файла, а не подсказкой под формой. */
.upload-box.ready .file-label,
.upload-box.ready .file-icon {
  color: #1e7a52;
}

.upload-box.ready .file-label {
  background: #f4fbf7;
  font-weight: 800;
}

@keyframes uploadCall {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(11, 141, 203, 0);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(11, 141, 203, 0.16);
  }
}

@keyframes uploadButtonCall {
  0%,
  100% {
    background: var(--blue);
  }

  50% {
    background: #0aa0e8;
  }
}

@keyframes uploadButtonReady {
  0%,
  100% {
    transform: none;
  }

  50% {
    transform: scale(1.035);
  }
}

/* --- KPI «Без себест.» ----------------------------------------------------- */
.kpi-card.kpi-action {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.kpi-card.kpi-action:hover {
  border-color: var(--amber);
  box-shadow: 0 14px 30px rgba(197, 138, 18, 0.18);
}

.kpi-card.urgent {
  border: 1px solid #f0cf8a;
  border-top: 4px solid var(--amber);
  background: #fffdf6;
  animation: costCall 1.8s ease-in-out infinite;
}

.kpi-card.urgent strong {
  color: #8a5f05;
}

.kpi-cta {
  display: block;
  margin-top: 8px;
  color: var(--amber);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@keyframes costCall {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(197, 138, 18, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(197, 138, 18, 0.16);
  }
}

/* --- плашка о незаполненной себестоимости ---------------------------------- */
.cost-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #f0cf8a;
  border-left: 5px solid var(--amber);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fffaef, #fffdf8);
}

.cost-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  font-size: 18px;
  font-weight: 900;
  animation: costIconCall 1.8s ease-in-out infinite;
}

.cost-alert-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

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

.cost-alert-copy span {
  color: #7a6633;
  font-size: 13px;
}

.cost-alert-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.cost-alert-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--amber);
  font-weight: 800;
  white-space: nowrap;
}

.cost-alert-button:hover {
  background: #a97609;
}

.cost-alert-ghost {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #e6cf9a;
  border-radius: var(--radius);
  color: #7a5a08;
  background: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.cost-alert-ghost:hover {
  border-color: var(--amber);
}

.cost-alert.done {
  border-color: #bfe5d3;
  border-left-color: var(--green);
  background: linear-gradient(120deg, #f4fbf7, #fdfffe);
}

.cost-alert.done .cost-alert-icon {
  background: var(--green);
  animation: none;
}

.cost-alert.done .cost-alert-copy span {
  color: #4b6b5c;
}

@keyframes costIconCall {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(197, 138, 18, 0.45);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(197, 138, 18, 0);
  }
}

/* --- ячейки себестоимости --------------------------------------------------- */
.data-table td.cost-cell.missing {
  background: #fffaee;
  box-shadow: inset 3px 0 0 var(--amber);
}

.cost-input.missing {
  border: 1px dashed var(--amber);
  background: #fffdf5;
  color: #8a5f05;
  font-weight: 700;
}

.cost-input.missing::placeholder {
  color: #b98e2b;
  font-weight: 800;
  opacity: 1;
}

.cost-input.missing:focus {
  border-style: solid;
  border-color: var(--amber);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(197, 138, 18, 0.18);
}

.cost-input.filled {
  border-color: #bfe5d3;
  background: #f8fdfa;
  font-weight: 700;
}

.th-flag {
  display: block;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--amber);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: none;
  vertical-align: middle;
}

/* --- массовая себестоимость -------------------------------------------------- */
.bulk-cost.urgent {
  border-color: #f0cf8a;
  background: #fffdf6;
}

.bulk-cost.flash {
  animation: bulkFlash 0.55s ease 0s 3;
}

@keyframes bulkFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(197, 138, 18, 0);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(197, 138, 18, 0.22);
  }
}

@media (max-width: 720px) {
  .cost-alert {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cost-alert-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cost-alert-button,
  .cost-alert-ghost {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .upload-box.urgent,
  .upload-box.urgent .upload-submit,
  .upload-box.ready .upload-submit,
  .kpi-card.urgent,
  .cost-alert-icon,
  .bulk-cost.flash {
    animation: none;
  }

  .upload-box.urgent {
    box-shadow: 0 0 0 4px rgba(11, 141, 203, 0.16);
  }

  .kpi-card.urgent {
    box-shadow: 0 0 0 4px rgba(197, 138, 18, 0.16);
  }
}
