.aos-portal {
	--aos-bg: #f8fafc;
	--aos-white: #ffffff;
	--aos-text: #0f172a;
	--aos-muted: #64748b;
	--aos-border: #e2e8f0;
	--aos-soft-blue: #eaf2ff;
	--aos-soft-green: #ecfdf5;
	--aos-soft-orange: #fff4e6;
	--aos-soft-purple: #f5f3ff;
	--aos-active: #f59e0b;
	--aos-qty-highlight: #2563eb;
	max-width: 1200px;
	margin: 24px auto;
	padding: 0 14px;
	box-sizing: border-box;
	font-family: "Poppins", "Nunito Sans", "Segoe UI", sans-serif;
	color: var(--aos-text);
}

.aos-order-shell {
	padding-top: 0;
	background: transparent;
	border-radius: 0;
}

.aos-card {
	background: var(--aos-white);
	border: 1px solid var(--aos-border);
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 14px;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.aos-card h2,
.aos-card h3 {
	margin: 0 0 14px;
	color: var(--aos-text);
}

.aos-agent-info {
	display: grid;
	grid-template-columns: repeat(2, minmax(220px, 1fr));
	gap: 10px 16px;
	font-size: 14px;
}

@media (min-width: 769px) {
	.aos-login-card,
	.aos-order-shell,
	.aos-history-shell {
		width: 100%;
		max-width: 100%;
	}

	.aos-order-shell .aos-agent-info-order {
		grid-template-columns: repeat(3, minmax(180px, 1fr));
	}

	.aos-history-shell .aos-agent-info-history {
		grid-template-columns: repeat(3, minmax(180px, 1fr));
	}
}

.aos-login-form input[type="text"],
.aos-login-form input[type="password"],
.aos-login-form input[type="email"],
.aos-order-controls input[type="text"],
.aos-order-controls select,
.aos-history-filter input[type="date"],
.aos-history-filter select {
	width: 100%;
	max-width: 360px;
	padding: 9px 12px;
	min-height: 42px;
	border: 1px solid var(--aos-border);
	border-radius: 10px;
	box-sizing: border-box;
	background: var(--aos-white);
	color: var(--aos-text);
}

.aos-order-controls {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px 16px;
	align-items: start;
}

.aos-order-controls .aos-order-control,
.aos-order-controls .aos-clone-yesterday-form {
	margin: 0;
}

.aos-order-controls .aos-order-control label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.aos-order-controls select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 42px;
	cursor: pointer;
	background-image:
		linear-gradient(45deg, transparent 50%, #475569 50%),
		linear-gradient(135deg, #475569 50%, transparent 50%),
		linear-gradient(to right, rgba(148, 163, 184, 0.4), rgba(148, 163, 184, 0.4));
	background-position:
		calc(100% - 16px) calc(50% - 2px),
		calc(100% - 10px) calc(50% - 2px),
		calc(100% - 30px) 50%;
	background-size: 6px 6px, 6px 6px, 1px 22px;
	background-repeat: no-repeat;
}

.aos-order-controls select::-ms-expand {
	display: none;
}

.aos-login-form input[type="text"]:focus,
.aos-login-form input[type="password"]:focus,
.aos-login-form input[type="email"]:focus,
.aos-order-controls input[type="text"]:focus,
.aos-order-controls select:focus,
.aos-history-filter input[type="date"]:focus,
.aos-history-filter select:focus,
.aos-duplicate-select:focus,
.aos-order-table input[type="number"]:focus {
	outline: 2px solid rgba(245, 158, 11, 0.25);
	outline-offset: 1px;
	border-color: var(--aos-active);
}

.aos-order-controls p,
.aos-history-filter p,
.aos-login-form p {
	margin: 0 0 12px;
}

.aos-clone-yesterday-form {
	margin: 0;
}

.aos-button {
	display: inline-block;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--aos-active);
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: filter 0.18s ease-in-out;
}

.aos-button:hover {
	filter: brightness(0.95);
}

.aos-button[disabled] {
	background: #94a3b8;
	cursor: not-allowed;
	filter: none;
}

.aos-button-secondary {
	background: #334155;
}

.aos-button-primary {
	background: var(--aos-active);
}

.aos-button-danger {
	background: #b91c1c;
}

.aos-alert {
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 12px;
}

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

.aos-alert-success {
	background: #ecfdf3;
	color: #0f5132;
	border: 1px solid #a7f3d0;
}

.aos-alert-warning {
	background: #fffbeb;
	color: #92400e;
	border: 1px solid #fcd34d;
}

.aos-alert-info {
	background: #eff6ff;
	color: #1e40af;
	border: 1px solid #bfdbfe;
}

.aos-cutoff {
	margin-top: 12px;
	padding: 10px 12px;
	border: 1px solid #fed7aa;
	border-radius: 10px;
	background: var(--aos-soft-orange);
	font-weight: 600;
}

.aos-cutoff-meta {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--aos-muted);
	margin-top: 4px;
}

