.client-sales-history-switch-v325,
.clients-page-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border, #d6deeb);
  border-radius: 12px;
  background: var(--surface-muted, #eef3f8);
}
.client-sales-history-switch-v325 button,
.clients-page-switch button {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted, #5d6878);
  box-shadow: none;
}
.client-sales-history-switch-v325 button.active,
.clients-page-switch button.active {
  background: var(--surface, #fff);
  color: var(--primary, #1769e0);
  box-shadow: 0 2px 8px rgba(15, 35, 65, .12);
}
.client-sales-history-view-v325,
.client-sales-history-view {
  display: grid;
  gap: 16px;
}
.v325-day-toolbar,
.client-sales-day-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}
.v325-day-toolbar h3,
.client-sales-day-toolbar h3,
.v325-day-section h3,
.client-sales-day-section h3 { margin: 0; }
.v325-day-toolbar p,
.client-sales-day-toolbar p { margin: 5px 0 0; }
.v325-day-navigation,
.client-sales-day-navigation {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.v325-day-navigation label,
.client-sales-day-navigation label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #647084);
}
.v325-day-navigation input,
.client-sales-day-navigation input { min-width: 150px; }
.v325-day-summary,
.client-sales-day-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.v325-day-summary .card,
.client-sales-day-summary .card {
  display: grid;
  gap: 5px;
  min-height: 92px;
  align-content: center;
}
.v325-day-summary span,
.client-sales-day-summary span { color: var(--text-muted, #667085); font-size: 12px; font-weight: 700; }
.v325-day-summary strong,
.client-sales-day-summary strong { font-size: 21px; color: var(--text, #172033); }
.v325-day-section,
.client-sales-day-section { display: grid; gap: 12px; }
.v325-table-wrap,
.client-sales-manage-table-wrap { overflow: auto; border: 1px solid var(--border, #dce3ec); border-radius: 12px; }
.v325-table,
.client-sales-manage-table { width: 100%; border-collapse: collapse; min-width: 1000px; }
.v325-table th,
.v325-table td,
.client-sales-manage-table th,
.client-sales-manage-table td { padding: 11px 12px; border-bottom: 1px solid var(--border, #e2e7ee); text-align: left; vertical-align: middle; }
.v325-table th,
.client-sales-manage-table th { background: var(--surface-muted, #f4f7fa); color: var(--text-muted, #5f6b7b); font-size: 12px; white-space: nowrap; }
.v325-table tbody tr:last-child td,
.client-sales-manage-table tbody tr:last-child td { border-bottom: 0; }
.v325-client-link,
.client-history-person {
  display: grid;
  gap: 2px;
  min-width: 170px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text, #172033);
  text-align: left;
  box-shadow: none;
}
.v325-client-link:hover strong,
.client-history-person:hover strong { color: var(--primary, #1769e0); text-decoration: underline; }
.v325-client-link small,
.client-history-person small { color: var(--text-muted, #667085); font-weight: 400; }
.v325-compact,
.compact-button { min-height: 32px !important; padding: 5px 10px !important; font-size: 12px !important; }
.v325-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 20, 34, .54);
  backdrop-filter: blur(3px);
}
.v325-modal {
  width: min(650px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: grid;
  gap: 15px;
  padding: 22px;
  border: 1px solid var(--border, #d9e1eb);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--text, #172033);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
}
.v325-modal-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--border, #dde4ed); padding-bottom: 12px; }
.v325-modal-header h3 { margin: 0; }
.v325-modal-header span { color: var(--text-muted, #687385); font-size: 13px; }
.v325-close { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 10px; font-size: 24px; }
.v325-form-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v325-modal label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text, #172033); }
.v325-warning,
.client-edit-warning { padding: 11px 13px; border: 1px solid #e2ba61; border-radius: 10px; background: #fff8df; color: #6c4a00; font-size: 13px; line-height: 1.45; }
[data-theme="dark"] .v325-warning,
[data-theme="dark"] .client-edit-warning { background: #352b12; color: #f6d98b; border-color: #76602a; }
.v325-form-error { padding: 11px 13px; border-radius: 10px; background: var(--danger-soft, #fff0f0); color: var(--danger, #b42318); }
.v325-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
body.v325-modal-open { overflow: hidden; }
.v325-client-managed-history,
.client-managed-history { display: grid; gap: 14px; }
.v325-client-history-list,
.client-managed-history-list { display: grid; gap: 8px; }
.v325-client-history-list > div,
.client-managed-history-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border, #e1e6ed); }
.v325-client-history-list > div:last-child,
.client-managed-history-list > div:last-child { border-bottom: 0; }
.v325-client-history-list span,
.client-managed-history-list span { display: grid; gap: 3px; }
.v325-client-history-list small,
.client-managed-history-list small { color: var(--text-muted, #667085); }
.v325-toast { position: sticky; top: 8px; z-index: 40; }
@media (max-width: 900px) {
  .v325-day-toolbar,
  .client-sales-day-toolbar { align-items: stretch; flex-direction: column; }
  .v325-day-navigation,
  .client-sales-day-navigation { justify-content: stretch; }
  .v325-day-navigation > *,
  .client-sales-day-navigation > * { flex: 1 1 150px; }
  .v325-day-summary,
  .client-sales-day-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .clients-page-header { align-items: stretch !important; }
  .client-sales-history-switch-v325,
  .clients-page-switch { width: 100%; }
  .client-sales-history-switch-v325 button,
  .clients-page-switch button { flex: 1; }
  .v325-day-summary,
  .client-sales-day-summary { grid-template-columns: 1fr; }
  .v325-form-two { grid-template-columns: 1fr; }
  .v325-modal-backdrop { padding: 8px; }
  .v325-modal { max-height: calc(100vh - 16px); padding: 16px; }
}
