/* ==========================================================================
   AwoFleet v1.0.0 — Kurumsal Araç Filosu, Sefer Defteri, KM & Zimmet Stüdyosu
   Adaptive Day/Night Theme + A4 Print Engine
   ========================================================================== */

.af-root {
	--af-bg: #f1f5f9;
	--af-surface: #ffffff;
	--af-surface-2: #f8fafc;
	--af-border: #cbd5e1;
	--af-text: #0f172a;
	--af-text-muted: #64748b;
	--af-primary: #2563eb;
	--af-primary-hover: #1d4ed8;
	--af-primary-soft: #eff6ff;
	--af-emerald: #059669;
	--af-emerald-soft: #ecfdf5;
	--af-amber: #d97706;
	--af-amber-soft: #fffbeb;
	--af-rose: #e11d48;
	--af-rose-soft: #fff1f2;
	--af-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
	--af-radius: 14px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--af-text);
	background: var(--af-bg);
	padding: 24px;
	border-radius: 16px;
	box-sizing: border-box;
	line-height: 1.5;
}

.af-root *,
.af-root *::before,
.af-root *::after {
	box-sizing: border-box;
}

.af-root[data-theme="dark"] {
	--af-bg: #0b1120;
	--af-surface: #111827;
	--af-surface-2: #1e293b;
	--af-border: #334155;
	--af-text: #f8fafc;
	--af-text-muted: #94a3b8;
	--af-primary: #3b82f6;
	--af-primary-hover: #60a5fa;
	--af-primary-soft: rgba(59, 130, 246, 0.16);
	--af-emerald: #10b981;
	--af-emerald-soft: rgba(16, 185, 129, 0.15);
	--af-amber: #f59e0b;
	--af-amber-soft: rgba(245, 158, 11, 0.15);
	--af-rose: #fb7185;
	--af-rose-soft: rgba(244, 63, 94, 0.16);
	--af-shadow: 0 8px 28px -4px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
	.af-root[data-theme="auto"] {
		--af-bg: #0b1120;
		--af-surface: #111827;
		--af-surface-2: #1e293b;
		--af-border: #334155;
		--af-text: #f8fafc;
		--af-text-muted: #94a3b8;
		--af-primary: #3b82f6;
		--af-primary-hover: #60a5fa;
		--af-primary-soft: rgba(59, 130, 246, 0.16);
		--af-emerald: #10b981;
		--af-emerald-soft: rgba(16, 185, 129, 0.15);
		--af-amber: #f59e0b;
		--af-amber-soft: rgba(245, 158, 11, 0.15);
		--af-rose: #fb7185;
		--af-rose-soft: rgba(244, 63, 94, 0.16);
		--af-shadow: 0 8px 28px -4px rgba(0, 0, 0, 0.45);
	}
}

/* Header */
.af-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: var(--af-surface);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius);
	padding: 18px 22px;
	box-shadow: var(--af-shadow);
	margin-bottom: 20px;
}

.af-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.af-logo-icon {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	background: linear-gradient(135deg, #2563eb, #0ea5e9);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #fff;
	box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.af-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.af-title {
	margin: 0;
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--af-text);
}

.af-version {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--af-surface-2);
	border: 1px solid var(--af-border);
	color: var(--af-text-muted);
}

.af-plan-badge {
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 99px;
}

.af-plan-badge.is-free {
	background: var(--af-amber-soft);
	color: var(--af-amber);
	border: 1px solid rgba(217, 119, 6, 0.3);
}

.af-plan-badge.is-pro {
	background: var(--af-emerald-soft);
	color: var(--af-emerald);
	border: 1px solid rgba(5, 150, 105, 0.3);
}

.af-subtitle {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--af-text-muted);
}

.af-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.af-theme-group {
	display: inline-flex;
	background: var(--af-surface-2);
	border: 1px solid var(--af-border);
	border-radius: 10px;
	padding: 3px;
}

.af-theme-btn {
	border: none;
	background: transparent;
	color: var(--af-text-muted);
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 7px;
	cursor: pointer;
}

.af-theme-btn.active {
	background: var(--af-surface);
	color: var(--af-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.af-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.15s ease;
}

.af-btn-primary {
	background: var(--af-primary);
	color: #ffffff;
}

.af-btn-primary:hover {
	background: var(--af-primary-hover);
}

.af-btn-secondary {
	background: var(--af-surface-2);
	color: var(--af-text);
	border-color: var(--af-border);
}

.af-btn-secondary:hover {
	border-color: var(--af-primary);
}

.af-btn-pro {
	background: linear-gradient(135deg, #f59e0b, #d97706);
	color: #ffffff;
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
}

.af-btn-pro.is-unlocked {
	background: linear-gradient(135deg, #059669, #10b981);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.af-btn-block {
	width: 100%;
	padding: 11px 16px;
}

.af-btn-link {
	background: none;
	border: none;
	color: var(--af-primary);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.af-pro-pill {
	font-size: 10px;
	font-weight: 800;
	padding: 1px 6px;
	border-radius: 99px;
	background: rgba(245, 158, 11, 0.18);
	color: #d97706;
	border: 1px solid rgba(245, 158, 11, 0.35);
}

/* KPI Grid */
.af-kpi-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 20px;
}

.af-kpi-card {
	background: var(--af-surface);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius);
	padding: 16px 18px;
	box-shadow: var(--af-shadow);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.af-kpi-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--af-text-muted);
}

.af-kpi-value {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--af-text);
}