.aos-table-wrap {
	overflow-x: auto;
}

.aos-order-menu-table-wrap {
	position: relative;
	min-height: 220px;
	margin-bottom: 14px;
}

.aos-order-shell p.aos-submit-order-wrap {
	margin: 0 0 12px;
	padding-top: 14px;
}

.aos-order-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(248, 250, 252, 0.78);
	backdrop-filter: blur(0.6px);
	z-index: 2;
	font-weight: 600;
	color: var(--aos-muted);
}

.aos-order-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	min-width: 720px;
	background: var(--aos-white);
	border: 1px solid var(--aos-border);
	border-radius: 12px;
	overflow: hidden;
}

.aos-order-menu-table {
	min-width: 680px;
}

.aos-order-table thead th {
	background: var(--aos-soft-blue);
	color: var(--aos-text);
	font-size: 13px;
	font-weight: 700;
	text-transform: none;
}

.aos-order-table th,
.aos-order-table td {
	padding: 10px 11px;
	border-bottom: 1px solid var(--aos-border);
	text-align: left;
	vertical-align: middle;
}

.aos-order-table tbody tr:hover {
	background: #fffdf7;
}

.aos-order-table tfoot th {
	background: #f8fafc;
}

.aos-order-table .aos-money-cell {
	white-space: nowrap;
}

.aos-order-table input[type="number"] {
	width: 108px;
	min-height: 40px;
	padding: 8px 10px;
	font-size: 15px;
	border: 1px solid var(--aos-border);
	border-radius: 10px;
	background: #ffffff;
	color: var(--aos-text);
}

/* Keep header height unchanged while compacting order rows and quantity input. */
.aos-order-menu-table tbody td {
	padding: 2px 11px;
}

.aos-order-menu-table tbody input[type="number"] {
	min-height: 30px;
	padding: 2px 10px;
}

.aos-order-menu-table tbody input[type="number"].aos-qty-highlight {
	color: var(--aos-qty-highlight);
	font-weight: 700;
}

.aos-order-menu-table .aos-order-col-category,
.aos-order-menu-table .aos-order-col-price,
.aos-order-menu-table .aos-order-col-qty,
.aos-order-menu-table .aos-order-col-total {
	white-space: nowrap;
}

.aos-order-menu-table .aos-order-col-category {
	width: 112px;
}

.aos-order-menu-table .aos-order-col-price,
.aos-order-menu-table .aos-order-col-total {
	width: 128px;
}

.aos-order-menu-table .aos-order-col-qty {
	width: 134px;
}

.aos-order-sortable {
	white-space: nowrap;
}

.aos-order-sort-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-weight: 700;
	color: inherit;
	cursor: pointer;
}

.aos-order-sort-trigger:focus {
	outline: 2px solid rgba(245, 158, 11, 0.35);
	outline-offset: 2px;
}

.aos-order-sort-indicator {
	display: inline-block;
	width: 10px;
	line-height: 1;
	font-size: 11px;
	color: transparent;
}

.aos-order-sortable.is-active .aos-order-sort-indicator {
	color: var(--aos-active);
	font-weight: 700;
}

.aos-order-sortable.is-active .aos-order-sort-trigger {
	color: #b45309;
}

.aos-shell-note {
	margin-bottom: 10px;
	font-size: 13px;
	color: var(--aos-muted);
}

.aos-clone-messages {
	margin-bottom: 10px;
}

.aos-history-duplicate-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 260px;
	padding: 12px;
	border: 1px solid #d7e2f2;
	border-radius: 12px;
	background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.aos-history-inline-form {
	display: inline-flex;
	margin: 0;
}

.aos-history-order-cell,
.aos-history-actions-cell {
	vertical-align: top;
}

.aos-history-order-main {
	word-break: break-word;
}

.aos-history-order-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-start;
	margin-top: 16px;
}

.aos-history-order-actions .aos-history-action-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	width: 100%;
	max-width: 120px;
	padding: 9px 14px;
	border-radius: 10px;
	text-align: center;
	white-space: nowrap;
}

.aos-history-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
	min-width: 280px;
}

.aos-history-actions > .aos-button,
.aos-history-actions > .aos-history-inline-form {
	flex: 0 0 auto;
}

.aos-history-duplicate-fields {
	display: grid;
	gap: 10px;
}

.aos-duplicate-field {
	display: block;
}

.aos-duplicate-label {
	display: block;
	margin-bottom: 5px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #475569;
}

.aos-history-button-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: stretch;
}

.aos-history-empty-action {
	display: inline-block;
	color: var(--aos-muted);
	font-size: 13px;
	font-weight: 500;
}

.aos-history-row-active {
	background: #fff7ed;
}

