:root {
  --mtt-green: #2d6a4f;
  --mtt-dark: #1b4332;
  --mtt-mint: #95d5b2;
}

/* Hide all ERPNext / Frappe commercial chrome + links */
a[href*="erpnext.com"],
a[href*="frappe.io"],
a[href*="frappe.com"],
a[href*="frappecloud.com"],
a[href*="support.frappe.io"],
a[href*="discuss.frappe"],
a[href*="github.com/frappe"],
a[href*="docs.erpnext"],
.footer-powered,
.powered-by-frappe,
.powered-by,
footer .text-muted[href*="frappe"],
body a[href*="source=website_footer"],
.modal-about .about-links,
[data-mtt-hidden="frappe-chrome"],
[data-mtt-hidden="frappe-link"] {
  display: none !important;
}

/* Avatar / menu rows that still leak Frappe labels (JS also hides these) */
.dropdown-menu a[href*="frappe"],
.dropdown-menu a[href*="erpnext"],
[role="menu"] a[href*="frappe"],
[role="menu"] a[href*="erpnext"] {
  display: none !important;
}

/* Buttons / login polish */
.btn-primary,
.btn-login,
button.btn-primary {
  background: var(--mtt-green) !important;
  border-color: var(--mtt-green) !important;
}

.btn-primary:hover,
.btn-login:hover {
  background: var(--mtt-dark) !important;
  border-color: var(--mtt-dark) !important;
}

.for-login .page-card,
.for-forgot .page-card,
.for-signup .page-card {
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(27, 67, 50, 0.12);
}

.for-login .app-logo,
.navbar .app-logo,
.navbar-brand img {
  max-height: 40px !important;
  width: auto !important;
}

.navbar {
  border-bottom: 2px solid var(--mtt-mint) !important;
}

/* Unified single-interface desk polish */
.body-sidebar .standard-sidebar-label,
.body-sidebar .sidebar-item-label {
  font-size: 13px;
}

.body-sidebar [data-title="MyToyTree"] .sidebar-header-subtitle,
.sidebar-header .sidebar-header-subtitle {
  color: var(--mtt-green);
}

/* Soft-hide residual multi-app chrome if any still renders */
.desktop-page .desktop-icon-title:is([title="Framework"], [title="ERPNext"]) {
  display: none !important;
}

/* Native ERP website analytics dashboard */
.mtt-analytics-container {
  padding: 10px 0 30px;
  font-family: inherit;
}

.mtt-analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mtt-analytics-title h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--heading-color, #111827);
}

.mtt-analytics-title p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mtt-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.mtt-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: mtt-pulse 1.8s infinite;
}

@keyframes mtt-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mtt-analytics-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mtt-analytics-ranges {
  display: inline-flex;
  border-radius: 8px;
  background: #f3f4f6;
  padding: 3px;
}

.mtt-range-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mtt-range-btn:hover {
  color: #111827;
}

.mtt-range-btn.active {
  background: #fff;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtt-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.mtt-analytics-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mtt-analytics-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.mtt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mtt-analytics-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--heading-color, #111827);
  line-height: 1.1;
}

.mtt-card-sub {
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
}

.mtt-analytics-funnel-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mtt-funnel-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

/* MyToyTree Sales Events workspace */
.mtt-events-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 8px 0 32px;
}

.mtt-events-loading {
  padding: 48px 12px;
  text-align: center;
}

.mtt-events-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 24px;
  color: #fff;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--mtt-dark), var(--mtt-green));
  box-shadow: 0 10px 30px rgba(27, 67, 50, 0.16);
}

.mtt-events-hero h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.mtt-events-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.mtt-event-stats {
  display: flex;
  gap: 10px;
}

