/* Base e layout */

body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; background: #f0f2f5 url("img/bg_body.jpg"); margin: 0; }
.wrapper { max-width: 1000px; margin: 0 auto; border: 1px solid #ccc; background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

/* HEADER RESPONSIVE */
.nav-global { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; background: #2c3e50; }
.nav-global li { flex: 1 1 auto; text-align: center; }
.nav-global li a { display: block; padding: 15px; color: #ecf0f1; text-decoration: none; font-size: 14px; border-bottom: 1px solid #34495e; }

.header-images { width: 100%; display: flex; flex-direction: column; }
.img-fluid { width: 100%; height: auto; display: block; }

/* Layout */
.content-area { display: flex; min-height: 500px; padding: 25px; gap: 25px; background: url("img/bg_table.jpg"); }
.sidebar { width: 240px; flex-shrink: 0; }
.main-content { flex-grow: 1; background: rgba(255,255,255,0.9); padding: 25px; border-radius: 12px; border: 1px solid #eee; }

.page-title-custom {
    color: #4CAF50;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
    
/* --- STILE USER PROFILE (Il tuo "Nome") --- */
.user-card { 
	background: #fff; 
	padding: 15px; 
	border-radius: 10px; 
	margin-bottom: 20px; 
	border-left: 5px solid #00fa9a;
	box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.user-card .greeting { font-size: 12px; color: #7f8c8d; text-transform: uppercase; display: block; }
.user-card .user-name { font-size: 16px; color: #2c3e50; font-weight: bold; margin-top: 5px; display: block; }

/* Menu Navigazione */
.dashboard-menu { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.dashboard-menu td { background: #00fa9a; border-radius: 6px; padding: 0; transition: 0.2s; }
.dashboard-menu td:hover { filter: brightness(1.1); transform: translateX(5px); }
.dashboard-menu a { text-decoration: none; color: #333; display: block; padding: 12px 15px; font-weight: 600; }

/* Stili per uploadVisualizzaFormPrincipale */
.form-upload {
	border: 2px solid #4CAF50;
	padding: 1em;
	margin: 1.5em auto;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
	max-width: 500px;
	background-color: #f9fff9;
}
.form-input {
	flex: 1;
}
.form-submit {
	text-align: right;
}
.form-message-green {
	color: green;
	font-weight: bold;
	margin-bottom: 1em;
}

/* Stile pulsante generico */
.btn-submit {
	background-color: #4CAF50;
	border: none;
	padding: 0.6em 1em;
	border-radius: 6px;
	cursor: pointer;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 600;
	gap: 0.5em;
	font-family: Arial, sans-serif;
	text-align: center;
}
.btn-submit:hover {
	background-color: #388E3C;
}
.btn-submit svg {
	stroke: white;
	width: 20px;
	height: 20px;
}

/* Stili per file input con anteprima */
.file-input-container {
	position: relative;
	max-width: 400px;
	margin-bottom: 1.5em;
	font-family: inherit;
}
.file-input-label {
	font-size: 1.3rem;
	font-weight: 700;
	color: #2e2e2e;
	user-select: none;
	display: block;
	margin-bottom: 0.5em;
}
.file-input-element {
	width: 100%;
	padding: 0.6em 0.75em;
	border: 3px double #4CAF50;
	border-radius: 8px;
	background-color: #fff;
	color: #2e2e2e;
	font-size: 1rem;
	font-weight: 600;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}
.file-name-display {
	margin-top: 0.5em;
	font-size: 1rem;
	color: #4CAF50;
	font-weight: 600;
	word-break: break-word;
}
.file-preview-image {
	margin-top: 0.5em;
	max-width: 100%;
	max-height: 200px;
	border-radius: 8px;
	box-shadow: 0 3px 6px rgba(0,0,0,0.1);
	object-fit: contain;
	display: none;
}

/* Stile container select con label */
.select-container {
	display: flex;
	flex-direction: column;
	margin-bottom: 1.5em;
	max-width: 400px;
}
.select-label {
	font-size: 1.1rem;
	font-weight: 700;
	margin-bottom: 0.2em;
	color: #2e2e2e;
	user-select: none;
}
.select-wrapper {
	position: relative;
	width: 100%;
}
select.custom-select {
	width: 100%;
	padding: 0.6em 2.5em 0.6em 0.75em; /* spazio per icona a destra */
	border: 3px double #4CAF50;
	border-radius: 8px;
	background-color: #fff;
	color: #2e2e2e;
	font-size: 1rem;
	font-weight: 600;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	box-sizing: border-box;
}
select.custom-select:focus {
	border-color: #388E3C;
	box-shadow: 0 0 8px rgba(56, 142, 60, 0.8);
	outline: none;
}
.select-icon {
	position: absolute;
	top: 50%;
	right: 10px;
	width: 28px;
	height: 28px;
	pointer-events: none;
	transform: translateY(-50%);
	fill: #4CAF50;
}

/* Stili per uploadVisualizzaImportaFilePasso1 e uploadVisualizzaFormPrincipale */
/* Container bottoni */
.form-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	/*margin-top: 1.5em;*/
}
/* Riga form */
.form-row {
	display: flex;
	align-items: center;
	/*margin-bottom: 1.5em;*/
}
/* Label flex */
.form-label {
	flex: 0 0 40%;
	font-weight: bold;
	color: #2e2e2e;
	user-select: none;
}
/* Wrapper input/select flex */
.form-input-wrapper {
	flex: 1;
}
/* Container bottoni */

/* Pulsante secondario */
.btn-secondary {
	background-color: #ccc;
	border: none;
	padding: 0.6em 1em;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 700;
	font-size: 1rem;
	transition: background-color 0.3s ease;
}
.btn-secondary:hover {
	background-color: #bbb;
}
/* Stile container form */
.form-container {
	border: 2px solid #4CAF50;
	padding: 1em;
	margin: 1.5em auto;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
	max-width: 500px;
	background-color: #f9fff9;
	font-family: Arial, sans-serif;
	color: #2e2e2e;
}
/* Stile input text e select */
.form-input-text {
	width: 100%;
	padding: 0.6em;
	border: 3px double #4CAF50;
	border-radius: 8px;
	box-sizing: border-box;
	font-weight: 600;
	font-size: 1rem;
	color: #2e2e2e;
	box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

/* Pulsante submit principale */
.btn-submit {
	background-color: #4CAF50;
	border: none;
	padding: 0.6em 1em;
	border-radius: 6px;
	cursor: pointer;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	color: white;
	font-weight: 700;
	font-size: 1rem;
	transition: background-color 0.3s ease;
}
.btn-submit:hover {
	background-color: #388E3C;
}

/* Container principale */
.container-green-border {
	border: 2px solid #4CAF50;
	padding: 1em;
	margin: 1.5em auto;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
	max-width: 900px;
	background-color: #f9fff9;
	font-family: Arial, sans-serif;
	color: #2e2e2e;
}
/* Container link verticale */
.links-vertical {
	display: flex;
	flex-direction: column;
	max-width: 500px;
	margin: 0 auto 1.5em auto;
}
/* Base per tutti i link */
.link-base {
	text-decoration: underline;
	cursor: pointer;
	transition: color 0.3s ease;
	outline-offset: 2px;
	display: inline-block;
	margin-bottom: 0.8em;
}
/* Link primari verdi grandi */
.link-primary {
	color: #4CAF50;
	font-weight: 700;
	font-size: 1.5rem;
}
.link-primary:hover, .link-primary:focus {
	color: #388E3C;
	text-decoration: none;
	outline: 2px solid #388E3C;
}
/* Link secondari arancioni medi */
.link-secondary {
	color: #FF9800;
	font-weight: 600;
	font-size: 1rem;
}
.link-secondary:hover, .link-secondary:focus {
	color: #e67c00;
	text-decoration: none;
	outline: 2px solid #e67c00;
}
/* Link normali grigi */
.link-normal {
	color: #2e2e2e;
	font-size: 1rem;
}
.link-normal:hover, .link-normal:focus {
	color: #1b1b1b;
	text-decoration: none;
	outline: 2px solid #1b1b1b;
}
.link-manuale {
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-bottom: 0.8em;
    text-align: left;        /* Testo allineato a sinistra */
}
.links-vertical-manuale {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Allinea tutto a sinistra */
    max-width: 500px;
    margin: 0 auto 1.5em 2.5em;  /* margin-right auto per spingerlo a sinistra */
}
.import-summary {
	text-align: center;
	font-weight: 600;
	margin-bottom: 1em;
}
/* Sezione errori duplicati */
.error-duplicate-container {
	margin-top: 2em;
	border-top: 1px solid #ddd;
	padding-top: 1em;
	font-family: Arial, sans-serif;
	font-size: 0.9rem;
}
.error-duplicate-title {
	color: #d32f2f;
	font-weight: 700;
	margin-bottom: 0.5em;
}
.error-duplicate-table {
	width: 100%;
	border-collapse: collapse;
}
.error-duplicate-table th,
.error-duplicate-table td {
	padding: 0.4em 0.5em;
	border: 1px solid #ccc;
}
.error-duplicate-table thead tr {
	background-color: #f0f0f0;
	font-weight: 700;
}
.container-main {
	max-width: 700px;
	margin: 2em auto;
	padding: 1.5em;
	border: 2px solid #4CAF50;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(76,175,80,0.3);
	background: #f9fff9;
	font-family: Arial, sans-serif;
	color: #2e2e2e;
}
table.main-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5em;
}
table.main-table th {
	background: #4CAF50;
	color: #fff;
	font-weight: 700;
	padding: 0.6em;
	text-align: left;
}
table.main-table td {
	padding: 0.5em;
	border-bottom: 1px solid #ddd;
	vertical-align: middle;
}

input[type="submit"].btn-submit {
	font-weight: normal;
	padding: 0.5em 1em;
	border-radius: 6px;
	border: 1px solid #4CAF50;
	background: #4CAF50;
	color: white;
	cursor: pointer;
	transition: background-color 0.3s ease;
}
input[type="submit"].btn-submit:disabled {
	background: #a5d6a7;
	border-color: #a5d6a7;
	cursor: not-allowed;
}

td.checkbox-cell {
	width: 4%;
	text-align: center;
	padding: 0.5em;
	border-bottom: 1px solid #ddd;
	vertical-align: middle;
}
#text1, #text2 {
	display: block;
	font-style: italic;
	margin-top: 1em;
}

footer { background: #fdfdfd; padding: 20px; text-align: center; border-top: 1px solid #eee; color: #95a5a6; font-size: 11px; }
/* --- MEDIA QUERIES PER TABLET E SMARTPHONE --- */
@media (max-width: 768px) {
	.content-area { flex-direction: column; padding: 10px; } /* Sidebar sopra, contenuto sotto */
	.sidebar { width: 100%; }
	.nav-global li { flex: 1 1 50%; } /* Menu alto su due colonne su mobile */
	.main-content { margin-top: 10px; }
	.user-card { text-align: center; border-left: none; border-top: 5px solid #00fa9a; }
}

@media (max-width: 480px) {
	.nav-global li { flex: 1 1 100%; } /* Menu alto una voce per riga su smartphone piccoli */
	.dashboard-menu a { padding: 20px; font-size: 18px; } /* Tasti più grandi per touch */
}

/* Nascondi il checkbox originale */
.custom-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Contenitore della label */
.custom-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    color: #333;
}

/* Il "finto" checkbox quadrato */
.checkmark {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    transition: all 0.2s ease-in-out;
}

/* Effetto hover */
.custom-label:hover input ~ .checkmark {
    border-color: #4CAF50;
}

/* Sfondo quando il checkbox è selezionato */
.custom-label input:checked ~ .checkmark {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

/* Il segno di spunta (creato con i bordi ruotati, nascosto di default) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Mostra il segno di spunta quando selezionato */
.custom-label input:checked ~ .checkmark:after {
    display: block;
}

/* Il contenitore dell'interruttore */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-right: 10px;
}

/* Nascondi il checkbox originale */
.toggle-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

/* Lo sfondo dell'interruttore */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

/* Il cerchietto bianco (pallino) dell'interruttore */
.toggle-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);
}

/* Colore verde quando attivato */
.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
}

/* Sposta il cerchietto verso destra quando attivato */
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Contenitore per allineare testo e switch */
.toggle-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

/* Select multiplo */
select[multiple] {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    padding: 5px;
    font-size: 14px;
    min-height: 120px;
}

select[multiple]:focus {
    outline: none;
    border-color: #4CAF50;
}

.btn-delete {
    background-color: #e74c3c !important;
    border-color: #c0392b !important;
    color: white !important;
}

.btn-delete:hover {
    background-color: #c0392b !important;
    border-color: #a93226 !important;
}

/* Link secondari arancioni medi */
.link-delete {
	color: #e74c3c;
	font-weight: 600;
	font-size: 1rem;
}
.link-delete:hover, .link-delete:focus {
	color: #c0392b;
	text-decoration: none;
	outline: 2px solid #a93226;
}


/* --- BLU PETROLIO (Elegante e bilanciato) --- */
.btn-credits {
    background-color: #2980b9 !important; /* Blu professionale */
    border: 1px solid #2471a3 !important;
}

.btn-credits:hover {
    background-color: #1f618d !important; /* Più scuro al passaggio del mouse */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}