/* ============================================================
   PestX — Brand & Custom Styles (on top of Bootstrap 5)
   ============================================================ */

/* ─── Font Face Declarations (locally hosted, no CDN) ─── */
@font-face {
	font-family: 'Space Grotesk';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('../fonts/space-grotesk-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Space Grotesk';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Inter Tight';
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url('../fonts/inter-tight-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Inter Tight';
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url('../fonts/inter-tight-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Brand Tokens & Bootstrap Variable Overrides (pestX v1.0) --- */
:root {
	/* ─── Brand Palette ─── */
	--ink:          #0A0B0C;
	--carbon:       #15171A;
	--steel:        #2A2D31;
	--slate:        #6B7079;
	--fog:          #C8CBD0;
	--bone:         #F2F0EA;
	--paper:        #FFFFFF;
	--toxin:        oklch(0.66 0.19 145);
	--toxin-deep:   oklch(0.48 0.16 145);
	--toxin-tint:   oklch(0.94 0.06 145);
	--hazard:       oklch(0.80 0.16 78);
	--alert:        oklch(0.60 0.22 25);

	/* ─── Font Families ─── */
	--font-display: 'Space Grotesk', 'Helvetica Neue', system-ui, sans-serif;
	--font-body:    'Inter Tight', 'Helvetica Neue', system-ui, sans-serif;
	--font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

	/* ─── Bootstrap Overrides ─── */
	--bs-primary:             #1FB04E;
	--bs-primary-rgb:         31, 176, 78;
	--bs-success:             #1FB04E;
	--bs-success-rgb:         31, 176, 78;
	--bs-danger:              #DC3522;
	--bs-danger-rgb:          220, 53, 34;
	--bs-warning:             #F4A92A;
	--bs-warning-rgb:         244, 169, 42;
	--bs-link-color:          #1FB04E;
	--bs-link-hover-color:    #117A3A;
	--bs-body-font-family:    var(--font-body);
	--bs-body-font-size:      1rem;
	--bs-body-color:          var(--ink);
	--bs-border-radius:       8px;
	--bs-border-radius-sm:    4px;
	--bs-card-border-color:   var(--fog);
	--bs-card-box-shadow:     0 2px 8px rgba(0, 0, 0, 0.08);

	/* ─── Legacy aliases (keep while still referenced) ─── */
	--primary:        var(--toxin);
	--primary-dark:   var(--toxin-deep);
	--primary-light:  var(--toxin-tint);
	--black:          var(--ink);
	--gray-dark:      #333333;
	--gray-medium:    var(--slate);
	--gray-light:     #E0E0E0;
	--bg:             var(--paper);
	--bg-alt:         var(--bone);
	--blue:           #1976D2;
	--blue-bg:        #E3F2FD;
	--sidebar-bg:     var(--carbon);
	--sidebar-width:      240px;
	--sidebar-width-slim: 56px;
	--header-height:      56px;
	--danger-light:   #FDECEA;
	--warning-light:  #FFF8E1;
	--success-light:  var(--toxin-tint);
}

/* --- Bootstrap Btn-Primary color fix --- */
.btn-primary {
	--bs-btn-bg:               #1FB04E;
	--bs-btn-border-color:     #1FB04E;
	--bs-btn-hover-bg:         #1A9944;
	--bs-btn-hover-border-color: #1A9944;
	--bs-btn-active-bg:        #117A3A;
	--bs-btn-active-border-color: #117A3A;
	--bs-btn-disabled-bg:      #1FB04E;
	--bs-btn-disabled-border-color: #1FB04E;
	color: #fff;
	--bs-btn-color: #fff;
	--bs-btn-hover-color: #fff;
	--bs-btn-active-color: #fff;
	box-shadow: 0 1px 3px rgba(31, 176, 78, 0.3);
}

.btn-primary:hover {
	box-shadow: 0 2px 6px rgba(31, 176, 78, 0.4);
}

.btn-outline-primary {
	--bs-btn-color:            #1FB04E;
	--bs-btn-border-color:     #1FB04E;
	--bs-btn-hover-bg:         #1FB04E;
	--bs-btn-hover-border-color: #1FB04E;
	--bs-btn-active-bg:        #117A3A;
}

/* --- App Layout --- */
body {
	background: var(--bg-alt);
	min-height: 100vh;
}

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

/* --- Sidebar --- */
.sidebar {
	width: var(--sidebar-width);
	background: var(--sidebar-bg);
	color: rgba(255, 255, 255, 0.8);
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0;
	left: 0;
	height: 100vh;
	overflow-y: auto;
	z-index: 1000;
	transition: transform 0.3s ease;
	border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* slim scrollbar in sidebar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.sidebar-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 16px 14px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-header img {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.sidebar-header h1 {
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	margin: 0;
	letter-spacing: -0.01em;
}

.sidebar-nav {
	flex: 1;
	padding: 8px 0 12px;
}

.sidebar-nav .nav-section-label {
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.28);
	padding: 18px 16px 4px;
}

.sidebar-nav a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 10px 7px 16px;
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
	font-size: 0.8375rem;
	border-radius: 0 6px 6px 0;
	margin: 1px 8px 1px 0;
	transition: all 0.15s ease;
	position: relative;
}

.sidebar-nav a i {
	font-size: 0.9375rem;
	width: 17px;
	text-align: center;
	flex-shrink: 0;
	opacity: 0.75;
	transition: opacity 0.15s;
}

.sidebar-nav a:hover {
	color: rgba(255, 255, 255, 0.9);
	background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav a:hover i { opacity: 1; }

.sidebar-nav a.active {
	color: #fff;
	background: rgba(31, 176, 78, 0.18);
	font-weight: 500;
}

.sidebar-nav a.active i { opacity: 1; color: var(--primary); }

.sidebar-nav a.active::before {
	content: '';
	position: absolute;
	left: -8px;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 20px;
	background: var(--primary);
	border-radius: 0 2px 2px 0;
}

.nav-group-toggle {
	cursor: pointer;
	user-select: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-right: 12px;
}

.nav-group-toggle:hover {
	color: rgba(255, 255, 255, 0.5);
}

.nav-group-chevron {
	font-size: 0.6rem;
	opacity: 0.45;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.nav-group.collapsed .nav-group-chevron {
	transform: rotate(-90deg);
}

.nav-group-items {
	overflow: hidden;
	max-height: 400px;
	transition: max-height 0.25s ease;
}

.nav-group.collapsed .nav-group-items {
	max-height: 0;
}

.sidebar-footer {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	background: rgba(0, 0, 0, 0.15);
}

.user-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--primary-dark), var(--primary));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	flex-shrink: 0;
}

.user-info {
	flex: 1;
	min-width: 0;
}

.user-name {
	font-size: 0.8rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.9);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.user-role {
	font-size: 0.7rem;
	color: rgba(255, 255, 255, 0.38);
	margin-top: 1px;
}

/* --- Sidebar Slim-Toggle Button --- */
.sidebar-slim-toggle {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	padding: 4px 5px;
	border-radius: 4px;
	cursor: pointer;
	flex-shrink: 0;
	margin-left: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	transition: color 0.15s, background 0.15s;
	line-height: 1;
}

.sidebar-slim-toggle:hover {
	color: rgba(255, 255, 255, 0.9);
	background: rgba(255, 255, 255, 0.08);
}

/* --- Slim Sidebar State --- */
.sidebar.slim {
	width: var(--sidebar-width-slim);
	overflow: visible;
}

.sidebar.slim .sidebar-header h1 {
	display: none;
}

.sidebar.slim .sidebar-slim-toggle {
	margin-left: 0;
}

.sidebar.slim .nav-section-label {
	display: none;
}

/* Hide nav link text via font-size: 0 trick; restore icon size */
.sidebar.slim .sidebar-nav a {
	font-size: 0;
	justify-content: center;
	padding: 9px 0;
	margin: 2px 4px;
	border-radius: 6px;
}

.sidebar.slim .sidebar-nav a i {
	font-size: 0.9375rem;
}

.sidebar.slim .sidebar-nav a.active::before {
	left: -4px;
	height: 60%;
}

.sidebar.slim .user-info {
	display: none;
}

/* --- Main Content --- */
.main-content {
	margin-left: var(--sidebar-width);
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	transition: margin-left 0.3s ease;
}

body.sidebar-slim .main-content {
	margin-left: var(--sidebar-width-slim);
}

.top-header {
	height: var(--header-height);
	background: var(--bg);
	border-bottom: 1px solid var(--gray-light);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.top-header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.top-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.top-header h2 {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--black);
	margin: 0;
	letter-spacing: -0.01em;
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	color: var(--gray-medium);
	padding: 4px 6px;
	border-radius: 6px;
	transition: background 0.15s, color 0.15s;
}

.menu-toggle:hover {
	background: var(--bg-alt);
	color: var(--gray-dark);
}

.page-content {
	flex: 1;
	padding: 20px 24px 32px;
}

/* --- Cards --- */
.card {
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
	border-color: var(--gray-light);
	border-radius: 10px;
	margin-bottom: 1.25rem;
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--bg);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	padding: 12px 18px;
	gap: 12px;
	border-radius: 10px 10px 0 0 !important;
}

.card-header h3 {
	font-size: 0.9rem;
	font-weight: 600;
	margin: 0;
	color: var(--black);
	display: flex;
	align-items: center;
	gap: 6px;
}

.card-body {
	border-radius: 0 0 10px 10px;
}

/* --- Section Title --- */
.section-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--black);
	margin-bottom: 0;
	letter-spacing: -0.01em;
	display: flex;
	align-items: center;
	gap: 8px;
}

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

