:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #eef6f1;
  --ink: #17211d;
  --muted: #69746f;
  --line: #d9e0dc;
  --soft-line: #e9eeeb;
  --primary: #176b4d;
  --primary-strong: #0d5138;
  --primary-soft: #dff1e8;
  --blue: #245f9f;
  --blue-soft: #e6f0fb;
  --amber: #a55e11;
  --amber-soft: #fff2dd;
  --red: #b23b3b;
  --red-soft: #fdeaea;
  --violet: #6354a4;
  --violet-soft: #efedfb;
  --shadow: 0 18px 42px rgba(23, 33, 29, 0.08);
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

.cloud-login {
  min-height: 100vh;
  padding: 24px;
  background: #15231e;
  display: grid;
  place-items: center;
}

.cloud-login[hidden] {
  display: none;
}

.cloud-login-card {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.cloud-login-brand {
  padding: 18px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--ink);
}

.cloud-login-brand p {
  color: var(--muted);
}

.cloud-login-form {
  padding: 18px;
  display: grid;
  gap: 13px;
}

.cloud-login-form[hidden] {
  display: none;
}

.cloud-login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cloud-login-actions.single-action {
  grid-template-columns: 1fr;
}

.cloud-login-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  flex: 0 0 auto;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #15231e;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f8fffb 0%, #dff1e8 100%);
  color: var(--primary-strong);
  font-weight: 900;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.66), 0 8px 18px rgba(13, 81, 56, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
  line-height: 1.15;
}

.brand h1 {
  font-size: 19px;
}

.brand p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 42px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.16);
}

.side-summary {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 6px;
}

.side-summary span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 800;
}

