:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #f7faf5;
  --text: #061b16;
  --muted: #61716d;
  --line: #d7dfda;
  --primary: #11745f;
  --primary-strong: #0a5d4d;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c2410c;
  --green: #15803d;
  --sidebar: #13231b;
  --sidebar-soft: #2d3c33;
  --cream: #ffd166;
  --shadow: 0 18px 50px rgba(37, 52, 44, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--sidebar);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 4px 0 0;
  font-size: 26px;
}

.login-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 6px;
  color: #405469;
  font-size: 14px;
}

.login-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  outline: 0;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

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

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

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--sidebar);
  color: #eff7ef;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--cream);
  color: #102016;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.brand p {
  margin: 5px 0 0;
  color: #d5e4d8;
  font-size: 13px;
}

.module-nav {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.module-nav::-webkit-scrollbar {
  width: 6px;
}

.module-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
}

.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #e2eee4;
  text-align: left;
  padding: 12px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.nav-btn.dragging {
  opacity: .48;
}

.nav-btn:hover,
.nav-btn.active {
  color: #fff;
  border-color: rgba(255, 255, 255, .14);
  background: var(--sidebar-soft);
}

.nav-icon {
  display: inline-block;
  width: 24px;
  color: #d9efe2;
}

.side-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.user-side-card {
  padding: 14px;
}

.side-card span {
  font-size: 13px;
}

.side-card strong {
  font-size: 34px;
  line-height: 1;
}

.side-card-btn {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
}

.side-user-readonly {
  display: grid;
  gap: 4px;
}

.side-user-readonly span,
.side-user-readonly em {
  color: #d5e4d8;
  font-size: 12px;
  font-style: normal;
}

.side-user-readonly strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.workspace {
  min-width: 0;
  padding: 28px 28px 46px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 360px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.user-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.user-switch span {
  white-space: nowrap;
  font-size: 13px;
}

.user-switch select {
  min-width: 132px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.user-side-card .user-switch {
  width: 100%;
  height: auto;
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d5e4d8;
}

.user-side-card .user-switch select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.btn,
.icon-btn {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.btn {
  padding: 0 16px;
}

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

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

.btn.secondary:hover,
.icon-btn:hover {
  border-color: #b8c7d2;
  background: #f4f8fa;
}

.icon-btn {
  width: 42px;
  font-size: 24px;
}

.notice-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #c4dfd4;
  border-radius: 8px;
  background: #e4f1ea;
  color: #164e48;
}

.notice-band strong {
  display: block;
  margin-bottom: 4px;
}

.notice-band span {
  color: #42665f;
  font-size: 13px;
}

.route-crumbs {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-weight: 800;
}

.route-crumbs b {
  color: var(--primary);
}

.route-crumbs i {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.kpi-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.kpi-filter-title {
  display: grid;
  gap: 3px;
}

.kpi-filter-title strong {
  color: var(--ink);
  font-size: 16px;
}

.kpi-filter-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.kpi-filter-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi-filter-actions input {
  min-height: 36px;
  max-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 6px 9px;
  font: inherit;
}

.kpi-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.kpi-hero h3 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.kpi-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.kpi-score {
  min-width: 168px;
  padding: 16px;
  border: 1px solid #c4dfd4;
  border-radius: 8px;
  background: #e4f1ea;
  text-align: center;
}

.kpi-score span {
  color: var(--muted);
  font-size: 13px;
}

.kpi-score strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-strong);
  font-size: 34px;
}

.kpi-currency-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  min-width: min(620px, 100%);
  max-width: 760px;
}

.kpi-currency-card {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid #c4dfd4;
  border-radius: 8px;
  background: #e4f1ea;
}

.kpi-currency-card span,
.kpi-currency-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.kpi-currency-card strong {
  color: var(--primary-strong);
  font-size: 22px;
}

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

.metric-grid.kpi-metrics {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.metric {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

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

.metric-sub {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.metric-sub span {
  display: block;
  line-height: 1.35;
}

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

.dashboard-grid.three {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) minmax(280px, 1fr);
}

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

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

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

.flow-list,
.recent-list,
.status-list,
.lifecycle-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.flow-item,
.recent-item,
.status-item,
.lifecycle-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.flow-top,
.recent-top,
.status-top,
.lifecycle-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow-x: auto;
}

.pipeline-step {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.pipeline-step strong {
  font-size: 26px;
}

.pipeline-step span {
  color: var(--muted);
  font-size: 13px;
}

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

.bar i {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--primary);
}

.kpi-chart,
.ranking-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.kpi-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 2fr) 42px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kpi-bar-row strong,
.kpi-bar-row span {
  display: block;
}

.kpi-bar-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-bar-row b {
  text-align: right;
}

.ranking-item {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) minmax(84px, auto) minmax(110px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ranking-item > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dcefed;
  color: var(--primary-strong);
  font-weight: 800;
}

.kpi-style-scroller {
  display: flex;
  gap: 14px;
  padding: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.kpi-style-scroller::-webkit-scrollbar {
  height: 8px;
}

.kpi-style-scroller::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c4dfd4;
}

