/* ==========================================================================
   BBC YAPI MÜHENDİSLİK — ERP & Şantiye Yönetim Sistemi Design System
   ========================================================================== */

:root {
	/* BBC YAPI Design System Tokens */
	--font-sans: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-display: 'Archivo', var(--font-sans);
	--font-body: 'Barlow', var(--font-sans);
	--font-mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;

	/* Base Palette */
	/* Amber — Single Brand Accent (CTAs, eyebrows, active rules, numerals, icons) */
	--amber-100: #FFF3D6;
	--amber-200: #FFE1A3;
	--amber-300: #FFCE6B;
	--amber-400: #FBB43A;
	--amber-500: #F5A623;
	--amber-600: #DC8F12;
	--amber-700: #B0710B;

	/* Ink — Structural dark surfaces (sidebar, topbar, hero scrim, dark accents) */
	--ink-900: #0E0F10;
	--ink-800: #151719;
	--ink-700: #1D1F22;
	--ink-600: #2A2D31;
	--ink-500: #3A3E43;

	/* Neutrals — paper, section tints, hairlines, secondary copy */
	--neutral-0: #FFFFFF;
	--neutral-50: #FAFAF8;
	--neutral-100: #F4F4F1;
	--neutral-200: #EBEBE7;
	--neutral-300: #DEDEDA;
	--neutral-400: #B9B9B4;
	--neutral-500: #8A8A85;
	--neutral-600: #6B6B67;
	--neutral-700: #4A4A47;

	/* Semantic Status */
	--green-500: #3F8F4F;
	--red-500: #C2402F;
	--blue-500: #2C6CA6;

	/* Semantic Aliases (Light Mode Core) */
	--bg-body: var(--neutral-50);
	--bg-sidebar: var(--ink-900);
	--bg-sidebar-hover: var(--ink-800);
	--bg-card: var(--neutral-0);
	--bg-card-subtle: var(--neutral-100);
	--bg-card-hover: var(--neutral-50);
	--bg-input: var(--neutral-0);

	--text-main: var(--ink-900);
	--text-muted: var(--neutral-600);
	--text-subtle: var(--neutral-500);
	--text-inverse: var(--neutral-0);

	--border-color: var(--neutral-200);
	--border-light: var(--neutral-100);
	--border-focus: var(--amber-500);

	--primary: var(--amber-500);
	--primary-hover: var(--amber-600);
	--primary-light: var(--amber-100);
	--primary-dark: var(--amber-700);

	--accent-gold: var(--amber-500);
	--accent-gold-light: var(--amber-100);

	--success: var(--green-500);
	--success-light: #E8F5E9;
	--warning: var(--amber-500);
	--warning-light: var(--amber-100);
	--danger: var(--red-500);
	--danger-light: #FDE8E4;
	--info: var(--blue-500);
	--info-light: #E3F2FD;

	/* Radii — Structural near-square corners (2px - 4px) */
	--radius-sm: 2px;
	--radius-md: 4px;
	--radius-lg: 4px;
	--radius-xl: 6px;
	--radius-full: 9999px;

	/* Hairline & Elevation */
	--shadow-sm: 0 1px 2px rgba(14, 15, 16, 0.04);
	--shadow-md: 0 4px 12px rgba(14, 15, 16, 0.06);
	--shadow-lg: 0 10px 28px rgba(14, 15, 16, 0.10);
	--shadow-glow: 0 0 0 3px rgba(245, 166, 35, 0.45);

	--header-height: 68px;
	--sidebar-width: 260px;
	--transition-speed: 0.2s;
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body, html {
	width: 100%;
	height: 100%;
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text-main);
	background-color: var(--bg-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow: hidden;
}

a {
	color: var(--primary);
	text-decoration: none;
	transition: color var(--transition-speed) ease;
}
a:hover {
	color: var(--primary-hover);
}

button, input, select, textarea {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	outline: none;
}

ul, ol {
	list-style: none;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
	background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
	background: var(--border-color);
	border-radius: var(--radius-full);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
	background: var(--text-subtle);
}

/* Utility Helpers */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-highlight { color: var(--accent-gold); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

/* ==========================================================================
   LOGIN PAGE STYLES
   ========================================================================== */
.bbc-login-body {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	background: var(--ink-900);
	overflow-y: auto;
	padding: 24px;
	position: relative;
}

.login-bg-effects {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}
.login-bg-effects .glow {
	position: absolute;
	border-radius: 50%;
	filter: blur(140px);
	opacity: 0.18;
}
.login-bg-effects .glow-1 {
	width: 500px;
	height: 500px;
	top: -100px;
	left: -100px;
	background: var(--amber-500);
}
.login-bg-effects .glow-2 {
	width: 400px;
	height: 400px;
	bottom: -50px;
	right: -50px;
	background: var(--amber-600);
}
.grid-overlay {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
	                  linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 40px 40px;
}

.login-container {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	max-width: 1080px;
	width: 100%;
	background: var(--ink-800);
	border: 1px solid var(--ink-600);
	border-radius: var(--radius-xl);
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
	overflow: hidden;
}

.login-hero-card {
	padding: 48px 40px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background: linear-gradient(135deg, rgba(245, 166, 35, 0.08) 0%, rgba(14, 15, 16, 0.95) 100%);
	border-right: 1px solid var(--ink-700);
}

.brand-badge {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.04);
	padding: 8px 16px;
	border-radius: var(--radius-full);
	border: 1px solid rgba(255, 255, 255, 0.1);
	width: fit-content;
}
.brand-logo-icon {
	color: var(--amber-500);
	display: flex;
}
.brand-name-text {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #ffffff;
}

.hero-headline {
	margin: 32px 0;
}
.hero-headline h2 {
	font-family: var(--font-display);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	color: #ffffff;
	margin-bottom: 16px;
}
.hero-headline p {
	color: var(--neutral-400);
	font-size: 14px;
	line-height: 1.6;
}

.hero-features-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.feature-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}
.feature-item .f-icon {
	width: 36px;
	height: 36px;
	border-radius: var(--radius-md);
	background: rgba(245, 166, 35, 0.15);
	color: var(--amber-500);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.feature-item .f-text {
	display: flex;
	flex-direction: column;
}
.feature-item .f-text strong {
	color: #ffffff;
	font-size: 13px;
	margin-bottom: 2px;
}
.feature-item .f-text span {
	color: var(--neutral-400);
	font-size: 12px;
}

.hero-footer {
	margin-top: 32px;
	font-size: 12px;
	color: var(--neutral-500);
}

.login-form-card {
	padding: 48px 40px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: var(--ink-800);
}
.login-card-header {
	margin-bottom: 24px;
}
.login-card-header h3 {
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 700;
	color: #ffffff;
	margin-bottom: 6px;
}
.login-card-header p {
	color: var(--neutral-400);
	font-size: 13px;
}

/* Demo Role Quick Switcher Pills */
.demo-role-quickbar {
	background: rgba(255, 255, 255, 0.03);
	border: 1px dashed rgba(245, 166, 35, 0.3);
	padding: 12px;
	border-radius: var(--radius-md);
	margin-bottom: 20px;
}
.quickbar-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	color: var(--amber-500);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.role-pills-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.role-pill {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: var(--neutral-300);
	padding: 4px 10px;
	border-radius: var(--radius-full);
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}
.role-pill:hover, .role-pill.active {
	background: var(--amber-500);
	border-color: var(--amber-500);
	color: var(--ink-900);
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}
.role-pill.customer-pill {
	background: rgba(245, 166, 35, 0.15);
	border-color: rgba(245, 166, 35, 0.3);
	color: var(--amber-500);
}
.role-pill.customer-pill:hover, .role-pill.customer-pill.active {
	background: var(--amber-500);
	color: var(--ink-900);
}

/* Form controls */
.form-group {
	margin-bottom: 18px;
}
.form-group label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--neutral-300);
	margin-bottom: 6px;
}
.label-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.forgot-link {
	font-size: 12px;
	color: var(--amber-500);
}