.aos-history-detail-card h4 {
	margin: 18px 0 12px;
	color: var(--aos-text);
}

.aos-history-detail-head {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 18px;
	align-items: flex-start;
	justify-content: space-between;
}

.aos-history-detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.aos-history-detail-meta {
	margin-top: 12px;
}

.aos-history-detail-table .aos-history-qty-value {
	color: var(--aos-qty-highlight);
	font-weight: 700;
}

.aos-history-inline-note {
	margin-top: 4px;
	font-size: 12px;
	color: var(--aos-muted);
}

.aos-duplicate-select {
	width: 100%;
	min-width: 0;
	max-width: none;
	padding: 10px 42px 10px 12px;
	min-height: 42px;
	border: 1px solid #b8c7dd;
	border-radius: 10px;
	background-color: var(--aos-white);
	background-image:
		linear-gradient(45deg, transparent 50%, #334155 50%),
		linear-gradient(135deg, #334155 50%, transparent 50%),
		linear-gradient(to right, #dbe4f0, #dbe4f0);
	background-position:
		calc(100% - 18px) calc(50% - 2px),
		calc(100% - 12px) calc(50% - 2px),
		calc(100% - 34px) 50%;
	background-size: 6px 6px, 6px 6px, 1px 22px;
	background-repeat: no-repeat;
	color: var(--aos-text);
	font-size: 13px;
	font-weight: 500;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.aos-duplicate-select::-ms-expand {
	display: none;
}

.aos-history-button-row .aos-history-action-button {
	display: inline-flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	width: 100%;
	padding: 9px 14px;
	border-radius: 10px;
	text-align: center;
	white-space: nowrap;
}

.aos-history-shell .aos-history-action-button.aos-button-primary {
	background: #2563eb;
}

.aos-button-compact {
	padding: 8px 12px;
	font-size: 13px;
	border-radius: 10px;
}

.aos-modal-open {
	overflow: hidden;
}

.aos-confirm-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	isolation: isolate;
}

.aos-confirm-modal.is-open {
	display: flex;
}

.aos-confirm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.aos-confirm-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 500px);
	padding: 28px;
	border: 1px solid #fecaca;
	border-radius: 22px;
	background: #ffffff !important;
	opacity: 1;
	box-shadow:
		0 28px 80px rgba(15, 23, 42, 0.3),
		0 10px 24px rgba(185, 28, 28, 0.12);
	overflow: hidden;
}

.aos-confirm-modal__dialog::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 6px;
	background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

.aos-confirm-modal__header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 18px;
}

.aos-confirm-modal__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	border-radius: 16px;
	background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
	color: #b91c1c;
	font-size: 1.65rem;
	font-weight: 700;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.aos-confirm-modal__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.aos-confirm-modal__eyebrow {
	display: inline-block;
	margin-bottom: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #fff1f2;
	color: #b91c1c;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.aos-confirm-modal__title {
	margin: 0;
	font-size: 1.42rem;
	line-height: 1.3;
	color: #111827;
}

.aos-confirm-modal__panel {
	padding: 16px 18px;
	border: 1px solid #fed7aa;
	border-radius: 16px;
	background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
}

.aos-confirm-modal__message {
	margin: 0;
	font-size: 1rem;
	line-height: 1.72;
	color: #1f2937;
	font-weight: 500;
}

.aos-confirm-modal__actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
}

.aos-confirm-modal__button {
	flex: 1 1 0;
	min-height: 48px;
	font-size: 0.98rem;
	border-radius: 14px;
	box-shadow: none;
}

.aos-confirm-modal__button.aos-button-danger {
	background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
}

.aos-confirm-modal__button.aos-button-secondary {
	border: 1px solid #cbd5e1;
	background: #f8fafc;
	color: #0f172a;
}

.aos-confirm-modal__button:focus-visible {
	outline: 3px solid rgba(245, 158, 11, 0.28);
	outline-offset: 2px;
}

.aos-notice-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	isolation: isolate;
}

.aos-notice-modal.is-open {
	display: flex;
}

.aos-notice-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.aos-notice-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 540px);
	padding: 28px;
	border-radius: 22px;
	background: #ffffff !important;
	opacity: 1;
	overflow: hidden;
}

.aos-notice-modal.is-error .aos-notice-modal__dialog {
	border: 1px solid #fecaca;
	box-shadow:
		0 28px 80px rgba(15, 23, 42, 0.3),
		0 10px 24px rgba(185, 28, 28, 0.12);
}

.aos-notice-modal.is-success .aos-notice-modal__dialog {
	border: 1px solid #a7f3d0;
	box-shadow:
		0 28px 80px rgba(15, 23, 42, 0.25),
		0 10px 24px rgba(5, 150, 105, 0.14);
}

.aos-notice-modal__dialog::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 6px;
}

