/**
 * Adworth Cargo Management System - Frontend Stylesheet
 * Responsive, modern design system for public & staff operations.
 */

:root {
	--acms-primary: #2d3192;
	--acms-primary-hover: #1f2266;
	--acms-primary-light: #eceef9;
	--acms-primary-tint: #f4f5fc;
	--acms-cta: #ff6600;
	--acms-cta-hover: #e65c00;
	--acms-cta-light: #fff4eb;
	--acms-cta-border: #ffd1b3;
	--acms-brand-head: #2d3192;
	--acms-brand-orange: #ff6600;
	--acms-secondary: #0f172a;
	--acms-bg: #f8fafc;
	--acms-card-bg: #ffffff;
	--acms-border: #e2e8f0;
	--acms-border-dark: #cbd5e1;
	--acms-text: #334155;
	--acms-text-dark: #0f172a;
	--acms-text-muted: #64748b;
	--acms-success: #059669;
	--acms-success-bg: #ecfdf5;
	--acms-warning: #d97706;
	--acms-warning-bg: #fffbeb;
	--acms-danger: #dc2626;
	--acms-danger-bg: #fef2f2;
	--acms-radius: 10px;
	--acms-radius-sm: 6px;
	--acms-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
	--acms-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--acms-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	--acms-sidebar-width: 240px;
	--acms-sidebar-collapsed-width: 64px;
	--acms-header-height: 60px;
}