.input-icon-wrap {
	position: relative;
	display: flex;
	align-items: center;
}
.input-icon-wrap .input-icon {
	position: absolute;
	left: 14px;
	color: var(--neutral-500);
	width: 18px;
	height: 18px;
	pointer-events: none;
}
.form-control {
	width: 100%;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 10px 14px;
	color: var(--text-main);
	font-family: var(--font-body);
	font-size: 13px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-icon-wrap .form-control {
	padding-left: 42px;
}
.form-control:focus {
	border-color: var(--border-focus);
	box-shadow: var(--shadow-focus);
	outline: none;
}
.bbc-login-body .form-control {
	background: var(--ink-900);
	border: 1px solid var(--ink-600);
	color: #ffffff;
}
.bbc-login-body .form-control:focus {
	border-color: var(--amber-500);
	box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.35);
}
.toggle-password-btn {
	position: absolute;
	right: 12px;
	background: none;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 4px;
}
.toggle-password-btn:hover {
	color: #cbd5e1;
}

.form-options-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 22px;
}
.custom-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 13px;
	color: #94a3b8;
}
.custom-checkbox input {
	cursor: pointer;
	accent-color: var(--primary);
	width: 16px;
	height: 16px;
}

.quick-login-direct {
	background: rgba(16, 185, 129, 0.15);
	border: 1px solid rgba(16, 185, 129, 0.3);
	color: #34d399;
	padding: 5px 12px;
	border-radius: var(--radius-full);
	font-size: 11px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	cursor: pointer;
}
.quick-login-direct:hover {
	background: #10b981;
	color: #fff;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.15s ease;
	text-decoration: none;
}
.btn-primary {
	background: var(--primary);
	color: var(--ink-900);
}
.btn-primary:hover {
	background: var(--primary-hover);
	color: var(--ink-900);
	box-shadow: 0 4px 14px rgba(245, 166, 35, 0.35);
}
.btn-secondary {
	background: var(--ink-900);
	border-color: var(--ink-900);
	color: #ffffff;
}
.btn-secondary:hover {
	background: var(--ink-800);
	color: #ffffff;
}
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 12px; }

/* --------------------------------------------------------------------------
   BUTON DÜZELTMELERİ
   - Dokunmatik cihazda "yapışkan :hover" yüzünden butonların kararması giderildi.
   - Tanımsız `.btn-danger` (JS'te kullanılıyordu) eklendi.
   - Varsayılan padding/boyut: variant'sız `.btn` de görünür olsun.
   - Satır işlem butonları (`.btn-icon`) siyah kare yerine açık gri.
   -------------------------------------------------------------------------- */
.btn {
	line-height: 1.2;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}
