/* ================================================================
   PRIME BAKES APPLICATION STYLESHEET
   ================================================================ */

:root {
	/* Colors */
	--primary-blue: #3b82f6;
	--dark-blue: #1e40af;
	--red: #dc2626;
	--bright-red: #ef4444;
	--error-red: #e50000;
	--green: #059669;
	--success-green: #26b050;
	/* Grays */
	--gray-50: #f8fafc;
	--gray-100: #f1f5f9;
	--gray-200: #e2e8f0;
	--gray-300: #cbd5e1;
	--gray-400: #94a3b8;
	--gray-500: #64748b;
	--gray-600: #475569;
	--gray-700: #334155;
	--gray-800: #1e293b;
	--gray-900: #0f172a;
	/* Backgrounds */
	--bg-white: #ffffff;
	--bg-light: #fafbfc;
	--bg-blue-light: #eff6ff;
	--bg-summary: #deecf9;
	/* Spacing */
	--border-radius: 6px;
	--border-radius-lg: 12px;
}

/* ================================================================
   1. BASE STYLES & RESET
   ================================================================ */
html,
body {
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a,
.btn-link {
	color: #006bb7;
}

	.btn:focus,
	.btn:active:focus,
	.btn-link.nav-link:focus,
	.form-control:focus,
	.form-check-input:focus {
		box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
	}

h1:focus {
	outline: none;
}

/* ================================================================
   2. FORM VALIDATION & ERROR STATES
   ================================================================ */
.valid.modified:not([type=checkbox]) {
	outline: 1px solid var(--success-green);
}

.invalid {
	outline: 1px solid var(--error-red);
}

.validation-message {
	color: var(--error-red);
}

.blazor-error-boundary {
	background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjw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NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
	padding: 1rem 1rem 1rem 3.7rem;
	color: white;
}

	.blazor-error-boundary::after {
		content: "An error has occurred."
	}

/* ================================================================
   3. PAGE LAYOUT & CONTAINERS
   ================================================================ */
.page-container {
	padding: 16px 32px;
	width: 100%;
	margin: 0 auto;
	background: linear-gradient(135deg, #ffeef5 0%, #fff5f9 100%);
	flex: 1;
}

.page-shell {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

/* Grid Action Buttons Container - used in all grids */
.grid-actions {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

/* Header Actions Container */
.header-actions {
	display: flex;
	gap: 12px;
	align-items: center;
}

/* ================================================================
   4. SECTION CARDS
   Common card container for page sections
   ================================================================ */
.section-card {
	background: var(--bg-white);
	border-radius: var(--border-radius-lg);
	border: 1px solid var(--gray-200);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	margin-bottom: 16px;
	overflow: hidden;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid var(--gray-200);
	background: linear-gradient(to bottom, var(--bg-white) 0%, var(--gray-50) 100%);
}

.section-title-wrapper {
	display: flex;
	align-items: center;
	gap: 12px;
}

.section-icon {
	color: var(--primary-blue);
	flex-shrink: 0;
}

.section-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--gray-900);
	margin: 0;
	letter-spacing: -0.2px;
}

.section-subtitle {
	font-size: 13px;
	color: var(--gray-500);
	margin: 0;
	padding-left: 34px;
	font-weight: 400;
}

.section-body {
	padding: 16px 20px;
}

.grid-body {
	padding: 0 !important;
}

/* ================================================================
   5. FORM FIELDS & LABELS
   ================================================================ */
.form-field,
.cart-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.field-label,
.cart-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--gray-600);
	letter-spacing: 0.1px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.cart-label {
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.required {
	color: var(--bright-red);
	font-weight: 700;
	margin-left: 2px;
}

/* ================================================================
   6. FORM GRID LAYOUTS
   ================================================================ */
.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
	gap: 16px 20px;
	align-items: start;
}

/* ================================================================
   7. SYNCFUSION INPUT COMPONENTS
   ================================================================ */
.custom-numeric .e-input {
	text-align: right;
}

.custom-numeric {
	padding-right: 16px;
}

.custom-autocomplete,
.custom-datepicker,
.custom-textbox,
.custom-numeric,
.custom-daterange {
	width: 100%;
}

	.custom-autocomplete .e-input-group,
	.custom-datepicker .e-input-group,
	.custom-textbox .e-input-group,
	.custom-numeric .e-input-group,
	.custom-daterange .e-input-group {
		border: 1px solid var(--gray-300);
		border-radius: var(--border-radius);
		background: var(--bg-white);
		transition: all 0.2s ease;
		height: 40px;
	}

		.custom-autocomplete .e-input-group:hover,
		.custom-datepicker .e-input-group:hover,
		.custom-textbox .e-input-group:hover,
		.custom-numeric .e-input-group:not(.e-disabled):hover,
		.custom-daterange .e-input-group:hover {
			border-color: var(--gray-400);
		}

		.custom-autocomplete .e-input-group.e-input-focus,
		.custom-datepicker .e-input-group.e-input-focus,
		.custom-textbox .e-input-group.e-input-focus,
		.custom-numeric .e-input-group.e-input-focus,
		.custom-daterange .e-input-group.e-input-focus {
			border-color: var(--primary-blue);
			box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
		}

		.custom-autocomplete .e-input-group input,
		.custom-datepicker .e-input-group input,
		.custom-textbox .e-input-group input,
		.custom-textbox .e-input-group textarea,
		.custom-numeric .e-input-group input,
		.custom-daterange .e-input-group input {
			font-size: 14px;
			color: var(--gray-800);
			padding: 8px 12px;
		}

		.custom-numeric .e-input-group input {
			text-align: right;
		}

			.custom-autocomplete .e-input-group input::placeholder,
			.custom-datepicker .e-input-group input::placeholder,
			.custom-textbox .e-input-group input::placeholder,
			.custom-textbox .e-input-group textarea::placeholder,
			.custom-numeric .e-input-group input::placeholder,
			.custom-daterange .e-input-group input::placeholder {
				color: var(--gray-400);
			}

.readonly-field .e-input-group {
	background: var(--gray-50);
	cursor: not-allowed;
}

	.readonly-field .e-input-group input {
		color: var(--gray-500);
		font-weight: 500;
	}

/* ================================================================
   8. SYNCFUSION DROPDOWNS & AUTOCOMPLETE
   ================================================================ */
.e-popup .e-dropdownbase .e-list-item.e-item-focus,
.e-popup .e-dropdownbase .e-list-item.e-active,
.e-popup .e-dropdownbase .e-list-item.e-active.e-hover,
.e-popup .e-dropdownbase .e-list-item.e-hover,
.e-dropdownbase .e-list-item.e-item-focus,
.e-dropdownbase .e-list-item.e-active,
.e-dropdownbase .e-list-item.e-active.e-hover,
.e-dropdownbase .e-list-item.e-hover,
.e-ddl.e-popup .e-list-item.e-item-focus,
.e-ddl.e-popup .e-list-item.e-active,
.e-ddl.e-popup .e-list-item.e-hover,
.e-autocomplete.e-popup .e-list-item.e-item-focus,
.e-autocomplete.e-popup .e-list-item.e-active,
.e-autocomplete.e-popup .e-list-item.e-hover {
	background-color: var(--primary-blue) !important;
	color: var(--bg-white) !important;
}

/* ================================================================
   9. SYNCFUSION GRID (PROFESSIONAL GRID)
   ================================================================ */
.professional-grid {
	border: none;
}

	.professional-grid .e-gridheader {
		background: linear-gradient(to bottom, var(--gray-50) 0%, var(--gray-100) 100%);
		border-bottom: 2px solid var(--gray-200);
	}

	.professional-grid .e-headercell {
		background: transparent;
		color: var(--gray-600);
		font-weight: 600;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.3px;
		border-right: 1px solid var(--gray-200);
		padding: 12px 8px;
	}

		.professional-grid .e-headercell:last-child,
		.professional-grid .e-rowcell:last-child,
		.professional-grid .e-summarycell:last-child {
			border-right: none;
		}

	.professional-grid .e-gridcontent {
		background: var(--bg-white);
	}

	.professional-grid .e-row {
		transition: background-color 0.2s ease;
	}

		.professional-grid .e-row:hover,
		.professional-grid .e-row.e-altrow:hover {
			background-color: var(--gray-50);
		}

		.professional-grid .e-row.e-altrow {
			background-color: var(--bg-light);
		}

	.professional-grid .e-rowcell {
		border-right: 1px solid var(--gray-100);
		border-bottom: 1px solid var(--gray-100);
		padding: 10px 8px;
		font-size: 13px;
		color: var(--gray-800);
	}

	.professional-grid .e-gridfooter {
		background-color: var(--bg-summary) !important;
		border-top: 2px solid var(--gray-300);
	}

	.professional-grid .e-summarycell {
		background-color: var(--bg-summary) !important;
		font-weight: 600;
		color: var(--gray-800);
		padding: 12px 8px;
		border-right: 1px solid var(--gray-300);
	}

	.professional-grid .e-emptyrow {
		text-align: center;
		padding: 48px 24px;
		color: var(--gray-400);
		font-size: 14px;
	}

	.e-grid .e-gridfooter,
	.e-grid .e-summaryrow,
	.e-grid .e-summaryrow .e-summarycell,
	.professional-grid .e-gridfooter,
	.professional-grid .e-summaryrow,
	.professional-grid .e-summarycell {
		background-color: var(--bg-summary) !important;
	}

/* ================================================================
   10. GRID CELL VALUES & AGGREGATES
   ================================================================ */
/* Cell Value Colors */
.grid-discount,
.grid-debit {
	color: var(--red);
	font-weight: 600;
}

.grid-credit {
	color: var(--green);
	font-weight: 600;
}

.grid-total {
	color: var(--dark-blue);
	font-weight: 700;
	font-size: 14px;
}

.grid-checkbox {
	display: inline-block;
	width: 20px;
	height: 20px;
	line-height: 20px;
	text-align: center;
	border-radius: 4px;
	font-weight: 700;
	font-size: 14px;
}

/* Aggregate Labels and Values */
.aggregate-label {
	text-align: left;
	font-size: 13px;
	color: var(--gray-600);
}

	.aggregate-label strong,
	.aggregate-value strong {
		font-weight: 700;
	}

.aggregate-value {
	text-align: right;
	font-size: 13px;
	color: var(--gray-800);
}

	.aggregate-value.aggregate-discount,
	.aggregate-value.aggregate-debit {
		color: var(--red);
	}

	.aggregate-value.aggregate-credit {
		color: var(--green);
	}

	.aggregate-value.aggregate-total {
		color: var(--dark-blue);
		font-size: 14px;
	}

		.aggregate-value.aggregate-total strong {
			font-size: 15px;
		}

/* ================================================================
   11. FILTERS & REPORT LAYOUTS
   ================================================================ */
.filters-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

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

/* Grid Section (for side-by-side grids) */
.grid-section {
	background: var(--bg-white);
	border-radius: 8px;
	border: 1px solid var(--gray-200);
	overflow: hidden;
}

.grid-section-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	background: linear-gradient(to bottom, var(--gray-50) 0%, var(--gray-100) 100%);
	border-bottom: 2px solid var(--gray-200);
}

