/* Partner dashboard — sidebar layout & components */

.mg-portal--dashboard {
  max-width: 1180px;
}

.mg-dash-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.mg-dash-nav {
  position: sticky;
  top: 1rem;
  background: #fff;
  border: 1px solid rgba(13, 45, 94, 0.1);
  border-radius: 14px;
  padding: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 74, 124, 0.06);
}

.mg-dash-nav__group + .mg-dash-nav__group {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(13, 45, 94, 0.08);
}

.mg-dash-nav__label {
  margin: 0 0 0.35rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a7184;
}

.mg-dash-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.mg-dash-nav__link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  color: #0d2d5e !important;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s;
}

.mg-dash-nav__link:hover {
  background: #f0f7ff;
}

.mg-dash-nav__link.is-active {
  background: linear-gradient(135deg, var(--ps-primary, #0f6080), color-mix(in srgb, var(--ps-primary, #0f6080) 70%, var(--ps-accent, #f97316)));
  color: #fff !important;
}

.mg-theme-swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.mg-theme-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1.5px solid rgba(13, 45, 94, 0.12);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.mg-theme-swatch:hover {
  border-color: color-mix(in srgb, var(--ps-primary, #0f6080) 45%, transparent);
  transform: translateY(-1px);
}

.mg-theme-swatch.is-active {
  border-color: var(--ps-primary, #0f6080);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ps-accent, #f97316) 28%, transparent);
}

.mg-theme-swatch__colors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
}

.mg-theme-swatch__colors i {
  display: block;
  height: 100%;
}

.mg-theme-swatch__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0d2d5e;
}

@media (max-width: 720px) {
  .mg-theme-swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mg-dash-nav__icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.82rem;
}

.mg-dash-main {
  min-width: 0;
}

.mg-btn--outline {
  background: #fff !important;
  color: #0d2d5e !important;
  border: 1.5px solid rgba(13, 45, 94, 0.2) !important;
  box-shadow: none !important;
}

.mg-btn--outline:hover {
  background: #f0f7ff !important;
  transform: none;
}

.mg-btn--ghost {
  background: transparent !important;
  color: #b42318 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0.5rem 0.75rem;
}

.mg-btn--ghost:hover {
  background: #fdecea !important;
}

.mg-btn--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.mg-btn--whatsapp {
  background: #25d366 !important;
  color: #fff !important;
}

.mg-home-progress {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(13, 45, 94, 0.1);
  position: relative;
  overflow: hidden;
}

.mg-home-progress::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, #f97316, #ea580c);
  border-radius: inherit;
}

.mg-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.mg-checklist__item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(13, 45, 94, 0.1);
  background: #fafcff;
}

.mg-checklist__item.is-done {
  opacity: 0.75;
  background: #f6fef9;
  border-color: rgba(2, 122, 72, 0.15);
}

.mg-checklist__mark {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f2fb;
  font-weight: 700;
  font-size: 0.85rem;
}

.mg-checklist__item.is-done .mg-checklist__mark {
  background: #ecfdf3;
  color: #027a48;
}

.mg-checklist__item p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: #5a7184;
}

.mg-checklist__link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.mg-builder-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.mg-builder-step {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 45, 94, 0.15);
  background: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0d2d5e;
  cursor: pointer;
}

.mg-builder-step.is-active {
  background: #0d2d5e;
  color: #fff;
  border-color: #0d2d5e;
}

.mg-builder-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.mg-url-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(13, 45, 94, 0.15);
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
}

.mg-url-field span {
  color: #5a7184;
  white-space: nowrap;
}

.mg-url-field input {
  flex: 1;
  min-width: 120px;
  border: 0 !important;
  padding: 0.25rem 0 !important;
  background: transparent !important;
}

.mg-offer-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid rgba(13, 45, 94, 0.1);
  border-radius: 12px;
  background: #fff;
}

.mg-offer-card__thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.mg-offer-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.mg-offer-card__head h3 {
  margin: 0;
  font-size: 1rem;
}

.mg-offer-card__meta {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: #5a7184;
}

.mg-offer-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.mg-offer-boost {
  position: relative;
}

.mg-offer-boost summary {
  list-style: none;
  cursor: pointer;
}