/* ===== SITE HEADER (standalone pages) ===== */
.acms-site-header {
	background: var(--acms-brand-head, #2d3192);
	color: #ffffff;
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: var(--acms-shadow-md);
	border-bottom: 3px solid var(--acms-cta, #ff6600);
}

.acms-site-header-inner {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	height: var(--acms-header-height);
}

.acms-site-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: #ffffff;
	flex-shrink: 0;
}

.acms-site-logo {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: var(--acms-cta, #ff6600);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 16px;
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.acms-site-brand-text {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.acms-site-nav {
	display: flex;
	align-items: center;
	gap: 4px;
}

.acms-site-nav-link {
	padding: 8px 14px;
	border-radius: var(--acms-radius-sm);
	color: rgba(255,255,255,0.75);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.15s ease;
}

.acms-site-nav-link:hover,
.acms-site-nav-link.active {
	background: rgba(255,255,255,0.12);
	color: #ffffff;
}

.acms-site-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.acms-site-header-actions .acms-btn {
	font-size: 12px;
	padding: 6px 12px;
}

/* ===== SITE FOOTER (standalone pages) ===== */
.acms-site-footer {
	background: var(--acms-secondary);
	color: rgba(255,255,255,0.6);
	text-align: center;
	padding: 24px;
	font-size: 13px;
	margin-top: 40px;
}

.acms-site-footer a {
	color: rgba(255,255,255,0.8);
	text-decoration: none;
}

.acms-site-footer a:hover {
	color: #ffffff;
}

.acms-site-footer-links {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

/* ===== HUB FOOTER (inside dashboards) ===== */
.acms-hub-footer {
	border-top: 1px solid var(--acms-border);
	padding: 20px 30px;
	text-align: center;
	font-size: 12px;
	color: var(--acms-text-muted);
	background: var(--acms-card-bg);
	flex-shrink: 0;
	margin-top: auto;
}

.acms-hub-footer a {
	color: var(--acms-text-muted);
	text-decoration: none;
	margin: 0 10px;
}

.acms-hub-footer a:hover {
	color: var(--acms-primary);
}

.acms-hub-footer-links {
	margin-bottom: 6px;
}

/* ===== LAYOUT ===== */
.acms-container {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: var(--acms-text);
	background: var(--acms-bg);
	padding: 30px 24px;
	box-sizing: border-box;
	line-height: 1.5;
	min-height: 100vh;
}

.acms-shell {
	max-width: 1200px;
	margin: 0 auto;
}

/* ===== SIDEBAR HUB LAYOUT ===== */
.acms-hub-layout {
	display: grid;
	grid-template-columns: var(--acms-sidebar-width) 1fr;
	gap: 0;
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	transition: grid-template-columns 0.25s ease;
}

.acms-sidebar {
	background: var(--acms-card-bg);
	border-right: 1px solid var(--acms-border);
	padding: 20px 0;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	overflow-x: hidden;
	transition: width 0.25s ease;
}

/* ===== COLLAPSIBLE SIDEBAR ===== */
.acms-sidebar-collapse-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background: transparent;
	border: 0;
	border-top: 1px solid var(--acms-border);
	padding: 8px 0;
	margin-top: 8px;
	cursor: pointer;
	color: var(--acms-text-muted);
	font-size: 12px;
	transition: background 0.15s ease, color 0.15s ease;
}

.acms-sidebar-collapse-btn:hover {
	background: var(--acms-primary-light);
	color: var(--acms-primary);
}

/* Sidebar collapsed state */
.acms-hub-layout.sidebar-collapsed {
	grid-template-columns: var(--acms-sidebar-collapsed-width) 1fr;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar {
	width: var(--acms-sidebar-collapsed-width);
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-nav-link {
	justify-content: center;
	padding: 12px 0;
	gap: 0;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-nav-text,
.acms-hub-layout.sidebar-collapsed .acms-sidebar-user-name,
.acms-hub-layout.sidebar-collapsed .acms-sidebar-user-role,
.acms-hub-layout.sidebar-collapsed .acms-sidebar-nav-badge {
	display: none;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-user {
	padding: 0 0 16px;
	text-align: center;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-footer {
	padding: 16px 0 0;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-logout {
	justify-content: center;
	padding-left: 0;
	padding-right: 0;
	width: 100%;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-logout .acms-sidebar-nav-text {
	display: none;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-collapse-btn .acms-sidebar-collapse-icon {
	transform: rotate(180deg);
}

.acms-sidebar-collapse-icon {
	display: inline-block;
	transition: transform 0.25s ease;
}

.acms-sidebar-user {
	padding: 0 20px 16px;
	border-bottom: 1px solid var(--acms-border);
	margin-bottom: 12px;
	overflow: hidden;
	white-space: nowrap;
	transition: padding 0.25s ease;
}

.acms-hub-layout.sidebar-collapsed .acms-sidebar-user {
	padding: 0 0 16px;
}

.acms-sidebar-user-name {
	font-weight: 700;
	font-size: 14px;
	color: var(--acms-secondary);
	margin-bottom: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.acms-sidebar-user-role {
	font-size: 12px;
	color: var(--acms-text-muted);
	overflow: hidden;
	text-overflow: ellipsis;
}

.acms-sidebar-nav {
	list-style: none;
	padding: 0;
	margin: 0;
}

.acms-sidebar-nav-item {
	margin: 0;
}

.acms-sidebar-nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	color: var(--acms-text);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.15s ease;
	border-left: 3px solid transparent;
	white-space: nowrap;
	overflow: hidden;
}

.acms-sidebar-nav-link:hover {
	background: var(--acms-primary-light);
	color: var(--acms-primary);
	border-left-color: var(--acms-primary);
}

.acms-sidebar-nav-link.active {
	background: var(--acms-primary-light);
	color: var(--acms-primary);
	border-left-color: var(--acms-primary);
	font-weight: 700;
}

.acms-sidebar-nav-icon {
	width: 20px;
	text-align: center;
	flex-shrink: 0;
	font-size: 14px;
}

.acms-sidebar-nav-text {
	overflow: hidden;
	text-overflow: ellipsis;
}

.acms-sidebar-nav-badge {
	margin-left: auto;
	background: var(--acms-danger);
	color: #ffffff;
	font-size: 10px;
	padding: 2px 7px;
	border-radius: 10px;
	font-weight: 700;
	line-height: 1.3;
	flex-shrink: 0;
}

.acms-sidebar-footer {
	padding: 16px 20px 0;
	margin-top: 12px;
	border-top: 1px solid var(--acms-border);
	display: flex;
	flex-direction: column;
	gap: 0;
}

.acms-hub-content {
	padding: 24px 30px;
	background: var(--acms-bg);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	box-sizing: border-box;
}

.acms-hub-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--acms-border);
	flex-shrink: 0;
}

.acms-hub-topbar-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--acms-secondary);
	margin: 0;
}

.acms-hub-topbar-actions {
	display: flex;
	gap: 8px;
}

/* ===== HEADER & TYPOGRAPHY ===== */
.acms-header {
	margin-bottom: 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.acms-kicker {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--acms-primary);
	margin-bottom: 4px;
}

.acms-title {
	font-size: 26px;
	font-weight: 700;
	color: var(--acms-secondary);
	margin: 0;
}

.acms-subtitle {
	color: var(--acms-text-muted);
	font-size: 14px;
	margin: 4px 0 0;
}

/* ===== TAB NAVIGATION (horizontal - kept for backwards compat) ===== */
.acms-nav-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	background: #ffffff;
	padding: 8px;
	border-radius: var(--acms-radius);
	border: 1px solid var(--acms-border);
	margin-bottom: 24px;
	box-shadow: var(--acms-shadow);
}

.acms-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: var(--acms-radius-sm);
	color: var(--acms-text);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.15s ease;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.acms-nav-link:hover {
	background: var(--acms-primary-light);
	color: var(--acms-primary);
}

.acms-nav-link.active {
	background: var(--acms-primary);
	color: #ffffff;
}

.acms-nav-badge {
	background: rgba(0, 0, 0, 0.15);
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 10px;
	line-height: 1;
}

.acms-tab-content {
	display: none;
	flex: 1;
}

.acms-tab-content.active {
	display: block;
	animation: acmsFadeIn 0.2s ease-in-out;
	flex: 1;
}

@keyframes acmsFadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ===== KPI CARDS ===== */
.acms-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.acms-kpi-card {
	background: var(--acms-card-bg);
	border: 1px solid var(--acms-border);
	border-radius: var(--acms-radius);
	padding: 18px;
	box-shadow: var(--acms-shadow);
	position: relative;
	overflow: hidden;
}

.acms-kpi-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--acms-primary);
}

.acms-kpi-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--acms-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.acms-kpi-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--acms-secondary);
	margin-top: 6px;
	line-height: 1.1;
}

/* ===== CARDS ===== */
.acms-card {
	background: var(--acms-card-bg);
	border: 1px solid var(--acms-border);
	border-radius: var(--acms-radius);
	padding: 24px;
	box-shadow: var(--acms-shadow);
	margin-bottom: 24px;
}

.acms-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--acms-border);
	padding-bottom: 14px;
	margin-bottom: 18px;
}

.acms-card-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: var(--acms-secondary);
}

