@font-face {
  font-family: "Golos Text";
  src: url("fonts/GolosText-VF.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

/* Reversible visual concept for the CRM shell and shared components. */
:root {
  --background: #f2f3f5;
  --sidebar-surface: #ffffff;
  --metric-emphasis: #ffffff;
  --text: #1d2b23;
  --muted: #6b7b71;
  --secondary-text: #45564a;
  --border: #e0e9e2;
  --row-border: #eaf0eb;
  --table-heading: #f6f9f7;
  --hover: #f2f8f4;
  --active-background: #e8f3eb;
  --shadow-soft: 0 3px 16px rgba(26, 51, 37, .055);
  --shadow-hover: 0 8px 22px rgba(26, 51, 37, .09);
  --debt-text: #a95606;
  font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

:root[data-theme="dark"] {
  --background: #111b15;
  --sidebar-surface: #16231a;
  --metric-emphasis: #203b2a;
  --border: #314438;
  --row-border: #2a3a2e;
  --table-heading: #223127;
  --hover: #25392b;
  --active-background: #264b33;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .12);
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, .2);
  --debt-text: var(--warning-text);
}

/* Interface type roles: regular copy and headings 400, important data 450–500. */
:root:not([data-theme="dark"]) strong,
:root:not([data-theme="dark"]) b {
  font-weight: 450;
}

:root:not([data-theme="dark"]) h1,
:root:not([data-theme="dark"]) h2,
:root:not([data-theme="dark"]) h3,
:root:not([data-theme="dark"]) .button,
:root:not([data-theme="dark"]) .eyebrow,
:root:not([data-theme="dark"]) summary {
  font-weight: 400;
}

:root:not([data-theme="dark"]) .brand,
:root:not([data-theme="dark"]) .dashboard-chart-total,
:root:not([data-theme="dark"]) .dashboard-chart-today .dashboard-chart-label,
:root:not([data-theme="dark"]) .dashboard-activity-idline > .text-link,
:root:not([data-theme="dark"]) .dashboard-ready-identity > .text-link,
:root:not([data-theme="dark"]) .debt-amount {
  font-weight: 450;
}

:root:not([data-theme="dark"]) .nav-link.active,
:root:not([data-theme="dark"]) .dashboard-service-label,
:root:not([data-theme="dark"]) .dashboard-rank {
  font-weight: 450;
}

:root:not([data-theme="dark"]) .nav-link,
:root:not([data-theme="dark"]) .dashboard-metric h2,
:root:not([data-theme="dark"]) .dashboard-highlight-metrics .dashboard-metric h2 {
  font-weight: 400;
}

:root:not([data-theme="dark"]) .topbar-title,
:root:not([data-theme="dark"]) label,
:root:not([data-theme="dark"]) legend,
:root:not([data-theme="dark"]) .client-table thead th {
  font-weight: 400;
}

:root:not([data-theme="dark"]) .dashboard-item-amount,
:root:not([data-theme="dark"]) .dashboard-summary dd {
  font-weight: 450;
}

:root:not([data-theme="dark"]) .status-badge {
  font-weight: 400;
}

:root:not([data-theme="dark"]) .card h3 {
  font-weight: 400;
}

:root:not([data-theme="dark"]) .client-table tbody th,
:root:not([data-theme="dark"]) .dashboard-activity-main > .text-link {
  font-weight: 450;
}

:root:not([data-theme="dark"]) .catalog-stock-values dd,
:root:not([data-theme="dark"]) .dashboard-profit-row dt,
:root:not([data-theme="dark"]) .dashboard-profit-row dd {
  font-weight: 450;
}

:root:not([data-theme="dark"]) .debt-amount,
:root:not([data-theme="dark"]) .status-debt {
  color: var(--debt-text);
}

:root:not([data-theme="dark"]) .status-debt {
  background: #fff0df;
}

:root[data-theme="dark"] .debt-amount,
:root[data-theme="dark"] .status-debt {
  color: var(--debt-text);
}

:root[data-theme="dark"] .status-debt {
  background: var(--warning-background);
}

:root .negative-work-balance {
  color: var(--error-text);
}

.layout {
  min-height: 100dvh;
}

.layout > .sidebar {
  width: 252px;
  padding: 26px 12px 20px;
  background: var(--sidebar-surface);
}

.sidebar-brand-row {
  gap: 14px;
  margin-bottom: 24px;
  padding: 0 10px;
}

.brand {
  height: auto;
  font-size: 21px;
  font-weight: 450;
  letter-spacing: -.03em;
}

.sidebar-close-button {
  height: 30px;
  padding-inline: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--secondary-text);
  box-shadow: none;
}

.sidebar nav {
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
}

.nav-link.active {
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: 0 3px 10px var(--primary-shadow);
  font-weight: 450;
}

.nav-link:not(.nav-sublink)::before {
  content: "";
  flex: none;
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}

.nav-home { --nav-icon: url("icons/layout-dashboard.svg"); }
.nav-clients { --nav-icon: url("icons/users.svg"); }
.nav-orders { --nav-icon: url("icons/shopping-bag.svg"); }
.nav-catalog { --nav-icon: url("icons/package.svg"); }
.nav-quick_sales { --nav-icon: url("icons/bolt.svg"); }
.nav-expenses { --nav-icon: url("icons/wallet.svg"); }
.nav-bonuses { --nav-icon: url("icons/coin-percent.svg"); }
.nav-settings { --nav-icon: url("icons/settings.svg"); }

.settings-trigger span {
  flex: 1;
}

.nav-sublink {
  min-height: 35px;
  padding-left: 28px;
  font-size: 13px;
}

.topbar {
  height: 66px;
  padding-inline: 32px;
  box-shadow: none;
}

.topbar-title {
  font-weight: 450;
}

.badge {
  padding: 6px 11px;
  background: var(--background);
  font-size: 12px;
}

main {
  max-width: var(--workspace-main-max-width, 1680px);
  padding: 40px 32px 72px;
}

.page-heading {
  margin-bottom: 30px;
}

h1 {
  margin-bottom: 8px;
  font-size: 31px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.035em;
}

h2 {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.35;
}

.lead {
  font-size: 14px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading .muted {
  font-size: 13px;
}

.panel,
.card,
.table-wrapper,
.empty-state {
  border-radius: 17px;
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 24px;
  border-color: transparent;
}

.table-wrapper {
  border-color: transparent;
}

.dashboard-table-wrapper {
  border-color: var(--border);
  border-radius: 12px;
  box-shadow: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  box-shadow: none;
}

.button:hover {
  box-shadow: none;
}

.button:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.theme-toggle,
.sidebar-toggle {
  min-height: 42px;
  border-radius: 9px;
  box-shadow: none;
}

.search-bar {
  gap: 12px;
  margin-bottom: 26px;
  padding: 18px;
  border: 0;
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.search-field label,
.filter-field label,
.form-field label {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 450;
}

input,
select,
textarea {
  min-height: 42px;
  border-radius: 9px;
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

.client-table th,
.client-table td {
  padding: 14px 16px;
}

.client-table thead th {
  padding-block: 12px;
  font-size: 12px;
  font-weight: 450;
}

.client-table tbody tr:focus-within {
  background: var(--hover);
}

.dashboard {
  gap: 22px;
}

.dashboard-metrics {
  gap: 12px;
}

.dashboard-metric {
  min-height: 138px;
  padding: 14px 18px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--active-background);
}

.metric-icon::before {
  content: "";
  width: 19px;
  height: 19px;
  background: var(--primary);
  -webkit-mask: var(--metric-icon) center / contain no-repeat;
  mask: var(--metric-icon) center / contain no-repeat;
}

.dashboard-metric:nth-child(1) { --metric-icon: url("icons/wallet.svg"); }
.dashboard-metric:nth-child(2) { --metric-icon: url("icons/shopping-bag.svg"); }
.dashboard-metric:nth-child(3) { --metric-icon: url("icons/bolt.svg"); }
.dashboard-metric:nth-child(4) { --metric-icon: url("icons/circle-check.svg"); }
.dashboard-metric:nth-child(5) { --metric-icon: url("icons/alert-circle.svg"); }
.dashboard-metric:nth-child(6) { --metric-icon: url("icons/receipt.svg"); }

.dashboard-metric-primary .metric-icon {
  background: var(--primary);
}

.dashboard-metric-primary .metric-icon::before {
  background: var(--on-primary);
}

.dashboard-metric h2 {
  font-size: 13px;
  font-weight: 450;
  color: var(--muted);
}

.dashboard-metric strong {
  margin-top: 3px;
  font-size: 24px;
  font-weight: 450;
  line-height: 1.15;
}

.dashboard-metric p {
  margin-top: 5px;
  line-height: 1.3;
}

.dashboard-metric-primary {
  background: var(--metric-emphasis);
}

.dashboard-metrics.dashboard-highlight-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-highlight-metrics .dashboard-metric {
  min-width: 0;
  min-height: 142px;
  padding: 14px 15px;
  color: var(--text);
  text-decoration: none;
}

.dashboard-highlight-metrics .metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin-bottom: 12px;
}

.dashboard-highlight-metrics .metric-icon {
  flex: 0 0 34px;
  margin: 0;
  background: var(--active-background);
}

.dashboard-highlight-metrics .metric-icon::before {
  background: var(--active-text);
}

.metric-icon-wallet { --metric-icon: url("icons/wallet.svg"); }
.metric-icon-orders { --metric-icon: url("icons/shopping-bag.svg"); }
.metric-icon-lenses { --metric-icon: url("icons/eye.svg"); }
.metric-icon-master { --metric-icon: url("icons/package.svg"); }
.metric-icon-ready { --metric-icon: url("icons/package-export.svg"); }
.metric-icon-overdue { --metric-icon: url("icons/alert-circle.svg"); }

.metric-sparkline {
  flex: 0 1 96px;
  width: 96px;
  height: 32px;
  overflow: visible;
  color: var(--accent-border);
}

.metric-sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-sparkline circle {
  fill: var(--active-text);
}

.dashboard-highlight-metrics .dashboard-metric h2 {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 450;
}

.dashboard-highlight-metrics .dashboard-metric strong {
  margin-top: 4px;
  font-size: clamp(20px, 1.75vw, 27px);
  line-height: 1.1;
}

.dashboard-highlight-metrics .dashboard-metric p {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.3;
}

.dashboard-highlight-metrics .metric-note {
  color: var(--muted);
}

.dashboard-highlight-metrics .metric-note-alert {
  color: var(--error-text);
}

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

.dashboard-support-metrics > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  text-decoration: none;
}

.dashboard-support-metrics > .dashboard-support-metric-warning {
  background: var(--warning-background);
}

.dashboard-support-metrics > .dashboard-support-metric-warning span {
  color: var(--warning-text);
}

.dashboard-support-metrics span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.dashboard-support-metrics strong {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}

.dashboard-support-metrics a:hover,
.dashboard-support-metrics a:focus-visible {
  color: var(--link);
  box-shadow: var(--shadow-hover);
}

.dashboard-support-metrics a:focus-visible {
  outline: 2px solid var(--focus);
}

.dashboard-day-card {
  position: relative;
  align-self: start;
  height: max-content;
  padding: 20px;
  border: 0;
  border-radius: 18px;
}

.dashboard-week-card {
  align-self: start;
  padding: 24px 26px 18px;
}

.dashboard-week-card .dashboard-chart-summary {
  align-items: start;
}

.dashboard-week-card .dashboard-chart-summary h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.dashboard-week-card .dashboard-chart-total {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.dashboard-week-card .dashboard-day-compare {
  gap: 2px;
  min-width: 140px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.2;
}

.dashboard-week-card .dashboard-day-compare strong {
  font-size: 15px;
}

.dashboard-week-card .dashboard-day-compare small {
  font-size: 10px;
}

.dashboard-week-card .dashboard-chart {
  margin-top: 18px;
}

.dashboard-chart-body {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
}

.dashboard-chart-axis {
  position: relative;
  height: 220px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dashboard-chart-axis span {
  position: absolute;
  right: 10px;
  white-space: nowrap;
  transform: translateY(-50%);
}

.dashboard-chart-plot {
  color: var(--primary);
}

.dashboard-week-card .dashboard-chart-line {
  height: 220px;
}

.dashboard-chart-gridline {
  stroke: var(--row-border);
  stroke-dasharray: 4 5;
}

.dashboard-chart-gridline-zero {
  stroke: var(--border);
}

.dashboard-chart-area {
  fill: url(#dashboard-revenue-fill);
}

.dashboard-chart-path {
  stroke-width: 2.5;
}

.dashboard-chart-point {
  opacity: 0;
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 2;
}

.dashboard-chart-point.is-active {
  opacity: 1;
  fill: var(--primary);
  stroke-width: 2;
}

.dashboard-chart-guide {
  stroke: var(--muted);
  stroke-dasharray: none;
  opacity: .45;
}

.dashboard-chart-tooltip {
  display: grid;
  gap: 5px;
  min-width: 160px;
  max-width: 220px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-hover);
  font-size: 12px;
  transform: none;
}

.dashboard-chart-tooltip strong {
  color: var(--primary);
  font-size: inherit;
  font-weight: 450;
}

.dashboard-chart-tooltip.is-below {
  transform: none;
}

.dashboard-week-card .dashboard-chart-days {
  margin-top: 0;
  margin-left: 60px;
}

.dashboard-week-card .dashboard-chart-day {
  padding-block: 4px;
}

.dashboard-week-card .dashboard-chart-label {
  font-size: 12px;
}

.dashboard-week-card > .muted {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.25;
}

.dashboard-day-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-right: 92px;
}

.dashboard-day-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: var(--active-text);
  -webkit-mask: url("icons/wallet.svg") center / contain no-repeat;
  mask: url("icons/wallet.svg") center / contain no-repeat;
}

.dashboard-day-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 450;
}