.kpi-style-card {
  flex: 0 0 min(360px, 82vw);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faf8 100%);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.kpi-style-card:hover {
  transform: translateY(-2px);
  border-color: #9dd5c1;
  box-shadow: 0 18px 34px rgba(15, 59, 47, .12);
}

.kpi-style-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.kpi-style-top strong,
.kpi-style-top span {
  display: block;
}

.kpi-style-top strong {
  color: var(--ink);
  font-size: 20px;
}

.kpi-style-top span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.kpi-style-meta > div {
  min-height: 72px;
  padding: 11px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.kpi-style-meta span,
.kpi-style-foot span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi-style-meta strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.kpi-style-empty {
  padding: 16px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }
.status-dot.blue { background: var(--blue); }

.lifecycle-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.lifecycle-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #dcefed;
  color: #0f5d56;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8eef3;
  color: #294459;
  font-size: 12px;
  white-space: nowrap;
}

.badge.green { background: #dcfce7; color: var(--green); }
.badge.blue { background: #dbeafe; color: var(--blue); }
.badge.amber { background: #fef3c7; color: var(--amber); }
.badge.red { background: #ffedd5; color: var(--red); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  justify-content: flex-end;
}

.filter-bar select {
  min-width: 180px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quick-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}

.order-search-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(520px, 100%);
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.order-search-group input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.order-search-group .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
}

.order-search-group .text-btn {
  white-space: nowrap;
}

.order-sort-group {
  display: flex;
  gap: 8px;
}

.order-sort-group select:first-child {
  min-width: 150px;
}

.order-sort-group select:last-child {
  min-width: 92px;
}

.quick-filter {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.quick-filter.active,
.quick-filter:hover {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.record-card {
  display: grid;
  gap: 12px;
  min-height: 162px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.record-card.clickable-card {
  cursor: pointer;
}

.record-card.clickable-card:hover {
  border-color: #b8d7ca;
  box-shadow: 0 16px 34px rgba(23, 56, 45, .13);
}

.customer-value-card {
  border-top: 4px solid #9eb8ad;
}

.customer-value-card.healthy {
  border-top-color: var(--green);
}

.customer-value-card.attention {
  border-top-color: var(--amber);
}

.customer-value-card.danger {
  border-top-color: var(--red);
}

.customer-money-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.customer-money-row.single {
  grid-template-columns: 1fr;
}

.customer-money-row > div,
.customer-stat-grid > div,
.customer-detail-kpi > div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.customer-money-row span,
.customer-stat-grid span,
.customer-detail-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.customer-money-row strong {
  color: var(--primary-strong);
  font-size: 18px;
}

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

.customer-stat-grid strong {
  font-size: 20px;
}

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

.customer-detail-kpi strong {
  font-size: 20px;
}

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

.record-card h3 {
  margin: 0;
  font-size: 18px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-money {
  color: #455b54;
}

.record-track {
  display: grid;
  gap: 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.record-track.text-only {
  color: #455b54;
}

.record-track-bar {
  height: 24px;
  border-radius: 999px;
  background: #fff0e9;
  overflow: hidden;
}

.record-track-bar i {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: #ffd8c9;
}

.sample-track,
.quotation-track,
.feedback-track,
.order-track {
  gap: 8px;
}

.progress-track-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.progress-track-head b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sample-track .record-track-bar,
.quotation-track .record-track-bar,
.feedback-track .record-track-bar,
.order-track .record-track-bar {
  height: 12px;
  background: #eef2f0;
}

.sample-pending {
  color: #8a5b12;
}

.sample-pending .record-track-bar {
  background: #fff6df;
}

.sample-pending .record-track-bar i {
  background: #f5c35b;
}

.sample-making {
  color: #0f5d56;
}

.sample-making .record-track-bar {
  background: #e2f3ee;
}

.sample-making .record-track-bar i {
  background: #34a58e;
}

.sample-sent {
  color: #1d4ed8;
}

.feedback-pending {
  color: #8a5b12;
}

.feedback-pending .record-track-bar {
  background: #fff6df;
}

.feedback-pending .record-track-bar i {
  background: #f5c35b;
}

.feedback-processing {
  color: #0f5d56;
}

.feedback-processing .record-track-bar {
  background: #e2f3ee;
}

.feedback-processing .record-track-bar i {
  background: #34a58e;
}

.feedback-replied {
  color: #166534;
}

.feedback-replied .record-track-bar {
  background: #dcfce7;
}

.feedback-replied .record-track-bar i {
  background: #22c55e;
}

.sample-sent .record-track-bar {
  background: #dbeafe;
}

.sample-sent .record-track-bar i {
  background: #3b82f6;
}

.sample-confirmed {
  color: var(--green);
}

.sample-confirmed .record-track-bar {
  background: #dcfce7;
}

.sample-confirmed .record-track-bar i {
  background: #22c55e;
}

.sample-revise {
  color: var(--amber);
}

.sample-revise .record-track-bar {
  background: #fef3c7;
}

.sample-revise .record-track-bar i {
  background: #f59e0b;
}

.sample-void {
  color: var(--red);
}

.sample-void .record-track-bar {
  background: #ffedd5;
}

.sample-void .record-track-bar i {
  background: #ef4444;
}

.quote-draft {
  color: #6b7280;
}

.quote-draft .record-track-bar {
  background: #f3f4f6;
}

.quote-draft .record-track-bar i {
  background: #9ca3af;
}

.quote-submitted {
  color: #0f5d56;
}

.quote-submitted .record-track-bar {
  background: #e2f3ee;
}

.quote-submitted .record-track-bar i {
  background: #34a58e;
}

.quote-sent {
  color: #1d4ed8;
}

.quote-sent .record-track-bar {
  background: #dbeafe;
}

.quote-sent .record-track-bar i {
  background: #3b82f6;
}

.quote-accepted {
  color: var(--green);
}

.quote-accepted .record-track-bar {
  background: #dcfce7;
}

.quote-accepted .record-track-bar i {
  background: #22c55e;
}

.quote-rejected,
.quote-void {
  color: var(--red);
}

.quote-rejected .record-track-bar,
.quote-void .record-track-bar {
  background: #ffedd5;
}

.quote-rejected .record-track-bar i,
.quote-void .record-track-bar i {
  background: #ef4444;
}

.order-confirmed {
  color: #1d4ed8;
}

.order-confirmed .record-track-bar {
  background: #dbeafe;
}

.order-confirmed .record-track-bar i {
  background: #3b82f6;
}

.order-partial {
  color: var(--amber);
}

.order-partial .record-track-bar {
  background: #fef3c7;
}

.order-partial .record-track-bar i {
  background: #f59e0b;
}

.order-completed {
  color: var(--green);
}

.order-completed .record-track-bar {
  background: #dcfce7;
}

.order-completed .record-track-bar i {
  background: #22c55e;
}

.order-cancelled {
  color: var(--red);
}

.order-cancelled .record-track-bar {
  background: #ffedd5;
}

.order-cancelled .record-track-bar i {
  background: #ef4444;
}

.quick-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.order-lines-builder {
  display: grid;
  gap: 12px;
}

.order-default-delivery {
  display: flex;
  gap: 14px;
  align-items: end;
  padding: 12px;
  border: 1px solid #cfe5dd;
  border-radius: 8px;
  background: #f0fbf7;
}

.order-default-delivery .field {
  min-width: 220px;
  margin: 0;
}

.order-default-delivery .sub {
  padding-bottom: 10px;
}

.order-lines-list {
  display: grid;
  gap: 12px;
}

.order-total-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #cfe5dd;
  border-radius: 8px;
  background: #f0fbf7;
}

.order-total-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-total-bar strong {
  color: var(--primary-strong);
  font-size: 20px;
}

.order-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sku-detail-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sku-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sku-detail-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sku-detail-main h5 {
  margin: 0;
  font-size: 16px;
}

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

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

.sku-metrics span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.sku-metrics strong {
  color: var(--ink);
  font-size: 16px;
}

.sku-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.sku-progress div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f0;
}

.sku-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #34a58e;
}

.sku-progress b {
  color: var(--primary-strong);
  font-size: 13px;
}

.order-line-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf8f3;
  display: grid;
  gap: 12px;
}

.order-line-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(120px, .7fr) auto;
  gap: 12px;
  align-items: end;
}

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

.size-choice {
  display: grid;
  grid-template-columns: minmax(86px, .8fr) minmax(90px, .6fr) minmax(90px, .6fr) minmax(130px, .8fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.size-choice.selected {
  border-color: #34a58e;
  background: #f0fbf7;
}

.size-choice > label:not(.size-choice-field) {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.size-choice-field {
  display: grid;
  gap: 4px;
}

.size-choice-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.size-choice-field input {
  width: 100%;
}

@media (max-width: 760px) {
  .order-default-delivery,
  .order-line-grid,
  .size-choice {
    grid-template-columns: 1fr;
    display: grid;
  }

  .order-default-delivery .field {
    min-width: 0;
  }

  .order-default-delivery .sub {
    padding-bottom: 0;
  }
}

.quick-status button {
  min-height: 30px;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: #f7faf5;
  color: #315047;
  padding: 4px 10px;
  cursor: pointer;
}

.quick-status button:hover {
  border-color: #b8d7ca;
  background: #e9f5ef;
  color: var(--primary);
}

.master-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
  align-items: start;
}

.master-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  align-self: start;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.master-card[open] {
  border-color: #b8d7ca;
  box-shadow: 0 14px 34px rgba(12, 42, 32, 0.12);
}

.master-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  cursor: pointer;
  list-style: none;
}

.master-card-head::-webkit-details-marker {
  display: none;
}

.master-card h3 {
  margin: 0;
  font-size: 18px;
}

.master-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.master-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.master-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.18s ease;
}

.master-card[open] .master-chevron {
  transform: rotate(180deg);
}

.master-card-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.master-add-btn {
  justify-self: start;
}

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

.master-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.master-item strong {
  display: block;
  font-size: 15px;
}

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

.master-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
}

.permission-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.permission-card-wide {
  grid-column: 1 / -1;
}

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

.permission-card h3 {
  margin: 0;
  font-size: 18px;
}

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

.permission-block {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

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

.role-matrix {
  display: grid;
  gap: 12px;
}

.role-row {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 2.2fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.role-row strong {
  display: block;
  font-size: 16px;
}

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

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

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

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

th {
  position: sticky;
  top: 0;
  background: #f5f9fb;
  color: #475a6e;
  font-weight: 700;
}

td .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.user-table-wrap {
  width: 100%;
}

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

.user-table th,
.user-table td {
  vertical-align: middle;
  white-space: nowrap;
  padding: 11px 12px;
}

.user-table td:first-child strong {
  font-size: 15px;
}

.order-table {
  min-width: 1180px;
}

.order-row {
  cursor: pointer;
}

.order-row:hover {
  background: #f7faf5;
}

.order-row-danger {
  background: #fff7ed;
}

.order-row-warning {
  background: #fffbeb;
}

.order-row-done {
  background: #f0fdf4;
}

.order-row-cancelled {
  opacity: .72;
}

.table-progress {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.table-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.table-progress-head span {
  font-weight: 800;
  color: var(--primary-strong);
}

.table-progress-head b {
  color: var(--muted);
  font-weight: 700;
}

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

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

.mini-bar.empty i {
  display: none;
}

.mini-bar.partial i {
  background: #0f8b72;
}

.mini-bar.done i {
  background: var(--green);
}

.mini-bar.payment i {
  background: var(--blue);
}

.payment-order-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.payment-order-head strong {
  color: var(--ink);
  font-size: 20px;
}

.payment-order-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.payment-summary-grid,
.payment-after-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payment-summary-card,
.payment-after-grid > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf7;
}

.payment-summary-card span,
.payment-after-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-summary-card strong,
.payment-after-grid strong {
  color: var(--ink);
  font-size: 18px;
}

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

.zero-progress-line {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e8f0ec;
}

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

.text-ok {
  color: var(--green);
}

body[data-active-module="users"] .record-grid {
  display: block;
  width: 100%;
}

body[data-active-module="users"] .table-wrap {
  width: 100%;
}

body[data-active-module="orders"] .record-grid {
  display: block;
  width: 100%;
}

body[data-active-module="orders"] .table-wrap {
  width: 100%;
}

body[data-active-module="styles"] .record-grid,
body[data-active-module="samples"] .record-grid,
body[data-active-module="sampleDev"] .record-grid,
body[data-active-module="sampleKanban"] .record-grid,
body[data-active-module="activityLogs"] .record-grid,
body[data-active-module="devCosts"] .record-grid {
  display: block;
  width: 100%;
}

body[data-active-module="styles"] .table-wrap,
body[data-active-module="samples"] .table-wrap,
body[data-active-module="sampleDev"] .table-wrap,
body[data-active-module="activityLogs"] .table-wrap,
body[data-active-module="devCosts"] .table-wrap {
  width: 100%;
}

.business-table {
  min-width: 1060px;
}

.business-table th,
.business-table td {
  vertical-align: middle;
  padding: 12px;
}

.business-table th {
  white-space: nowrap;
}

.business-table td:first-child strong {
  font-size: 15px;
}

.styles-table {
  min-width: 1120px;
  table-layout: fixed;
}

.styles-table th,
.styles-table td {
  padding: 12px 14px;
}

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

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

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

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

.styles-table th:nth-child(5),
.styles-table td:nth-child(5) {
  width: 8%;
}

.styles-table th:nth-child(6),
.styles-table td:nth-child(6) {
  width: 8%;
}

.styles-table th:nth-child(7),
.styles-table td:nth-child(7) {
  width: 10%;
}

.style-record-row {
  transition: background .16s ease;
}

.style-record-row:hover {
  background: #fbfdfb;
}

.style-name-cell,
.style-project-cell {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.style-name-cell strong,
.style-project-cell strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.style-name-cell span,
.style-project-cell span,
.style-date-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.style-spec-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.style-spec-cell span {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: #f3f8f5;
  color: #315047;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 10px;
}

.style-file-cell {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.style-file-cell .file-chip {
  max-width: 150px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.style-file-cell .badge {
  min-height: 30px;
  align-items: center;
}

.style-status-cell {
  display: flex;
  align-items: center;
}

.styles-table .table-actions {
  flex-wrap: nowrap;
  gap: 10px;
  white-space: nowrap;
}

.styles-table .table-actions .quick-status {
  flex-wrap: nowrap;
}

.styles-table .table-actions .quick-status button {
  min-height: 30px;
  white-space: nowrap;
}

.samples-table {
  min-width: 1280px;
}

.activity-logs-table {
  min-width: 1180px;
}

.activity-logs-table th:nth-child(1),
.activity-logs-table td:nth-child(1) {
  width: 160px;
  white-space: nowrap;
}

.activity-logs-table th:nth-child(2),
.activity-logs-table td:nth-child(2) {
  width: 150px;
}

.activity-logs-table th:nth-child(3),
.activity-logs-table td:nth-child(3),
.activity-logs-table th:nth-child(4),
.activity-logs-table td:nth-child(4),
.activity-logs-table th:nth-child(5),
.activity-logs-table td:nth-child(5) {
  width: 110px;
  white-space: nowrap;
}

.activity-logs-table th:nth-child(6),
.activity-logs-table td:nth-child(6) {
  min-width: 460px;
}

.samples-table th:nth-child(1),
.samples-table td:nth-child(1) {
  width: 170px;
}

.samples-table th:nth-child(2),
.samples-table td:nth-child(2) {
  width: 200px;
}

.samples-table th:nth-child(3),
.samples-table td:nth-child(3),
.samples-table th:nth-child(5),
.samples-table td:nth-child(5),
.samples-table th:nth-child(7),
.samples-table td:nth-child(7),
.samples-table th:nth-child(8),
.samples-table td:nth-child(8) {
  white-space: nowrap;
}

.samples-table th:nth-child(3),
.samples-table td:nth-child(3) {
  width: 96px;
}

.samples-table th:nth-child(4),
.samples-table td:nth-child(4) {
  width: 96px;
}

.samples-table th:nth-child(5),
.samples-table td:nth-child(5) {
  width: 96px;
}

.samples-table th:nth-child(6),
.samples-table td:nth-child(6) {
  width: 82px;
}

.samples-table th:nth-child(7),
.samples-table td:nth-child(7) {
  width: 118px;
}

.samples-table th:nth-child(8),
.samples-table td:nth-child(8) {
  width: 118px;
}

.samples-table th:nth-child(9),
.samples-table td:nth-child(9) {
  width: 148px;
}

.samples-table th:nth-child(10),
.samples-table td:nth-child(10) {
  width: 250px;
}

.samples-table td {
  height: 76px;
}

.samples-table .table-actions {
  min-width: 228px;
  max-width: 250px;
}

.samples-table .table-actions > .text-btn {
  white-space: nowrap;
  line-height: 1.4;
}

.samples-table .table-actions .quick-status {
  flex-basis: 100%;
}

.samples-table .table-actions .quick-status button {
  white-space: nowrap;
  min-width: 0;
}

.table-wrap-text {
  max-width: 220px;
  white-space: normal;
  line-height: 1.5;
}

.table-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.samples-table .table-file-list {
  max-width: 126px;
  flex-wrap: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-actions .quick-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 0;
}

.table-actions .quick-status button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}

.sample-kanban-entry {
  width: 100%;
}

.sample-kanban-entry .panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.kanban-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}

.kanban-entry-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kanban-entry-card.dark {
  background: #10231f;
  color: #eef8f4;
}

.kanban-entry-card strong {
  font-size: 20px;
  line-height: 1.35;
}

.kanban-entry-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.kanban-entry-card.dark p {
  color: #bfd4cd;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 37, 50, .52);
  z-index: 20;
}

.modal.modal-on-top {
  z-index: 50;
}

.modal-panel {
  width: min(960px, 100%);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.modal-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-panel {
  width: min(1180px, 100%);
  height: min(820px, 92vh);
  grid-template-rows: auto minmax(0, 1fr);
}

.detail-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overscroll-behavior: contain;
}

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

.detail-summary-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.detail-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-summary-item strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
}

.link-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: visible;
}

.link-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7faf5;
}

.link-section-head h4 {
  margin: 0;
  font-size: 16px;
}

.link-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
}

