/**
 * A&A Elevator — UI components (design-unification phase).
 *
 * Consumes the variables in aae-design-tokens.css. All rules are scoped
 * under .aae-* classes so legacy screens are untouched; screens adopt the
 * design one by one by switching their markup to these classes.
 *
 * Applied screens:
 *   - addCustomer.php (New Customer) — 2026-07-12
 */

/* ===== Form screen ===== */
.aae-form-screen {
	background: var(--aae-bg);
	border-radius: var(--aae-radius-md);
	padding: var(--aae-space-6);
	display: grid;
	gap: var(--aae-space-4);
	margin: var(--aae-space-4) var(--aae-space-6);
}

.aae-screen-title {
	font-family: var(--aae-font-heading);
	font-style: var(--aae-heading-style);
	font-weight: var(--aae-heading-weight);
	text-transform: var(--aae-heading-transform);
	letter-spacing: 1px;
	font-size: var(--aae-text-xl);
	color: var(--aae-blue-700);
	margin: 0;
}

.aae-form-section {
	background: var(--aae-surface);
	border-radius: var(--aae-radius-md);
	padding: var(--aae-space-4) var(--aae-space-6) var(--aae-space-6);
	box-shadow: var(--aae-shadow-card);
}

.aae-form-section > h4 {
	margin: 0 0 var(--aae-space-3);
	font-family: var(--aae-font-heading);
	font-style: var(--aae-heading-style);
	font-weight: var(--aae-heading-weight);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: var(--aae-text-xs);
	color: var(--aae-blue-400);
}

.aae-field-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: var(--aae-space-3) var(--aae-space-4);
}

.aae-field {
	display: grid;
	gap: var(--aae-space-1);
	align-content: start;
}

.aae-field > label {
	font-size: var(--aae-text-xs);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--aae-text-muted);
	font-weight: 600;
}

.aae-field .aae-req {
	color: var(--aae-accent);
}

.aae-form-screen .aae-field .aae-input {
	background: var(--aae-blue-100);
	border: 2px solid transparent;
	border-radius: var(--aae-radius-pill);
	padding: 0.5rem 1rem;
	font-size: var(--aae-text-sm);
	font-family: var(--aae-font-body);
	color: var(--aae-blue-800);
	width: 100%;
	box-sizing: border-box;
	transition: border-color 0.15s ease;
}

.aae-form-screen .aae-field .aae-input::placeholder {
	color: var(--aae-blue-400);
}

.aae-form-screen .aae-field .aae-input:focus,
.aae-form-screen .aae-field .aae-input:focus-visible {
	outline: none;
	border-color: var(--aae-blue-400);
	background: #e4eef7;
}

.aae-form-screen .aae-field select.aae-input {
	appearance: auto;
	cursor: pointer;
}

/* jquery-validate + HTML5 invalid state */
.aae-form-screen .aae-field .aae-input.error,
.aae-form-screen .aae-field .aae-input:user-invalid {
	border-color: var(--aae-accent);
	background: #ffe9e3;
}

.aae-field label.error {
	/* jquery-validate injects <label class="error"> after the input */
	color: var(--aae-accent);
	font-size: var(--aae-text-xs);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 600;
}

/* ===== Buttons ===== */
.aae-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--aae-space-3);
	align-items: center;
}

.aae-form-screen .aae-actions .aae-btn,
.aae-btn {
	border-radius: var(--aae-radius-pill);
	padding: 0.6rem 1.6rem;
	font-family: var(--aae-font-body);
	font-weight: 700;
	letter-spacing: 1px;
	font-size: var(--aae-text-sm);
	text-transform: uppercase;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
}

.aae-btn--primary {
	background: var(--aae-blue-800);
	color: var(--aae-text-on-brand);
	border: 2px solid var(--aae-blue-800);
	box-shadow: var(--aae-shadow-float);
}

.aae-btn--primary:hover {
	filter: brightness(1.15);
}

.aae-btn--secondary {
	background: var(--aae-surface);
	color: var(--aae-blue-700);
	border: 2px solid var(--aae-blue-700);
}

.aae-btn--secondary:hover {
	background: var(--aae-blue-100);
}

.aae-btn--ghost {
	background: none;
	color: var(--aae-text-muted);
	border: 2px solid transparent;
}

.aae-btn--ghost:hover {
	color: var(--aae-text);
}