.table {
	margin-bottom: 0;
}

.table th {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--gray-medium);
	border-bottom: 1px solid var(--gray-light);
	white-space: nowrap;
	padding: 10px 14px;
	background: var(--bg-alt);
}

.table td {
	padding: 11px 14px;
	vertical-align: middle;
	border-color: rgba(0, 0, 0, 0.04);
	font-size: 0.875rem;
}

.table tbody tr:last-child td {
	border-bottom: none;
}

.table-hover tbody tr:hover {
	background: var(--primary-light);
}

/* --- Badges --- */
.badge {
	font-size: 0.7rem;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 20px;
	letter-spacing: 0.01em;
}

.badge-outline-primary {
	background: transparent;
	color: var(--primary);
	border: 1px solid var(--primary);
}

.badge-success {
	background: var(--success-light);
	color: var(--primary-dark);
}

.badge-warning {
	background: var(--warning-light);
	color: #7a5100;
}

.badge-danger {
	background: var(--danger-light);
	color: var(--danger);
}

.bg-orange {
	background-color: #E65100 !important;
	color: #fff !important;
}

.badge-secondary,
.badge-default {
	background: rgba(0, 0, 0, 0.06);
	color: var(--gray-dark);
}

/* --- Filter Bar --- */
.filter-bar {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
	align-items: center;
}

.filter-bar .form-control,
.filter-bar .form-select {
	max-width: 220px;
	font-size: 0.875rem;
}

.filter-bar .search-input {
	max-width: 300px;
}

/* --- KPI Grid --- */
.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
	margin-bottom: 20px;
}

.kpi-card {
	background: var(--bg);
	border: 1px solid rgba(0, 0, 0, 0.07);
	border-radius: 12px;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 14px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.15s, transform 0.15s;
}

.kpi-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.kpi-icon {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	flex-shrink: 0;
}

.kpi-icon.green  { background: var(--primary-light); color: var(--primary); }
.kpi-icon.yellow { background: #FFF8E1; color: #E65100; }
.kpi-icon.red    { background: #FDECEA; color: var(--danger); }
.kpi-icon.blue   { background: var(--blue-bg); color: var(--blue); }

.kpi-value {
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--black);
	line-height: 1;
	letter-spacing: -0.02em;
}

.kpi-label {
	font-size: 0.775rem;
	color: var(--gray-medium);
	margin-top: 3px;
}

/* --- Dashboard: Alert List --- */
.alert-list {
	max-height: 360px;
	overflow-y: auto;
}

.alert-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--gray-light);
}

.alert-item:last-child {
	border-bottom: none;
}

.alert-item i {
	margin-top: 2px;
	font-size: 1rem;
}

.alert-item-body {
	flex: 1;
	min-width: 0;
}

.alert-item-title {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--black);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.alert-item-sub {
	font-size: 0.76rem;
	color: var(--gray-medium);
	margin-top: 1px;
}

