/* Container esterno admin e titolo lista */
.admin-outer-container {
	max-width: 1400px;
	margin: 20px auto;
	padding: 0 20px;
}
.lista-titolo {
	margin-top: 30px;
}
/* Benvenuto testo */
.benvenuto-testo {
	text-align: center;
	color: #333;
}
/* Login logo container e logo */
.login-logo-container {
	text-align: center;
	margin-bottom: 30px;
}
.login-logo {
	max-width: 220px;
	height: auto;
}
body {
	font-family: Arial, Helvetica, sans-serif;
	background: #f5f5f5;
	margin: 0;
	padding: 20px;
	color: #222;
}
h1, h2, h3 {
	color: #007bff;
	margin-bottom: 10px;
}
hr {
	margin: 25px 0;
	border: none;
	border-top: 1px solid #ccc;
}
.menu-container,
.login-container {
	max-width: 400px;
	margin: 0 auto;
	padding: 25px;
	background: white;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
	width: 360px;
}
.login-stato-caricamento {
	margin: 10px 0 0 0;
	text-align: center;
	font-size: 14px;
	color: #666;
	min-height: 1.2em;
}
/* Ricordami: stesso stile checkbox del foglio lavoro */
.login-ricordami {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0 14px 0;
	font-size: 13px;
	font-weight: bold;
	cursor: pointer;
}
.login-ricordami input[type="checkbox"] {
	width: 18px;
	height: 18px;
	min-width: 18px;
	margin: 0;
	cursor: pointer;
}
.login-password-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
}
.login-password-wrap input {
	flex: 1;
	min-width: 0;
}
.login-toggle-pwd {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #f8f8f8;
	cursor: pointer;
	color: #555;
}
.login-toggle-pwd:hover:not(:disabled) {
	background: #eee;
	border-color: #999;
}
.login-toggle-pwd:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.login-toggle-pwd svg {
	flex-shrink: 0;
}
.menu-wrapper {
	display: flex;
	gap: 14px;
	justify-content: center;
	align-items: center;
	flex-direction: column;
}
.menu-title {
	margin: 0 0 12px 0;
	text-align: center;
	color: #007bff;
	font-size: 16px;
}
.menu-container button {
	display: block;
	width: 100%;
	margin-bottom: 12px;
}
#archivioContainer,
#archivioSettimanaleContainer,
#listaClienti,
#listaUtenti {
	background: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
select,
textarea {
	width: 100%;
	padding: 10px;
	margin: 6px 0 12px 0;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 15px;
	box-sizing: border-box;
}
textarea {
	height: 120px;
	resize: vertical;
}
button {
	background: #007bff;
	color: white;
	padding: 10px 18px;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	cursor: pointer;
	margin: 5px 0;
	transition: background 0.2s;
}
#topBar {
	position: static;
	width: 100%;
	height: 45px;
	background: #f5f5f5;
	color: #333;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 0 10px;
	border-bottom: 1px solid #ccc;
	box-sizing: border-box;
	gap: 8px;
}
#topBar button,
#topBar button.topbar-btn {
	padding: 6px 12px !important;
	background: #007bff !important;
	color: white !important;
	border: none !important;
	border-radius: 6px !important;
	cursor: pointer !important;
	flex: 0 0 auto !important;
	width: auto !important;
	min-width: 140px !important;
	text-align: center !important;
	font-size: 13px !important;
	margin: 0 !important;
	line-height: 1.2 !important;
	white-space: nowrap !important;
}
#topBar button:hover {
	background: #007bff;
}
.admin-container {
	display: flex;
	gap: 30px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
}
.admin-column {
	flex: 1;
	background: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.admin-column h2 {
	margin-top: 0;
	color: #007bff;
	border-bottom: 2px solid #007bff;
	padding-bottom: 10px;
}
.admin-column h3 {
	color: #007bff;
	font-size: 18px;
	margin-top: 25px;
	margin-bottom: 15px;
}
.admin-column input,
.admin-column select {
	display: block;
	width: 100%;
	padding: 10px;
	margin-bottom: 8px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	box-sizing: border-box;
}
.admin-column .field-stack {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 0;
}
.admin-column .field-stack > input,
.admin-column .field-stack > select {
	margin-bottom: 0;
}
.admin-column .field-row {
	display: flex;
	gap: 8px;
	margin-bottom: 0;
}
.admin-column .field-row > input {
	margin-bottom: 0;
}
.admin-column button {
	width: 100%;
	margin-bottom: 20px;
}
#listaClienti,
#listaUtenti {
	padding: 0;
	border-radius: 0;
	border-left: none;
	background: transparent;
}
#listaClienti > div,
#listaUtenti > div {
	background: white;
	padding: 12px;
	margin-bottom: 12px;
	border-left: 4px solid #007bff;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#listaClienti > div:last-child,