.aae-btn:focus-visible {
	outline: 3px solid var(--aae-blue-400);
	outline-offset: 2px;
}

.aae-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ===== Admin list screens (dense — the web is the ADMIN) ===== */

/* The customizer inline CSS caps content via `.site .container` at 1405px
   (printed after all stylesheets); on list screens give dense tables more
   room on large monitors — .site prefix out-specifies it. */
.site .site-content_wrap:has(.aae-list-screen) {
	max-width: 1680px;
}

.aae-list-section {
	padding: var(--aae-space-2) var(--aae-space-2) var(--aae-space-4);
}

.aae-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--aae-space-3) var(--aae-space-4);
}

.aae-toolbar .aae-field {
	min-width: 170px;
}

.aae-toolbar__search {
	flex: 1 1 260px;
}

/* Pill checkbox ("Only created") */
.aae-check {
	display: inline-flex;
	align-items: center;
	gap: var(--aae-space-2);
	padding: 0.5rem 1rem;
	background: var(--aae-blue-100);
	border-radius: var(--aae-radius-pill);
	font-size: var(--aae-text-xs);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--aae-blue-700);
	cursor: pointer;
	align-self: flex-end;
	margin: 0;
}

.aae-check input {
	accent-color: var(--aae-blue-700);
	margin: 0;
}

/* Legacy style.css positions input#filterC absolutely (scaled 1.5x, margins
   !important) which made it overlap the label text — neutralize it. */
.aae-check input#filterC {
	position: static;
	transform: none;
	margin: 0 !important;
	padding: 0;
	width: 15px;
	height: 15px;
}

/* The search trigger is a DIV (JS binds div[name=searchTicket]); the legacy
   stylesheet pins Linearicon + display:inline on #iconSearch, so re-pin. */
.aae-toolbar #iconSearch {
	display: inline-flex;
	align-items: center;
	gap: var(--aae-space-2);
	font-family: var(--aae-font-body);
	user-select: none;
}

.aae-toolbar #iconSearch::before {
	font-family: 'Linearicon';
	font-weight: 400;
	/* magnifier glyph comes from the legacy #iconSearch:before rule */
}

/* List table */
.aae-list-scroll {
	overflow-x: auto;
}

.aae-list {
	min-width: 860px;
}

.aae-list .aae-list-head,
.aae-list .aae-list-row {
	display: grid;
	gap: var(--aae-space-2);
	align-items: center;
	padding: 0 var(--aae-row-px);
}

.aae-list--tickets .aae-list-head,
.aae-list--tickets .aae-list-row {
	grid-template-columns: 64px 2fr 1.1fr 1.2fr 1.4fr 110px 1.1fr 118px;
}

/* Ticket id — the unique handle (names repeat, ids don't) */
.aae-list-cell--id {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--aae-blue-400);
}

.aae-list--buildings .aae-list-head,
.aae-list--buildings .aae-list-row {
	grid-template-columns: 1.6fr 1.8fr 1.8fr 1.1fr 1fr 118px;
}

.aae-list--customers .aae-list-head,
.aae-list--customers .aae-list-row {
	grid-template-columns: 1.8fr 1.8fr 1.3fr 1.1fr 1.6fr 118px;
}

.aae-list--elevators .aae-list-head,
.aae-list--elevators .aae-list-row {
	grid-template-columns: 2.2fr 1.2fr 1.2fr 1fr 1fr 118px;
}

/* Clickable cell (e.g. customer name on the buildings list opens the
   customer modal) */
.aae-list-cell--link {
	color: var(--aae-blue-700);
	font-weight: 600;
	cursor: pointer;
}

.aae-list-cell--link:hover {
	text-decoration: underline;
}

.aae-list-head {
	min-height: var(--aae-row-h);
	font-size: var(--aae-text-xs);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--aae-text-muted);
	border-bottom: 2px solid var(--aae-blue-100);
}

.aae-list-row {
	min-height: var(--aae-row-h);
	border-bottom: var(--aae-row-separator);
	font-size: var(--aae-text-sm);
	color: var(--aae-text);
}

.aae-list-row:hover {
	background: var(--aae-row-hover);
}

