/* SSAP visual language, modelled on ssapengg.com. */
:root {
	--ssap-orange: #f7941d;
	--ssap-orange-dark: #b35f00;
	--ssap-navy: #13213a;
	--ssap-charcoal: #1e2730;
	--ssap-text: #3a4452;
	--ssap-grey: #f3f4f6;
	--ssap-border: #dde1e6;
	--ssap-shadow: 0 1px 2px rgba(19, 33, 58, 0.06), 0 4px 12px rgba(19, 33, 58, 0.06);
	--primary: var(--ssap-orange);
	--primary-color: var(--ssap-orange);
	--text-color: var(--ssap-text);
	--heading-color: var(--ssap-navy);
	--border-color: var(--ssap-border);
	--desk-sidebar-bg: var(--ssap-navy);
	--font-stack: "InterVariable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body,
button,
input,
select,
textarea {
	font-family: "InterVariable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body {
	line-height: 1.5;
}

/* Desk */
body[data-route^="app"] .navbar,
body[data-route^="app"] header.navbar {
	border-bottom: 1px solid var(--ssap-border);
	box-shadow: 0 2px 10px rgba(19, 33, 58, 0.05);
}

.layout-side-section,
.desk-sidebar {
	background: var(--ssap-navy) !important;
	color: #fff;
	border-right-color: rgba(255, 255, 255, 0.12) !important;
}

/* Frappe v16 persistent app sidebar. */
:root,
[data-theme="light"],
[data-theme="dark"] {
	--desk-sidebar-bg: var(--ssap-navy);
}

.body-sidebar {
	background: var(--ssap-navy) !important;
	border-right-color: rgba(255, 255, 255, 0.14) !important;
}

.body-sidebar .standard-sidebar-item .item-anchor,
.body-sidebar .standard-sidebar-item .sidebar-item-label,
.body-sidebar .standard-sidebar-item .sidebar-item-suffix,
.body-sidebar .standard-sidebar-item .keyboard-shortcut,
.body-sidebar .sidebar-header,
.body-sidebar .sidebar-header .header-title,
.body-sidebar .sidebar-header .header-subtitle,
.body-sidebar .sidebar-user-button,
.body-sidebar .sidebar-user-button .avatar-name-email span,
.body-sidebar .sidebar-user-button .avatar-name-email span + span,
.body-sidebar svg {
	color: #eef2f7 !important;
	stroke: currentColor;
}

.body-sidebar .section-break,
.body-sidebar .section-break .sidebar-item-label {
	color: #aeb9c8 !important;
}

.body-sidebar .divider,
.body-sidebar .indent + .nested-container {
	border-color: rgba(255, 255, 255, 0.16) !important;
}

.body-sidebar .standard-sidebar-item:not(.active-sidebar):has(a:not(.section-break)):hover,
.body-sidebar .sidebar-user-button:hover,
.body-sidebar .sidebar-user-button.user-menu-active {
	background: rgba(255, 255, 255, 0.12) !important;
}

.body-sidebar .active-sidebar,
.body-sidebar .standard-sidebar-item.active-sidebar {
	background: var(--ssap-orange) !important;
	box-shadow: none !important;
}

.body-sidebar .active-sidebar .item-anchor,
.body-sidebar .active-sidebar .sidebar-item-label,
.body-sidebar .active-sidebar .sidebar-item-suffix,
.body-sidebar .active-sidebar svg {
	color: var(--ssap-navy) !important;
}

.layout-side-section .sidebar-section,
.layout-side-section .standard-sidebar,
.desk-sidebar .sidebar-section,
.desk-sidebar .standard-sidebar {
	background: transparent !important;
}

.layout-side-section .standard-sidebar-label,
.layout-side-section .sidebar-label,
.layout-side-section .sidebar-item-label,
.layout-side-section .standard-sidebar-item,
.layout-side-section .standard-sidebar-item a,
.layout-side-section .sidebar-item,
.layout-side-section .sidebar-item a,
.layout-side-section svg,
.desk-sidebar .standard-sidebar-label,
.desk-sidebar .sidebar-label,
.desk-sidebar .sidebar-item-label,
.desk-sidebar .standard-sidebar-item,
.desk-sidebar .standard-sidebar-item a,
.desk-sidebar .sidebar-item,
.desk-sidebar .sidebar-item a,
.desk-sidebar svg {
	color: #fff !important;
	stroke: currentColor;
}

.standard-sidebar-item.selected,
.desk-sidebar-item.selected,
.standard-sidebar-item:hover,
.desk-sidebar-item:hover {
	background: var(--ssap-orange) !important;
	color: var(--ssap-navy) !important;
}

.layout-side-section .standard-sidebar-item.selected *,
.layout-side-section .standard-sidebar-item:hover *,
.desk-sidebar .standard-sidebar-item.selected *,
.desk-sidebar .standard-sidebar-item:hover *,
.desk-sidebar .desk-sidebar-item.selected *,
.desk-sidebar .desk-sidebar-item:hover * {
	color: var(--ssap-navy) !important;
}

.btn-primary,
.primary-action,
.btn.btn-primary {
	background-color: var(--ssap-orange) !important;
	border-color: var(--ssap-orange) !important;
	color: var(--ssap-navy) !important;
	font-weight: 700;
}

.btn-primary:hover,
.primary-action:hover,
.btn.btn-primary:hover {
	background-color: var(--ssap-orange-dark) !important;
	border-color: var(--ssap-orange-dark) !important;
	color: #fff !important;
}

.page-head .title-text,
.page-title .title-text,
.widget-title,
.form-section .section-head {
	color: var(--ssap-navy);
}

.frappe-card,
.widget,
.form-dashboard-section,
.form-layout,
.list-row-container {
	border-color: var(--ssap-border);
}

/* Login */
body[frappe-session-status="logged-out"] {
	min-height: 100vh;
	background:
		linear-gradient(135deg, transparent 0 74%, rgba(247, 148, 29, 0.95) 74% 82%, transparent 82%),
		radial-gradient(circle at 20% 25%, rgba(247, 148, 29, 0.13), transparent 34%),
		linear-gradient(115deg, #13213a 0%, #13213a 52%, #1e2730 100%);
	color: var(--ssap-text);
}

body[frappe-session-status="logged-out"] .page-content-wrapper {
	min-height: 100vh;
	display: grid;
	align-items: center;
	position: relative;
}

body[frappe-session-status="logged-out"] .page-content-wrapper::before {
	content: "ENGINEERED FOR IMPACT\A BUILT FOR SAFETY";
	position: fixed;
	left: clamp(24px, 6vw, 96px);
	top: 50%;
	width: min(38vw, 430px);
	transform: translateY(-50%);
	color: #fff;
	font-size: clamp(28px, 3.3vw, 48px);
	line-height: 1.08;
	font-weight: 900;
	letter-spacing: 0.01em;
	white-space: pre-line;
}

body[frappe-session-status="logged-out"] .page-content-wrapper::after {
	display: none;
}

body[frappe-session-status="logged-out"] main.container {
	width: 100%;
	max-width: 1200px;
	display: flex;
	justify-content: flex-end;
	padding: 40px 24px;
}

body[frappe-session-status="logged-out"] .page_content {
	width: min(100%, 430px);
}

body[frappe-session-status="logged-out"] .login-content.page-card {
	width: 100%;
	max-width: none;
	padding: 32px;
	background: rgba(255, 255, 255, 0.98);
	border: 1px solid var(--ssap-border);
	border-radius: 10px;
	box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

body[frappe-session-status="logged-out"] .page-card-head .app-logo {
	width: 149px;
	height: 60px;
	object-fit: contain;
	object-position: left center;
}

body[frappe-session-status="logged-out"] .page-card-head h4 {
	color: var(--ssap-navy) !important;
	font-size: 30px;
	font-weight: 900;
}

body[frappe-session-status="logged-out"] .page-card-subtitle {
	color: var(--ssap-text) !important;
}

body[frappe-session-status="logged-out"] .form-control {
	min-height: 48px;
	border-color: #8a94a3;
	border-radius: 6px;
}

body[frappe-session-status="logged-out"] .form-control:focus {
	border-color: var(--ssap-navy);
	box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.34);
}

body[frappe-session-status="logged-out"] .es-button[data-variant="solid"] {
	background: var(--ssap-orange) !important;
	border-color: var(--ssap-orange) !important;
	color: var(--ssap-navy) !important;
	font-weight: 700;
}

body[frappe-session-status="logged-out"] .es-button[data-variant="solid"]:hover {
	background: var(--ssap-orange-dark) !important;
	border-color: var(--ssap-orange-dark) !important;
	color: #fff !important;
}

body[frappe-session-status="logged-out"] .web-footer {
	display: none;
}

@media (max-width: 1080px) {
	body[frappe-session-status="logged-out"] .page-content-wrapper::before,
	body[frappe-session-status="logged-out"] .page-content-wrapper::after {
		display: none;
	}

	body[frappe-session-status="logged-out"] main.container {
		justify-content: center;
	}
}

/* Branded management dashboard */
.fi-dash .fi-hero {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 24px;
	align-items: center;
	overflow: hidden;
	margin: 4px 0 20px;
	padding: 28px 30px;
	background: var(--ssap-navy);
	border-radius: 10px;
	color: #fff;
	box-shadow: var(--ssap-shadow);
}

.fi-dash .fi-hero::after {
	content: "";
	position: absolute;
	right: 0;
	top: 0;
	width: 0;
	height: 0;
	border-top: 110px solid var(--ssap-orange);
	border-left: 110px solid transparent;
}

.fi-dash .fi-eyebrow {
	margin-bottom: 8px;
	color: var(--ssap-orange);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.fi-dash .fi-hero h2 {
	margin: 0 0 8px;
	color: #fff;
	font-size: 28px;
	font-weight: 800;
}

.fi-dash .fi-hero p:last-child {
	margin: 0;
	color: #dfe4ec;
}

.fi-dash .fi-hero-logo {
	position: relative;
	z-index: 1;
	width: 132px;
	padding: 10px;
	background: #fff;
	border-radius: 8px;
}

.fi-dash .fi-guide {
	margin: 0 0 18px;
	padding: 20px;
	background: var(--ssap-grey);
	border: 1px solid var(--ssap-border);
	border-radius: 10px;
}

.fi-dash .fi-guide-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.fi-dash .fi-guide-head h3 {
	margin: 0;
	color: var(--ssap-navy);
	font-size: 18px;
}

.fi-dash .fi-guide-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fi-dash .fi-guide-actions button {
	min-height: 38px;
	padding: 7px 13px;
	border: 1px solid var(--ssap-navy);
	border-radius: 6px;
	background: #fff;
	color: var(--ssap-navy);
	font-weight: 700;
}

.fi-dash .fi-guide-actions button:first-child {
	background: var(--ssap-orange);
	border-color: var(--ssap-orange);
}

.fi-dash .fi-location-flow {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.fi-dash .fi-location {
	position: relative;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--ssap-border);
	border-top: 4px solid var(--ssap-orange);
	border-radius: 8px;
}

.fi-dash .fi-location strong,
.fi-dash .fi-location span {
	display: block;
}

.fi-dash .fi-location strong {
	color: var(--ssap-navy);
}

.fi-dash .fi-location span {
	margin-top: 4px;
	color: #687384;
	font-size: 12px;
}

.fi-dash .fi-model-note {
	margin: 12px 0 0;
	color: #687384;
	font-size: 12px;
}

@media (max-width: 760px) {
	.fi-dash .fi-hero {
		grid-template-columns: minmax(0, 1fr);
		padding: 22px;
	}

	.fi-dash .fi-hero-logo {
		display: none;
	}

	.fi-dash .fi-location-flow {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