/* variant boyut sınıfı yoksa taban padding (mevcut .btn-sm/.btn-lg ezilmez). */
.btn:not(.btn-sm):not(.btn-lg) {
	padding: 10px 16px;
	font-size: 13px;
}
.btn:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-danger {
	background: #ef4444;
	border-color: #ef4444;
	color: #ffffff;
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #ffffff; }

/* Satır sonu ikon butonları — rowActions() bu sınıfı üretir. */
.btn-icon {
	background: var(--neutral-100);
	border-color: var(--neutral-300);
	color: var(--ink-900);
	padding: 8px;
}
.btn-icon:hover { background: var(--neutral-200); color: var(--ink-900); }

/* Dokunmatik: :hover durumlarını taban duruma sabitle (kararmayı önler). */
@media (hover: none) {
	.btn-primary:hover {
		background: var(--primary);
		color: var(--ink-900);
		box-shadow: none;
	}
	.btn-secondary:hover { background: var(--ink-900); color: #ffffff; }
	.btn-icon:hover { background: var(--neutral-100); }
	.btn-danger:hover { background: #ef4444; border-color: #ef4444; }
	.modal-footer .btn-secondary:hover { background: var(--neutral-100); color: var(--ink-900); }
}

.login-card-footer {
	margin-top: 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: #64748b;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	padding-top: 16px;
}
.security-stamp {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #10b981;
}
.back-to-site {
	display: flex;
	align-items: center;
	gap: 5px;
	color: #94a3b8;
}

/* Alert Boxes */
.alert-box {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: var(--radius-md);
	font-size: 13px;
	margin-bottom: 18px;
}
.alert-danger {
	background: var(--danger-light);
	color: #fca5a5;
	border: 1px solid rgba(239, 68, 68, 0.3);
}
.alert-success {
	background: var(--success-light);
	color: #86efac;
	border: 1px solid rgba(16, 185, 129, 0.3);
}
.alert-info {
	background: var(--info-light);
	color: #93c5fd;
	border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ==========================================================================
   APP SHELL LAYOUT (SaaS Experience)
   ========================================================================== */
.app-layout {
	display: flex;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
}

/* Left Sidebar */
.app-sidebar {
	width: var(--sidebar-width);
	height: 100%;
	background: var(--bg-sidebar);
	border-right: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	z-index: 100;
	transition: transform var(--transition-speed) ease;
}

.sidebar-header {
	height: var(--header-height);
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--border-color);
}
.sidebar-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}
.brand-icon {
	width: 38px;
	height: 38px;
	border-radius: var(--radius-md);
	background: var(--amber-500);
	color: var(--ink-900);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(245, 166, 35, 0.25);
}
.brand-title {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 16px;
	letter-spacing: -0.2px;
	color: #ffffff;
	display: block;
	line-height: 1.1;
}
.brand-subtitle {
	font-family: var(--font-body);
	font-size: 10px;
	font-weight: 700;
	color: var(--amber-500);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	display: block;
}

.sidebar-project-select {
	padding: 12px 16px;
	border-bottom: 1px solid var(--ink-700);
}
.select-label {
	display: block;
	font-family: var(--font-body);
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--neutral-400);
	margin-bottom: 4px;
	letter-spacing: 0.12em;
}
.project-pill-dropdown {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--ink-800);
	border: 1px solid var(--ink-700);
	border-radius: var(--radius-md);
	padding: 6px 10px;
}
.project-pill-dropdown .p-icon {
	width: 16px;
	height: 16px;
	color: var(--amber-500);
	flex-shrink: 0;
}
.project-pill-dropdown select {
	background: transparent;
	border: none;
	width: 100%;
	font-size: 12px;
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
}

/* Sidebar Navigation Items */
.sidebar-nav {
	flex: 1;
	overflow-y: auto;
	padding: 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.nav-group {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.group-title {
	font-family: var(--font-body);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--neutral-400);
	padding: 6px 12px;
}
.nav-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: var(--radius-md);
	color: var(--neutral-400);
	font-size: 13px;
	font-weight: 500;
	transition: all 0.15s ease;
}
.nav-link i {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}
.nav-link:hover {
	background: var(--ink-800);
	color: #ffffff;
}
.nav-link.active {
	background: rgba(245, 166, 35, 0.14);
	border-left: 3px solid var(--amber-500);
	color: #ffffff;
	font-weight: 700;
	box-shadow: none;
}
.nav-link.active i {
	color: var(--amber-500);
}
.nav-link.highlight-portal {
	background: rgba(245, 166, 35, 0.1);
	border: 1px solid rgba(245, 166, 35, 0.25);
	color: var(--amber-500);
}
.nav-link.highlight-portal.active {
	background: var(--amber-500);
	color: var(--ink-900);
	font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
	padding: 14px 16px;
	border-top: 1px solid var(--border-color);
	background: var(--bg-sidebar);
}
.sidebar-user-pill {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: var(--radius-md);
	background: var(--bg-card-subtle);
	cursor: pointer;
	transition: background 0.15s ease;
}
.sidebar-user-pill:hover {
	background: var(--bg-card-hover);
}
.user-avatar {
	width: 36px;
	height: 36px;
	border-radius: var(--radius-full);
	object-fit: cover;
	border: 2px solid var(--primary);
}
.user-info {
	flex: 1;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.user-name {
	font-size: 12px;
	font-weight: 700;
	color: var(--text-main);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.user-role-badge {
	font-size: 10px;
	color: var(--primary);
	font-weight: 600;
}
.user-arrow {
	width: 14px;
	height: 14px;
	color: var(--text-subtle);
}

.sidebar-dev-credit {
	margin-top: 10px;
	text-align: center;
}
.sidebar-dev-credit a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.15s ease;
}
.sidebar-dev-credit a:hover {
	color: var(--accent-gold);
}

.dev-badge-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
	padding: 3px 8px;
	background: var(--primary-light);
	border-radius: var(--radius-full);
	border: 1px solid rgba(2, 132, 199, 0.2);
	transition: all 0.15s ease;
}
.dev-badge-link:hover {
	background: var(--primary);
	color: #ffffff;
}