.aae-list-cell {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Status badges */
.aae-badge {
	display: inline-block;
	padding: 0.1rem 0.7rem;
	border-radius: var(--aae-radius-pill);
	font-size: var(--aae-text-xs);
	font-weight: 700;
	letter-spacing: 0.5px;
}

.aae-badge--complete {
	background: #ddf2e5;
	color: var(--aae-success);
}

.aae-badge--created {
	background: var(--aae-blue-100);
	color: var(--aae-blue-700);
}

.aae-badge--pending {
	background: #ffe9e3;
	color: var(--aae-accent);
}

.aae-badge--started {
	background: #fdeed2;
	color: #b97a10; /* readable tint of --aae-warning */
}

.aae-badge--other {
	background: #ececec;
	color: var(--aae-text-muted);
}

/* Row actions: view (PDF) | edit | delete — same order on every list.
   Ids are the JS contract; the double anchor out-ranks the legacy
   Linearicon id rules and kills their :before glyphs. */
.aae-list-cell--actions {
	display: flex;
	justify-content: flex-end;
	gap: var(--aae-space-1);
	overflow: visible;
}

.aae-list-row .aae-action,
#ticketList #iconViewTicket,
#ticketList #iconEditTicket,
#ticketList #iconDelTicket,
#buildingList #iconView,
#buildingList #iconEdit,
#buildingList #iconDel,
#customersList #iconViewCustom,
#customersList #iconEditCustom,
#customersList #iconDelCustom,
#elevatorList #iconViewElevator,
#elevatorList #iconEditElevator,
#elevatorList #iconDelElevator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	border-radius: var(--aae-radius-pill);
	cursor: pointer;
	transition: background 0.15s ease;
}

#ticketList #iconViewTicket::before,
#ticketList #iconEditTicket::before,
#ticketList #iconDelTicket::before,
#buildingList #iconView::before,
#buildingList #iconEdit::before,
#buildingList #iconDel::before,
#customersList #iconViewCustom::before,
#customersList #iconEditCustom::before,
#customersList #iconDelCustom::before,
#elevatorList #iconViewElevator::before,
#elevatorList #iconEditElevator::before,
#elevatorList #iconDelElevator::before {
	content: none;
}

.aae-action svg {
	width: 15px;
	height: 15px;
	display: block;
}

#ticketList .aae-action--view,
#buildingList .aae-action--view,
#customersList .aae-action--view,
#elevatorList .aae-action--view {
	color: var(--aae-action-view);
}

#ticketList .aae-action--edit,
#buildingList .aae-action--edit,
#customersList .aae-action--edit,
#elevatorList .aae-action--edit {
	color: var(--aae-action-edit);
}

#ticketList .aae-action--delete,
#buildingList .aae-action--delete,
#customersList .aae-action--delete,
#elevatorList .aae-action--delete {
	color: var(--aae-action-delete);
}

.aae-list-row .aae-action--view:hover,
.aae-list-row .aae-action--edit:hover {
	background: var(--aae-blue-100);
}

.aae-list-row .aae-action--delete:hover {
	background: #ffe9e3;
}

/* Pagination */
.aae-list-pagination {
	text-align: center;
	padding: var(--aae-space-4) 0 var(--aae-space-2);
}

.aae-list-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 0.5rem;
	margin: 0 2px;
	border-radius: var(--aae-radius-pill);
	font-size: var(--aae-text-sm);
	font-weight: 600;
	color: var(--aae-blue-700);
	background: var(--aae-blue-100);
	text-decoration: none;
}

.aae-list-pagination .page-numbers.current {
	background: var(--aae-blue-800);
	color: var(--aae-text-on-brand);
}

.aae-list-pagination .page-numbers.dots {
	background: none;
}

.aae-list-pagination a.page-numbers:hover {
	background: var(--aae-blue-200);
}

/* ===== Ticket preview modal (read-only card before PDF actions) ===== */
/* The legacy modal JS sets width:auto inline on #modal, so the card itself
   fixes the size; cap the box height and round its corners. */
#modal:has(.aae-modal-ticket) {
	max-height: 86vh;
	overflow-y: auto;
	border-radius: var(--aae-radius-md);
}

.aae-modal-ticket {
	width: min(660px, 88vw);
	padding: var(--aae-space-4) var(--aae-space-6) var(--aae-space-6);
	display: grid;
	gap: var(--aae-space-4);
	font-family: var(--aae-font-body);
	text-align: left;
}

