/* Poultry Farm Management System - Frontend Portal Styles
   Prefixed with .pfms- to avoid any conflict with the active theme. */

html, body.pfms-portal-body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background: #f1f5f9;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1f2937;
}

.pfms-portal-shell {
	width: 100%;
	min-height: 100vh;
	box-sizing: border-box;
	padding: 24px;
}

.pfms-portal-login {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1d3557 0%, #2a5298 100%);
}

.pfms-login-box {
	background: #fff;
	border-radius: 10px;
	padding: 40px;
	max-width: 400px;
	width: 100%;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
	.pfms-portal-shell {
		padding: 12px;
	}
	.pfms-login-box {
		padding: 24px;
	}
}

/* ---- Dashboard shell ---- */

.pfms-portal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #1d3557;
	color: #fff;
	padding: 14px 20px;
	border-radius: 8px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 8px;
}

.pfms-portal-header a {
	color: #fff;
}

.pfms-logout-btn {
	display: inline-block;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #ffffff !important;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.pfms-logout-btn:hover,
.pfms-logout-btn:focus {
	background: rgba(255, 255, 255, 0.26);
	color: #ffffff !important;
}

.pfms-portal-subtle {
	color: rgba(255, 255, 255, 0.7);
	font-size: 13px;
	margin-left: 8px;
}

.pfms-dashboard-shell .pfms-house-card .pfms-portal-subtle {
	color: #6b7280;
}

.pfms-houses-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.pfms-house-card {
	background: #fff;
	border-radius: 8px;
	padding: 18px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pfms-house-card h2 {
	margin-top: 0;
	font-size: 17px;
}

.pfms-house-metrics {
	display: flex;
	justify-content: space-between;
	margin: 12px 0;
	text-align: center;
}

.pfms-house-metrics div {
	flex: 1;
}

.pfms-house-metrics span {
	display: block;
	font-size: 11px;
	color: #6b7280;
	text-transform: uppercase;
}

.pfms-house-metrics strong {
	font-size: 16px;
	color: #1d3557;
}

.pfms-slot-status {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.pfms-slot {
	flex: 1;
	border-radius: 6px;
	padding: 8px;
	text-align: center;
	font-size: 12px;
}

.pfms-slot span {
	display: block;
	opacity: 0.8;
}

.pfms-slot strong {
	display: block;
	margin-top: 2px;
}

.pfms-badge-success { background: #d1fae5; color: #065f46; }
.pfms-badge-warning { background: #fef3c7; color: #92400e; }
.pfms-badge-danger  { background: #fee2e2; color: #991b1b; }

.pfms-stock-details {
	margin-bottom: 12px;
	font-size: 13px;
}

.pfms-mini-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 6px;
}

.pfms-mini-table td {
	padding: 4px 0;
	border-bottom: 1px solid #f1f5f9;
}

.pfms-btn {
	display: inline-block;
	border: none;
	border-radius: 6px;
	padding: 10px 16px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}

.pfms-btn-block { width: 100%; }
.pfms-btn-small { padding: 6px 10px; font-size: 12px; }
.pfms-btn-primary { background: #1d3557; color: #fff; }
.pfms-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.pfms-btn-secondary { background: #e5e7eb; color: #1f2937; }

.pfms-alert {
	padding: 10px 14px;
	border-radius: 6px;
	margin: 10px 0;
	font-size: 14px;
}

.pfms-alert-error { background: #fee2e2; color: #991b1b; }
.pfms-alert-warning { background: #fef3c7; color: #92400e; }
.pfms-alert-success { background: #d1fae5; color: #065f46; }

/* ---- Login form fields ---- */

.pfms-field { text-align: left; margin-bottom: 14px; }
.pfms-field label { display: block; font-size: 13px; margin-bottom: 4px; color: #374151; }
.pfms-field input[type="text"],
.pfms-field input[type="password"],
.pfms-field input[type="number"],
.pfms-field input[type="date"],
.pfms-field input[type="time"],
.pfms-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 15px;
}

.pfms-field-inline { display: flex; align-items: center; gap: 6px; }
.pfms-field-inline label { display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
.pfms-field-label { display: block; font-size: 13px; margin-bottom: 6px; color: #374151; font-weight: 600; }
.pfms-field-inline-group { display: flex; gap: 16px; }
.pfms-field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.pfms-field-row .pfms-field { flex: 1; min-width: 160px; }

/* ---- Modal ---- */

.pfms-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 24px 12px;
}

.pfms-modal {
	background: #fff;
	border-radius: 10px;
	max-width: 560px;
	width: 100%;
	padding: 20px;
	box-sizing: border-box;
}

.pfms-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.pfms-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	line-height: 1;
}

.pfms-product-row {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
	align-items: center;
}

.pfms-product-select { flex: 2; padding: 8px; border-radius: 6px; border: 1px solid #d1d5db; }
.pfms-product-qty { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid #d1d5db; min-width: 0; }

/* ---- Entries table ---- */

.pfms-table-scroll { overflow-x: auto; }

.pfms-entries-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.pfms-entries-table th,
.pfms-entries-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #f1f5f9;
	font-size: 13px;
}

.pfms-entries-table th {
	background: #f8fafc;
	text-transform: uppercase;
	font-size: 11px;
	color: #6b7280;
}

@media (max-width: 640px) {
	.pfms-entries-table thead { display: none; }
	.pfms-entries-table, .pfms-entries-table tbody, .pfms-entries-table tr, .pfms-entries-table td {
		display: block;
		width: 100%;
	}
	.pfms-entries-table tr {
		margin-bottom: 10px;
		border: 1px solid #f1f5f9;
		border-radius: 6px;
		padding: 8px;
	}
	.pfms-entries-table td {
		border: none;
		padding: 4px 0;
	}
	.pfms-entries-table td::before {
		content: attr(data-label);
		font-weight: 600;
		display: inline-block;
		width: 110px;
		color: #6b7280;
		font-size: 11px;
		text-transform: uppercase;
	}
}