.link-item {
  display: grid;
  width: 100%;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.link-item.clickable {
  cursor: pointer;
}

.link-item.clickable:hover {
  border-color: #b8d7ca;
  background: #f7faf5;
}

.link-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.link-item strong {
  font-size: 15px;
}

.readonly-content {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.field {
  display: grid;
  gap: 6px;
}

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

.field label {
  color: #405469;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: 0;
}

.multi-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.check-pill input {
  width: auto;
  min-width: auto;
  padding: 0;
}

.relation-search-field {
  position: relative;
}

.relation-search-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 59, 47, .16);
}

.relation-search-menu button {
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.relation-search-menu button:hover {
  border-color: #aadbc9;
  background: #eefaf5;
}

.relation-search-menu strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-search-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.file-upload-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #bfd1ca;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdfc, #f4f9f6);
}

.paste-upload-zone {
  outline: 0;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.paste-upload-zone:focus,
.paste-upload-zone:focus-within {
  border-color: #7cc9af;
  background: #f3fbf7;
  box-shadow: 0 0 0 3px rgba(17, 116, 95, .1);
}

.paste-upload-zone.uploading {
  border-style: dashed;
  border-color: var(--primary);
  background: #eefaf5;
}

.paste-upload-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.file-upload-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #dce5df;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(18, 46, 36, .06);
}