/* Main Workspace */
.app-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	position: relative;
	background: var(--bg-body);
}

/* Top App Header */
.app-header {
	height: var(--header-height);
	padding: 0 28px;
	background: var(--bg-card);
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-shrink: 0;
	z-index: 50;
}
.header-left {
	display: flex;
	align-items: center;
	gap: 16px;
}
.sidebar-toggle-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-main);
	padding: 6px;
	display: flex;
}
.page-main-title {
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 700;
	color: var(--text-main);
	line-height: 1.1;
}
.page-sub-title {
	font-size: 12px;
	color: var(--text-muted);
}

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

/* Search bar button */
.header-search-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--bg-card-subtle);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-full);
	padding: 8px 16px;
	cursor: pointer;
	width: 260px;
	color: var(--text-muted);
	font-size: 13px;
	transition: all 0.15s ease;
}
.header-search-bar:hover {
	border-color: var(--border-focus);
	color: var(--text-main);
}
.search-icon { width: 16px; height: 16px; flex-shrink: 0; }
.search-placeholder { flex: 1; }
.search-kbd {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 4px;
	padding: 1px 6px;
	font-size: 11px;
	font-family: monospace;
	color: var(--text-subtle);
}

.icon-btn {
	width: 38px;
	height: 38px;
	border-radius: var(--radius-md);
	background: var(--bg-card-subtle);
	border: 1px solid var(--border-color);
	color: var(--text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	position: relative;
	transition: all 0.15s ease;
}
.icon-btn:hover {
	color: var(--text-main);
	background: var(--bg-card-hover);
}
.notification-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: var(--danger);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: var(--radius-full);
	border: 2px solid var(--bg-card);
}

.user-avatar-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}
.user-avatar-btn img {
	width: 38px;
	height: 38px;
	border-radius: var(--radius-full);
	border: 2px solid var(--border-color);
}

/* Dropdown Panels */
.header-dropdown {
	position: relative;
}
.dropdown-panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	z-index: 200;
	overflow: hidden;
}
.panel-header {
	padding: 14px 18px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.panel-header h6 {
	font-size: 13px;
	font-weight: 700;
	color: var(--text-main);
}
.mark-all-read {
	background: none;
	border: none;
	font-size: 11px;
	color: var(--primary);
	cursor: pointer;
	font-weight: 600;
}

.notification-panel {
	width: 340px;
}
.notification-list {
	max-height: 360px;
	overflow-y: auto;
}
.notification-item {
	padding: 12px 16px;
	border-bottom: 1px solid var(--border-color);
	cursor: pointer;
	transition: background 0.15s ease;
	display: flex;
	gap: 12px;
}
.notification-item:hover {
	background: var(--bg-card-hover);
}
.notification-item.unread {
	background: var(--primary-light);
}
.notif-title { font-weight: 700; font-size: 13px; color: var(--text-main); }
.notif-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }
.notif-time { font-size: 10px; color: var(--text-subtle); margin-top: 4px; }

/* Demo switcher panel */
.demo-switch-panel {
	width: 240px;
	padding: 8px;
}
.demo-role-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.demo-role-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: var(--radius-md);
	background: none;
	border: none;
	text-align: left;
	font-size: 12px;
	font-weight: 600;
	color: var(--text-main);
	cursor: pointer;
	width: 100%;
	transition: background 0.15s ease;
}
.demo-role-item:hover {
	background: var(--primary-light);
	color: var(--primary);
}
.demo-role-item.customer-item {
	color: var(--accent-gold);
}

/* User dropdown panel */
.user-panel {
	width: 240px;
}
.user-menu-header {
	padding: 16px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
}
.user-email { font-size: 11px; color: var(--text-muted); }
.user-badge {
	display: inline-block;
	background: var(--primary-light);
	color: var(--primary);
	font-size: 10px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: var(--radius-full);
	width: fit-content;
}
.user-menu-items {
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: var(--radius-md);
	color: var(--text-main);
	font-size: 13px;
	transition: background 0.15s ease;
}
.menu-item:hover {
	background: var(--bg-card-subtle);
}
.menu-item.logout-item {
	color: var(--danger);
}
.dropdown-divider {
	border: none;
	border-top: 1px solid var(--border-color);
	margin: 4px 0;
}

/* ==========================================================================
   APP MAIN VIEWPORT & COMPONENTS
   ========================================================================== */
.app-viewport {
	flex: 1;
	overflow-y: auto;
	padding: 28px;
}