.dashboard-day-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.dashboard-day-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.dashboard-day-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid var(--row-border);
  border-radius: 12px;
  background: var(--table-heading);
  color: var(--text);
  text-decoration: none;
}

.dashboard-day-tile > span:first-child {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.dashboard-day-tile strong {
  font-size: 20px;
  font-weight: 450;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dashboard-day-tile-link:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-hover);
}

.dashboard-day-tile-link:focus-visible,
.dashboard-day-details > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dashboard-day-tile-debt {
  grid-column: span 2;
  border-color: var(--warning-background);
  background: var(--warning-background);
}

.dashboard-day-tile-debt > span:first-child,
.dashboard-day-tile-debt strong,
.dashboard-day-tile-debt small {
  color: var(--warning-text);
}

.dashboard-day-debt-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.dashboard-day-debt-value small {
  font-size: 10px;
  white-space: nowrap;
}

.dashboard-day-details > summary {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--secondary-text);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.25;
  list-style: none;
  cursor: pointer;
}

.dashboard-day-details > summary::-webkit-details-marker {
  display: none;
}

.dashboard-day-details > summary:hover {
  border-color: var(--accent-border);
  color: var(--link);
}

.dashboard-day-detail-content {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--row-border);
}

.dashboard-day-detail-content .dashboard-summary > div {
  padding-block: 9px;
}