.file-upload-trigger:hover {
  border-color: #a8cbbd;
  background: #f8fcfa;
}

.file-upload-trigger input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-upload-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: #e4f4ed;
  color: var(--primary);
  font-size: 16px;
  line-height: 1;
}

.file-upload-row a,
.file-upload-row span {
  color: var(--muted);
  font-size: 13px;
}

.file-upload-row a {
  color: var(--primary-strong);
  font-weight: 700;
}

.file-upload-column {
  gap: 10px;
}

.file-chip-list,
.followup-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.file-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 0;
  border-radius: 9px;
  background: #f3f5f4;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(12, 27, 22, .03);
}

.file-chip-wrap {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
}

.file-remove-btn {
  width: 28px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: #f0f2f1;
  color: #697a74;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.file-chip:hover {
  background: #e9f1ee;
}

.file-remove-btn:hover {
  background: #fee2e2;
  color: #b42318;
}

.file-chip span {
  color: inherit;
  font-size: inherit;
}

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

.file-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #6b7a76;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.file-icon.excel {
  background: #16834a;
}

.file-icon.word {
  background: #1f64c8;
}

.file-icon.pdf {
  background: #d1433f;
}

.file-icon.image {
  background: #7c5cc4;
}

.file-more-btn {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
}

.sample-file-empty {
  color: var(--muted);
}

