@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800&family=Barlow+Condensed:wght@600;700;800&display=swap');

#munga-dashboard {
  --navy:       #0f2744;
  --navy-mid:   #1a3a5c;
  --blue:       #185FA5;
  --blue-light: #dbeafe;
  --blue-dark:  #0c447c;
  --amber:      #d97706;
  --amber-light:#fef3c7;
  --amber-dark: #78350f;
  --green:      #059669;
  --green-light:#d1fae5;
  --green-dark: #064e3b;
  --gray:       #64748b;
  --gray-light: #f1f5f9;
  --border:     #e2e8f0;
  --white:      #ffffff;
  --text:       #0f172a;
  --text-muted: #64748b;
  --radius:     12px;
  --radius-sm:  8px;
  font-family: 'Barlow', sans-serif;
  color: var(--text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* ── TOPBAR ── */
.munga-topbar {
  background: var(--navy);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.munga-topbar-left { display: flex; align-items: center; gap: 14px; }
.munga-logo {
  width: 44px; height: 44px;
  background: var(--blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.munga-logo svg { width: 22px; height: 22px; stroke: #fff; }
.munga-site-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 800;
  color: #fff; letter-spacing: .02em; line-height: 1;
}
.munga-site-sub { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.munga-topbar-right { display: flex; align-items: center; gap: 12px; }
.munga-updated { font-size: 11px; color: #64748b; }
.munga-btn-refresh {
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  font-family: 'Barlow', sans-serif;
  background: var(--blue); border: none; border-radius: var(--radius-sm);
  color: #fff; cursor: pointer; transition: background .15s;
}
.munga-btn-refresh:hover { background: var(--blue-dark); }

/* ── STATE ── */
.munga-state {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center; padding: 60px 20px;
  color: var(--text-muted); font-size: 14px;
}
.munga-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: munga-spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes munga-spin { to { transform: rotate(360deg); } }

/* ── CONTENT WRAPPER ── */
#munga-content {
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px;
}

/* ── SUMMARY CARDS ── */
.munga-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.munga-metric {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.munga-metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.munga-metric.m-total::before  { background: var(--navy); }
.munga-metric.m-entries::before{ background: var(--gray); }
.munga-metric.m-paid::before   { background: var(--blue); }
.munga-metric.m-unpaid::before { background: var(--amber); }
.munga-metric-icon { font-size: 20px; margin-bottom: 8px; }
.munga-metric-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px;
}
.munga-metric-value { font-size: 36px; font-weight: 800; line-height: 1; }
.munga-metric-value.c-navy  { color: var(--navy); }
.munga-metric-value.c-blue  { color: var(--blue); }
.munga-metric-value.c-amber { color: var(--amber); }
.munga-metric-value.c-green { color: var(--green); }
.munga-metric-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── TOOLBAR ── */
.munga-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.munga-tabs { display: flex; gap: 4px; background: var(--white); border: 1px solid var(--border); border-radius: 30px; padding: 4px; }
.munga-tab {
  padding: 6px 16px; font-size: 13px; font-weight: 600;
  font-family: 'Barlow', sans-serif;
  border: none; border-radius: 30px; background: transparent;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.munga-tab.active { background: var(--navy); color: #fff; }
.munga-tab:hover:not(.active) { background: var(--gray-light); color: var(--text); }
.munga-search {
  margin-left: auto;
  padding: 8px 16px; font-size: 13px; font-family: 'Barlow', sans-serif;
  border: 1px solid var(--border); border-radius: 30px;
  background: var(--white); color: var(--text); width: 220px;
}
.munga-search:focus { outline: none; border-color: var(--blue); }

/* ── EVENT CARDS ── */
.munga-event-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.munga-event-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.munga-event-header {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: background .12s;
}
.munga-event-header:hover { background: #fafbfc; }
.munga-event-header.open { border-bottom: 1px solid var(--border); }
.munga-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-past     { background: #94a3b8; }
.dot-upcoming { background: var(--green); }
.dot-soon     { background: var(--amber); }
.munga-event-name { flex: 1; font-size: 14px; font-weight: 700; }
.munga-event-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-right: 8px; }
.munga-pills { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.munga-pill {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pill-total  { background: var(--green-light);  color: var(--green-dark); }
.pill-paid   { background: var(--blue-light);   color: var(--blue-dark); }
.pill-unpaid { background: var(--amber-light);  color: var(--amber-dark); }
.munga-badge {
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-past     { background: var(--gray-light); color: var(--gray); }
.badge-upcoming { background: var(--green-light); color: var(--green-dark); }
.badge-soon     { background: var(--amber-light); color: var(--amber-dark); }
.munga-chevron { font-size: 11px; color: #94a3b8; transition: transform .2s; flex-shrink: 0; }
.munga-chevron.open { transform: rotate(180deg); }

/* ── EVENT BODY ── */
.munga-event-body { display: none; padding: 20px; }
.munga-event-body.open { display: block; animation: munga-fade .2s ease; }
@keyframes munga-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.munga-section-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 12px;
}

/* ── CATEGORY CARDS ── */
.munga-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.munga-cat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--gray-light);
}
.munga-cat-name {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase; letter-spacing: .04em;
}
.munga-cat-nums { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.munga-cat-paid   { font-size: 28px; font-weight: 800; color: var(--blue); line-height: 1; }
.munga-cat-paid-lbl { font-size: 11px; color: var(--text-muted); }
.munga-cat-unpaid { font-size: 14px; font-weight: 700; color: var(--amber); }
.munga-progress {
  height: 5px; background: var(--border);
  border-radius: 3px; overflow: hidden; display: flex;
}
.munga-prog-paid   { background: var(--blue);  height: 100%; transition: width .6s ease; }
.munga-prog-unpaid { background: var(--amber); height: 100%; transition: width .6s ease; }

/* ── BAR CHART ── */
.munga-chart { padding-top: 16px; border-top: 1px solid var(--border); }
.munga-legend { display: flex; gap: 16px; margin-bottom: 12px; }
.munga-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.munga-legend-swatch { width: 12px; height: 12px; border-radius: 2px; }
.munga-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.munga-bar-lbl {
  font-size: 12px; color: var(--text-muted);
  width: 160px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.munga-bar-track {
  flex: 1; height: 24px; background: var(--gray-light);
  border-radius: 4px; overflow: hidden; display: flex;
}
.munga-bar-paid   { background: var(--blue);  height: 100%; transition: width .6s ease; }
.munga-bar-unpaid { background: var(--amber); height: 100%; transition: width .6s ease; }
.munga-bar-total  { font-size: 12px; font-weight: 700; color: var(--text-muted); width: 32px; text-align: right; flex-shrink: 0; }

/* ── EVENT FOOTER STATS ── */
.munga-event-stats {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.munga-event-stats strong { color: var(--text); font-weight: 700; }
.munga-event-stats .spaid   { color: var(--blue);  font-weight: 700; }
.munga-event-stats .sunpaid { color: var(--amber); font-weight: 700; }

/* ── NO EVENTS ── */
.munga-no-events {
  text-align: center; padding: 40px;
  color: var(--text-muted); font-size: 14px;
}

/* ── LOADING SKELETON ── */
.munga-skeleton {
  background: linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
  background-size: 200% 100%;
  animation: munga-shimmer 1.4s infinite;
  border-radius: 4px; height: 16px;
}
@keyframes munga-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .munga-summary { grid-template-columns: repeat(2,1fr); }
  #munga-content { padding: 16px; }
  .munga-topbar  { padding: 16px; border-radius: 0; }
  .munga-bar-lbl { width: 100px; }
  .munga-search  { width: 160px; }
  .munga-event-name { font-size: 13px; }
}

/* ── DEFERRED PILL ── */
.pill-deferred { background: #ede9fe; color: #4c1d95; }
.c-purple { color: #7C3AED; }
.m-deferred::before { background: #7C3AED; }

/* ── MERCHANDISE PAGE ── */
.merch-toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
  padding: 16px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.merch-select {
  padding: 8px 12px; font-size: 13px; font-family: 'Barlow', sans-serif;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text); cursor: pointer;
}
.merch-select:focus { outline: none; border-color: #7C3AED; }

.merch-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 4px;
}
.merch-summary-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  border-top: 3px solid #7C3AED;
}
.merch-summary-item   { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.merch-summary-option { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.merch-summary-count  { font-size: 28px; font-weight: 800; color: #7C3AED; line-height: 1; }
.merch-summary-sub    { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.merch-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.merch-table thead tr { background: #4c1d95; color: #fff; }
.merch-table th { padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.merch-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.merch-row-even { background: var(--white); }
.merch-row-odd  { background: #faf5ff; }
.merch-paid-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.merch-paid   { background: var(--blue-light); color: var(--blue-dark); }
.merch-unpaid { background: var(--amber-light); color: var(--amber-dark); }

#munga-merchandise #merch-content {
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px;
}

@media (max-width: 768px) {
  .merch-table { font-size: 12px; }
  .merch-table th, .merch-table td { padding: 8px 10px; }
  .merch-summary-grid { grid-template-columns: repeat(2,1fr); }
}