.aae-modal-ticket__head {
	display: flex;
	align-items: center;
	gap: var(--aae-space-3);
	border-bottom: var(--aae-separator);
	padding-bottom: var(--aae-space-3);
}

.aae-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: var(--aae-space-3) var(--aae-space-4);
}

.aae-detail {
	display: grid;
	gap: 2px;
	align-content: start;
}

.aae-detail__label {
	font-size: var(--aae-text-xs);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--aae-text-muted);
	font-weight: 600;
}

.aae-detail__value {
	font-size: var(--aae-text-sm);
	color: var(--aae-blue-800);
	font-weight: 600;
}

.aae-detail--wide {
	display: grid;
	gap: 2px;
}

/* Evidence thumbnails (light-blue band like the app gallery) */
.aae-photos {
	display: flex;
	flex-wrap: wrap;
	gap: var(--aae-space-2);
	background: var(--aae-blue-100);
	border-radius: var(--aae-radius-md);
	padding: var(--aae-space-2);
}

.aae-photos__item img {
	width: 84px;
	height: 84px;
	object-fit: cover;
	border-radius: var(--aae-radius-sm);
	display: block;
}

/* Evidence management variant (edit-ticket): checkbox under each photo */
.aae-photos--manage .aae-photos__item {
	display: grid;
	gap: 4px;
	justify-items: center;
	cursor: pointer;
}

.aae-photos--manage .delImage {
	width: 16px;
	height: 16px;
	accent-color: var(--aae-accent);
	cursor: pointer;
}

.aae-photos--manage .aae-photos__delete {
	align-self: center;
	margin-left: auto;
}

/* Form textareas: softer radius than the pill inputs */
.aae-form-screen .aae-field textarea.aae-input {
	border-radius: var(--aae-radius-md);
	resize: vertical;
	min-height: 90px;
}

.aae-screen-title__id {
	color: var(--aae-blue-400);
	font-weight: 600;
}

.aae-modal-ticket__note label {
	font-size: var(--aae-text-xs);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--aae-text-muted);
	font-weight: 600;
}

.aae-modal-ticket .aae-input {
	background: var(--aae-blue-100);
	border: 2px solid transparent;
	border-radius: var(--aae-radius-md);
	padding: 0.5rem 1rem;
	font-size: var(--aae-text-sm);
	font-family: var(--aae-font-body);
	color: var(--aae-blue-800);
	width: 100%;
	box-sizing: border-box;
}

.aae-modal-ticket .aae-input:focus {
	outline: none;
	border-color: var(--aae-blue-400);
}

/* Narrow screens: stack action buttons full width */
@media (max-width: 600px) {
	.aae-form-screen {
		margin: var(--aae-space-2);
		padding: var(--aae-space-4);
	}
	.aae-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.aae-btn {
		width: 100%;
	}
}

/* ===== AJAX preloader ===== */
/* The loader markup (.page-preloader-cover > .page-preloader > .bounce1-3)
   is injected from ~15 handlers in ajaxFunctions.js, which also sets an
   inline light-gray background on the cover — hence the !important. The
   markup is left untouched; the legacy bouncing dots are hidden and the
   A&A triangle mark + sliding accent bar are drawn with pseudo-elements. */
.page-preloader-cover {
	background: rgba(10, 46, 79, 0.72) !important;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.page-preloader-cover .page-preloader {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0;
	width: 96px;
	transform: translate(-50%, -50%);
	text-align: center;
}

.page-preloader-cover .page-preloader > div {
	display: none; /* legacy bounce1-3 dots */
}

.page-preloader-cover .page-preloader::before {
	content: '';
	display: block;
	width: 74px;
	height: 56px;
	margin: 0 auto;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 107 81'%3E%3Cpath d='M46.905,0.408l-7.129,0.003l-39.776,80.049l7.107,-0.003l39.798,-80.049Z' fill='white'/%3E%3Cpath d='M23.725,74.07l32.947,-66.78l-3.661,-6.887l-39.571,80.054l7.133,-0.003l73.149,-0.026l-3.204,-6.381l-66.793,0.023Z' fill='white'/%3E%3Cpath d='M67.211,0.401l-7.141,0.002l31.245,63.157l-48.626,0.017l17.414,-34.858l15.381,29.921l7.141,0l-22.488,-44.082l-27.774,55.405l62.189,0.147l5.118,10.347l7.13,-0.002l-39.589,-80.054Z' fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: aae-loader-pulse 1.6s ease-in-out infinite;
}

.page-preloader-cover .page-preloader::after {
	content: '';
	display: block;
	width: 28px;
	height: 5px;
	margin: 14px auto 0;
	border-radius: var(--aae-radius-pill);
	background: var(--aae-accent);
	animation: aae-loader-slide 1.6s ease-in-out infinite;
}

@keyframes aae-loader-pulse {
	0%, 100% { opacity: 0.7; transform: scale(0.95); }
	50% { opacity: 1; transform: scale(1); }
}

@keyframes aae-loader-slide {
	0%, 100% { transform: translateX(-23px); }
	50% { transform: translateX(23px); }
}

@media (prefers-reduced-motion: reduce) {
	.page-preloader-cover .page-preloader::before,
	.page-preloader-cover .page-preloader::after {
		animation: none;
	}
}

/* ===== Evidence upload modal ===== */
#modal:has(.aae-modal-upload) {
	max-height: 86vh;
	overflow-y: auto;
	border-radius: var(--aae-radius-md);
}