/* --- Dashboard: Quick Links --- */
.quick-link-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.quick-link-card {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: var(--bg);
	border: 1px solid var(--gray-light);
	border-radius: 8px;
	text-decoration: none;
	color: var(--gray-dark);
	font-size: 0.85rem;
	font-weight: 500;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.quick-link-card i {
	font-size: 1rem;
	color: var(--primary);
}

.quick-link-card:hover {
	background: var(--primary-light);
	border-color: var(--primary);
	color: var(--primary-dark);
}

/* --- Dashboard: Technician color dot --- */
.dash-tech-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 5px;
	vertical-align: middle;
}

/* --- Toast Notifications --- */
.toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.toast-notification {
	background: #1e2329;
	color: #fff;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 0.875rem;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 240px;
	max-width: 380px;
	animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.toast-success { border-left: 3px solid var(--primary); }
.toast-notification.toast-error   { border-left: 3px solid #EF5350; }
.toast-notification.toast-warning { border-left: 3px solid var(--warning); }

.toast-notification.removing {
	animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
	from { transform: translateX(calc(100% + 24px)); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
	from { transform: translateX(0); opacity: 1; }
	to   { transform: translateX(calc(100% + 24px)); opacity: 0; }
}

/* --- Empty State --- */
.empty-state {
	text-align: center;
	padding: 48px 24px;
	color: var(--gray-medium);
}

.empty-state i {
	font-size: 2.25rem;
	margin-bottom: 10px;
	opacity: 0.35;
}

.empty-state p {
	margin: 0;
	font-size: 0.875rem;
}

/* --- Timeline --- */
.timeline { padding: 4px 0; }

.timeline-item {
	display: flex;
	gap: 14px;
	padding: 14px 18px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-marker {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-alt);
	border-radius: 50%;
	font-size: 0.9rem;
}

.timeline-body { flex: 1; min-width: 0; }

.timeline-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	flex-wrap: wrap;
}

.timeline-header > div:first-child {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.timeline-content {
	margin-top: 6px;
	color: var(--gray-dark);
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 0.875rem;
}

/* --- Building Tree --- */
.tree { padding: 14px; }

.tree-node {
	border-left: 2px solid var(--gray-light);
	margin-left: 8px;
	padding-left: 16px;
	margin-bottom: 4px;
}

.tree-node:last-child { border-left-color: transparent; }

.tree-node-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--bg-alt);
	border-radius: 7px;
	margin-bottom: 4px;
	flex-wrap: wrap;
}

.tree-node-info {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.tree-children { margin-left: 8px; }

/* --- Checkbox Group --- */
.checkbox-group {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 0.875rem;
	margin: 0;
}

/* --- Login Page --- */
.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(145deg, #0d1117 0%, #161b22 50%, #1a3a1c 100%);
	padding: 24px;
	position: relative;
	overflow: hidden;
}

.login-page::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, rgba(76,175,80,0.06) 1px, transparent 1px);
	background-size: 30px 30px;
	pointer-events: none;
}

.login-page::after {
	content: '';
	position: absolute;
	width: 600px;
	height: 600px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(76,175,80,0.12) 0%, transparent 70%);
	bottom: -200px;
	right: -150px;
	pointer-events: none;
}

.login-card {
	background: #fff;
	border-radius: 16px;
	padding: 40px 36px;
	width: 100%;
	max-width: 400px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
	position: relative;
	animation: cardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
	from { opacity: 0; transform: translateY(20px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
	text-align: center;
	margin-bottom: 32px;
}

.login-logo img {
	width: 68px;
	height: 68px;
	border-radius: 14px;
	object-fit: cover;
	margin-bottom: 14px;
	box-shadow: 0 8px 24px rgba(76,175,80,0.25);
}

.login-logo h2 {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--black);
	margin: 0;
	letter-spacing: -0.02em;
}

.login-logo p {
	font-size: 0.825rem;
	color: var(--gray-medium);
	margin: 4px 0 0;
}

.login-card .form-control:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}

.login-card .input-group-text {
	background: var(--bg-alt);
	border-color: var(--gray-light);
	color: var(--gray-medium);
}

.login-card .btn-primary {
	padding: 10px;
	font-size: 0.9375rem;
	letter-spacing: 0.01em;
}

/* --- Form controls --- */
.form-control:focus,
.form-select:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(31, 176, 78, 0.1);
}

.form-label {
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--gray-dark);
	margin-bottom: 5px;
}

/* --- Pagination --- */
.pagination .page-link {
	color: var(--primary);
	font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
	background-color: var(--primary);
	border-color: var(--primary);
}

/* --- Nav Tabs customization --- */
.tab-content {
	background: var(--bg);
}

.tab-pane {
	background: var(--bg);
}

.nav-tabs .nav-link {
	color: var(--gray-medium);
	border-bottom: 2px solid transparent;
	border-top: none;
	border-left: none;
	border-right: none;
	padding: 9px 14px;
	font-size: 0.8375rem;
	transition: color 0.15s;
}

.nav-tabs .nav-link.active {
	color: var(--primary-dark);
	border-bottom-color: var(--primary);
	font-weight: 600;
}

.nav-tabs .nav-link:hover:not(.active) {
	color: var(--black);
	border-bottom-color: var(--gray-light);
}