/* KPI Cards Grid */
.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	margin-bottom: 28px;
}
.kpi-card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-shadow: var(--shadow-sm);
	transition: transform 0.15s ease, border-color 0.15s ease;
	position: relative;
	overflow: hidden;
}
.kpi-card:hover {
	transform: translateY(-2px);
	border-color: var(--primary);
}
.kpi-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}
.kpi-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--text-muted);
	letter-spacing: 0.4px;
}
.kpi-icon-wrap {
	width: 36px;
	height: 36px;
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
}
.kpi-value {
	font-family: var(--font-display);
	font-size: 26px;
	font-weight: 800;
	color: var(--text-main);
	line-height: 1.1;
	margin-bottom: 6px;
}
.kpi-footer {
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--text-subtle);
}

/* Content Panels / Cards */
.content-card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: 24px;
	box-shadow: var(--shadow-sm);
	margin-bottom: 28px;
}
.card-header-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 12px;
}
.card-heading {
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 700;
	color: var(--text-main);
}
.card-subheading {
	font-size: 12px;
	color: var(--text-muted);
}

/* Data Tables */
.table-responsive {
	width: 100%;
	overflow-x: auto;
}
.bbc-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 13px;
}
.bbc-table th {
	background: var(--bg-card-subtle);
	padding: 12px 16px;
	font-weight: 700;
	color: var(--text-muted);
	border-bottom: 1px solid var(--border-color);
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.5px;
}
.bbc-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--border-color);
	color: var(--text-main);
	vertical-align: middle;
}
.bbc-table tr:hover td {
	background: var(--bg-card-hover);
}

/* Status Badges */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: var(--radius-full);
	font-size: 11px;
	font-weight: 700;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-neutral { background: var(--bg-card-subtle); color: var(--text-muted); }

/* Progress Bars */
.progress-bar-wrap {
	width: 100%;
	height: 8px;
	background: var(--bg-card-subtle);
	border-radius: var(--radius-full);
	overflow: hidden;
	position: relative;
}
.progress-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
	border-radius: var(--radius-full);
	transition: width 0.4s ease;
}
.progress-bar-fill.success {
	background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

/* Puantaj Interactive Matrix Table */
.puantaj-table-container {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
}
.puantaj-table {
	width: 100%;
	border-collapse: collapse;
	text-align: center;
	font-size: 12px;
}
.puantaj-table th, .puantaj-table td {
	border: 1px solid var(--border-color);
	padding: 6px 4px;
}
.puantaj-table th {
	background: var(--bg-card-subtle);
	font-weight: 700;
}
.puantaj-table .emp-name-cell {
	text-align: left;
	padding-left: 12px;
	font-weight: 600;
	min-width: 180px;
}
.p-cell-status {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	font-weight: 800;
	cursor: pointer;
	user-select: none;
	transition: transform 0.1s ease;
}
.p-cell-status:hover {
	transform: scale(1.15);
}
.p-cell-G { background: var(--success-light); color: var(--success); }
.p-cell-X { background: var(--danger-light); color: var(--danger); }
.p-cell-I { background: var(--warning-light); color: var(--warning); }
.p-cell-R { background: var(--info-light); color: var(--info); }
.p-cell-H { background: var(--bg-card-subtle); color: var(--text-subtle); }

/* Gantt Chart Container */
.gantt-container {
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	overflow-x: auto;
	background: var(--bg-card);
}
.gantt-header {
	display: grid;
	grid-template-columns: 240px 1fr;
	border-bottom: 2px solid var(--border-color);
	background: var(--bg-card-subtle);
	padding: 10px 16px;
	font-weight: 700;
	font-size: 12px;
}
.gantt-row {
	display: grid;
	grid-template-columns: 240px 1fr;
	border-bottom: 1px solid var(--border-color);
	padding: 10px 16px;
	align-items: center;
}
.gantt-bar-track {
	height: 24px;
	background: var(--bg-card-subtle);
	border-radius: var(--radius-sm);
	position: relative;
	overflow: hidden;
}
.gantt-bar-fill {
	position: absolute;
	height: 100%;
	border-radius: var(--radius-sm);
	background: var(--primary);
	display: flex;
	align-items: center;
	padding-left: 8px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
}

/* VIP Customer Portal Styling */
.portal-hero-card {
	background: linear-gradient(135deg, rgba(2, 132, 199, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-xl);
	padding: 36px;
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 32px;
	margin-bottom: 28px;
	align-items: center;
}
.portal-gauge-wrap {
	display: flex;
	align-items: center;
	gap: 24px;
}
.portal-gauge-circle {
	width: 120px;
	height: 120px;
	border-radius: var(--radius-full);
	border: 8px solid var(--primary);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-size: 32px;
	font-weight: 800;
	color: var(--text-main);
	flex-shrink: 0;
}
.portal-gauge-circle span {
	font-size: 11px;
	color: var(--text-muted);
	font-weight: 600;
}

/* Timeline Milestones */
.milestones-track {
	display: flex;
	justify-content: space-between;
	position: relative;
	margin: 30px 0;
}
.milestones-track::before {
	content: '';
	position: absolute;
	top: 18px;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--border-color);
	z-index: 0;
}
.milestone-step {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 1;
}
.milestone-dot {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-full);
	background: var(--bg-card);
	border: 3px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-subtle);
	margin-bottom: 8px;
	transition: all 0.2s ease;
}
.milestone-step.completed .milestone-dot {
	background: var(--success);
	border-color: var(--success);
	color: #fff;
}
.milestone-step.active .milestone-dot {
	background: var(--primary);
	border-color: #38bdf8;
	color: #fff;
	box-shadow: var(--shadow-glow);
}
.milestone-title { font-size: 12px; font-weight: 700; color: var(--text-main); }
.milestone-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Photo Gallery Grid */
.photo-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}
.photo-card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.15s ease;
}
.photo-card:hover {
	transform: translateY(-4px);
}
.photo-card-img {
	height: 180px;
	width: 100%;
	object-fit: cover;
}
.photo-card-body {
	padding: 14px 16px;
}
.photo-card-title {
	font-weight: 700;
	font-size: 13px;
	color: var(--text-main);
	margin-bottom: 4px;
}
.photo-card-meta {
	font-size: 11px;
	color: var(--text-muted);
	display: flex;
	justify-content: space-between;
}

