:root {
	--wbc-primary: #2271b1;
	--wbc-bg: #f0f0f1;
	--wbc-border: #dcdcde;
	--wbc-text: #1d2327;
	--wbc-muted: #646970;
	--wbc-success: #00a32a;
	--wbc-error: #d63638;
}

* { box-sizing: border-box; }

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: var(--wbc-bg);
	color: var(--wbc-text);
	margin: 0;
}

.wbc-nav {
	background: #1d2327;
	color: #fff;
	padding: 0 20px;
	display: flex;
	align-items: center;
	gap: 20px;
	height: 48px;
}

.wbc-nav a {
	color: #f0f0f1;
	text-decoration: none;
	font-size: 14px;
}

.wbc-nav a:hover { color: #72aee6; }

.wbc-nav .wbc-nav-title { font-weight: 600; margin-right: 20px; }
.wbc-nav .wbc-nav-spacer { flex: 1; }

.wbc-container {
	max-width: 1100px;
	margin: 30px auto;
	padding: 0 20px;
}

.wbc-card {
	background: #fff;
	border: 1px solid var(--wbc-border);
	border-radius: 6px;
	padding: 20px;
	margin-bottom: 20px;
}

table.wbc-table {
	width: 100%;
	border-collapse: collapse;
}

table.wbc-table th, table.wbc-table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--wbc-border);
	font-size: 14px;
}

table.wbc-table th { color: var(--wbc-muted); font-weight: 600; }

.wbc-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
}