.grid-section-icon {
	flex-shrink: 0;
}

.grid-section-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--gray-900);
	margin: 0;
}

.grid-section-count {
	font-size: 12px;
	color: var(--gray-500);
	margin-left: auto;
}

/* ================================================================
   12. TRANSACTION PAGE LAYOUTS
   ================================================================ */
/* Two Column Layout (75-25 split) */
.two-column-layout {
	display: flex;
	gap: 16px;
	margin-bottom: 16px;
}

	.two-column-layout > :first-child {
		flex: 0 0 75%;
	}

	.two-column-layout > :last-child {
		flex: 0 0 calc(25% - 16px);
	}

/* Transaction Number with Auto-generate Checkbox */
.transaction-no-wrapper {
	display: flex;
	gap: 12px;
	align-items: stretch;
}

	.transaction-no-wrapper > :first-child {
		flex: 1;
	}

/* Financial Grid Layout */
.financial-grid {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.financial-row,
.financial-row-dual {
	display: grid;
	grid-template-columns: 100px 1fr;
	align-items: center;
	gap: 10px;
}

.dual-inputs {
	display: grid;
	grid-template-columns: 1.5fr 1.5fr;
	gap: 8px;
	align-items: center;
}

.financial-divider {
	height: 1px;
	background: var(--gray-200);
	margin: 8px 0;
}

.financial-row.total-row {
	margin-top: 4px;
	padding-top: 8px;
	border-top: 2px solid var(--gray-200);
}

.financial-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--gray-600);
	text-align: right;
	white-space: nowrap;
}