/* Modals & Drawers */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.modal-dialog {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	width: 100%;
	max-width: 640px;
	box-shadow: var(--shadow-lg);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: 90vh;
}
.modal-dialog.modal-lg { max-width: 900px; }
.modal-dialog.modal-md { max-width: 640px; }
.modal-header {
	padding: 18px 24px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--bg-card);
}
.modal-header h4, .modal-header h5 {
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 700;
	color: var(--text-main);
}
.modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--text-muted);
	cursor: pointer;
	line-height: 1;
}
.modal-close:hover { color: var(--text-main); }
.modal-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
	background: var(--bg-card);
	color: var(--text-main);
}
.modal-body label {
	display: block;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	color: var(--text-main);
	margin-bottom: 6px;
}
.modal-footer {
	padding: 16px 24px;
	border-top: 1px solid var(--border-color);
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	background: var(--bg-card-subtle);
}
.modal-footer .btn-secondary {
	background: var(--neutral-100);
	border: 1px solid var(--neutral-300);
	color: var(--ink-900);
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.modal-footer .btn-secondary:hover {
	background: var(--neutral-200);
	color: var(--ink-900);
}
.modal-footer .btn-primary {
	background: var(--amber-500);
	border: 1px solid var(--amber-500);
	color: var(--ink-900);
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.modal-footer .btn-primary:hover {
	background: var(--amber-600);
	border-color: var(--amber-600);
	color: var(--ink-900);
}

/* Quick Actions Grid in Modal */
.quick-actions-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}
.quick-action-card {
	background: var(--bg-card-subtle);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: 18px;
	text-align: left;
	cursor: pointer;
	transition: all 0.15s ease;
	display: flex;
	flex-direction: column;
}
.quick-action-card:hover {
	border-color: var(--primary);
	background: var(--bg-card-hover);
	transform: translateY(-2px);
}
.q-icon {
	width: 42px;
	height: 42px;
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}
.quick-action-card strong {
	font-size: 14px;
	color: var(--text-main);
	margin-bottom: 4px;
}
.quick-action-card span {
	font-size: 12px;
	color: var(--text-muted);
	line-height: 1.4;
}

/* Lightbox */
.lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 2000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px;
}
.lightbox-overlay img {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: var(--radius-md);
	box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}
.lightbox-close {
	position: absolute;
	top: 20px;
	right: 30px;
	background: none;
	border: none;
	font-size: 36px;
	color: #fff;
	cursor: pointer;
}
.lightbox-caption {
	margin-top: 16px;
	color: #e2e8f0;
	font-size: 15px;
	font-weight: 600;
}

/* Search Modal Overlay (Ctrl+K) */
.search-modal-overlay {
	align-items: flex-start;
	padding-top: 100px;
}
.search-modal-box {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-xl);
	width: 100%;
	max-width: 600px;
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}
.search-modal-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	gap: 12px;
}
.search-modal-header input {
	flex: 1;
	background: none;
	border: none;
	font-size: 16px;
	color: var(--text-main);
}
.search-modal-results {
	max-height: 380px;
	overflow-y: auto;
	padding: 12px;
}
.search-result-item {
	padding: 12px 14px;
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
}
.search-result-item:hover {
	background: var(--bg-card-subtle);
}
.search-empty-hint {
	padding: 30px;
	text-align: center;
	color: var(--text-muted);
	font-size: 13px;
}

/* Toast Notifications */
.toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 3000;
	pointer-events: none;
}
.toast {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 14px 18px;
	box-shadow: var(--shadow-lg);
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 280px;
	color: var(--text-main);
	pointer-events: auto;
	animation: toastSlideIn 0.25s ease;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-danger { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
@keyframes toastSlideIn {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

/* Fullscreen Loader State */
.loading-full-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 60vh;
	gap: 16px;
	color: var(--text-muted);
}
.app-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--border-color);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}
@keyframes spin {
	to { transform: rotate(360deg); }
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
	height: 60px;
	background: var(--bg-card);
	border-top: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: space-around;
	flex-shrink: 0;
	z-index: 60;
}
.b-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	color: var(--text-muted);
	font-size: 10px;
	font-weight: 600;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
}
.b-nav-item i { width: 20px; height: 20px; }
.b-nav-item.active { color: var(--primary); }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile-First Polish)
   ========================================================================== */
@media (max-width: 1024px) {
	.app-sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		transform: translateX(-100%);
		box-shadow: var(--shadow-lg);
	}
	.app-sidebar.show {
		transform: translateX(0);
	}
	.portal-hero-card {
		grid-template-columns: 1fr;
	}
	.login-container {
		grid-template-columns: 1fr;
	}
	.login-hero-card {
		display: none;
	}
}

