:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --ink: #07132f;
  --muted: #53627c;
  --soft: #f8fafd;
  --line: #e1e7f0;
  --line-strong: #d4dce8;
  --blue: #0a56d9;
  --blue-strong: #004ad1;
  --green: #1ca34a;
  --green-soft: #e6f7eb;
  --orange: #f59e0b;
  --orange-soft: #fff1d6;
  --red: #ef4444;
  --red-soft: #ffe8e8;
  --shadow: 0 12px 32px rgba(8, 29, 73, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial,
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

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

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


.workspace {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 22px 28px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.page-title h1,
.panel h2 {
  margin: 0;
}

.page-title h1 {
  font-size: 27px;
  line-height: 1.08;
  font-weight: 650;
}

.page-title p {
  margin: 9px 0 0;
  color: #33415f;
  font-size: 15px;
}

.filterbar {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 0.95fr) minmax(330px, 1.15fr) auto;
  gap: 16px;
  align-items: end;
}

.filter-field,
.sprint-tabs {
  display: grid;
  gap: 7px;
}

.filter-field > span,
.sprint-tabs legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.date-control,
.filter-field select {
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(8, 29, 73, 0.04);
}

.date-control {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 20px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-control svg {
  width: 18px;
  height: 18px;
  color: #415171;
}

.date-control:hover {
  border-color: #aebbd0;
}

.date-control:focus-visible {
  border-color: #78a6f4;
  box-shadow: 0 0 0 3px rgba(10, 86, 217, 0.1);
}


.date-control-arrow {
  pointer-events: none;
}

#periodCaption {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-field select {
  width: 100%;
  padding: 0 14px;
}

.sprint-tabs {
  margin: 0;
  padding: 0;
  border: 0;
}

.sprint-tabs legend {
  padding: 0;
}

.sprint-tabs {
  grid-template-columns: repeat(3, minmax(104px, 1fr));
}

.sprint-tabs button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-left: 0;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
}

.sprint-tabs button:first-of-type {
  border-left: 1px solid var(--line-strong);
  border-radius: 6px 0 0 6px;
}

.sprint-tabs button:last-of-type {
  border-radius: 0 6px 6px 0;
}

.sprint-tabs button.active {
  border-color: var(--blue-strong);
  color: #ffffff;
  background: var(--blue-strong);
}

.sprint-tabs button span {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}

.refresh-button {
  display: grid;
  grid-template-columns: 28px auto;
  gap: 9px;
  align-items: center;
  min-width: 154px;
  height: 48px;
  padding: 0;
  border: 0;
  color: #40506e;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.refresh-button svg {
  width: 25px;
  height: 25px;
  color: #183963;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.refresh-button.loading svg {
  animation: spin 0.9s linear infinite;
}

.refresh-button span {
  font-size: 12px;
  line-height: 1.35;
}

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

.notice {
  padding: 12px 14px;
  border: 1px solid #f6d290;
  border-radius: 8px;
  color: #6d4700;
  background: var(--orange-soft);
  font-size: 13px;
}

.hidden {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 16px;
}

.kpi-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 146px;
  padding: 28px 28px 22px;
}

