/*
 * AH Maitla styles on top of AdminLTE 4 / Bootstrap 5.
 * Kept small: brand colours, shared table styles, and a few Bootstrap 3
 * class names that pages and scripts still use.
 */

/* =====================================================================
   Theme: dark navy sidebar, white top bar, indigo accent, soft cards
   ===================================================================== */
:root,
[data-bs-theme=light] {
	--maitla-navy: #0f172a;
	--maitla-navy-2: #111c33;
	--maitla-indigo: #4f46e5;
	--maitla-indigo-dark: #4338ca;
	--maitla-bg: #f4f6fb;
	--maitla-border: #e6e9f0;
	--maitla-muted: #64748b;
	--maitla-purple: var(--maitla-indigo); /* older rules use this name */

	--bs-primary: #4f46e5;
	--bs-primary-rgb: 79, 70, 229;
	--bs-link-color: #4f46e5;
	--bs-link-color-rgb: 79, 70, 229;
	--bs-link-hover-color: #4338ca;
	--bs-body-font-family: "Inter", "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bs-body-font-size: 0.9rem;
	--bs-body-color: #1e293b;
	--bs-border-color: #e6e9f0;
	--bs-border-radius: 0.5rem;
	--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
}
body.app-theme {
	background-color: var(--maitla-bg);
	font-family: var(--bs-body-font-family);
	-webkit-font-smoothing: antialiased;
}

/* primary buttons and form focus in indigo */
.btn-primary {
	--bs-btn-bg: var(--maitla-indigo);
	--bs-btn-border-color: var(--maitla-indigo);
	--bs-btn-hover-bg: var(--maitla-indigo-dark);
	--bs-btn-hover-border-color: var(--maitla-indigo-dark);
	--bs-btn-active-bg: var(--maitla-indigo-dark);
	--bs-btn-active-border-color: var(--maitla-indigo-dark);
	--bs-btn-disabled-bg: var(--maitla-indigo);
	--bs-btn-disabled-border-color: var(--maitla-indigo);
}
.btn-outline-primary {
	--bs-btn-color: var(--maitla-indigo);
	--bs-btn-border-color: var(--maitla-indigo);
	--bs-btn-hover-bg: var(--maitla-indigo);
	--bs-btn-hover-border-color: var(--maitla-indigo);
	--bs-btn-active-bg: var(--maitla-indigo);
	--bs-btn-active-border-color: var(--maitla-indigo);
}
.btn {
	border-radius: 0.5rem;
	font-weight: 500;
}
.form-control,
.form-select,
.ts-control,
.input-group-text {
	border-radius: 0.5rem;
	border-color: #dbe0ea;
}
.form-control:focus,
.form-select:focus,
.ts-wrapper.focus .ts-control {
	border-color: #a5b4fc;
	box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}
.form-control[readonly] {
	background-color: #f8fafc;
}
label,
.form-label {
	font-weight: 500;
	color: #334155;
	margin-bottom: 0.3rem;
}