.side-summary strong {
  font-size: 24px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 12px clamp(14px, 2vw, 24px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar h2 {
  font-size: 24px;
}

.app-clock {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.eyebrow {
  display: none;
}

.top-actions,
.filter-row,
.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.month-field {
  height: 40px;
  min-width: 172px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.month-field input {
  height: 30px;
  border: 0;
  padding: 0;
  min-width: 110px;
}

.button,
.icon-button,
.small-action {
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

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

.button:hover,
.icon-button:hover,
.small-action:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

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

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover {
  background: #f8faf8;
}

.button.danger {
  background: var(--red-soft);
  border-color: #f4c9c9;
  color: var(--red);
}

.button:disabled,
.small-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.button.followup-button {
  background: var(--amber-soft);
  border-color: #f4d39b;
  color: var(--amber);
}

.button.followup-button span {
  min-width: 22px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--red);
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 36px;
  height: 36px;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.view {
  display: none;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 14px clamp(12px, 1.6vw, 20px) 20px;
}

.view.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat-item {
  min-width: 0;
  min-height: 96px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  align-content: space-between;
}

.stat-item span,
.stat-item em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.stat-item strong {
  margin: 9px 0 8px;
  font-size: clamp(22px, 2.3vw, 31px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.stat-item.accent {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.stat-item.accent span,
.stat-item.accent em {
  color: rgba(255, 255, 255, 0.76);
}

.overview-layout,
.work-layout,
.finance-grid,
.settings-grid {
  display: grid;
  gap: 12px;
}

.overview-layout {
  grid-template-columns: minmax(360px, 1.05fr) minmax(320px, 0.95fr);
  margin-bottom: 12px;
}

.work-layout {
  grid-template-columns: minmax(390px, 500px) minmax(560px, 1fr);
  align-items: start;
}

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

.customer-layout .panel {
  box-shadow: 0 10px 26px rgba(23, 33, 29, 0.045);
}

.customer-layout .panel-header {
  min-height: 56px;
  padding: 13px 16px;
}

.customer-layout .panel-header h3 {
  font-size: 18px;
}

.customer-layout .data-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px 16px 16px;
  gap: 12px;
  align-items: end;
}

.customer-layout .data-form .field {
  gap: 7px;
}

.customer-layout .data-form .field span {
  font-size: 13px;
}

.customer-layout .data-form input,
.customer-layout .data-form select {
  height: 40px;
}

.customer-layout .data-form textarea {
  min-height: 78px;
  height: 78px;
  line-height: 1.6;
}

.customer-layout .data-form .field.wide {
  grid-column: span 2;
}

.customer-layout .data-form .button {
  min-height: 40px;
}

.customer-layout .data-form .button.full {
  grid-column: span 2;
  align-self: end;
  justify-self: end;
  width: min(240px, 100%);
}

.customer-layout .table-panel {
  display: grid;
  grid-template-rows: auto auto minmax(360px, 1fr);
  min-height: calc(100vh - 390px);
}

.customer-layout .table-panel .panel-header {
  border-bottom: 0;
  padding-bottom: 8px;
}

.customer-layout .table-panel .table-wrap {
  min-height: 360px;
  max-height: calc(100vh - 440px);
  border-top: 1px solid var(--soft-line);
}

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

.product-layout .panel {
  box-shadow: 0 8px 24px rgba(23, 33, 29, 0.04);
}

.product-layout .panel-header {
  min-height: 56px;
  padding: 13px 16px;
}

.product-layout #productForm {
  grid-template-columns: minmax(260px, 1fr) auto;
  padding: 14px 16px 16px;
  align-items: end;
}

.product-layout #productForm .field.wide {
  grid-column: auto;
}

.product-layout #productForm .button.full {
  width: min(190px, 100%);
}

.product-month-field {
  min-width: 210px;
}

.product-sales-panel {
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  padding: 14px 16px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

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

.product-insight-card {
  min-width: 0;
  min-height: 82px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fbfcfb;
  display: grid;
  align-content: space-between;
}

.product-insight-card span,
.product-insight-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.product-insight-card strong {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.product-sales-summary {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfcfb;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.product-donut {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.product-donut::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  background: #fbfcfb;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.product-donut div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  text-align: center;
}

.product-donut strong {
  font-size: 15px;
}

.product-donut span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-donut-legend {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.product-legend-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.product-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.product-legend-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.product-legend-row strong {
  overflow-wrap: anywhere;
}

.product-legend-row em,
.product-legend-row b {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.customer-toolbar {
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
  display: grid;
  gap: 10px;
}

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

.customer-insight-card {
  min-width: 0;
  min-height: 54px;
  border: 1px solid #edf1ef;
  border-radius: var(--radius);
  padding: 9px 12px;
  background: #fbfcfb;
  display: grid;
  align-content: space-between;
}

.customer-insight-card span,
.customer-insight-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.customer-insight-card strong {
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.customer-search-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 190px) auto minmax(170px, 190px) minmax(150px, 180px);
  gap: 8px;
  align-items: center;
}

.customer-search-field {
  min-width: 0;
}

.customer-date-field,
.customer-month-field {
  min-width: 0;
}

.customer-detail-modal {
  width: min(760px, 100%);
}

.customer-detail-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.customer-detail-head {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fbfcfb;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-detail-head div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.customer-detail-head strong,
.customer-detail-grid strong {
  overflow-wrap: anywhere;
}

.customer-detail-head span:not(.status),
.customer-detail-grid span,
.customer-detail-note span,
.customer-detail-muted,
.customer-followup-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.customer-detail-grid div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
  display: grid;
  gap: 6px;
}

.customer-detail-grid div:nth-child(3n) {
  border-right: 0;
}

.customer-detail-grid div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.customer-detail-note,
.customer-followup-history {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fff;
}

.customer-detail-note p {
  margin: 7px 0 0;
  color: var(--ink);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.customer-detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.customer-detail-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.customer-followup-item {
  padding: 10px 0;
  border-top: 1px solid var(--soft-line);
  display: grid;
  gap: 5px;
}

.customer-followup-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.customer-followup-item p {
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.customer-detail-muted {
  margin: 0;
}

.customer-detail-actions {
  padding-top: 2px;
}

.traffic-management-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.traffic-entry-panel .data-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.traffic-entry-panel .data-form .field.wide {
  grid-column: span 2;
}

.traffic-entry-panel .data-form .button.full {
  align-self: end;
}

.traffic-channel-manager {
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
  background: #fbfcfb;
}

.traffic-channel-manager-head {
  min-height: 40px;
  padding: 0 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.traffic-channel-manager-head h3 {
  margin: 0;
  font-size: 16px;
}

.traffic-record-panel {
  margin-top: 12px;
}

.content-layout {
  display: grid;
  gap: 12px;
}

.content-overview-panel {
  overflow: hidden;
}

.content-stat-grid {
  padding: 14px;
  border-bottom: 1px solid var(--soft-line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.content-stat-card {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fbfcfb;
  padding: 13px 14px;
  display: grid;
  gap: 6px;
}

.content-stat-card span,
.content-stat-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.content-stat-card strong {
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
}

.content-stat-card.today {
  background: var(--blue-soft);
  border-color: #c7dbef;
}

.content-stat-card.done {
  background: var(--primary-soft);
  border-color: #b9decf;
}

.content-stat-card.month {
  background: var(--amber-soft);
  border-color: #efd3a5;
}

.content-stat-card.rate {
  background: var(--violet-soft);
  border-color: #d5cfee;
}

.content-dashboard-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 12px;
}

.content-card-block {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.content-block-head {
  min-height: 46px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.content-block-head h3 {
  margin: 0;
  font-size: 16px;
}

.content-insight-list,
.content-today-list {
  padding: 10px 14px 14px;
  display: grid;
  gap: 9px;
}

.content-insight-row {
  min-width: 0;
  border-bottom: 1px solid var(--soft-line);
  padding: 0 0 10px;
  display: grid;
  gap: 8px;
}

.content-insight-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.content-insight-head,
.content-today-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.content-insight-head strong,
.content-today-row strong {
  overflow-wrap: anywhere;
}

.content-insight-head span,
.content-today-row > span {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.content-insight-row p,
.content-today-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.content-today-row {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: #fbfcfb;
}

.content-today-row.done {
  border-color: #b9decf;
  background: #f6fbf8;
}

.content-entry-panel .data-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-entry-panel .data-form .field.wide {
  grid-column: span 3;
}

.content-entry-panel .data-form .button.full {
  align-self: end;
}

.content-channel-manager {
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
  background: #fbfcfb;
}

.content-channel-manager-head {
  min-height: 40px;
  padding: 0 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-channel-manager-head h3 {
  margin: 0;
  font-size: 16px;
}

.content-record-panel {
  margin-top: 0;
}

.finance-live-panel {
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(23, 33, 29, 0.06);
}

.finance-live-header {
  min-height: 62px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-live-header h3 {
  margin: 0;
  line-height: 1.15;
}

.finance-dashboard {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  align-items: stretch;
}

.finance-main-metrics {
  min-width: 0;
  display: grid;
  gap: 10px;
}

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

.finance-period-card {
  --period-color: var(--primary);
  --period-soft: var(--primary-soft);
  --period-tint: #f7fbf8;
  --period-line: #c7e3d5;
  position: relative;
  min-width: 0;
  border: 1px solid rgba(23, 107, 77, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--period-tint) 0, #fff 42%);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(23, 33, 29, 0.05);
}

.finance-period-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--period-color);
}

.finance-period-card.day {
  --period-color: #176b4d;
  --period-soft: #e2f4ec;
  --period-tint: #f5fbf8;
  --period-line: #b7dccc;
  border-color: #b7dccc;
}

.finance-period-card.month {
  --period-color: #245f9f;
  --period-soft: #e6f0fb;
  --period-tint: #f6faff;
  --period-line: #bfd5ee;
  border-color: #bfd5ee;
}

.finance-period-card.year {
  --period-color: #6354a4;
  --period-soft: #efedfb;
  --period-tint: #fbf9ff;
  --period-line: #d0c8ec;
  border-color: #d0c8ec;
}

.finance-period-head {
  padding: 12px 14px 10px 18px;
  border-bottom: 1px solid var(--period-line);
  background: var(--period-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-period-head strong {
  color: var(--period-color);
  font-size: 16px;
}

.finance-period-head span {
  min-width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--period-color);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.finance-period-values {
  display: grid;
  grid-template-columns: 1fr;
}

.finance-period-values div {
  min-width: 0;
  padding: 11px 14px 11px 18px;
  border-bottom: 1px solid var(--soft-line);
  display: grid;
  gap: 5px;
}

.finance-period-values div:last-child {
  border-bottom: 0;
}

.finance-period-values span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.finance-period-values strong {
  color: var(--period-color);
  font-size: clamp(19px, 1.8vw, 26px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

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

.finance-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.finance-clock {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.finance-today-card {
  min-height: 104px;
  border: 1px solid var(--soft-line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  display: grid;
  align-content: space-between;
}

.finance-today-card span,
.finance-today-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.finance-today-card strong {
  margin: 8px 0 6px;
  font-size: clamp(25px, 2.5vw, 36px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.finance-today-card.income {
  border-left-color: var(--primary);
}

.finance-today-card.expense {
  border-left-color: var(--red);
}

.finance-today-card.net {
  border-left-color: var(--blue);
}

.finance-filter-summary {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f8faf8;
}

.finance-filter-summary div {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--soft-line);
  display: grid;
  gap: 4px;
}

.finance-filter-summary div:last-child {
  border-right: 0;
}

.finance-filter-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.finance-filter-summary strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.finance-ratio-board {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfcfb;
  display: grid;
  align-content: start;
}

.finance-ratio-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.finance-ratio-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.finance-ratio-bars {
  display: grid;
  gap: 12px;
}

.finance-ratio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: end;
}

.finance-ratio-row div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.finance-ratio-row strong,
.finance-ratio-row span {
  overflow-wrap: anywhere;
}

.finance-ratio-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.finance-ratio-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.finance-ratio-meter {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

.finance-ratio-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.finance-ratio-row.expense .finance-ratio-meter span {
  background: var(--red);
}

.finance-section {
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(23, 33, 29, 0.045);
}

.finance-income-layout {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--soft-line);
}

.finance-income-layout .summary-list {
  margin: 14px 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfcfb;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.finance-income-table {
  min-width: 720px;
}

.finance-expense-layout {
  display: grid;
  grid-template-columns: 1fr;
  padding: 14px 16px;
  background: #fff;
}

.finance-tool-block {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fff;
}

.finance-block-head {
  min-height: 56px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-block-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.finance-expense-layout .data-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.finance-expense-layout .data-form .field.wide {
  grid-column: span 2;
}

.finance-expense-layout .data-form .button.full {
  grid-column: span 2;
  align-self: end;
  justify-self: end;
  width: min(220px, 100%);
}

.expense-category-manager {
  border-top: 1px solid var(--soft-line);
  padding-top: 10px;
  background: #fff;
}

.expense-category-head {
  min-height: 36px;
  padding: 0 14px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.expense-category-head h3 {
  margin: 0;
  font-size: 15px;
}

.expense-category-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-height: 210px;
}

.expense-category-list .tag-item {
  min-height: 42px;
  background: #fff;
}

.expense-category-list .tag-actions {
  justify-content: flex-start;
}

.finance-expense-summary {
  border-top: 1px solid var(--soft-line);
  background: #fff;
  padding: 14px 16px;
}

.finance-expense-summary .summary-list {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfcfb;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.expense-donut {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.expense-donut::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  background: #fbfcfb;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.expense-donut div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  text-align: center;
}

.expense-donut strong {
  font-size: 15px;
}

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

.expense-donut-legend {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.expense-legend-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.expense-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.expense-legend-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.expense-legend-row strong {
  overflow-wrap: anywhere;
}

.expense-legend-row em,
.expense-legend-row b {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.inline-panel-header {
  border-top: 1px solid var(--soft-line);
}

.finance-grid,
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.compact-panel {
  align-self: stretch;
}

.panel-header {
  min-height: 60px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.panel h3 {
  font-size: 18px;
}

.panel-subhead {
  padding: 0 14px;
}

.compact-subhead h3 {
  font-size: 16px;
}

.pill {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.announcement-list,
.summary-list,
.tag-list {
  padding: 10px 14px 14px;
  display: grid;
  gap: 8px;
}

.announcement-item {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.announcement-item.overdue {
  border-color: #f2c6c6;
  background: #fffafa;
}

.announcement-item strong,
.summary-main strong {
  display: block;
  overflow-wrap: anywhere;
}

.announcement-item p,
.summary-main p,
.empty-state {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.empty-state {
  padding: 16px;
  text-align: center;
}

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

.summary-main {
  min-width: 0;
}

.summary-amount {
  text-align: right;
  font-weight: 900;
}

.bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

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

.traffic-screen {
  height: clamp(360px, 48vh, 540px);
  border-color: #203d33;
  background: #101c18;
  color: #f6fbf8;
  overflow: hidden;
}

.traffic-screen-header {
  min-height: 66px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.traffic-screen h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.traffic-screen .eyebrow {
  color: #8ce0b7;
}

.live-meta {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #72df9f;
  box-shadow: 0 0 0 0 rgba(114, 223, 159, 0.55);
  animation: livePulse 1.6s ease-out infinite;
}

.traffic-screen-body {
  height: calc(100% - 66px);
  display: grid;
  grid-template-columns: minmax(230px, 0.32fr) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}

.traffic-hero-stat {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  align-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.traffic-hero-stat span,
.traffic-hero-stat em {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.traffic-hero-stat strong {
  margin: 12px 0;
  font-size: clamp(58px, 7vw, 104px);
  line-height: 0.92;
  color: #fff;
  animation: numberJump 1.2s ease-in-out infinite;
}

.traffic-board {
  min-width: 0;
  overflow: auto;
  padding-right: 2px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.traffic-channel-row {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(120px, 0.36fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
}

.traffic-channel-row.is-hot {
  border-color: rgba(140, 224, 183, 0.48);
  background: rgba(140, 224, 183, 0.1);
}

.traffic-channel-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.traffic-channel-title strong {
  overflow-wrap: anywhere;
}

.traffic-channel-title span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 800;
}

.traffic-meter {
  height: 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.traffic-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #72df9f;
  animation: barBreathe 1.35s ease-in-out infinite;
}

.traffic-channel-count {
  min-width: 82px;
  text-align: right;
  font-size: 24px;
  font-weight: 900;
}

.traffic-empty {
  height: 100%;
  min-height: 180px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.66);
  font-weight: 900;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(114, 223, 159, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(114, 223, 159, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(114, 223, 159, 0);
  }
}

@keyframes numberJump {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes barBreathe {
  0%,
  100% {
    filter: brightness(0.95);
  }
  50% {
    filter: brightness(1.18);
  }
}

.data-form {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.field-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.compact-button {
  min-width: 86px;
  padding-inline: 11px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 72px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.13);
}

.inline-form {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.split-line {
  margin: 4px 14px 12px;
  border-top: 1px solid var(--soft-line);
}

.tag-list {
  padding-top: 0;
}

.tag-item {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 11px;
}

.compact-inline {
  padding-bottom: 10px;
}

.compact-tags {
  max-height: 190px;
  overflow: auto;
  padding-bottom: 12px;
}

.referral-field {
  display: none;
}

.referral-field.show {
  display: grid;
}

.tag-item.inactive {
  color: var(--muted);
  background: #fafafa;
}

.tag-item strong {
  overflow-wrap: anywhere;
}

.tag-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-action {
  min-height: 30px;
  padding: 0 8px;
  background: #fff;
  border-color: var(--line);
  color: var(--primary);
  font-size: 12px;
}

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

.small-action.danger {
  color: var(--red);
}

.text-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 900;
  text-align: left;
  white-space: normal;
}

.text-action:hover {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.product-table {
  min-width: 960px;
}

.product-table th,
.product-table td {
  padding: 16px 18px;
  line-height: 1.65;
  vertical-align: middle;
}

.product-table th:nth-child(2) {
  width: 34%;
}

.product-table th:nth-child(3),
.product-table th:nth-child(4) {
  width: 16%;
}

.product-table .cell-main {
  gap: 7px;
}

.product-table .cell-main strong {
  font-size: 15px;
  line-height: 1.45;
}

.product-table .row-actions {
  gap: 8px;
}

.product-table .small-action {
  min-height: 32px;
  padding-inline: 10px;
}

.check-cell {
  width: 44px;
  text-align: center;
}

.check-cell input {
  width: 17px;
  height: 17px;
  padding: 0;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

td {
  font-size: 14px;
}

.cell-main {
  display: grid;
  gap: 3px;
}

.cell-main strong {
  overflow-wrap: anywhere;
}

.cell-main span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.status {
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status.done {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.status.paused {
  background: var(--violet-soft);
  color: var(--violet);
}

.data-status {
  margin: 0;
  padding: 8px 16px 16px;
  display: grid;
  gap: 8px;
}

.data-status div {
  min-height: 42px;
  border-bottom: 1px solid var(--soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-status div:last-child {
  border-bottom: 0;
}

.data-status dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.data-status dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.settings-actions {
  padding: 16px;
}

.compact-settings-actions {
  padding-top: 10px;
}

.settings-note {
  margin: 0 16px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.license-status dd {
  max-width: 65%;
}

.brand-preview {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fbfcfb;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-preview strong,
.brand-preview span {
  display: block;
  overflow-wrap: anywhere;
}

.brand-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 24, 20, 0.46);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 24, 20, 0.24);
}

.modal-header {
  min-height: 72px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  line-height: 1.15;
}

.followup-customer-card {
  margin: 16px 16px 0;
  padding: 13px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.followup-customer-card strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.followup-customer-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.followup-form {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.check-row {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  color: var(--ink);
  font-weight: 900;
}

.check-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.next-followup-field {
  display: none;
}

.next-followup-field.show {
  display: grid;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  transform: translate(-50%, 18px);
  min-width: 210px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #17211d;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 16px 12px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .nav-item {
    justify-content: flex-start;
  }

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

  .overview-layout,
  .work-layout,
  .customer-search-row,
  .product-sales-panel,
  .traffic-management-grid,
  .content-dashboard-grid,
  .finance-dashboard,
  .finance-income-layout,
  .finance-expense-layout,
  .finance-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .traffic-screen {
    height: auto;
    min-height: 420px;
  }

  .traffic-screen-body {
    height: auto;
    grid-template-columns: 1fr;
  }

  .content-entry-panel .data-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-entry-panel .data-form .field.wide,
  .content-entry-panel .data-form .button.full {
    grid-column: 1 / -1;
  }

  .customer-layout .data-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-layout .data-form .field.wide,
  .customer-layout .data-form .button.full {
    grid-column: 1 / -1;
  }

  .product-layout #productForm {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .product-sales-summary {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .finance-income-layout .summary-list {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .finance-expense-layout .data-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-expense-layout .data-form .field.wide,
  .finance-expense-layout .data-form .button.full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 188px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 10px;
    gap: 14px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .side-summary {
    display: none;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .app-clock {
    justify-content: flex-start;
  }

  .top-actions,
  .finance-live-header,
  .finance-filter-row,
  .settings-actions,
  .modal-actions {
    align-items: stretch;
  }

  .finance-live-header {
    flex-direction: column;
  }

  .finance-today-grid,
  .finance-period-grid,
  .content-dashboard-grid,
  .finance-filter-summary {
    grid-template-columns: 1fr;
  }

  .top-actions > *,
  .finance-filter-row > *,
  .settings-actions > *,
  .modal-actions > * {
    flex: 1 1 150px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

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

  .customer-insight-grid,
  .product-insight-grid,
  .content-stat-grid,
  .customer-detail-grid {
    grid-template-columns: 1fr;
  }

  .customer-detail-grid div,
  .customer-detail-grid div:nth-child(3n),
  .customer-detail-grid div:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .customer-detail-grid div:last-child {
    border-bottom: 0;
  }

  .data-form {
    grid-template-columns: 1fr;
  }

  .customer-layout .data-form {
    grid-template-columns: 1fr;
  }

  .customer-layout .data-form .button.full {
    justify-self: stretch;
    width: 100%;
  }

  .content-entry-panel .data-form {
    grid-template-columns: 1fr;
  }

  .content-entry-panel .data-form .button.full {
    justify-self: stretch;
    width: 100%;
  }

  .product-layout #productForm {
    grid-template-columns: 1fr;
  }

  .product-layout #productForm .field.wide,
  .product-layout #productForm .button.full {
    grid-column: auto;
    width: 100%;
  }

  .product-sales-summary {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .product-donut-legend {
    width: 100%;
  }

  .finance-income-layout .summary-list {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .finance-expense-layout .data-form {
    grid-template-columns: 1fr;
  }

  .finance-expense-layout .data-form .button.full {
    justify-self: stretch;
    width: 100%;
  }

  .finance-expense-summary .summary-list {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .expense-donut-legend {
    width: 100%;
  }

  .field.wide {
    grid-column: auto;
  }

  .compact-header {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-row {
    align-items: stretch;
  }

  .announcement-item,
  .summary-row,
  .traffic-channel-row,
  .content-insight-head,
  .content-today-row,
  .finance-ratio-row {
    grid-template-columns: 1fr;
  }

  .summary-amount {
    text-align: left;
  }

  .finance-filter-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .finance-filter-summary div:last-child {
    border-bottom: 0;
  }

  .finance-income-layout .summary-list {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .finance-ratio-row em {
    text-align: left;
  }

  .traffic-channel-count {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .app-shell {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .sidebar {
    padding: 12px 8px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    display: none;
  }

  .nav-item {
    min-height: 40px;
    gap: 6px;
    padding: 0 8px;
    font-size: 13px;
  }

  .stat-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}