.mg-offer-boost summary::-webkit-details-marker {
  display: none;
}

.mg-offer-boost .mg-boost-form {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 5;
  display: grid;
  gap: 0.35rem;
  min-width: 220px;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid rgba(13, 45, 94, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(13, 45, 94, 0.12);
}

.mg-portal__notice--info {
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 900px) {
  .mg-dash-layout {
    grid-template-columns: 1fr;
  }

  .mg-dash-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.65rem;
  }

  .mg-dash-nav__group {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    display: contents;
  }

  .mg-dash-nav__label {
    display: none;
  }

  .mg-dash-nav__list {
    display: contents;
  }

  .mg-dash-nav__link {
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(13, 45, 94, 0.12);
    border-radius: 999px;
    font-size: 0.82rem;
  }

  .mg-offer-card {
    grid-template-columns: 56px 1fr;
  }

  .mg-offer-card__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Website builder — service category picker */
.mg-service-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.mg-service-category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid rgba(13, 45, 94, 0.12);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mg-service-category-card:hover {
  border-color: rgba(13, 45, 94, 0.28);
  box-shadow: 0 4px 14px rgba(13, 45, 94, 0.08);
}

.mg-service-category-card.is-active {
  border-color: #0d2d5e;
  box-shadow: 0 0 0 1px #0d2d5e;
  background: #f0f7ff;
}

.mg-service-category-card__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.mg-service-category-card__name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0d2d5e;
  line-height: 1.25;
}

.mg-service-category-card__tag {
  font-size: 0.68rem;
  color: #5a7184;
  line-height: 1.3;
}

/* Website builder — template picker */
.mg-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.mg-template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem 0.85rem;
  border: 2px solid rgba(13, 45, 94, 0.12);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mg-template-card.is-matched:not(.is-active) {
  border-color: rgba(37, 99, 235, 0.35);
}

.mg-template-card__preview {
  display: block;
  width: 100%;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tpl-bg, #f0f9ff);
  border: 1px solid rgba(13, 45, 94, 0.08);
  margin-bottom: 0.15rem;
}

