@use "sass:color";

// my variables
@use "variables";

// other libraries
@use "lib/jquery-ui.min";

// my styles
@use "bs.custom";

$table-bg: variables.$body-background;
$table-striped-bg: color.adjust(variables.$beige, $lightness: -5%);
$table-hover-bg: variables.$beige;


html {
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape while allowing user zoom */
}

body {
	font-family: variables.$adminFontFamily;
	font-size : 14px;
	color: #000;
	background-color: #fff;
	
	margin: 0px;
	padding: 0;
	
	line-height: 1.6em;
}

::selection {
    background-color: variables.$green;
    color: white;
}

/* le ancore */
a {
	color: variables.$link_color;
	text-decoration: underline;
}

a:visited {
	color: variables.$link_visited_color;
}

a:hover {
	color: variables.$link_hover_color;
}

p {

}

h3 {
	font-size: 1.5em;
	color: #6B8E23 !important;
}

#admin-content li {

}

#admin-content h3 {
	font-size: 1em !important;	
	border-bottom: 2px solid #eee;
	margin-bottom: 3px;
}

div.form {
	margin: 1px auto;
	width: 100%;
}

div.form-buttons {
	margin: 15px 10px 0 0;
	padding: 5px;
	text-align: right;
}

.form-control {
	border: 1px solid color.adjust(variables.$beige, $lightness: -20%);
	width: auto !important;
	background-color: #fff !important;
}

.form-select {
	border: 1px solid color.adjust(variables.$beige, $lightness: -20%);
	width: auto !important;
	background-color: #fff !important;
}

@media (min-width: 768px) {
	
	div.form-item {
		margin: 1px auto;
		clear: both;
		padding-bottom: 5px;
		text-align: left;
	}

	div.form-item label {
		float: left;
		width: 15%;
		text-align: right;
		margin-right: 10px;
	}

	div.form-item input, div.form-item textarea {
		max-width: 500px;
		/*min-width: 400px;		*/
	}
	
	div.form-item span.value {
		margin-left: 5px;
		padding-top: 5px;
		float: left;
		text-align: left;
		color: #4C4C4C;
		width: 74%;
	}
		
}

@media (max-width: 768px) {
	
	div.form-item {
		margin: 1px auto;
		clear: both;
		padding-bottom: 0px;
		text-align: left;
	}

	div.form-item label {
		float: left;
		width: inherit;
		text-align: left;
		margin-right: 0px;
	}

	div.form-item label:after {
		content: ':';
	}
	
	div.form-item span.value {
		margin-left: 5px;
		padding-top: 5px;
		float: left;
		text-align: left;
		color: #4C4C4C;
	}
		
}


div.upload {
	float: left;
	margin-left: 5px;
}

@media (max-width: 768px) {
	div.upload > img {
		width: 100%;
	}	
}

div.upload p {
	margin: 0 0 3px 0;
	padding: 0px;
}

div.upload p img {
	cursor: pointer;
}


label {
	padding-top: 5px;
}

label.required {
	font-weight: bold;
}

input.number {
	text-align: right;
	width: 100px;
}


/* form login */

#box-login {
	text-align: center;
	width: 300px;
	margin: 30px auto;
	padding: 10px;
}

#box-login input#user_userid, #box-login input#user_password {
	margin-bottom: 5px;
	width: 10em;
}

#box-login input.submit {
	position: relative;
	margin-top: 10px;
}

#box-login label {
	display: block;
	text-align: right;
	margin-right: 5px;
}


#admin-content {
	margin-top: 10px;
	margin-left: 20px;
	float: left;
	width: 80%;
}


/*
#admin-menu {
	float: left;
	width: 20%;
	min-height: 100%;
}

#admin-menu ul {
	margin: 0px 0px 0px 10px;
	padding: 0px;
}

#admin-menu ul li {
	list-style-type: none;
	margin: 0px;
	font-size: .9em !important;
	width: 100%;
	text-align: left;
}

#admin-menu ul li a {
	display: block;
	padding: 4px;
	border: 1px solid transparent;
	-moz-border-radius: 5px;
}

#admin-menu ul li a:hover {
	color: #fff;
	-moz-border-radius: 5px;
	border: 1px solid #4B3E20;
	background-color: #4B3E20;
}
*/

/*
#header-wrapper {
	background-color: #000;
	
	opacity:.30;
	filter: alpha(opacity=30);
	-moz-opacity: 0.30;
}
*/

#header {
	display: none;
	color: #fff;
	background-color: #408000;
	text-align: left;
	border-bottom: 2px solid #D9D9AE;
	margin-bottom: 0px;
	height: 30px;
	
	/*
	background: url(/images/adminbg.png);
	*/
}

#header a:hover {
	background-color: transparent;
}