.aae-modal-upload {
	width: min(560px, 88vw);
	padding: var(--aae-space-4) var(--aae-space-6) var(--aae-space-6);
	display: grid;
	gap: var(--aae-space-4);
	font-family: var(--aae-font-body);
	text-align: left;
}

.aae-modal-upload__head {
	border-bottom: var(--aae-separator);
	padding-bottom: var(--aae-space-3);
}

.aae-modal-upload__head h4 {
	margin: 0;
	font-family: var(--aae-font-heading);
	font-style: var(--aae-heading-style);
	font-weight: var(--aae-heading-weight);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: var(--aae-text-md);
	color: var(--aae-blue-700);
}

.aae-modal-upload #drop_zone {
	border: 2px dashed var(--aae-blue-400);
	border-radius: var(--aae-radius-md);
	background: var(--aae-blue-100);
	padding: var(--aae-space-6) var(--aae-space-4);
	text-align: center;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.aae-modal-upload #drop_zone.is-dragover {
	border-color: var(--aae-accent);
	background: #ffe9e3;
}

.aae-modal-upload .drag-drop-info {
	margin: 0 0 4px;
	font-weight: 700;
	color: var(--aae-blue-700);
	font-size: var(--aae-text-md);
}

.aae-modal-upload .drag-drop-or {
	margin: 0 0 10px;
	color: var(--aae-text-muted);
	font-size: var(--aae-text-xs);
	text-transform: uppercase;
	letter-spacing: 1px;
}

.aae-modal-upload .drag-drop-buttons {
	margin: 0;
}

.aae-modal-upload #fileInput {
	display: none;
}

.aae-modal-upload .upload-file {
	margin: 0;
	font-size: var(--aae-text-sm);
	color: var(--aae-text);
}

.aae-modal-upload .upload-file:empty {
	display: none;
}

.aae-modal-upload progress {
	accent-color: var(--aae-accent);
	vertical-align: middle;
	margin-left: 8px;
}

.aae-modal-upload .aae-actions {
	justify-content: flex-end;
}

/* ===== Modernization screens ===== */
.aae-help-text {
	margin: 0 0 var(--aae-space-3);
	color: var(--aae-text-muted);
	font-size: var(--aae-text-sm);
}

.aae-stage-list {
	margin: 0;
	padding: 0 0 0 1.2em;
	color: var(--aae-text);
	font-size: var(--aae-text-sm);
	display: grid;
	gap: 6px;
}

.aae-stage-list b {
	color: var(--aae-blue-700);
}

/* Read-only (calculated) inputs — e.g. modernization stage dates derived
   from Administration/Demolition Start. Kept in the form payload, just not
   hand-editable. */
