/* =========================================
           GLOBAL VARIABLES & RESET (MODERNIZED)
           ========================================= */
:root {
	--bg-body: #f8fafc;
	--primary-blue: #2563eb;
	--dark-blue: #1d4ed8;
	--nav-bg: #0f172a;
	--nav-hover: #1e293b;
	--yellow-btn: #eab308;
	--yellow-btn-hover: #ca8a04;
	--text-main: #334155;
	--text-muted: #64748b;
	--border-color: #e2e8f0;
	--card-bg: #ffffff;
	--font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--success: #10b981;
	--danger: #ef4444;
	--warning: #f59e0b;
}

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

body {
	font-family: var(--font-family);
	background-color: var(--bg-body);
	color: var(--text-main);
	font-size: 14px;
	display: flex;
	height: 100vh;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

/* =========================================
           MODERN UTILITIES & BUTTONS
           ========================================= */
.btn {
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	white-space: nowrap;
}

.btn-blue {
	background-color: var(--primary-blue);
	color: white;
}

.btn-blue:hover {
	background-color: var(--dark-blue);
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-yellow {
	background-color: var(--yellow-btn);
	color: white;
}

.btn-yellow:hover {
	background-color: var(--yellow-btn-hover);
}

.btn-white {
	background-color: white;
	color: var(--text-main);
	border: 1px solid var(--border-color);
}

.btn-white:hover {
	background-color: #f8fafc;
	border-color: #cbd5e1;
}

.btn-block {
	width: 100%;
	padding: 12px;
	font-size: 16px;
	margin-top: 10px;
}

.flex-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

@media (max-width: 768px) {
	.flex-between {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.flex-between>div {
		display: flex;
		flex-direction: column;
		gap: 8px;
		width: 100%;
	}

	.flex-between .btn {
		width: 100%;
	}

	.flex-between input[type="text"] {
		width: 100% !important;
	}
}
.mt-15 {
	margin-top: 15px;
}

.mb-20 {
	margin-bottom: 20px;
}

.text-center {
	text-align: center;
}

.badge-status {
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	display: inline-block;
	white-space: nowrap;
}

.status-new {
	background-color: #fef08a;
	color: #854d0e;
}

.status-contacted {
	background-color: #e0e7ff;
	color: #3730a3;
}

.status-quoted {
	background-color: #d1fae5;
	color: #065f46;
}

/* =========================================
           APP LAYOUT: SIDEBAR & MAIN AREA
           ========================================= */
#app-sidebar {
	width: 260px;
	background-color: var(--nav-bg);
	color: white;
	display: flex;
	flex-direction: column;
	z-index: 1001;
	/* Above overlay */
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
	transition: left 0.3s ease;
}
@media (max-width: 768px) {
    #app-sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: -260px;
		height: 100vh;
	}

	#app-sidebar.open {
		left: 0;
	}
}
/* Mobile Overlay */
#sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.3s ease;
}

#sidebar-overlay.active {
	display: block;
	opacity: 1;
}

.sidebar-brand {
	padding: 24px 20px;
	font-size: 20px;
	font-weight: 700;
	color: white;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	display: flex;
	align-items: center;
	gap: 10px;
	letter-spacing: -0.5px;
}

.sidebar-brand span {
	color: var(--yellow-btn);
}

.sidebar-nav {
	flex: 1;
	padding: 20px 10px;
	list-style: none;
	overflow-y: auto;
}

.sidebar-nav li a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	margin-bottom: 4px;
	color: #94a3b8;
	text-decoration: none;
	font-weight: 500;
	border-radius: 8px;
	transition: all 0.2s;
	cursor: pointer;
}

.sidebar-nav li a:hover {
	background-color: var(--nav-hover);
	color: white;
}

