/* StepUp on Frappe — black & white operations chrome */
:root {
  --stepup-ink: #171717;
  --stepup-muted: #6c7680;
  --stepup-border: #d1d8dd;
  --stepup-surface: #ffffff;
  --stepup-bg: #f4f5f6;
  --stepup-accent: #171717;
}

body.stepup-hub-body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--stepup-bg);
  color: var(--stepup-ink);
}

.stepup-hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.stepup-hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--stepup-border);
}

.stepup-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--stepup-ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.stepup-hub-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stepup-hub-brand p {
  margin: 4px 0 0;
  color: var(--stepup-muted);
  font-size: 13px;
}

.stepup-hub-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--stepup-border);
  border-radius: 6px;
  background: var(--stepup-surface);
  color: var(--stepup-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.stepup-hub-actions a.primary {
  background: var(--stepup-ink);
  border-color: var(--stepup-ink);
  color: #fff;
}

.stepup-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stepup-stat {
  background: var(--stepup-surface);
  border: 1px solid var(--stepup-border);
  border-radius: 8px;
  padding: 16px;
}

.stepup-stat span {
  display: block;
  font-size: 12px;
  color: var(--stepup-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stepup-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
}

.stepup-section {
  margin-bottom: 28px;
}

.stepup-section h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stepup-muted);
}

.stepup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.stepup-card {
  display: block;
  background: var(--stepup-surface);
  border: 1px solid var(--stepup-border);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stepup-card:hover {
  border-color: #99a1a9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stepup-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stepup-muted);
  margin-bottom: 8px;
}

.stepup-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.stepup-card p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--stepup-muted);
  line-height: 1.45;
}

.stepup-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--stepup-border);
  font-size: 12px;
  color: var(--stepup-muted);
}

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

@media (max-width: 860px) {
  .stepup-charts {
    grid-template-columns: 1fr;
  }
}

.stepup-chart-panel {
  background: var(--stepup-surface);
  border: 1px solid var(--stepup-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.stepup-chart-panel.wide {
  grid-column: 1 / -1;
}

.stepup-chart-panel header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.stepup-chart-panel header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.stepup-chart-panel header span {
  font-size: 11px;
  color: var(--stepup-muted);
}

.stepup-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stepup-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 120px) 1fr minmax(72px, 110px);
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.stepup-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--stepup-ink);
  font-weight: 500;
}

.stepup-bar-track {
  height: 12px;
  background: #eef2f6;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.stepup-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.45s ease;
}

.stepup-bar-fill.waiter {
  background: linear-gradient(90deg, #4f46e5, #818cf8);
}

.stepup-bar-value {
  text-align: right;
  color: var(--stepup-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
}

.stepup-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 160px;
  padding: 12px 4px 0;
  background: linear-gradient(180deg, #f8fafc 0%, transparent 70%);
  border-radius: 12px;
}

.stepup-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  height: 148px;
}

.stepup-spark-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  border-radius: 8px 8px 4px 4px;
  min-height: 6px;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
}

.stepup-spark-col span {
  font-size: 10px;
  color: var(--stepup-muted);
  font-weight: 600;
  writing-mode: horizontal-tb;
  transform: none;
  max-height: none;
}

.stepup-empty {
  margin: 0;
  font-size: 12px;
  color: var(--stepup-muted);
}

/* Circular / donut charts */
.stepup-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 0 4px;
}

.stepup-donut {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.stepup-donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #f1f5f9;
}

.stepup-donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.stepup-donut-center strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stepup-donut-center span {
  font-size: 0.72rem;
  color: var(--stepup-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stepup-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
}

.stepup-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.stepup-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stepup-legend-row strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.stepup-vbar-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  min-height: 150px;
  padding-top: 8px;
}

.stepup-vbar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stepup-vbar-track {
  width: 100%;
  max-width: 40px;
  height: 120px;
  background: #eef2f6;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

.stepup-vbar-fill {
  width: 100%;
  border-radius: 10px 10px 4px 4px;
  min-height: 4px;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  transition: height 0.45s ease;
}

.stepup-vbar span {
  font-size: 10px;
  color: var(--stepup-muted);
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Frappe desk white-label touches */
.navbar-brand .app-logo-title,
.app-switcher-dropdown .app-title {
  font-weight: 600;
}

.navbar-brand img,
.app-logo,
.app-switcher-logo,
.for-login .page-card-head img,
img[src*="ury/Images"],
img[src*="ury-logo"] {
  content: url("https://bi.stepup-online.in/stepup-brand/stepup-logo.png") !important;
  object-fit: contain !important;
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
}

/* Hide vendor powered-by on login and desk */
.footer-powered,
.powered-by,
.login-footer,
.page-card-actions .text-muted,
a[href*="erpnext.com"],
a[href*="frappe.io"] {
  display: none !important;
}

.for-login .page-card-head img,
.navbar-brand img {
  content: url("https://bi.stepup-online.in/stepup-brand/stepup-logo.png") !important;
  max-height: 48px !important;
  width: auto !important;
}

@media (max-width: 900px) {
  .stepup-charts {
    grid-template-columns: 1fr;
  }

  .stepup-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .stepup-bar-value {
    text-align: left;
  }
}