.financial-label-total {
	font-size: 14px;
	font-weight: 700;
	color: var(--gray-900);
	text-align: right;
	white-space: nowrap;
}

/* Transaction Date and Financial Year Wrapper */
.date-year-wrapper {
	display: flex;
	gap: 12px;
	align-items: stretch;
}

	.date-year-wrapper > * {
		flex: 1;
	}

/* Reference Wrapper */
.reference-wrapper {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

	.reference-wrapper > :first-child {
		flex: 1;
	}

.reference-actions {
	display: flex;
	gap: 6px;
	align-items: center;
}

/* Checkbox Wrapper */
.checkbox-wrapper {
	height: 32px;
	display: flex;
	align-items: center;
	padding: 0 12px;
	background: var(--gray-50);
	border: 1px solid var(--gray-300);
	border-radius: var(--border-radius);
	white-space: nowrap;
}

	.checkbox-wrapper .custom-checkbox {
		font-size: 13px;
		font-weight: 500;
	}

/* ================================================================
   13. CART INPUT SECTION
   ================================================================ */
.cart-input-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
	gap: 12px;
	align-items: end;
	margin-bottom: 12px;
}

	.cart-input-row:last-child {
		margin-bottom: 0;
	}

.cart-field-wide {
	grid-column: span 2;
}

/* ================================================================
   14. DASHBOARD GRID
   ================================================================ */
.dashboard-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	width: 100%;
	margin-bottom: 16px;
}

	.dashboard-grid:last-child {
		margin-bottom: 0;
	}