.dashboard-day-detail-content .dashboard-reminders {
  margin-top: 14px;
}

.dashboard-statuses {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-status-section .section-heading {
  margin-bottom: 10px;
}

.dashboard-status {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 72px;
  min-width: 0;
  padding: 10px 11px;
  border: 0;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-status .status-badge {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 450;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: normal;
}

:root:not([data-theme="dark"]) .dashboard-status .status-badge {
  box-shadow: none;
}

.dashboard-status .status-badge::before {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.dashboard-status strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 450;
  line-height: 1;
}

.dashboard-clickable:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}

.dashboard-grid {
  gap: 20px;
}

.dashboard-work-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.dashboard-work-grid-single {
  grid-template-columns: 1fr;
}

.dashboard-work-grid .panel,
.dashboard-work-queues {
  min-width: 0;
}

.dashboard-work-queues {
  display: grid;
  gap: 20px;
}

.dashboard-activity-idline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  min-width: 0;
}

.dashboard-activity-idline > .text-link {
  font-size: 14px;
  font-weight: 450;
  line-height: 1.25;
}

.dashboard-ready-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.dashboard-ready-list > li {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--row-border);
  border-radius: 12px;
  background: var(--table-heading);
}

.dashboard-ready-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.dashboard-ready-identity {
  min-width: 0;
}

