/* admin.css - Estilos para Login e Painel Administrativo Canaã Soluções Agrícolas */

/* ==========================================================================
   PÁGINA DE LOGIN
   ========================================================================== */
.login-body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #2e1065 100%);
	padding: 1.5rem;
	color: var(--brand-dark);
}

.login-card {
	width: 100%;
	max-width: 440px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
	padding: 2.5rem 2rem;
	position: relative;
	overflow: hidden;
}

.login-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	background: linear-gradient(90deg, #6329A2 0%, var(--brand-green) 100%);
}

.login-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	margin-bottom: 2rem;
}

.login-logo {
	max-width: 180px;
	height: auto;
	margin: 0 auto 1.25rem;
	display: block;
}

.login-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: #1f2937;
	margin-bottom: 0.35rem;
}

.login-subtitle {
	font-size: 0.9rem;
	color: var(--gray-500);
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	text-align: left;
}

.form-group label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #374151;
}

.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.form-control {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 0.95rem;
	font-family: inherit;
	color: #1f2937;
	background: #f9fafb;
	transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control:focus {
	outline: none;
	border-color: #6329A2;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(99, 41, 162, 0.15);
}

.toggle-password-btn {
	position: absolute;
	right: 0.75rem;
	background: none;
	border: none;
	color: var(--gray-500);
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
}

.toggle-password-btn:hover {
	color: #6329A2;
}

.login-btn {
	margin-top: 0.5rem;
	padding: 0.85rem 1.5rem;
	border: none;
	border-radius: 8px;
	background: #6329A2;
	color: #ffffff;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.1s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.login-btn:hover {
	background: #4e1f82;
}

.login-btn:active {
	transform: scale(0.99);
}

.login-alert {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.875rem;
	display: none;
	align-items: center;
	margin-bottom: 1rem;
}

.login-alert.error {
	background-color: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.login-alert.info {
	background-color: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.login-footer {
	margin-top: 2rem;
	text-align: center;
	border-top: 1px solid #e5e7eb;
	padding-top: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.login-footer a {
	color: #6329A2;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
}

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

.credentials-hint {
	background: #f3f4f6;
	border-radius: 8px;
	padding: 0.75rem;
	font-size: 0.8rem;
	color: #4b5563;
	border-left: 3px solid #6329A2;
	text-align: left;
}

.credentials-hint strong {
	color: #1f2937;
}

/* ==========================================================================
   PAINEL ADMINISTRATIVO (DASHBOARD)
   ========================================================================== */
.admin-body {
	background-color: #f8fafc;
	min-height: 100vh;
	color: #1e293b;
	display: flex;
	flex-direction: column;
}

/* Admin Top Bar */
.admin-navbar {
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-nav-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0.75rem 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.admin-brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	text-decoration: none;
}

.admin-logo {
	height: 38px;
	width: auto;
}

.admin-badge {
	background: #ede9fe;
	color: #6329A2;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 6px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.admin-nav-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.admin-btn {
	padding: 0.55rem 1rem;
	border-radius: 7px;
	font-size: 0.875rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	transition: all 0.2s;
	text-decoration: none;
	border: 1px solid transparent;
}

.admin-btn-primary {
	background: #6329A2;
	color: #ffffff;
}

.admin-btn-primary:hover {
	background: #4e1f82;
}

.admin-btn-outline {
	background: #ffffff;
	border-color: #cbd5e1;
	color: #475569;
}

.admin-btn-outline:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.admin-btn-danger {
	background: #fee2e2;
	border-color: #fecaca;
	color: #b91c1c;
}

.admin-btn-danger:hover {
	background: #fecaca;
}

.admin-btn-success {
	background: #16a34a;
	color: #ffffff;
}

.admin-btn-success:hover {
	background: #15803d;
}

/* Admin Main Layout */
.admin-main {
	max-width: 1400px;
	width: 100%;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* Metric Cards */
.metrics-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.25rem;
}

.metric-card {
	background: #ffffff;
	padding: 1.25rem;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	display: flex;
	align-items: center;
	gap: 1rem;
	transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}

.metric-icon {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	flex-shrink: 0;
}

.metric-icon.total { background: #ede9fe; color: #6329A2; }
.metric-icon.fertilizantes { background: #dcfce7; color: #16a34a; }
.metric-icon.adubos { background: #fef3c7; color: #d97706; }
.metric-icon.defensivos { background: #fee2e2; color: #dc2626; }
.metric-icon.implementos { background: #e0f2fe; color: #0284c7; }

.metric-info {
	display: flex;
	flex-direction: column;
}

.metric-value {
	font-size: 1.75rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.2;
}

.metric-label {
	font-size: 0.825rem;
	color: #64748b;
	font-weight: 500;
}

/* Management Section */
.content-card {
	background: #ffffff;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	overflow: hidden;
}

.content-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	align-items: center;
}

.content-title-wrapper h2 {
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 0.2rem;
}

.content-title-wrapper p {
	font-size: 0.875rem;
	color: #64748b;
}

.content-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
}

/* Filters & Toolbar */
.toolbar-section {
	padding: 1rem 1.5rem;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	align-items: center;
}

.search-box {
	position: relative;
	width: 100%;
	max-width: 320px;
}

.search-box input {
	width: 100%;
	padding: 0.55rem 0.85rem 0.55rem 2.2rem;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 0.875rem;
	font-family: inherit;
	background: #ffffff;
}

.search-box input:focus {
	outline: none;
	border-color: #6329A2;
	box-shadow: 0 0 0 2px rgba(99, 41, 162, 0.15);
}

.search-icon {
	position: absolute;
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 0.9rem;
	pointer-events: none;
}

.category-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.tab-btn {
	padding: 0.45rem 0.85rem;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	color: #64748b;
	font-size: 0.825rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.tab-btn:hover {
	border-color: #cbd5e1;
	color: #1e293b;
}

.tab-btn.active {
	background: #6329A2;
	border-color: #6329A2;
	color: #ffffff;
}

/* Products Table */
.table-responsive {
	overflow-x: auto;
}

.products-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 0.875rem;
}

.products-table th {
	background: #f8fafc;
	padding: 0.85rem 1.25rem;
	font-weight: 600;
	color: #475569;
	border-bottom: 1px solid #e2e8f0;
	white-space: nowrap;
}

.products-table td {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: middle;
}

.products-table tr:hover {
	background-color: #f8fafc;
}

.product-thumb-container {
	width: 52px;
	height: 52px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	padding: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.product-thumb {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.product-title-cell strong {
	color: #0f172a;
	font-size: 0.925rem;
	display: block;
	margin-bottom: 0.15rem;
}

.product-desc-cell {
	color: #64748b;
	font-size: 0.825rem;
	max-width: 320px;
	white-space: pre-line;
}

.category-tag {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: capitalize;
}

.category-tag.fertilizantes { background: #dcfce7; color: #166534; }
.category-tag.adubos { background: #fef3c7; color: #92400e; }
.category-tag.defensivos { background: #fee2e2; color: #991b1b; }
.category-tag.implementos { background: #e0f2fe; color: #075985; }

.table-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.btn-icon {
	width: 34px;
	height: 34px;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s;
	color: #475569;
}

.btn-icon.edit:hover {
	background: #ede9fe;
	border-color: #c4b5fd;
	color: #6329A2;
}

.btn-icon.delete:hover {
	background: #fee2e2;
	border-color: #fecaca;
	color: #dc2626;
}

.empty-state {
	padding: 3.5rem 1.5rem;
	text-align: center;
	color: #64748b;
}

.empty-state p {
	font-size: 1rem;
	margin-bottom: 1rem;
}

/* ==========================================================================
   MODAIS
   ========================================================================== */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.modal-container {
	background: #ffffff;
	border-radius: 14px;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	transform: translateY(15px);
	transition: transform 0.2s;
}

.modal-overlay.active .modal-container {
	transform: translateY(0);
}

.modal-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h3 {
	font-size: 1.2rem;
	font-weight: 700;
	color: #0f172a;
}

.modal-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	color: #94a3b8;
	cursor: pointer;
	line-height: 1;
	padding: 4px;
}

.modal-close:hover {
	color: #0f172a;
}

.modal-body {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.modal-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid #e2e8f0;
	background: #f8fafc;
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	border-radius: 0 0 14px 14px;
}

/* Card Preview no Modal */
.preview-box {
	background: #f1f5f9;
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
	padding: 1rem;
	text-align: center;
}

.preview-box-title {
	font-size: 0.75rem;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	margin-bottom: 0.75rem;
}

.preview-card-wrapper {
	max-width: 200px;
	margin: 0 auto;
}

/* Toast Notifications */
.toast-container {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.toast {
	padding: 0.85rem 1.25rem;
	border-radius: 8px;
	color: #ffffff;
	font-size: 0.875rem;
	font-weight: 500;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	animation: toast-slide 0.3s ease forwards;
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #6329A2; }

@keyframes toast-slide {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
	.admin-nav-container {
		flex-direction: column;
		align-items: stretch;
	}

	.admin-nav-actions {
		justify-content: space-between;
	}

	.content-header {
		flex-direction: column;
		align-items: stretch;
	}

	.content-actions {
		justify-content: stretch;
	}

	.content-actions .admin-btn {
		flex: 1;
		justify-content: center;
	}

	.toolbar-section {
		flex-direction: column;
		align-items: stretch;
	}

	.search-box {
		max-width: 100%;
	}
}