/* --- Modal customization --- */
.modal-content {
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header {
	border-bottom: 1px solid var(--gray-light);
	padding: 14px 18px;
	background: var(--bg-alt);
	border-radius: 12px 12px 0 0;
}

.modal-title { font-size: 0.9375rem; font-weight: 600; }

.modal-footer {
	border-top: 1px solid var(--gray-light);
	padding: 12px 18px;
	background: var(--bg-alt);
	border-radius: 0 0 12px 12px;
}

.modal-body {
	padding: 18px;
}

/* --- Responsive 1280px (slim sidebar + column hiding) --- */
@media (max-width: 1280px) {
	.page-content {
		padding: 14px 16px 24px;
	}

	.route-layout {
		grid-template-columns: 280px 1fr;
	}

	.col-hide-md {
		display: none !important;
	}

	.table th {
		white-space: normal;
	}
}

/* --- Responsive --- */
@media (max-width: 768px) {
	.sidebar {
		transform: translateX(-100%);
	}

	.sidebar.open {
		transform: translateX(0);
	}

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

	.menu-toggle {
		display: block;
	}

	.filter-bar .form-control,
	.filter-bar .form-select,
	.filter-bar .search-input {
		max-width: 100%;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.kpi-grid { grid-template-columns: 1fr; }
	.page-content { padding: 14px; }
}

/* --- Planner Toolbar --- */
.planner-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

/* --- Planner Grid --- */
.planner-grid {
	display: grid;
	min-width: 700px;
}

.planner-header-cell {
	background: var(--bg-alt);
	border-bottom: 2px solid var(--gray-light);
	border-right: 1px solid var(--gray-light);
	padding: 8px 10px;
	text-align: center;
	font-weight: 600;
	font-size: 0.8rem;
	color: var(--gray-dark);
}

.planner-header-cell.planner-today {
	background: var(--primary-light);
	color: var(--primary-dark);
}

.planner-day-name {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--gray-medium);
}

.planner-day-date {
	display: block;
	font-size: 1rem;
	font-weight: 700;
}

.planner-row-label {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	border-right: 2px solid var(--gray-light);
	border-bottom: 1px solid var(--gray-light);
	background: var(--bg-alt);
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
}

.tech-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	display: inline-block;
}

.tech-name {
	overflow: hidden;
	text-overflow: ellipsis;
}

.planner-day-cell {
	border-right: 1px solid var(--gray-light);
	border-bottom: 1px solid var(--gray-light);
	min-height: 80px;
	padding: 4px;
	vertical-align: top;
	transition: background 0.15s;
	cursor: pointer;
}

.planner-day-cell.planner-today {
	background: var(--primary-light);
}

.planner-day-cell.drag-over {
	background: #d4edda;
	outline: 2px dashed var(--primary);
}

/* --- Assignment Cards --- */
.planner-card {
	border-radius: 5px;
	padding: 4px 7px;
	margin-bottom: 4px;
	font-size: 0.75rem;
	cursor: pointer;
	border-left: 3px solid transparent;
	transition: opacity 0.15s, box-shadow 0.15s;
	user-select: none;
}

.planner-card:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.planner-card.dragging {
	opacity: 0.4;
}

.planner-card-time {
	font-weight: 700;
	color: var(--gray-dark);
	font-size: 0.7rem;
}

.planner-card-title {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.planner-card-customer {
	color: var(--gray-medium);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.planner-status-planned {
	background: var(--primary-light);
	border-left-color: var(--primary);
}

.planner-status-travelling {
	background: #e3f2fd;
	border-left-color: #1976D2;
}

.planner-status-onsite {
	background: #fff8e1;
	border-left-color: var(--warning);
}

.planner-status-done {
	background: var(--bg-alt);
	border-left-color: var(--gray-medium);
	opacity: 0.7;
}

.planner-status-cancelled {
	background: var(--danger-light);
	border-left-color: var(--danger);
	text-decoration: line-through;
	opacity: 0.6;
}

/* --- Planner Legend --- */
.planner-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	font-size: 0.8rem;
}

.planner-legend-title {
	font-weight: 600;
	color: var(--gray-dark);
}

.planner-legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

/* --- Day Planner (Outlook-style) --- */
.day-planner-scroll {
	overflow-y: auto;
	max-height: calc(100vh - 270px);
	min-height: 400px;
	position: relative;
}

.day-planner-grid {
	display: flex;
	position: relative;
	min-width: 500px;
}

.day-time-col {
	width: 54px;
	flex-shrink: 0;
	border-right: 2px solid var(--fog);
	position: sticky;
	left: 0;
	background: var(--paper);
	z-index: 2;
}

.day-corner {
	height: 41px;
	border-bottom: 2px solid var(--fog);
	background: var(--bone);
}

.day-time-slot {
	height: 60px;
	border-bottom: 1px solid var(--fog);
	display: flex;
	align-items: flex-start;
	padding: 3px 5px 0;
	font-size: 0.63rem;
	font-weight: 600;
	color: var(--slate);
	font-family: var(--font-mono);
	letter-spacing: 0.04em;
}

.day-time-slot.day-time-half {
	border-bottom-color: rgba(0,0,0,0.06);
	font-size: 0;
	height: 60px;
}

.day-tech-col {
	flex: 1;
	min-width: 140px;
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--fog);
}

.day-tech-header {
	height: 41px;
	position: sticky;
	top: 0;
	z-index: 3;
	background: var(--bone);
	border-bottom: 2px solid var(--fog);
	padding: 0 10px;
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	flex-shrink: 0;
}

.day-tech-header.day-today-col {
	background: var(--toxin-tint);
	color: var(--toxin-deep);
}

.day-col-body {
	position: relative;
	cursor: cell;
}

.day-slot-row {
	height: 60px;
	box-sizing: border-box;
}

.day-slot-hour {
	border-bottom: 1px solid var(--fog);
}

.day-slot-half {
	border-bottom: 1px dashed rgba(0,0,0,0.07);
}

.day-col-body.drag-over {
	background: rgba(31, 176, 78, 0.06);
	outline: 2px dashed var(--toxin);
	outline-offset: -2px;
}

/* Day assignment cards */
.day-card {
	position: absolute;
	left: 3px;
	right: 3px;
	border-radius: 5px;
	padding: 3px 7px;
	font-size: 0.72rem;
	cursor: pointer;
	border-left: 3px solid transparent;
	transition: box-shadow 0.15s, opacity 0.15s;
	user-select: none;
	overflow: hidden;
	z-index: 1;
	box-shadow: 0 1px 3px rgba(0,0,0,0.10);
	box-sizing: border-box;
}

.day-card:hover {
	box-shadow: 0 3px 10px rgba(0,0,0,0.18);
	z-index: 2;
}

.day-card.dragging {
	opacity: 0.35;
}

.day-card.resizing {
	opacity: 0.85;
	box-shadow: 0 4px 14px rgba(0,0,0,0.22);
	z-index: 3;
}

.day-card-resize {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 8px;
	cursor: ns-resize;
	border-radius: 0 0 5px 5px;
}

.day-card-resize::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 2px;
	transform: translateX(-50%);
	width: 24px;
	height: 3px;
	border-radius: 2px;
	background: rgba(0,0,0,0.18);
	opacity: 0;
	transition: opacity 0.15s;
}