.af-kpi-sub {
	font-size: 12px;
	color: var(--af-text-muted);
}

.af-text-emerald {
	color: var(--af-emerald);
}

.af-text-indigo {
	color: var(--af-primary);
}

.af-text-amber {
	color: var(--af-amber);
}

.af-text-rose {
	color: var(--af-rose);
}

/* Toast */
.af-toast {
	padding: 12px 16px;
	border-radius: 10px;
	background: var(--af-primary-soft);
	border: 1px solid var(--af-primary);
	color: var(--af-text);
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 18px;
}

/* Main Grid */
.af-main-grid {
	display: grid;
	grid-template-columns: 410px 1fr;
	gap: 20px;
	align-items: start;
}

.af-sidebar,
.af-content {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.af-card {
	background: var(--af-surface);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius);
	padding: 20px;
	box-shadow: var(--af-shadow);
}

.af-fine-card {
	border-color: rgba(245, 158, 11, 0.45);
}

.af-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--af-border);
}

.af-board-header {
	flex-wrap: wrap;
}

.af-card-title {
	margin: 0;
	font-size: 15.5px;
	font-weight: 700;
	color: var(--af-text);
}

.af-card-desc {
	margin: 3px 0 0;
	font-size: 12px;
	color: var(--af-text-muted);
}

/* Forms */
.af-form {
	display: flex;
	flex-direction: column;
	gap: 11px;
}

.af-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.af-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.af-field label {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--af-text-muted);
}

.af-field input,
.af-field select {
	width: 100%;
	padding: 8.5px 10px;
	border-radius: 9px;
	border: 1px solid var(--af-border);
	background: var(--af-surface-2);
	color: var(--af-text);
	font-size: 12.5px;
	font-family: inherit;
}

.af-field input:focus,
.af-field select:focus {
	outline: none;
	border-color: var(--af-primary);
}

.af-calc-pill {
	padding: 8px 12px;
	border-radius: 9px;
	background: var(--af-primary-soft);
	color: var(--af-primary);
	font-size: 12px;
	font-weight: 700;
}

/* Signature Box */
.af-sig-box {
	border: 1px dashed var(--af-border);
	border-radius: 10px;
	padding: 10px;
	background: var(--af-surface-2);
}

.af-sig-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--af-text-muted);
	margin-bottom: 6px;
}

.af-sig-canvas {
	width: 100%;
	height: 86px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	cursor: crosshair;
	touch-action: none;
}

/* Fine Lookup Result */
.af-fine-result {
	padding: 12px;
	border-radius: 10px;
	font-size: 12.5px;
	border: 1px solid var(--af-border);
	background: var(--af-surface-2);
}

.af-fine-result.found {
	border-color: var(--af-rose);
	background: var(--af-rose-soft);
}

.af-fine-result.clean {
	border-color: var(--af-emerald);
	background: var(--af-emerald-soft);
}

/* Vehicles Grid */
.af-vehicles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
	gap: 14px;
}

.af-veh-card {
	border: 1px solid var(--af-border);
	background: var(--af-surface-2);
	border-radius: 12px;
	padding: 15px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
}

.af-veh-card.is-busy {
	border-color: var(--af-amber);
	background: var(--af-amber-soft);
}

.af-veh-card.is-free {
	border-color: rgba(5, 150, 105, 0.4);
}