#admin #header h1 {
	font-family: Verdana;
	margin: 0px;
	color: #fff;
	float: left;
	margin-top: 3px;
	margin-left: 15px;
	font-size: 1.3em;
}

#admin #header .info {
	font-size: 1em;
	float: right;
	color: #fff;
	padding-right: 10px;
	padding-left: 10px;
}
#admin #header .info p {
	padding: 5px;
	margin: 0px;
}
	
#admin #header .info a {

}



/* stili della pagina di edit e list */
.col-visible, .col-actions {
	text-align: center;
}

.col-actions > .btn{
	margin: 0 3px;
	padding: 2px 8px;
	line-height: 1.3;
}




.error-dialog {
	text-align: center;
}



#admin-actions {
	margin: 0px 0px 10px 0px;
}

#admin-actions select {

	@media (min-width: 768px) {
		min-width: 200px;
	}
		
	@media (max-width: 768px) {
		width: 300px !important;
		max-width: 100%;
	}
}

.checkbox-cell {
	text-align: center
}


.disabledicon {
	opacity: 0.40;
	-moz-opacity: 0.40; /* older Gecko-based browsers */
	filter:alpha(opacity=40); /* For IE6&7 */	
}


fieldset {
	border: 1px solid #d9d9ae;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
}

fieldset legend {
	font-size: .85em;
}


.select-checkbox {
	width: 20px;
	text-align: center;
}

.ui-autocomplete {
	font-size: .9em;	
}

table {
	border: none;
	background-color: transparent !important;
}

td, th {
	border: none;
	background-color: transparent !important;
	padding: 0.2rem 0.5rem;
	line-height: 1.3em;
}
th {
	border-bottom: 2px solid black;
}


#category_order {
	width: 500px;
}	

#category_order li {
	width: 150px;
	margin-right: 10px;
	float: left;
	text-align: center;
}

#category_order li img {
	width: 90%;
}



#admin-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

#admin-menu {
	margin-top: 10px;
	float: left;
	width: 150px;
	margin-left: 10px;
}

#admin-menu li {
	padding: 5px 0px 0px 10px;
}

#admin-menu li a {
	font-size: 90%;
	padding: 0px;
	display: block;
	border: 1px solid transparent;
}

#admin-menu li a:hover {
}

#admin-menu li a.current {
	font-weight: bold;
	text-decoration: underline;
}


.toggler {
	cursor: pointer;
	margin: 10px 0px 1px 0px;
	color: #000;
	padding: 2px 2px 2px 2px;
	font-weight: normal;
	font-size: 1.2em;
	border-bottom: 1px solid black;
}

.element {

}

.element p {
	margin: 0;
	padding: 4px;
}

.float-right {
	padding:10px 20px;
	float:right;
}



.sidebar-casaparrina  {

	padding: 0px;

	.nav > li > a {
		padding: 2px 10px 0px 10px;
		font-size: 15px;
		color: color.adjust(variables.$beige, $lightness: -50%);
		text-decoration: normal;
	}

	.nav > li > a:hover, .nav > li > a:focus {
	    background-color: color.adjust(variables.$beige, $lightness: -5%);
	}
	
	.nav-sidebar-title {
		font-size: 16px;
		padding: 2px 10px 0px 10px;
		background-color: color.adjust(variables.$beige, $lightness: -5%);
	}
}

.nav > li > a {
    position: relative;
    display: block;
    padding: 5px 5px;
}


#admin-header {
	
}

#admin-header .container-fluid {
	
}

#admin-page-content {
	padding: 15px;
}

@media (max-width: 768px) {
    .form-control {
        width: 100%;
    }
}


.dropdown-menu  {
    background-color: #fff;	
}

.dropdown-menu  a {
    color: #000;	
}



.datepicker th, .datepicker td {
	border: none;
}


@media (max-width: 768px) {
	.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
		padding: 3px;
	}
}


.sidebar-heading {
	font-size: 1.2em;
	font-weight: 600;
	// background-color: $beige;
	color: variables.$green !important;
	text-decoration: underline;
}

a.nav-link {
	font-size: 1.1em;
}

.flatpickr-day.selected {
	background-color: variables.$green !important;
	border-color: variables.$green !important;	
}


.navbar {
    border-radius: none;
	border: none;
	padding: 0px;
	background-color: variables.$beige;
}
  
.navbar .nav-link {
	color: #5a4a42 !important; /* Colore testo */
}

.navbar .nav-link:hover {
	color: #8a6f5a !important;
}

// .table {
// 	--bs-table-bg: variables.$beige !important; /* Sfondo tabella */
// 	--bs-table-border-color: variables.$beige !important; /* Bordo tabella */
// }

.table-striped tbody tr:nth-of-type(odd) {
	background-color: variables.$beige !important; /* Alternanza righe */
}
.bg-body-tertiary {
	background-color: variables.$beige !important; /* Alternanza righe */	
}