/* ---- top bar: white, thin border ---- */
.app-header {
	background-color: #fff !important;
	border-bottom: 1px solid var(--maitla-border) !important;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.app-header .nav-link {
	color: #334155 !important;
}
.topbar-date {
	font-size: 0.85rem;
	color: var(--maitla-muted);
	padding-left: 0.5rem;
}

/* ---- sidebar: dark navy ---- */
.app-sidebar {
	background: linear-gradient(180deg, var(--maitla-navy) 0%, var(--maitla-navy-2) 100%) !important;
	border-right: 0;
	box-shadow: 2px 0 12px rgba(15, 23, 42, 0.18);
}
.app-sidebar .sidebar-brand {
	background-color: transparent;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-sidebar .brand-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}
.app-sidebar .brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	background: linear-gradient(135deg, #6366f1, #4338ca);
	color: #fff;
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	box-shadow: 0 4px 10px rgba(79, 70, 229, 0.45);
}
.app-sidebar .brand-text {
	color: #f8fafc;
	font-weight: 700;
	font-size: 1rem;
}
.app-sidebar .user-panel {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0.85rem 0.75rem 0.5rem;
	padding: 0.6rem 0.7rem;
	border-radius: 0.6rem;
	background: rgba(255, 255, 255, 0.05);
}
.app-sidebar .user-panel img {
	width: 2.25rem;
	height: 2.25rem;
}
.app-sidebar .user-panel .info p {
	margin: 0;
	line-height: 1.25;
	color: #e2e8f0;
}
.app-sidebar .user-panel .info p.small {
	color: #94a3b8;
	font-size: 0.75rem;
}
.app-sidebar .sidebar-menu .nav-header {
	color: #64748b;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
}
.app-sidebar .sidebar-menu .nav-link {
	color: #cbd5e1;
	border-radius: 0.5rem;
	margin: 1px 0.5rem;
	width: auto;
}
.app-sidebar .sidebar-menu .nav-link .nav-icon {
	color: #94a3b8;
}
.app-sidebar .sidebar-menu .nav-link:hover {
	color: #fff;
	background-color: rgba(255, 255, 255, 0.06);
}
.app-sidebar .sidebar-menu .nav-link.active,
.app-sidebar .sidebar-menu .menu-group > .nav-link.active {
	color: #fff !important;
	background-color: rgba(99, 102, 241, 0.18) !important;
}
.app-sidebar .sidebar-menu .nav-treeview .nav-link.active {
	background-color: var(--maitla-indigo) !important;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.app-sidebar .sidebar-menu .nav-link.active .nav-icon {
	color: #fff;
}
.app-sidebar .sidebar-menu .nav-treeview .nav-link {
	padding-left: 1.6rem;
	font-size: 0.85rem;
}
.app-sidebar .sidebar-tools .form-control,
.app-sidebar .sidebar-tools .btn {
	background-color: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.1);
	color: #e2e8f0;
}
.app-sidebar .sidebar-tools .form-control::placeholder {
	color: #94a3b8;
}
.app-sidebar .sidebar-tools .btn:hover {
	background-color: rgba(255, 255, 255, 0.12);
}

/* sidebar search / sort / bookmark bar */
.sidebar-tools {
	padding: 0.5rem 0.75rem;
}
.sidebar-menu .nav-link .menu-group {
	font-size: 0.75rem;
	opacity: 0.6;
	margin-left: 0.25rem;
}

/* ---- cards: rounded, borderless, soft shadow ---- */
.app-main .card {
	border: 1px solid var(--maitla-border);
	border-radius: 0.85rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
}
.app-main .card.card-outline {
	border-top: 1px solid var(--maitla-border);
}
.app-main .card > .card-header {
	background-color: transparent;
	border-bottom: 1px solid var(--maitla-border);
	padding: 0.9rem 1.25rem;
}
.app-main .card > .card-body {
	padding: 1.25rem;
}
.app-main .card > .card-footer {
	background-color: #fafbfd;
	border-top: 1px solid var(--maitla-border);
	border-radius: 0 0 0.85rem 0.85rem;
}
.app-main .card-title {
	font-weight: 600;
	font-size: 1rem;
	color: #0f172a;
}

/* ---- page title row ---- */
.app-content-header h1 {
	font-weight: 700 !important;
	color: #0f172a;
	letter-spacing: -0.01em;
}
.page-crumbs {
	font-size: 0.8rem;
	color: var(--maitla-muted);
	margin-top: 0.15rem;
}
.page-crumbs a {
	color: var(--maitla-muted);
	text-decoration: none;
}
.page-crumbs a:hover {
	color: var(--maitla-indigo);
}

/* ---- tables: light header, no heavy grid ---- */
.app-main .table {
	--bs-table-striped-bg: #fafbfd;
	--bs-table-hover-bg: #f1f3fc;
	font-size: 0.875rem;
}
.app-main .table > thead > tr > th,
.app-main .table > thead > tr > td {
	background-color: #f8fafc;
	color: #475569;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-bottom: 1px solid var(--maitla-border);
}
.app-main .table-bordered > :not(caption) > * > * {
	border-width: 0 0 1px 0;
	border-color: var(--maitla-border);
}
.app-main .table-bordered > :not(caption) > * {
	border-width: 0;
}
.dt-container .dt-search input,
.dt-container .dt-length select {
	border-radius: 0.5rem;
}

/* ---- footer ---- */
.app-footer {
	background: transparent;
	border-top: 1px solid var(--maitla-border);
	color: var(--maitla-muted);
	font-size: 0.8rem;
}

/* ---- headline stat cards (dashboard) ---- */
.stat-card {
	display: flex;
	align-items: center;
	gap: 1rem;
	height: 100%;
	padding: 1.1rem 1.25rem;
	background: #fff;
	border: 1px solid var(--maitla-border);
	border-radius: 0.85rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
	text-decoration: none;
	color: inherit;
	transition: transform 0.15s, box-shadow 0.15s;
}
a.stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
	color: inherit;
}
.stat-card .stat-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 0.75rem;
	font-size: 1.2rem;
}
.stat-card .stat-label {
	font-size: 0.78rem;
	color: var(--maitla-muted);
	font-weight: 500;
}
.stat-card .stat-value {
	font-size: 1.45rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.2;
}
.stat-card .stat-sub {
	font-size: 0.75rem;
	color: var(--maitla-muted);
}
.stat-indigo .stat-icon { background: #eef2ff; color: #4f46e5; }
.stat-green .stat-icon { background: #ecfdf5; color: #059669; }
.stat-amber .stat-icon { background: #fffbeb; color: #d97706; }
.stat-rose .stat-icon { background: #fff1f2; color: #e11d48; }

/* ---- Bootstrap 3 names still used by pages and scripts ---- */
.hidden {
	display: none !important;
}
.form-group {
	margin-bottom: 1rem;
}
.help-block {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.875em;
	color: var(--bs-secondary-color);
}
.control-label {
	font-weight: 600;
}
.input-group-btn {
	display: flex;
}
.btn-flat {
	border-radius: 0;
}
.dl-horizontal dt {
	float: left;
	clear: left;
	width: 160px;
	text-align: right;
	font-weight: 600;
}
.dl-horizontal dd {
	margin-left: 180px;
	margin-bottom: 0.25rem;
}
@media (max-width: 575.98px) {
	.dl-horizontal dt {
		float: none;
		width: auto;
		text-align: left;
	}
	.dl-horizontal dd {
		margin-left: 0;
	}
}
.modal-header .btn-close {
	order: 2;
	margin-left: auto;
}
.text-green { color: var(--bs-success) !important; }
.text-red { color: var(--bs-danger) !important; }
.text-yellow { color: var(--bs-warning) !important; }
.text-aqua { color: var(--bs-info) !important; }
.bg-aqua { background-color: var(--bs-info) !important; color: #fff; }
.bg-green { background-color: var(--bs-success) !important; color: #fff; }
.bg-yellow { background-color: var(--bs-warning) !important; color: #fff; }
.bg-red { background-color: var(--bs-danger) !important; color: #fff; }

/* labels on form checkboxes in the role pages */
#rolelabel {
	margin-left: 15px;
	font-weight: 600;
}

/* ---- shared table styles (were inside header.php) ---- */
table.gridtable {
	margin: 0 auto;
	width: 95%;
	overflow: auto;
	font-family: helvetica, arial, sans-serif;
	font-size: 14px;
	color: #333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
	text-align: center;
}
table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #F6B4A5;
}
table.gridtable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
}

/* DataTables row-detail toggle */
td.details-control {
	cursor: pointer;
	text-align: center;
}
tbody td.details-control::before {
	content: "+";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 6px;
	background: #e0e7ff;
	color: #4338ca;
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	transition: background 0.15s, color 0.15s;
}
tbody td.details-control:hover::before {
	background: #4f46e5;
	color: #fff;
}
tbody tr.shown td.details-control::before {
	content: "\2212";
	background: #4f46e5;
	color: #fff;
}
/* the expand column is not something to sort by */
table.dataTable:has(td.details-control) thead tr > :first-child .dt-column-order {
	display: none;
}

/* ---- page frame: pages use .app-content-header / .app-content without
   AdminLTE 4's inner .container-fluid, so give them its padding here ---- */
.app-content-header {
	padding: 1rem 1rem 0.5rem;
}
.app-content-header h1 {
	font-size: 1.6rem;
	margin: 0;
}
.app-content-header h1 small {
	font-size: 0.95rem;
	color: var(--bs-secondary-color);
	font-weight: 400;
}
.app-content {
	padding: 0 1rem 1rem;
}
.app-main > .row,
.app-content-header > .card,
.app-main > .card {
	margin-left: 1rem;
	margin-right: 1rem;
}

/* ---- DataTables 2: let wide tables scroll sideways instead of squashing
   the column headers on small screens ---- */
.dt-container .dt-layout-table {
	overflow-x: auto;
}
table.dataTable > thead > tr > th {
	white-space: nowrap;
}
/* DataTables 2 fixes column widths to the screen; let content decide */
table.dataTable {
	table-layout: auto !important;
}

/* ---- one spacing for every page: older pages nudged sections around with
   inline margins (margin-top: 35px / -35px); the frame handles it now ---- */
.app-main > section {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
.app-main > section > .col-lg-12:empty,
.app-main > section:empty {
	display: none;
}
.app-main .alert {
	margin: 0.5rem 0 1rem;
}
.app-main > section > .col-lg-12 > .alert,
.app-main > section > .alert {
	margin-left: 0;
	margin-right: 0;
}

/* titles inside cards: smaller than the page title */
.card-header > h2,
.card-header > h3:not(.card-title),
.card-header > h4 {
	font-size: 1.15rem;
	font-weight: 600;
	margin: 0;
}

/* required fields: label gets a red star (set by app.js) */
label.required::after {
	content: " *";
	color: var(--bs-danger);
}

/* icon-only buttons in tables (class="btn btn-info fa fa-edit") */
.table .btn.fa,
.table .btn > .fa:only-child {
	width: 2.1rem;
	height: 2.1rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.table .btn.fa.w-100 {
	width: 2.1rem !important;
}
.table td .btn + .btn,
.table td .btn + a.btn,
.table td a.btn + .btn {
	margin-left: 0.15rem;
}
.table > :not(caption) > * > * {
	vertical-align: middle;
}

/* status buttons in lists (Active / In-Active) */
.table .btn-sm[style*="77px"] {
	min-width: 5.5rem;
	width: auto !important;
}

/* ---- role pages: section headings were squeezed callouts (inline height 30px) ---- */
.callout[style*="height: 30px"] {
	height: auto !important;
	padding: 0.5rem 1rem !important;
	margin: 1.25rem 0 0.75rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.callout[style*="height: 30px"] > h4 {
	margin: 0 !important;
	font-size: 1rem;
	font-weight: 600;
}
.callout .section-all {
	font-size: 0.85rem;
	font-weight: 400;
	margin: 0;
	cursor: pointer;
}

/* section headings inside long forms (booking) */
.form-section {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 1.25rem 0 0.75rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--bs-border-color);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--maitla-indigo);
}

/* ---- confirm-delete popups (AdminLTE 2 "modal-info" with btn-outline buttons) ---- */
.modal-info .modal-header {
	background-color: var(--bs-danger-bg-subtle);
	border-bottom-color: var(--bs-danger-border-subtle);
}
.modal-info .modal-title {
	color: var(--bs-danger-text-emphasis);
	font-weight: 600;
}
.modal .btn.btn-outline {
	color: var(--bs-body-color);
	background-color: var(--bs-secondary-bg);
	border: 1px solid var(--bs-border-color);
}
.modal .btn.btn-outline:hover {
	background-color: var(--bs-tertiary-bg);
}
/* the button that does the work (Yes / Delete) has an onclick handler */
.modal-footer .btn.btn-outline[onclick] {
	color: #fff;
	background-color: var(--bs-danger);
	border-color: var(--bs-danger);
}
.modal-footer .btn.btn-outline[onclick]:hover {
	background-color: var(--bs-danger-text-emphasis);
}
.modal-footer {
	gap: 0.5rem;
}

/* action buttons stay on one line */
.table td:has(> .btn.fa),
.table td:has(> a.btn.fa) {
	white-space: nowrap;
}

/* a top-level page link (no sub-menu) that is open: solid indigo */
.app-sidebar .sidebar-menu > .nav-item:not(.menu-group) > .nav-link.active {
	background-color: var(--maitla-indigo) !important;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.app-content-header h1 small {
	font-size: 0.85rem;
	font-weight: 400;
	color: var(--maitla-muted);
	margin-left: 0.35rem;
}

/* lists use the full card width; pager in indigo */
.app-main table.dataTable {
	width: 100% !important;
}
.pagination {
	--bs-pagination-active-bg: var(--maitla-indigo);
	--bs-pagination-active-border-color: var(--maitla-indigo);
	--bs-pagination-color: #475569;
	--bs-pagination-border-radius: 0.5rem;
}
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-secondary {
	background-color: var(--maitla-indigo);
	border-color: var(--maitla-indigo);
	color: #fff;
}
/* old lists put .table-responsive on the table itself (display:block): keep it a table */
.app-main table.dataTable.table-responsive {
	display: table;
}

/* row action buttons: small soft icon buttons instead of solid blocks */
.app-main td .btn.fa,
.app-main td .btn > .fa:only-child {
	line-height: 1;
}
.app-main td > .btn.fa,
.app-main td > a.btn.fa {
	width: 32px !important;
	height: 32px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	border-radius: 0.5rem;
	border: 0;
	margin: 1px;
}
.app-main td > .btn-warning.fa { background: #fef3c7; color: #b45309; }
.app-main td > .btn-secondary.fa { background: #e2e8f0; color: #334155; }
.app-main td > .btn-danger.fa { background: #ffe4e6; color: #e11d48; }
.app-main td > .btn-info.fa { background: #e0f2fe; color: #0369a1; }
.app-main td > .btn-success.fa { background: #d1fae5; color: #047857; }
.app-main td > .btn-primary.fa { background: #e0e7ff; color: #4338ca; }
.app-main td > .btn-warning.fa:hover { background: #f59e0b; color: #fff; }
.app-main td > .btn-secondary.fa:hover { background: #475569; color: #fff; }
.app-main td > .btn-danger.fa:hover { background: #e11d48; color: #fff; }
.app-main td > .btn-info.fa:hover { background: #0284c7; color: #fff; }
.app-main td > .btn-success.fa:hover { background: #059669; color: #fff; }
.app-main td > .btn-primary.fa:hover { background: #4f46e5; color: #fff; }
.app-main .table > tbody > tr > td {
	vertical-align: middle;
}
/* old lists hide columns with inline display:none; DataTables' <colgroup> still
   reserves their width, so let the browser size columns from the cells */
.app-main table.dataTable > colgroup {
	display: none;
}

/* ---- login ---- */
.login-theme {
	background: radial-gradient(circle at 20% 10%, #312e81 0%, #0f172a 55%) !important;
}
.login-theme .login-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: #f8fafc;
	font-weight: 700;
	font-size: 1.6rem;
}
.login-theme .brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 0.6rem;
	background: linear-gradient(135deg, #6366f1, #4338ca);
	color: #fff;
	font-size: 0.95rem;
	box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}
.login-theme .card {
	border: 0;
	border-radius: 1rem;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.login-theme .login-card-body {
	border-radius: 1rem;
	padding: 1.75rem;
}

/* =====================================================================
   Compact forms: counter staff type fast, so fields sit close together
   ===================================================================== */
.app-main form .form-control,
.app-main form .form-select,
.app-main form .input-group-text,
.app-main form .ts-wrapper .ts-control {
	padding: 0.28rem 0.6rem;
	font-size: 0.85rem;
	min-height: 32px;
	line-height: 1.4;
}
.app-main form .ts-wrapper.single .ts-control {
	padding-right: 1.8rem;
}
.app-main form label,
.app-main form .form-label {
	font-size: 0.78rem;
	margin-bottom: 0.15rem;
}
.app-main form .form-check-label,
.app-main form label:has(> input[type=radio]),
.app-main form label:has(> input[type=checkbox]) {
	font-size: 0.85rem;
}
.app-main form .form-group,
.app-main form .mb-3 {
	margin-bottom: 0.5rem !important;
}
/* old forms space rows with inline margins: tighten them */
.app-main form .row[style*="margin"] {
	margin-top: 0 !important;
	margin-bottom: 0.5rem !important;
}
.app-main form .row {
	--bs-gutter-x: 0.9rem;
}
.app-main form .row > [class*="col"] > .form-group:last-child {
	margin-bottom: 0 !important;
}
.app-main form br + label,
.app-main form label + br {
	line-height: 1;
}
.app-main form .card-body {
	padding: 0.85rem 1rem;
}
.app-main form .card-footer {
	padding: 0.6rem 1rem;
}
.app-main form .btn {
	padding: 0.32rem 0.85rem;
	font-size: 0.85rem;
}
.app-main .form-section {
	margin: 0.6rem 0 0.4rem !important;
	padding-bottom: 0.2rem !important;
	font-size: 0.72rem !important;
}
.app-content-header {
	padding-top: 0.75rem !important;
	padding-bottom: 0.5rem !important;
}
.app-content-header h1 {
	font-size: 1.35rem !important;
}
/* bilty number boxes are marked is-valid only for colour: no tick over the number */
.app-main form .form-control.is-valid {
	background-image: none;
	padding-right: 0.6rem;
}

/* icon-only buttons (<a class="btn fa fa-print">): the button's text font must not
   replace the icon font. :where keeps the v4-shim rules (e.g. .fa.fa-edit) in charge */
.fa:where(.btn),
.fa:where(.btn)::before {
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
}

/* ---- list tables: tighter rows, dates on one line ---- */
.app-main table.dataTable > tbody > tr > td {
	padding-top: 0.4rem;
	padding-bottom: 0.4rem;
}
.app-main table.dataTable td.dt-type-date,
.app-main table.dataTable th.dt-type-date {
	white-space: nowrap;
}
.app-main table.dataTable td.details-control {
	width: 28px;
	cursor: pointer;
}

/* expanded row (+ button): the hidden columns as small chips on one line */
.details-container {
	padding: 0.35rem 0.25rem;
}
.details-container .details-table,
.details-container .details-table > tbody {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	width: auto;
	margin: 0;
	border: 0;
}
.details-container .details-table tr {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.65rem;
	background: #eef2ff;
	border-radius: 999px;
	font-size: 0.8rem;
}
.details-container .details-table td {
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	white-space: nowrap;
}
.details-container .details-table td.title {
	color: var(--maitla-muted);
	font-weight: 500;
}
.details-container .details-table td:not(.title) {
	font-weight: 600;
	color: #1e293b;
}
.app-main table.dataTable > tbody > tr.dt-hasChild + tr > td,
.app-main table.dataTable > tbody > tr.shown + tr > td {
	background: #fafbff !important;
	padding: 0.35rem 0.75rem;
}

/* list page filter bar and "Date : ..." heading: smaller */
.app-main .card-body > h2,
.app-main .card-body > h3,
.app-main form + h2,
.app-main form + h3 {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0.6rem 0 0.4rem;
}
.list-period {
	display: inline-flex;
	align-items: center;
	margin-bottom: 0.6rem;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: #eef2ff;
	color: #3730a3;
	font-size: 0.85rem;
	font-weight: 600;
}
/* bilties inside an expanded departure row */
.details-container > .table {
	margin-bottom: 0;
	font-size: 0.8rem;
	background: #fff;
}
.details-container > .table td {
	padding: 0.25rem 0.6rem;
}
.details-container > .table tr:first-child td {
	color: var(--maitla-muted);
	font-weight: 600;
	font-size: 0.72rem;
	text-transform: uppercase;
}

/* user initials instead of a stock photo */
.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1, #4338ca);
	color: #fff;
	font-weight: 600;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
}
.avatar-sm {
	width: 2rem;
	height: 2rem;
	font-size: 0.75rem;
	margin-right: 0.4rem;
}
.avatar-lg {
	width: 4.5rem;
	height: 4.5rem;
	font-size: 1.5rem;
	border: 3px solid rgba(255, 255, 255, 0.35);
}
.app-header .user-menu .dropdown-toggle {
	display: flex;
	align-items: center;
}
.app-header .user-menu .user-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	height: auto;
	padding: 1.25rem 1rem;
	background: linear-gradient(135deg, #4f46e5, #312e81) !important;
}
.app-header .user-menu .user-header p {
	margin: 0;
}

/* reports menu tiles */
.stat-sky .stat-icon { background: #e0f2fe; color: #0284c7; }
.report-tile .report-title {
	font-weight: 600;
	color: #0f172a;
	font-size: 0.95rem;
}
.report-tile .report-go {
	color: #cbd5e1;
	transition: color 0.15s, transform 0.15s;
}
.report-tile:hover .report-go {
	color: var(--maitla-indigo);
	transform: translateX(3px);
}

/* Bootstrap 3 "default" buttons still in a few pages */
.btn-default {
	--bs-btn-color: #334155;
	--bs-btn-bg: #fff;
	--bs-btn-border-color: #dbe0ea;
	--bs-btn-hover-bg: #f1f5f9;
	--bs-btn-hover-border-color: #cbd5e1;
	--bs-btn-active-bg: #e2e8f0;
}

/* =====================================================================
   Multiple booking: entry form on the left, rows added so far on the right
   ===================================================================== */
.card-plain {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}
.card-plain > form > .row > [class*="col-"] > .card {
	margin-bottom: 0;
}
.rows-pane .card-body {
	padding: 0.5rem 0.75rem;
	max-height: calc(100vh - 230px);
	overflow-y: auto;
}
.rows-pane #table {
	margin: 0;
	font-size: 0.8rem;
}
.rows-pane #table th,
.rows-pane #table td {
	padding: 0.3rem 0.35rem;
	font-size: 0.72rem;
	white-space: nowrap;
}
.rows-pane #dataTable:not(:has(tbody tr))::after {
	content: "No rows yet: fill the form and press Add Row";
	display: block;
	padding: 1.5rem 0.5rem;
	color: var(--maitla-muted);
	font-size: 0.8rem;
}
.rows-pane .card-footer .btn {
	min-width: 140px;
}
/* the left pane is ~60% wide: an even 4-per-line grid, same field order */
@media (min-width: 1200px) {
	.entry-pane .row > [class*="col"] { flex: 0 0 auto; width: 20%; }
	.entry-pane .row > .col-12.col-lg-6 { width: 40%; } /* description */
	.entry-pane .row > [class*="col"]:has(input[type="date"]) { width: 26%; }
	.entry-pane .row > [class*="col"]:empty { display: none; }
	.entry-pane .row > .col-12:has(#btnAddRow) { width: 100%; }
	.entry-pane .form-section { margin-top: 0.4rem !important; }
}
.rows-pane .card-body {
	overflow: auto;
}
/* all nine columns (incl. the delete button) fit the right pane */
.rows-pane #table {
	width: 100% !important;
	table-layout: auto;
}
.app-main .rows-pane #table > thead > tr > th {
	white-space: normal;
	font-size: 0.62rem;
	letter-spacing: 0;
	padding: 0.3rem 0.25rem;
	vertical-align: bottom;
}
.rows-pane #table td {
	padding: 0.3rem 0.25rem;
}
.rows-pane #table td .btn {
	padding: 0.1rem 0.4rem;
	font-size: 0.75rem;
}
.rows-pane .card-body {
	padding: 0.35rem 0.5rem;
}
.rows-pane #table td {
	white-space: nowrap;
}
.rows-pane #table td:nth-child(2) {
	white-space: normal; /* receiver names may wrap at spaces */
}

/* =====================================================================
   Departure form: details on the left, the city's pending bilties on the right
   ===================================================================== */
.app-content-header h1 {
	margin-right: auto;
}
.dep-form .row > [class*="col-"] {
	margin-bottom: 0.45rem;
}
/* "View Pending" list (all cities), shown only after the button is pressed */
.pending-box #tvPending:not(:empty) {
	max-height: 140px;
	overflow-y: auto;
	margin-bottom: 0.5rem !important;
	padding: 0.5rem 0.65rem !important;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 0.5rem;
	font-size: 0.78rem;
	line-height: 1.5;
}
.pending-box #lblPending {
	font-weight: 600;
	color: #92400e;
}
/* totals of the ticked bilties: read-only summary */
.dep-totals .form-control[readonly] {
	background: #f8fafc;
	border-style: dashed;
	font-weight: 600;
	color: #0f172a;
}
.dep-totals label {
	font-size: 0.72rem;
	color: var(--maitla-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}
.dep-profit .form-control {
	background: #ecfdf5 !important;
	border-color: #6ee7b7;
	color: #047857;
	font-weight: 700;
}
/* pending bilties table */
.dep-bilties .card-body {
	padding: 0.35rem 0.5rem;
	max-height: calc(100vh - 230px);
	min-height: 180px;
	overflow: auto;
}
.dep-bilties #table {
	width: 100% !important;
	margin: 0;
	font-size: 0.8rem;
	display: table;
}
.dep-bilties #table th,
.dep-bilties #table td {
	padding: 0.35rem 0.4rem;
	white-space: nowrap;
	vertical-align: middle;
}
.dep-bilties #table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}
.dep-bilties #table tbody tr:has(input:checked) {
	--bs-table-bg-state: #eef2ff;
}
.dep-bilties #get_table:not(:has(tbody tr))::after {
	content: "Choose a To city: its pending bilties show here. Tick the ones going in this departure.";
	display: block;
	padding: 2rem 0.75rem;
	text-align: center;
	color: var(--maitla-muted);
	font-size: 0.82rem;
}
.dep-bilties .card-footer .btn {
	min-width: 140px;
}

/* save / error messages (flash alerts from the controllers): one slim line */
.app-main .alert.alert-dismissible {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 0.5rem;
	padding: 0.55rem 2.75rem 0.55rem 0.9rem;
	margin: 0 0 0.75rem;
	border-radius: 0.6rem;
	font-size: 0.875rem;
}
.app-main .alert.alert-dismissible h4,
.app-main .alert.alert-dismissible h5 {
	font-size: 0.875rem;
	margin: 0;
	font-weight: 600;
}
.app-main .alert.alert-dismissible h4 + h4,
.app-main .alert.alert-dismissible h4 + h5 {
	font-weight: 400;
}
.app-main .alert.alert-dismissible .btn-close {
	padding: 0.8rem 0.9rem;
}

.reports-heading {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--maitla-muted);
	margin: 1.5rem 0 0.75rem;
}

/* =====================================================================
   Dashboard overview
   ===================================================================== */
.dash-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem;
}
.dash-header h1 { font-size: 1.55rem !important; margin: 0; }
.dash-sub { color: var(--maitla-muted); font-size: 0.875rem; margin-top: 0.15rem; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* KPI cards */
.dash-kpi {
	position: relative;
	display: block;
	height: 100%;
	padding: 1rem 1.1rem 0.9rem;
	background: #fff;
	border: 1px solid var(--maitla-border);
	border-radius: 0.9rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	transition: transform 0.15s, box-shadow 0.15s;
}
a.dash-kpi:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
	color: inherit;
}
.dash-kpi-top { display: flex; align-items: center; gap: 0.55rem; }
.dash-kpi-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.1rem; height: 2.1rem; border-radius: 0.6rem; font-size: 0.95rem;
}
.k-indigo { background: #eef2ff; color: #4f46e5; }
.k-green { background: #ecfdf5; color: #059669; }
.k-sky { background: #e0f2fe; color: #0284c7; }
.k-amber { background: #fffbeb; color: #d97706; }
.k-violet { background: #f5f3ff; color: #7c3aed; }
.k-rose { background: #fff1f2; color: #e11d48; }
.dash-kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--maitla-muted); }
.dash-kpi-value {
	font-size: 1.6rem; font-weight: 700; color: #0f172a;
	letter-spacing: -0.02em; margin: 0.55rem 0 0.2rem; line-height: 1.15;
	font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dash-kpi-foot { font-size: 0.75rem; position: relative; z-index: 1; }
.dash-kpi-note { font-size: 0.75rem; color: var(--maitla-muted); margin-top: 0.15rem; }
.dash-vs { color: var(--maitla-muted); }
.dash-delta {
	display: inline-flex; align-items: center; gap: 0.2rem;
	padding: 0.05rem 0.45rem; border-radius: 999px; font-weight: 700;
}
.dash-delta.up { background: #ecfdf5; color: #047857; }
.dash-delta.down { background: #fff1f2; color: #be123c; }
.dash-delta.flat { background: #f1f5f9; color: #475569; }
.dash-spark {
	position: absolute; right: 0.6rem; bottom: 0.55rem;
	width: 42% !important; height: 2.4rem !important; opacity: 0.9;
}

/* cards */
.dash-card > .card-header {
	display: flex; align-items: center; gap: 0.5rem;
	border-bottom: 0 !important; padding-bottom: 0.25rem !important;
}
.dash-card .card-title { font-size: 0.95rem; font-weight: 700; }
.dash-link { font-size: 0.8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dash-legend { display: flex; gap: 0.9rem; font-size: 0.78rem; color: var(--maitla-muted); }
.dash-legend i { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.dash-empty {
	padding: 1.5rem; text-align: center; color: var(--maitla-muted);
	border: 1px dashed var(--maitla-border); border-radius: 0.6rem; font-size: 0.85rem;
}

/* destination bars */
.dash-bar-row + .dash-bar-row { margin-top: 0.85rem; }
.dash-bar-head { display: flex; justify-content: space-between; font-size: 0.85rem; }
.dash-bar-name { font-weight: 600; color: #0f172a; }
.dash-bar-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-bar { height: 0.45rem; background: #eef2ff; border-radius: 999px; margin: 0.3rem 0 0.2rem; overflow: hidden; }
.dash-bar span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #4338ca); border-radius: 999px; }
.dash-bar-meta { font-size: 0.72rem; color: var(--maitla-muted); }

/* payment mix */
.dash-donut-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.dash-donut-center {
	position: absolute; inset: 0; display: flex; flex-direction: column;
	align-items: center; justify-content: center; pointer-events: none;
}
.dash-donut-center b { font-size: 1rem; color: #0f172a; }
.dash-donut-center span { font-size: 0.72rem; color: var(--maitla-muted); }
.dash-mix-legend { flex: 1; min-width: 150px; }
.dash-mix-legend div { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; padding: 0.35rem 0; }
.dash-mix-legend div + div { border-top: 1px solid var(--maitla-border); }
.dash-mix-legend i { width: 0.65rem; height: 0.65rem; border-radius: 3px; flex: none; }
.dash-mix-legend span { flex: 1; color: #334155; }
.dash-mix-legend b { font-variant-numeric: tabular-nums; }
.dash-mix-legend em { font-style: normal; color: var(--maitla-muted); width: 2.4rem; text-align: right; font-size: 0.75rem; }

/* tables and lists */
.app-main .dash-table { font-size: 0.83rem; }
.app-main .dash-table > thead > tr > th {
	background: transparent !important; font-size: 0.68rem; padding: 0.5rem 1rem;
}
.app-main .dash-table > tbody > tr > td { padding: 0.55rem 1rem; border-color: var(--maitla-border); }
.dash-ellipsis { max-width: 22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-tag {
	display: inline-block; font-size: 0.65rem; font-weight: 700; padding: 0.05rem 0.4rem;
	border-radius: 0.3rem; background: #fff1f2; color: #be123c; vertical-align: 1px;
}
.dash-age {
	display: inline-block; min-width: 2.6rem; text-align: center; font-size: 0.72rem; font-weight: 700;
	padding: 0.1rem 0.4rem; border-radius: 999px; background: #ecfdf5; color: #047857;
}
.dash-age.warn { background: #fffbeb; color: #b45309; }
.dash-age.late { background: #fff1f2; color: #be123c; }
.dash-list { list-style: none; margin: 0; padding: 0.25rem 0; }
.dash-list li { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem; }
.dash-list li + li { border-top: 1px solid var(--maitla-border); }
.dash-avatar {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 2.1rem; height: 2.1rem; border-radius: 50%;
	background: #eef2ff; color: #4338ca; font-weight: 700; font-size: 0.85rem;
}
.dash-avatar.truck { background: #f5f3ff; color: #7c3aed; border-radius: 0.6rem; }
.dash-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-list-main b { font-size: 0.85rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-list-main small { font-size: 0.72rem; color: var(--maitla-muted); }
.dash-owe { font-weight: 700; color: #be123c; font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-owe.neutral { color: #0f172a; }

.dash-section {
	font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
	color: var(--maitla-muted); margin: 0.5rem 0 0.75rem;
}
.dash-section small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 0.4rem; }
/* six KPI cards in one line only on very wide screens */
@media (min-width: 1700px) {
	.dash-kpi-col { flex: 0 0 auto; width: 16.6667%; }
}

/* detailed charts: a closed chart is one slim line; its date box shows when opened */
.app-main .card.collapsed-card[data-chart] {
	box-shadow: none;
	background: #fff;
}
.app-main .card.collapsed-card[data-chart] > .card-header {
	padding: 0.65rem 1rem !important;
	border-bottom: 0 !important;
	cursor: pointer;
}
.app-main .card.collapsed-card[data-chart] > .card-header [data-period] {
	display: none;
}
.app-main .card[data-chart] > .card-header .card-title::before {
	content: "\f080"; /* chart icon */
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	color: #6366f1;
	margin-right: 0.55rem;
	font-size: 0.85rem;
}
.app-main .card.collapsed-card[data-chart]:hover {
	border-color: #c7d2fe;
}
.app-main [data-chart] .card-title { font-size: 0.9rem; }
.app-main .row > [class*="col-"] > .card[data-chart] { margin-bottom: 0.75rem; }

/* today by city: what loaders check all day */
.dash-live { font-size: 0.75rem; color: var(--maitla-muted); white-space: nowrap; }
.dash-dot {
	display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%;
	background: #10b981; margin-right: 0.2rem; vertical-align: 1px;
	box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); animation: dashPulse 2s infinite;
}
@keyframes dashPulse {
	0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
	70% { box-shadow: 0 0 0 0.45rem rgba(16, 185, 129, 0); }
	100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.dash-city-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	gap: 0.6rem;
}
.dash-city {
	border: 1px solid var(--maitla-border);
	border-radius: 0.75rem;
	padding: 0.65rem 0.8rem 0.6rem;
	background: #fff;
	transition: border-color 0.15s;
}
.dash-city:hover { border-color: #c7d2fe; }
.dash-city.total {
	background: linear-gradient(135deg, #4f46e5, #3730a3);
	border-color: transparent;
	color: #fff;
}
.dash-city.empty { opacity: 0.5; }
.dash-city-name {
	font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
	color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-city.total .dash-city-name { color: #e0e7ff; }
.dash-city-qty {
	font-size: 1.75rem; font-weight: 800; line-height: 1.15; color: #0f172a;
	font-variant-numeric: tabular-nums; margin: 0.15rem 0 0.1rem;
}
.dash-city.total .dash-city-qty { color: #fff; }
.dash-city-qty small { font-size: 0.75rem; font-weight: 600; color: var(--maitla-muted); margin-left: 0.25rem; }
.dash-city.total .dash-city-qty small { color: #c7d2fe; }
.dash-city-meta { display: flex; justify-content: space-between; gap: 0.4rem; font-size: 0.75rem; font-weight: 600; color: #475569; }
.dash-city.total .dash-city-meta { color: #e0e7ff; }
.dash-city-meta i { opacity: 0.6; margin-right: 0.15rem; }
.dash-city-urgent {
	display: inline-block; margin-top: 0.35rem; font-size: 0.68rem; font-weight: 700;
	padding: 0.05rem 0.45rem; border-radius: 999px; background: #fff1f2; color: #be123c;
}
.dash-city.total .dash-city-urgent { background: rgba(255, 255, 255, 0.18); color: #fff; }
.dash-daypick { width: auto; flex-wrap: nowrap; }
.dash-daypick .form-control { width: 9.5rem; }
.dash-city-grid.loading { opacity: 0.45; transition: opacity 0.15s; }

/* =====================================================================
   Privacy: money is blurred until someone asks to see it (app.js)
   ===================================================================== */
.privacy-on .money:not(.peek) {
	filter: blur(7px);
	cursor: pointer;
	user-select: none;
	transition: filter 0.2s;
}
.privacy-on canvas.money:not(.peek),
.privacy-on .money canvas {
	filter: blur(9px);
}
.money.peek { filter: none; }
.privacy-btn {
	border: 1px solid var(--maitla-border);
	background: #fff;
	color: #475569;
	border-radius: 999px;
	padding: 0.25rem 0.75rem;
	font-weight: 600;
	font-size: 0.8rem;
}
.privacy-btn:hover { background: #f1f5f9; }
.privacy-btn.showing {
	background: #fef3c7;
	border-color: #fcd34d;
	color: #92400e;
}
@media print {
	.privacy-on .money { filter: none !important; }
}

/* =====================================================================
   Top bar: search, icons, breadcrumb
   ===================================================================== */
.topbar-search-item { margin-left: 0.5rem; }
.topbar-search {
	position: relative;
	display: flex;
	align-items: center;
	width: min(26rem, 44vw);
	height: 2.3rem;
	padding: 0 0.75rem;
	background: #f1f5f9;
	border: 1px solid transparent;
	border-radius: 999px;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.topbar-search:focus-within {
	background: #fff;
	border-color: #a5b4fc;
	box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.12);
}
.topbar-search > .fa-search { color: #94a3b8; font-size: 0.85rem; }
.topbar-search input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	outline: none;
	padding: 0 0.55rem;
	font-size: 0.875rem;
	color: inherit;
}
.topbar-search kbd {
	background: #fff;
	color: #64748b;
	border: 1px solid #e2e8f0;
	box-shadow: none;
	font-size: 0.7rem;
	padding: 0.05rem 0.4rem;
	border-radius: 0.3rem;
}
.topbar-results {
	position: absolute;
	top: calc(100% + 0.4rem);
	left: 0;
	width: min(34rem, 92vw);
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--maitla-border);
	border-radius: 0.8rem;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
	padding: 0.35rem;
	z-index: 1080;
}
.topbar-results-head {
	font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
	color: #94a3b8; padding: 0.45rem 0.6rem 0.25rem;
}
.topbar-results-empty { padding: 0.9rem; color: var(--maitla-muted); font-size: 0.85rem; text-align: center; }
.topbar-hit {
	display: flex; align-items: center; gap: 0.7rem;
	padding: 0.5rem 0.6rem; border-radius: 0.55rem;
	color: inherit; text-decoration: none;
}
.topbar-hit:hover, .topbar-hit.active { background: #eef2ff; color: inherit; }
.hit-no { min-width: 4.6rem; font-weight: 700; color: #4338ca; font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.hit-no em { display: block; font-style: normal; font-size: 0.65rem; color: #be123c; }
.hit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hit-main b { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-main small { font-size: 0.72rem; color: var(--maitla-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-status { font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.hit-status.pending { background: #fffbeb; color: #b45309; }
.hit-status.departed { background: #ecfdf5; color: #047857; }
.hit-status.deleted { background: #fff1f2; color: #be123c; }
.topbar-icon { font-size: 1rem; padding: 0.4rem 0.6rem !important; color: #475569 !important; }
.topbar-icon:hover { color: #4f46e5 !important; }

/* breadcrumb above the page title */
.app-main > .page-crumbs { padding: 0.75rem 1.5rem 0; margin-bottom: -0.35rem; }
.app-main > .page-crumbs + .app-content-header { padding-top: 0.25rem !important; }
.page-crumbs .breadcrumb { font-size: 0.78rem; --bs-breadcrumb-divider-color: #94a3b8; }
.page-crumbs .breadcrumb-item a { color: var(--maitla-muted); text-decoration: none; }
.page-crumbs .breadcrumb-item a:hover { color: var(--maitla-indigo); }
.page-crumbs .breadcrumb-item.active { color: #334155; font-weight: 600; }

/* =====================================================================
   Bilty detail (Search/bilty)
   ===================================================================== */
.bd-steps { display: flex; gap: 0.5rem; }
.bd-step { flex: 1; position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.bd-step + .bd-step::before {
	content: ""; position: absolute; top: 1rem; right: 50%; width: 100%; height: 3px;
	background: #e2e8f0; z-index: 0;
}
.bd-step.done + .bd-step.done::before { background: #4f46e5; }
.bd-dot {
	position: relative; z-index: 1; width: 2rem; height: 2rem; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #f1f5f9; color: #94a3b8; border: 3px solid #fff; box-shadow: 0 0 0 1px #e2e8f0;
}
.bd-step.done .bd-dot { background: #4f46e5; color: #fff; box-shadow: 0 0 0 1px #4f46e5; }
.bd-step b { font-size: 0.85rem; }
.bd-step small { font-size: 0.72rem; color: var(--maitla-muted); }
.bd-route { display: flex; align-items: center; gap: 1rem; }
.bd-route > div { display: flex; flex-direction: column; }
.bd-route small, .bd-party small { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--maitla-muted); font-weight: 600; }
.bd-route b { font-size: 1.4rem; font-weight: 800; color: #0f172a; }
.bd-route > i { font-size: 1.4rem; color: #a5b4fc; }
.bd-party { border: 1px solid var(--maitla-border); border-radius: 0.7rem; padding: 0.7rem 0.9rem; display: flex; flex-direction: column; }
.bd-party b { font-size: 1rem; color: #0f172a; }
.bd-party span { font-size: 0.8rem; color: #475569; margin-top: 0.15rem; }
.bd-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.6rem 1.2rem; margin: 0; }
.bd-facts dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--maitla-muted); font-weight: 600; }
.bd-facts dd { margin: 0; font-weight: 600; color: #0f172a; font-size: 0.875rem; }
.bd-charges td { padding: 0.4rem 0; border-color: var(--maitla-border); }
.bd-charges tr.bd-total td { font-weight: 800; border-top: 2px solid #0f172a; }
.bd-event { padding: 0.55rem 0; display: flex; flex-direction: column; }
.bd-event + .bd-event { border-top: 1px solid var(--maitla-border); }

/* =====================================================================
   Dark mode (top bar button; html[data-bs-theme=dark])
   ===================================================================== */
[data-bs-theme=dark] {
	--maitla-bg: #0b1120;
	--maitla-border: #1f2a3d;
	--maitla-muted: #94a3b8;
	--bs-body-color: #e2e8f0;
	--bs-border-color: #1f2a3d;
	--d-surface: #111827;
	--d-surface-2: #0f172a;
	--d-ink: #f1f5f9;
}
[data-bs-theme=dark] body.app-theme { background-color: var(--maitla-bg); color: #e2e8f0; }

/* top bar */
[data-bs-theme=dark] .app-header { background-color: #0f172a !important; border-bottom-color: #1e293b !important; }
[data-bs-theme=dark] .app-header .nav-link,
[data-bs-theme=dark] .topbar-icon { color: #cbd5e1 !important; }
[data-bs-theme=dark] .topbar-date { color: #94a3b8; }
[data-bs-theme=dark] .topbar-search { background: #1e293b; }
[data-bs-theme=dark] .topbar-search:focus-within { background: #0b1120; border-color: #4f46e5; }
[data-bs-theme=dark] .topbar-search kbd { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme=dark] .topbar-results { background: var(--d-surface); border-color: #1f2a3d; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
[data-bs-theme=dark] .topbar-hit:hover,
[data-bs-theme=dark] .topbar-hit.active { background: #1e1b4b; }
[data-bs-theme=dark] .hit-no { color: #a5b4fc; }
[data-bs-theme=dark] .privacy-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }

/* page and cards */
[data-bs-theme=dark] .app-content-header h1,
[data-bs-theme=dark] .app-main .card-title,
[data-bs-theme=dark] .page-crumbs .breadcrumb-item.active { color: var(--d-ink); }
[data-bs-theme=dark] .app-main .card,
[data-bs-theme=dark] .stat-card,
[data-bs-theme=dark] .dash-kpi,
[data-bs-theme=dark] .dash-city,
[data-bs-theme=dark] .app-main .card.collapsed-card[data-chart] {
	background: var(--d-surface);
	border-color: var(--maitla-border);
	box-shadow: none;
}
[data-bs-theme=dark] .app-main .card > .card-footer { background: var(--d-surface-2); }
[data-bs-theme=dark] .stat-value,
[data-bs-theme=dark] .dash-kpi-value,
[data-bs-theme=dark] .dash-city-qty,
[data-bs-theme=dark] .report-title,
[data-bs-theme=dark] .dash-bar-name,
[data-bs-theme=dark] .dash-list-main b,
[data-bs-theme=dark] .dash-owe.neutral,
[data-bs-theme=dark] .dash-donut-center b,
[data-bs-theme=dark] .bd-route b,
[data-bs-theme=dark] .bd-party b,
[data-bs-theme=dark] .bd-facts dd { color: var(--d-ink); }
[data-bs-theme=dark] .dash-city-name,
[data-bs-theme=dark] .dash-city-meta,
[data-bs-theme=dark] .dash-mix-legend span,
[data-bs-theme=dark] .bd-party span { color: #cbd5e1; }
[data-bs-theme=dark] .dash-bar,
[data-bs-theme=dark] .bd-step + .bd-step::before { background: #1e293b; }
[data-bs-theme=dark] .bd-dot { background: #1e293b; border-color: var(--d-surface); box-shadow: 0 0 0 1px #334155; }
[data-bs-theme=dark] .bd-charges tr.bd-total td { border-top-color: #e2e8f0; }
[data-bs-theme=dark] .dash-empty { border-color: #334155; }
[data-bs-theme=dark] .k-indigo, [data-bs-theme=dark] .stat-indigo .stat-icon { background: rgba(99, 102, 241, 0.18); }
[data-bs-theme=dark] .k-green, [data-bs-theme=dark] .stat-green .stat-icon { background: rgba(16, 185, 129, 0.16); }
[data-bs-theme=dark] .k-sky, [data-bs-theme=dark] .stat-sky .stat-icon { background: rgba(14, 165, 233, 0.16); }
[data-bs-theme=dark] .k-amber, [data-bs-theme=dark] .stat-amber .stat-icon { background: rgba(245, 158, 11, 0.16); }
[data-bs-theme=dark] .k-violet { background: rgba(139, 92, 246, 0.18); }
[data-bs-theme=dark] .k-rose, [data-bs-theme=dark] .stat-rose .stat-icon { background: rgba(244, 63, 94, 0.16); }

/* tables */
[data-bs-theme=dark] .app-main .table {
	--bs-table-bg: transparent;
	--bs-table-color: #e2e8f0;
	--bs-table-striped-bg: rgba(255, 255, 255, 0.025);
	--bs-table-striped-color: #e2e8f0;
	--bs-table-hover-bg: rgba(99, 102, 241, 0.12);
	--bs-table-hover-color: #f8fafc;
}
[data-bs-theme=dark] .app-main .table > thead > tr > th,
[data-bs-theme=dark] .app-main .table > thead > tr > td { background-color: var(--d-surface-2); color: #94a3b8; border-bottom-color: var(--maitla-border); }
[data-bs-theme=dark] .app-main .table > :not(caption) > * > * { border-color: var(--maitla-border); }
[data-bs-theme=dark] .app-main table.dataTable > tbody > tr.dt-hasChild + tr > td,
[data-bs-theme=dark] .app-main table.dataTable > tbody > tr.shown + tr > td { background: var(--d-surface-2) !important; }
[data-bs-theme=dark] .details-container .details-table tr { background: #1e1b4b; }
[data-bs-theme=dark] .details-container .details-table td:not(.title) { color: var(--d-ink); }
[data-bs-theme=dark] .app-main td > .btn-warning.fa { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
[data-bs-theme=dark] .app-main td > .btn-secondary.fa { background: #1e293b; color: #cbd5e1; }
[data-bs-theme=dark] .app-main td > .btn-danger.fa { background: rgba(244, 63, 94, 0.16); color: #fb7185; }
[data-bs-theme=dark] .app-main td > .btn-info.fa { background: rgba(14, 165, 233, 0.16); color: #38bdf8; }
[data-bs-theme=dark] .app-main td > .btn-success.fa { background: rgba(16, 185, 129, 0.16); color: #34d399; }
[data-bs-theme=dark] .app-main td > .btn-primary.fa { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }

/* forms */
[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select,
[data-bs-theme=dark] .input-group-text,
[data-bs-theme=dark] .ts-wrapper .ts-control,
[data-bs-theme=dark] .ts-dropdown {
	background-color: #0b1220;
	border-color: #334155;
	color: #e2e8f0;
}
[data-bs-theme=dark] .form-control[readonly],
[data-bs-theme=dark] .form-control:disabled,
[data-bs-theme=dark] .dep-totals .form-control[readonly] { background-color: #111827; color: #cbd5e1; }
[data-bs-theme=dark] .ts-dropdown .active { background-color: #1e1b4b; color: #f8fafc; }
[data-bs-theme=dark] label,
[data-bs-theme=dark] .form-label { color: #cbd5e1; }
[data-bs-theme=dark] .form-section { border-color: var(--maitla-border); }
[data-bs-theme=dark] .pending-box #tvPending:not(:empty) { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); color: #fde68a; }
[data-bs-theme=dark] .dep-profit .form-control { background: rgba(16, 185, 129, 0.12) !important; color: #34d399; }

/* footer and pager */
[data-bs-theme=dark] .app-footer { color: #64748b; border-top-color: var(--maitla-border); }
[data-bs-theme=dark] .pagination { --bs-pagination-bg: var(--d-surface); --bs-pagination-border-color: var(--maitla-border); --bs-pagination-color: #cbd5e1; }
[data-bs-theme=dark] .list-period { background: #1e1b4b; color: #c7d2fe; }

/* =====================================================================
 * Phones (under 576px). Forms keep their field order and Tab order;
 * only the column widths change so every box is wide enough to type in.
 * ===================================================================== */
@media (max-width: 575.98px) {
	/* page shell */
	.app-content-header { padding: 0.6rem 0.75rem 0.25rem; }
	.app-content-header h1 { font-size: 1.15rem; }
	.app-main .card-body { padding: 0.65rem; }
	.app-main .card-header { padding: 0.5rem 0.65rem; }

	/* fixed (non-responsive) grid columns inside forms and role pages:
	   tiny columns become a third, small ones half, the rest full width */
	.app-main .row > .col-1 { flex: 0 0 auto; width: 33.3333%; }
	.app-main .row > .col-2,
	.app-main .row > .col-3,
	.app-main .row > .col-4,
	.app-main .row > .col-5 { flex: 0 0 auto; width: 50%; }
	.app-main .row > .col-6 { flex: 0 0 auto; width: 50%; }
	.app-main .row > .col-7,
	.app-main .row > .col-8,
	.app-main .row > .col-9,
	.app-main .row > .col-10,
	.app-main .row > .col-11 { flex: 0 0 auto; width: 100%; }
	/* a bigger target for fingers */
	.app-main .form-control, .app-main .form-select, .app-main .ts-control { min-height: 36px; }
	.app-main .btn { min-height: 34px; }
	.app-main .btn-sm { min-height: 30px; }

	/* role checkbox lists */
	#rolelabel { margin-left: 0; font-size: 0.85rem; display: inline-flex; gap: 0.35rem; align-items: flex-start; }

	/* any plain table that is wider than the phone scrolls inside its box */
	.app-main .dash-table,
	.app-main #biltyTable { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }

	/* DataTables: length/search controls stack, the table scrolls */
	div.dt-container .dt-layout-row { flex-wrap: wrap; gap: 0.35rem; }
	div.dt-container .dt-layout-cell { width: 100%; }
	div.dt-container .dt-search input { width: 100% !important; margin-left: 0 !important; }
	div.dt-container .dt-length select { min-width: 70px; }
	div.dt-container .dt-paging .dt-paging-button { padding: 0.2rem 0.5rem !important; }

	/* dashboard */
	.dash-cities .card-header > .ms-auto { margin-left: 0 !important; width: 100%; flex-wrap: wrap; }
	.dash-cities .dash-live { width: 100%; }
	.dash-cities .dash-daypick { flex: 1 1 auto; width: auto; }
	.dash-header .btn { flex: 1 1 auto; }

	/* top bar: search becomes the full row under the icons when opened */
	.app-header .navbar { flex-wrap: nowrap; }
	.app-header .nav-link { padding-left: 0.45rem; padding-right: 0.45rem; }

	/* two-pane screens stack */
	.entry-pane, .rows-pane, .dep-form, .dep-bilties { width: 100%; max-width: 100%; }

	/* bilty detail */
	.bd-steps { overflow-x: auto; }
	.bd-route b { font-size: 1rem; }
	.bd-facts > div { flex-wrap: wrap; }
	.app-content-header h1 .badge { font-size: 0.65rem !important; }

	/* modals use the whole width */
	.modal-dialog { margin: 0.5rem; }
}
@media (max-width: 575.98px) {
	.topbar-search-item { margin-left: 0.25rem; }
	.topbar-search { width: 44vw; padding: 0 0.6rem; }
	.topbar-results { position: fixed; top: 3.6rem; left: 0.5rem; right: 0.5rem; width: auto; }
}
@media (max-width: 575.98px) {
	/* empty spacer columns only push fields down on a phone */
	.app-main .row > [class*="col"]:not(:has(*)) { display: none; }
	/* date boxes: icon and input stay on one line, full column width */
	.app-main .input-group[class*="col-"] { width: 100%; flex-wrap: nowrap; }
	.app-main .input-group > input[type="date"] { width: auto !important; flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 575.98px) {
	/* city strip: two cities per row, total across the top */
	.dash-city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
	.dash-city { padding: 0.5rem 0.6rem; }
	.dash-city.total { grid-column: 1 / -1; }
	.dash-city-qty { font-size: 1.4rem; }
	.dash-daypick .form-control { width: auto; }
}
@media (max-width: 575.98px) {
	/* KPI cards: two per row */
	.dash-kpi-col { width: 50%; flex: 0 0 auto; }
	.dash-kpi { padding: 0.65rem 0.7rem !important; }
	.dash-kpi-label { font-size: 0.72rem; }
	.dash-kpi-value, .dash-kpi .dash-kpi-num { font-size: 1.25rem !important; }
	.dash-kpi .dash-spark, .dash-kpi canvas { display: none; }
}
@media (max-width: 575.98px) {
	.app-content-header > .card, .app-content-header > form > .card { margin-left: 0 !important; margin-right: 0 !important; }
}
@media (max-width: 575.98px) {
	.app-main .input-group:has(> input[type="date"]) { flex-wrap: nowrap; }
	.app-main .input-group > input[type="date"] { padding-left: 0.4rem; padding-right: 0.3rem; font-size: 0.85rem; }
	/* CP-B, CP-CT and CT side by side on their own line */
	.app-main .row > :has(+ #divCPB) { width: 100%; }
	.app-main .row > #divCPB, .app-main .row > #divCPCT, .app-main .row > #divCT { width: 33.3333%; }
}
@media (max-width: 575.98px) {
	/* stat cards: two per row, smaller */
	.app-main .row > [class*="col-"]:has(> .stat-card) { width: 50%; flex: 0 0 auto; }
	.stat-card { padding: 0.6rem !important; gap: 0.5rem !important; }
	.stat-card .stat-icon { width: 2rem !important; height: 2rem !important; font-size: 0.9rem !important; }
	.stat-card .stat-value { font-size: 1.05rem !important; }
	.stat-card .stat-label, .stat-card .stat-sub { font-size: 0.7rem !important; }
}
@media (max-width: 575.98px) {
	.app-main .row > [class*="col-"]:has(> .report-tile) { width: 100%; }
	.report-tile .report-title { font-size: 0.95rem; }
}
/* tablets: tiny form columns get a bit wider, wide dashboard tables scroll */
@media (min-width: 576px) and (max-width: 991.98px) {
	.app-main .row > .col-1 { flex: 0 0 auto; width: 16.6667%; }
}
@media (max-width: 991.98px) {
	.app-main .dash-table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }
}
@media (max-width: 575.98px) {
	/* full screen does nothing useful on a phone (iPhone Safari has none): keep the bar room for search */
	.app-header .nav-item:has(> #fullscreenToggle) { display: none; }
}
@media (max-width: 359.98px) {
	.topbar-search { width: 40vw; }
}

/* gate pass: the city / quantity table fills its column, its boxes look like the other inputs */
#dataTable > table#table { display: table; width: 100%; }
#dataTable > table#table th { font-size: 0.8rem; padding: 0.3rem 0.4rem; }
#dataTable > table#table td { padding: 0.15rem; }
#dataTable > table#table td input {
	width: 100%; min-width: 0;
	border: 1px solid var(--bs-border-color); border-radius: 0.35rem;
	padding: 0.2rem 0.45rem; font-size: 0.85rem;
	background: var(--bs-body-bg); color: var(--bs-body-color);
}
#dataTable > table#table td input[readonly] { background: var(--bs-tertiary-bg); }
@media (max-width: 767.98px) {
	/* a half column that holds its own row of fields (gate pass) takes the full width */
	.app-main .row > .col-6:has(> .row) { width: 100%; }
}

#themeToggle svg { vertical-align: -2px; }