.sample-file-dropdown-btn {
  display: inline-flex;
  align-items: center;
  max-width: 126px;
  min-height: 32px;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid #e1ebe6;
  border-radius: 8px;
  background: #f6faf8;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(8, 41, 31, 0.04);
}

.sample-file-dropdown-btn:hover {
  border-color: rgba(16, 128, 96, 0.28);
  background: #eef8f3;
}

.sample-file-dropdown-btn .file-icon {
  flex: 0 0 auto;
}

.sample-file-dropdown-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-file-dropdown-btn b {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #2c64c8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.sample-file-popover {
  position: fixed;
  z-index: 35;
  width: min(320px, calc(100vw - 24px));
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.sample-file-popover-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sample-file-popover-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sample-file-group {
  display: grid;
  gap: 6px;
}

.sample-file-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-preview-panel {
  width: min(1080px, 96vw);
  height: min(820px, 92vh);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.file-preview-body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
  background: #f6faf8;
}

.file-preview-body iframe {
  width: 100%;
  height: 100%;
  min-height: 620px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.file-preview-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.file-preview-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 520px;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.file-preview-fallback strong {
  font-size: 22px;
}

.file-preview-fallback p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.readonly-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 10px 11px;
}

.user-role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.role-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.role-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.role-check span {
  line-height: 1.2;
  white-space: nowrap;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #102532;
  color: #fff;
  box-shadow: var(--shadow);
}

.ai-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 18;
  display: none;
}

