* {
	box-sizing: border-box;
}

html {
	height: 100%;
}

body {
	margin: 0;
	padding: 15px;
	min-height: 100%;
	font-family: 'Trebuchet MS', Arial, sans-serif;
	background-color: #f9f9f9;
	line-height: 1.4;
	font-size: 14px;
}

.container {
	max-width: 1000px;
	margin: 0 auto;
	padding: 0 80px;
	width: 100%;
}

header {
	background: linear-gradient(135deg, #b8860b, #daa520);
	padding: 15px 20px;
	border-radius: 25px;
	margin-bottom: 15px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	color: white;
	display: flex;
	align-items: center;
	gap: 15px;
	flex-wrap: wrap;
}

.logo-circle {
	width: 50px;
	height: 50px;
	background-color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	flex-shrink: 0;
	overflow: hidden;
}

.logo-circle img {
	width: 35px;
	height: 35px;
	object-fit: contain;
}

h1 {
	font-family: 'Trebuchet MS', Arial, sans-serif;
	color: white;
	margin: 0;
	font-size: clamp(16px, 3vw, 24px);
	font-weight: normal;
	flex: 1;
}

.help-icon {
	display: inline-block;
	width: 24px;
	height: 24px;
	background-color: #cd1414;
	color: white;
	border-radius: 50%;
	text-align: center;
	line-height: 24px;
	font-weight: bold;
	cursor: help;
	position: relative;
	font-size: 14px;
	flex-shrink: 0;
}

.help-icon:hover .tooltip {
	visibility: visible;
	opacity: 1;
	transform: translateY(5px);
}

.tooltip {
	visibility: hidden;
	opacity: 0;
	background-color: rgba(0, 0, 0, 0.9);
	color: white;
	text-align: left;
	border-radius: 6px;
	padding: 15px;
	position: absolute;
	z-index: 1000;
	top: 125%;
	right: 0;
	width: 300px;
	transition: all 0.3s;
	transform: translateY(0);
	font-size: 12px;
	line-height: 1.4;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tooltip::after {
	content: "";
	position: absolute;
	bottom: 100%;
	right: 20px;
	border-width: 5px;
	border-style: solid;
	border-color: transparent transparent rgba(0, 0, 0, 0.9) transparent;
}

/* Nouveaux styles pour les infobulles des boutons */
.action-btn {
	position: relative;
	padding: 10px 18px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 13px;
	font-weight: bold;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.3s;
	font-family: 'Trebuchet MS', Arial, sans-serif;
	min-width: 120px;
	justify-content: center;
}

.action-btn:hover .btn-tooltip {
	visibility: visible;
	opacity: 1;
	transform: translateX(-50%) translateY(-10px);
}

.btn-tooltip {
	visibility: hidden;
	opacity: 0;
	background-color: rgba(0, 0, 0, 0.9);
	color: white;
	text-align: center;
	border-radius: 6px;
	padding: 8px 12px;
	position: absolute;
	z-index: 1000;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-5px);
	transition: all 0.3s ease;
	font-size: 12px;
	line-height: 1.3;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	pointer-events: none;
	max-width: 250px;
	white-space: normal;
}

.btn-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.balance-container {
	background-color: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	margin: 15px auto;
	border: 1px solid #ddd;
	max-width: 1100px;
}

.balance-header {
	background-color: #4a90e2;
	color: white;
	padding: 12px 15px;
	text-align: center;
	font-size: 16px;
	font-weight: bold;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.period-info {
	text-align: right;
	font-size: 12px;
}

.balance-table {
	width: 100%;
	border-collapse: collapse;
	background-color: white;
}

.balance-table th {
	background-color: #9e9e9e;
	color: white;
	padding: 10px 8px;
	text-align: center;
	font-weight: bold;
	border: 1px solid #ddd;
	font-size: 14px;
	height: 35px;
}

.balance-table td {
	padding: 5px;
	border: 1px solid #ddd;
	font-size: 13px;
	height: auto;
}

.balance-table tr:nth-child(even) {
	background-color: #f5f5f5;
}

.account-number {
	background-color: #e8e8e8;
	font-weight: bold;
	width: 80px;
	min-width: 80px;
	text-align: center;
}

.account-name {
	text-align: left !important;
	padding-left: 15px;
	width: auto;
}

.amount-column {
	text-align: right;
	padding-right: 5px;
	width: 100px;
}

.section-header {
	background-color: #bce6f6;
	color: #00425b;
	padding: 10px 20px;
	font-weight: bold;
	margin: 15px 0 0 0;
	font-size: 16px;
	border-radius: 0;
}

.section-header-top {
	color: #bce6f6;
	background-color: #00425b;
	padding: 10px 20px;
	font-weight: bold;
	margin: 15px 0 0 0;
	font-size: 16px;
	border-radius: 0;
}

.section-header.violet {
	background-color: #e8d5e8;
	color: #61055d;
	text-align: center;
	margin: 10px auto;
	width: 60%;
	border-radius: 5px;
}

.section-header.rouge {
	background-color: #ffebee;
	color: #c62828;
	text-align: center;
	margin: 10px auto;
	width: 60%;
	border-radius: 5px;
}

.form-container {
	background-color: white;
	border-radius: 8px;
	padding: 0;
	margin-bottom: 15px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-row {
	display: flex;
	align-items: center;
	min-height: 50px;
	border-bottom: 1px solid #f0f0f0;
	padding: 8px 0;
}

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

.form-row.header-row {
	background-color: #f8f9fa;
	font-weight: bold;
	text-align: center;
	padding: 12px 0;
}

.form-row.total-row {
	background-color: #e8f5e8;
	font-weight: bold;
}

.form-label {
	flex: 1;
	padding-left: 20px;
	font-size: 14px;
	font-weight: bold;
}

.form-input-container {
	width: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.form-input-container.dual {
	width: 420px;
	gap: 20px;
}

.form-input {
	width: 120px;
	text-align: right;
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 3px;
	font-size: 14px;
	font-family: 'Trebuchet MS', Arial, sans-serif;
}

.form-input:focus {
	outline: 2px solid #045FB4;
	border-color: #045FB4;
}

.verification-circle {
	display: inline-block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	text-align: center;
	line-height: 22px;
	font-weight: bold;
	font-size: 12px;
	color: white;
	border: 2px solid #ddd;
	background-color: #f5f5f5;
	transition: all 0.3s ease;
	flex-shrink: 0;
}

.verification-circle.correct {
	background-color: #4caf50;
	border-color: #4caf50;
	color: white;
}

.verification-circle.incorrect {
	background-color: #f44336;
	border-color: #f44336;
	color: white;
}

.calc-btn {
	background-color: #ff9800;
	color: white;
	border: none;
	padding: 8px 10px;
	margin: 2px;
	border-radius: 3px;
	cursor: pointer;
	font-weight: bold;
	transition: all 0.3s;
	font-family: 'Trebuchet MS', Arial, sans-serif;
	font-size: 14px;
}

.calc-btn:hover {
	background-color: #f57c00;
	transform: scale(1.05);
}

.result-section {
	margin-top: 20px;
}

.result-row-container {
	display: flex;
	justify-content: center;
	gap: 40px;
	margin: 15px 0;
	flex-wrap: wrap;
}

.result-item {
	display: flex;
	align-items: center;
	gap: 15px;
	flex-direction: column;
	text-align: center;
}

.result-label {
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 10px;
}

.result-input-container {
	display: flex;
	align-items: center;
	gap: 10px;
}

.button-container {
	display: flex;
	gap: 15px;
	justify-content: center;
	margin: 20px 0;
	flex-wrap: wrap;
}

.btn-verify {
	background-color: #2196f3;
	color: white;
}

.btn-verify:hover {
	background-color: #1976d2;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-clear-colors {
	background-color: #ff9800;
	color: white;
}

.btn-clear-colors:hover {
	background-color: #f57c00;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-clear-all {
	background-color: #f44336;
	color: white;
}

.btn-clear-all:hover {
	background-color: #d32f2f;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-print {
	background-color: #9c27b0;
	color: white;
}

.btn-print:hover {
	background-color: #7b1fa2;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.score-container {
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 15px;
	text-align: center;
	margin: 20px auto;
	max-width: 300px;
	font-weight: normal;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.score-title {
	font-size: 14px;
	color: #6c757d;
	margin-bottom: 8px;
}

.score-display {
	font-size: 18px;
	color: #495057;
	margin: 5px 0;
	font-weight: bold;
}

.popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 10000;
}

.popup-content {
	background: white;
	color: #333;
	padding: 25px;
	border-radius: 8px;
	text-align: center;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	max-width: 450px;
	min-width: 350px;
	position: relative;
	border-top: 4px solid #b8860b;
	animation: popupAppear 0.2s ease-out;
}

@keyframes popupAppear {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(-10px);
	}

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

.popup-title {
	font-size: 20px;
	font-weight: bold;
	margin-bottom: 15px;
	color: #b8860b;
	font-family: 'Trebuchet MS', Arial, sans-serif;
}

.popup-message {
	font-size: 14px;
	line-height: 1.4;
	margin-bottom: 20px;
	color: #555;
}

.popup-score {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	padding: 15px;
	border-radius: 5px;
	margin: 15px 0;
	font-size: 16px;
	color: #333;
}

.popup-buttons {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.popup-btn {
	padding: 10px 20px;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	font-weight: normal;
	transition: all 0.2s;
	min-width: 100px;
	font-family: 'Trebuchet MS', Arial, sans-serif;
	background: white;
	color: #333;
}

.popup-btn.primary {
	background-color: #b8860b;
	color: white;
	border-color: #b8860b;
}

.popup-btn.primary:hover {
	background-color: #a0750a;
	border-color: #a0750a;
}

.popup-btn.secondary {
	background-color: #6c757d;
	color: white;
	border-color: #6c757d;
}

.popup-btn.secondary:hover {
	background-color: #5a6268;
	border-color: #5a6268;
}

.popup-btn.danger {
	background-color: #dc3545;
	color: white;
	border-color: #dc3545;
}

.popup-btn.danger:hover {
	background-color: #c82333;
	border-color: #c82333;
}

.popup-btn:hover {
	background-color: #f8f9fa;
	border-color: #b8860b;
	color: #b8860b;
}

.tentative-counter {
	background: #e9ecef;
	border: 1px solid #ced4da;
	padding: 10px;
	border-radius: 4px;
	margin: 15px 0;
	font-size: 14px;
	color: #495057;
}

.tentative-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 15px 0;
}

.tentative-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: #e9ecef;
	border: 1px solid #ced4da;
	transition: all 0.2s;
}

.tentative-dot.used {
	background-color: #dc3545;
	border-color: #dc3545;
}

.tentative-dot.current {
	background-color: #b8860b;
	border-color: #b8860b;
	transform: scale(1.1);
}

.instructions {
	background-color: #fff3cd;
	border: 1px solid #ffeaa7;
	border-radius: 5px;
	padding: 15px;
	margin-bottom: 20px;
	color: #856404;
	font-size: 18px;
}

/* Styles améliorés pour l'état préparatoire - SANS QUADRILLAGE */
.etat-container {
	background-color: white;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 15px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.etat-row {
	display: flex;
	align-items: center;
	min-height: 32px;
	padding: 4px 0;
	border-bottom: 1px solid #f0f0f0;
}

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

.etat-row.total-row {
	background-color: rgba(232, 245, 232, 0.3);
	font-weight: bold;
	border-radius: 5px;
	margin: 5px 0;
	padding: 8px;
}

.etat-label {
	flex: 3;
	padding-left: 15px;
	font-size: 14px;
	color: #333;
}

.etat-input-container {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.etat-verification-single {
	flex: 0 0 50px;
	display: flex;
	justify-content: center;
}

.etat-input {
	width: 120px;
	text-align: right;
	padding: 6px 10px;
	border: 1px solid #e1f1fa;
	border-radius: 6px;
	font-size: 13px;
	font-family: 'Trebuchet MS', Arial, sans-serif;
	background-color: #f8fffe;
	color: #2c3e50;
	transition: all 0.3s ease;
}

.etat-input:focus {
	outline: none;
	border-color: #2196f3;
	background-color: #ffffff;
	box-shadow: 0 0 8px rgba(33, 150, 243, 0.2);
}

.etat-input:hover {
	border-color: #bbdefb;
	background-color: #ffffff;
}

.etat-verification {
	margin-left: 5px;
}

/* Styles pour les écritures comptables améliorés */
.comptabilite-container {
	background-color: white;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 15px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comptabilite-row {
	display: flex;
	align-items: center;
	min-height: 20px;
	padding: 1px 0;
	border-bottom: 1px solid #f0f0f0;
}

.comptabilite-row:last-child {
	border-bottom: none;
	background-color: rgba(219, 112, 147, 0.1);
	border: 1px solid #db7093;
	border-radius: 5px;
}

.comptabilite-cell {
	padding: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.comptabilite-select {
	width: 90px;
	padding: 8px;
	border: 2px solid #e3f2fd;
	border-radius: 6px;
	background-color: #f8fffe;
	font-size: 13px;
	transition: all 0.3s ease;
}

.comptabilite-select:focus {
	outline: none;
	border-color: #2196f3;
	background-color: #ffffff;
}

.compte-name-input {
	width: 200px;
	border: none;
	background: transparent;
	font-size: 13px;
	text-align: center;
	color: #555;
}

.comptabilite-input {
	width: 100px;
	text-align: center;
	padding: 8px;
	border: 1px solid #e3f2fd;
	border-radius: 6px;
	background-color: #f8fffe;
	color: #2c3e50;
	font-size: 14px;
	transition: all 0.3s ease;
}

.comptabilite-input:focus {
	outline: none;
	border-color: #2196f3;
	background-color: #ffffff;
	box-shadow: 0 0 8px rgba(33, 150, 243, 0.2);
}

.comptabilite-verification {
	margin-left: 8px;
}

/* Message d'aide pour les écritures comptables */
.comptabilite-help {
	background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
	border: 1px solid #c8e6c9;
	border-radius: 8px;
	padding: 15px;
	margin: 15px 0;
	color: #2e7d32;
	font-size: 14px;
	text-align: center;
}

.comptabilite-help.warning {
	background: linear-gradient(135deg, #fff3e0, #ffeaa7);
	border-color: #ffb74d;
	color: #f57c00;
}

.comptabilite-help.error {
	background: linear-gradient(135deg, #ffebee, #ffcdd2);
	border-color: #ef5350;
	color: #d32f2f;
}

/* Headers pour les tableaux sans bordure */
.etat-header {
	display: flex;
	background-color: #f5f5f5;
	padding: 10px;
	margin-bottom: 8px;
	border-radius: 6px;
	font-weight: bold;
	color: #333;
}

.comptabilite-header {
	display: flex;
	background-color: #f5f5f5;
	padding: 4px;
	margin-bottom: 4px;
	border-radius: 6px;
	font-weight: bold;
	color: #333;
	text-align: center;
}

/* Styles améliorés pour les popups */
.popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}

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

.popup-content {
	background: white;
	padding: 2rem;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	max-width: 500px;
	width: 90%;
	text-align: center;
	animation: slideIn 0.3s ease-out;
	border: 1px solid #e5e7eb;
}

.popup-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 1rem;
	line-height: 1.3;
}

.popup-message {
	color: #4b5563;
	margin-bottom: 1.5rem;
	line-height: 1.6;
	font-size: 1rem;
}

.popup-score {
	background: #f8fafc;
	padding: 1.2rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	color: #334155;
	font-weight: 500;
	border: 1px solid #e2e8f0;
}

.penalite-info {
	background: #fef3c7;
	padding: 1rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	color: #92400e;
	font-size: 0.95rem;
	border: 1px solid #f59e0b;
	font-weight: 500;
}

.penalite-warning {
	background: #fee2e2;
	padding: 1rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	color: #dc2626;
	font-size: 0.95rem;
	border: 1px solid #f87171;
	font-weight: 500;
}

.penalite-critical {
	background: #fecaca;
	padding: 1rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	color: #b91c1c;
	font-size: 0.95rem;
	border: 2px solid #dc2626;
	font-weight: 600;
}

.indicateur-tentatives {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 1.5rem;
}

.dot-tentative {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #e5e7eb;
	transition: all 0.3s ease;
}

.dot-tentative.utilise {
	background: #dc2626;
}

.dot-tentative.actuelle {
	background: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.button-container {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	flex-wrap: wrap;
}

.action-btn {
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 120px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.btn-primary {
	background: #2563eb;
	color: white;
}

.btn-primary:hover {
	background: #1d4ed8;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
	background: #e2e8f0;
	border-color: #94a3b8;
	transform: translateY(-1px);
}

.btn-danger {
	background: #dc2626;
	color: white;
}

.btn-danger:hover {
	background: #b91c1c;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-cancel {
	background: #9ca3af;
	color: white;
}

.btn-cancel:hover {
	background: #6b7280;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3);
}

.action-btn:active {
	transform: translateY(0);
}

.popup-content .button-container .action-btn {
	min-width: 100px;
	padding: 0.6rem 1.2rem;
	font-size: 0.85rem;
}

.score-breakdown {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-top: 0.5rem;
	font-size: 0.9rem;
}

.score-item {
	padding: 0.3rem;
	background: #f8fafc;
	border-radius: 4px;
}

@media print {
	.popup-overlay {
		display: none !important;
	}

	.button-container,
	.help-icon,
	.calc-btn,
	.action-btn,
	button,
	[type="button"] {
		display: none !important;
	}

	.btn-tooltip {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.container {
		padding: 0 40px;
	}

	.etat-row,
	.comptabilite-row {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 15px 10px;
	}

	.etat-label {
		padding-left: 10px;
		text-align: left;
	}

	.etat-input-container,
	.comptabilite-cell {
		width: 100%;
		justify-content: center;
	}

	.result-row-container {
		flex-direction: column;
		gap: 20px;
	}

	.button-container {
		flex-direction: column;
		align-items: center;
	}

	.action-btn {
		width: 200px;
	}

	.btn-tooltip {
		display: none !important;
	}

	.action-btn:hover .btn-tooltip {
		display: none !important;
	}
}


.footer {
	text-align: center;
	color: #666;
	font-size: 0.7rem;
	font-weight: 400;
	margin-top: 10px;
}