.dashboard-ready-identity > .text-link {
  font-weight: 450;
}

.dashboard-ready-top .status-badge {
  flex-shrink: 0;
}

.dashboard-ready-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .8fr);
  gap: 12px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--row-border);
}

.dashboard-ready-facts > div {
  min-width: 0;
}

.dashboard-ready-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-ready-facts dd {
  margin: 4px 0 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dashboard-ready-facts dd > span {
  display: block;
}

.dashboard-ready-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.dashboard-activity-list {
  margin-top: 16px;
}

.dashboard-activity-row {
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.5fr) minmax(175px, .8fr);
  align-items: start;
  gap: 24px;
  padding: 22px 0;
}

.dashboard-activity-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-activity-main {
  gap: 6px;
}

.dashboard-activity-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.dashboard-activity-meta time,
.dashboard-activity-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.dashboard-activity-main > .text-link {
  font-size: 15px;
  line-height: 1.3;
}

.dashboard-activity-label {
  display: block;
  margin-bottom: 10px;
}

.dashboard-activity-composition ul {
  gap: 10px;
}

.dashboard-activity-composition li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
}

.dashboard-item-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 7px;
  min-width: 0;
}

.dashboard-item-amount {
  margin-left: 0;
  color: var(--secondary-text);
  font-weight: 450;
}