@media (max-width: 768px) {
	.app-header {
		padding: 0 16px;
	}
	.app-viewport {
		padding: 16px;
	}
	.header-search-bar {
		display: none;
	}
	.quick-actions-grid {
		grid-template-columns: 1fr;
	}
	.milestones-track {
		flex-direction: column;
		gap: 16px;
	}
	.milestones-track::before {
		display: none;
	}
	.milestone-step {
		flex-direction: row;
		text-align: left;
		gap: 14px;
	}
	.milestone-dot {
		margin-bottom: 0;
	}

	/* Sidebar — mobile hidden by default, toggled via JS */
	.app-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		height: 100%;
		z-index: 999;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
	}
	.app-sidebar.sidebar-open {
		transform: translateX(0);
	}
	.sidebar-overlay {
		display: block;
	}

	/* Main content fills full width on mobile */
	.app-main {
		width: 100%;
		margin-left: 0;
	}
	.app-header {
		left: 0;
	}

	/* KPI grid: 2 columns on tablet */
	.kpi-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	/* Dashboard 2-col grid becomes 1-col */
	.app-viewport > div[style*="grid-template-columns: 1.4fr 1fr"] {
		display: block !important;
	}

	/* Mobile bottom nav visible */
	.mobile-bottom-nav {
		display: flex !important;
	}
	.app-viewport {
		padding-bottom: 72px;
	}

	/* Modal full width */
	.modal-dialog {
		max-width: 100% !important;
		margin: 0 !important;
		height: 100dvh;
		border-radius: 0;
	}
	.modal-overlay {
		align-items: flex-end;
	}
	.modal-dialog.modal-sm,
	.modal-dialog.modal-md,
	.modal-dialog.modal-lg {
		max-width: 100% !important;
	}

	/* Header actions simplified */
	.header-left-group .global-project-selector-wrap label {
		display: none;
	}
	.header-actions > .btn > span {
		display: none;
	}

	/* Table improvements */
	.bbc-table th,
	.bbc-table td {
		font-size: 11px;
		padding: 8px 8px;
	}

	/* Card padding reduction */
	.content-card {
		padding: 16px;
	}
	.card-header-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}

@media (max-width: 480px) {
	/* KPI grid: 1 column on small phones */
	.kpi-grid {
		grid-template-columns: 1fr;
	}

	.kpi-card {
		padding: 16px;
	}
	.kpi-value {
		font-size: 22px;
	}

	/* Puantaj matrix horizontal scroll */
	.table-responsive {
		-webkit-overflow-scrolling: touch;
	}

	/* Attendance cell compact */
	.puantaj-cell {
		width: 28px;
		height: 28px;
		font-size: 9px;
	}

	/* Gantt reduced */
	.gantt-bar-label {
		font-size: 9px;
	}
}


/* ----------------------------------------------------
   DOSYA YÜKLEME ALANI (Faz 4)
   ---------------------------------------------------- */
.bbc-upload-zone {
	border: 2px dashed var(--border-color);
	border-radius: var(--radius-md);
	padding: 22px 16px;
	text-align: center;
	cursor: pointer;
	color: var(--text-muted);
	background: var(--bg-card-subtle);
	transition: border-color .15s ease, background .15s ease;
}

.bbc-upload-zone:hover,
.bbc-upload-zone.is-over {
	border-color: var(--primary);
	background: rgba(2, 132, 199, 0.06);
	color: var(--text-main);
}

.bbc-upload-zone > div {
	font-size: 13px;
	font-weight: 600;
	margin-top: 8px;
}

.bbc-upload-zone small {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: var(--text-subtle);
}

/* ==========================================================================
   EKSİK BİLEŞEN VE YARDIMCI SINIFLAR
   --------------------------------------------------------------------------
   Şablonda kullanılan 14 sınıfın hiç CSS karşılığı yoktu. Sonuçları:
     - .sidebar-close-btn biçimlendirilmemiş bir <button> olarak, yani
       beyaz bir kutu olarak görünüyordu.
     - .d-lg-none hiçbir şey yapmadığı için mobil alt menü ve kenar çubuğu
       kapatma düğmesi masaüstünde de görünüyordu.
     - .d-sm-inline / .d-md-inline tanımsız olduğu için .d-none ile
       gizlenen etiketler hiçbir ekran boyutunda geri gelmiyordu.
   ========================================================================== */

/* Duyarlı görünürlük yardımcıları (mobil öncelikli, Bootstrap mantığı) */
@media (min-width: 1025px) {
	.d-lg-none { display: none !important; }
}
@media (min-width: 576px) {
	.d-sm-inline { display: inline !important; }
}
@media (min-width: 768px) {
	.d-md-inline { display: inline !important; }
}

/* Kenar çubuğu kapatma düğmesi (yalnızca mobil) */
.sidebar-close-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	color: #94a3b8;
	padding: 6px;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-close-btn:hover {
	background: rgba(148, 163, 184, 0.12);
	color: #f1f5f9;
}
.sidebar-close-btn i {
	width: 20px;
	height: 20px;
}

/* Başlık alanı sarmalayıcıları */
.current-page-indicator {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0; /* Uzun başlıkların taşmasını değil kısalmasını sağlar. */
}
.brand-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.bbc-app-body {
	margin: 0;
}