#listaUtenti > div:last-child {
	margin-bottom: 0;
}
@media (max-width: 1024px) {
	.admin-container {
		flex-direction: column;
		gap: 20px;
	}
}
button.no-save {
	background: #cc0000;
}
button.no-save:hover {
	background: #ff3333;
}
table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}
table th {
	background: #007bff;
	color: white;
	padding: 10px;
	text-align: left;
}
table td {
	padding: 8px;
	border-bottom: 1px solid #ddd;
}

/* Tabelle archivi (fogli e settimanali): bordi e righe unificati */
.tabella-archivio {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
	font-size: 14px;
	border: 1px solid #dee2e6;
}
.tabella-archivio th,
.tabella-archivio td {
	border: 1px solid #dee2e6;
	padding: 6px 8px;
	text-align: left;
	vertical-align: middle;
}
.tabella-archivio th {
	background: #007bff;
	color: white;
	font-weight: 600;
}
.tabella-archivio tbody tr:hover {
	background: #f8f9fa;
}
.tabella-archivio tbody tr.riga-non-letta:hover {
	background: #e8f4ff;
}
canvas {
	border: 2px solid #007bff;
	border-radius: 6px;
	background: white;
	width: 100%;
	height: 150px;
}
.cst-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	backdrop-filter: blur(3px);
	justify-content: center;
	align-items: center;
	z-index: 10000;
}
.cst-modal-content {
	background: white;
	padding: 25px;
	border-radius: 12px;
	min-width: 320px;
	max-width: 500px;
	text-align: center;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	animation: cstSlideIn 0.3s ease-out;
}
.cst-modal-icon {
	font-size: 48px;
	margin-bottom: 15px;
}
.cst-modal-icon-warn {
	color: #ffc107;
}
.cst-modal-title {
	margin: 0 0 10px 0;
	color: #007bff;
}
.cst-modal-message {
	margin: 0 0 20px 0;
	color: #555;
}
.cst-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}
.cst-modal-input {
	width: 100%;
	padding: 10px;
	margin-bottom: 20px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 15px;
	box-sizing: border-box;
}
.cst-btn {
	color: white;
	border: none;
	padding: 10px 30px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 15px;
}
.cst-btn-primary {
	background: #007bff;
}
.cst-btn-secondary {
	background: #6c757d;
}
@keyframes cstSlideIn {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
@keyframes slideIn {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
@media (max-width: 600px) {
	body {
		padding: 10px;
	}
	.menu-container,
	.login-container {
		padding: 15px;
	}
	.menu-wrapper {
		flex-direction: column;
		align-items: stretch;
		flex-wrap: wrap;
	}
	button {
		width: 100%;
	}
}
.pagina {
	margin-top: 20px !important;
}
#contenutoFoglio {
	margin-top: 20px !important;
}

/* Badge "Nuovo" e riga non letta in archivio in lavorazione */
.badge-nuovo {
	display: inline-block;
	background: #007bff;
	color: white;
	font-size: 11px;
	font-weight: bold;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
}
.badge-letto {
	display: inline-block;
	background: #28a745;
	color: white;
	font-size: 11px;
	font-weight: bold;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
}
.riga-non-letta {
	background: #e8f4ff !important;
}
.riga-non-letta td {
	font-weight: 500;
}

/* Badge conteggio non letti sulla home: a fianco alla scritta, senza decentrare */
.btn-con-badge {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
}
.btn-con-badge .archivio-badge {
	margin-left: 0;
}
.archivio-badge {
	display: none;
	min-width: 20px;
	height: 20px;
	line-height: 20px;
	padding: 0 6px;
	margin-left: 8px;
	background: #dc3545;
	color: white;
	font-size: 12px;
	font-weight: bold;
	border-radius: 10px;
	vertical-align: middle;
}
.archivio-badge.visible {
	display: inline-block;
}

/* Cella azioni archivio: pulsanti allineati a destra con stessa spaziatura */
.cell-azioni-archivio {
	display: flex !important;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 6px;
}
.cell-azioni-archivio .azioni-sx {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}
/* Colonna Azioni: larghezza ridotta al contenuto (pulsanti in linea, senza sovrapposizioni) */
.tabella-archivio td.cell-azioni-archivio {
	white-space: nowrap;
	width: 1%;
	box-sizing: border-box;
	min-width: max-content;
}
.tabella-archivio th:last-child {
	white-space: nowrap;
	width: 1%;
	box-sizing: border-box;
}
/* Pulsante Archivia (archivio definitivo): verde */
.btn-archivia-definitivo {
	background: #28a745 !important;
	color: white !important;
	border-color: #28a745 !important;
}
.btn-archivia-definitivo:hover {
	background: #218838 !important;
	color: white !important;
}
/* Pulsante Elimina in archivio: rosso */
.btn-elimina-archivio {
	background: #dc3545 !important;
	color: white !important;
	border-color: #dc3545 !important;
}
.btn-elimina-archivio:hover {
	background: #c82333 !important;
	color: white !important;
}