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

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #33404F;
  --muted: #8791A0;
  --muted2: #5B6675;
  --card-border: #EAEDF3;
  --panel-border: #E7EBF1;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }

/* 90% width to match the sibling redesigned apps. */
.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

@keyframes mmFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------- Hero ------------------------------- */
.mm-hero-inner { max-width: 90%; margin: 0 auto; padding: 34px 32px 4px; }
.mm-title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0 0 6px;
  padding-top: 4px;
}
.mm-url { font-size: 15.5px; color: var(--muted2); padding-bottom: 8px; }

/* ------------------------------- Tabs ------------------------------- */
.mm-tabs {
  background: #fff;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.03);
  margin-top: 14px;
}
.mm-tabs-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 38px; }
.mm-tab {
  appearance: none;
  background: none;
  border: none;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
  padding: 18px 2px;
  margin: 0;
  border-bottom: 3px solid transparent;
}
.mm-tab.active { font-weight: 700; color: var(--ink); border-bottom-color: #E8402A; }

/* ------------------------------- Main ------------------------------- */
.mm-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 32px 32px 56px; }
.mm-panel { animation: mmFadeUp 0.35s ease both; }

/* ------------------------------- Summary: count cards ------------------------------- */
.mm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.mm-stat {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mm-stat-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.mm-stat-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 40px; color: var(--ink); line-height: 1; letter-spacing: -0.5px; }
.mm-stat-label { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 8px; }
.mm-progress { margin-top: 16px; }
.mm-progress-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.mm-progress-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mm-progress-pct { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--ink); }
.mm-progress-track { height: 7px; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.mm-progress-track span { display: block; height: 100%; border-radius: 999px; }

/* ------------------------------- Summary: breakdown cards ------------------------------- */
.mm-breakdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.mm-breakdown {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
}
.mm-breakdown-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.mm-breakdown-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 19px; color: var(--ink); margin: 0; }
.mm-breakdown-rows { display: flex; flex-direction: column; gap: 16px; }
.mm-breakdown-row { display: flex; align-items: center; gap: 12px; }
.mm-chip { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 3px; }
.mm-breakdown-label { flex: 1; font-size: 14.5px; color: #43525F; }
.mm-breakdown-value { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }

/* ------------------------------- Toolbar / filters ------------------------------- */
.mm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.mm-count { font-size: 14px; color: var(--muted); font-weight: 600; }
.mm-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.mm-filter {
  appearance: none;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 20px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #C9D2DE;
}
.mm-filter.active { background: #132638; color: #fff; border-color: #132638; }

/* ------------------------------- Images grid ------------------------------- */
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.mm-img-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
}
.mm-img-thumb {
  height: 140px;
  background: repeating-linear-gradient(45deg, #EEF1F6, #EEF1F6 9px, #F6F8FB 9px, #F6F8FB 18px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mm-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-img-body { padding: 13px 15px; }
.mm-img-name {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mm-img-status { margin-top: 10px; }

/* ------------------------------- Media list ------------------------------- */
.mm-list {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  overflow: hidden;
}
.mm-row { display: flex; align-items: center; gap: 18px; padding: 18px 26px; border-bottom: 1px solid #F1F4F8; }
.mm-row:last-child { border-bottom: none; }
.mm-row-icon { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.mm-row-main { flex: 1; min-width: 0; }
.mm-row-title {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mm-row-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.mm-view {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid #DCE1E9;
  color: var(--ink);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: 10px;
}
.mm-view:hover { border-color: var(--ink); }

/* ------------------------------- Status pills ------------------------------- */
.mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.mm-pill.ai { color: #1FA97A; background: #E7F7F1; border: 1px solid #CDEDE1; }
.mm-pill.manual { color: #2F6FE0; background: #EAF1FC; border: 1px solid #D6E4FB; }
.mm-pill.missing { color: #D14545; background: #FCECEC; border: 1px solid #F5D5D5; }
.mm-pill.none { color: #B5772E; background: #FCF6E4; border: 1px solid #F1E7C4; }

.mm-empty {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 1080px) {
  .mm-stats { grid-template-columns: repeat(2, 1fr); }
  .mm-breakdowns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mm-hero-inner, .mm-tabs-inner, .mm-main { padding-left: 20px; padding-right: 20px; }
  .mm-stats { grid-template-columns: 1fr; }
  .mm-row { flex-wrap: wrap; }
}
