/* === CSS SOBRE ET MODERNE V6.0 === */

/* === RESET & BASE === */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

[hidden] { display: none !important; }

html {
	height: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100%;
	margin: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	background-attachment: fixed;
	color: #1a202c;
	line-height: 1.6;
	overflow-x: hidden;
}

/* === NAVIGATION === */
nav#main-nav {
	max-width: 600px;
	margin: 0 auto;
	padding: 16px 24px;
	display: flex;
	gap: 16px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	background: #ffffff;
	border-radius: 12px;
	margin-top: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

nav#main-nav a {
	color: #2d3748;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	padding: 8px 14px;
	border-radius: 8px;
	transition: all 0.2s ease;
	position: relative;
}

nav#main-nav a.active {
	background: #f0f4f8;
	color: #2563eb;
}

nav#main-nav a:hover {
	background: #f0f4f8;
}

/* === CONTENEUR PRINCIPAL === */
#app {
	max-width: 600px;
	margin: 24px auto 40px;
	padding: 32px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	position: relative;
	overflow: hidden;
}

#app section {
	width: 100%;
}

/* === TYPOGRAPHIE === */
#app h2 {
	margin: 0 0 20px;
	font-size: 26px;
	font-weight: 700;
	color: #1a202c;
}

#app h3 {
	margin: 20px 0 14px;
	font-size: 18px;
	font-weight: 600;
	color: #2d3748;
}

#app p {
	margin: 10px 0;
	color: #4a5568;
	line-height: 1.6;
}

#app p b {
	color: #1a202c;
	font-weight: 600;
}

/* === FORMULAIRES === */
#app form {
	margin: 20px 0;
}

#app label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #2d3748;
	font-size: 14px;
}

#app input,
#app select {
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 14px;
	border: 1px solid #cbd5e0;
	border-radius: 8px;
	background: #ffffff;
	font-size: 14px;
	font-family: 'Inter', sans-serif;
	color: #2d3748;
	transition: all 0.2s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

#app select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%232d3748' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	padding-right: 40px;
	cursor: pointer;
}

#app input:focus,
#app select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#app input:hover,
#app select:hover {
	border-color: #a0aec0;
}

/* === BOUTONS === */
#app button {
	width: 100%;
	padding: 12px 20px;
	margin: 8px 0;
	border: none;
	border-radius: 8px;
	background: #2563eb;
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#app button:hover {
	background: #1d4ed8;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

#app button:active {
	transform: translateY(1px);
}

#app button:disabled {
	background: #cbd5e0;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

#app button:disabled:hover {
	transform: none;
	background: #cbd5e0;
}

/* === BOUTONS ROUGES === */
#app button[style*="background:#d32f2f"],
#app button[style*="background: #d32f2f"],
.btn-delete-user,
.btn-delete-saturday,
.btn-delete-presence {
	background: #dc2626 !important;
}

#app button[style*="background:#d32f2f"]:hover,
#app button[style*="background: #d32f2f"]:hover,
.btn-delete-user:hover,
.btn-delete-saturday:hover,
.btn-delete-presence:hover {
	background: #b91c1c !important;
}

/* === LISTES === */
#app ul {
	list-style: none;
	padding: 0;
	margin: 14px 0;
}

#app li {
	padding: 14px 16px;
	margin-bottom: 10px;
	background: #f8fafc;
	border-radius: 8px;
	border-left: 4px solid #2563eb;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: space-between;
	align-items: flex-start;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#app li:hover {
	background: #f0f4f8;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#app li > div:first-child {
	flex: 1 1 100%;
	min-width: 0;
}

#app li button {
	width: auto;
	padding: 8px 14px;
	margin: 0;
	font-size: 13px;
	background: #2563eb;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	flex: 0 1 auto;
}

#app li button:hover {
	background: #1d4ed8;
}

/* Listes imbriquées */
#app li ul {
	flex: 1 1 100%;
	margin: 8px 0 0 0;
	padding-left: 0;
}

#app li li {
	padding: 10px 12px;
	margin-bottom: 6px;
	background: #ffffff;
	border-left-color: #cbd5e0;
	font-size: 14px;
}

/* === LIENS === */
#app a {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
	transition: all 0.2s;
	position: relative;
}

#app a:hover {
	color: #1d4ed8;
}

/* === MESSAGES === */
#app .error,
#app .success {
	padding: 12px 16px;
	margin: 14px 0;
	border-radius: 8px;
	font-weight: 500;
}

#app .error {
	background: #fee;
	color: #991;
	border-left: 4px solid #dc2626;
}

#app .success {
	background: #efe;
	color: #191;
	border-left: 4px solid #16a34a;
}

/* === ACTIONS === */
#app .actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0;
}

#app .help {
	text-align: center;
	margin: 16px 0;
	color: #718096;
	font-size: 14px;
}

/* === RESPONSIVE === */
@media (max-width: 680px) {
	nav#main-nav {
		max-width: calc(100% - 32px);
		margin-left: 16px;
		margin-right: 16px;
		padding: 12px 16px;
		gap: 12px;
	}
    
	nav#main-nav a {
		font-size: 13px;
		padding: 6px 12px;
	}
    
	#app {
		max-width: calc(100% - 32px);
		margin: 20px 16px 28px;
		padding: 24px;
	}
    
	#app h2 {
		font-size: 22px;
	}
    
	#app h3 {
		font-size: 16px;
	}
	
	#app li {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}
	
	#app li > div:first-child {
		flex: 1 1 auto;
	}
	
	#app li button {
		width: 100%;
	}
	
	#app li ul {
		margin: 10px 0 0 0;
	}
	
	#app li li {
		padding: 10px 12px;
	}
	
	#app li li button {
		width: 100%;
	}
}

@media (max-width: 480px) {
	nav#main-nav {
		gap: 8px;
		padding: 10px 12px;
	}
    
	#app {
		padding: 20px 16px;
		margin: 16px 12px 24px;
	}
    
	#app input,
	#app select,
	#app button {
		font-size: 14px;
		padding: 11px 12px;
	}
    
	#app li {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 12px 14px;
	}
    
	#app li button {
		width: 100%;
		padding: 10px 12px;
		font-size: 13px;
		margin: 4px 0;
	}
	
	#app li ul {
		margin: 8px 0 0 0;
	}
	
	#app li li {
		padding: 8px 10px;
		font-size: 13px;
		margin-bottom: 4px;
	}
}

/* === LOADING STATES === */
.loading {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #e0e7ff;
	border-radius: 50%;
	border-top-color: #2563eb;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}