.aos-notice-modal.is-error .aos-notice-modal__dialog::before {
	background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

.aos-notice-modal.is-success .aos-notice-modal__dialog::before {
	background: linear-gradient(90deg, #10b981 0%, #22c55e 100%);
}

.aos-notice-modal__header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 18px;
}

.aos-notice-modal__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.aos-notice-modal.is-error .aos-notice-modal__icon {
	background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
	color: #b91c1c;
}

.aos-notice-modal.is-success .aos-notice-modal__icon {
	background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
	color: #047857;
}

.aos-notice-modal__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.aos-notice-modal__eyebrow {
	display: inline-block;
	margin-bottom: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.aos-notice-modal.is-error .aos-notice-modal__eyebrow {
	background: #fff1f2;
	color: #b91c1c;
}

.aos-notice-modal.is-success .aos-notice-modal__eyebrow {
	background: #ecfdf5;
	color: #047857;
}

.aos-notice-modal__title {
	margin: 0;
	font-size: 1.4rem;
	line-height: 1.3;
	color: #111827;
}

.aos-notice-modal__panel {
	padding: 16px 18px;
	border-radius: 16px;
}

.aos-notice-modal.is-error .aos-notice-modal__panel {
	border: 1px solid #fed7aa;
	background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
}

.aos-notice-modal.is-success .aos-notice-modal__panel {
	border: 1px solid #a7f3d0;
	background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}

.aos-notice-modal__message,
.aos-notice-modal__rich {
	margin: 0;
	font-size: 1rem;
	line-height: 1.72;
	color: #1f2937;
	font-weight: 500;
}

.aos-notice-modal__rich ul {
	margin: 0;
	padding-left: 22px;
}

.aos-notice-modal__rich li + li {
	margin-top: 10px;
}

.aos-notice-modal__list {
	margin: 0;
	padding-left: 22px;
	font-size: 1rem;
	line-height: 1.7;
	color: #1f2937;
	font-weight: 500;
}

.aos-notice-modal__list-item + .aos-notice-modal__list-item {
	margin-top: 10px;
}

.aos-notice-modal__actions {
	display: flex;
	margin-top: 20px;
}

.aos-notice-modal__button {
	flex: 1 1 auto;
	min-height: 48px;
	font-size: 0.98rem;
	border-radius: 14px;
	box-shadow: none;
}

.aos-notice-modal.is-success .aos-notice-modal__button {
	background: linear-gradient(180deg, #059669 0%, #047857 100%);
}

.aos-notice-modal__button:focus-visible {
	outline: 3px solid rgba(245, 158, 11, 0.28);
	outline-offset: 2px;
}

@media (min-width: 769px) {
	.aos-order-controls {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.aos-order-controls.has-location-select .aos-order-control-location {
		grid-column: 1;
	}

	.aos-order-controls.has-location-select .aos-order-control-date {
		grid-column: 2;
	}

	.aos-order-controls.has-location-select .aos-order-control-duplicate {
		grid-column: 3;
		align-self: end;
	}

	.aos-order-controls.has-location-select .aos-order-control-category {
		grid-column: 1;
	}

	.aos-order-controls.has-location-select .aos-order-control-search {
		grid-column: 2;
	}
}

@media (max-width: 768px) {
	.aos-portal {
		padding: 0 10px;
	}

	.aos-agent-info {
		grid-template-columns: 1fr;
	}

	.aos-card {
		padding: 13px;
	}

	.aos-order-table {
		min-width: 640px;
	}

	.aos-order-table th,
	.aos-order-table td {
		padding: 8px;
	}

	.aos-order-table input[type="number"] {
		width: 92px;
		min-height: 40px;
	}

	.aos-button {
		width: 100%;
		text-align: center;
	}

	.aos-history-actions .aos-button,
	.aos-history-actions .aos-history-inline-form,
	.aos-history-detail-actions .aos-button,
	.aos-history-detail-actions .aos-history-inline-form {
		width: 100%;
	}

	.aos-history-action-button {
		flex: 1 1 auto;
		width: 100%;
	}

	.aos-history-order-actions .aos-history-action-button {
		max-width: none;
	}

	.aos-history-inline-form .aos-button {
		width: 100%;
	}

	.aos-history-duplicate-form {
		min-width: 0;
	}

	.aos-confirm-modal {
		padding: 14px;
	}

	.aos-confirm-modal__dialog {
		padding: 22px 18px 18px;
		border-radius: 18px;
	}

	.aos-confirm-modal__actions {
		flex-direction: column;
	}

	.aos-confirm-modal__header {
		gap: 12px;
	}

	.aos-confirm-modal__icon {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
		border-radius: 14px;
		font-size: 1.4rem;
	}

	.aos-confirm-modal__title {
		font-size: 1.2rem;
	}

	.aos-confirm-modal__panel {
		padding: 14px;
	}
}