/* ===== TOOLBAR & FILTERS ===== */
.acms-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}

.acms-search-form {
	display: flex;
	gap: 8px;
	flex: 1;
	max-width: 450px;
}

.acms-filter-group {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ===== TABLES ===== */
.acms-table-responsive {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--acms-radius-sm);
	border: 1px solid var(--acms-border);
	background: #ffffff;
}

.acms-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	text-align: left;
}

.acms-table th {
	background: var(--acms-brand-head, #2d3192);
	color: #ffffff;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.05em;
	padding: 12px 14px;
	border-bottom: 2px solid var(--acms-cta, #ff6600);
	white-space: nowrap;
}

.acms-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--acms-border);
	vertical-align: middle;
}

.acms-table tr:last-child td {
	border-bottom: 0;
}

.acms-table tr:hover td {
	background: var(--acms-primary-tint, #f4f5fc);
}

/* ===== SORTABLE TABLE HEADERS ===== */
.acms-table-sortable th[data-sort] {
	cursor: pointer;
	user-select: none;
	position: relative;
	padding-right: 24px;
}

.acms-table-sortable th[data-sort]:hover {
	background: var(--acms-primary-hover, #1f2266);
	color: #ffffff;
}

.acms-table-sortable th[data-sort]:after {
	content: " ⇅";
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	position: absolute;
	right: 6px;
}

.acms-table-sortable th.sort-asc[data-sort]:after {
	content: " ↑";
	color: var(--acms-cta, #ff6600);
}

.acms-table-sortable th.sort-desc[data-sort]:after {
	content: " ↓";
	color: var(--acms-cta, #ff6600);
}

/* ===== BADGES ===== */
.acms-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
}

.acms-badge-pending { background: #fef3c7; color: #92400e; }
.acms-badge-approved { background: #ecfdf5; color: #059669; }
.acms-badge-rejected { background: #fee2e2; color: #991b1b; }
.acms-badge-status { background: #eceef9; color: #2d3192; }
.acms-badge-paid { background: #ecfdf5; color: #059669; }
.acms-badge-delivered { background: #ecfdf5; color: #059669; }
.acms-badge-intransit { background: #fff4eb; color: #c2410c; border: 1px solid #ffd1b3; }

.acms-doc-label {
	display: block;
	margin: 0 0 2px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--acms-text-muted, #64748b);
}

.acms-booking-actions {
	border: 1px solid var(--acms-border, #e2e8f0);
	background: var(--acms-surface, #ffffff);
	cursor: pointer;
	color: var(--acms-text, #0f172a);
}
.acms-booking-actions:focus { outline: 2px solid var(--acms-primary, #2d3192); outline-offset: 1px; }


/* ===== BUTTONS ===== */
.acms-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: var(--acms-radius-sm);
	font-size: 13px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s ease;
	line-height: 1.4;
	white-space: nowrap;
}

.acms-btn-primary,
.acms-btn-cta {
	background: var(--acms-cta, #ff6600);
	color: #ffffff;
	box-shadow: 0 2px 5px rgba(255, 102, 0, 0.25);
}

.acms-btn-primary:hover,
.acms-btn-cta:hover {
	background: var(--acms-cta-hover, #e65c00);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(255, 102, 0, 0.35);
}

.acms-btn-navy,
.acms-btn-brand {
	background: var(--acms-brand-head, #2d3192);
	color: #ffffff;
}

.acms-btn-navy:hover,
.acms-btn-brand:hover {
	background: var(--acms-primary-hover, #1f2266);
	color: #ffffff;
}

.acms-btn-secondary {
	background: #ffffff;
	border-color: var(--acms-border);
	color: var(--acms-text);
}

.acms-btn-secondary:hover {
	background: #f1f5f9;
	color: var(--acms-secondary);
}

.acms-btn-success {
	background: var(--acms-success);
	color: #ffffff;
}

.acms-btn-danger {
	background: var(--acms-danger);
	color: #ffffff;
}

.acms-btn-sm {
	padding: 4px 10px;
	font-size: 12px;
}

/* ===== FORMS & INPUTS ===== */
.acms-form-group {
	margin-bottom: 16px;
}

.acms-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--acms-secondary);
	margin-bottom: 5px;
}

.acms-input,
.acms-select,
.acms-textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid var(--acms-border);
	border-radius: var(--acms-radius-sm);
	font-size: 14px;
	color: var(--acms-text);
	background: #ffffff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.acms-input:focus,
.acms-select:focus,
.acms-textarea:focus {
	outline: none;
	border-color: var(--acms-primary);
	box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.acms-textarea {
	min-height: 80px;
	resize: vertical;
}

.acms-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.acms-grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.acms-grid-4 {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.acms-fieldset {
	border: 1px solid var(--acms-border);
	border-radius: var(--acms-radius-sm);
	padding: 16px;
	margin-bottom: 16px;
	background: #ffffff;
}

.acms-legend {
	font-size: 13px;
	font-weight: 700;
	color: var(--acms-primary);
	padding: 0 6px;
}

/* ===== TIMELINE ===== */
.acms-timeline {
	list-style: none;
	padding: 0;
	margin: 0;
	position: relative;
}

.acms-timeline-item {
	display: flex;
	gap: 14px;
	padding-bottom: 20px;
	position: relative;
}

.acms-timeline-item:last-child {
	padding-bottom: 0;
}

.acms-timeline-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--acms-primary);
	margin-top: 5px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.acms-timeline-line {
	position: absolute;
	left: 5px;
	top: 17px;
	bottom: 0;
	width: 2px;
	background: var(--acms-border);
}

.acms-timeline-item:last-child .acms-timeline-line {
	display: none;
}

.acms-timeline-content {
	flex: 1;
}

.acms-timeline-time {
	font-size: 11px;
	color: var(--acms-text-muted);
}

/* ===== ALERTS ===== */
.acms-alert {
	padding: 12px 16px;
	border-radius: var(--acms-radius-sm);
	margin-bottom: 18px;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.acms-alert-success { background: var(--acms-success-bg); color: #166534; border: 1px solid #bbf7d0; }
.acms-alert-error { background: var(--acms-danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.acms-alert-warning { background: var(--acms-warning-bg); color: #92400e; border: 1px solid #fde68a; }

/* ===== CUSTOMER PROFILE & CARDS ===== */
.acms-customer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

.acms-customer-card {
	background: #ffffff;
	border: 1px solid var(--acms-border);
	border-radius: var(--acms-radius);
	padding: 16px;
	text-decoration: none;
	color: inherit;
	display: flex;
	gap: 14px;
	align-items: center;
	transition: all 0.15s ease;
}

.acms-customer-card:hover {
	border-color: var(--acms-primary);
	box-shadow: var(--acms-shadow-md);
	transform: translateY(-1px);
}

.acms-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--acms-primary-light);
	color: var(--acms-primary);
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.acms-avatar-lg {
	width: 64px;
	height: 64px;
	font-size: 24px;
}

/* ===== MODAL ===== */
.acms-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.acms-modal-backdrop.active {
	opacity: 1;
	visibility: visible;
}

.acms-modal {
	background: #ffffff;
	border-radius: var(--acms-radius);
	max-width: 680px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: var(--acms-shadow-lg);
	padding: 24px;
	position: relative;
}

.acms-modal-close {
	position: absolute;
	top: 18px;
	right: 18px;
	background: transparent;
	border: 0;
	font-size: 20px;
	cursor: pointer;
	color: var(--acms-text-muted);
}

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.acms-mobile-sidebar-toggle {
	display: none;
	background: var(--acms-primary);
	color: #ffffff;
	border: 0;
	border-radius: var(--acms-radius-sm);
	padding: 6px 10px;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}

/* ===== ITEMS TO SHIP LIST ===== */
.acms-items-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 8px;
}
.acms-item-row {
	display: flex;
	align-items: center;
	gap: 6px;
}
.acms-item-row .acms-input {
	flex: 1;
	min-width: 0;
}
.acms-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border: 1px solid var(--acms-border);
	border-radius: 6px;
	background: var(--acms-card-bg);
	color: var(--acms-text-muted);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.acms-btn-icon:hover {
	background: #fee2e2;
	color: #dc2626;
	border-color: #fca5a5;
}
.acms-item-add {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--acms-primary);
	background: transparent;
	border: 1px dashed var(--acms-primary);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.acms-item-add:hover {
	background: var(--acms-primary-light);
}

/* ===== DISABLED TRACK BUTTON (cancelled bookings) ===== */
.acms-track-disabled {
	position: relative;
	cursor: not-allowed !important;
	opacity: 0.55;
	pointer-events: auto;
	user-select: none;
	display: inline-flex;
	align-items: center;
}
.acms-track-disabled:hover {
	filter: none;
}
.acms-hover-tip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background: #1e293b;
	color: #ffffff;
	font-size: 11px;
	font-weight: 500;
	padding: 5px 10px;
	border-radius: 6px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, transform 0.15s ease;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
	z-index: 60;
}
.acms-hover-tip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1e293b;
}
.acms-track-disabled:hover .acms-hover-tip,
.acms-track-disabled:focus .acms-hover-tip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */

/* Phones only: sidebar becomes off-canvas, hamburger appears */
@media (max-width: 768px) {
	.acms-hub-layout,
	.acms-hub-layout.sidebar-collapsed {
		grid-template-columns: 1fr;
	}
	.acms-sidebar,
	.acms-hub-layout.sidebar-collapsed .acms-sidebar {
		position: fixed;
		top: 0;
		left: -300px;
		width: 280px;
		max-width: 85vw;
		height: 100vh;
		height: 100dvh;
		z-index: 900;
		box-shadow: var(--acms-shadow-lg);
		transition: left 0.3s ease;
	}
	.acms-sidebar.open {
		left: 0;
	}
	.acms-hub-content,
	.acms-hub-layout.sidebar-collapsed .acms-hub-content {
		padding: 16px;
		min-height: 100vh;
		min-height: 100dvh;
		width: auto;
	}
	/* Hamburger visible on phones only */
	.acms-mobile-sidebar-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		font-size: 18px;
		border-radius: 8px;
		touch-action: manipulation;
	}
	/* Inline-collapse arrow is a desktop control */
	.acms-sidebar-collapse-btn {
		display: none !important;
	}
}

/* Phones */
@media (max-width: 768px) {
	.acms-grid-2,
	.acms-grid-3,
	.acms-grid-4 {
		grid-template-columns: 1fr;
	}
	.acms-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.acms-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}
	.acms-toolbar .acms-btn {
		align-self: flex-start;
	}
	.acms-search-form {
		max-width: 100%;
	}
	.acms-search-form .acms-input {
		flex: 1 1 auto;
		width: 100%;
	}
	.acms-kpi-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.acms-site-nav {
		display: none;
	}
	.acms-site-header-inner {
		padding: 0 16px;
		height: auto;
		min-height: 56px;
		flex-wrap: wrap;
		gap: 8px;
	}
	.acms-hub-topbar {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.acms-card-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.acms-card-header .acms-btn {
		align-self: flex-start;
	}
	.acms-hub-footer {
		padding: 16px;
		text-align: center;
	}
	.acms-hub-footer nav {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 10px;
	}
	/* Tables stay scrollable instead of breaking layout */
	.acms-table-responsive {
		margin: 0 -16px;
		padding: 0 16px;
	}
}

/* Small phones */
@media (max-width: 480px) {
	.acms-container {
		padding: 16px 12px;
	}
	.acms-kpi-grid {
		grid-template-columns: 1fr;
	}
	.acms-title {
		font-size: 22px;
	}
	.acms-site-brand-text {
		font-size: 15px;
	}
	.acms-table {
		font-size: 12px;
	}
	.acms-table th,
	.acms-table td {
		padding: 8px 10px;
	}
	.acms-btn {
		padding: 7px 12px;
		font-size: 12px;
	}
	.acms-card {
		padding: 16px;
	}
	.acms-fieldset {
		padding: 12px;
	}
	.acms-hub-content {
		padding: 12px;
	}
}

/* Sidebar overlay backdrop for mobile */
.acms-sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.4);
	z-index: 899;
}

.acms-sidebar-overlay.active {
	display: block;
}

/* ===== NOTIFICATION TOASTS ===== */
.acms-toast-stack {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: min(360px, calc(100vw - 40px));
}
.acms-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #ffffff;
	color: #1e293b;
	border: 1px solid var(--acms-border, #e2e8f0);
	border-left: 4px solid var(--acms-cta, #ff6600);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
	padding: 12px 14px;
	cursor: pointer;
	opacity: 0;
	transform: translateX(30px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.acms-toast.acms-toast-in {
	opacity: 1;
	transform: translateX(0);
}
.acms-toast-icon {
	font-size: 20px;
	line-height: 1.2;
}
.acms-toast-body {
	flex: 1;
	min-width: 0;
}
.acms-toast-body strong {
	display: block;
	font-size: 13px;
	margin-bottom: 2px;
}
.acms-toast-body p {
	margin: 0;
	font-size: 12px;
	color: #475569;
	overflow-wrap: break-word;
}
.acms-toast-body small {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: #94a3b8;
}
.acms-toast-close {
	background: none;
	border: 0;
	font-size: 16px;
	line-height: 1;
	color: #94a3b8;
	cursor: pointer;
	padding: 2px;
}
.acms-toast-close:hover {
	color: #1e293b;
}

/* Notification list */
.acms-notification-item.acms-notification-unread {
	background: var(--acms-primary-light, #eceef9);
	border-radius: 8px;
	padding-left: 10px !important;
	padding-right: 10px !important;
}
.acms-notification-item.acms-notification-unread strong::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--acms-cta, #ff6600);
	margin-right: 6px;
	vertical-align: middle;
}

@media (max-width: 480px) {
	.acms-toast-stack {
		bottom: 12px;
		right: 12px;
		left: 12px;
		max-width: none;
	}
}

/* ===== CITY TYPEAHEAD ===== */
.acms-ac-list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid var(--acms-border, #e2e8f0);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
	z-index: 50;
	max-height: 220px;
	overflow: auto;
	margin-top: 4px;
}
.acms-ac-item {
	padding: 9px 12px;
	font-size: 13px;
	cursor: pointer;
	color: var(--acms-text, #1e293b);
}
.acms-ac-item:hover,
.acms-ac-item.acms-ac-active {
	background: var(--acms-primary, #2d3192);
	color: #ffffff;
}

/* ===== CORPORATE DOCUMENT VIEWS (INVOICE, RECEIPT, WAYBILL) ===== */
.acms-legacy-route-delivery { display: none; }
.acms-doc-shell {
	background: #ffffff;
	border-radius: 12px;
	border: 1px solid var(--acms-border, #e2e8f0);
	box-shadow: var(--acms-shadow-md);
	overflow: hidden;
	margin-bottom: 24px;
}

.acms-doc-header-banner {
	background: var(--acms-brand-head, #2d3192);
	color: #ffffff;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 3px solid var(--acms-cta, #ff6600);
}

.acms-doc-header-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.acms-doc-header-title {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0;
	color: #ffffff;
}

.acms-doc-header-subtitle {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.75);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-top: 2px;
}

.acms-doc-route-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--acms-primary-light, #eceef9);
	color: var(--acms-primary, #2d3192);
	padding: 6px 14px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 700;
}

.acms-doc-route-arrow {
	color: var(--acms-cta, #ff6600);
	font-weight: 900;
}

.acms-doc-action-group {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.acms-doc-action-group .acms-btn {
	font-size: 12px;
	padding: 6px 12px;
}