.mtt-event-stat {
  min-width: 92px;
  padding: 12px 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.mtt-event-stat strong,
.mtt-event-stat span {
  display: block;
}

.mtt-event-stat strong {
  font-size: 22px;
}

.mtt-event-stat span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.mtt-event-section {
  min-width: 0;
  margin: 0;
}

.mtt-event-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mtt-event-section-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.mtt-event-section-heading p {
  margin: 2px 0 0;
  color: var(--text-muted, #6b7280);
  font-size: 12px;
}

.mtt-event-section-heading > span {
  min-width: 28px;
  padding: 4px 9px;
  text-align: center;
  color: var(--mtt-dark);
  border-radius: 999px;
  background: #d8f3dc;
  font-size: 12px;
  font-weight: 700;
}

.mtt-event-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.mtt-event-card,
.mtt-events-empty {
  padding: 16px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  background: var(--card-bg, #fff);
}

.mtt-event-card {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mtt-event-card:hover {
  border-color: var(--mtt-mint);
  box-shadow: 0 7px 20px rgba(27, 67, 50, 0.08);
  transform: translateY(-1px);
}

.mtt-event-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted, #6b7280);
  font-size: 11px;
}

.mtt-event-status {
  padding: 3px 8px;
  color: #374151;
  border-radius: 999px;
  background: #f3f4f6;
  font-weight: 600;
}

.mtt-event-status.status-active { color: #065f46; background: #d1fae5; }
.mtt-event-status.status-prepared { color: #92400e; background: #fef3c7; }
.mtt-event-status.status-closing { color: #854d0e; background: #fef9c3; }
.mtt-event-status.status-cancelled { color: #991b1b; background: #fee2e2; }

.mtt-event-card h4 {
  margin: 14px 0 5px;
  font-size: 16px;
  font-weight: 700;
}

.mtt-event-venue,
.mtt-event-dates {
  margin: 3px 0;
  color: var(--text-muted, #6b7280);
  font-size: 12px;
}

.mtt-event-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 10px;
  border-radius: 9px;
  background: #f6fbf8;
}

.mtt-event-results span,
.mtt-event-results strong {
  display: block;
}

.mtt-event-results span {
  color: var(--text-muted, #6b7280);
  font-size: 10px;
}

.mtt-event-results strong {
  color: var(--heading-color, #111827);
  font-size: 13px;
}

.mtt-events-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  color: var(--text-muted, #6b7280);
}

@media (max-width: 767px) {
  .mtt-events-workspace { grid-template-columns: 1fr; gap: 18px; }
  .mtt-events-hero { align-items: flex-start; flex-direction: column; }
  .mtt-event-stats { width: 100%; }
  .mtt-event-stat { min-width: 0; flex: 1; }
}

.mtt-funnel-step {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #f3f4f6;
  position: relative;
}

.mtt-step-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
}

.mtt-step-count {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 4px 0 6px;
}

.mtt-step-bar-bg {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.mtt-step-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.mtt-step-rate {
  font-size: 11px;
  color: #4f46e5;
  font-weight: 600;
  margin-top: 4px;
}

.mtt-panels-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.mtt-analytics-panel {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mtt-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.mtt-panel-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.mtt-panel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mtt-panel-table th {
  text-align: left;
  padding: 8px 10px;
  color: #6b7280;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid #e5e7eb;
}

.mtt-panel-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.mtt-panel-table tr:last-child td {
  border-bottom: none;
}

.mtt-panel-table tr:hover td {
  background: #f9fafb;
}

.mtt-channel-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
}

.mtt-channel-badge.direct { background: #f3f4f6; color: #374151; }
.mtt-channel-badge.google { background: #e0f2fe; color: #0369a1; }
.mtt-channel-badge.instagram { background: #fdf2f8; color: #be185d; }
.mtt-channel-badge.facebook { background: #eff6ff; color: #1d4ed8; }
.mtt-channel-badge.whatsapp { background: #f0fdf4; color: #15803d; }

.mtt-attribution-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 10px;
}

.mtt-attribution-box h5 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
}

.mtt-attribution-box p {
  margin: 0;
  font-size: 12px;
  color: #b45309;
  line-height: 1.5;
}

/* Unified Getting Started — all modules, same coach card as stock Selling Setup */
.mtt-onb-later {
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 1px 6px;
  margin-right: 4px;
}

.mtt-onb-panel {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 24px;
  width: 340px;
  max-height: 80vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mtt-onb-panel.mtt-onb-hidden {
  display: none;
}

.mtt-onb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.mtt-onb-header-actions button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  padding: 2px 4px;
}

.mtt-onb-body {
  overflow-y: auto;
}

.mtt-onb-title {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 6px;
}

.mtt-onb-logo {
  height: 36px;
  margin-bottom: 8px;
}

.mtt-onb-sub {
  color: #6b7280;
  font-size: 13px;
  margin-top: 4px;
}

.mtt-onb-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 10px;
}

.mtt-onb-badge {
  background: #FDFAED;
  color: #DB7706;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.mtt-onb-badge.done {
  background: #E4FAEB;
  color: #278F5E;
}

.mtt-onb-skip {
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
}

.mtt-onb-skip:hover {
  color: #111827;
}

.mtt-onb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.mtt-onb-tab {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
}

.mtt-onb-tab.active {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}

.mtt-onb-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mtt-onb-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.mtt-onb-step:hover {
  background: #f5f5f5;
}

.mtt-onb-step.done {
  color: #9ca3af;
}

.mtt-onb-step.skipped .mtt-onb-step-label {
  text-decoration: line-through;
  color: #9ca3af;
}

.mtt-onb-dot {
  width: 16px;
  height: 16px;
  border: 1.5px solid #9ca3af;
  border-radius: 50%;
  flex: 0 0 16px;
}

.mtt-onb-step.done .mtt-onb-dot {
  background: #278F5E;
  border-color: #278F5E;
}

.mtt-onb-step-label {
  flex: 1;
  font-size: 14px;
}

.mtt-onb-step-skip {
  font-size: 12px;
  color: #6b7280;
  opacity: 0;
}

.mtt-onb-step:hover .mtt-onb-step-skip {
  opacity: 1;
}

[data-theme="dark"] .mtt-onb-panel {
  background: #232323;
  color: #e5e7eb;
}

[data-theme="dark"] .mtt-onb-tab {
  background: #1c1c1c;
  border-color: #333;
  color: #e5e7eb;
}

[data-theme="dark"] .mtt-onb-tab.active {
  background: #2d6a4f;
  border-color: #2d6a4f;
}

[data-theme="dark"] .mtt-onb-step:hover {
  background: #1c1c1c;
}

/* Blocked-delete dialog */
.mtt-del-summary {
  margin: 0 0 14px;
  line-height: 1.5;
  color: var(--text-color, #374151);
}

.mtt-del-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin-bottom: 8px;
}

.mtt-del-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card-bg, #fff);
}

.mtt-del-row a {
  font-weight: 600;
}

.mtt-del-meta {
  color: #6b7280;
  font-size: 12px;
  margin-top: 2px;
}

.mtt-del-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f3f4f6;
  color: #374151;
}

.mtt-del-pill.draft {
  background: #e0f2fe;
  color: #075985;
}

.mtt-del-pill.submitted {
  background: #fef3c7;
  color: #92400e;
}

.mtt-del-pill.cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.mtt-del-pill.locked {
  background: #fee2e2;
  color: #991b1b;
}

.mtt-del-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}
/* QR scan floating button (Item list) */
.mtt-qr-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  border-radius: 50px;
  padding: 10px 18px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  background: var(--mtt-green, #2d6a4f);
  border-color: var(--mtt-green, #2d6a4f);
}
.mtt-qr-float-btn:hover {
  background: var(--mtt-dark, #1b4332);
  border-color: var(--mtt-dark, #1b4332);
  color: #fff;
}

/* Fast quantity controls inside POS cart rows. */
.mtt-pos-quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 96px;
  padding: 3px;
  border: 1px solid #e4ece7;
  border-radius: 9px;
  background: #f8fbf9;
  justify-content: center;
}

.mtt-pos-qty-btn {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #1b6b3a;
  cursor: pointer;
  padding: 0;
}

.mtt-pos-qty-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.mtt-pos-qty-btn:hover,
.mtt-pos-qty-btn:focus-visible {
  background: #dff2e5;
  outline: none;
}

.mtt-pos-qty-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}

.mtt-pos-qty-value {
  min-width: 28px;
  color: var(--text-color, #273444);
  font-weight: 600;
  text-align: center;
}
