/* SBM Self-Assessment - public styles */

.sbm-public {
	--sbm-border: #e5e7eb;
	--sbm-muted: #6b7280;
	font-size: 15px;
	line-height: 1.6;
	color: #1f2937;
}

.sbm-public * { box-sizing: border-box; }

.sbm-public-header { text-align: center; padding: 28px 16px; border-bottom: 1px solid var(--sbm-border); margin-bottom: 24px; }
.sbm-public-logo img { max-width: 120px; height: auto; margin-bottom: 12px; }
.sbm-public-school { font-size: 26px; margin: 0 0 6px; }
.sbm-public-title { font-size: 14px; color: var(--sbm-muted); margin: 0 0 12px; }
.sbm-public-meta { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--sbm-muted); margin: 0; }

.sbm-toolbar { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; padding: 10px 14px; background: #f9fafb; border: 1px solid var(--sbm-border); border-radius: 8px; }
.sbm-toolbar label { font-size: 13px; font-weight: 600; color: #374151; }
.sbm-toolbar select { padding: 6px 10px; border: 1px solid var(--sbm-border); border-radius: 6px; background: #fff; font-size: 13px; }

.sbm-public-section { margin-bottom: 40px; }
.sbm-public-section h3 { font-size: 18px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid #f3f4f6; }
.sbm-public-section h4 { font-size: 14px; margin: 0; }

/* KPI band */
.sbm-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 32px; }
.sbm-stat { border: 1px solid var(--sbm-border); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.sbm-stat-label { font-size: 12px; color: var(--sbm-muted); text-transform: uppercase; letter-spacing: .05em; }
.sbm-stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.sbm-stat-detail { font-size: 12px; color: var(--sbm-muted); }
.sbm-stat-level { align-self: flex-start; font-size: 11px; font-weight: 600; color: #fff; padding: 2px 8px; border-radius: 10px; }

.sbm-progress { width: 100%; height: 7px; background: #f0f0f1; border-radius: 4px; overflow: hidden; }
.sbm-progress-fill { height: 100%; background: #0284c7; }

/* Run / trend chart */
.sbm-trend-chart-wrap { width: 100%; margin-bottom: 4px; }
.sbm-trend-chart-wrap-lg { margin-bottom: 10px; }
.sbm-trend-svg { width: 100%; height: auto; display: block; }
.sbm-trend-svg .sbm-trend-axis { font-size: 9px; fill: var(--sbm-muted); text-anchor: end; }
.sbm-trend-svg .sbm-trend-value { font-size: 11px; font-weight: 700; }
.sbm-trend-svg .sbm-trend-value-current { font-size: 12px; }
.sbm-trend-svg .sbm-trend-xlabel { font-size: 10px; fill: var(--sbm-muted); }
.sbm-trend-svg .sbm-trend-xlabel-current { font-weight: 700; fill: #1f2937; }

.sbm-trend-legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--sbm-muted); margin: 0 0 24px; }
.sbm-trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sbm-legend-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; opacity: .6; }
.sbm-legend-line { width: 14px; height: 0; border-top: 1px dashed #0284c7; display: inline-block; }
.sbm-legend-ring { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 2px solid #9ca3af; background: #fff; }

.sbm-public-callout { background: #ecfdf5; color: #065f46; border-radius: 10px; padding: 14px 16px; font-size: 14px; margin-bottom: 28px; }
.sbm-public-callout-muted { background: #f3f4f6; color: #374151; margin-bottom: 20px; }

.sbm-evidence-trend-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sbm-evidence-trend-head .sbm-stat-value { font-size: 24px; }

.sbm-dim-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sbm-dim-card { border: 1px solid var(--sbm-border); border-radius: 10px; padding: 16px; }
.sbm-dim-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sbm-dim-score-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.sbm-dim-score { font-size: 20px; font-weight: 700; line-height: 1.1; }
.sbm-dim-level { font-size: 10px; font-weight: 600; color: var(--sbm-muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }

.sbm-trend-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 12px; margin-top: 6px; }
.sbm-trend-badge-improving { background: #dcfce7; color: #166534; }
.sbm-trend-badge-declining { background: #fee2e2; color: #991b1b; }
.sbm-trend-badge-stable { background: #e0f2fe; color: #075985; }
.sbm-trend-badge-insufficient { background: #f3f4f6; color: #6b7280; }

/* Indicator matrix */
.sbm-table-scroll { overflow-x: auto; border: 1px solid var(--sbm-border); border-radius: 10px; }
.sbm-public-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.sbm-public-table th, .sbm-public-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--sbm-border); vertical-align: top; }
.sbm-public-table thead th { background: #f9fafb; font-size: 12px; font-weight: 600; color: var(--sbm-muted); }
.sbm-public-table .c-num { width: 44px; text-align: center; }
.sbm-public-table .c-rate { width: 170px; }
.sbm-public-table .c-ev { width: 320px; }
.sbm-public-dim td { background: #f3f4f6; padding: 8px 12px; }
.sbm-row-attention { box-shadow: inset 3px 0 0 #f59e0b; }

.sbm-dim-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sbm-dim-row-title { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.sbm-dim-row-meta { font-size: 11px; color: var(--sbm-muted); white-space: nowrap; }
.sbm-dist-bar { display: flex; height: 8px; width: 140px; min-width: 100px; border-radius: 4px; overflow: hidden; background: #e5e7eb; margin-left: auto; }
.sbm-dist-bar-inline { flex: 0 0 auto; }
.sbm-dist-seg { height: 100%; }
.sbm-dist-seg-empty { background: #e5e7eb; }

.sbm-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.sbm-badge-empty { background: #f3f4f6; color: #6b7280; }


.sbm-muted { color: var(--sbm-muted); font-size: 12px; }

.sbm-public-actions { text-align: center; margin-top: 20px; }
.sbm-print-btn { padding: 10px 18px; border: 1px solid var(--sbm-border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sbm-print-btn:hover { background: #f9fafb; }

.sbm-empty { padding: 24px; text-align: center; color: var(--sbm-muted); }

.sbm-file-icon { display: inline-block; min-width: 34px; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-align: center; text-transform: uppercase; line-height: 1.5; vertical-align: middle; }
.sbm-file-icon-pdf { background: #fecaca; color: #991b1b; }
.sbm-file-icon-doc { background: #bfdbfe; color: #1e40af; }
.sbm-file-icon-xls { background: #bbf7d0; color: #065f46; }
.sbm-file-icon-ppt { background: #fed7aa; color: #92400e; }
.sbm-file-icon-img { background: #e9d5ff; color: #6b21a8; }
.sbm-file-icon-vid { background: #fbcfe8; color: #9d174d; }
.sbm-file-icon-txt, .sbm-file-icon-generic { background: #e5e7eb; color: #374151; }

@media print {
	.sbm-toolbar, .sbm-public-actions { display: none; }
	.sbm-table-scroll { overflow: visible; border: 0; }
	.sbm-public-table { min-width: 0; font-size: 10px; }
}

@media screen and (max-width: 600px) {
	.sbm-public-school { font-size: 21px; }
	.sbm-stat-value { font-size: 24px; }
	.sbm-dim-row { align-items: flex-start; }
	.sbm-dist-bar { margin-left: 0; width: 100%; }
}
