/* ============================================================
   MR4 Client Dashboard — standalone DEMO component
   Scoped under .mr4-demo-dash. Light theme, brand palette
   #dd1467 / #850037. Mobile-first; no horizontal page scroll.
   ============================================================ */

.mr4-demo-dash {
	--mdd-pink: #dd1467;
	--mdd-maroon: #850037;
	--mdd-green: #10b981;
	--mdd-ink: #1f2937;
	--mdd-muted: #6b7280;
	--mdd-line: #e5e7eb;
	--mdd-soft: #f9fafb;
	--mdd-card: #ffffff;
	--mdd-radius: 12px;
	color: var(--mdd-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	max-width: 1080px;
	margin: 0 auto;
	-webkit-text-size-adjust: 100%;
	box-sizing: border-box;
}
.mr4-demo-dash *,
.mr4-demo-dash *::before,
.mr4-demo-dash *::after { box-sizing: border-box; }

/* ---------- Frame + header ---------- */
.mdd-frame {
	background: var(--mdd-card);
	border: 1px solid var(--mdd-line);
	border-radius: var(--mdd-radius);
	box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
	overflow: hidden;
}
.mdd-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 16px 18px;
	background: linear-gradient(135deg, var(--mdd-maroon), var(--mdd-pink));
	color: #fff;
}
.mdd-title { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: .2px; }
.mdd-badge {
	font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
	background: rgba(255,255,255,.22); color: #fff;
	padding: 3px 8px; border-radius: 999px;
}
.mdd-refreshed { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.85); }