/* Turkish License Plate Style */
.af-plate-badge {
	display: inline-flex;
	align-items: stretch;
	border: 2px solid #0f172a;
	border-radius: 6px;
	overflow: hidden;
	background: #ffffff;
	color: #0f172a;
	font-family: 'Inter', monospace;
	font-weight: 800;
	font-size: 13.5px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.af-plate-tr {
	background: #1d4ed8;
	color: #ffffff;
	font-size: 9px;
	padding: 2px 5px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	font-weight: 800;
}

.af-plate-num {
	padding: 2px 9px;
	letter-spacing: 0.04em;
}

.af-veh-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.af-veh-status-pill {
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 99px;
}

.af-veh-status-pill.free {
	background: var(--af-emerald-soft);
	color: var(--af-emerald);
}

.af-veh-status-pill.busy {
	background: var(--af-amber-soft);
	color: var(--af-amber);
}

.af-veh-model {
	font-size: 14px;
	font-weight: 700;
	color: var(--af-text);
	margin: 0;
}

.af-veh-info {
	font-size: 12px;
	color: var(--af-text-muted);
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.af-veh-actions {
	display: flex;
	gap: 6px;
	margin-top: auto;
	padding-top: 6px;
}

/* Table */
.af-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.af-filter-input,
.af-filter-select {
	padding: 7px 11px;
	border-radius: 9px;
	border: 1px solid var(--af-border);
	background: var(--af-surface-2);
	color: var(--af-text);
	font-size: 12.5px;
}

.af-table-wrap {
	overflow-x: auto;
}

.af-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
}

.af-table th,
.af-table td {
	padding: 11px 10px;
	border-bottom: 1px solid var(--af-border);
	text-align: left;
	vertical-align: middle;
}

.af-table th {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--af-text-muted);
	background: var(--af-surface-2);
}

.af-badge {
	font-size: 11px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 99px;
	background: var(--af-primary-soft);
	color: var(--af-primary);
}

.af-gap-badge {
	display: inline-block;
	margin-top: 3px;
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--af-rose-soft);
	color: var(--af-rose);
	font-size: 11px;
	font-weight: 700;
}

.af-mini-btn {
	border: 1px solid var(--af-border);
	background: var(--af-surface);
	color: var(--af-text-muted);
	padding: 4px 8px;
	border-radius: 7px;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
}

.af-mini-btn:hover {
	color: var(--af-text);
	border-color: var(--af-primary);
}

/* Modal */
.af-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
}

.af-modal-backdrop[hidden] {
	display: none !important;
}

.af-modal {
	background: var(--af-surface);
	border: 1px solid var(--af-border);
	border-radius: 16px;
	max-width: 520px;
	width: 100%;
	padding: 22px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.af-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.af-modal-header h3 {
	margin: 0;
	font-size: 17px;
	color: var(--af-text);
}

.af-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--af-text-muted);
	cursor: pointer;
}

.af-modal-lead {
	font-size: 13.5px;
	color: var(--af-text-muted);
	margin: 0 0 12px;
}

.af-pro-features {
	margin: 0 0 16px;
	padding-left: 18px;
	font-size: 13px;
	color: var(--af-text);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.af-license-box {
	background: var(--af-surface-2);
	border: 1px solid var(--af-border);
	border-radius: 12px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.af-license-row {
	display: flex;
	gap: 8px;
}

.af-license-row input {
	flex: 1;
	padding: 9px 12px;
	border-radius: 8px;
	border: 1px solid var(--af-border);
	background: var(--af-surface);
	color: var(--af-text);
	font-family: monospace;
	font-size: 13px;
}

.af-license-hint {
	font-size: 11.5px;
	color: var(--af-text-muted);
}

.af-pro-feedback {
	font-size: 12.5px;
	font-weight: 600;
}

.af-modal-footer {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--af-border);
	display: flex;
	justify-content: flex-end;
}

.af-btn-danger-outline {
	border: 1px solid var(--af-rose);
	color: var(--af-rose);
	background: transparent;
}

.af-print-only {
	display: none;
}

@media (max-width: 1100px) {
	.af-kpi-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.af-main-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   @media print — A4 Fleet Logbook, Handover Slip & Dashboard QR Stickers
   ========================================================================== */
@media print {
	@page {
		size: A4 portrait;
		margin: 10mm;
	}

	body * {
		visibility: hidden;
	}

	#awofleet-app,
	#af-print-host,
	#af-print-host * {
		visibility: visible;
	}

	.no-print {
		display: none !important;
	}

	#awofleet-app {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		background: #ffffff !important;
		color: #0f172a !important;
		padding: 0 !important;
		margin: 0 !important;
		box-shadow: none !important;
	}

	.af-print-only {
		display: block !important;
		width: 100%;
		color: #0f172a;
		font-family: 'Inter', -apple-system, sans-serif;
	}

	.af-print-sheet {
		border: 1px solid #cbd5e1;
		border-radius: 10px;
		padding: 16px;
	}

	.af-print-table {
		width: 100%;
		border-collapse: collapse;
		font-size: 11px;
		margin-top: 12px;
	}

	.af-print-table th,
	.af-print-table td {
		border: 1px solid #cbd5e1;
		padding: 6px 8px;
		text-align: left;
	}

	.af-print-table th {
		background: #f1f5f9;
		font-weight: 700;
	}

	.af-qr-grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	.af-qr-sticker {
		border: 2px dashed #1e293b;
		border-radius: 12px;
		padding: 16px;
		text-align: center;
		page-break-inside: avoid;
	}
}