.day-card:hover .day-card-resize::after {
	opacity: 1;
}

.day-card-time {
	font-weight: 700;
	font-size: 0.66rem;
	font-family: var(--font-mono);
	opacity: 0.85;
	white-space: nowrap;
}

.day-card-title {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.3;
}

.day-card-customer {
	opacity: 0.72;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 0.67rem;
}

/* Now-line (current time indicator) */
.day-now-line {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--alert);
	z-index: 4;
	pointer-events: none;
}

.day-now-line::before {
	content: '';
	position: absolute;
	left: -4px;
	top: -4px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--alert);
}

/* Ghost block — drag-to-create in day view */
.day-ghost-block {
	position: absolute;
	left: 3px;
	right: 3px;
	border-radius: 5px;
	background: rgba(31, 176, 78, 0.12);
	border: 2px dashed var(--toxin);
	z-index: 5;
	pointer-events: none;
	padding: 4px 7px;
	font-size: 0.72rem;
	font-weight: 600;
	font-family: var(--font-mono);
	color: var(--toxin-deep);
	box-sizing: border-box;
	user-select: none;
}

/* Clickable week-header cells */
.planner-day-header-clickable {
	cursor: pointer;
	transition: background 0.15s;
}

.planner-day-header-clickable:hover {
	background: var(--toxin-tint);
	color: var(--toxin-deep);
}

/* --- Route Planning --- */
.route-toolbar {
	background: var(--bg);
	border: 1px solid var(--gray-light);
	border-radius: 8px;
	padding: 10px 14px;
}

.route-layout {
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 16px;
	height: calc(100vh - 220px);
	min-height: 500px;
}

.route-list-panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.route-list {
	flex: 1;
	overflow-y: auto;
}

.route-stop {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--gray-light);
	cursor: grab;
	transition: background 0.15s;
	user-select: none;
}

.route-stop:last-child {
	border-bottom: none;
}

.route-stop:hover {
	background: var(--bg-alt);
}

.route-stop.dragging {
	opacity: 0.4;
	cursor: grabbing;
}

.route-stop.drag-over {
	border-top: 2px solid var(--primary);
}

.route-stop-number {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 1px;
}

.route-stop-number.no-coords {
	background: var(--gray-medium);
}

.route-stop-body {
	flex: 1;
	min-width: 0;
}

.route-stop-title {
	font-weight: 600;
	font-size: 0.875rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--black);
}

.route-stop-sub {
	font-size: 0.775rem;
	color: var(--gray-medium);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 1px;
}

.route-stop-time {
	font-size: 0.775rem;
	color: var(--primary-dark);
	font-weight: 600;
	white-space: nowrap;
	margin-top: 1px;
}

.route-stop-tech {
	font-size: 0.75rem;
	margin-top: 2px;
}

.route-stop-drag-handle {
	color: var(--gray-light);
	font-size: 1rem;
	margin-top: 4px;
	cursor: grab;
}

.route-stop-travel {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 3px 14px;
	background: var(--bg-alt);
	border-bottom: 1px solid var(--gray-light);
	font-size: 0.75rem;
	color: var(--gray-medium);
}

.route-map-panel {
	overflow: hidden;
}

.route-map {
	width: 100%;
	height: 100%;
}

.route-map-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--gray-medium);
}

.route-empty {
	flex: 1;
}

.tech-color-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	margin-right: 5px;
	flex-shrink: 0;
}

/* --- Fallenplan --- */
.fp-container {
	position: relative;
	display: inline-block;
	width: 100%;
	min-height: 300px;
	background: var(--bg-alt);
	overflow: hidden;
	cursor: crosshair;
}

.fp-image {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
	user-select: none;
}

.fp-marker {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	font-weight: 700;
	color: #fff;
	border: 2px solid rgba(255,255,255,0.9);
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	cursor: grab;
	z-index: 10;
	transition: transform 0.1s, box-shadow 0.1s;
	user-select: none;
}

.fp-marker:hover {
	transform: translate(-50%, -50%) scale(1.2);
	box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.fp-marker.dragging-marker {
	cursor: grabbing;
	z-index: 100;
	opacity: 0.85;
}

.fp-marker-result-ok          { background: #1FB04E; }
.fp-marker-result-activity     { background: #F4A92A; }
.fp-marker-result-infestation  { background: #DC3522; }
.fp-marker-result-defect       { background: #9E9E9E; }
.fp-marker-result-unknown      { background: #546E7A; }

.fp-dropzone {
	position: absolute;
	inset: 0;
	background: rgba(76,175,80,0.1);
	border: 3px dashed var(--primary);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--primary);
	font-size: 1rem;
	font-weight: 600;
	pointer-events: none;
	z-index: 20;
}

.fp-unplaced-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px;
}

.fp-unplaced-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--bg-alt);
	border: 1px solid var(--gray-light);
	border-radius: 20px;
	padding: 4px 12px;
	font-size: 0.8rem;
	cursor: grab;
	user-select: none;
	transition: background 0.15s;
}

.fp-unplaced-chip:hover {
	background: var(--primary-light);
	border-color: var(--primary);
}

.fp-marker-popup {
	position: fixed;
	z-index: 9999;
	background: var(--bg);
	border: 1px solid var(--gray-light);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
	padding: 12px 14px;
	min-width: 200px;
	max-width: 280px;
}

.fp-popup-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--gray-medium);
	font-size: 1rem;
	line-height: 1;
}

.fp-popup-title {
	font-weight: 700;
	font-size: 0.875rem;
	margin-bottom: 6px;
	padding-right: 20px;
}

.fp-popup-body {
	font-size: 0.8rem;
	color: var(--gray-dark);
}

.fp-legend {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	padding: 10px 14px;
	border-top: 1px solid var(--gray-light);
	font-size: 0.78rem;
}

.fp-legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.fp-legend-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* --- Zeiterfassung --- */
.zt-toolbar {
	background: var(--bg);
	border: 1px solid var(--gray-light);
	border-radius: 8px;
	padding: 10px 14px;
}

/* --- Utility --- */
.hidden { display: none !important; }
.text-blue { color: var(--blue) !important; }