.aae-input--readonly,
.aae-input[readonly] {
	background: var(--aae-blue-50, #eef3f8);
	color: var(--aae-blue-700);
	border-style: dashed;
	cursor: default;
	pointer-events: none;
}

/* Custom file-input skin (native control text follows the browser locale;
   site UI is English-only). The real input covers the control, invisible. */
.aae-file {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border: 1px solid var(--aae-blue-400);
	border-radius: var(--aae-radius, 16px);
	background: #fff;
}

.aae-file input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

.aae-file__btn {
	pointer-events: none;
	flex: none;
}

.aae-file__name {
	color: var(--aae-blue-700);
	font-size: var(--aae-text-sm);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ============ Inventory screens ============ */

.aae-list-grid--inventory {
	display: grid;
	grid-template-columns: 44px minmax(0, 2.4fr) 90px 64px 150px 60px;
	align-items: center;
	gap: var(--aae-space-2);
}

.aae-list-row--inactive {
	opacity: 0.5;
	pointer-events: none;
}

.aae-list-flag {
	color: var(--aae-danger, #c0392b);
	font-size: 11px;
}

.aae-list-cell--check input[type="checkbox"] {
	position: static;
	transform: none;
	margin: 0 !important;
	width: 15px;
	height: 15px;
}

.aae-list-cell--num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.aae-list-cell--img img {
	width: 30px;
	height: 30px;
	object-fit: contain;
	border-radius: 6px;
	display: block;
}

.aae-input--qty {
	max-width: 110px;
	padding-top: 6px;
	padding-bottom: 6px;
}

/* Bottom bar of the inventory search order form */
.aae-order-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aae-space-3);
	margin-top: var(--aae-space-4);
	padding: var(--aae-space-3);
	background: #fff;
	border-radius: var(--aae-radius, 16px);
	box-shadow: var(--aae-shadow-card, 0 2px 10px rgba(10, 46, 79, 0.08));
}

.aae-order-bar > select {
	max-width: 420px;
}

.aae-order-bar__cost {
	display: flex;
	align-items: center;
	gap: 8px;
}

.aae-order-bar__cost label {
	margin: 0;
	font-size: var(--aae-text-sm);
	color: var(--aae-blue-700);
	white-space: nowrap;
}

.aae-order-bar__cost .aae-input {
	max-width: 130px;
}

.aae-pagination {
	text-align: center;
	margin-top: var(--aae-space-4);
}

/* Icon actions inside the inventory list (same treatment as the other lists,
   which scope by container id) */
#buildingList #iconEditMaterial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	border-radius: var(--aae-radius-pill);
	cursor: pointer;
	transition: background 0.15s ease;
}

#buildingList #iconEditMaterial::before {
	content: none;
}

.aae-list-grid--history {
	display: grid;
	grid-template-columns: minmax(0, 2.4fr) 100px minmax(0, 1.4fr) 110px 130px;
	align-items: center;
	gap: var(--aae-space-2);
}

/* AJAX-rendered project materials table (#history/#tempTable) */
.aae-table-wrap {
	background: #fff;
	border-radius: var(--aae-radius, 16px);
	box-shadow: var(--aae-shadow-card, 0 2px 10px rgba(10, 46, 79, 0.08));
	padding: var(--aae-space-3);
	overflow-x: auto;
	margin-top: var(--aae-space-3);
}

.aae-table-wrap table {
	width: 100%;
	border-collapse: collapse;
}

.aae-table-wrap th {
	text-align: left;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--aae-blue-400);
	padding: 8px 10px;
	border-bottom: 2px solid var(--aae-blue-100);
	background: transparent;
}

.aae-table-wrap td {
	padding: 8px 10px;
	font-size: var(--aae-text-sm);
	color: var(--aae-text);
	border-bottom: 1px solid var(--aae-blue-100);
}

.aae-table-wrap tr:hover td {
	background: rgba(20, 101, 168, 0.05);
}

/* Product-code autocomplete dropdown (populated by ajaxFunctions.js) */
.aae-field--suggest {
	position: relative;
}

.aae-suggest {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1000;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(10, 46, 79, 0.18);
	max-height: 260px;
	overflow-y: auto;
}

.aae-suggest:empty {
	display: none;
}

.aae-suggest div {
	padding: 8px 14px;
	font-size: var(--aae-text-sm);
	cursor: pointer;
}

.aae-suggest div:hover {
	background: var(--aae-blue-100);
}

.aae-material-image {
	width: 100px;
	max-width: 100%;
	border-radius: 12px;
	border: 1px solid var(--aae-blue-100);
	display: block;
}

/* Checkbox group (e.g. ticket-type filters on the report form) */
.aae-check-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--aae-space-2) var(--aae-space-4);
}

.aae-check-group .aae-check input[type="checkbox"] {
	position: static;
	transform: none;
	margin: 0 8px 0 0 !important;
	width: 15px;
	height: 15px;
}

