#sgcrm-root .sgcrm-agent-native-hidden {
  display: none !important;
}

#sgcrm-root .sgcrm-agent-simple-dashboard,
.sgcrm-agent-detail-modal {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#sgcrm-root .sgcrm-agent-simple-dashboard {
  display: grid;
  gap: 18px;
  color: #0f172a;
}

#sgcrm-root .sgcrm-agent-dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}

#sgcrm-root .sgcrm-agent-dashboard-toolbar-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.015em;
}

#sgcrm-root .sgcrm-agent-dashboard-toolbar-copy span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

#sgcrm-root .sgcrm-agent-dashboard-range {
  min-width: 152px;
  height: 42px;
  padding: 0 38px 0 13px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  outline: none;
}

#sgcrm-root .sgcrm-agent-dashboard-range:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

#sgcrm-root .sgcrm-agent-dashboard-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

#sgcrm-root .sgcrm-agent-dashboard-date {
  min-width: 145px;
}

#sgcrm-root .sgcrm-agent-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#sgcrm-root .sgcrm-agent-dashboard-card {
  min-width: 0;
  min-height: 142px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  color: #0f172a;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.045);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#sgcrm-root .sgcrm-agent-dashboard-card:hover,
#sgcrm-root .sgcrm-agent-dashboard-card:focus-visible {
  transform: translateY(-2px);
  border-color: #86efac;
  box-shadow: 0 17px 38px rgba(15, 23, 42, 0.08);
  outline: none;
}

#sgcrm-root .sgcrm-agent-dashboard-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#sgcrm-root .sgcrm-agent-dashboard-card-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

#sgcrm-root .sgcrm-agent-dashboard-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 16px;
  font-weight: 900;
}

#sgcrm-root .sgcrm-agent-dashboard-card-value {
  margin-top: 13px;
  overflow: hidden;
  color: #0f172a;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sgcrm-root .sgcrm-agent-dashboard-card-note {
  margin-top: 7px;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.42;
}

#sgcrm-root .sgcrm-agent-dashboard-card.is-remittance .sgcrm-agent-dashboard-card-icon {
  background: #fff7ed;
  color: #d97706;
}

#sgcrm-root .sgcrm-agent-dashboard-breakdown {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.04);
}

#sgcrm-root .sgcrm-agent-dashboard-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 19px;
  border-bottom: 1px solid #e2e8f0;
}

#sgcrm-root .sgcrm-agent-dashboard-breakdown-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

#sgcrm-root .sgcrm-agent-dashboard-breakdown-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

#sgcrm-root .sgcrm-agent-dashboard-link {
  border: 0;
  background: transparent;
  color: #15803d;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

#sgcrm-root .sgcrm-agent-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  padding: 16px;
}

#sgcrm-root .sgcrm-agent-status-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fbfdff;
  color: #0f172a;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

#sgcrm-root .sgcrm-agent-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--sgcrm-status-color, #64748b);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--sgcrm-status-color, #64748b) 13%, transparent);
}

#sgcrm-root .sgcrm-agent-status-copy {
  min-width: 0;
  flex: 1;
}

#sgcrm-root .sgcrm-agent-status-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sgcrm-root .sgcrm-agent-status-sub {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10.5px;
}

#sgcrm-root .sgcrm-agent-status-count {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

#sgcrm-root .sgcrm-agent-dashboard-empty,
#sgcrm-root .sgcrm-agent-dashboard-error {
  padding: 30px 18px;
  color: #64748b;
  font-size: 12.5px;
  text-align: center;
}

#sgcrm-root .sgcrm-agent-dashboard-error {
  color: #b91c1c;
}

#sgcrm-root .sgcrm-agent-dashboard-retry {
  margin-top: 10px;
  padding: 9px 13px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fff;
  color: #b91c1c;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#sgcrm-root .sgcrm-agent-order-sheet-row {
  margin: 10px 12px;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.035);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

#sgcrm-root .sgcrm-agent-order-sheet-row:hover,
#sgcrm-root .sgcrm-agent-order-sheet-row:focus-visible {
  transform: translateY(-1px);
  border-color: #86efac !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.075);
  outline: none;
}

#sgcrm-root .sgcrm-agent-orders-row {
  cursor: pointer;
}

#sgcrm-root .sgcrm-agent-orders-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: -3px;
}

#sgcrm-root .sgcrm-agent-order-meta {
  margin-top: 6px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.45;
}

#sgcrm-root .sgcrm-agent-order-hint {
  margin-top: 6px;
  color: #15803d;
  font-size: 10px;
  font-weight: 800;
}

