@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --sg-blue: #2563eb;
  --sg-ink: #0f172a;
  --sg-muted: #64748b;
  --sg-border: #e2e8f0;
  --sg-surface: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  color: var(--sg-ink);
  background: #f8fafc;
  line-height: 1.4;
  min-width: 920px;
}

.sg-app { min-height: 100vh; }
.sg-main { min-width: 0; }
.sg-content { padding: 18px 22px 22px; }

.sg-page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  color: var(--sg-ink);
}

.sg-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.sg-stat {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
}

.sg-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sg-muted);
  margin-bottom: 6px;
}

.sg-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sg-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: #f1f5f9;
}

.sg-stat-icon.blue { color: #2563eb; }
.sg-stat-icon.red { color: #dc2626; }
.sg-stat-icon.amber { color: #d97706; }
.sg-stat-icon--box { color: #2563eb; background: #eff6ff; }
.sg-stat-icon--red { color: #dc2626; background: #fef2f2; }
.sg-stat-icon--amber { color: #d97706; background: #fffbeb; }

.sg-text-red { color: #dc2626; }
.sg-text-amber { color: #d97706; }

.sg-head-actions { display: flex; gap: 8px; flex-shrink: 0; }

.sg-btn-outline {
  border-color: #93c5fd;
  color: #2563eb;
  background: #fff;
}

.sg-btn-icon {
  min-width: 34px;
  padding: 7px 10px;
}

.sg-search--icon {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 10px center no-repeat;
  padding-left: 32px;
}

.sg-badge--gray { background: #f1f5f9; color: #64748b; }

.sg-card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 16px 18px;
}

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

.sg-card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sg-card-sub {
  font-size: 10px;
  color: var(--sg-muted);
  margin-top: 3px;
}

.sg-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--sg-border);
  background: #fff;
  color: #334155;
}

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

.sg-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sg-search {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  font-size: 10px;
  color: #94a3b8;
  background: #fff;
}

.sg-select {
  padding: 8px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  font-size: 10px;
  color: #475569;
  background: #fff;
}

.sg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.sg-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--sg-muted);
  border-bottom: 1px solid var(--sg-border);
  background: #f8fafc;
}

.sg-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.sg-table tbody tr:hover {
  background: #f8fafc;
}

.sg-product-cell { display: flex; align-items: center; gap: 10px; }

.sg-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  background: #e2e8f0;
  object-fit: cover;
  display: block;
}

.sg-product-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sg-product-hero-media {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--sg-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sg-product-hero-media img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.sg-product-name { font-weight: 600; color: var(--sg-ink); }
.sg-product-sku { font-size: 9px; color: #94a3b8; }

.sg-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
}

.sg-badge.green { background: #ecfdf5; color: #059669; }
.sg-badge.red { background: #fef2f2; color: #dc2626; }
.sg-badge.amber { background: #fffbeb; color: #d97706; }

.sg-stock-ok { color: #059669; font-weight: 600; }
.sg-stock-low { color: #d97706; font-weight: 600; }
.sg-stock-out { color: #dc2626; font-weight: 600; }

.sg-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  font-size: 10px;
  color: var(--sg-muted);
}

.sg-pages { display: flex; gap: 4px; }

.sg-page {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  background: #fff;
  font-size: 10px;
  font-weight: 500;
  display: grid;
  place-items: center;
  color: #475569;
}

.sg-page.active {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
  color: #fff;
}

.sg-edit-layout { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
.sg-edit-layout--product { grid-template-columns: 1fr 240px; }
.sg-product-edit .sg-card { padding: 14px 16px; }
.sg-product-edit .sg-card-title { font-size: 13px; margin-bottom: 2px; }
.sg-product-edit .sg-card-sub { margin-bottom: 12px; line-height: 1.45; }

.sg-link-btn {
  border: 0;
  background: none;
  color: #059669;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
  padding: 0;
}

.sg-media-upload {
  border: 1px dashed var(--sg-border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fafafa;
}

.sg-media-upload img {
  border-radius: 8px;
  object-fit: contain;
}

.sg-media-upload-label {
  font-size: 9px;
  color: var(--sg-muted);
}

.sg-gst-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0 12px;
}

.sg-gst-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.sg-field-hint {
  display: block;
  font-size: 8px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.35;
}

.sg-input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.sg-input-prefix span {
  padding: 8px 10px;
  font-size: 10px;
  color: var(--sg-muted);
  border-right: 1px solid var(--sg-border);
  background: #f8fafc;
}

.sg-input-prefix input {
  border: 0;
  flex: 1;
  padding: 8px 11px;
  font-size: 10px;
  font-family: inherit;
  background: #fff;
}

.sg-pricing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 4px;
}

.sg-pricing-tab {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
  padding: 5px 8px;
  border: 1px solid var(--sg-border);
  border-radius: 4px;
  background: #f8fafc;
}

.sg-pricing-tab.active {
  background: #fff;
  color: var(--sg-ink);
  border-color: #cbd5e1;
}

.sg-pricing-tab-more {
  margin-left: auto;
  color: var(--sg-muted);
  font-size: 12px;
}
.sg-stack { display: flex; flex-direction: column; gap: 16px; }

.sg-mini-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.sg-mini-table th, .sg-mini-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; text-align: left; }
.sg-mini-table th { font-size: 8px; color: var(--sg-muted); font-weight: 700; letter-spacing: 0.04em; }

.sg-field { margin-bottom: 10px; }
.sg-field label {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--sg-muted);
  margin-bottom: 5px;
}

.sg-field input,
.sg-field select,
.sg-field textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  font-size: 10px;
  font-family: inherit;
  background: #fff;
}

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

.sg-muted-box {
  background: #f8fafc;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.sg-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 9px;
  color: var(--sg-muted);
  margin-top: 8px;
}

.sg-toggle-row { display: flex; justify-content: space-between; align-items: center; }

.sg-toggle {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--sg-blue);
  position: relative;
  flex-shrink: 0;
}

.sg-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.sg-seg {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 3px;
  margin: 10px 0;
}

.sg-seg span {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--sg-muted);
}

.sg-seg span.active {
  background: #fff;
  color: var(--sg-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.sg-delete { color: #dc2626; font-size: 10px; margin-top: 10px; font-weight: 500; }
.sg-stars { color: #f59e0b; letter-spacing: 1px; }

.sg-checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sg-checkout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sg-checkout-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sg-pill-on {
  background: #ecfdf5;
  color: #059669;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.sg-pill-off {
  background: #f1f5f9;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.sg-checkout-spark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.sg-checkout-tagline {
  width: 100%;
  font-size: 11px;
  color: var(--sg-muted);
  font-weight: 400;
  margin-left: 38px;
  margin-top: -6px;
}

.sg-checkout-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.sg-checkout-compare-col {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 16px;
}

.sg-checkout-compare-col--highlight {
  background: #fafbfc;
}

.sg-checkout-compare-arrow {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 18px;
  font-weight: 600;
}

.sg-compare-label {
  font-size: 12px;
  font-weight: 600;
  margin: 4px 0 12px;
  color: var(--sg-ink);
}

.sg-compare-stat {
  font-size: 9px;
  color: var(--sg-muted);
  margin-top: 10px;
}

.sg-form-skeleton {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sg-form-skeleton span {
  display: block;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
}

.sg-form-skeleton-btn {
  height: 14px !important;
  width: 40% !important;
  margin-top: 4px;
  background: #cbd5e1 !important;
}

.sg-fast-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 0;
}

.sg-fast-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
}

.sg-fast-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.sg-fast-step-line {
  flex: 1;
  height: 2px;
  background: #cbd5e1;
  margin: 0 8px;
  margin-bottom: 18px;
  min-width: 40px;
}

.sg-benefit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sg-benefit-chip {
  font-size: 9px;
  font-weight: 600;
  color: #475569;
  padding: 6px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  background: #fff;
}

.sg-info--blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #334155;
}

.sg-card--flat {
  margin-top: 0;
}

.sg-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}

.sg-flow-arrow {
  display: grid;
  place-items: center;
  color: var(--sg-muted);
  font-size: 22px;
  font-weight: 700;
}

.sg-metric-big {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--sg-ink);
}

.sg-trend { color: #059669; font-size: 10px; font-weight: 600; margin-top: 6px; }

.sg-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  margin: 12px 0 8px;
  overflow: hidden;
}

.sg-progress span {
  display: block;
  height: 100%;
  width: 64%;
  background: var(--sg-blue);
  border-radius: 999px;
}

.sg-steps { display: flex; justify-content: space-between; padding-top: 10px; gap: 8px; }
.sg-step { text-align: center; flex: 1; }

.sg-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  font-size: 17px;
}

.sg-step strong { display: block; font-size: 9px; letter-spacing: 0.05em; color: var(--sg-ink); }
.sg-step span { font-size: 9px; color: var(--sg-muted); }

.sg-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.sg-benefit {
  display: flex;
  gap: 10px;
  font-size: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
}

.sg-benefit-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f1f5f9;
}

.sg-info {
  background: #f8fafc;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 10px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.sg-info strong { display: block; margin-bottom: 5px; font-weight: 700; color: var(--sg-ink); }

/* CRM feature screens */
.sg-avatar { border-radius: 50%; object-fit: cover; }

.sg-source {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.sg-source--fb { background: #eff6ff; color: #2563eb; }
.sg-source--web { background: #f0fdf4; color: #059669; }
.sg-source--csv { background: #f8fafc; color: #64748b; }
.sg-source--ig { background: #fdf2f8; color: #db2777; }
.sg-source--wa { background: #ecfdf5; color: #059669; }

.sg-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sg-pipeline-col {
  background: #f8fafc;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 10px;
  min-height: 280px;
}

.sg-pipeline-head {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--sg-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.sg-pipeline-head span {
  background: #e2e8f0;
  color: #475569;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 8px;
}

.sg-pipeline-head--won { color: #059669; }
.sg-pipeline-head--won span { background: #d1fae5; color: #059669; }

.sg-pipeline-card {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.sg-pipeline-card--active {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.sg-pipeline-card--won {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.sg-pipeline-avatar {
  border-radius: 50%;
  margin-bottom: 6px;
  display: block;
}

.sg-pipeline-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--sg-ink);
  margin-bottom: 2px;
}

.sg-pipeline-meta {
  font-size: 9px;
  color: var(--sg-muted);
}

.sg-crm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.sg-crm-avatar-lg {
  border-radius: 50%;
  flex-shrink: 0;
}

.sg-crm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sg-crm-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 10px;
  color: #475569;
}

.sg-crm-row:last-child { border-bottom: 0; }

.sg-crm-amt {
  font-weight: 600;
  color: var(--sg-ink);
}

/* Operations & insights screens */
.sg-stock-bar {
  width: 80px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.sg-stock-bar span {
  display: block;
  height: 100%;
  background: var(--sg-blue);
  border-radius: 999px;
}

.sg-route-list { margin-bottom: 14px; }

.sg-route-stop {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 10px;
}

.sg-route-stop:last-child { border-bottom: 0; }

.sg-route-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.sg-route-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 24px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--sg-border);
}

.sg-route-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #93c5fd;
  border: 2px solid #2563eb;
  flex-shrink: 0;
}

.sg-route-dot--end { background: #2563eb; }

.sg-route-line {
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, #cbd5e1 0, #cbd5e1 4px, transparent 4px, transparent 8px);
  max-width: 80px;
}

/* Route optimization screen */
.sg-route-opt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sg-route-opt-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sg-route-opt-metric {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
}

.sg-route-opt-metric span {
  display: block;
  font-size: 7px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sg-route-opt-metric strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--sg-ink);
  margin-top: 2px;
}

.sg-route-opt-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 8px;
  align-items: stretch;
  min-height: 280px;
}

.sg-route-opt-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sg-route-list--compact .sg-route-stop {
  padding: 6px 0;
  font-size: 9px;
}

.sg-route-num--hub {
  background: #1e40af;
  color: #fff;
}

.sg-route-opt-dispatch {
  margin-top: 8px;
  width: 100%;
  font-size: 8px;
}

.sg-route-opt-map-card {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sg-route-opt-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 600;
  color: #475569;
}

.sg-route-opt-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: #059669;
  font-weight: 600;
}

.sg-route-opt-map {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.sg-route-svg {
  width: 100%;
  height: auto;
  flex: 1;
  display: block;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.sg-route-path {
  animation: sgRouteDash 2.5s linear infinite;
}

.sg-route-truck {
  animation: sgRouteTruck 4s ease-in-out infinite;
}

@keyframes sgRouteDash {
  to { stroke-dashoffset: -28; }
}

@keyframes sgRouteTruck {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-4px, -3px); }
}

.sg-route-opt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 7px;
  color: #64748b;
}

.sg-route-opt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sg-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  display: inline-block;
}

.sg-legend-dot--hub {
  background: #1e40af;
}

.sg-legend-line {
  width: 14px;
  height: 2px;
  background: #2563eb;
  display: inline-block;
  border-radius: 1px;
}

body.sg-frame .sg-ops-routes .sg-content--frame {
  min-height: 620px;
}

body.sg-frame .sg-ops-routes .sg-page-title {
  font-size: 13px;
}

.sg-campaign-list,
.sg-automation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-campaign-item,
.sg-automation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: #fff;
}

.sg-campaign-body { flex: 1; min-width: 0; }

.sg-automation-flow {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 9px;
}

.sg-auto-node {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

.sg-auto-node--done {
  background: #ecfdf5;
  color: #059669;
}

.sg-auto-arrow { color: #94a3b8; font-weight: 700; }

.sg-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 140px;
  padding: 0 8px 24px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--sg-border);
}

.sg-chart-bar {
  flex: 1;
  height: var(--h, 50%);
  background: #93c5fd;
  border-radius: 4px 4px 0 0;
  position: relative;
  min-width: 0;
}

.sg-chart-bar--peak { background: #2563eb; }

.sg-chart-bar span {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--sg-muted);
  white-space: nowrap;
}

.sg-analytics-row {
  display: flex;
  gap: 32px;
  padding-top: 4px;
}

/* Pillar iframe frame — fixed 920×640 canvas, full content visible */
body.sg-frame {
  min-width: 920px;
  width: 920px;
  height: 640px;
  max-height: 640px;
  overflow: hidden;
  background: #f8fafc;
}

body.sg-frame .sg-app {
  min-height: 640px;
  height: 640px;
  max-height: 640px;
  overflow: hidden;
}

body.sg-frame .sg-content--frame {
  box-sizing: border-box;
  height: 640px;
  max-height: 640px;
  padding: 8px 10px 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.sg-frame .sg-page-title { font-size: 15px; margin-bottom: 6px; line-height: 1.2; }
body.sg-frame .sg-stats { gap: 6px; margin-bottom: 6px; flex-shrink: 0; }
body.sg-frame .sg-stat { padding: 7px 9px; }
body.sg-frame .sg-stat-value { font-size: 17px; }
body.sg-frame .sg-stat-label { margin-bottom: 3px; }
body.sg-frame .sg-card-head { margin-bottom: 8px; }
body.sg-frame .sg-card-title { font-size: 11px; }
body.sg-frame .sg-card-sub { font-size: 8px; margin-top: 2px; }
body.sg-frame .sg-toolbar { margin-bottom: 6px; flex-shrink: 0; }
body.sg-frame .sg-card--flush {
  flex: 1;
  min-height: 0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
body.sg-frame .sg-table { flex-shrink: 1; min-height: 0; }
body.sg-frame .sg-table--compact th,
body.sg-frame .sg-table--compact td,
body.sg-frame .sg-table--leads th,
body.sg-frame .sg-table--leads td,
body.sg-frame .sg-table--orders th,
body.sg-frame .sg-table--orders td,
body.sg-frame .sg-table--inv th,
body.sg-frame .sg-table--inv td {
  padding: 4px 6px;
}
body.sg-frame .sg-pagination {
  flex-shrink: 0;
  padding-top: 6px;
  margin-top: auto;
}
body.sg-frame .sg-page { min-width: 24px; height: 24px; font-size: 8px; }

body.sg-frame .sg-product-edit .sg-card-title { font-size: 10px; }
body.sg-frame .sg-product-edit .sg-card-sub { font-size: 7px; margin-bottom: 5px; }
body.sg-frame .sg-product-edit .sg-field { margin-bottom: 4px; }
body.sg-frame .sg-product-edit .sg-field input { padding: 5px 8px; font-size: 8px; }
body.sg-frame .sg-product-edit .sg-gst-box { padding: 6px; margin: 4px 0 6px; }
body.sg-frame .sg-product-edit .sg-media-grid { gap: 4px; }
body.sg-frame .sg-product-edit .sg-stack { gap: 5px; }
body.sg-frame .sg-product-edit .sg-edit-layout--product { gap: 8px; grid-template-columns: 1fr 210px; }
body.sg-frame .sg-product-edit .sg-card--compact { padding: 8px 10px; }
body.sg-frame .sg-product-edit .sg-pricing-metrics { gap: 4px; margin-top: 6px; padding-top: 6px; }
body.sg-frame .sg-product-edit .sg-content--frame { padding: 6px 8px 4px; }

body.sg-frame .sg-checkout-head { margin-bottom: 6px; flex-shrink: 0; }
body.sg-frame .sg-checkout-title h1 { font-size: 15px; }
body.sg-frame .sg-checkout-tagline { font-size: 9px; margin-top: -4px; }
body.sg-frame .sg-checkout-compare--v2 { margin-bottom: 5px; flex-shrink: 0; }
body.sg-frame .sg-checkout-compare-col { padding: 8px; }
body.sg-frame .sg-benefit-chips { margin-bottom: 5px; flex-shrink: 0; }
body.sg-frame .sg-benefit-chip { font-size: 8px; padding: 4px 8px; }
body.sg-frame .sg-info { margin-bottom: 5px; padding: 7px 9px; font-size: 8px; flex-shrink: 0; }
body.sg-frame .sg-card--flat { flex-shrink: 0; }

body.sg-frame .sg-crm-leads .sg-content--frame,
body.sg-frame .sg-crm-pipeline .sg-content--frame,
body.sg-frame .sg-crm-contact .sg-content--frame,
body.sg-frame .sg-ops-orders .sg-content--frame,
body.sg-frame .sg-ops-inventory .sg-content--frame,
body.sg-frame .sg-ops-routes .sg-content--frame {
  padding: 6px 8px 4px;
}

.sg-stat-trend {
  font-size: 8px;
  font-weight: 600;
  margin-top: 4px;
}

.sg-stat-trend--up { color: #059669; }
.sg-stat-trend--down { color: #dc2626; }

.sg-card--flush { padding: 14px 16px; }
.sg-card--compact { padding: 12px 14px; }

.sg-table--compact td,
.sg-table--compact th { padding: 8px 10px; }

.sg-cell-muted { color: #64748b; font-size: 9px; }

.sg-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
  border: 1px solid var(--sg-border);
  object-fit: cover;
  background: #f8fafc;
}

.sg-input-count { position: relative; }
.sg-input-count input { padding-right: 52px; }
.sg-char-count {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  color: #94a3b8;
}

.sg-media-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.sg-media-item,
.sg-media-add {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--sg-border);
  background: #f8fafc;
  overflow: hidden;
}

.sg-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-media-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-style: dashed;
  font-size: 8px;
  font-weight: 700;
  color: var(--sg-muted);
}

.sg-media-add span { font-size: 16px; line-height: 1; }

.sg-pricing-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sg-border);
}

.sg-pricing-metric span {
  display: block;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
  margin-bottom: 3px;
}

.sg-pricing-metric strong {
  font-size: 9px;
  font-weight: 600;
  color: var(--sg-ink);
}

.sg-status-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-status-select input { flex: 1; }

.sg-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
  flex-shrink: 0;
}

.sg-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.sg-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--sg-border);
}

.sg-toggle-label { font-size: 10px; font-weight: 600; }

/* Checkout v2 */
.sg-checkout-compare--v2 { align-items: stretch; }

.sg-checkout-compare-col--green {
  border-color: #86efac !important;
  background: #fafffe;
}

.sg-stat-label--green { color: #059669; }

.sg-flow-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
  padding: 8px 0;
  position: relative;
}

.sg-flow-steps::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

.sg-flow-steps--2::before {
  left: 20%;
  right: 20%;
  background: #86efac;
}

.sg-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: var(--sg-muted);
  z-index: 1;
  flex: 1;
}

.sg-flow-step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.sg-flow-step--green span { background: #ecfdf5; }

.sg-flow-step strong { font-size: 7px; letter-spacing: 0.03em; }

.sg-compare-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0;
}

.sg-compare-metrics div span {
  display: block;
  font-size: 7px;
  color: var(--sg-muted);
  margin-bottom: 2px;
}

.sg-compare-metrics div strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.sg-compare-metrics div em {
  display: block;
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
  color: #059669;
  margin-top: 1px;
}

.sg-compare-metrics--green div strong { color: #059669; }

.sg-compare-banner {
  font-size: 8px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  margin-top: 8px;
}

.sg-compare-banner--info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.sg-compare-banner--success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.sg-toggle-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sg-toggle-live {
  font-size: 8px;
  font-weight: 600;
  color: #059669;
  white-space: nowrap;
}

/* CRM screens */
.sg-breadcrumb {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.sg-leads-head,
.sg-pipeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.sg-leads-head .sg-page-title,
.sg-pipeline-head .sg-page-title { margin-bottom: 0; }

.sg-leads-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.sg-search--wide { flex: 1; min-width: 0; }

.sg-leads-toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.sg-view-toggle {
  font-size: 12px;
  color: var(--sg-muted);
  letter-spacing: 4px;
}

.sg-stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.sg-stage-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sg-muted);
  margin-right: 4px;
}

.sg-stage-pill {
  font-size: 9px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--sg-border);
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sg-stage-pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.sg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.sg-dot--open { background: #eab308; }
.sg-dot--progress { background: #2563eb; }
.sg-dot--won { background: #059669; }
.sg-dot--lost { background: #dc2626; }

.sg-table--leads { font-size: 8px; }
.sg-table--leads th { font-size: 7px; padding: 6px 8px; }
.sg-table--leads td { padding: 6px 8px; white-space: nowrap; }

.sg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sg-avatar--sm { width: 18px; height: 18px; font-size: 6px; }
.sg-avatar--lg { width: 48px; height: 48px; font-size: 14px; margin-bottom: 6px; }

.sg-avatar--rk { background: #6366f1; }
.sg-avatar--ps { background: #ec4899; }
.sg-avatar--am { background: #0ea5e9; }
.sg-avatar--sk { background: #8b5cf6; }
.sg-avatar--vj { background: #f59e0b; }
.sg-avatar--nd { background: #14b8a6; }
.sg-avatar--rs { background: #818cf8; }
.sg-avatar--amit { background: #3b82f6; }
.sg-avatar--neha { background: #a855f7; }
.sg-avatar--vikram { background: #10b981; }

.sg-stage-badge {
  font-size: 8px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.sg-stage-badge--open { background: #fef9c3; color: #a16207; }
.sg-stage-badge--progress { background: #dbeafe; color: #1d4ed8; }
.sg-stage-badge--won { background: #d1fae5; color: #047857; }
.sg-stage-badge--lost { background: #fee2e2; color: #b91c1c; }

.sg-assignee {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
}

.sg-cell-notes {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #64748b;
}

.sg-source--phone { background: #f0fdf4; color: #059669; }
.sg-source--google { background: #fef2f2; color: #dc2626; }
.sg-source--referral { background: #faf5ff; color: #7c3aed; }
.sg-source--trade { background: #f8fafc; color: #475569; }

body.sg-frame .sg-crm-leads .sg-page-title { font-size: 16px; }
body.sg-frame .sg-crm-leads .sg-leads-head { margin-bottom: 6px; }

/* Pipeline settings */
.sg-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sg-ink);
  margin-bottom: 2px;
}

.sg-pipeline-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.sg-pipeline-card-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: #fff;
}

.sg-pipeline-card-select.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.sg-pipeline-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sg-pipeline-card-body { flex: 1; min-width: 0; }

.sg-pipeline-card-title {
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sg-pipeline-card-actions {
  font-size: 11px;
  color: var(--sg-muted);
  flex-shrink: 0;
}

.sg-info--compact {
  margin-bottom: 8px;
  padding: 8px 10px;
  font-size: 8px;
}

.sg-stage-list { margin-top: 10px; }

.sg-stage-row {
  display: grid;
  grid-template-columns: 20px 1fr 16px auto 52px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 9px;
}

.sg-stage-row:last-child { border-bottom: 0; }

.sg-drag { color: #cbd5e1; font-size: 10px; letter-spacing: -2px; }

.sg-stage-row-main strong {
  display: block;
  font-size: 10px;
  color: var(--sg-ink);
}

.sg-stage-row-main span {
  display: block;
  font-size: 8px;
  color: var(--sg-muted);
}

.sg-stage-map { color: #94a3b8; font-size: 10px; }

.sg-stage-row-actions {
  font-size: 9px;
  color: #94a3b8;
  text-align: right;
}

body.sg-frame .sg-crm-pipeline .sg-page-title { font-size: 16px; margin-bottom: 2px; }
body.sg-frame .sg-crm-pipeline .sg-pipeline-head { margin-bottom: 6px; }
body.sg-frame .sg-crm-pipeline .sg-stage-row { padding: 6px 0; }

/* Unified CRM contact */
.sg-crm-contact { padding-top: 10px !important; }

.sg-contact-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sg-border);
}

.sg-contact-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.sg-back { color: var(--sg-muted); font-size: 14px; }

.sg-badge--wa {
  background: #ecfdf5;
  color: #059669;
  font-size: 7px;
  font-weight: 700;
  padding: 2px 6px;
}

.sg-contact-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  height: calc(640px - 52px);
}

.sg-contact-sidebar {
  border-right: 1px solid var(--sg-border);
  padding-right: 10px;
  overflow: hidden;
}

.sg-contact-profile {
  text-align: center;
  margin-bottom: 10px;
}

.sg-contact-profile strong {
  display: block;
  font-size: 11px;
  margin: 4px 0;
}

.sg-contact-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.sg-contact-fields > div {
  display: flex;
  gap: 8px;
  font-size: 8px;
}

.sg-contact-fields > div > span:first-child {
  color: #94a3b8;
  width: 14px;
  flex-shrink: 0;
}

.sg-contact-fields label {
  display: block;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
  margin-bottom: 1px;
}

.sg-ltv-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.sg-ltv-label { font-size: 7px; font-weight: 700; color: var(--sg-muted); }
.sg-ltv-value { font-size: 16px; font-weight: 700; color: var(--sg-ink); line-height: 1.2; }
.sg-ltv-sub { font-size: 7px; color: var(--sg-muted); }

.sg-tag--purple {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.sg-contact-activity {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sg-activity-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--sg-border);
  margin-bottom: 8px;
  padding-bottom: 6px;
  flex-shrink: 0;
}

.sg-activity-tabs span {
  font-size: 9px;
  font-weight: 600;
  color: var(--sg-muted);
  padding-bottom: 4px;
}

.sg-activity-tabs span.active {
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
}

.sg-timeline {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-timeline-item {
  display: flex;
  gap: 8px;
  font-size: 8px;
  position: relative;
  padding-left: 2px;
}

.sg-timeline-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex-shrink: 0;
}

.sg-timeline-meta {
  font-size: 7px;
  color: var(--sg-muted);
  margin-bottom: 2px;
}

.sg-timeline-item strong { font-size: 9px; display: block; margin-bottom: 2px; }
.sg-timeline-item p { color: #475569; margin: 2px 0; font-style: italic; }

.sg-timeline-status { font-size: 7px; color: var(--sg-muted); margin-top: 2px; }

.sg-timeline-item--note {
  background: #f8fafc;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  padding: 6px 8px;
  margin-left: 24px;
}

.sg-note-compose {
  flex-shrink: 0;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  margin-top: 6px;
  overflow: hidden;
}

.sg-note-compose textarea {
  width: 100%;
  border: 0;
  padding: 8px 10px;
  font-size: 9px;
  font-family: inherit;
  resize: none;
  height: 36px;
  background: #fff;
}

.sg-note-compose-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: #f8fafc;
  border-top: 1px solid var(--sg-border);
  font-size: 9px;
  color: var(--sg-muted);
}

.sg-note-compose-bar .sg-btn { padding: 4px 10px; font-size: 8px; }

/* Operations screens */
.sg-ops-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.sg-ops-head .sg-page-title { font-size: 14px; margin-bottom: 2px; }
.sg-title-sep { color: #cbd5e1; font-weight: 400; }

.sg-ops-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.sg-sync-label { font-size: 8px; color: var(--sg-muted); white-space: nowrap; }

.sg-order-metrics {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sg-order-metric,
.sg-inv-metric,
.sg-inv-insight {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.sg-order-metric span,
.sg-inv-metric span,
.sg-inv-insight span {
  display: block;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
  margin-bottom: 2px;
}

.sg-order-metric strong,
.sg-inv-metric strong,
.sg-inv-insight strong {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.sg-order-metric em,
.sg-inv-metric em,
.sg-inv-insight em {
  display: block;
  font-size: 6px;
  font-style: normal;
  color: #059669;
  margin-top: 1px;
}

.sg-text-purple { color: #7c3aed; }

.sg-metric-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex-shrink: 0;
}

.sg-metric-icon--blue { background: #dbeafe; }
.sg-metric-icon--amber { background: #fef3c7; }
.sg-metric-icon--purple { background: #ede9fe; }
.sg-metric-icon--cyan { background: #cffafe; }
.sg-metric-icon--green { background: #d1fae5; }
.sg-metric-icon--red { background: #fee2e2; }

.sg-ops-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.sg-table-meta {
  font-size: 8px;
  color: var(--sg-muted);
  margin-bottom: 6px;
}

.sg-table--orders { font-size: 7px; }
.sg-table--orders th { font-size: 6px; padding: 5px 6px; }
.sg-table--orders td { padding: 5px 6px; }

.sg-link { color: #2563eb; font-weight: 600; text-decoration: none; }

.sg-pay-badge,
.sg-status-pill,
.sg-delivery-badge {
  font-size: 6px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.sg-pay-badge--cod { background: #ffedd5; color: #c2410c; }
.sg-pay-badge--prepaid { background: #d1fae5; color: #047857; }
.sg-status-pill--pickup { background: #ede9fe; color: #6d28d9; }
.sg-delivery-badge--express { background: #ffedd5; color: #c2410c; }
.sg-delivery-badge--standard { background: #dbeafe; color: #1d4ed8; }

/* Inventory overview */
.sg-inv-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  align-items: flex-start;
}

.sg-inv-head .sg-page-title { font-size: 14px; margin-bottom: 2px; }

.sg-inv-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.sg-warehouse-select {
  text-align: right;
  font-size: 8px;
}

.sg-warehouse-select strong { display: block; font-size: 9px; }
.sg-warehouse-select span { color: var(--sg-muted); font-size: 7px; }

.sg-inv-metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 5px;
}

.sg-inv-metric { flex-direction: row; align-items: center; padding: 6px; }
.sg-inv-metric .sg-metric-icon { margin-right: 4px; }

.sg-inv-insights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 6px;
}

.sg-inv-insight { padding: 6px 8px; align-items: center; }
.sg-inv-insight em { font-size: 6px; color: #64748b; }

.sg-mini-bar {
  width: 100%;
  height: 3px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 3px;
  overflow: hidden;
}

.sg-mini-bar span {
  display: block;
  height: 100%;
  background: #059669;
  border-radius: 999px;
}

.sg-inv-main {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 8px;
  min-height: 0;
}

.sg-inv-table-wrap { min-width: 0; }

.sg-inv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.sg-inv-pills .sg-stage-pill { font-size: 7px; padding: 3px 7px; }

.sg-table--inv { font-size: 7px; }
.sg-table--inv th { font-size: 6px; padding: 4px 6px; }
.sg-table--inv td { padding: 4px 6px; }

.sg-thumb--phone { background: linear-gradient(145deg, #1a1a1a, #444); }
.sg-thumb--buds { background: linear-gradient(145deg, #111, #333); }
.sg-thumb--ink { background: linear-gradient(145deg, #2563eb, #1e40af); }
.sg-thumb--samsung { background: linear-gradient(145deg, #7c3aed, #4c1d95); }

.sg-inv-activity {
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sg-inv-activity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 9px;
}

.sg-activity-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

.sg-activity-feed > div {
  display: grid;
  grid-template-columns: 36px 18px 1fr;
  gap: 4px;
  align-items: start;
  font-size: 7px;
}

.sg-feed-time { font-size: 6px; color: var(--sg-muted); }
.sg-feed-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8px;
}

.sg-feed-icon--green { background: #d1fae5; color: #059669; }
.sg-feed-icon--blue { background: #dbeafe; color: #2563eb; }
.sg-feed-icon--purple { background: #ede9fe; color: #7c3aed; }
.sg-feed-icon--amber { background: #fef3c7; color: #d97706; }

.sg-activity-feed p { margin: 0; color: #475569; line-height: 1.3; }

.sg-btn-block { width: 100%; font-size: 8px; padding: 5px; }

body.sg-frame .sg-stats--compact { gap: 6px; margin-bottom: 6px; }
body.sg-frame .sg-stats--compact .sg-stat { padding: 7px 9px; }
body.sg-frame .sg-stats--compact .sg-stat-value { font-size: 17px; }

body.sg-frame .sg-ops-inventory .sg-inv-main { flex: 1; min-height: 0; }
body.sg-frame .sg-ops-inventory .sg-inv-metrics { margin-bottom: 4px; }
body.sg-frame .sg-ops-inventory .sg-inv-insights { margin-bottom: 4px; }
body.sg-frame .sg-ops-inventory .sg-inv-head { margin-bottom: 4px; }
body.sg-frame .sg-ops-inventory .sg-inv-head .sg-page-title { font-size: 13px; }
body.sg-frame .sg-ops-orders .sg-ops-head .sg-page-title { font-size: 12px; }
body.sg-frame .sg-ops-orders .sg-order-metrics { margin-bottom: 5px; }
body.sg-frame .sg-crm-contact .sg-contact-layout { height: calc(640px - 44px); }
body.sg-frame .sg-crm-leads .sg-leads-head .sg-page-title { font-size: 14px; }
body.sg-frame .sg-crm-pipeline .sg-page-title { font-size: 14px; }
