/* Cruscotto WP — stile base (Bootstrap 5.3 + Open Sans), chiaro e scuro */
:root {
	--cr-sidebar-w: 240px;
	--cr-sidebar-bg: #1d3b66;
	--cr-sidebar-fg: rgba(255, 255, 255, .78);
	--cr-sidebar-active: rgba(255, 255, 255, .12);
	--cr-topbar-h: 56px;
}
html, body { height: 100%; }
body { font-family: 'Open Sans', system-ui, -apple-system, sans-serif; font-size: .925rem; }
.min-width-0 { min-width: 0; }

/* Struttura */
.cr-wrapper { display: flex; min-height: 100vh; }
.cr-sidebar {
	width: var(--cr-sidebar-w); flex: 0 0 var(--cr-sidebar-w); background: var(--cr-sidebar-bg); color: var(--cr-sidebar-fg);
	display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; transition: width .2s, flex-basis .2s;
}
html.sidebar-closed .cr-sidebar { width: 0; flex-basis: 0; }
.cr-brand { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.cr-brand-logo { height: 28px; }
.cr-nav { padding: .25rem .5rem; }
.cr-nav .nav-link { color: var(--cr-sidebar-fg); border-radius: .5rem; padding: .55rem .8rem; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.cr-nav .nav-link:hover { background: var(--cr-sidebar-active); color: #fff; }
.cr-nav .nav-link.active { background: var(--cr-sidebar-active); color: #fff; font-weight: 600; }
.cr-nav .nav-link.disabled { opacity: .5; }
.cr-nav .nav-link .badge { background: rgba(255, 255, 255, .18); font-weight: 500; }
.cr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--bs-body-bg); }
.cr-topbar {
	height: var(--cr-topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem;
	border-bottom: 1px solid var(--bs-border-color); background: var(--bs-body-bg); position: sticky; top: 0; z-index: 1020;
}
.cr-topbar-user { text-decoration: none; }
.cr-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--cr-sidebar-bg); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }
.cr-content { padding: 1.25rem; flex: 1 1 auto; }
.cr-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 1.25rem; border-top: 1px solid var(--bs-border-color); font-size: .8rem; }

/* Mobile: sidebar off-canvas */
.cr-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1029; }
@media (max-width: 991.98px) {
	.cr-sidebar { position: fixed; left: 0; top: 0; z-index: 1030; transform: translateX(-100%); transition: transform .2s; width: var(--cr-sidebar-w) !important; flex-basis: var(--cr-sidebar-w) !important; }
	body.sidebar-open .cr-sidebar { transform: none; }
	body.sidebar-open .cr-sidebar-backdrop { display: block; }
	.cr-content { padding: 1rem; }
}

/* Card statistiche */
.cr-stat .cr-stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); }
.cr-stat .cr-stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin-top: .15rem; }
.cr-list-compact .list-group-item { padding: .5rem .9rem; }

/* Form guidato */
.cr-form-guided .card-header { font-size: .95rem; }
.cr-steps { padding-left: 1.25rem; }
.cr-steps li { margin-bottom: 1rem; }
.cr-steps li:last-child { margin-bottom: 0; }

/* Login */
.cr-auth-body { background: linear-gradient(160deg, #1d3b66 0%, #0f1f38 100%); }

/* Tema scuro */
[data-bs-theme="dark"] .cr-topbar { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .table-warning { --bs-table-bg: rgba(255, 193, 7, .12); color: inherit; }

/* Segnalazioni */
.cr-check { border-left: 3px solid transparent; }
.cr-check-danger { border-left-color: var(--bs-danger); }
.cr-check-warning { border-left-color: var(--bs-warning); }
.cr-check-info { border-left-color: var(--bs-info); }
.cr-toggle { line-height: 1; }
.cr-toggle:hover i { filter: brightness(1.2); }
.cr-plugin-actions form { vertical-align: middle; }
.cr-plugin-actions .btn { font-size: 1rem; line-height: 1; }