/* ---------- Tabs (scroll strip on narrow screens) ---------- */
.mdd-tabs {
	display: flex;
	gap: 2px;
	padding: 6px 8px;
	background: var(--mdd-soft);
	border-bottom: 1px solid var(--mdd-line);
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}
.mdd-tabs::-webkit-scrollbar { height: 6px; }
.mdd-tabs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.mdd-tab {
	flex: 0 0 auto;
	scroll-snap-align: start;
	display: inline-flex; align-items: center; gap: 6px;
	background: transparent; border: 0; cursor: pointer;
	font: inherit; font-size: 13px; font-weight: 600; color: var(--mdd-muted);
	padding: 9px 13px; border-radius: 8px; white-space: nowrap;
	transition: background .15s, color .15s;
}
.mdd-tab:hover { background: #eef2f7; color: var(--mdd-ink); }
.mdd-tab.is-active { background: var(--mdd-card); color: var(--mdd-pink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.mdd-tab-icon { font-size: 15px; line-height: 1; }

/* ---------- Panels ---------- */
.mdd-panel { display: none; padding: 18px; animation: mdd-fade .2s ease; }
.mdd-panel.is-active { display: block; }
@keyframes mdd-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.mdd-intro {
	display: flex; gap: 10px; align-items: flex-start;
	background: #fff5f9; border: 1px solid #fcd7e7; border-left: 3px solid var(--mdd-pink);
	border-radius: 8px; padding: 10px 12px; margin: 0 0 16px;
	font-size: 13px; color: #4b5563;
}
.mdd-intro b { color: var(--mdd-maroon); }

.mdd-section-title {
	font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
	color: var(--mdd-maroon); margin: 22px 0 10px; padding-bottom: 6px;
	border-bottom: 2px solid var(--mdd-line);
	display: flex; align-items: center; gap: 8px;
}
.mdd-section-title:first-child { margin-top: 0; }

/* ---------- KPI cards ---------- */
.mdd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.mdd-card {
	background: var(--mdd-soft); border: 1px solid var(--mdd-line); border-radius: 10px;
	padding: 14px; display: flex; flex-direction: column; gap: 3px; position: relative;
}
.mdd-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--mdd-muted); }
.mdd-card-value { font-size: 26px; font-weight: 700; color: var(--mdd-ink); line-height: 1.1; }
.mdd-card-sub { font-size: 11px; color: var(--mdd-muted); }

/* ---------- Charts ---------- */
.mdd-chartwrap { position: relative; height: 320px; margin-top: 14px; }
.mdd-chartwrap.sm { height: 260px; }
.mdd-legend {
	display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
	gap: 4px 14px; margin-top: 10px; font-size: 11px; color: var(--mdd-muted);
}
.dcl-item { display: inline-flex; align-items: center; gap: 5px; }
.dcl-toggle { cursor: pointer; user-select: none; }
.dcl-item.off { opacity: .4; text-decoration: line-through; }
.dcl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dcl-sep { color: #d1d5db; }

/* ---------- Tables ---------- */
.mdd-tablewrap { overflow-x: auto; border: 1px solid var(--mdd-line); border-radius: 10px; -webkit-overflow-scrolling: touch; }
table.mdd-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 460px; }
table.mdd-table th, table.mdd-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--mdd-line); white-space: nowrap; }
table.mdd-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--mdd-muted); background: var(--mdd-soft); font-weight: 700; }
table.mdd-table td.num, table.mdd-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.mdd-table tr:last-child td { border-bottom: 0; }
table.mdd-table td.strong { font-weight: 600; color: var(--mdd-ink); }
.mdd-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.mdd-pill.up { background: #dcfce7; color: #166534; }
.mdd-pill.down { background: #fee2e2; color: #991b1b; }
.mdd-pill.flat { background: #f3f4f6; color: #4b5563; }

/* ---------- Stat strip (small metric rows) ---------- */
.mdd-statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mdd-stat { background: var(--mdd-soft); border: 1px solid var(--mdd-line); border-radius: 10px; padding: 12px 14px; }
.mdd-stat .v { font-size: 22px; font-weight: 700; }
.mdd-stat .l { font-size: 11px; color: var(--mdd-muted); text-transform: uppercase; letter-spacing: .4px; }

/* ---------- Reputation / health ---------- */
.mdd-rep { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; background: var(--mdd-soft); border: 1px solid var(--mdd-line); border-radius: 10px; padding: 16px; }
.mdd-rep-score { font-size: 40px; font-weight: 800; color: var(--mdd-maroon); line-height: 1; }
.mdd-stars { color: #f59e0b; font-size: 18px; letter-spacing: 2px; }
.mdd-health { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.mdd-health.ok { background: #dcfce7; color: #166534; }

/* ---------- Teaching info affordance ---------- */
.mdd-info {
	appearance: none; border: 1px solid currentColor; background: transparent;
	color: var(--mdd-muted); width: 16px; height: 16px; border-radius: 50%;
	font-size: 10px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.mdd-info:hover { color: var(--mdd-pink); }
.mdd-card .mdd-info { position: absolute; top: 10px; right: 10px; }
.mdd-tip {
	position: absolute; z-index: 30; max-width: 240px;
	background: #111827; color: #f9fafb; font-size: 12px; line-height: 1.45; font-weight: 400;
	text-transform: none; letter-spacing: normal;
	padding: 9px 11px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.mdd-tip::after { content: ""; position: absolute; width: 8px; height: 8px; background: #111827; transform: rotate(45deg); }

.mdd-note { font-size: 12px; color: var(--mdd-muted); margin: 8px 2px 0; font-style: italic; }
.mdd-placeholder { padding: 30px; text-align: center; color: var(--mdd-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.mdd-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.mr4-demo-dash { font-size: 13px; }
	.mdd-panel { padding: 14px; }
	.mdd-chartwrap { height: 260px; }
	.mdd-card-value { font-size: 22px; }
	.mdd-rep-score { font-size: 32px; }
}
@media (max-width: 420px) {
	.mdd-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
	.mdd-card { padding: 11px; }
	.mdd-card-value { font-size: 20px; }
	.mdd-head { padding: 13px 14px; }
	.mdd-title { font-size: 15px; }
}
