* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #F3F4F6;
    color: #111827;
}

/* --- Layout a due colonne: sidebar fissa a sinistra + contenuto --- */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #111827;
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    font-weight: bold;
    font-size: 15px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #1F2937;
}

.sidebar-client {
    padding: 14px 20px;
    border-bottom: 1px solid #1F2937;
}
.sidebar-client-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #6B7280;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}
.sidebar-client-name {
    font-size: 13px;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 6px;
    word-break: break-word;
}
.sidebar-client-switch {
    font-size: 11px;
    color: #9CA3AF;
    text-decoration: none;
}
.sidebar-client-switch:hover { color: white; }

.sidebar-links {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}
.sidebar-links a {
    color: #D1D5DB;
    text-decoration: none;
    font-size: 14px;
    padding: 10px 20px;
    border-left: 3px solid transparent;
}
.sidebar-links a:hover {
    color: white;
    background: #1F2937;
    border-left-color: #2563EB;
}

.sidebar-user {
    padding: 14px 20px;
    border-top: 1px solid #1F2937;
}
.sidebar-user-email {
    font-size: 11px;
    color: #9CA3AF;
    margin-bottom: 6px;
    word-break: break-word;
}
.sidebar-logout {
    font-size: 12px;
    color: #D1D5DB;
    text-decoration: none;
}
.sidebar-logout:hover { color: white; }

.container { flex: 1; max-width: 1100px; padding: 28px 40px; overflow-x: auto; }

h1 { font-size: 22px; margin-bottom: 6px; }
h2 { font-size: 16px; margin: 20px 0 10px; color: #374151; }
.page-subtitle { color: #6B7280; font-size: 13px; margin-bottom: 20px; }

/* --- Cards / stat grid --- */
.stat-grid { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-width: 140px;
    flex: 1;
}
.stat-card .stat-value { font-size: 26px; font-weight: bold; }
.stat-card .stat-label { font-size: 12px; color: #6B7280; text-transform: uppercase; margin-top: 4px; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
th { background: #1F2937; color: white; text-align: left; padding: 10px 14px; font-size: 12px; text-transform: uppercase; }
td { padding: 10px 14px; border-bottom: 1px solid #E5E7EB; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9FAFB; }
a.row-link { color: #111827; text-decoration: none; font-weight: 500; }
a.row-link:hover { text-decoration: underline; }

/* --- Badges --- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 10px; font-weight: bold; color: white; }
.badge-critical { background: #B91C1C; }
.badge-high { background: #EA580C; }
.badge-medium { background: #D97706; }
.badge-low { background: #65A30D; }
.badge-info { background: #6B7280; }

.badge-status-pending, .badge-status-discovering, .badge-status-scanning, .badge-status-parsing { background: #2563EB; }
.badge-status-completed { background: #16A34A; }
.badge-status-failed { background: #B91C1C; }

.badge-ok { background: #16A34A; }
.badge-warn { background: #B91C1C; }

/* --- Forms & buttons --- */
form.form-box { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); max-width: 480px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: #374151; }
.form-group input, .form-group select {
    width: 100%; padding: 8px 10px; border: 1px solid #D1D5DB; border-radius: 6px; font-size: 13px;
}

.btn {
    display: inline-block;
    background: #111827;
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #1F2937; }
.btn-secondary { background: #E5E7EB; color: #111827; }
.btn-secondary:hover { background: #D1D5DB; }

.alert-box { background: #FEF2F2; border-left: 3px solid #B91C1C; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }

.filter-bar { margin-bottom: 14px; }
.filter-bar a { margin-right: 10px; font-size: 12px; color: #6B7280; text-decoration: none; }
.filter-bar a.active { color: #111827; font-weight: bold; }

.empty-state { color: #9CA3AF; font-size: 13px; padding: 20px; text-align: center; }