.ai-toggle {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.ai-toggle span {
  display: grid;
  place-items: center;
}

.ai-panel {
  width: min(390px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ai-assistant.collapsed .ai-panel {
  display: none;
}

.ai-assistant:not(.collapsed) .ai-toggle {
  display: none;
}

.ai-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: #eef7f2;
}

.ai-head strong,
.ai-head span {
  display: block;
}

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

.ai-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px;
  overflow: auto;
  background: #f7faf5;
}

.ai-message {
  display: grid;
  gap: 4px;
  max-width: 86%;
}

.ai-message.user {
  justify-self: end;
}

.ai-message span {
  color: var(--muted);
  font-size: 11px;
}

.ai-message p {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-message.user p {
  border-color: #bdd9cc;
  background: #dff0e8;
}

.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.ai-form textarea {
  min-height: 44px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  font: inherit;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.link-list .empty {
  padding: 12px;
}

.hidden {
  display: none !important;
}

.mobile-tab-bar {
  display: none;
}

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

  .side-nav {
    position: static;
    height: auto;
    max-height: 44vh;
    z-index: 10;
  }

  .module-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-card {
    display: none;
  }

	  .dashboard-grid,
	  .dashboard-grid.three,
	  .metric-grid,
	  .metric-grid.kpi-metrics,
	  .customer-detail-kpi,
	  .record-grid {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .top-actions {
    display: grid;
    justify-content: stretch;
  }

  .search-box {
    min-width: 0;
  }

  .user-switch {
    width: 100%;
  }

	  .module-nav,
	  .dashboard-grid,
	  .dashboard-grid.three,
	  .metric-grid,
	  .metric-grid.kpi-metrics,
	  .record-grid,
	  .master-grid,
	  .permission-grid,
	  .customer-money-row,
	  .customer-stat-grid,
	  .customer-detail-kpi,
	  .record-form {
	    grid-template-columns: 1fr;
	  }

	  .kpi-hero,
	  .kpi-bar-row,
	  .ranking-item {
	    grid-template-columns: 1fr;
	  }

	  .kpi-hero {
	    display: grid;
	  }

	  .kpi-bar-row b {
	    text-align: left;
	  }

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

  .role-row {
    grid-template-columns: 1fr;
  }

  .notice-band {
    grid-template-columns: 1fr;
  }

  .nav-btn {
    padding: 10px;
  }

  .modal {
    padding: 0;
    align-items: stretch;
  }

  .modal-panel {
    max-height: 100vh;
    border-radius: 0;
  }

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

@media (max-width: 860px) {
  :root {
    --bg: #07110f;
    --panel: #0d1b17;
    --panel-soft: #132822;
    --text: #f4f8f6;
    --muted: #9cafaa;
    --line: rgba(255, 255, 255, .09);
    --primary: #18a77a;
    --primary-strong: #37d399;
    --sidebar: #081411;
    --sidebar-soft: rgba(255, 255, 255, .08);
    --shadow: 0 18px 42px rgba(0, 0, 0, .34);
  }

  body {
    overflow-x: hidden;
    background:
      radial-gradient(circle at 12% -8%, rgba(24, 167, 122, .24), transparent 32%),
      linear-gradient(180deg, #07110f 0%, #081713 46%, #06100e 100%);
  }

  .app-shell {
    display: block;
  }

  .side-nav {
    position: sticky;
    top: 0;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 12px;
    z-index: 16;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    background: rgba(8, 20, 17, .92);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
    backdrop-filter: blur(14px);
  }

  .brand {
    margin: 0;
  }

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

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

  .brand p {
    margin-top: 2px;
    font-size: 12px;
  }

  .module-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: 0 0 auto;
    min-width: 96px;
    padding: 9px 11px;
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    text-align: center;
    white-space: nowrap;
  }

  .nav-btn.active {
    border-color: rgba(55, 211, 153, .42);
    background: rgba(24, 167, 122, .18);
    color: #eafff6;
  }

  .nav-icon {
    width: auto;
    margin-right: 5px;
  }

  .workspace {
    padding: 14px 12px 104px;
  }

  .topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
  }

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

  .eyebrow {
    color: #6ee7b7;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .search-box {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .top-actions .btn {
    width: 100%;
    padding: 0 10px;
  }

  #createBtn {
    grid-column: 1 / -1;
    position: fixed;
    right: 16px;
    bottom: 86px;
    z-index: 17;
    width: 58px;
    height: 58px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    border-color: rgba(55, 211, 153, .58);
    background: linear-gradient(135deg, #18a77a, #0f766e);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .42);
    font-size: 0;
  }

  #createBtn::before {
    content: "+";
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
  }

  .mobile-tab-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 19;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 22px;
    background: rgba(9, 23, 19, .92);
    box-shadow: 0 20px 46px rgba(0, 0, 0, .46);
    backdrop-filter: blur(16px);
  }

  .mobile-tab-btn {
    display: grid;
    place-items: center;
    gap: 3px;
    min-width: 0;
    height: 50px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #8aa19b;
    cursor: pointer;
  }

  .mobile-tab-btn span {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-tab-btn b {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab-btn.active {
    background: rgba(24, 167, 122, .2);
    color: #dcfff2;
  }

  .notice-band,
  .dashboard-grid,
  .dashboard-grid.three,
  .metric-grid,
  .metric-grid.kpi-metrics,
  .record-grid,
  .master-grid,
  .permission-grid,
  .customer-money-row,
  .customer-stat-grid,
  .customer-detail-kpi,
  .record-form {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .filter-bar select,
  .order-sort-group,
  .order-search-group,
  .quick-filter-group,
  .quick-filter {
    width: 100%;
    min-width: 0;
  }

  .order-search-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .order-sort-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .order-sort-group select:first-child,
  .order-sort-group select:last-child {
    min-width: 0;
  }

  .quick-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-right: 0;
  }

  .record-card {
    min-height: 0;
    padding: 14px;
  }

  .panel,
  .metric,
  .record-card,
  .master-card,
  .permission-card,
  .link-section,
  .detail-summary-item,
  .customer-money-row > div,
  .customer-stat-grid > div,
  .customer-detail-kpi > div,
  .status-item,
  .recent-item,
  .flow-item,
  .pipeline-step,
  .ranking-item,
  .file-upload-row,
  .role-check {
    border-color: rgba(255, 255, 255, .09);
    background: rgba(13, 27, 23, .92);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
  }

  .metric {
    border-radius: 18px;
  }

  .metric strong,
  .customer-money-row strong,
  .detail-summary-item strong {
    color: #eafff6;
  }

  .panel,
  .record-card,
  .master-card,
  .permission-card,
  .link-section {
    border-radius: 18px;
  }

  .notice-band {
    display: none;
  }

  .pipeline-step,
  .status-item,
  .recent-item,
  .flow-item,
  .link-item,
  .master-item {
    background: rgba(255, 255, 255, .045);
  }

  .panel-head,
  .link-section-head,
  th {
    background: rgba(255, 255, 255, .045);
  }

  .badge {
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .08);
    color: #d7e7e2;
  }

  .badge.green { background: rgba(55, 211, 153, .17); color: #7cf1bb; }
  .badge.blue { background: rgba(59, 130, 246, .18); color: #9cc4ff; }
  .badge.amber { background: rgba(251, 191, 36, .18); color: #ffd978; }
  .badge.red { background: rgba(239, 68, 68, .18); color: #ff9a9a; }

  .search-box,
  .filter-bar select,
  .field input,
  .field select,
  .field textarea,
  .readonly-field,
  .multi-check-list {
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
  }

  .field input::placeholder,
  .field textarea::placeholder,
  .search-box input::placeholder {
    color: #687b75;
  }

  .btn.secondary,
  .icon-btn {
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
  }

  .quick-status {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .quick-status button {
    flex: 0 0 auto;
  }

  .table-wrap {
    width: 100%;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table,
  .user-table {
    min-width: 760px;
  }

  .table-wrap {
    border-color: rgba(255, 255, 255, .09);
    background: rgba(13, 27, 23, .9);
  }

  th,
  td {
    padding: 11px 10px;
    font-size: 13px;
  }

  .modal {
    align-items: end;
    place-items: end stretch;
    padding: 0;
  }

  .modal-panel,
  .detail-panel,
  .file-preview-panel {
    width: 100%;
    height: min(92vh, 100dvh);
    max-height: 100dvh;
    border-radius: 14px 14px 0 0;
    border: 1px solid rgba(255, 255, 255, .1);
    background: #081411;
  }

  .modal-head,
  .modal-actions {
    padding: 12px;
  }

  .modal-head h3 {
    font-size: 18px;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: rgba(8, 20, 17, .96);
  }

  .modal-actions .btn {
    flex: 1;
  }

  .record-form {
    gap: 12px;
    padding: 12px;
  }

  .field input,
  .field select,
  .field textarea,
  .readonly-field {
    min-height: 44px;
    font-size: 16px;
  }

  .kpi-filter-bar,
  .kpi-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-filter-actions .quick-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-filter-actions label,
  .kpi-filter-actions input,
  .kpi-filter-actions .btn {
    width: 100%;
    max-width: none;
  }

  .payment-summary-grid,
  .payment-after-grid {
    grid-template-columns: 1fr;
  }

  .link-section-head,
  .link-item-top,
  .master-card-head,
  .permission-card-head {
    align-items: flex-start;
  }

  .link-section-actions,
  .master-summary-meta,
  .permission-actions,
  .master-actions {
    flex-wrap: wrap;
  }

  .master-list {
    max-height: 56vh;
  }

  .master-item {
    align-items: flex-start;
  }

  .file-upload-row input {
    max-width: 100%;
  }

  .file-upload-row {
    border-color: rgba(255, 255, 255, .13);
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .045));
  }

  .file-upload-trigger {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    box-shadow: none;
  }

  .file-upload-icon {
    background: rgba(55, 211, 153, .14);
    color: #6ee7b7;
  }

  .file-chip {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
  }

  .file-chip:hover {
    background: rgba(55, 211, 153, .13);
  }

  .file-remove-btn {
    background: rgba(255, 255, 255, .08);
    color: #9cafaa;
  }

  .paste-upload-zone:focus,
  .paste-upload-zone:focus-within {
    border-color: rgba(55, 211, 153, .46);
    background: rgba(24, 167, 122, .1);
    box-shadow: 0 0 0 3px rgba(55, 211, 153, .1);
  }

  .paste-upload-zone.uploading {
    border-color: #37d399;
    background: rgba(24, 167, 122, .14);
  }

  .ai-assistant {
    right: 14px;
    bottom: 14px;
  }

  .ai-toggle {
    width: 54px;
    height: 54px;
  }

  .ai-assistant:not(.collapsed) {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .ai-panel {
    width: 100%;
    height: min(70vh, 560px);
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
  }

  .mobile-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(55, 211, 153, .2);
    border-radius: 22px;
    background:
      radial-gradient(circle at top right, rgba(55, 211, 153, .18), transparent 36%),
      linear-gradient(145deg, rgba(24, 167, 122, .16), rgba(13, 27, 23, .96));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
  }

  .mobile-detail-hero strong {
    display: block;
    margin-top: 5px;
    color: #f4fff9;
    font-size: 22px;
    line-height: 1.25;
  }

  .mobile-detail-hero p {
    margin: 7px 0 0;
    color: #9cafaa;
    line-height: 1.55;
  }

  .mobile-detail-kicker {
    color: #6ee7b7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-timeline {
    position: relative;
  }

  .mobile-timeline .status-item {
    position: relative;
    margin-left: 14px;
  }

  .mobile-timeline .status-item::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #37d399;
    box-shadow: 0 0 0 4px rgba(55, 211, 153, .14);
  }
}

@media (max-width: 480px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

  .quick-filter-group {
    grid-template-columns: 1fr;
  }

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

  .modal-panel,
  .detail-panel,
  .file-preview-panel {
    height: 100dvh;
    border-radius: 0;
  }

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