.sidebar-nav li a.active {
	background-color: var(--primary-blue);
	color: white;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar-footer {
	padding: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#main-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 100%;
}

/* Topbar */
.topbar {
	height: 64px;
	background-color: white;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 32px;
	flex-shrink: 0;
}

.topbar-left {
	display: flex;
	align-items: center;
	gap: 16px;
}
@media (max-width: 768px) {
    .topbar {
		padding: 0 16px;
	}

	.topbar-right-text {
		display: none;
	}
}
.topbar-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--nav-bg);
}

#mobile-menu-btn {
	display: none;
	background: none;
	border: none;
	font-size: 24px;
	color: var(--nav-bg);
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
}

#mobile-menu-btn:hover {
	background: #f1f5f9;
}
@media (max-width: 768px) {
    #mobile-menu-btn {
		display: block;
	}
}
/* View Container */
.view-container {
	flex: 1;
	padding: 32px;
	overflow-y: auto;
	overflow-x: hidden;
}
@media (max-width: 768px) {

	.view-container {
		padding: 16px;
	}
}
.view {
	display: none;
}

.view.active {
	display: block;
	animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =========================================
           LOGIN VIEW
           ========================================= */
#login-wrapper {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--nav-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 20px;
}

.login-box {
	background: white;
	padding: 40px;
	border-radius: 12px;
	width: 100%;
	max-width: 400px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-box h2 {
	text-align: center;
	margin-bottom: 24px;
	color: var(--nav-bg);
	font-weight: 700;
}

@media (max-width: 768px) {
	.login-box {
		padding: 30px 20px;
	}
}
.form-group {
	margin-bottom: 20px;
	width: 100%;
}

.form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: var(--text-main);
	font-size: 13px;
}

.form-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	color: var(--text-main);
	transition: all 0.2s;
	outline: none;
	background: #fff;
}

.form-input:focus {
	border-color: var(--primary-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =========================================
           DASHBOARD & TABLES
           ========================================= */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
	margin-bottom: 32px;
}

.stat-card {
	background: white;
	padding: 24px;
	border-radius: 12px;
	border: 1px solid var(--border-color);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
}

.stat-card h3 {
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 500;
}

.stat-card p {
	font-size: 32px;
	font-weight: 700;
	color: var(--nav-bg);
	margin-top: 8px;
}

/* Table Responsive Wrapper */
.table-responsive {
	width: 100%;
	overflow-x: auto;
	border-radius: 12px;
	border: 1px solid var(--border-color);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	background: white;
	-webkit-overflow-scrolling: touch;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 600px;
}

.data-table th,
.data-table td {
	padding: 16px 24px;
	text-align: left;
	border-bottom: 1px solid var(--border-color);
}

.data-table th {
	background-color: #f8fafc;
	font-weight: 600;
	color: var(--text-muted);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

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

.data-table tr:hover {
	background-color: #f1f5f9;
}

/* =========================================
           MODERN QUOTE GENERATOR FORM
           ========================================= */
.quote-grid {
	display: grid;
	grid-template-columns: 1fr 350px;
	gap: 24px;
	margin-top: 20px;
}
@media (max-width: 1024px) {
	.quote-grid {
		grid-template-columns: 1fr;
	}
}
.card {
	background-color: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	margin-bottom: 24px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	overflow: hidden;
}

.card-header {
	background-color: white;
	padding: 16px 24px;
	font-weight: 600;
	color: var(--nav-bg);
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 16px;
}

.card-header.solid-blue {
	background-color: #f8fafc;
	color: var(--nav-bg);
	border-bottom: 2px solid var(--primary-blue);
}

.badge {
	background-color: #e0e7ff;
	color: var(--primary-blue);
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 700;
	flex-shrink: 0;
}

.card-body {
	padding: 24px;
}

@media (max-width: 768px) {
	.card-header {
		padding: 16px;
	}

	.card-body {
		padding: 16px;
	}
}
/* Modern Grid Forms */
.grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.grid-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 16px;
}

@media (max-width: 768px) {
	.grid-2,
	.grid-3 {
		grid-template-columns: 1fr;
	}
}
.radio-group {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.custom-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 500;
	color: var(--text-main);
}

.custom-radio input[type="radio"] {
	accent-color: var(--primary-blue);
	width: 16px;
	height: 16px;
}

.checkbox-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
@media (max-width: 768px) {
	.checkbox-grid {
		grid-template-columns: 1fr;
	}
}
.custom-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	padding: 10px 14px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	transition: all 0.2s;
	font-weight: 500;
}