/* --- Angebote items table column widths --- */
.items-table th:nth-child(1) { width: 40%; }
.items-table th:nth-child(2) { width: 10%; }
.items-table th:nth-child(3) { width: 10%; }
.items-table th:nth-child(4) { width: 10%; }
.items-table th:nth-child(5) { width: 12%; }
.items-table th:nth-child(6) { width: 12%; }
.items-table th:nth-child(7) { width: 6%; }

/* --- Items table: view mode --- */
.item-row:not(.item-row-edit) {
	cursor: pointer;
}

/* --- Items table: edit mode --- */
.item-row-edit {
	background: var(--bg-alt);
}

.item-row-edit td {
	padding: 6px 8px;
	vertical-align: middle;
}

.item-row-edit .form-control,
.item-row-edit .form-select {
	padding: 3px 8px;
	font-size: 0.8125rem;
	line-height: 1.4;
	min-height: 0;
}

.item-row-edit .item-quantity  { width: 68px; }
.item-row-edit .item-unit      { width: 72px; }
.item-row-edit .item-unitprice { width: 100px; }
.item-row-edit .item-type      { width: 118px; }

/* --- Items table: responsive two-line edit mode (≤1280px) --- */
@media (max-width: 1280px) {
	.items-table thead { display: none; }

	.items-table tbody tr.item-row-edit {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 6px;
		padding: 8px 4px;
		border-top: 1px solid var(--fog);
		border-bottom: none;
	}

	.items-table tbody tr.item-row-edit td {
		display: block;
		padding: 0;
		border: none;
	}

	/* Line 1: description (grows) */
	.items-table tbody tr.item-row-edit td:nth-child(1) {
		order: 1;
		flex: 1 1 0;
		min-width: 0;
	}

	/* Line 1: actions (fixed, after description) */
	.items-table tbody tr.item-row-edit td:nth-child(7) {
		order: 2;
		flex: 0 0 auto;
	}

	/* Line 2: Typ, Menge, Einheit, EP, Gesamt — wrap after line 1 fills */
	.items-table tbody tr.item-row-edit td:nth-child(2) { order: 3; flex: 0 0 auto; }
	.items-table tbody tr.item-row-edit td:nth-child(3) { order: 4; flex: 0 0 auto; }
	.items-table tbody tr.item-row-edit td:nth-child(4) { order: 5; flex: 0 0 auto; }
	.items-table tbody tr.item-row-edit td:nth-child(5) { order: 6; flex: 0 0 auto; }
	.items-table tbody tr.item-row-edit td:nth-child(6) {
		order: 7;
		flex: 1 1 auto;
		text-align: right;
		align-self: center;
		font-weight: 600;
		font-size: 0.875rem;
	}
}

/* --- Table utilities --- */
.col-cb { width: 36px; }

/* --- Filter width utilities (replace inline styles in filter bars) --- */
.filter-select-sm  { max-width: 160px; }
.filter-select-md  { max-width: 180px; }
.filter-input-xs   { width: 90px; }
.filter-input-sm   { width: 130px; }
.filter-input-md   { width: 160px; }
.filter-input-lg   { width: 220px; }
.filter-input-color { max-width: 60px; }

/* --- Sidebar extras --- */
.sidebar-logout {
	color: rgba(255, 255, 255, 0.3);
	transition: color 0.15s;
	line-height: 1;
}

.sidebar-logout:hover {
	color: rgba(255, 255, 255, 0.8);
}

.btn-dark-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.3);
	font-size: 0.9375rem;
	padding: 4px 5px;
	transition: color 0.15s;
	flex-shrink: 0;
	line-height: 1;
	border-radius: 4px;
}

.btn-dark-toggle:hover {
	color: rgba(255, 255, 255, 0.8);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
	--bg:            #161B22;
	--bg-alt:        #0D1117;
	--black:         #E6EDF3;
	--gray-dark:     #C9D1D9;
	--gray-medium:   #8B949E;
	--gray-light:    #30363D;
	--primary-light: rgba(31, 176, 78, 0.14);
	--blue:          #58A6FF;
	--blue-bg:       rgba(88, 166, 255, 0.1);
	--danger-light:  rgba(220, 53, 34, 0.14);
	--warning-light: rgba(244, 169, 42, 0.14);
	--success-light: rgba(31, 176, 78, 0.14);
	--sidebar-bg:    #0D1117;
}

[data-theme="dark"] body {
	background: var(--bg-alt);
	color: var(--gray-dark);
}

/* Bootstrap background utilities */
[data-theme="dark"] .bg-white  { background-color: var(--bg) !important; }
[data-theme="dark"] .bg-light  { background-color: var(--bg-alt) !important; }

/* Text utilities */
[data-theme="dark"] .text-muted   { color: var(--gray-medium) !important; }
[data-theme="dark"] .text-dark    { color: var(--gray-dark) !important; }
[data-theme="dark"] .form-text    { color: var(--gray-medium); }
[data-theme="dark"] .form-label   { color: var(--gray-dark); }

/* Borders */
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end   { border-color: var(--gray-light) !important; }

