:root {
  --bg: #faf3f6;
  --surface: #ffffff;
  --surface-2: #fdf7f9;
  --ink: #1d2733;
  --ink-2: #465466;
  --muted: #748094;
  --border: #f0dce5;
  --border-2: #d9b4c4;
  --primary: #c2255c;
  --primary-strong: #9d174d;
  --primary-soft: #fde7ef;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --rose: #c2255c;
  --rose-soft: #fbe3ec;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --radius: 8px;
  --sidebar-w: 236px;
  --topbar-h: 60px;
  --bottom-h: 62px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(194, 37, 92, 0.14), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(157, 23, 77, 0.12), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px;
}

.login-card > .field + .field {
  margin-top: 12px;
}

.login-card > .btn-block {
  margin-top: 18px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.login-brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin: 10px 0 0;
}

/* ---------- App shell ---------- */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #2c0a1c;
  color: #f2d8e2;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
  background: #e0457e;
}

.sidebar-brand strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.sidebar-brand span {
  display: block;
  color: #d9a3b7;
  font-size: 11px;
  margin-top: 2px;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-group {
  margin-bottom: 16px;
}

.nav-group-label {
  display: block;
  font-size: 11px;
  color: #b98a9d;
  padding: 2px 10px 6px;
  letter-spacing: 0.06em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #ecd0da;
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 13px;
  text-align: left;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  background: #e0457e;
  color: #fff;
}

.side-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #ecd0da;
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 13px;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.main-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.page-title {
  flex: 1;
  min-width: 0;
}

.page-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.page-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.content {
  flex: 1;
  padding: 16px 16px calc(var(--bottom-h) + 20px);
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
}

.bn-item {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  padding: 6px 0;
}

.bn-item.active {
  color: var(--primary-strong);
}

.bn-item.active svg {
  color: var(--primary);
}

/* ---------- Common components ---------- */

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#sr-content,
#rg-content,
#ca-content,
#iq-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

.card-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

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

.stat-card .stat-icon {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.teal {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.stat-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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

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

.btn-ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

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

.btn-danger:hover {
  background: #fecaca;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span,
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 37, 92, 0.14);
}

.input-wrap input {
  padding-left: 34px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input[type="date"],
input[type="month"] {
  min-height: 38px;
}

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

.form-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: -2px;
}

.form-note {
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  padding: 10px 12px;
  color: var(--ink-2);
  font-size: 13px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--surface);
}

.switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.switch-row span {
  font-size: 13px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.teal {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.gray {
  background: #eef1f5;
  color: var(--ink-2);
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 100%;
}

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

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

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfdfc;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.muted {
  color: var(--muted);
}

.strong {
  font-weight: 700;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

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

.empty-state svg {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  display: block;
  opacity: 0.5;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.pager-btns {
  display: flex;
  gap: 6px;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tab.active {
  color: var(--primary-strong);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  background: var(--surface);
  margin-bottom: -1px;
}

.chart-box {
  position: relative;
  min-height: 260px;
}

.chart-box canvas {
  max-height: 340px;
}

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

.split-grid > * {
  min-width: 0;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}

.detail-row .detail-main {
  min-width: 0;
}

.detail-row .detail-main strong {
  display: block;
  font-size: 13px;
}

.detail-row .detail-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.detail-row .detail-side {
  text-align: right;
  flex: none;
}

.item-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
  position: relative;
}

.item-line-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: var(--red-soft);
  color: var(--red);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.series-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.series-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.series-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.product-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}

.product-chip {
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 9px;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.product-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.product-chip strong {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-chip small {
  color: var(--muted);
}

.phone-check {
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.phone-check.ok {
  background: var(--green-soft);
  border-color: #86efac;
  color: var(--green);
}

.phone-check.warn {
  background: var(--amber-soft);
  border-color: #fcd34d;
  color: var(--amber);
}

.phone-check.error {
  background: var(--red-soft);
  border-color: #fca5a5;
  color: var(--red);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

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

.customer-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

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

.summary-side {
  text-align: right;
  flex: none;
}

.summary-label {
  font-size: 11px;
  color: var(--muted);
}

.summary-name {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.summary-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-strong);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.summary-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.modal-section {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

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

.table-wrap.compact th,
.table-wrap.compact td {
  padding: 7px 10px;
}

.order-switch-row {
  cursor: pointer;
}

.order-switch-row:hover {
  background: var(--surface-2);
}

tr.current-order,
tr.current-order:hover {
  background: var(--primary-soft);
}

.modal .table-wrap {
  overflow-x: hidden;
}

.modal .table-wrap table {
  min-width: 0;
  width: 100%;
}

.modal .table-wrap th,
.modal .table-wrap td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.toast-root {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.18s ease;
}

.toast.error {
  background: var(--red);
}

.toast.success {
  background: var(--green);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  padding: 40px 0;
  font-size: 13px;
}

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

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

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

.progress-mini {
  height: 6px;
  border-radius: 999px;
  background: #e8edf2;
  overflow: hidden;
  margin-top: 8px;
}

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

.list-simple {
  display: flex;
  flex-direction: column;
}

.list-simple .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border);
}

.list-simple .row:last-child {
  border-bottom: 0;
}

.list-simple .row span {
  color: var(--ink-2);
  font-size: 13px;
}

.list-simple .row strong {
  font-variant-numeric: tabular-nums;
}

.segments {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
}

.range-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.range-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.range-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.range-inputs input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#sr-start,
#sr-end,
#rg-start,
#rg-end,
#cq-start,
#cq-end,
#sq-start,
#sq-end {
  width: 100%;
  max-width: 170px;
}

.segment-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.segment-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.file-drop {
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.file-drop svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.code-block {
  background: #0f1c1a;
  color: #c9e5df;
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
  margin: 0;
}

.code-block code {
  color: #f2c66d;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .range-row {
    grid-template-columns: 120px minmax(0, 1fr) auto;
  }

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

  .split-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  .item-line {
    grid-template-columns: 1fr 1fr 100px 110px 110px 32px;
    align-items: end;
  }

  .item-line-remove {
    position: static;
    margin-bottom: 2px;
  }

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

@media (min-width: 1024px) {
  .sidebar {
    transform: none;
    box-shadow: none;
  }

  .main-wrap {
    margin-left: var(--sidebar-w);
  }

  #menu-btn,
  .sidebar-overlay,
  .bottom-nav {
    display: none;
  }

  .content {
    padding: 22px 24px 32px;
  }

  .topbar {
    padding: 0 24px;
  }
}

@media (max-width: 720px) {
  .segments {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .segment-btn {
    min-width: 58px;
    text-align: center;
  }

  .range-inputs {
    grid-template-columns: 1fr;
  }

  .range-inputs input {
    min-width: 0;
  }

  .table-sales table,
  .table-dash-sales table,
  .table-month table,
  .table-customer table,
  .table-product table,
  .table-customer-mini table,
  .table-region table,
  .table-series-manage table {
    min-width: 0;
    width: 100%;
  }

  .table-sales th:nth-child(2),
  .table-sales td:nth-child(2),
  .table-sales th:nth-child(5),
  .table-sales td:nth-child(5),
  .table-sales th:nth-child(6),
  .table-sales td:nth-child(6),
  .table-sales th:nth-child(7),
  .table-sales td:nth-child(7),
  .table-sales th:nth-child(9),
  .table-sales td:nth-child(9) {
    display: none;
  }

  .table-dash-sales th:nth-child(3),
  .table-dash-sales td:nth-child(3),
  .table-dash-sales th:nth-child(5),
  .table-dash-sales td:nth-child(5) {
    display: none;
  }

  .table-month th:nth-child(3),
  .table-month td:nth-child(3),
  .table-month th:nth-child(4),
  .table-month td:nth-child(4),
  .table-month th:nth-child(6),
  .table-month td:nth-child(6),
  .table-month th:nth-child(8),
  .table-month td:nth-child(8) {
    display: none;
  }

  .table-customer th:nth-child(3),
  .table-customer td:nth-child(3),
  .table-customer th:nth-child(6),
  .table-customer td:nth-child(6),
  .table-customer th:nth-child(7),
  .table-customer td:nth-child(7) {
    display: none;
  }

  .table-product th:nth-child(3),
  .table-product td:nth-child(3),
  .table-product th:nth-child(5),
  .table-product td:nth-child(5) {
    display: none;
  }

  .table-customer-mini th:nth-child(2),
  .table-customer-mini td:nth-child(2),
  .table-customer-mini th:nth-child(3),
  .table-customer-mini td:nth-child(3) {
    display: none;
  }

  .table-region th:nth-child(5),
  .table-region td:nth-child(5),
  .table-region th:nth-child(6),
  .table-region td:nth-child(6) {
    display: none;
  }

  .table-series-manage th:nth-child(3),
  .table-series-manage td:nth-child(3) {
    display: none;
  }
}

html,
body {
  overflow-x: hidden;
}

@media (max-width: 420px) {
  .stat-grid,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 12px;
  }

  .topbar {
    padding: 0 10px;
  }

  .page-title h2 {
    font-size: 15px;
  }

  .login-card {
    padding: 22px 18px;
  }

  .range-inputs {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    width: 100%;
  }

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

  .modal {
    padding: 14px;
  }

  .customer-summary {
    flex-direction: column;
  }

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