/* Veterans Security — Guard Portal */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Source+Sans+3:wght@300;400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--red:       #A53B3B;
	--red-dark:  #7a2b2b;
	--red-light: #c44;
	--black:     #0a0a0a;
	--bg:        #0d0d0d;
	--surface:   #161616;
	--surface-2: #1f1f1f;
	--surface-3: #272727;
	--border:    rgba(255,255,255,0.08);
	--border-2:  rgba(255,255,255,0.13);
	--text:      rgba(255,255,255,0.87);
	--text-dim:  rgba(255,255,255,0.5);
	--text-mute: rgba(255,255,255,0.3);
	--sidebar-w: 240px;
	--radius:    6px;
	--shadow:    0 4px 24px rgba(0,0,0,0.6);
}

html { font-size: 15px; }

body {
	font-family: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-light); }

h1, h2, h3 {
	font-family: 'Bebas Neue', 'Impact', sans-serif;
	letter-spacing: 0.04em;
	font-weight: 400;
}

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	padding: 1.5rem;
}

.auth-card {
	width: 100%;
	max-width: 420px;
	background: var(--surface);
	border: 1px solid var(--border-2);
	padding: 2.5rem 2rem;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.auth-logo {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.auth-logo-badge {
	width: 44px;
	height: 44px;
	background: var(--red);
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Bebas Neue', sans-serif;
	font-size: 1.2rem;
	color: #fff;
}

.auth-logo-text strong {
	display: block;
	font-family: 'Bebas Neue', sans-serif;
	font-size: 1.2rem;
	letter-spacing: 0.06em;
	color: var(--text);
}

.auth-logo-text small {
	display: block;
	font-size: 0.72rem;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.auth-card h1 {
	font-size: 2rem;
	margin-bottom: 0.25rem;
	color: var(--text);
}

.auth-sub {
	color: var(--text-dim);
	margin-bottom: 1.75rem;
	font-size: 0.9rem;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-dim);
	margin-bottom: 0.4rem;
}

.form-control {
	display: block;
	width: 100%;
	padding: 0.65rem 0.85rem;
	background: var(--surface-2);
	border: 1px solid var(--border-2);
	border-radius: var(--radius);
	color: var(--text);
	font-size: 0.95rem;
	font-family: inherit;
	transition: border-color 0.15s;
}

.form-control:focus {
	outline: none;
	border-color: var(--red);
}

.form-control::placeholder { color: var(--text-mute); }

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.form-hint {
	font-size: 0.78rem;
	color: var(--text-dim);
	margin-top: 0.25rem;
}

.form-readonly {
	padding: 0.65rem 0.85rem;
	background: var(--surface-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text-dim);
	font-size: 0.95rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.65rem 1.25rem;
	border: none;
	border-radius: var(--radius);
	font-size: 0.9rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
	text-decoration: none;
}

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

.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: #7a1d1d; color: #fff; }
.btn-danger:hover { background: #5a1515; color: #fff; }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.portal-body { display: flex; min-height: 100vh; }

.sidebar {
	width: var(--sidebar-w);
	background: var(--surface);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 200;
	transition: transform 0.25s ease;
}

.sidebar__brand {
	padding: 1.25rem 1rem;
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.sidebar__brand-logo {
	width: 36px;
	height: 36px;
	background: var(--red);
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Bebas Neue', sans-serif;
	font-size: 1rem;
	color: #fff;
	flex-shrink: 0;
}

.sidebar__brand strong {
	display: block;
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--text);
}

.sidebar__brand small {
	display: block;
	font-size: 0.68rem;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.sidebar-close {
	display: none;
	margin-left: auto;
	background: none;
	border: none;
	color: var(--text-dim);
	font-size: 1.4rem;
	cursor: pointer;
	padding: 0 0.25rem;
	line-height: 1;
}

.sidebar__nav {
	flex: 1;
	padding: 0.75rem 0;
	overflow-y: auto;
}

.sidebar__link {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.7rem 1.1rem;
	color: var(--text-dim);
	font-weight: 600;
	font-size: 0.9rem;
	transition: background 0.15s, color 0.15s;
	border-left: 3px solid transparent;
}

.sidebar__link:hover {
	background: rgba(165, 59, 59, 0.1);
	color: var(--text);
}

.sidebar__link.is-active {
	background: rgba(165, 59, 59, 0.15);
	color: var(--red-light);
	border-left-color: var(--red);
}

.sidebar__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	width: 28px;
	height: 28px;
	border-radius: 5px;
	background: rgba(255,255,255,0.05);
	font-size: 0.72rem;
	font-weight: 700;
}

.sidebar__foot {
	padding: 1rem;
	border-top: 1px solid var(--border);
}

.sidebar__guard {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 0.75rem;
}

.sidebar__guard-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--red);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.9rem;
	color: #fff;
	flex-shrink: 0;
}

.sidebar__guard-info p {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 140px;
}

.sidebar__guard-info small {
	font-size: 0.7rem;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.sidebar__logout {
	display: block;
	padding: 0.5rem 0.75rem;
	border-radius: var(--radius);
	background: rgba(165,59,59,0.15);
	color: #e07777;
	font-size: 0.82rem;
	font-weight: 600;
	text-align: center;
	transition: background 0.15s;
}

.sidebar__logout:hover { background: rgba(165,59,59,0.3); color: #e07777; }

.sidebar-toggle {
	display: none;
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 300;
	background: var(--surface);
	border: 1px solid var(--border-2);
	color: var(--text);
	font-size: 1.1rem;
	padding: 0.45rem 0.65rem;
	border-radius: var(--radius);
	cursor: pointer;
}

.portal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.55);
	z-index: 150;
}

.portal-overlay.is-visible { display: block; }

/* ── Bottom tab bar (mobile only; hidden on desktop) ── */
.portal-tabs { display: none; }
.portal-more-menu { display: none; }

/* ── Main content ────────────────────────────────────────────────────────── */
.portal-main {
	margin-left: var(--sidebar-w);
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.portal-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.75rem;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
	position: sticky;
	top: 0;
	z-index: 100;
}

.portal-topbar h1 {
	font-size: 1.6rem;
	line-height: 1;
}

.breadcrumb {
	font-size: 0.72rem;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 0.2rem;
}

.topbar-name {
	font-size: 0.85rem;
	color: var(--text-dim);
	font-weight: 600;
}

.portal-content { padding: 1.75rem; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	margin-bottom: 1.25rem;
}

.card-title {
	font-family: 'Bebas Neue', sans-serif;
	font-size: 1.15rem;
	letter-spacing: 0.04em;
	color: var(--text);
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.card-title small {
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.75rem;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* ── Dashboard grid ──────────────────────────────────────────────────────── */
.dash-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.stat-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem 1.5rem;
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.stat-card__icon {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background: rgba(165,59,59,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	color: var(--red-light);
	flex-shrink: 0;
}

.stat-card__label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-dim);
	margin-bottom: 0.2rem;
}

.stat-card__value {
	font-family: 'Bebas Neue', sans-serif;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--text);
}

.stat-card__sub {
	font-size: 0.8rem;
	color: var(--text-dim);
	margin-top: 0.15rem;
}

/* ── Welcome banner ──────────────────────────────────────────────────────── */
.welcome-banner {
	background: linear-gradient(135deg, var(--red-dark) 0%, #1a1a1a 100%);
	border: 1px solid rgba(165,59,59,0.4);
	border-radius: var(--radius);
	padding: 1.5rem 2rem;
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.welcome-banner h2 {
	font-size: 1.8rem;
	color: #fff;
}

.welcome-banner p {
	color: rgba(255,255,255,0.65);
	font-size: 0.9rem;
	margin-top: 0.25rem;
}

.quick-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

thead th {
	text-align: left;
	padding: 0.6rem 0.85rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-dim);
	border-bottom: 1px solid var(--border);
	background: var(--surface-2);
}

tbody td {
	padding: 0.7rem 0.85rem;
	border-bottom: 1px solid var(--border);
	color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
	display: inline-block;
	padding: 0.2em 0.65em;
	border-radius: 4px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.badge-pending  { background: rgba(200,150,0,0.2);  color: #d4aa00; }
.badge-approved { background: rgba(50,160,50,0.2);  color: #4caf50; }
.badge-denied   { background: rgba(180,30,30,0.2);  color: #e07070; }
.badge-submitted{ background: rgba(60,120,200,0.2); color: #6ea8fe; }
.badge-reviewed { background: rgba(130,90,200,0.2); color: #b794f4; }
.badge-scheduled{ background: rgba(0,150,200,0.2);  color: #4fc3f7; }
.badge-completed{ background: rgba(50,160,50,0.2);  color: #4caf50; }
.badge-cancelled{ background: rgba(100,100,100,0.2); color: #9e9e9e; }
.badge-active   { background: rgba(50,160,50,0.2);  color: #4caf50; }
.badge-default  { background: rgba(255,255,255,0.08); color: var(--text-dim); }

/* ── Schedule / calendar ─────────────────────────────────────────────────── */
.week-nav {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.week-nav span {
	font-family: 'Bebas Neue', sans-serif;
	font-size: 1.3rem;
	letter-spacing: 0.04em;
}

.shift-list { display: flex; flex-direction: column; gap: 0.75rem; }

.shift-item {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-left: 3px solid var(--red);
	border-radius: var(--radius);
	padding: 0.9rem 1.1rem;
}

.shift-date-col {
	flex-shrink: 0;
	text-align: center;
	min-width: 52px;
}

.shift-date-col .day { font-size: 0.7rem; text-transform: uppercase; color: var(--text-dim); }
.shift-date-col .num { font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; line-height: 1; color: var(--text); }
.shift-date-col .mon { font-size: 0.7rem; text-transform: uppercase; color: var(--text-dim); }

.shift-info { flex: 1; }
.shift-info strong { display: block; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.shift-info p { font-size: 0.82rem; color: var(--text-dim); }

.shift-time {
	flex-shrink: 0;
	text-align: right;
	font-size: 0.88rem;
	color: var(--text);
}

.no-data {
	text-align: center;
	padding: 2.5rem 1rem;
	color: var(--text-dim);
	font-style: italic;
}

/* ── Alert / notice ──────────────────────────────────────────────────────── */
.alert {
	padding: 0.85rem 1rem;
	border-radius: var(--radius);
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

.alert-error   { background: rgba(180,30,30,0.18); border: 1px solid rgba(180,30,30,0.4); color: #f08080; }
.alert-success { background: rgba(50,160,50,0.18); border: 1px solid rgba(50,160,50,0.4);  color: #7fcf7f; }
.alert-info    { background: rgba(60,120,200,0.12); border: 1px solid rgba(60,120,200,0.35); color: #7baff0; }

/* ── Profile photo ───────────────────────────────────────────────────────── */
.photo-upload-area {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.photo-preview {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: var(--surface-3);
	border: 2px solid var(--border-2);
	object-fit: cover;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Bebas Neue', sans-serif;
	font-size: 2rem;
	color: var(--text-dim);
	overflow: hidden;
}

.photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── KB articles ─────────────────────────────────────────────────────────── */
.kb-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.kb-cat-btn {
	padding: 0.35rem 0.85rem;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
	border: 1px solid var(--border-2);
	background: var(--surface-2);
	color: var(--text-dim);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	text-decoration: none;
}

.kb-cat-btn:hover, .kb-cat-btn.is-active {
	background: var(--red);
	border-color: var(--red);
	color: #fff;
}

.kb-list { display: flex; flex-direction: column; gap: 0.85rem; }

.kb-card {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.1rem 1.25rem;
	cursor: pointer;
	transition: border-color 0.15s;
}

.kb-card:hover { border-color: var(--red); }

.kb-card h3 {
	font-size: 1rem;
	color: var(--text);
	margin-bottom: 0.3rem;
	font-family: 'Source Sans 3', sans-serif;
	font-weight: 700;
}

.kb-card p { font-size: 0.85rem; color: var(--text-dim); }

.kb-article {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
}

.kb-article h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text); }

.kb-article .kb-body {
	font-size: 0.95rem;
	color: rgba(255,255,255,0.8);
	line-height: 1.75;
	white-space: pre-wrap;
}

.kb-meta {
	font-size: 0.75rem;
	color: var(--text-dim);
	margin-bottom: 0.75rem;
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

/* ── Section header ──────────────────────────────────────────────────────── */
.section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.section-header h2 {
	font-size: 1.3rem;
}

/* ── Lockout notice ──────────────────────────────────────────────────────── */
.lockout-box {
	background: rgba(180,30,30,0.15);
	border: 1px solid rgba(180,30,30,0.4);
	border-radius: var(--radius);
	padding: 1.25rem;
	text-align: center;
	color: #f08080;
}

/* ── Mobile (≤768px) ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	/* Sidebar replaced by bottom tab bar */
	.sidebar { display: none; }
	.sidebar-toggle { display: none; }
	.portal-overlay { display: none !important; }

	.portal-main { margin-left: 0; }

	/* Topbar — compact */
	.portal-topbar { padding: 0.75rem 1rem; }
	.portal-topbar h1 { font-size: 1.3rem; }
	.topbar-name { display: none; }

	/* Content — bottom padding clears the fixed tab bar */
	.portal-content {
		padding: 1rem;
		padding-bottom: calc(64px + env(safe-area-inset-bottom) + 0.5rem);
	}

	/* Dashboard — 2-col grid on tablets */
	.dash-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

	/* Welcome banner */
	.welcome-banner {
		flex-direction: column;
		align-items: flex-start;
		padding: 1rem;
		gap: 0.75rem;
	}
	.welcome-banner h2 { font-size: 1.4rem; }
	.quick-actions { flex-direction: column; }
	.quick-actions .btn { width: 100%; justify-content: center; }

	/* Tables — touch-friendly horizontal scroll */
	.table-wrap { -webkit-overflow-scrolling: touch; }
	table { font-size: 0.85rem; }

	/* Forms — larger touch targets */
	.form-row { flex-direction: column; gap: 0; }
	.form-control,
	select.form-control { min-height: 44px; }
	.btn { min-height: 44px; }

	/* Schedule */
	.week-nav { flex-wrap: wrap; gap: 0.5rem; }
	.shift-item { flex-direction: column; gap: 0.5rem; }
	.shift-time { text-align: left; }

	/* Email client — stack panels vertically */
	.email-layout {
		flex-direction: column;
		height: auto;
	}
	.email-folders {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--border);
		display: flex;
		flex-direction: row;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding: 0.25rem 0;
	}
	.email-folder-item { white-space: nowrap; flex-shrink: 0; }
	.email-list {
		max-height: 50vh;
		border-right: none;
		border-bottom: 1px solid var(--border);
	}
	.email-view { min-height: 40vh; }

	/* Gallery — 2-column grid */
	.gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }

	/* Section header — wrap on small screens */
	.section-header { flex-wrap: wrap; gap: 0.5rem; }

	/* Modals — full-screen on mobile */
	.modal-box {
		position: fixed;
		inset: 0;
		border-radius: 0;
		max-height: 100vh;
		overflow-y: auto;
	}

	/* ── Bottom tab bar ── */
	.portal-tabs {
		display: flex;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background: var(--surface);
		border-top: 1px solid var(--border-2);
		z-index: 500;
		padding-bottom: env(safe-area-inset-bottom);
	}
	.portal-tab {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 0.4rem 0.2rem;
		font-size: 0.62rem;
		font-family: inherit;
		text-decoration: none;
		color: var(--text-dim);
		gap: 3px;
		border: none;
		background: none;
		cursor: pointer;
		position: relative;
		min-width: 0;
		line-height: 1.1;
		transition: color 0.15s;
	}
	.portal-tab svg { width: 22px; height: 22px; flex-shrink: 0; }
	.portal-tab span {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
	}
	.portal-tab.active,
	.portal-tab:hover { color: var(--red-light); }
	.portal-tab__badge {
		position: absolute;
		top: 3px;
		right: calc(50% - 20px);
		min-width: 16px;
		height: 16px;
		border-radius: 8px;
		background: var(--red);
		color: #fff;
		font-size: 0.58rem;
		font-weight: 700;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 3px;
		line-height: 1;
	}

	/* ── More menu drawer ── */
	.portal-more-menu {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.55);
		z-index: 700;
	}
	.portal-more-menu.is-open { display: block; }
	.portal-more-menu__inner {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		background: var(--surface);
		border-radius: 16px 16px 0 0;
		padding: 1.25rem 1rem;
		padding-bottom: calc(1rem + env(safe-area-inset-bottom));
		max-height: 80vh;
		overflow-y: auto;
	}
	.portal-more-menu__title {
		font-family: 'Bebas Neue', sans-serif;
		font-size: 1rem;
		letter-spacing: 0.08em;
		color: var(--text-dim);
		text-transform: uppercase;
		margin-bottom: 0.75rem;
		padding-bottom: 0.5rem;
		border-bottom: 1px solid var(--border);
	}
	.portal-more-menu__grid {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 0.6rem;
		margin-bottom: 0.75rem;
	}
	.portal-more-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.35rem;
		padding: 0.85rem 0.4rem;
		background: var(--surface-2);
		border: 1px solid var(--border);
		border-radius: var(--radius);
		color: var(--text);
		text-decoration: none;
		font-size: 0.75rem;
		font-weight: 600;
		text-align: center;
		transition: background 0.15s, color 0.15s;
		position: relative;
	}
	.portal-more-item:hover,
	.portal-more-item.is-active {
		background: rgba(165,59,59,0.2);
		color: var(--red-light);
		border-color: var(--red);
	}
	.portal-more-item__icon {
		width: 32px;
		height: 32px;
		border-radius: 6px;
		background: rgba(255,255,255,0.06);
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 0.85rem;
		font-weight: 700;
		font-family: 'Bebas Neue', sans-serif;
		letter-spacing: 0.03em;
	}
	.portal-more-menu__close {
		display: block;
		width: 100%;
		padding: 0.7rem;
		background: none;
		border: 1px solid var(--border-2);
		border-radius: var(--radius);
		color: var(--text-dim);
		font-size: 0.85rem;
		font-weight: 600;
		font-family: inherit;
		cursor: pointer;
		text-align: center;
		transition: background 0.15s;
	}
	.portal-more-menu__close:hover { background: var(--surface-2); }
}

/* ── Small mobile (≤480px) ──────────────────────────────────────────────── */
@media (max-width: 480px) {
	html { font-size: 14px; }
	.auth-card { padding: 1.75rem 1.25rem; }
	.portal-topbar h1 { font-size: 1.15rem; }
	.portal-content {
		padding: 0.75rem;
		padding-bottom: calc(64px + env(safe-area-inset-bottom) + 0.5rem);
	}
	.card { padding: 0.9rem; }
	.stat-card { padding: 0.85rem 1rem; }
	.welcome-banner { padding: 0.85rem 1rem; }
	.dash-grid { grid-template-columns: 1fr; }
}

/* ── KB article content ──────────────────────────────────────────────────── */
.kb-content h2 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.5rem; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.25rem; font-family: inherit; letter-spacing: 0; }
.kb-content h3 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.4rem; color: rgba(255,255,255,0.7); font-family: inherit; letter-spacing: 0; }
.kb-content p { margin: 0.5rem 0 0.75rem; line-height: 1.7; }
.kb-content ul, .kb-content ol { padding-left: 1.5rem; margin: 0.5rem 0 0.75rem; }
.kb-content li { margin-bottom: 0.3rem; line-height: 1.6; }
.kb-content strong { font-weight: 600; }
.kb-content dl { margin: 0.5rem 0; }
.kb-content dt { font-weight: 600; margin-top: 0.5rem; }
.kb-content dd { margin-left: 1.5rem; color: rgba(255,255,255,0.55); }

.kb-content-toc { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 1.5rem; font-size: 0.875rem; }
.kb-content-toc a { color: #7aabf0; text-decoration: none; display: block; padding: 0.15rem 0; }
.kb-content-toc a:hover { text-decoration: underline; }
.kb-content-toc .toc-h3 { padding-left: 1rem; }
.kb-content-toc a.toc-active { font-weight: 600; color: #9ec5ff; }

/* ── Email client ─────────────────────────────────────────────────────────── */
.email-layout { display: flex; gap: 0; height: calc(100vh - var(--header-h, 60px) - 2rem); }
.email-folders { width: 180px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 0.5rem 0; }
.email-folder-item { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.75rem; cursor: pointer; border-radius: 4px; font-size: 0.875rem; }
.email-folder-item.active { background: var(--accent-soft, rgba(165,59,59,0.12)); color: var(--red-light); font-weight: 600; }
.email-list { flex: 1; overflow-y: auto; border-right: 1px solid var(--border); }
.email-list-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.email-list-item.unread { font-weight: 600; background: var(--surface-2); }
.email-list-item:hover { background: var(--surface-2); }
.email-view { flex: 1; overflow-y: auto; padding: 1rem; }
.email-compose { padding: 1rem; }
.email-compose textarea { width: 100%; min-height: 200px; }

/* Unread badge in sidebar nav */
.email-unread-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	background: var(--red);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	padding: 0 4px;
	margin-left: 5px;
	line-height: 1;
}

/* ── Notification bell (header) ──────────────────────────────────────────── */
.notif-bell { position: relative; }
.notif-btn { background: none; border: none; cursor: pointer; padding: 0.4rem; position: relative; color: inherit; display: flex; align-items: center; justify-content: center; }
.notif-btn:hover { color: var(--red-light); }
.notif-count { position: absolute; top: 0; right: 0; background: #ef4444; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; font-weight: 700; pointer-events: none; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + 6px); width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); z-index: 600; display: none; }
.notif-dropdown.is-open { display: block; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.875rem; }
.notif-mark-all { font-size: 0.75rem; color: var(--red-light); text-decoration: none; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item { display: block; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; font-size: 0.8rem; transition: background 0.15s; }
.notif-item:hover { background: var(--surface-2); }
.notif-item--unread { background: rgba(165,59,59,0.08); }
.notif-item__title { font-weight: 600; margin-bottom: 0.15rem; }
.notif-item__body { color: var(--text-dim); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.notif-item__time { color: var(--text-mute); font-size: 0.7rem; margin-top: 0.15rem; }
.notif-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-dim); font-size: 0.875rem; }
.notif-footer { display: block; padding: 0.6rem 1rem; text-align: center; font-size: 0.8rem; color: var(--red-light); border-top: 1px solid var(--border); text-decoration: none; }
.notif-footer:hover { background: var(--surface-2); }

/* Nav badge (notification count on sidebar links) */
.nav-badge { background: #ef4444; color: #fff; border-radius: 10px; padding: 1px 6px; font-size: 0.65rem; font-weight: 700; margin-left: auto; flex-shrink: 0; }

/* ── Notifications full page ─────────────────────────────────────────────── */
.notif-page { max-width: 760px; }
.notif-page__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.notif-page__filters { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.notif-page__filters select { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); border-radius: var(--radius); padding: 0.35rem 0.65rem; font-size: 0.85rem; }
.notif-page__mark-all { background: none; border: 1px solid var(--border-2); color: var(--red-light); border-radius: var(--radius); padding: 0.35rem 0.75rem; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.notif-page__mark-all:hover { background: var(--surface-2); }
.btn-link { color: var(--text-dim); font-size: 0.8rem; text-decoration: underline; }
.notif-page__list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.notif-page__item { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.notif-page__item:last-child { border-bottom: none; }
.notif-page__item--unread { background: rgba(165,59,59,0.07); }
.notif-page__icon { font-size: 1.25rem; flex-shrink: 0; padding-top: 0.1rem; }
.notif-page__content { flex: 1; min-width: 0; }
.notif-page__title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
.notif-page__body { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 0.3rem; }
.notif-page__meta { display: flex; gap: 0.75rem; align-items: center; font-size: 0.75rem; color: var(--text-mute); flex-wrap: wrap; }
.notif-page__type { background: var(--surface-2); border-radius: 4px; padding: 1px 6px; font-size: 0.7rem; color: var(--text-dim); }
.notif-page__badge { background: var(--red); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 0.7rem; font-weight: 700; }
.notif-page__cta { flex-shrink: 0; color: var(--red-light); font-size: 0.8rem; white-space: nowrap; padding: 0.25rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; }
.notif-page__cta:hover { background: var(--surface-2); }
.notif-page__empty { text-align: center; padding: 3rem 1rem; color: var(--text-dim); }
.notif-page__empty p { margin-top: 0.5rem; }
.notif-page__pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.25rem; font-size: 0.875rem; }
.notif-page__pg-btn { color: var(--red-light); text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.3rem 0.75rem; }
.notif-page__pg-btn:hover { background: var(--surface-2); }
.notif-page__pg-label { color: var(--text-dim); }

/* ── Clock In / Out ────────────────────────────────────────────────────────── */
.clock-card { text-align: center; padding: 2rem; }
.clock-display { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-bottom: 0.5rem; font-family: 'Bebas Neue', 'Impact', monospace; }
.clock-btn { display: inline-block; font-size: 1.25rem; padding: 1rem 3rem; border-radius: 50px; border: none; cursor: pointer; font-weight: 600; transition: transform 0.1s, box-shadow 0.15s; font-family: inherit; margin-top: 0.75rem; }
.clock-btn--in  { background: #10b981; color: #fff; box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
.clock-btn--out { background: #ef4444; color: #fff; box-shadow: 0 4px 16px rgba(239,68,68,0.35); }
.clock-btn:hover { transform: scale(1.02); }
.clock-btn:active { transform: scale(0.97); }
.clock-gps-status { font-size: 0.8rem; margin: 0.75rem 0; color: var(--text-dim); }
.clock-gps-ok   { color: #10b981; }
.clock-gps-warn { color: #f59e0b; }
.clock-shift-info { background: var(--surface-2); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem auto; font-size: 0.875rem; max-width: 460px; text-align: left; }

/* Active clock-in badge in nav */
.clock-active-badge { background: #10b981; color: #fff; font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; margin-left: 5px; font-weight: 700; vertical-align: middle; letter-spacing: 0.05em; }

/* ── Dashboard Time Clock widget ─────────────────────────────────────────────── */
.dash-clock-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.dash-clock-info { flex: 1 1 240px; min-width: 0; }
.dash-clock-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; color: var(--text-dim); }
.dash-clock-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dash-clock-dot--on  { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.18); animation: dashClockPulse 2s ease-in-out infinite; }
.dash-clock-dot--off { background: var(--text-mute); }
@keyframes dashClockPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(16,185,129,0.18); } 50% { box-shadow: 0 0 0 7px rgba(16,185,129,0.05); } }
.dash-clock-timer {
	font-family: 'Bebas Neue', 'Impact', monospace;
	font-size: 2.75rem; line-height: 1.05; font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em; color: var(--text); margin: 0.35rem 0 0.15rem;
}
.dash-clock-shift { font-size: 0.82rem; color: var(--text-mute); margin-top: 0.25rem; }
.dash-clock-gps { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.5rem; min-height: 1rem; }
.dash-clock-gps--ok   { color: #10b981; }
.dash-clock-gps--warn { color: #f59e0b; }
.dash-clock-actions { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.dash-clock-btn {
	border: none; cursor: pointer; color: #fff; font-family: inherit; font-weight: 700;
	font-size: 1.15rem; padding: 0.95rem 2.5rem; border-radius: 50px;
	transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s; min-width: 190px;
}
.dash-clock-btn--in  { background: #10b981; box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
.dash-clock-btn--out { background: #ef4444; box-shadow: 0 4px 16px rgba(239,68,68,0.35); }
.dash-clock-btn:hover:not(:disabled)  { transform: scale(1.02); }
.dash-clock-btn:active:not(:disabled) { transform: scale(0.97); }
.dash-clock-history { font-size: 0.82rem; color: var(--text-dim); text-decoration: none; }
.dash-clock-history:hover { color: var(--text); }
@media (max-width: 640px) {
	.dash-clock-row { flex-direction: column; align-items: stretch; }
	.dash-clock-actions { width: 100%; }
	.dash-clock-btn { width: 100%; min-width: 0; font-size: 1.25rem; padding: 1.1rem; }
	.dash-clock-timer { font-size: 3.25rem; }
}

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert--success { background: rgba(16,185,129,0.12); border: 1px solid #10b981; color: #10b981; padding: 0.65rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert--error   { background: rgba(239,68,68,0.12);  border: 1px solid #ef4444;  color: #ef4444;  padding: 0.65rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