.kpi-title {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.kpi-title em {
  font-style: normal;
  font-weight: 500;
}

.kpi-card strong {
  display: block;
  margin-top: 16px;
  font-size: 29px;
  line-height: 1;
  font-weight: 420;
}

.kpi-card small {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: #51617f;
  font-size: 13px;
}

.kpi-card small i {
  display: block;
  width: 16px;
  height: 1px;
  background: #526585;
}

.kpi-card small b {
  margin-right: 2px;
  font-size: 13px;
}

.kpi-card .down b {
  color: var(--red);
}

.kpi-card .up b {
  color: var(--green);
}

.forecast-card strong {
  color: var(--green);
}

.progress-card strong {
  color: var(--orange);
}

.kpi-icon {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  align-self: center;
  border-radius: 14px;
}

.kpi-icon svg {
  width: 31px;
  height: 31px;
  stroke-width: 2.2;
}

.kpi-icon.blue {
  color: var(--blue);
  background: linear-gradient(135deg, #ecf4ff, #dce9ff);
}

.kpi-icon.green {
  color: var(--green);
  background: linear-gradient(135deg, #ecfaef, #dcefdc);
}

.donut {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  margin: 18px 8px 0 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--panel) 0 53%, transparent 54%),
    conic-gradient(var(--orange) var(--value, 68%), #fde5bb 0);
}

.middle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 16px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(500px, 0.78fr) minmax(640px, 1fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 26px 28px;
}

.panel h2 {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 650;
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: #233251;
  font-size: 13px;
}

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

.legend i {
  display: block;
  width: 29px;
  height: 3px;
  border-radius: 999px;
}

.fact-line {
  background: var(--blue);
}

.plan-line {
  border-top: 2px dashed #667898;
}

.forecast-line {
  border-top: 2px dashed var(--green);
}

#trendChart {
  width: 100%;
  height: auto;
  min-height: 300px;
  overflow: visible;
}

.sprint-panel {
  padding: 22px 22px 18px;
}

.sprint-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.sprint-item {
  padding: 20px 26px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(8, 29, 73, 0.04);
}

.sprint-title {
  color: #24324f;
  font-size: 14px;
  line-height: 1.3;
}

.sprint-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.sprint-values strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}

.sprint-values span {
  color: #ff8a00;
  font-size: 20px;
  font-weight: 650;
}

.progress-track {
  overflow: hidden;
  height: 11px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e8ebf0;
}

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

.table-scroll {
  overflow: auto;
}

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

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

.sales-table {
  min-width: 920px;
}

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

th {
  color: #17223e;
  font-size: 12px;
  font-weight: 650;
}

tbody tr:hover {
  background: #f9fbff;
}

.manager-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 150px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #163f83, #6c8fc4);
  font-size: 12px;
  font-weight: 650;
}

.manager-name strong {
  font-weight: 500;
}

.money-inputs {
  display: none;
}

.progress-cell {
  display: grid;
  grid-template-columns: 36px minmax(72px, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 116px;
}

.progress-cell strong {
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
}

.progress-cell.warning strong {
  color: var(--orange);
}

.progress-mini {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e7ebf0;
}

.progress-mini span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress-cell.warning .progress-mini span {
  background: var(--orange);
}

.total-row td {
  padding-top: 18px;
  border-bottom: 0;
  font-weight: 650;
}

.save-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--blue);
  background: #edf4ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip.closed {
  color: #198c46;
  background: var(--green-soft);
}

.status-chip.paid {
  color: #0b57d0;
  background: #e7f0ff;
}

.status-chip.work {
  color: #f08a00;
  background: var(--orange-soft);
}

.show-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  border: 0;
  color: var(--blue-strong);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.show-more svg {
  width: 16px;
  height: 16px;
}

.chart-label {
  fill: #17223e;
  font-size: 12px;
}

.chart-muted {
  fill: #52617e;
  font-size: 12px;
}