/* Üst çubuk açılır menü sarmalayıcıları */
.notification-dropdown-wrap,
.user-dropdown-wrap,
.demo-switch-wrap,
.quick-action-wrap {
	position: relative;
	display: flex;
	align-items: center;
}
.quick-add-btn,
.demo-switch-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}
.theme-toggle-btn {
	flex-shrink: 0;
}

/* ==========================================================================
   KOYU MOD KONTRAST DÜZELTMELERİ
   --------------------------------------------------------------------------
   Kenar çubuğu her iki temada da koyu zeminlidir (--bg-sidebar). Ancak
   proje seçicisi metin rengi olarak --text-main kullanıyordu; bu değişken
   açık temada koyu bir renk olduğu için koyu zemin üzerinde okunmuyordu.
   Ayrıca <option> öğeleri tarayıcı varsayılanı olan beyaz zeminle
   çiziliyor, koyu temada açık renk metinle birleşince beyaz üstüne beyaz
   yazı oluşuyordu.
   ========================================================================== */
.project-pill-dropdown {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(148, 163, 184, 0.22);
}
.project-pill-dropdown select {
	color: #e2e8f0;
	appearance: none;
	-webkit-appearance: none;
	padding-right: 18px;
	text-overflow: ellipsis;
	background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
	                  linear-gradient(135deg, #94a3b8 50%, transparent 50%);
	background-position: right 6px center, right 1px center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}
.project-pill-dropdown select:focus {
	outline: none;
	color: #ffffff;
}
/* Açılır listedeki seçenekler — tarayıcı varsayılan beyaz zemini ezilir. */
.project-pill-dropdown select option {
	background-color: #0f172a;
	color: #e2e8f0;
}
.project-pill-dropdown select option:checked,
.project-pill-dropdown select option:hover {
	background-color: var(--primary);
	color: #ffffff;
}

/* Aynı sorun formlardaki tüm açılır listeler için de geçerli. */
.form-control option {
	background-color: var(--bg-input);
	color: var(--text-main);
}

/* ==========================================================================
   MOBİL TAŞMA DÜZELTMELERİ
   --------------------------------------------------------------------------
   Üst çubuktaki "Genel Şantiye ve Finansal Durum Özeti" alt başlığı dar
   ekranda üç satıra yayılıp başlık alanını taşırıyordu.
   ========================================================================== */
.app-header {
	gap: 12px;
}
.header-left {
	min-width: 0;
	flex: 1 1 auto;
	overflow: hidden;
}
.header-right {
	flex-shrink: 0;
}
.page-main-title,
.page-sub-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* Mobil alt menü varsayılan olarak gizli; yalnızca dar ekranda açılır.
   Taban kuralı display:flex olduğu için masaüstünde de görünüyordu. */
.mobile-bottom-nav {
	display: none;
}

@media (max-width: 768px) {
	/* Alt başlık dar ekranda gereksiz yer kaplıyor; başlık zaten bağlamı veriyor. */
	.page-sub-title {
		display: none;
	}
	.page-main-title {
		font-size: 17px;
	}
	.header-right {
		gap: 6px;
	}
	/* Simge düğmelerini sıkılaştır ki üst çubuk tek satırda kalsın. */
	.icon-btn,
	.user-avatar-btn {
		padding: 5px;
	}
	.quick-add-btn {
		padding: 7px 10px;
	}
}

@media (max-width: 480px) {
	.app-header {
		padding: 0 12px;
		gap: 8px;
	}
	.page-main-title {
		font-size: 15px;
	}
	/* Rol değiştirme düğmesi dar ekranda üst çubuğu taşırıyor. */
	.demo-switch-wrap {
		display: none;
	}
}

/* Bağlam şeridi — hangi projenin verisinin gösterildiğini açıkça belirtir. */
.context-strip {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	margin-bottom: 16px;
	border-radius: var(--radius-md);
	background: var(--primary-light);
	border: 1px solid rgba(2, 132, 199, 0.25);
	color: var(--text-main);
	font-size: 12px;
}
.context-strip i {
	width: 15px;
	height: 15px;
	color: var(--primary);
	flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   İSTEMCİ TARAFI FİLTRE / ARAMA ARAÇ ÇUBUĞU (filterToolbar)
   -------------------------------------------------------------------------- */
.bbc-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	padding: 12px 14px;
	background: var(--bg-card-subtle, var(--neutral-50));
	border: 1px solid var(--neutral-200);
	border-radius: var(--radius-md);
}
.bbc-filter-bar .bbc-filter-input {
	flex: 1 1 160px;
	min-width: 130px;
	max-width: 240px;
	height: 38px;
	font-size: 13px;
}
.bbc-filter-bar .bbc-filter-clear {
	flex: 0 0 auto;
}
.bbc-filter-bar .bbc-filter-count {
	flex: 1 1 100%;
	font-size: 12px;
	color: var(--text-muted, #64748b);
}
@media (min-width: 900px) {
	.bbc-filter-bar .bbc-filter-count {
		flex: 0 0 auto;
		margin-left: auto;
	}
}
@media (max-width: 640px) {
	.bbc-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}
	.bbc-filter-bar .bbc-filter-input,
	.bbc-filter-bar .bbc-filter-clear {
		max-width: none;
		width: 100%;
	}
}