#sgcrm-root .sgcrm-agent-fee-approved,
#sgcrm-root .sgcrm-agent-fee-paid {
  color: #15803d !important;
}

#sgcrm-root .sgcrm-agent-fee-pending_review,
#sgcrm-root .sgcrm-agent-fee-pending {
  color: #b45309 !important;
}

#sgcrm-root .sgcrm-agent-fee-rejected {
  color: #dc2626 !important;
}

#sgcrm-root .sgcrm-agent-fee-not_submitted {
  color: #64748b !important;
}

.sgcrm-agent-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(5px);
}

.sgcrm-agent-detail-modal {
  width: min(720px, 100%);
  max-height: min(88vh, 840px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 22px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
}

.sgcrm-agent-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #e2e8f0;
}

.sgcrm-agent-detail-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.sgcrm-agent-detail-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}

.sgcrm-agent-detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: #f1f5f9;
  color: #334155;
  font-size: 22px;
  cursor: pointer;
}

.sgcrm-agent-detail-body {
  max-height: calc(min(88vh, 840px) - 80px);
  overflow: auto;
  padding: 18px 22px 24px;
}

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

.sgcrm-agent-detail-field {
  min-width: 0;
  margin: 0;
  padding: 12px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fbfdff;
}

.sgcrm-agent-detail-field.is-wide {
  grid-column: 1 / -1;
}

.sgcrm-agent-detail-field dt {
  margin: 0;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.sgcrm-agent-detail-field dd {
  margin: 5px 0 0;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sgcrm-agent-detail-field dd.is-approved,
.sgcrm-agent-detail-field dd.is-paid {
  color: #15803d;
}

.sgcrm-agent-detail-field dd.is-pending_review,
.sgcrm-agent-detail-field dd.is-pending {
  color: #b45309;
}

.sgcrm-agent-detail-field dd.is-rejected {
  color: #dc2626;
}

#sgcrm-root .sgcrm-agent-sheet-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #f8fafc;
}

#sgcrm-root .sgcrm-agent-sheet-filter {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

#sgcrm-root .sgcrm-agent-sheet-filter > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

#sgcrm-root .sgcrm-agent-sheet-filter select,
#sgcrm-root .sgcrm-agent-sheet-filter input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  outline: none;
}

#sgcrm-root .sgcrm-agent-sheet-filter select:focus,
#sgcrm-root .sgcrm-agent-sheet-filter input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

@media (max-width: 1020px) {
  #sgcrm-root .sgcrm-agent-dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #sgcrm-root .sgcrm-agent-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #sgcrm-root .sgcrm-agent-simple-dashboard {
    gap: 13px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 13px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-range {
    width: 100%;
  }

  #sgcrm-root .sgcrm-agent-dashboard-controls {
    align-items: stretch;
    width: 100%;
  }

  #sgcrm-root .sgcrm-agent-dashboard-date {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  #sgcrm-root .sgcrm-agent-dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-card {
    min-height: 126px;
    padding: 14px;
    border-radius: 15px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-card-value {
    font-size: 22px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-card-label {
    font-size: 9.5px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-card-icon {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    font-size: 13px;
  }

  #sgcrm-root .sgcrm-agent-dashboard-breakdown-head {
    align-items: flex-start;
    padding: 14px;
  }

  #sgcrm-root .sgcrm-agent-status-grid {
    grid-template-columns: 1fr;
    padding: 11px;
  }

  #sgcrm-root .sgcrm-agent-order-sheet-row {
    align-items: flex-start !important;
    flex-wrap: wrap;
    margin: 8px;
  }

  #sgcrm-root .sgcrm-agent-order-sheet-row > :first-child {
    flex: 1 1 100% !important;
    width: 100%;
  }

  #sgcrm-root .sgcrm-agent-order-sheet-row > :nth-child(2) {
    flex: 1 1 auto;
    min-width: 0 !important;
    text-align: left !important;
  }

  #sgcrm-root .sgcrm-agent-order-sheet-row > :nth-child(3) {
    margin-left: auto;
  }

  #sgcrm-root .sgcrm-agent-sheet-filters {
    align-items: stretch;
    gap: 9px;
    padding: 10px;
  }

  #sgcrm-root .sgcrm-agent-sheet-filter {
    flex: 1 1 100%;
    min-width: 0;
  }

  .sgcrm-agent-detail-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .sgcrm-agent-detail-modal {
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }

  .sgcrm-agent-detail-head {
    padding: 17px;
  }

  .sgcrm-agent-detail-body {
    max-height: calc(94vh - 76px);
    padding: 14px 15px 22px;
  }

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

  .sgcrm-agent-detail-field.is-wide {
    grid-column: auto;
  }
}
