:root {
	--brand: #2e8b57;
	--brand-700: #1f6a42;
	--brand-100: #e7f3ec;
	--bg: #f4f7f5;
	--text: #1f2937;
	--muted: #6b7280;
	--card: #ffffff;
	--border: #e5e7eb;
	--shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
	--shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.06);
}

* {
	box-sizing: border-box;
}

body {
	font-family: "Segoe UI", Tahoma, sans-serif;
	background: var(--bg);
	color: var(--text);
	margin: 0;
}

a {
	color: inherit;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 16px 28px;
	background: var(--card);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow-soft);
	position: sticky;
	top: 0;
	z-index: 10;
}

.topbar .brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.topbar .brand img {
	display: block;
	width: auto;
	height: 42px;
	object-fit: contain;
}

.topbar nav {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.topbar a {
	text-decoration: none;
	color: var(--text);
	font-weight: 600;
	font-size: 0.95rem;
	padding: 6px 8px;
	border-radius: 8px;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.topbar a.profile-link {
	gap: 8px;
}

.topbar-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--border);
}

.topbar a .nav-icon {
	width: 18px;
	height: 18px;
	display: inline-block;
	flex-shrink: 0;
	vertical-align: -2px;
	color: var(--brand-700);
}

.filters-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	align-items: end;
}

.filters-grid .filter-field label {
	margin-top: 0;
	font-size: 0.85rem;
	color: var(--muted);
}

.filters-grid .filter-field input,
.filters-grid .filter-field select {
	margin-top: 4px;
}

.topbar a:hover {
	background: var(--brand-100);
	color: var(--brand-700);
}

.topbar form {
	margin: 0;
}

.content {
	padding: 28px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.card {
	background: var(--card);
	padding: 18px 20px;
	border-radius: 14px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.card h2 {
	margin-top: 0;
	margin-bottom: 12px;
}

table {
	width: 100%;
	border-collapse: collapse;
	background: var(--card);
}

thead th {
	background: #f0f5f2;
	color: #334155;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 0.75rem;
}

th, td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

tbody tr:hover {
	background: #f8fafc;
}

tr.low-rating {
	background: #fef2f2;
}

label {
	display: block;
	margin-top: 12px;
	font-weight: 600;
	color: #334155;
}

input, select, textarea, button {
	font: inherit;
}

input, select, textarea {
	width: 100%;
	padding: 10px 12px;
	margin-top: 6px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.18);
	outline: none;
}

button {
	margin-top: 12px;
	padding: 10px 16px;
	border: none;
	border-radius: 10px;
	background: var(--brand);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	box-shadow: 0 8px 16px rgba(46, 139, 87, 0.2);
}

button:hover {
	background: var(--brand-700);
	transform: translateY(-1px);
}

button:active {
	transform: translateY(0);
}

.link-button {
	background: none;
	color: var(--brand-700);
	padding: 0;
	margin: 0;
	text-decoration: underline;
	box-shadow: none;
}

.password-field {
	display: flex;
	gap: 8px;
	align-items: center;
}

.password-field input {
	flex: 1;
}

.password-toggle {
	background: #f0f5f2;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 8px 12px;
	margin-top: 6px;
}

.badge-warning { color: #b45309; font-weight: 700; }
.badge-success { color: #1f6a42; font-weight: 700; }
.badge-danger { color: #b91c1c; font-weight: 700; }
.badge-info { color: #0ea5e9; font-weight: 700; }
.badge-secondary { color: #6b7280; font-weight: 700; }

.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.status-agendada {
	background: #dbeafe;
	color: #1d4ed8;
}

.status-concluida {
	background: #dcfce7;
	color: #166534;
}

.status-cancelada {
	background: #fef9c3;
	color: #a16207;
}

.status-nao_compareceu {
	background: #fee2e2;
	color: #b91c1c;
}

.photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.hidden {
	display: none;
}

.muted {
	color: var(--muted);
	font-size: 0.9rem;
}

.alert {
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 12px;
	border: 1px solid transparent;
	font-weight: 600;
}

.alert-error {
	background: #fee2e2;
	border-color: #fecaca;
	color: #991b1b;
}

.alert-success {
	background: #dcfce7;
	border-color: #bbf7d0;
	color: #166534;
}

.terms {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 12px;
}

.terms input {
	width: auto;
	margin: 0;
}

.terms-details {
	margin-top: 8px;
	padding: 10px 14px;
	background: #f0f5f2;
	border-radius: 10px;
	border: 1px solid #dfe7e2;
}

.terms-details summary {
	cursor: pointer;
	font-weight: 600;
}

.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
}

.kpi-card {
	background: var(--card);
	border-radius: 14px;
	padding: 16px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow-soft);
}

.kpi-card h3 {
	margin: 0 0 6px 0;
	font-size: 0.85rem;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.kpi-card .value {
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--text);
}

.chart-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
}

.chart-card {
	background: var(--card);
	border-radius: 14px;
	padding: 14px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow-soft);
}

.list-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
}

.list-card {
	background: var(--card);
	border-radius: 14px;
	padding: 14px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow-soft);
}