.wbc-badge-completed { background: #edfaef; color: var(--wbc-success); }
.wbc-badge-failed { background: #fcf0f1; color: var(--wbc-error); }
.wbc-badge-running { background: #eaf2fa; color: var(--wbc-primary); }
.wbc-badge-off { background: #f0f0f1; color: var(--wbc-muted); }

/* Barra di avanzamento mostrata sotto il badge "in corso" nella dashboard. */
.wbc-progress {
	margin-top: 6px;
	max-width: 240px;
}

.wbc-progress-track {
	background: #e4e6e8;
	border-radius: 8px;
	height: 10px;
	overflow: hidden;
	box-shadow: inset 0 1px 2px rgba( 0, 0, 0, .08 );
}

.wbc-progress-fill {
	background: var(--wbc-primary);
	height: 100%;
	border-radius: 8px;
	transition: width .6s ease;
	/* Le strisce diagonali in movimento comunicano "sta lavorando" anche
	   quando la percentuale resta ferma a lungo, come durante la
	   compressione di un sito con decine di migliaia di file. */
	background-image: linear-gradient(
		45deg,
		rgba( 255, 255, 255, .22 ) 25%, transparent 25%,
		transparent 50%, rgba( 255, 255, 255, .22 ) 50%,
		rgba( 255, 255, 255, .22 ) 75%, transparent 75%, transparent
	);
	background-size: 16px 16px;
	animation: wbc-progress-stripes 1s linear infinite;
}

@keyframes wbc-progress-stripes {
	from { background-position: 0 0; }
	to   { background-position: 16px 0; }
}

/* Colori per fase: il colpo d'occhio dice a che punto siamo senza leggere. */
.wbc-progress-db_dump .wbc-progress-fill   { background-color: #8e6bd4; }
.wbc-progress-file_scan .wbc-progress-fill { background-color: #2c9fd4; }
.wbc-progress-file_zip .wbc-progress-fill  { background-color: var(--wbc-primary); }
.wbc-progress-finalize .wbc-progress-fill  { background-color: var(--wbc-success); }

/* Rispetta chi ha chiesto al sistema di ridurre le animazioni. */
@media ( prefers-reduced-motion: reduce ) {
	.wbc-progress-fill { animation: none; }
	.wbc-progress-fill.wbc-progress-unknown { animation: none; width: 100% !important; opacity: .5; }
}

/* Quando la percentuale non e' ancora disponibile (il sito non l'ha
   comunicata) mostriamo una barra "indeterminata" che scorre, invece di una
   barra ferma a zero che sembrerebbe un backup bloccato. */
.wbc-progress-fill.wbc-progress-unknown {
	width: 35% !important;
	animation: wbc-progress-slide 1.6s ease-in-out infinite;
}

@keyframes wbc-progress-slide {
	0%   { margin-left: 0; }
	50%  { margin-left: 65%; }
	100% { margin-left: 0; }
}

.wbc-progress-label {
	font-size: 12px;
	color: var(--wbc-muted);
	margin-top: 4px;
}

.wbc-btn {
	display: inline-block;
	background: var(--wbc-primary);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
}

.wbc-btn.wbc-btn-secondary { background: #fff; color: var(--wbc-text); border: 1px solid var(--wbc-border); }
.wbc-btn.wbc-btn-danger { background: var(--wbc-error); }
.wbc-btn:disabled { opacity: 0.6; cursor: default; }

.wbc-field { margin-bottom: 16px; }
.wbc-field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.wbc-field input[type=text], .wbc-field input[type=password], .wbc-field input[type=number], .wbc-field input[type=url],
.wbc-field select, .wbc-field textarea {
	width: 100%;
	max-width: 420px;
	padding: 8px 10px;
	border: 1px solid var(--wbc-border);
	border-radius: 4px;
	font-size: 14px;
	background: #fff;
}

/* L'elenco delle esclusioni e' un percorso per riga: il testo a spaziatura
   fissa rende evidenti spazi accidentali e allineamenti, e i ritorni a capo
   vanno lasciati visibili. */
.wbc-field textarea {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	line-height: 1.5;
	resize: vertical;
	white-space: pre;
}
.wbc-field .wbc-description { color: var(--wbc-muted); font-size: 13px; margin-top: 4px; }
.wbc-field label.wbc-checkbox { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin-right: 16px; }

.wbc-notice {
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 20px;
	font-size: 14px;
}
.wbc-notice-success { background: #edfaef; color: var(--wbc-success); }
.wbc-notice-error { background: #fcf0f1; color: var(--wbc-error); }
.wbc-notice-warning { background: #fcf5e6; color: #8a5700; }

/* Scheda di manutenzione del sito */
.wbc-badge-update { background: #fcf5e6; color: #8a5700; }
.wbc-ok { color: var(--wbc-success); font-weight: 600; }
.wbc-ko { color: var(--wbc-error); font-weight: 600; }

.wbc-site-link { text-decoration: none; color: inherit; }
.wbc-site-link:hover { text-decoration: underline; }

/* --- Dashboard a schede -------------------------------------------------- */

.wbc-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.wbc-toolbar-stats { color: var(--wbc-muted); font-size: 14px; }

.wbc-search {
	flex: 1 1 220px;
	max-width: 320px;
	padding: 8px 12px;
	border: 1px solid var(--wbc-border);
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
}

.wbc-search:focus {
	outline: none;
	border-color: var(--wbc-primary);
	box-shadow: 0 0 0 2px rgba( 34, 113, 177, .15 );
}

/* auto-fill + minmax: il numero di colonne si adatta da solo alla larghezza
   disponibile, quindi la stessa regola copre desktop, tablet e telefono
   senza bisogno di media query per ogni soglia. */
.wbc-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 16px;
	margin-bottom: 24px;
}

.wbc-site {
	background: #fff;
	border: 1px solid var(--wbc-border);
	border-radius: 8px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wbc-site[hidden] { display: none; }

.wbc-site-head {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 16px;
	font-weight: 600;
}

.wbc-site-url {
	font-size: 12px;
	color: var(--wbc-muted);
	margin-top: -6px;
	word-break: break-all;
}

.wbc-site-state { min-height: 24px; }

.wbc-site-meta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 10px;
	margin: 0;
	font-size: 13px;
}

.wbc-site-meta dt { color: var(--wbc-muted); }
.wbc-site-meta dd { margin: 0; }

.wbc-site-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 4px;
}

.wbc-site-actions form { display: inline; }

/* Pallino con il numero di aggiornamenti disponibili. */
.wbc-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.wbc-dot-warn { background: #d63638; color: #fff; }
.wbc-dot-ok { background: #edfaef; color: var(--wbc-success); }

.wbc-no-results { margin: -8px 0 24px; }

/* Barra delle azioni multiple: compare solo quando c'e' una selezione. */
.wbc-select-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--wbc-muted);
	white-space: nowrap;
}

.wbc-bulk-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	background: #eaf2fa;
	border: 1px solid #bcd4ea;
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 14px;
	/* Resta visibile scorrendo l'elenco: con molti siti la selezione
	   avviene in fondo alla pagina e i pulsanti sarebbero fuori vista. */
	position: sticky;
	top: 8px;
	z-index: 5;
}

.wbc-bulk-bar[hidden] { display: none; }
.wbc-bulk-note { color: var(--wbc-muted); font-size: 13px; }

.wbc-pick { margin: 0; flex-shrink: 0; }

/* Su schermi stretti la tabella della cronologia ha troppe colonne: invece
   di comprimerla in modo illeggibile, la si fa scorrere lateralmente. */
.wbc-table-scroll { overflow-x: auto; }
.wbc-table-scroll .wbc-table { min-width: 640px; }

@media ( max-width: 600px ) {
	.wbc-toolbar { flex-direction: column; align-items: stretch; }
	.wbc-search { max-width: none; }
	.wbc-site-actions .wbc-btn { flex: 1; text-align: center; }
}

.wbc-login-box {
	max-width: 360px;
	margin: 80px auto;
	background: #fff;
	border: 1px solid var(--wbc-border);
	border-radius: 6px;
	padding: 30px;
}

.wbc-login-box h1 { font-size: 20px; margin-top: 0; }

.wbc-muted { color: var(--wbc-muted); font-size: 13px; }