/* =====================================================================
   DASHBOARD SHELL (sidebar scura + topbar + contenuto a card)
   ===================================================================== */
$adm-bg: #F3F5F7;
$adm-side: #1F2A17;
$adm-side-hover: rgba(255,255,255,.07);
$adm-accent: #D9A23A;
$adm-border: #E3E7EB;
$adm-text: #1F2933;
$adm-muted: #6B7785;
$adm-side-w: 248px;
$adm-top-h: 56px;

body { background: $adm-bg; color: $adm-text; font-size: 14px; }
body a { text-decoration: none; }
body a:visited { color: inherit; }
a { color: variables.$green; }
a:hover { color: variables.$link_hover_color; }

/* ---- topbar ---- */
.adm-topbar { position: fixed; top: 0; left: 0; right: 0; height: $adm-top-h; z-index: 1030; display: flex; align-items: center; gap: 14px; padding: 0 20px 0 20px; background: #fff; border-bottom: 1px solid $adm-border; }
@media (min-width: 992px) { .adm-topbar { left: $adm-side-w; } }
.adm-burger { border: 0; background: transparent; font-size: 20px; color: $adm-text; padding: 6px 8px; }
.adm-brand img { height: 26px; display: block; }
.adm-topbar-title { display: flex; align-items: center; gap: 10px; font-size: 14px; color: $adm-muted; }
.adm-topbar-title strong { color: $adm-text; font-weight: 600; }
.adm-topbar-title i { font-size: 10px; }
.adm-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.adm-top-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: $adm-text !important; font-size: 14px; }
.adm-top-link:hover { background: $adm-bg; }
.adm-user { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 600; }
.adm-avatar { width: 32px; height: 32px; border-radius: 50%; background: variables.$green; color: #F6F1E6; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* ---- sidebar ---- */
.adm-sidebar { background: $adm-side; color: #D8DCCE; width: $adm-side-w; --bs-offcanvas-width: #{$adm-side-w}; --bs-offcanvas-bg: #{$adm-side}; --bs-offcanvas-color: #D8DCCE; }
@media (min-width: 992px) { .adm-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; display: flex; flex-direction: column; overflow-y: auto; } }
.adm-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: $adm-top-h; border-bottom: 1px solid rgba(255,255,255,.08); flex: none; }
.adm-sidebar .adm-brand img { height: 30px; width: auto; box-sizing: content-box; padding: 4px 10px; border-radius: 8px; background: variables.$beige; } /* il logo del sito ha lo sfondo chiaro: sul verde scuro sta su una targhetta beige */
.adm-nav { display: flex; flex-direction: column; padding: 14px 12px 32px; gap: 2px; overflow-y: auto; }
.adm-nav-group { display: flex; align-items: center; gap: 10px; margin: 20px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8E9884; }
.adm-nav-group i { width: 16px; text-align: center; font-size: 12px; }
.adm-nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #D8DCCE !important; font-size: 14px; line-height: 1.3; }
.adm-nav-link:hover { background: $adm-side-hover; color: #fff !important; }
.adm-nav-link i { width: 16px; text-align: center; opacity: .85; }
.adm-nav-sub { padding-left: 38px; font-size: 13.5px; color: #B9C0AE !important; }
.adm-nav-link.current { background: rgba(217,162,58,.16); color: #fff !important; box-shadow: inset 3px 0 0 $adm-accent; font-weight: 600; }

/* ---- main ---- */
.adm-main { padding-top: $adm-top-h; min-height: 100vh; }
@media (min-width: 992px) { .adm-main { margin-left: $adm-side-w; } }
.adm-content { padding: 28px 28px 56px; max-width: 1500px; }
@media (max-width: 575.98px) { .adm-content { padding: 18px 14px 40px; } }

.adm-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.adm-pagehead h1 { font-size: 26px; font-weight: 700; margin: 0; color: $adm-text; font-family: variables.$adminFontFamily; letter-spacing: -.01em; }
.adm-pagehead p { margin: 4px 0 0; color: $adm-muted; }

/* ---- KPI ---- */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.adm-kpi { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid $adm-border; border-radius: 14px; padding: 18px 20px; color: $adm-text !important; transition: box-shadow .15s, transform .15s; }
.adm-kpi:hover { box-shadow: 0 6px 18px rgba(31,41,51,.08); transform: translateY(-1px); }
.adm-kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.adm-kpi-body strong { display: block; font-size: 28px; line-height: 1; font-weight: 700; }
.adm-kpi-body small { display: block; margin-top: 6px; color: $adm-muted; font-size: 13px; }
.adm-kpi--warn .adm-kpi-icon { background: #FFF3DC; color: #B7791F; }
.adm-kpi--danger .adm-kpi-icon { background: #FDE8E8; color: #C53030; }
.adm-kpi--ok .adm-kpi-icon { background: #E3F5E8; color: #2F855A; }
.adm-kpi--info .adm-kpi-icon { background: #E3EEFB; color: #2B6CB0; }

/* ---- card ---- */
.adm-card { background: #fff; border: 1px solid $adm-border; border-radius: 14px; margin-bottom: 22px; overflow: hidden; }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid $adm-border; }
.adm-card-head h2 { font-size: 16px; font-weight: 600; margin: 0; color: $adm-text; font-family: variables.$adminFontFamily; letter-spacing: 0; }
.adm-badge { min-width: 26px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; background: #EDF0F3; color: $adm-muted; }
.adm-badge--warn { background: #FFF3DC; color: #B7791F; }
.adm-badge--danger { background: #FDE8E8; color: #C53030; }
.adm-badge--ok { background: #E3F5E8; color: #2F855A; }
.adm-empty { margin: 0; padding: 26px 20px; color: $adm-muted; text-align: center; }
.adm-quick-body { padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.adm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 22px; }
.adm-two > .adm-card { margin-bottom: 22px; }
.adm-cal { padding: 0; }
.adm-gift { font-size: 1.3em; color: #C53030; }
.adm-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: $adm-bg; font-size: 12px; font-weight: 600; }
.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-top: 1px solid $adm-border; }
.adm-list li:first-child { border-top: 0; }
.adm-list-date { color: $adm-muted; font-size: 13px; min-width: 120px; }
.adm-list-main { flex: 1; font-weight: 600; }

/* ---- tabelle (dashboard + pagine elenco) ---- */
.adm-content .table, .adm-table { --bs-table-bg: transparent; --bs-table-striped-bg: transparent; --bs-table-hover-bg: #F7F9FA; width: 100%; margin-bottom: 0; font-size: 14px; }
.adm-content .table > :not(caption) > * > * { padding: 5px 12px; border-bottom: 1px solid $adm-border; }
.adm-content .table > thead > tr > th, .adm-table thead th { background: #F8FAFB; color: $adm-muted; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid $adm-border; white-space: nowrap; }
.adm-content .table-striped > tbody > tr:nth-of-type(odd) { background-color: transparent !important; }
.adm-content .table-hover > tbody > tr:hover > *, .adm-table--click tbody tr:hover > * { background: #F7F9FA; }
.adm-table--click tbody tr { cursor: pointer; }
.adm-content table:not(.adm-table) { background: #fff; border: 1px solid $adm-border; border-radius: 12px; overflow: hidden; }

/* ---- pagine elenco / form esistenti ---- */
.adm-content h3 { font-size: 18px !important; font-weight: 600; color: $adm-text !important; border: 0 !important; margin: 24px 0 12px; font-family: variables.$adminFontFamily; }
.adm-content h1, .adm-content h2 { font-family: variables.$adminFontFamily; font-weight: 700; color: $adm-text; letter-spacing: 0; }
.adm-content h2 { font-size: 22px; }
.adm-content #admin-actions { background: #fff; border: 1px solid $adm-border; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; align-items: center; }
.adm-content .form-control, .adm-content .form-select { border: 1px solid #D5DBE1; border-radius: 8px; background-color: #fff !important; }
.adm-content .form-control:focus, .adm-content .form-select:focus { border-color: variables.$green; box-shadow: 0 0 0 3px rgba(47,58,34,.15); }
.adm-content .btn { border-radius: 8px; font-weight: 500; }
.adm-content .btn-primary { background: variables.$green; border-color: variables.$green; color: #fff !important; }
.adm-content .btn-primary:hover { background: #3d4b2d; border-color: #3d4b2d; }
.adm-content div.form { background: #fff; border: 1px solid $adm-border; border-radius: 14px; padding: 20px 22px; }
.adm-content .alert { border-radius: 10px; }
/* la paginazione si stacca dalla tabella sopra (le tabelle hanno margin-bottom: 0) */
.adm-content .pagination { margin: 22px 0 10px; flex-wrap: wrap; row-gap: 6px; }
.adm-content .pagination .page-link { color: variables.$green; border-radius: 8px; margin: 0 2px; }
.adm-content .pagination .active .page-link { background: variables.$green; border-color: variables.$green; color: #fff; }

/* neutralizza il vecchio stile della navbar/sidebar */
.bg-body-tertiary { background-color: transparent !important; }

/* Bootstrap .offcanvas-lg azzera sfondo e larghezza da lg in su: li riaffermiamo */
.adm-sidebar { background-color: $adm-side !important; color: #D8DCCE !important; }
@media (min-width: 992px) {
	.adm-sidebar { width: $adm-side-w !important; height: 100vh !important; }
}
@media (max-width: 991.98px) {
	.adm-sidebar { width: $adm-side-w; }
}


/* =====================================================================
   COERENZA PALETTE (verde scuro + miele) tra sidebar e contenuto
   ===================================================================== */
$adm-green: variables.$green;

/* tabelle senza <thead>: la riga di intestazione e' dentro il tbody */
.adm-content table.table { background: #fff !important; --bs-table-bg: #fff; border-collapse: separate; border-spacing: 0; border: 1px solid $adm-border; border-radius: 14px; overflow: hidden; }
.adm-content table.table th { background: #F8FAFB; color: $adm-muted; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border-bottom: 1px solid $adm-border; }
.adm-content table.table td { background: #fff; vertical-align: middle; color: $adm-text; }
.adm-content table.table tr:last-child td { border-bottom: 0; }
.adm-content table.table-hover tr:hover td { background: #F7F9FA; }
.adm-content table.table td a { color: $adm-green; font-weight: 500; }
.adm-content table.table td a:hover { text-decoration: underline; }
.adm-content table.table .fa-credit-card, .adm-content table.table .fa-truck { color: $adm-muted; }
.adm-content input[type=checkbox] { accent-color: $adm-green; width: 16px; height: 16px; }

/* badge di stato: stile "soft" */
.adm-content .badge { font-size: 12px !important; font-weight: 600; padding: 6px 10px; border-radius: 999px; }
.adm-content .badge.text-bg-success { background-color: #E3F5E8 !important; color: #1E6B43 !important; }
.adm-content .badge.text-bg-primary { background-color: #E3EEFB !important; color: #2B6CB0 !important; }
.adm-content .badge.text-bg-warning { background-color: #FFF3DC !important; color: #8A5A00 !important; }
.adm-content .badge.text-bg-danger  { background-color: #FDE8E8 !important; color: #B42318 !important; }
.adm-content .badge.text-bg-secondary { background-color: #EDF0F3 !important; color: $adm-muted !important; }

/* bottoni coerenti: neutri/outline, primario verde, accento miele */
.adm-content .btn { background-image: none !important; box-shadow: none; }
.adm-content .btn-default, .adm-content .btn-info, .adm-content .btn-light, .adm-content .btn-secondary {
	background: #fff !important; border: 1px solid #D5DBE1 !important; color: $adm-text !important; }
.adm-content .btn-default:hover, .adm-content .btn-info:hover, .adm-content .btn-secondary:hover { background: #F3F5F7 !important; border-color: #BFC7CF !important; }
.adm-content .btn-warning { background: #FFF3DC !important; border: 1px solid #F1D9A3 !important; color: #8A5A00 !important; }
.adm-content .btn-warning:hover { background: #FBE7BD !important; }
.adm-content .btn-success, .adm-content .btn-green, .adm-content .btn-primary { background: $adm-green !important; border: 1px solid $adm-green !important; color: #fff !important; }
.adm-content .btn-success:hover, .adm-content .btn-green:hover, .adm-content .btn-primary:hover { background: #3d4b2d !important; border-color: #3d4b2d !important; }
.adm-content .btn-danger { background: #FDE8E8 !important; border: 1px solid #F5BDBD !important; color: #B42318 !important; }
.adm-content .btn-danger:hover { background: #FAD4D4 !important; }
.adm-content .btn-group > .btn { border-radius: 0; }
.adm-content .btn-group > .btn:first-child { border-radius: 8px 0 0 8px; }
.adm-content .btn-group > .btn:last-child { border-radius: 0 8px 8px 0; }
.adm-content .btn-group > .btn:only-child { border-radius: 8px; }
.adm-content .btn-sm { padding: 5px 10px; font-size: 13px; }
.adm-content .btn i { color: inherit; }

/* breadcrumb, scrollbar sidebar */
.adm-topbar-title .adm-crumb { margin-right: 2px; }
.adm-topbar-title i { margin: 0 8px; }
.adm-sidebar, .adm-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.adm-sidebar::-webkit-scrollbar, .adm-nav::-webkit-scrollbar { width: 8px; }
.adm-sidebar::-webkit-scrollbar-track, .adm-nav::-webkit-scrollbar-track { background: transparent; }
.adm-sidebar::-webkit-scrollbar-thumb, .adm-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 8px; }

/* topbar e sidebar sullo stesso filo: accento miele e verde */
.adm-topbar { border-bottom: 2px solid $adm-accent; }
.adm-sidebar-head { background: rgba(0,0,0,.12); }
.adm-avatar { background: $adm-green; box-shadow: 0 0 0 2px $adm-accent; }


/* =====================================================================
   FORM DI MODIFICA (comuni a tutti gli oggetti)
   ===================================================================== */
$adm-label-w: 190px;
$adm-label-gap: 16px;

/* i form semplici sono una card unica; quelli a sezioni usano .adm-card */
.adm-content form:has(> .form-item) { background: #fff; border: 1px solid $adm-border; border-radius: 14px; padding: 22px 22px 8px; margin-bottom: 22px; }
.adm-card-body { padding: 20px 20px 8px; }
.adm-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 22px; align-items: start; }
@media (max-width: 1199.98px) { .adm-form-layout { grid-template-columns: minmax(0, 1fr); } }

/* etichetta a sinistra, tutto il resto (campi, unita', bottoni, note) nella colonna di destra */
.adm-content .form-item { display: flow-root; clear: both; margin: 0 0 12px; padding: 0 0 0 ($adm-label-w + $adm-label-gap); text-align: left; }
.adm-content .form-item > label { float: left; width: $adm-label-w; margin: 0 0 0 (-($adm-label-w + $adm-label-gap)); padding-top: 7px; text-align: right; color: $adm-muted; font-weight: 500; line-height: 1.3; }
.adm-content .form-item > div[style*="clear"] { display: none; }

.adm-content .form-item input.form-control:not([type=file]):not(.number):not(.adm-narrow):not([style*="width"]),
.adm-content .form-item textarea.form-control:not([style*="width"]) { display: inline-block; width: 100% !important; max-width: 720px; vertical-align: top; }
.adm-content .form-item input.number, .adm-content .form-item input.adm-narrow { display: inline-block; }
.adm-content .form-item input.number { width: 110px !important; }
.adm-content .form-item input.adm-narrow { width: 220px !important; }
.adm-content .form-item input.datetimepicker { max-width: 260px !important; }
.adm-content .form-item input[type=file] { display: block; width: 100% !important; max-width: 720px; }
.adm-content .form-item .form-select { display: inline-block; min-width: 220px; }
.adm-content .form-item input[type=checkbox] { margin-top: 9px; }
.adm-content .form-item .btn { vertical-align: baseline; }

/* i bottoni di salvataggio restano a portata di mano sui form lunghi */
.adm-content div.form-buttons { position: sticky; bottom: 0; z-index: 10; margin: 0 0 14px; padding: 12px 0; text-align: right; background: linear-gradient(to top, $adm-bg 70%, rgba(243,245,247,0)); }
.adm-content form:has(> .form-item) > div.form-buttons { background: #fff; border-top: 1px solid $adm-border; margin: 18px 0 0; }

/* colonna laterale: etichette sopra ai campi */
.adm-card-side .form-item { padding-left: 0; }
.adm-card-side .form-item > label { float: none; display: block; width: auto; margin: 0 0 4px; padding-top: 0; text-align: left; }
.adm-card-side .adm-checks .form-item { display: flex; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 10px; }
.adm-card-side .adm-checks .form-item > label { margin: 0; color: $adm-text; }
.adm-card-side .adm-checks input[type=checkbox] { margin-top: 0; }

/* upload con anteprima */
.adm-upload { max-width: 340px; }
.adm-content .adm-upload input[type=file] { display: block; width: 100% !important; }
.adm-upload-preview { display: flex; align-items: center; justify-content: center; height: 260px; padding: 8px; border: 1px dashed #D5DBE1; border-radius: 10px; background: #F8FAFB; overflow: hidden; }
.adm-upload-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.adm-upload-empty { color: $adm-muted; font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.adm-upload-info { margin: 6px 0 10px; min-height: 1.3em; color: $adm-muted; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.adm-upload-info.is-new { color: #8A5A00; font-weight: 600; }
.adm-upload-info.is-error { color: #B42318; font-weight: 600; }
.adm-url-preview img { display: block; max-width: 340px; max-height: 200px; margin-top: 8px; border: 1px solid $adm-border; border-radius: 10px; }
.adm-url-preview img[hidden] { display: none; }

/* traduzioni: stessi campi del resto della scheda */
.cp-trans { margin-bottom: 22px; padding: 18px 20px 8px; border: 1px solid $adm-border; border-radius: 14px; background: #fff; }
.adm-content form:has(> .form-item) > .cp-trans { margin: 20px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid $adm-border; border-radius: 0; }
.cp-trans h5 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: $adm-text; }
.cp-trans .tr-help { color: $adm-muted; font-size: 13px; margin-bottom: 12px; }
.cp-trans .tr-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 5px; }
.cp-trans .tab-content { padding-top: 16px; }
.cp-trans .tr-source { max-width: 720px; margin-top: 3px; color: $adm-muted; font-size: 12px; line-height: 1.3; }
.cp-trans .tr-toolbar { margin-bottom: 14px; padding-left: $adm-label-w + $adm-label-gap; }

@media (max-width: 767.98px) {
	.adm-content .form-item { padding-left: 0; }
	.adm-content .form-item > label { float: none; display: block; width: auto; margin: 0 0 4px; padding-top: 0; text-align: left; }
	.cp-trans .tr-toolbar { padding-left: 0; }
}


/* =====================================================================
   ORDINI
   ===================================================================== */
.adm-sub { color: $adm-muted; font-size: 12px; line-height: 1.35; }
.adm-sub span { white-space: nowrap; }
.adm-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #C9C2B0; }
.adm-dot--ok { background: #2F855A; }
.adm-dot--warn { background: $adm-accent; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-pagehead h1 .badge { margin-left: 10px; vertical-align: middle; }

/* schede di stato con conteggi */
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.adm-tab { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border: 1px solid $adm-border; border-radius: 999px; background: #fff; color: $adm-text !important; font-size: 13px; font-weight: 500; line-height: 1.35; }
.adm-tab .adm-badge { min-width: 22px; padding: 0 7px; font-size: 11px; line-height: 1.5; }
.adm-tab:hover { background: #F7F9FA; }
.adm-tab i { color: $adm-muted; font-size: 12px; }
.adm-tab.active { background: $adm-green; border-color: $adm-green; color: #fff !important; }
.adm-tab.active i { color: #fff; }
.adm-tab.active .adm-badge { background: rgba(255,255,255,.2); color: #fff; }
.adm-tab--warn:not(.active) .adm-badge { background: #FFF3DC; color: #B7791F; }

/* barra azioni + ricerca */
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.adm-toolbar-group select { min-width: 260px; }
.adm-toolbar-search { position: relative; flex: 1 1 280px; max-width: 460px; }
.adm-toolbar-search > i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: $adm-muted; font-size: 13px; pointer-events: none; }
.adm-toolbar-search input { padding-left: 34px; padding-right: 30px; width: 100% !important; }
.adm-toolbar-clear { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); color: $adm-muted !important; }

/* tabella ordini */
.adm-orders td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.adm-orders .checkbox-cell { padding-top: 12px; }
.adm-orders .adm-order-num a { font-weight: 600; }
.adm-orders .adm-order-num .adm-gift { margin-left: 4px; font-size: 1em; }
.adm-orders .adm-row-actions { vertical-align: middle; }
.adm-orders tr.adm-row-link { cursor: pointer; }
.adm-orders .order-status { white-space: nowrap; }
@media (max-width: 991.98px) { .adm-orders .optional { display: none; } }
@media (max-width: 575.98px) {
	.adm-orders > :not(caption) > * > * { padding-left: 6px; padding-right: 6px; }
	.adm-orders { table-layout: fixed; }
	.adm-orders .select-checkbox, .adm-orders .checkbox-cell { width: 34px; }
	.adm-orders .adm-row-actions { width: 76px !important; }
	.adm-orders .adm-row-actions .btn-group > .btn:nth-child(2) { display: none; }
	.adm-orders .adm-row-actions .btn-group > .btn:first-child { border-radius: 8px 0 0 8px; }
	.adm-toolbar-group select { min-width: 0; width: 100%; }
}

/* dettaglio ordine */
.adm-order-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; align-items: stretch; }
@media (max-width: 991px) { .adm-order-grid { grid-template-columns: minmax(0, 1fr); } }
.adm-order-grid > .adm-span-2 { grid-column: span 2; }
@media (max-width: 991px) { .adm-order-grid > .adm-span-2 { grid-column: auto; } }
.adm-kv--tight { padding: 0; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 12px; }
.adm-icon-btn { border: 0; background: transparent; color: $adm-muted; padding: 4px 7px; border-radius: 6px; cursor: pointer; }
.adm-icon-btn:hover, .adm-icon-btn:focus-visible { background: $adm-bg; color: $adm-text; }
.adm-plref-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.adm-plref-edit { margin-top: 8px; padding: 10px; background: $adm-bg; border: 1px solid $adm-border; border-radius: 10px; }
.adm-plref-edit .adm-sub { margin-top: 6px; }
.adm-plref-edit input[type=text] { width: 15em !important; max-width: 100%; }
.adm-pl-strip { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px 28px; padding: 18px 20px; align-items: start; }
.adm-pl-col { min-width: 0; }
.adm-pl-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: $adm-muted; margin-bottom: 6px; }
.adm-pl-history { margin: 0; padding-left: 16px; font-size: 13px; color: $adm-muted; }
@media (max-width: 991px) { .adm-pl-strip { grid-template-columns: minmax(0, 1fr); } }
.adm-card-head h2 i { margin-right: 8px; color: $adm-muted; font-size: 14px; }
.adm-card--gift { border-color: #F1D9A3; }
.adm-card--gift .adm-card-head { background: #FFF8EA; }
.adm-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 16px; margin: 0; padding: 18px 20px; }
.adm-kv dt { color: $adm-muted; font-weight: 500; }
.adm-kv dd { margin: 0; overflow-wrap: anywhere; }
.adm-kv dd p { margin: 0 0 6px; }
.adm-quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; padding: 12px 16px; background: #fff; border: 1px solid $adm-border; border-radius: 12px; }
.adm-quick-actions .adm-sub { margin-right: 4px; }
.adm-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.adm-inline-form input[type=text] { width: 190px !important; }
.adm-thumb { width: 44px; height: 44px; object-fit: contain; border: 1px solid $adm-border; border-radius: 8px; background: #fff; }
.adm-order-items td { vertical-align: middle; }
.adm-order-items .adm-total-row td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; color: $adm-muted; }
.adm-order-items .adm-total-row:first-of-type td, .adm-order-items tr:has(+ .adm-total-row) td { border-bottom: 1px solid $adm-border; }
.adm-order-items .adm-total-row--grand td { padding-top: 10px; padding-bottom: 12px; color: $adm-text; font-size: 16px; font-weight: 700; border-top: 1px solid $adm-border; }
.adm-content .adm-card > table.table { border: 0; border-radius: 0; }
@media (max-width: 575.98px) { .adm-kv { grid-template-columns: 1fr; gap: 2px 0; } .adm-kv dd { margin-bottom: 8px; } }

// ---------------------------------------------------------------------
// Pagine di ordinamento (trascina per ordinare): layouts/admin/_order_list
// Stessi colori del resto dell'admin: testo scuro su sfondo chiaro, voci nascoste in grigio.
// ---------------------------------------------------------------------
.adm-order { max-width: 640px; margin: 8px 0 28px; }
.adm-order-legend { display: flex; gap: 18px; margin-bottom: 12px; font-size: 12px; color: $adm-muted; }
.adm-order-dot { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 50%; background: #fff; border: 2px solid $adm-accent; vertical-align: -1px; }
.adm-order-dot--hidden { background: #E9EDF1; border-color: #B8C1CC; }
.adm-order-status { position: sticky; top: $adm-top-h + 10px; z-index: 5; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.adm-order-status[hidden] { display: none; }
.adm-order-status.is-saving { background: #FFF7E3; border-color: #F0D9A0; color: #6B4E0A; }
.adm-order-status.is-saved { background: #EAF6EE; border-color: #BFE0C9; color: #1E6B3A; }
.adm-order-status.is-error { background: #FDECEA; border-color: #F3C1BC; color: #9B2C20; }

.sortable-list { margin: 0; padding: 0; list-style: none; }
.sortable-list li {
	position: relative;
	margin: 0 0 8px;
	padding: 11px 16px 11px 42px;
	background: #fff;
	color: $adm-text;
	border: 1px solid $adm-border;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.35;
	cursor: grab;
	user-select: none;
	transition: border-color .12s, box-shadow .12s;
}
// maniglia di trascinamento
.sortable-list li::before {
	content: "\f58e"; // fa-grip-vertical
	font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
	font-weight: 900;
	position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
	color: #A9B3BE; font-size: 14px;
}
.sortable-list li:hover { border-color: $adm-accent; box-shadow: 0 1px 6px rgba(31, 41, 51, .08); }
.sortable-list li:hover::before { color: $adm-accent; }

// voci nascoste: grigio chiaro, testo attenuato (ancora leggibile) e etichetta
.sortable-list li.hidden-item { background: #F4F6F8; color: #5B6673; }
.sortable-list li.hidden-item::after {
	content: "NASCOSTO";
	position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
	padding: 2px 8px; border-radius: 999px; background: #E3E8ED; color: #5B6673;
	font-size: 10px; font-weight: 700; letter-spacing: .06em;
}

// durante il trascinamento
.sortable-list li.ui-sortable-helper { cursor: grabbing; border-color: $adm-accent; box-shadow: 0 8px 24px rgba(31, 41, 51, .18); }
.sortable-list li.sortable-placeholder { visibility: visible !important; background: #FFF7E3; border: 2px dashed $adm-accent; box-shadow: none; }
.sortable-list li.sortable-placeholder::before, .sortable-list li.sortable-placeholder::after { content: none; }
.adm-order-empty { padding: 18px; border: 1px dashed $adm-border; border-radius: 10px; background: #fff; color: $adm-muted; text-align: center; }

// pulsante "Svuota cache" nel menu laterale: un <button> in un form, con l'aspetto degli altri link
.adm-nav-form { margin: 0; }
.adm-nav-action { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font-family: inherit; }
.adm-nav-action span { flex: 1; }
.adm-nav-action:focus-visible { outline: 2px solid $adm-accent; outline-offset: -2px; }

// miniatura della foto nell'elenco prodotti
.adm-content .table td.adm-thumb-cell, .adm-content .table th.adm-thumb-cell { width: 56px; padding-right: 4px; }
.adm-thumb { display: block; width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid $adm-border; }
.adm-thumb--empty { display: flex; align-items: center; justify-content: center; color: #A9B3BE; background: #F4F6F8; font-size: 16px; }