.custom-checkbox:hover {
	background-color: #f8fafc;
	border-color: #cbd5e1;
}

.custom-checkbox input[type="checkbox"] {
	accent-color: var(--primary-blue);
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.divider {
	height: 1px;
	background-color: var(--border-color);
	margin: 20px 0;
}

/* Toggles (Apple Style) */
.toggle-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #f1f5f9;
	gap: 16px;
}

.toggle-row:last-child {
	border-bottom: none;
}

.switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 24px;
	flex-shrink: 0;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .3s;
	border-radius: 24px;
}

.slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .3s;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
	background-color: var(--primary-blue);
}

input:checked+.slider:before {
	transform: translateX(24px);
}

/* Sidebar Elements */
.summary-list {
	list-style: none;
}

.summary-list li {
	padding: 12px 0;
	border-bottom: 1px solid #f1f5f9;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

.summary-list li:last-child {
	border-bottom: none;
}

.summary-label {
	color: var(--text-muted);
	font-weight: 500;
}

.summary-value {
	font-weight: 600;
	color: var(--nav-bg);
	text-align: right;
	word-break: break-word;
}

.risk-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #fffbeb;
	border-left: 4px solid var(--warning);
	border-radius: 6px;
	margin-bottom: 10px;
	font-weight: 500;
	color: #92400e;
}

/* Attachments */
.file-upload-box {
	border: 2px dashed var(--border-color);
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	background: #f8fafc;
	cursor: pointer;
	transition: all 0.2s;
}

.file-upload-box:hover {
	border-color: var(--primary-blue);
	background: #eff6ff;
}

.attachment-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	color: #166534;
	font-weight: 500;
	margin-top: 10px;
	word-break: break-all;
}

/* =========================================
           QUOTE PREVIEW (PDF Style)
           ========================================= */
.pdf-preview {
	background: white;
	max-width: 800px;
	margin: 0 auto;
	padding: 48px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	border-radius: 8px;
	border: 1px solid #e2e8f0;
}

.pdf-header {
	border-bottom: 2px solid var(--border-color);
	padding-bottom: 24px;
	margin-bottom: 32px;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 16px;
}

.pdf-header h1 {
	color: var(--nav-bg);
	margin-bottom: 4px;
	font-weight: 800;
	letter-spacing: -1px;
	font-size: 28px;
}

.pdf-section-title {
	color: var(--primary-blue);
	font-weight: 700;
	font-size: 16px;
	margin: 32px 0 16px 0;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 8px;
}

.pdf-row {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	color: var(--text-main);
	gap: 16px;
	border-bottom: 1px solid #f8fafc;
}

.pdf-row span {
	color: var(--text-muted);
}

.pdf-row strong {
	text-align: right;
}

.pdf-total {
	font-size: 22px;
	font-weight: 800;
	color: var(--nav-bg);
	padding-top: 20px;
	border-top: 2px solid var(--nav-bg);
	margin-top: 20px;
	border-bottom: none;
}

.pdf-total span {
	color: inherit;
}

@media (max-width: 768px) {
	.pdf-preview {
		padding: 24px 16px;
	}

	.pdf-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.pdf-header>div:last-child {
		text-align: left;
	}

	.pdf-row {
		flex-direction: column;
		gap: 4px;
		border-bottom: 1px solid #f1f5f9;
		padding: 12px 0;
	}

	.pdf-row strong {
		text-align: left;
	}

	.pdf-total {
		flex-direction: row;
		align-items: center;
		font-size: 18px;
	}
}