.mg-template-card__preview-hero {
  display: block;
  background: linear-gradient(135deg, var(--tpl-primary, #0c4a6e), var(--tpl-accent, #06b6d4));
}

.mg-template-card__preview-body {
  display: block;
  height: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.mg-template-card__preview--fullscreen .mg-template-card__preview-hero { height: 40px; }
.mg-template-card__preview--cinematic .mg-template-card__preview-hero { height: 44px; border-radius: 0 0 40% 40%; }
.mg-template-card__preview--split { display: grid; grid-template-columns: 1fr 1fr; height: 54px; }
.mg-template-card__preview--split .mg-template-card__preview-hero { height: 100%; }
.mg-template-card__preview--split .mg-template-card__preview-body { height: 100%; background: var(--tpl-bg, #f0f9ff); }
.mg-template-card__preview--banner .mg-template-card__preview-hero { height: 22px; }
.mg-template-card__preview--banner .mg-template-card__preview-body { height: 32px; }
.mg-template-card__preview--soft .mg-template-card__preview-hero { height: 34px; opacity: 0.82; border-radius: 0 0 12px 12px; }
.mg-template-card__preview--editorial .mg-template-card__preview-hero { height: 28px; margin: 6px 8px 0; border-radius: 4px; width: calc(100% - 16px); }
.mg-template-card__preview--editorial .mg-template-card__preview-body { height: 20px; margin: 4px 8px 0; width: calc(100% - 16px); border-radius: 4px; background: rgba(13, 45, 94, 0.08); }
.mg-template-card__preview--corporate .mg-template-card__preview-hero { height: 18px; }
.mg-template-card__preview--corporate .mg-template-card__preview-body { height: 36px; background: linear-gradient(to right, rgba(13, 45, 94, 0.08) 35%, transparent 35%); }
.mg-template-card__preview--minimal .mg-template-card__preview-hero { height: 12px; opacity: 0.55; }
.mg-template-card__preview--minimal .mg-template-card__preview-body { height: 42px; }

.mg-template-card__layout {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}

.mg-template-card:hover {
  border-color: rgba(13, 45, 94, 0.28);
  box-shadow: 0 4px 14px rgba(13, 45, 94, 0.08);
}

.mg-template-card.is-active {
  border-color: #0d2d5e;
  box-shadow: 0 0 0 1px #0d2d5e;
}

.mg-template-card.is-suggested:not(.is-active) {
  border-color: rgba(232, 119, 34, 0.45);
}

.mg-template-card__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.mg-template-card__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0d2d5e;
}

.mg-template-card__tag {
  font-size: 0.74rem;
  color: #5a7184;
  line-height: 1.35;
}

.mg-template-card__badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
}

.mg-template-card__badge--match {
  top: auto;
  bottom: 0.45rem;
  right: 0.45rem;
  background: #eff6ff;
  color: #1d4ed8;
}

.mg-template-card__service {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0c4a6e;
}

.mg-service-flow {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  border-radius: 10px;
  background: #f0f7ff;
  border: 1px solid rgba(12, 74, 110, 0.12);
}

.mg-service-flow__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mg-service-flow__label {
  font-size: 0.82rem;
  color: #5a7184;
}

.mg-service-flow__row--pending strong {
  color: #c2410c;
}

.mg-service-change-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  font-size: 0.9rem;
  color: #92400e;
}

.mg-service-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

.mg-service-banner--preview {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
}

.mg-service-banner--pending {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.mg-service-banner__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.mg-service-banner__links a {
  font-weight: 600;
}

.mg-moderation--draft {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.25);
  color: #334155;
}

/* Map pin options (Deals tab) */
.mg-map-pin-fieldset {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(13, 45, 94, 0.1);
}

.mg-map-pin-picker {
  height: 280px;
  margin-top: 0.5rem;
  border: 1px solid rgba(13, 45, 94, 0.15);
  border-radius: 10px;
  position: relative;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

.mg-map-pin-picker .leaflet-container {
  z-index: 0 !important;
}

.mg-publish-settings {
  display: grid;
  gap: 0.65rem;
  position: relative;
  z-index: 2;
}

.mg-portal__check--toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 0;
  border: 1px solid rgba(13, 45, 94, 0.12);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  min-height: 48px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mg-portal__check--toggle:hover {
  border-color: rgba(13, 45, 94, 0.28);
  background: #fafcff;
}

.mg-portal__check--toggle input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.1rem 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #0d2d5e;
  pointer-events: auto;
}

.mg-portal__check--toggle span {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  color: #0d2d5e;
  pointer-events: none;
}

.mg-map-pin-options {
  margin-top: 0.75rem;
}

.mg-map-pin-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.mg-map-pin-badge--live {
  background: #dcfce7;
  color: #166534;
}

.mg-map-pin-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.mg-map-pin-badge--off {
  background: #f1f5f9;
  color: #64748b;
}

.mg-ai-assist-box {
  padding: 1rem;
  border-radius: 10px;
  background: rgba(13, 45, 94, 0.04);
  border: 1px dashed rgba(13, 45, 94, 0.18);
  margin-bottom: 1rem;
}

.mg-builder-fieldset {
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid rgba(13, 45, 94, 0.1);
}

.mg-builder-fieldset legend {
  font-weight: 700;
  color: #0d2d5e;
  padding: 0 0.25rem;
}

.mg-builder-preview-sections {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: #5a7184;
}

.mg-builder-preview-sections li {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(13, 45, 94, 0.06);
}

.mg-builder-preview-sections li:last-child {
  border-bottom: 0;
}

.mg-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.mg-analytics-grid > div {
  padding: 1rem;
  border: 1px solid rgba(15, 96, 128, 0.14);
  border-radius: 14px;
  background: #f5fbfc;
}

.mg-analytics-grid strong,
.mg-analytics-grid span {
  display: block;
}

.mg-analytics-grid strong {
  color: #0f6080;
  font-size: 1.5rem;
}

.mg-analytics-grid span {
  margin-top: 0.25rem;
  color: #5a7184;
  font-size: 0.75rem;
}

.mg-analytics-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.mg-analytics-table th,
.mg-analytics-table td {
  padding: 0.65rem;
  border-bottom: 1px solid rgba(15, 96, 128, 0.12);
  text-align: left;
}
