/*
Theme Name: TM Baseline Survey Theme
Description: Companion theme for the TM Baseline Survey plugin dashboards. Palette matches Tea Marketplace's own branding (teamarketplace.in inauguration page tokens), so this reads as part of the same product, not a bolted-on portal.
Author: Abhishek Gupta
Version: 0.2.0
*/

:root {
	--tea-green-dk: #0f2419;
	--tea-green: #1c3d2c;
	--tea-green-lt: #3d6b47;
	--gold: #c9a24b;
	--gold-lt: #e8cc82;
	--gold-dk: #8f7027;
	--cream: #f4ecd8;
	--mark-red: #b8362b;
	--lime: #cddc39;

	--surface: #ffffff;
	--surface-muted: #faf7f0;
	--border: #e3ddc9;
	--text: #23291f;
	--text-muted: #6b6455;

	--font-display: Georgia, 'Times New Roman', serif;
	--font-ui: 'Trebuchet MS', system-ui, -apple-system, sans-serif;
	--radius: 6px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--surface-muted);
	font-family: var(--font-ui);
	color: var(--text);
	line-height: 1.5;
}

a { color: var(--tea-green); }
a:hover { color: var(--gold-dk); }

/* ---------- Top bar ---------- */
.tm-bs-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--tea-green-dk);
	color: var(--cream);
	padding: 14px 28px;
	border-bottom: 3px solid var(--gold);
}

.tm-bs-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-display);
	font-size: 20px;
	letter-spacing: 0.02em;
	color: var(--cream);
	text-decoration: none;
}

.tm-bs-brand-mark {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: linear-gradient(160deg, var(--gold-lt), var(--gold) 55%, var(--gold-dk));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: bold;
	color: var(--tea-green-dk);
	font-size: 15px;
	flex-shrink: 0;
}

.tm-bs-brand-sub {
	font-family: var(--font-ui);
	font-size: 12px;
	color: var(--gold-lt);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-left: 4px;
}

.tm-bs-topbar-right {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 14px;
}

.tm-bs-role-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--gold);
	color: var(--tea-green-dk);
	font-weight: bold;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 4px 10px 4px 8px;
	border-radius: 999px;
}
.tm-bs-role-badge svg { width: 12px; height: 12px; flex-shrink: 0; }

.tm-bs-user-name { color: var(--cream); }

.tm-bs-logout {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--gold-lt);
	text-decoration: none;
	border: 1px solid var(--gold-dk);
	padding: 5px 12px;
	border-radius: var(--radius);
	font-size: 13px;
}
.tm-bs-logout svg { width: 14px; height: 14px; }
.tm-bs-logout:hover { background: var(--gold-dk); color: var(--tea-green-dk); }

/* ---------- Page shell ---------- */
.tm-bs-shell {
	max-width: 1320px;
	margin: 0 auto;
	padding: 32px 28px 64px;
}

.tm-bs-page-title-banner {
	background: linear-gradient(120deg, var(--tea-green-dk), var(--tea-green) 60%, var(--gold-dk));
	color: var(--cream);
	border-radius: var(--radius);
	padding: 22px 28px;
	margin-bottom: 24px;
	box-shadow: 0 2px 8px rgba(15, 36, 25, 0.15);
}
.tm-bs-page-title-banner h1 {
	font-family: var(--font-display);
	font-size: 26px;
	margin: 0;
	color: var(--cream);
}
.tm-bs-page-title-banner p {
	font-family: var(--font-ui);
	font-size: 13px;
	color: var(--gold-lt);
	margin: 4px 0 0;
	letter-spacing: 0.02em;
}

.tm-bs-content-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 28px 32px;
	box-shadow: 0 1px 3px rgba(15, 36, 25, 0.06);
}

/* ---------- Dashboard content (targets markup already in plugin templates) ---------- */
.tm-bs-dashboard h2 {
	font-family: var(--font-display);
	font-size: 18px;
	color: var(--tea-green);
	margin: 32px 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border);
}
.tm-bs-dashboard h2:first-child { margin-top: 0; }

.tm-bs-notice {
	background: var(--cream);
	border-left: 4px solid var(--gold);
	color: var(--tea-green-dk);
	padding: 10px 16px;
	border-radius: 4px;
	margin-bottom: 20px;
	font-size: 14px;
}

.tm-bs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin-bottom: 8px;
}
.tm-bs-table th {
	text-align: left;
	font-family: var(--font-ui);
	font-size: 12px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--text-muted);
	background: var(--surface-muted);
	padding: 10px 14px;
	border-bottom: 2px solid var(--border);
}
.tm-bs-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}
.tm-bs-table tr:last-child td { border-bottom: none; }
.tm-bs-table tr:hover td { background: var(--surface-muted); }

