:root {
	--crn-accent-color: #0f62ff;
}

.crn-login-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	text-align: center;
	padding-bottom: 1.5rem;
}

.crn-login-brand .crn-brand-logo img {
	width: 120px;
	height: auto;
	max-height: 120px;
	object-fit: contain;
}

.crn-login-brand .crn-brand-mark {
	font-weight: 700;
	font-size: 1.25rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--crn-accent-color);
}

.crn-login-brand .crn-brand-title {
	font-size: clamp(1.75rem, 2.5vw, 2.5rem);
	font-weight: 700;
}

.crn-login-brand .crn-brand-subtitle {
	font-size: 1rem;
	color: rgba(0, 0, 0, 0.65);
}

body #login-page .btn-primary,
body#login-page .login-form .btn-primary {
	background-color: var(--crn-accent-color);
	border-color: var(--crn-accent-color);
	box-shadow: none;
}

body#login-page .login-form .btn-primary:hover {
	filter: brightness(1.05);
}

body#login-page .login-form .btn-primary:focus {
	box-shadow: 0 0 0 0.2rem var(--crn-accent-color);
}

body#login-page .login-form .btn-outline-primary {
	border-color: var(--crn-accent-color);
	color: var(--crn-accent-color);
}

.crn-login-brand+* {
	margin-top: 0;
}

/* Hide Comments / Activity section globally (Frappe v16 form footer) */
.form-footer .after-save {
	display: none !important;
}

/* 
   Make the main body transparent so the fixed background animation shows through.
   The actual content containers will provide the surface color.
*/
body,
#app {
	background-color: transparent !important;
}

/* 
   Glassmorphism card effect for the Dashboard/Home container.
   Using a cleaner glass effect that shows the pattern while maintaining specific user background tone preference.
   User asked for #f3f3f3 previously -> mapped to #f5f7fa with opacity.
*/
.page-container.crn-pw-home {
	/* Base background color (Light Grey) */
	background-color: #f8f9fa !important;

	/* Pattern: Technical Dot Grid */
	background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
	background-size: 24px 24px;

	/* Frost/Glass effect (optional, mainly if sitting on top of something else, 
	   but nice for depth if we add inner elements) */
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);

	/* Border and definition */
	border: 1px solid rgba(0, 0, 0, 0.05);
	border-radius: 16px;

	/* Premium Shadow */
	box-shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.02),
		0 2px 4px -1px rgba(0, 0, 0, 0.02),
		0 10px 40px -10px rgba(0, 0, 0, 0.05);

	/* Spacing */
	margin: 16px;
	min-height: calc(100vh - 100px);
}

/* Ensure other pages have a solid background if needed */
.page-container:not(.crn-pw-home) {
	background-color: rgba(255, 255, 255, 0.95);
}

/* 
   Premium Custom Scrollbar Utility 
   (As requested for .my-container and global consistency)
*/

/* For Chrome, Edge, and Safari */
::-webkit-scrollbar,
.my-container::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

::-webkit-scrollbar-track,
.my-container::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb,
.my-container::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover,
.my-container::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* Firefox */
* {
	scrollbar-width: thin;
	scrollbar-color: #888 transparent;
}

/* 
   Splash Screen Branding 
   Replaces the default ERPNext logo with the software company logo 
*/
.centered.splash img {
	content: url("/assets/crn_erp_manufacture/images/crn-logo.svg");
	max-width: 220px !important;
	height: auto;
	filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

/* Hide Tax fields on Supplier form */
.frappe-control[data-fieldname="tax_id"],
.frappe-control[data-fieldname="tax_category"],
.frappe-control[data-fieldname="tax_withholding_category"],
.frappe-control[data-fieldname="tax_withholding_group"] {
	display: none !important;
}

/* Hide Accounting tab on Supplier form */
.form-tabs [data-fieldname="accounting_tab"],
.form-tabs .nav-item:has([data-fieldname="accounting_tab"]) {
	display: none !important;
}

/* Hide Comments section at bottom of forms */
.comment-input-wrapper {
	display: none !important;
}

/* Hide Is Reverse Charge checkbox on Purchase Order */
.frappe-control[data-fieldname="is_reverse_charge"] {
	display: none !important;
}

/* Hide Currency and Price List section on Purchase Order */
.form-section[data-fieldname="currency_and_price_list"] {
	display: none !important;
}

/* Hide "Try the new Print Designer" banner on print view */
#page-print .inner-page-message {
	display: none !important;
}

/* Purchase Order — Approval Details section border */
.frappe-control[data-fieldname="custom_approval_section"] > .section-head,
.form-section[data-fieldname="custom_approval_section"] .section-head {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 8px 12px;
	margin-bottom: 4px;
	background: #f8fafc;
}

/* Approval Timeline inside Approval Details */
.approval-timeline {
	margin: 8px 0 12px 0;
	padding: 0 4px;
}

.approval-timeline .timeline-entry {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 5px 0;
	border-bottom: 1px solid #f1f5f9;
}

.approval-timeline .timeline-entry:last-child {
	border-bottom: none;
}

.approval-timeline .timeline-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 2px;
}

.approval-timeline .timeline-icon.check svg {
	color: #16a34a;
}

.approval-timeline .timeline-icon.send-back svg {
	color: #dc2626;
}

.approval-timeline .timeline-icon.approve svg {
	color: #2563eb;
}

.approval-timeline .timeline-content {
	flex: 1;
	font-size: 12px;
	line-height: 1.5;
}

.approval-timeline .timeline-action {
	font-weight: 600;
	color: #1e293b;
}

.approval-timeline .timeline-user {
	color: #64748b;
}

.approval-timeline .timeline-time {
	color: #94a3b8;
}

.approval-timeline .timeline-reason {
	margin-top: 4px;
	padding: 6px 10px;
	background: #fff7ed;
	border-left: 3px solid #f97316;
	border-radius: 0 4px 4px 0;
	color: #7c2d12;
	font-size: 12px;
}