/* Cards */
[data-theme="dark"] .card {
	background: var(--bg);
	border-color: var(--gray-light);
	color: var(--gray-dark);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .card-header {
	background: rgba(255, 255, 255, 0.03);
	border-color: var(--gray-light);
	color: var(--gray-dark);
}

[data-theme="dark"] .card-body {
	background: var(--bg);
	color: var(--gray-dark);
}

/* Top header */
[data-theme="dark"] .top-header {
	background: var(--bg);
	border-color: var(--gray-light);
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .top-header h2 { color: var(--black); }

/* Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
	background-color: var(--bg-alt);
	border-color: var(--gray-light);
	color: var(--gray-dark);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
	background-color: var(--bg-alt);
	border-color: var(--primary);
	color: var(--gray-dark);
	box-shadow: 0 0 0 3px rgba(31, 176, 78, 0.15);
}

[data-theme="dark"] .form-control::placeholder { color: var(--gray-medium); }
[data-theme="dark"] .form-control:disabled      { background-color: var(--gray-light); color: var(--gray-medium); }
[data-theme="dark"] .form-check-input           { background-color: var(--bg-alt); border-color: var(--gray-light); }
[data-theme="dark"] .form-check-label           { color: var(--gray-dark); }
[data-theme="dark"] .form-label                 { color: var(--gray-dark); }

/* Tab content with border */
[data-theme="dark"] .tab-content.border,
[data-theme="dark"] .tab-content.border-top-0 {
	background: var(--bg);
	border-color: var(--gray-light) !important;
}

[data-theme="dark"] .nav-tabs {
	border-color: var(--gray-light);
}

[data-theme="dark"] .nav-tabs .nav-link {
	color: var(--gray-medium);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
	background: var(--bg);
	color: var(--primary);
	border-color: var(--gray-light) var(--gray-light) var(--bg);
}

[data-theme="dark"] .nav-tabs .nav-link:hover:not(.active) {
	color: var(--gray-dark);
	border-color: transparent;
}

[data-theme="dark"] .tab-pane { background: var(--bg); }

/* Modals */
[data-theme="dark"] .modal-content {
	background: var(--bg);
	border-color: var(--gray-light);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
	border-color: var(--gray-light);
	background: var(--bg-alt);
}

[data-theme="dark"] .modal-body { background: var(--bg); color: var(--gray-dark); }
[data-theme="dark"] .modal-title { color: var(--black); }

/* Tables */
[data-theme="dark"] .table {
	--bs-table-bg: transparent;
	--bs-table-striped-bg: var(--bg-alt);
	--bs-table-color: var(--gray-dark);
	color: var(--gray-dark);
	border-color: var(--gray-light);
}

[data-theme="dark"] .table th {
	border-color: var(--gray-light);
	color: var(--gray-medium);
	background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .table td  { border-color: rgba(255, 255, 255, 0.04); color: var(--gray-dark); }

[data-theme="dark"] .table-hover tbody tr:hover {
	--bs-table-hover-bg: rgba(31, 176, 78, 0.13);
	background-color: rgba(31, 176, 78, 0.13);
	color: var(--gray-dark);
}

[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light > td,
[data-theme="dark"] .table-light > th {
	--bs-table-bg: var(--bg-alt);
	background-color: var(--bg-alt) !important;
	color: var(--gray-dark);
}

/* Alerts */
[data-theme="dark"] .alert { border-radius: 8px; }

[data-theme="dark"] .alert-info {
	background-color: var(--blue-bg);
	border-color: var(--blue);
	color: var(--blue);
}

[data-theme="dark"] .alert-danger {
	background-color: var(--danger-light);
	border-color: var(--danger);
	color: #EF9A9A;
}

[data-theme="dark"] .alert-success {
	background-color: var(--success-light);
	border-color: var(--primary);
	color: var(--primary);
}

[data-theme="dark"] .alert-warning {
	background-color: var(--warning-light);
	border-color: var(--warning);
	color: var(--warning);
}

/* Badges */
[data-theme="dark"] .badge-secondary,
[data-theme="dark"] .badge-default {
	background: var(--gray-light);
	color: var(--gray-dark);
}

[data-theme="dark"] .badge.bg-secondary { background-color: var(--gray-light) !important; color: var(--gray-dark) !important; }
[data-theme="dark"] .badge.bg-light     { background-color: var(--gray-light) !important; color: var(--gray-dark) !important; }

/* Pagination */
[data-theme="dark"] .page-link {
	background-color: var(--bg);
	border-color: var(--gray-light);
	color: var(--primary);
}

[data-theme="dark"] .page-item.active .page-link {
	background-color: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

[data-theme="dark"] .page-item.disabled .page-link {
	background-color: var(--bg);
	border-color: var(--gray-light);
	color: var(--gray-medium);
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
	background: var(--bg);
	border-color: var(--gray-light);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .dropdown-item          { color: var(--gray-dark); }
[data-theme="dark"] .dropdown-item:hover    { background: var(--bg-alt); color: var(--black); }
[data-theme="dark"] .dropdown-divider       { border-color: var(--gray-light); }

/* Planner */
[data-theme="dark"] .planner-header-cell,
[data-theme="dark"] .planner-row-label {
	background: var(--bg-alt);
	color: var(--gray-dark);
}

[data-theme="dark"] .planner-day-cell { border-color: var(--gray-light); }
[data-theme="dark"] .planner-card { color: var(--gray-dark); }

[data-theme="dark"] .planner-header-cell.planner-today,
[data-theme="dark"] .planner-day-cell.planner-today {
	background: rgba(31, 176, 78, 0.1);
}

/* Route planning */
[data-theme="dark"] .route-toolbar    { background: var(--bg); border-color: var(--gray-light); }
[data-theme="dark"] .route-stop       { border-color: var(--gray-light); }
[data-theme="dark"] .route-stop:hover { background: var(--bg-alt); }
[data-theme="dark"] .route-stop-travel { background: var(--bg-alt); border-color: var(--gray-light); }
[data-theme="dark"] .route-list-panel { background: var(--bg); }

/* Floor plan */
[data-theme="dark"] .fp-container       { background: var(--bg-alt); }
[data-theme="dark"] .fp-marker-popup    { background: var(--bg); border-color: var(--gray-light); }
[data-theme="dark"] .fp-unplaced-chip  { background: var(--bg-alt); border-color: var(--gray-light); color: var(--gray-dark); }

/* Building tree */
[data-theme="dark"] .tree-node-header  { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .tree-node         { border-color: var(--gray-light); }

/* KPI cards */
[data-theme="dark"] .kpi-card {
	background: var(--bg);
	border-color: var(--gray-light);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .kpi-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Dashboard dark mode */
[data-theme="dark"] .alert-item { border-color: var(--gray-light); }
[data-theme="dark"] .alert-item-title { color: var(--black); }
[data-theme="dark"] .quick-link-card {
	background: var(--bg);
	border-color: var(--gray-light);
	color: var(--gray-dark);
}
[data-theme="dark"] .quick-link-card:hover {
	background: var(--primary-light);
	border-color: var(--primary);
}

/* Timeline */
[data-theme="dark"] .timeline-item   { border-color: var(--gray-light); }
[data-theme="dark"] .timeline-marker { background: var(--bg-alt); }

/* Zeiterfassung */
[data-theme="dark"] .zt-toolbar { background: var(--bg); border-color: var(--gray-light); }

/* Misc */
[data-theme="dark"] .section-title { color: var(--black); }
[data-theme="dark"] .empty-state   { color: var(--gray-medium); }
[data-theme="dark"] .menu-toggle   { color: var(--gray-medium); }
[data-theme="dark"] .menu-toggle:hover { background: var(--bg-alt); color: var(--gray-dark); }

/* Outline button hovers */
[data-theme="dark"] .btn-outline-secondary:hover,
[data-theme="dark"] .btn-outline-secondary:focus-visible {
	--bs-btn-hover-bg:         rgba(255, 255, 255, 0.08);
	--bs-btn-hover-border-color: var(--gray-medium);
	--bs-btn-hover-color:      var(--black);
	background-color: rgba(255, 255, 255, 0.08);
	border-color: var(--gray-medium);
	color: var(--black);
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-primary:focus-visible {
	--bs-btn-hover-bg:         rgba(31, 176, 78, 0.2);
	--bs-btn-hover-border-color: var(--primary);
	--bs-btn-hover-color:      var(--primary);
	background-color: rgba(31, 176, 78, 0.2);
	border-color: var(--primary);
	color: var(--primary);
}

[data-theme="dark"] .btn-outline-danger:hover,
[data-theme="dark"] .btn-outline-danger:focus-visible {
	--bs-btn-hover-bg:         rgba(220, 53, 34, 0.25);
	--bs-btn-hover-border-color: var(--danger);
	--bs-btn-hover-color:      #ff6b6b;
	background-color: rgba(220, 53, 34, 0.25);
	border-color: var(--danger);
	color: #ff6b6b;
}

[data-theme="dark"] .btn-outline-success:hover,
[data-theme="dark"] .btn-outline-success:focus-visible {
	--bs-btn-hover-bg:         rgba(31, 176, 78, 0.2);
	--bs-btn-hover-border-color: var(--primary);
	--bs-btn-hover-color:      var(--primary);
	background-color: rgba(31, 176, 78, 0.2);
	border-color: var(--primary);
	color: var(--primary);
}

[data-theme="dark"] .btn-outline-warning:hover,
[data-theme="dark"] .btn-outline-warning:focus-visible {
	--bs-btn-hover-bg:         rgba(244, 169, 42, 0.2);
	--bs-btn-hover-border-color: var(--warning);
	--bs-btn-hover-color:      var(--warning);
	background-color: rgba(244, 169, 42, 0.2);
	border-color: var(--warning);
	color: var(--warning);
}

/* Nav tabs hover */
[data-theme="dark"] .nav-tabs .nav-link:hover:not(.active) {
	background: rgba(255, 255, 255, 0.05);
	color: var(--black);
	border-color: var(--gray-light) var(--gray-light) transparent;
}

/* Floor plan chip hover */
[data-theme="dark"] .fp-unplaced-chip:hover {
	background: rgba(31, 176, 78, 0.15);
	border-color: var(--primary);
	color: var(--primary);
}

/* Planner card hover */
[data-theme="dark"] .planner-card:hover {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Day planner dark mode */
[data-theme="dark"] .day-time-col   { background: var(--carbon); border-color: var(--gray-light); }
[data-theme="dark"] .day-corner     { background: var(--steel);  border-color: var(--gray-light); }
[data-theme="dark"] .day-time-slot  { border-color: var(--gray-light); color: var(--slate); }
[data-theme="dark"] .day-tech-header { background: var(--steel); border-color: var(--gray-light); color: var(--fog); }
[data-theme="dark"] .day-tech-col   { border-color: var(--gray-light); }
[data-theme="dark"] .day-slot-hour  { border-color: var(--gray-light); }
[data-theme="dark"] .day-slot-half  { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .day-card       { color: var(--ink); }
[data-theme="dark"] .day-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.5); }
[data-theme="dark"] .day-col-body.drag-over { background: rgba(31,176,78,0.08); }
[data-theme="dark"] .day-ghost-block { background: rgba(31,176,78,0.18); color: var(--toxin); }

/* Material catalog picker list */
.catalog-picker-list {
	max-height: 320px;
	overflow-y: auto;
}

[data-theme="dark"] .catalog-picker-list .list-group-item {
	background-color: var(--bg);
	border-color: var(--gray-light);
	color: var(--gray-dark);
}

[data-theme="dark"] .catalog-picker-list .list-group-item-action:hover {
	background-color: var(--bg-alt);
	color: var(--black);
}

[data-theme="dark"] #modalMaterialPicker .border-bottom {
	border-color: var(--gray-light) !important;
}

/* Items table dark mode */
[data-theme="dark"] .item-row-edit  { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .item-row-edit .form-control,
[data-theme="dark"] .item-row-edit .form-select {
	background-color: var(--bg-alt);
	border-color: var(--gray-light);
	color: var(--gray-dark);
}


/* ============================================================
   Portal Layout
   ============================================================ */

.portal-logo {
	height: 36px;
	width: auto;
}

.portal-wrapper {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg-alt);
}

.portal-header {
	background: var(--bg);
	border-bottom: 1px solid var(--gray-light);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	position: sticky;
	top: 0;
	z-index: 100;
}

.portal-header-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 12px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.portal-header-title {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--black);
}

.portal-main {
	flex: 1;
}

/* ============================================================
   Typography — Headings use Display font (Space Grotesk)
   ============================================================ */

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem;  font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: 1.75rem;  font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h3 { font-size: 1.35rem;  font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h4 { font-size: 1.1rem;   font-weight: 600; letter-spacing: 0;        line-height: 1.25; }

/* Type-scale utility classes */
.type-lead    { font-size: 1.25rem;  font-family: var(--font-body);  font-weight: 400; line-height: 1.4; }
.type-body    { font-size: 1rem;     font-family: var(--font-body);  font-weight: 400; line-height: 1.55; }
.type-caption { font-size: 0.8125rem; font-family: var(--font-body); font-weight: 500; line-height: 1.45; }
.type-mono    { font-size: 0.6875rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }

/* ============================================================
   Brand Motifs
   ============================================================ */

.hazard-stripe {
	background: repeating-linear-gradient(45deg, var(--hazard) 0 24px, var(--ink) 24px 48px);
}
.hazard-stripe-sm {
	background: repeating-linear-gradient(45deg, var(--hazard) 0 14px, var(--ink) 14px 28px);
}

/* ─── end ─── */

.portal-main .container-fluid {
	max-width: 1100px;
	margin: 0 auto;
}