/* ---------- Forms & buttons (mirrors DTRDC's btn / btn--outline / btn-white pattern) ---------- */
.tm-bs-dashboard input[type="text"],
.tm-bs-dashboard input[type="email"],
.tm-bs-dashboard select,
.tm-bs-dashboard textarea {
	font-family: var(--font-ui);
	font-size: 14px;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
}
.tm-bs-dashboard input:focus,
.tm-bs-dashboard select:focus,
.tm-bs-dashboard textarea:focus {
	outline: none;
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.2);
}

.tm-bs-dashboard button,
.tm-bs-dashboard input[type="submit"] {
	font-family: var(--font-ui);
	font-size: 14px;
	font-weight: bold;
	background: var(--gold);
	color: var(--tea-green-dk);
	border: 2px solid var(--gold-dk);
	padding: 8px 18px;
	border-radius: var(--radius);
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	transition: background 0.15s ease, transform 0.1s ease;
}
.tm-bs-dashboard button:hover,
.tm-bs-dashboard input[type="submit"]:hover {
	background: var(--gold-lt);
	transform: translateY(-1px);
}

/* Secondary actions (verify/validate-and-forward is primary gold; the
   record's own "next stage" submit inside a table row reads as an outline
   button instead, so the row isn't dominated by a solid block) */
.tm-bs-table form button {
	background: transparent;
	color: var(--tea-green-dk);
	border: 2px solid var(--tea-green);
	box-shadow: none;
}
.tm-bs-table form button:hover {
	background: var(--tea-green);
	color: var(--cream);
}

/* Send-back / reject actions read as a red outline, not solid green/gold */
.tm-bs-dashboard form:has(input[name="to_status"][value="draft"]) button,
.tm-bs-dashboard form:has(input[name="decision"][value="reject"]) button {
	background: transparent;
	color: var(--mark-red);
	border: 2px solid var(--mark-red);
}
.tm-bs-dashboard form:has(input[name="to_status"][value="draft"]) button:hover,
.tm-bs-dashboard form:has(input[name="decision"][value="reject"]) button:hover {
	background: var(--mark-red);
	color: #fff;
}

.tm-bs-dashboard form { margin: 0 0 6px; }
.tm-bs-dashboard ul { padding-left: 20px; color: var(--text); }