/* Tickets-left rows: the #ticketList container keeps the aae-list--tickets
   grid because the searchTicket AJAX response injects standard 8-column
   ticket rows; the initial 6-column rows override at row level (extra
   specificity beats the container rule). */
.aae-list-grid--tickets-left,
.aae-list--tickets .aae-list-head.aae-list-grid--tickets-left,
.aae-list--tickets .aae-list-row.aae-list-grid--tickets-left {
	display: grid;
	grid-template-columns: 90px 2.2fr 1.4fr 1.6fr 150px 118px;
	align-items: center;
	gap: var(--aae-space-2);
}

/* Read-only view mode (show-* pages reuse the edit templates inside a
   disabled fieldset) */
.aae-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
	display: grid;
	gap: var(--aae-space-4);
}

.aae-form-screen .aae-field .aae-input:disabled,
.aae-fieldset:disabled .aae-input {
	background: #eef3f8;
	color: var(--aae-blue-700);
	border-style: dashed;
	cursor: default;
	opacity: 1;
	-webkit-text-fill-color: var(--aae-blue-700);
}

.aae-view-pill {
	display: inline-block;
	vertical-align: middle;
	margin-left: 8px;
	padding: 3px 12px;
	border-radius: var(--aae-radius-pill);
	background: var(--aae-blue-100);
	color: var(--aae-blue-700);
	font-size: 11px;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ===== Home screen (replaces the broken Power Builder front page) ===== */
.aae-home-welcome {
	display: flex;
	align-items: center;
	gap: var(--aae-space-6);
	flex-wrap: wrap;
}

.aae-home-welcome__text {
	flex: 1 1 320px;
	min-width: 0;
}

.aae-home-eyebrow {
	font-family: var(--aae-font-heading);
	font-weight: 700;
	font-size: var(--aae-text-xs);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--aae-blue-400);
	margin: 0 0 var(--aae-space-2);
}

.aae-home-headline {
	font-family: var(--aae-font-heading);
	font-style: var(--aae-heading-style);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	line-height: 1.15;
	color: var(--aae-blue-800);
	margin: 0 0 var(--aae-space-3);
}

.aae-home-headline em {
	font-style: inherit;
	color: var(--aae-accent);
}

.aae-home-sub {
	font-size: var(--aae-text-md);
	color: var(--aae-text-muted);
	line-height: 1.55;
	max-width: 46ch;
	margin: 0;
}

.aae-home-illustration {
	position: relative;
	flex: 1 1 320px;
	max-width: 460px;
	margin: 0 auto;
	border-radius: var(--aae-radius-md);
	overflow: hidden;
	box-shadow: var(--aae-shadow-card);
	line-height: 0;
}

.aae-home-illustration__photo {
	width: 100%;
	height: auto;
	display: block;
}

.aae-home-illustration__logo-chip {
	position: absolute;
	top: var(--aae-space-4);
	left: var(--aae-space-4);
	background: #fff;
	border-radius: var(--aae-radius-sm);
	padding: 10px 14px;
	box-shadow: var(--aae-shadow-card);
	line-height: 0;
}

.aae-home-illustration__logo-chip img {
	height: 28px;
	width: auto;
	display: block;
}

.aae-home-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--aae-space-3);
}

.aae-home-tile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--aae-space-3);
	padding: var(--aae-space-4);
	background: var(--aae-surface);
	border: 1px solid transparent;
	border-radius: var(--aae-radius-md);
	box-shadow: var(--aae-shadow-card);
	text-decoration: none;
	color: var(--aae-text);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.aae-home-tile:hover,
.aae-home-tile:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--aae-shadow-float);
	border-color: var(--aae-blue-200);
	outline: none;
}

.aae-home-tile__icon {
	width: 40px;
	height: 40px;
	border-radius: var(--aae-radius-sm);
	background: var(--aae-blue-100);
	color: var(--aae-blue-700);
	display: grid;
	place-items: center;
	flex: none;
}

.aae-home-tile__icon svg {
	width: 20px;
	height: 20px;
}

.aae-home-tile__label {
	font-family: var(--aae-font-heading);
	font-weight: 700;
	font-size: var(--aae-text-sm);
	letter-spacing: 0.02em;
	color: var(--aae-blue-800);
}

@media (prefers-reduced-motion: reduce) {
	.aae-home-tile {
		transition: none;
	}
}
