/* Mcarl Logistics — Admin Dashboard theme
   Brand colours reused from the public site's css/style.css (--primary: #FF4800) */
:root {
	--mc-primary: #FF4800;
	--mc-primary-dark: #b33200;
	--mc-navy: #1F1F2E;
	--mc-navy-light: #2b2b40;
	--mc-bg: #f4f5f9;
	--mc-border: #e6e7ee;
	--sidebar-width: 250px;
}

* { box-sizing: border-box; }

body {
	background: var(--mc-bg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #333;
	margin: 0;
}

.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
	width: var(--sidebar-width);
	background: var(--mc-navy);
	color: #fff;
	position: fixed;
	top: 0; left: 0; bottom: 0;
	overflow-y: auto;
	z-index: 1040;
	transition: transform 0.25s ease;
}
.sidebar-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px 18px;
	font-size: 1.15rem;
	font-weight: 600;
	border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { color: var(--mc-primary); font-size: 1.4rem; }
.sidebar-nav { padding: 10px 0; display: flex; flex-direction: column; }
.sidebar-nav a {
	color: #cfd0dc;
	text-decoration: none;
	padding: 11px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.95rem;
	border-left: 3px solid transparent;
	transition: background 0.15s, color 0.15s;
}
.sidebar-nav a i { width: 18px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active {
	background: rgba(255,72,0,0.12);
	color: #fff;
	border-left-color: var(--mc-primary);
	font-weight: 600;
}
.sidebar-nav a.text-danger:hover { color: #ff8a80 !important; }
.sidebar-nav hr { margin: 10px 18px; }

.admin-overlay {
	display: none;
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.45);
	z-index: 1030;
}
.admin-overlay.show { display: block; }

/* Main area */
.admin-main {
	margin-left: var(--sidebar-width);
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.admin-topbar {
	background: #fff;
	border-bottom: 1px solid var(--mc-border);
	padding: 14px 22px;
	display: flex;
	align-items: center;
	gap: 14px;
	position: sticky;
	top: 0;
	z-index: 1020;
}
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; color: var(--mc-navy); flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 8px; color: #555; font-size: 0.92rem; }
.topbar-user i { font-size: 1.6rem; color: var(--mc-primary); }
.btn-burger {
	display: none;
	background: none; border: none; font-size: 1.3rem; color: var(--mc-navy); cursor: pointer;
}
.admin-content { padding: 22px; flex: 1; }
.admin-footer {
	padding: 14px 22px;
	color: #8a8a8a;
	font-size: 0.85rem;
	text-align: center;
	border-top: 1px solid var(--mc-border);
	background: #fff;
}

/* Stat cards */
.stat-card {
	background: #fff;
	border-radius: 12px;
	padding: 20px;
	border: 1px solid var(--mc-border);
	display: flex;
	align-items: center;
	gap: 16px;
	height: 100%;
}
.stat-card .stat-icon {
	width: 52px; height: 52px;
	border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.4rem;
	color: #fff;
	flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--mc-navy); line-height: 1.1; }
.stat-card .stat-label { color: #888; font-size: 0.85rem; }

.bg-icon-orange { background: var(--mc-primary); }
.bg-icon-navy { background: var(--mc-navy); }
.bg-icon-green { background: #17a673; }
.bg-icon-blue { background: #2c7be5; }

/* Cards / panels */
.panel {
	background: #fff;
	border-radius: 12px;
	border: 1px solid var(--mc-border);
	padding: 20px;
	margin-bottom: 22px;
}
.panel-title {
	font-size: 1.02rem;
	font-weight: 600;
	color: var(--mc-navy);
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

/* Tables */
.table-responsive-card table { margin-bottom: 0; }
.admin-table thead th {
	background: #f8f9fc;
	color: #555;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-bottom: 2px solid var(--mc-border);
	white-space: nowrap;
}
.admin-table td { vertical-align: middle; font-size: 0.92rem; }
.admin-table td.actions { white-space: nowrap; }

.btn-mc {
	background: var(--mc-primary);
	border-color: var(--mc-primary);
	color: #fff;
}
.btn-mc:hover { background: var(--mc-primary-dark); border-color: var(--mc-primary-dark); color: #fff; }

.search-box { max-width: 320px; }

/* Delivery count-down timer (js/mc-timer.js) - red and bold once the
   route's promised delivery time has elapsed, whether or not the order
   has been marked Delivered yet. */
.mc-timer { font-variant-numeric: tabular-nums; }
.mc-timer-overdue { color: #dc3545; font-weight: 700; }

.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--mc-navy) 0%, #3a3a56 100%);
	padding: 20px;
}
.login-card {
	background: #fff;
	border-radius: 14px;
	padding: 36px 32px;
	width: 100%;
	max-width: 380px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.login-card .brand {
	text-align: center;
	margin-bottom: 22px;
}
.login-card .brand i { font-size: 2.4rem; color: var(--mc-primary); }
.login-card .brand h4 { margin-top: 8px; color: var(--mc-navy); font-weight: 700; }

/* Brand logo image - used in place of the truck icon wherever the site
   shows the Mcarl Logistics wordmark */
.brand-logo {
	height: 34px;
	width: auto;
	vertical-align: middle;
	background: #fff;
	border-radius: 8px;
	padding: 3px 6px;
	object-fit: contain;
}
.brand .brand-logo { height: 64px; padding: 6px 10px; border-radius: 12px; margin-bottom: 4px; }
.sidebar-brand .brand-logo { height: 36px; padding: 3px 6px; border-radius: 8px; }

/* Responsive */
@media (max-width: 991px) {
	.admin-sidebar { transform: translateX(-100%); }
	.admin-sidebar.open { transform: translateX(0); }
	.admin-main { margin-left: 0; }
	.btn-burger { display: inline-block; }
}
@media (max-width: 575px) {
	.admin-content { padding: 14px; }
	.admin-topbar { padding: 12px 14px; }
	.stat-card { flex-direction: row; }
}

/* Sign up / sign in forms - keep the same card look on a phone as on a
   desktop browser (just narrower), instead of the cramped, oddly-spaced
   layout a phone falls back to without these rules. Also stops iOS Safari
   from auto-zooming the page when a form field is tapped (it does this to
   any input with a font-size under 16px). */
.login-page, .panel {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
.form-control, .form-select, .btn {
	font-size: 1rem; /* 16px - below this, iOS zooms in on focus/tap */
}
@media (max-width: 480px) {
	.login-page { padding: 14px; }
	.login-card { padding: 26px 20px; border-radius: 12px; }
	.panel { padding: 16px; border-radius: 10px; }
	.mc-topnav .brand-logo { height: 28px; }
}