.tm-bs-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.82em;
	font-weight: 600;
	text-transform: capitalize;
	background: var(--surface-muted);
	color: var(--text);
	border: 1px solid var(--border);
}
.tm-bs-status--draft          { background: #ece7d8; color: var(--tea-green-dk); border-color: var(--gold-lt); }
.tm-bs-status--fo_review,
.tm-bs-status--zo_review,
.tm-bs-status--ho_review      { background: #fbf1d8; color: var(--gold-dk); border-color: var(--gold); }
.tm-bs-status--publish        { background: #e3ede6; color: var(--tea-green); border-color: var(--tea-green-lt); }
.tm-bs-status--edit_pending   { background: #f6dedb; color: var(--mark-red); border-color: var(--mark-red); }

.tm-bs-hint { font-size: 0.9em; color: var(--text-muted, #556); margin: 4px 0 12px; }

.tm-bs-division-table input[type="number"] { width: 80px; }
.tm-bs-division-table input[type="text"] { width: 160px; }
.tm-bs-sum-status.tm-bs-sum-ok  { color: var(--tea-green); font-weight: 600; }
.tm-bs-sum-status.tm-bs-sum-bad { color: var(--mark-red); font-weight: 600; }

.tm-bs-diff-table { font-size: 0.88em; margin: 6px 0 10px; }
.tm-bs-diff-table th, .tm-bs-diff-table td { padding: 3px 8px; border-bottom: 1px solid var(--border); }

.tm-bs-export-link {
	display: inline-block;
	padding: 6px 14px;
	background: var(--gold);
	color: var(--tea-green-dk);
	border-radius: var(--radius);
	text-decoration: none;
	font-weight: 600;
	margin-left: 6px;
}
.tm-bs-export-link:hover { background: var(--gold-lt); }

/* ---------- Login screen ---------- */
.login #login h1 { display: none; } /* replaced by tm-bs-login-brand below, see functions.php */

.tm-bs-login-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: center;
	margin: 0 0 28px;
}
.tm-bs-login-brand-title {
	font-family: var(--font-display);
	font-size: 22px;
	color: var(--cream);
	line-height: 1.2;
}
.tm-bs-login-brand-sub {
	font-family: var(--font-ui);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gold-lt);
}

body.login {
	background: linear-gradient(160deg, var(--tea-green-dk), var(--tea-green) 70%);
}
.login form {
	border-top: 3px solid var(--gold);
	border-radius: var(--radius);
	box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.login .button-primary {
	background: var(--gold) !important;
	border-color: var(--gold-dk) !important;
	color: var(--tea-green-dk) !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
.login .button-primary:hover { background: var(--gold-lt) !important; }
.login #backtoblog, .login #nav { text-align: center; }
.login #backtoblog a, .login #nav a { color: var(--cream) !important; }

/* ---------- Stat cards ---------- */
.tm-bs-stat-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}
.tm-bs-stat-card {
	flex: 1 1 140px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
	text-align: center;
}
.tm-bs-stat-card.tm-bs-stat-highlight {
	background: var(--tea-green);
	border-color: var(--tea-green-lt);
}
.tm-bs-stat-card.tm-bs-stat-highlight .tm-bs-stat-num,
.tm-bs-stat-card.tm-bs-stat-highlight .tm-bs-stat-label {
	color: var(--cream);
}
.tm-bs-stat-num {
	display: block;
	font-family: var(--font-display);
	font-size: 2em;
	font-weight: 700;
	line-height: 1.2;
	color: var(--tea-green-dk);
}
.tm-bs-stat-label {
	display: block;
	font-size: 0.82em;
	color: var(--text-muted, #556);
	margin-top: 2px;
}

/* ---------- Detail panel ---------- */
.tm-bs-garden-detail {
	padding: 16px 12px 12px;
	background: var(--surface-muted);
	border-radius: var(--radius);
}
.tm-bs-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin-bottom: 14px;
}
.tm-bs-detail-section { margin-bottom: 14px; }
.tm-bs-detail-section h4 {
	font-family: var(--font-display);
	font-size: 0.95em;
	color: var(--tea-green);
	border-bottom: 1px solid var(--border);
	padding-bottom: 4px;
	margin: 0 0 8px;
}
.tm-bs-dl { margin: 0; }
.tm-bs-dl dt { font-size: 0.82em; color: var(--text-muted, #556); margin: 6px 0 0; }
.tm-bs-dl dd { margin: 0 0 2px; font-weight: 500; }
.tm-bs-dl-inline { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.tm-bs-dl-inline dt { font-size: 0.82em; color: var(--text-muted, #556); margin: 0; }
.tm-bs-dl-inline dd { margin: 0 14px 0 0; font-weight: 500; }
.tm-bs-detail-row td { padding: 0 !important; }

.tm-bs-table-compact { font-size: 0.88em; }
.tm-bs-table-compact th, .tm-bs-table-compact td { padding: 5px 10px; }

/* ---------- Toggle link ---------- */
a.tm-bs-toggle-detail {
	color: var(--tea-green);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px dashed var(--tea-green-lt);
}
a.tm-bs-toggle-detail:hover { color: var(--gold-dk); }

/* ---------- Search ---------- */
.tm-bs-search {
	width: 100%;
	max-width: 400px;
	margin-bottom: 10px;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 0.92em;
}

/* ---------- Buttons ---------- */
.tm-bs-btn {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--gold);
	border-radius: var(--radius);
	font-size: 0.88em;
	font-weight: 600;
	cursor: pointer;
	background: var(--gold);
	color: var(--tea-green-dk);
}
.tm-bs-btn:hover { background: var(--gold-lt); }
.tm-bs-btn-primary { background: var(--tea-green); color: var(--cream); border-color: var(--tea-green); }
.tm-bs-btn-primary:hover { background: var(--tea-green-lt); }
.tm-bs-btn-outline { background: transparent; color: var(--mark-red); border-color: var(--mark-red); }
.tm-bs-btn-outline:hover { background: var(--mark-red); color: #fff; }
.tm-bs-inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 2px 4px 2px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.tm-bs-topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
	.tm-bs-shell { padding: 20px 14px 48px; }
	.tm-bs-content-card { padding: 18px; }
	.tm-bs-table, .tm-bs-table thead, .tm-bs-table tbody, .tm-bs-table th, .tm-bs-table td, .tm-bs-table tr { display: block; }
	.tm-bs-table thead { display: none; }
	.tm-bs-table tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 8px 0; }
	.tm-bs-table td { border: none; padding: 6px 14px; }
	.tm-bs-stat-row { flex-direction: column; }
	.tm-bs-stats-row { grid-template-columns: repeat(2, 1fr); }
	.tm-bs-detail-grid { grid-template-columns: 1fr; }
	.tm-bs-inline-form { flex-wrap: wrap; }
	.tm-bs-filter-bar form { flex-wrap: wrap; }
}

/* ---------- Stats row ---------- */
.tm-bs-stats-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 16px;
	margin-bottom: 28px;
}
.tm-bs-stat-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 20px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(15, 36, 25, 0.06);
}
.tm-bs-stat-card--alert {
	border-color: var(--gold);
	background: #fbf8ee;
}
.tm-bs-stat-value {
	display: block;
	font-family: var(--font-display);
	font-size: 28px;
	font-weight: bold;
	color: var(--tea-green);
	line-height: 1.1;
}
.tm-bs-stat-card--alert .tm-bs-stat-value {
	color: var(--gold-dk);
}
.tm-bs-stat-label {
	display: block;
	font-size: 12px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-top: 4px;
}

/* ---------- Filter bar ---------- */
.tm-bs-filter-bar {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 18px;
	margin-bottom: 14px;
}
.tm-bs-filter-bar form {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.tm-bs-filter-bar select,
.tm-bs-filter-bar input[type="text"] {
	min-width: 140px;
}
.tm-bs-report-summary {
	font-size: 0.92em;
	color: var(--text-muted);
	margin: 6px 0 14px;
}
.tm-bs-report-summary .tm-bs-status {
	margin-left: 4px;
}

/* ---------- Pagination ---------- */
.tm-bs-pagination {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 16px 0;
	flex-wrap: wrap;
}
.tm-bs-pagination a,
.tm-bs-pagination strong {
	display: inline-block;
	min-width: 32px;
	text-align: center;
	padding: 4px 8px;
	border-radius: var(--radius);
	text-decoration: none;
	font-size: 13px;
}
.tm-bs-pagination a {
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--tea-green);
}
.tm-bs-pagination a:hover {
	background: var(--cream);
}
.tm-bs-pagination strong {
	background: var(--tea-green);
	color: var(--cream);
	border: 1px solid var(--tea-green);
}

/* ---------- Garden detail ---------- */
.tm-bs-garden-detail {
	animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tm-bs-detail-header {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}
.tm-bs-detail-header h2 {
	font-size: 22px;
	margin: 0 !important;
}
.tm-bs-detail-office {
	font-size: 13px;
	color: var(--text-muted);
	border: 1px solid var(--border);
	padding: 2px 10px;
	border-radius: 999px;
}

.tm-bs-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-bottom: 24px;
}
.tm-bs-detail-section {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 22px;
}
.tm-bs-detail-section h3 {
	font-family: var(--font-display);
	font-size: 15px;
	color: var(--tea-green);
	margin: 0 0 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--border);
}

.tm-bs-dl {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 6px 12px;
	margin: 0;
	font-size: 0.92em;
}
.tm-bs-dl dt {
	font-weight: 600;
	color: var(--text-muted);
}
.tm-bs-dl dd {
	margin: 0;
}

.tm-bs-table-compact th,
.tm-bs-table-compact td {
	padding: 6px 12px;
	font-size: 0.88em;
}

/* ---------- Tabs ---------- */
.tm-bs-tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid var(--border);
	margin-bottom: 16px;
}
.tm-bs-tab {
	padding: 10px 20px;
	text-decoration: none;
	color: var(--text-muted);
	font-weight: 600;
	font-size: 14px;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s;
}
.tm-bs-tab:hover { color: var(--tea-green); }
.tm-bs-tab--active {
	color: var(--tea-green);
	border-bottom-color: var(--tea-green);
}

/* ---------- Area utilisation bar ---------- */
.tm-bs-area-bar {
	height: 18px;
	background: var(--surface-muted);
	border-radius: 999px;
	overflow: hidden;
	margin: 6px 0;
	border: 1px solid var(--border);
}
.tm-bs-area-bar--inline {
	display: inline-block;
	width: 80px;
	height: 12px;
	vertical-align: middle;
	margin: 0 6px 0 0;
}
.tm-bs-area-bar-tea {
	height: 100%;
	background: var(--tea-green-lt);
	border-radius: 999px;
	font-size: 11px;
	line-height: 18px;
	padding: 0 8px;
	color: #fff;
	font-weight: 600;
	white-space: nowrap;
	text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.tm-bs-area-bar--inline .tm-bs-area-bar-tea {
	font-size: 0;
	line-height: 12px;
	padding: 0;
}

/* ---------- Collapsible sections ---------- */
.tm-bs-collapsible {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0;
	margin-bottom: 16px;
	background: var(--surface);
}
.tm-bs-collapsible > summary {
	padding: 14px 20px;
	cursor: pointer;
	user-select: none;
	border-bottom: 1px solid transparent;
}
.tm-bs-collapsible[open] > summary {
	border-bottom-color: var(--border);
}
.tm-bs-collapsible > summary h3 {
	display: inline;
	font-family: var(--font-display);
	font-size: 15px;
	color: var(--tea-green);
	margin: 0;
}
.tm-bs-collapsible > :not(summary) {
	padding: 16px 20px;
}
.tm-bs-collapsible > table {
	padding: 0;
	margin: 0;
}
.tm-bs-collapsible > .tm-bs-detail-grid {
	padding: 16px 20px;
}

/* ---------- Diff details ---------- */
.tm-bs-diff-details summary {
	cursor: pointer;
	font-size: 0.88em;
	color: var(--tea-green);
	font-weight: 600;
}
.tm-bs-diff-details[open] summary {
	margin-bottom: 6px;
}

/* ---------- Horizontal bar charts (CSS-only) ---------- */
.tm-bs-bar-chart { margin: 8px 0 12px; }
.tm-bs-bar-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 3px 0;
	font-size: 12px;
}
.tm-bs-bar-label {
	width: 80px;
	text-align: right;
	color: var(--text-muted);
	flex-shrink: 0;
}
.tm-bs-bar-track {
	flex: 1;
	height: 20px;
	background: var(--surface-muted);
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}
.tm-bs-bar-fill {
	height: 100%;
	border-radius: 3px;
	transition: width 0.3s ease;
	display: flex;
	align-items: center;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	min-width: 2px;
}
.tm-bs-bar-fill--green  { background: var(--tea-green); }
.tm-bs-bar-fill--gold   { background: var(--gold); color: var(--tea-green-dk); }
.tm-bs-bar-fill--brown  { background: #8B6914; }
.tm-bs-bar-fill--grey   { background: #999; }
.tm-bs-bar-fill--red    { background: var(--mark-red); }
.tm-bs-bar-fill--blue   { background: #3B7DD8; }
.tm-bs-bar-fill--pink   { background: #D47B93; }
.tm-bs-bar-value {
	width: 70px;
	text-align: right;
	font-weight: 600;
	flex-shrink: 0;
}

/* ---------- KPI cards in a row ---------- */
.tm-bs-kpi-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 12px;
	margin: 12px 0 16px;
}
.tm-bs-kpi {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 12px 14px;
	text-align: center;
}
.tm-bs-kpi-value {
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: bold;
	color: var(--tea-green);
	line-height: 1.1;
}
.tm-bs-kpi-label {
	font-size: 11px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-top: 2px;
}
.tm-bs-kpi--warn .tm-bs-kpi-value { color: var(--gold-dk); }
.tm-bs-kpi--bad .tm-bs-kpi-value  { color: var(--mark-red); }

/* ---------- Ratio indicator (green/amber/red) ---------- */
.tm-bs-ratio-good { color: var(--tea-green); font-weight: 600; }
.tm-bs-ratio-warn { color: var(--gold-dk); font-weight: 600; }
.tm-bs-ratio-bad  { color: var(--mark-red); font-weight: 600; }

/* ---------- Gender split mini bar ---------- */
.tm-bs-gender-bar {
	display: flex;
	height: 14px;
	border-radius: 3px;
	overflow: hidden;
	margin: 4px 0;
	font-size: 10px;
	font-weight: 600;
}
.tm-bs-gender-m { background: #3B7DD8; color: #fff; display: flex; align-items: center; padding: 0 4px; }
.tm-bs-gender-f { background: #D47B93; color: #fff; display: flex; align-items: center; padding: 0 4px; }

/* ---------- Two-tone summary card ---------- */
.tm-bs-summary-card {
	background: linear-gradient(135deg, var(--tea-green-dk) 0%, var(--tea-green) 100%);
	color: var(--cream);
	border-radius: var(--radius);
	padding: 20px 24px;
	margin-bottom: 16px;
}
.tm-bs-summary-card h2 { color: var(--cream); margin: 0 0 12px; font-size: 18px; border: none; }
.tm-bs-summary-card .tm-bs-kpi { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.tm-bs-summary-card .tm-bs-kpi-value { color: var(--cream); }
.tm-bs-summary-card .tm-bs-kpi-label { color: rgba(255,255,255,0.7); }

@media (max-width: 768px) {
	.tm-bs-kpi-row { grid-template-columns: repeat(2, 1fr); }
	.tm-bs-bar-label { width: 60px; font-size: 11px; }
}