.install-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.install-card {
  width: min(460px, calc(100vw - 32px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.install-card .mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-size: 26px;
  font-weight: 900;
}

.install-card p {
  margin: 12px 0 24px;
  color: var(--muted);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

@media (max-width: 1360px) {
  .topbar,
  .middle-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

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

  .filterbar {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .refresh-button {
    min-width: 0;
  }
}

@media (max-width: 780px) {

  .workspace {
    padding: 18px;
  }

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

  .filterbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sprint-tabs {
    grid-template-columns: 1fr;
  }

  .sprint-tabs button,
  .sprint-tabs button:first-of-type,
  .sprint-tabs button:last-of-type {
    border: 1px solid var(--line-strong);
    border-radius: 6px;
  }

  .panel,
  .kpi-card {
    padding: 18px;
  }
}


/* Interactive dashboard refinements */
body {
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.kpi-card,
.panel {
  box-shadow: 0 10px 26px rgba(8, 29, 73, 0.065);
}

.kpi-card:hover,
.panel:hover {
  border-color: #d3dce9;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: end;
}

.sales-tools {
  flex: 1 1 auto;
}

.search-control,
.select-control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.search-control input,
.select-control select {
  height: 34px;
  min-width: 150px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.sales-tools .search-control input {
  min-width: 230px;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}

.sort-button::after {
  content: "↕";
  color: #8a98ae;
  font-size: 11px;
}

.sort-button.active.asc::after {
  content: "↑";
  color: var(--blue);
}

.sort-button.active.desc::after {
  content: "↓";
  color: var(--blue);
}

.chart-stage {
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 178px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(8, 29, 73, 0.14);
  pointer-events: none;
  transform: translate(10px, -50%);
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 650;
}

.chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chart-hit {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.chart-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chart-dot.active {
  opacity: 1;
}

.chart-focus-line {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chart-focus-line.active {
  opacity: 1;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 780px) {
  .table-tools,
  .sales-tools {
    justify-content: stretch;
  }

  .search-control,
  .select-control,
  .search-control input,
  .select-control select,
  .sales-tools .search-control input {
    width: 100%;
    min-width: 0;
  }
}

/* Softer typography pass */
.page-title h1 {
  font-weight: 600;
}

.panel h2,
.kpi-title,
th,
.sort-button,
.filter-field > span,
.sprint-tabs legend {
  font-weight: 560;
}

.kpi-card strong {
  white-space: nowrap;
  font-size: clamp(24px, 2vw, 28px);
  font-weight: 400;
}

.kpi-card > div:first-child {
  min-width: 0;
}

.status-chip,
.search-control,
.select-control {
  font-weight: 500;
}

.total-row td {
  font-weight: 650;
}

/* Manager table is intentionally compact: forecast lives in the KPI row. */
.manager-table {
  min-width: 560px;
}

.manager-panel th,
.manager-panel td {
  padding-left: 10px;
  padding-right: 10px;
}

.manager-panel .progress-cell {
  min-width: 96px;
}

.manager-table {
  min-width: 0;
  table-layout: fixed;
}

.manager-table th:nth-child(1),
.manager-table td:nth-child(1) { width: 31%; }
.manager-table th:nth-child(2),
.manager-table td:nth-child(2) { width: 18%; }
.manager-table th:nth-child(3),
.manager-table td:nth-child(3) { width: 33%; }
.manager-table th:nth-child(4),
.manager-table td:nth-child(4) { width: 18%; }

.manager-panel th,
.manager-panel td {
  padding-left: 7px;
  padding-right: 7px;
}

.manager-panel .manager-name {
  min-width: 0;
}

.manager-panel .manager-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chart typography: axis labels should read like UI annotations, not headings. */
#trendChart text,
.chart-label,
.chart-muted {
  stroke: none;
  paint-order: fill;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.chart-label {
  fill: #53627c;
}

.chart-muted {
  fill: #66758d;
}
/* Sales planning */
.panel-title-group {
  display: grid;
  gap: 5px;
}

.panel-title-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.plan-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 3px 12px;
  min-width: 150px;
}

.plan-breakdown strong {
  grid-column: 1 / -1;
  color: #1c2945;
  font-size: 13px;
  font-weight: 550;
}

.plan-breakdown span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.plan-dialog {
  width: min(780px, calc(100vw - 32px));
  max-width: none;
  max-height: min(760px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(5, 20, 51, 0.25);
}

.plan-dialog::backdrop {
  background: rgba(10, 24, 50, 0.42);
}

.plan-dialog-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: min(760px, calc(100vh - 32px));
}

.plan-dialog-head,
.plan-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
}

.plan-dialog-head {
  border-bottom: 1px solid var(--line);
}

.plan-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.plan-dialog-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #52617a;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: #f0f3f8;
}

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

.plan-dialog-period {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}

.plan-dialog-period span {
  color: var(--muted);
  font-size: 12px;
}

.plan-dialog-period strong {
  font-size: 13px;
  font-weight: 550;
  text-transform: capitalize;
}

.plan-dialog-table {
  overflow: auto;
  padding: 0 22px;
}

.plan-dialog-table table {
  min-width: 620px;
}

.plan-dialog-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
}

.plan-dialog-table th:nth-child(1) { width: 38%; }
.plan-dialog-table th:nth-child(2),
.plan-dialog-table th:nth-child(3) { width: 21%; }
.plan-dialog-table th:nth-child(4) { width: 20%; }

.plan-dialog-table input {
  width: 100%;
  min-width: 110px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.plan-dialog-table input:focus {
  border-color: #78a6f4;
  box-shadow: 0 0 0 3px rgba(10, 86, 217, 0.09);
}

.plan-dialog-table [data-plan-total] {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.plan-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
}

.primary-button {
  border: 1px solid var(--blue);
  color: #ffffff;
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: #2d3b57;
  background: #ffffff;
}

@media (max-width: 780px) {
  .plan-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .plan-dialog-card {
    max-height: calc(100vh - 20px);
  }

  .plan-dialog-head,
  .plan-dialog-actions {
    padding: 16px;
  }

  .plan-dialog-period {
    padding: 12px 16px;
  }

  .plan-dialog-table {
    padding: 0 16px;
  }
}
/* Period picker */
.period-dialog {
  width: min(430px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(5, 20, 51, 0.25);
}

.period-dialog::backdrop {
  background: rgba(10, 24, 50, 0.42);
}

.period-dialog-card {
  display: grid;
}

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

.period-dialog-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.year-selector {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: end;
  padding: 18px 20px 14px;
}

.year-selector label {
  display: grid;
  gap: 5px;
}

.year-selector label span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.year-selector input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font-size: 15px;
  font-weight: 550;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.year-selector input:focus {
  border-color: #78a6f4;
  box-shadow: 0 0 0 3px rgba(10, 86, 217, 0.09);
}

.year-step {
  border: 1px solid var(--line-strong);
  background: #ffffff;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 20px 20px;
}

.month-grid button {
  position: relative;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #263550;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 450;
}

.month-grid button:hover {
  border-color: #9db9ea;
  background: #f3f7ff;
}

.month-grid button:focus-visible {
  outline: 2px solid #76a2ec;
  outline-offset: 1px;
}

.month-grid button.current {
  border-color: #9bb7e8;
  color: var(--blue);
}

.month-grid button.active {
  border-color: var(--blue);
  color: #ffffff;
  background: var(--blue);
  font-weight: 550;
}

.month-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.period-dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafd;
}

@media (max-width: 480px) {
  .period-dialog {
    width: calc(100vw - 20px);
  }
}
/* Visible plan action and ruble inputs */
.plan-config-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-top: 14px;
  padding: 0 11px;
  border: 1px solid #b9cff4;
  border-radius: 6px;
  color: var(--blue);
  background: #f2f6ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
}

.plan-config-button:hover {
  border-color: #8eb1eb;
  background: #e8f0ff;
}

.plan-config-button:focus-visible {
  outline: 2px solid #76a2ec;
  outline-offset: 2px;
}

.plan-config-button.restricted {
  color: #53627c;
  border-color: var(--line-strong);
  background: #f6f8fb;
}

.plan-config-button svg {
  width: 15px;
  height: 15px;
}

.rubles-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 130px;
  height: 38px;
  padding-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #52617a;
  background: #ffffff;
}

.rubles-input:focus-within {
  border-color: #78a6f4;
  box-shadow: 0 0 0 3px rgba(10, 86, 217, 0.09);
}

.plan-dialog-table .rubles-input input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.rubles-input span {
  font-size: 13px;
  pointer-events: none;
}

.deal-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 5px;
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

.deal-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-link svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deal-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.deal-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid #76a2ec;
  outline-offset: 2px;
}
.products-cell {
  min-width: 220px;
  max-width: 360px;
}

.product-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.product-list span {
  overflow-wrap: anywhere;
}

.product-list small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.products-empty {
  color: var(--muted);
  font-size: 12px;
}
.waiting-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.waiting-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px #fff4d6;
}

.waiting-table {
  min-width: 780px;
}

.waiting-table th:nth-child(1),
.waiting-table td:nth-child(1) {
  width: 25%;
}

.waiting-table th:nth-child(2),
.waiting-table td:nth-child(2) {
  width: 20%;
}

.waiting-table th:nth-child(3),
.waiting-table td:nth-child(3) {
  width: 15%;
}

.waiting-table th:nth-child(4),
.waiting-table td:nth-child(4) {
  width: 40%;
}