.dashboard-activity-result {
  align-items: stretch;
  gap: 0;
  padding-left: 20px;
  border-left: 1px solid var(--row-border);
}

.dashboard-activity-result strong {
  font-size: 19px;
  font-weight: 450;
  line-height: 1.25;
}

.dashboard-activity-balance {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--row-border);
  color: var(--debt-text);
  font-size: 12px;
}

.dashboard-activity-balance .debt-amount {
  white-space: nowrap;
}

.dashboard-chart-total {
  font-weight: 450;
}

.login-page {
  background: var(--background);
}

.login-panel {
  gap: 16px;
  padding: 32px;
}

.login-panel h1 {
  margin-bottom: 0;
}

.login-panel .muted {
  margin: 0;
  font-size: 13px;
}

@media (min-width: 1600px) {
  .dashboard-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-status {
    padding: 12px 16px;
  }

  .dashboard-status .status-badge {
    font-size: 13px;
  }

  .dashboard-status .status-badge::before {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 1200px) {
  .dashboard-metrics.dashboard-highlight-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .dashboard-statuses {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .dashboard-status {
    grid-column: span 3;
  }

  .dashboard-status:nth-child(n+5) {
    grid-column: span 4;
  }

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

@media (max-width: 1000px) {
  .layout > .sidebar {
    width: 212px;
  }

  main {
    padding: 30px 24px 52px;
  }

  .topbar {
    padding-inline: 24px;
  }
}

@media (max-width: 900px) {
  .dashboard-activity-result {
    padding: 12px 0 0;
    border-top: 1px solid var(--row-border);
    border-left: 0;
  }

  .dashboard-activity-result .dashboard-activity-label {
    margin-bottom: 0;
  }

  .dashboard-activity-balance {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
  }
}

@media (max-width: 760px) {
  .dashboard-metrics.dashboard-highlight-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dashboard-status,
  .dashboard-status:nth-child(n+5) {
    grid-column: auto;
  }

  .dashboard-status:last-child {
    grid-column: 1 / -1;
  }

  .layout > .sidebar {
    width: min(300px, calc(100vw - 52px));
    padding: 20px 16px;
  }

  .topbar {
    height: 58px;
    padding-inline: 16px;
  }

  main {
    padding: 26px 16px 48px;
  }

  .page-heading {
    margin-bottom: 23px;
  }

  h1 {
    font-size: 28px;
  }
}

@media (max-width: 600px) {
  .dashboard-ready-top {
    flex-wrap: wrap;
  }

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

  .dashboard-day-card {
    padding: 18px;
  }

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

  .dashboard-day-details > summary {
    top: 18px;
    right: 18px;
  }

  .dashboard-metrics.dashboard-highlight-metrics,
  .dashboard-support-metrics {
    grid-template-columns: 1fr;
  }

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

  .dashboard-metric {
    min-height: 120px;
    padding: 16px;
  }

  .dashboard-metric strong {
    font-size: 22px;
  }

  .dashboard-status {
    padding: 12px;
  }

  .search-bar {
    padding: 14px;
  }

  .login-panel {
    padding: 24px;
  }
}

/* Full-width salon activity feed. */
.dashboard-activity {
  min-width: 0;
}

.dashboard-activity .dashboard-activity-meta {
  align-items: center;
  gap: 6px 11px;
}

.dashboard-activity .dashboard-activity-kind {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.dashboard-activity .dashboard-activity-by {
  color: var(--secondary-text);
  font-size: 12px;
}

.dashboard-activity .dashboard-activity-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.3;
}

.dashboard-activity .dashboard-activity-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.dashboard-activity .dashboard-activity-idline > .text-link,
.dashboard-activity .dashboard-activity-idline > strong,
.dashboard-activity .dashboard-activity-buyer {
  display: inline-flex;
  width: fit-content;
  max-width: calc(100% + 10px);
  margin-left: -10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--active-background);
  color: var(--active-text);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dashboard-activity .dashboard-activity-buyer a {
  color: inherit;
}

.dashboard-activity .dashboard-activity-idline > .text-link,
.dashboard-activity .dashboard-activity-buyer a {
  text-decoration: none;
}

.dashboard-activity .dashboard-activity-idline > .text-link:hover,
.dashboard-activity .dashboard-activity-buyer:has(a):hover {
  background: var(--hover);
}

.dashboard-activity .dashboard-activity-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 0;
}

.dashboard-activity-entry.is-day-start:not(:first-child) {
  margin-top: 12px;
}

.dashboard-activity-date {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 10px;
  color: var(--secondary-text);
  font-size: 13px;
  font-weight: 450;
  white-space: nowrap;
}

.dashboard-activity-date::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.dashboard-day-revenue {
  display: grid;
  grid-template-columns: 110px minmax(132px, 1fr) minmax(150px, 1.15fr) minmax(120px, .9fr) minmax(160px, 1.15fr) minmax(130px, .9fr) 44px;
  align-items: center;
  gap: 0;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 4px 8px 4px 16px;
  border: 1px solid #e8ddeb;
  border-radius: 10px;
  background: #f8f3fa;
  color: #624771;
  white-space: normal;
}

.dashboard-day-revenue::after { display: none; }
.dashboard-day-revenue > time {
  font-size: 11.9px;
  font-weight: 600;
}
.dashboard-day-revenue-metric,
.dashboard-day-revenue-profit {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 7px;
  min-width: 0;
  padding: 4px 12px;
}
.dashboard-day-revenue-metric::before,
.dashboard-day-revenue-profit::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 1px;
  background: #e3d5e9;
  content: "";
}
.dashboard-day-revenue-metric > span,
.dashboard-day-revenue-profit > span {
  font-size: 10.2px;
  line-height: 1.2;
}
.dashboard-day-revenue-metric > strong,
.dashboard-day-revenue-profit > strong {
  font-size: 13.6px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.dashboard-day-revenue-profit {
  color: #246441;
}
.dashboard-day-revenue-profit.is-neutral {
  color: #624771;
}
.dashboard-day-revenue-download {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  align-self: center;
  border-radius: 8px;
  color: inherit;
}
.dashboard-day-revenue-download:hover,
.dashboard-day-revenue-download:focus-visible { background: #eee3f2; }

:root[data-theme="dark"] .dashboard-day-revenue {
  border-color: #57475d;
  background: #302738;
  color: #ead8f0;
}
:root[data-theme="dark"] .dashboard-day-revenue-metric::before,
:root[data-theme="dark"] .dashboard-day-revenue-profit::before { background: #57475d; }
:root[data-theme="dark"] .dashboard-day-revenue-profit {
  color: #bce8c7;
}
:root[data-theme="dark"] .dashboard-day-revenue-profit.is-neutral {
  color: #ead8f0;
}
:root[data-theme="dark"] .dashboard-day-revenue-download:hover,
:root[data-theme="dark"] .dashboard-day-revenue-download:focus-visible { background: #483a50; }

@media (max-width: 1080px) {
  .dashboard-day-revenue {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
    gap: 3px 0;
    padding: 6px 8px 6px 12px;
  }
  .dashboard-day-revenue > time { grid-column: 1 / 4; }
  .dashboard-day-revenue-download { grid-column: 4; grid-row: 1; }
  .dashboard-day-revenue-metric:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .dashboard-day-revenue-metric:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .dashboard-day-revenue-metric:nth-of-type(3) { grid-column: 3 / 5; grid-row: 2; }
  .dashboard-day-revenue-metric:nth-of-type(4) { grid-column: 1 / 3; grid-row: 3; }
  .dashboard-day-revenue-profit { grid-column: 3 / 5; grid-row: 3; }
}

@media (max-width: 600px) {
  .dashboard-day-revenue { grid-template-columns: repeat(2, minmax(0, 1fr)) 44px; }
  .dashboard-day-revenue > time { grid-column: 1 / 3; }
  .dashboard-day-revenue-download { grid-column: 3; }
  .dashboard-day-revenue-metric:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .dashboard-day-revenue-metric:nth-of-type(2) { grid-column: 2 / 4; grid-row: 2; }
  .dashboard-day-revenue-metric:nth-of-type(3) { grid-column: 1; grid-row: 3; }
  .dashboard-day-revenue-metric:nth-of-type(4) { grid-column: 2 / 4; grid-row: 3; }
  .dashboard-day-revenue-profit { grid-column: 1 / 4; grid-row: 4; }
}

.dashboard-activity .dashboard-activity-main {
  gap: 4px;
}

.dashboard-activity .dashboard-activity-row,
.dashboard-activity .dashboard-activity-row:last-child {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  padding: 14px 20px;
  border: 1px solid var(--row-border);
  border-radius: 12px;
  background: var(--background);
}

.dashboard-activity .dashboard-activity-composition {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid var(--row-border);
}

.dashboard-activity .dashboard-activity-composition .dashboard-activity-label {
  margin-bottom: 6px;
}

.dashboard-activity .dashboard-activity-composition ul {
  gap: 6px;
}

.dashboard-activity .dashboard-activity-result {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding: 0;
  border: 0;
  text-align: right;
}

.dashboard-activity .dashboard-activity-result .dashboard-activity-label {
  margin-bottom: 3px;
}

.dashboard-activity .dashboard-activity-price-line {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dashboard-activity .dashboard-activity-price-line > :last-child {
  white-space: nowrap;
}

.dashboard-activity .dashboard-activity-total {
  color: var(--text);
}

.dashboard-activity .dashboard-activity-total strong {
  font-size: 20px;
}

.dashboard-activity .dashboard-activity-balance {
  margin-top: 10px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: var(--warning-background);
  white-space: nowrap;
}

.dashboard-activity .dashboard-activity-extra[hidden],
.dashboard-activity-toggle[hidden] {
  display: none;
}

.dashboard-activity-toggle {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  padding: 9px 17px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--active-text);
  background: var(--active-background);
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.dashboard-activity-toggle:hover {
  background: var(--hover);
}

.dashboard-activity-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .dashboard-activity .dashboard-activity-row,
  .dashboard-activity .dashboard-activity-row:last-child {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .dashboard-activity .dashboard-activity-result {
    grid-column: 1;
    grid-row: 3;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
    text-align: left;
  }

  .dashboard-activity .dashboard-activity-balance {
    margin-top: 0;
  }
}

.dashboard-day-revenue-limited {
  grid-template-columns: 110px repeat(4, minmax(0, 1fr)) 44px;
}
@media (max-width: 1080px) {
  .dashboard-day-revenue-limited { grid-template-columns: repeat(2, minmax(0, 1fr)) 44px; }
  .dashboard-day-revenue-limited > time { grid-column: 1 / 3; grid-row: 1; }
  .dashboard-day-revenue-limited .dashboard-day-revenue-download { grid-column: 3; grid-row: 1; }
  .dashboard-day-revenue-limited .dashboard-day-revenue-metric:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .dashboard-day-revenue-limited .dashboard-day-revenue-metric:nth-of-type(2) { grid-column: 2 / 4; grid-row: 2; }
  .dashboard-day-revenue-limited .dashboard-day-revenue-metric:nth-of-type(3) { grid-column: 1; grid-row: 3; }
  .dashboard-day-revenue-limited .dashboard-day-revenue-metric:nth-of-type(4) { grid-column: 2 / 4; grid-row: 3; }
}
