/* ============================================================
   Nexim Voice AI — pannello: stile minimal, leggibile, no-build.
   ============================================================ */

:root {
	--bg: #f5f6f8;
	--bg-card: #ffffff;
	--text: #1c1f24;
	--muted: #6b7280;
	--border: #e5e7eb;
	--brand: #0a4cff;
	--brand-dark: #0033bb;
	--ok: #16a34a;
	--warn: #d97706;
	--err: #dc2626;
	--info: #2563eb;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(20,30,60,.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small.muted, p.muted, .muted { color: var(--muted); }
.center { text-align: center; }

/* Topbar / nav */
.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 12px 24px;
	background: var(--bg-card);
	border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: 8px;
	background: var(--brand); color: white; font-weight: 700;
}
.brand .title, .brand h1 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.topnav { display: flex; gap: 14px; flex-wrap: wrap; }
.topnav a {
	color: var(--text);
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 0.92rem;
}
.topnav a:hover { background: #eef2ff; text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.btn-link { color: var(--brand); }

/* Layout */
.content { max-width: 1100px; margin: 28px auto; padding: 0 24px; }
.footer { text-align: center; color: var(--muted); padding: 24px; }

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.25rem; margin: 24px 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }

/* Card grid */
.grid { display: grid; gap: 16px; margin-top: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
	box-shadow: var(--shadow);
	color: var(--text);
	display: block;
}
.card:hover { border-color: var(--brand); text-decoration: none; }
.card p { color: var(--muted); font-size: 0.92rem; margin: 4px 0 12px; }

/* Badges */
.badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}
.badge-ok   { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err  { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }
.form input, .form select, .form textarea {
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 0.95rem;
	background: white;
	color: var(--text);
}
.form input:focus, .form select:focus, .form textarea:focus {
	outline: 2px solid #c7d2fe;
	border-color: var(--brand);
}

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 10px 16px;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: white;
	color: var(--text);
	font-size: 0.95rem;
	font-weight: 500;
	cursor: pointer;
}
.btn:hover { background: #f9fafb; }
.btn-primary {
	background: var(--brand);
	border-color: var(--brand);
	color: white;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }

/* Alerts */
.alert {
	padding: 10px 12px;
	border-radius: 8px;
	margin: 12px 0;
	font-size: 0.92rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warn  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Auth page */
.auth-bg {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eef2ff 0%, #f5f6f8 100%);
}
.auth-card {
	width: min(380px, 92vw);
	background: var(--bg-card);
	border-radius: var(--radius);
	padding: 28px;
	box-shadow: 0 12px 40px rgba(20,30,60,.08);
}
.auth-card .brand { justify-content: center; }

/* Tabella semplice */
table.simple {
	width: 100%;
	border-collapse: collapse;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}
table.simple th, table.simple td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid var(--border);
	font-size: 0.92rem;
}
table.simple th { background: #f9fafb; color: var(--muted); font-weight: 500; }
table.simple tr:last-child td { border-bottom: 0; }

/* Inline test result */
.test-result {
	margin-left: 10px;
	font-size: 0.85rem;
	font-weight: 500;
}
.test-result.ok  { color: var(--ok); }
.test-result.err { color: var(--err); }
.test-result.loading { color: var(--muted); }
