body { font-family: Arial, sans-serif; margin: 0; background: #f6f6f6; color: #222; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.app-header { background: #0f172a; color: #fff; }
.app-header a { color: #fff; margin-right: 12px; text-decoration: none; }
.app-main { padding: 16px 0; }
.user-menu { position: relative; margin-left: 12px; }
.user-menu[open] .user-menu__dropdown { display: block; }
.user-menu__btn { list-style: none; display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #fff; cursor: pointer; font: inherit; padding: 4px 8px; border-radius: 999px; line-height: 1; }
.user-menu__btn::-webkit-details-marker { display: none; }
.user-menu__btn:hover { background: rgba(255,255,255,0.12); }
.user-menu__avatar { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50% !important; background:#1f2937 !important; color:#fff; font-size:12px; flex: 0 0 34px; line-height: 1; overflow: hidden; }
.user-menu__name { color: #e5e7eb; font-size: 13px; }
.user-menu__caret { font-size: 12px; color: #cbd5e1; margin-left: 2px; }
.user-menu__dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: #0f172a; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; min-width: 210px; padding: 8px; display: none; z-index: 60; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.user-menu__dropdown a { display: block; padding: 8px 10px; border-radius: 8px; color: #e5e7eb; text-decoration: none; }
.user-menu__dropdown a:hover { background: rgba(255,255,255,0.08); }

@media (max-width: 768px) {
	.user-menu__name { display: none; }
	.user-menu__btn { padding: 2px 6px; }
	.user-menu__dropdown { min-width: 170px; }
}
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; margin-bottom: 22px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.grid > * { min-width: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.btn { display: inline-block; padding: 8px 12px; border-radius: 6px; background: #0ea5e9; color: #fff; text-decoration: none; border: 0; cursor: pointer; }
.btn.secondary { background: #64748b; }
.btn.danger { background: #ef4444; }
.btn-delete { background: #ef4444; }
.btn-edit { background: #f59e0b; }
.btn-disabled, .btn[aria-disabled="true"] { background: #e5e7eb !important; color: #888 !important; cursor: not-allowed; }
.muted { color: #6b7280; }
input, select, textarea { width: 100%; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
label { font-size: 12px; color: #475569; }

.card .btn { white-space: nowrap; }
.card form { margin: 0; }
.card .grid { gap: 12px; }

.clienti-toolbar { margin: 6px 0 14px; display: flex; justify-content: flex-end; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top-bar-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.input-search { min-width: 240px; }
.per-page { display: flex; align-items: center; gap: 6px; }
.clienti-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.clienti-table th, .clienti-table td { padding: 10px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; }
.azioni { display: flex; gap: 6px; flex-wrap: wrap; }
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 4px; flex-wrap: wrap; }
.list-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-count { margin: 0 8px; }

.badge-score { display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; font-size:.78rem; font-weight:600; }
.badge-cold { background:#e5e7eb; color:#111827; }
.badge-warm { background:#fef3c7; color:#92400e; }
.badge-hot  { background:#fee2e2; color:#991b1b; }
.row-cold { background: #fafafa; }
.row-warm { background: #fff7ed; }
.row-hot { background: #fef2f2; }
.score-num { font-weight:700; }
.workflow-tip { font-size:.85rem; color:#4b5563; }
.alert { padding:10px 12px; border-radius:8px; margin-bottom:12px; }
.alert.success { background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; }
.alert.error { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }

@media (max-width: 768px) {
	.grid { grid-template-columns: 1fr; }
	.card { padding: 12px; }
	.app-header .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
	.app-header nav { gap: 10px; }
	table { display: block; overflow-x: auto; }
	.btn { width: 100%; text-align: center; }
	.card h4 { font-size: 16px; }
	.card .btn { flex: 1 1 100%; }
	.card .btn + form { width: 100%; }
	.card .btn + form .btn { width: 100%; }
	.card form { width: 100%; }
	.modal-card .grid { grid-template-columns: 1fr; gap: 10px; }
	.modal-card textarea { min-height: 90px; }
	.clienti-toolbar { justify-content: stretch; }
	.top-bar { align-items: flex-start; }
	.top-bar-form { width: 100%; }
	.input-search { min-width: 0; flex: 1 1 100%; }
	.azioni { flex-direction: column; align-items: stretch; }
	.clienti-table { display: block; overflow-x: auto; }
	.list-meta, .list-footer { align-items: flex-start; }
}

@media (max-width: 480px) {
	.wrap { padding: 16px 12px; }
	.grid { gap: 12px; }
	.card { border-radius: 8px; }
	.modal { padding: 10px; }
	.modal-card { padding: 12px; border-radius: 10px; }
}