.list-card h3 {
	margin-top: 0;
	margin-bottom: 10px;
	color: #1f2937;
}

.list-card table {
	margin-top: 8px;
}

.site-footer {
	margin-top: 24px;
	padding: 18px 28px;
	color: var(--muted);
	border-top: 1px solid var(--border);
	background: var(--card);
}

.site-footer .footer-inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 0.9rem;
	text-align: center;
}

.site-footer .footer-links {
	display: flex;
	gap: 16px;
}

.site-footer a {
	color: var(--brand-700);
	text-decoration: none;
	font-weight: 600;
}

.site-footer a:hover {
	text-decoration: underline;
}

.notif-menu {
	position: relative;
}

.notif-menu summary {
	list-style: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: #f8fafc;
	color: var(--brand-700);
	font-weight: 600;
}

.notif-menu summary:hover {
	background: var(--brand-100);
}

.notif-menu summary::-webkit-details-marker {
	display: none;
}

.notif-badge {
	background: #ef4444;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 999px;
	line-height: 1;
}

.notif-panel {
	position: absolute;
	right: 0;
	top: 38px;
	width: 340px;
	max-height: 360px;
	overflow: auto;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: var(--shadow);
	padding: 12px;
	z-index: 20;
}

.notif-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-weight: 700;
}

.notif-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
	border-bottom: none;
}

.notif-item button {
	margin-top: 0;
	padding: 6px 10px;
	font-size: 0.8rem;
}

.notif-message {
	font-weight: 600;
}

.notif-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin-top: 14px;
}

.pagination a,
.pagination span {
	padding: 6px 10px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #fff;
	text-decoration: none;
	color: #0f172a;
	font-weight: 600;
}

.pagination .active {
	background: var(--brand);
	color: #fff;
	border-color: var(--brand);
}

.supplier-cell {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.avatar-mini {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--border);
}

.profile-photo-wrap {
	margin-bottom: 10px;
}

.profile-photo {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	border: 1px solid var(--border);
	object-fit: cover;
}

.profile-photo-fallback {
	display: grid;
	place-items: center;
	background: #f0f5f2;
	color: #475569;
	font-size: 0.8rem;
}

.error-shell {
	min-height: calc(100vh - 92px);
	display: grid;
	place-items: center;
	padding: 24px;
}

.error-card {
	width: min(900px, 100%);
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 20px;
	box-shadow: var(--shadow);
	padding: 32px;
	text-align: center;
}

.error-code {
	font-size: clamp(3rem, 10vw, 6rem);
	line-height: 1;
	font-weight: 800;
	color: #2563eb;
	margin: 8px 0 12px;
}

.error-title {
	margin: 0;
	font-size: 2rem;
	color: #0f172a;
}

.error-text {
	margin: 12px auto 24px;
	max-width: 680px;
	color: #64748b;
	font-size: 1.1rem;
}

.error-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}

.button-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--brand-700);
	text-decoration: none;
	font-weight: 600;
}

.button-ghost:hover {
	background: var(--brand-100);
}

.maintenance-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	background: #ffedd5;
	color: #9a3412;
	font-size: 0.85rem;
	font-weight: 700;
}
