/*
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.1.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: 1080px;
	margin: 0 auto;
	padding: 32px 24px 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); }

/* ---------- 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; }

/* ---------- 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; }
}
